You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.3 KiB

3 years ago
<template>
<view class="container">
2 years ago
<uni-card :is-shadow="false" :border="false" padding="0" is-full>
3 years ago
<view class="form">
<view class="line">
<uni-data-checkbox v-model="myVal" :localdata="checkList" @change="myChange"></uni-data-checkbox>
3 years ago
<text>我的邮箱</text>
2 years ago
<uni-easyinput v-model="email" disabled />
3 years ago
</view>
<view class="line">
<uni-data-checkbox v-model="otherVal" :localdata="checkList" @change="otherChange"></uni-data-checkbox>
3 years ago
<text>其他邮箱</text>
2 years ago
<uni-easyinput v-model="otherEmail" placeholder="请输入其他邮箱" />
3 years ago
</view>
2 years ago
<button type="primary" @click="submit">确认</button>
3 years ago
</view>
</uni-card>
</view>
</template>
<script>
2 years ago
import { mailFileSend } from '@/apis/modules/parner.js'
import { my } from '@/apis/modules/parner.js'
3 years ago
export default {
data() {
return {
2 years ago
id: '',
email: '',
otherEmail: '',
myVal: 1,
2 years ago
otherVal: '',
checkList: [{
3 years ago
text: '',
value: 1
}],
2 years ago
files: [
'人工智能实验室建设方案-2020.1.docx',
'大数据管理与应用专业建设方案.docx',
'金融科技实验室建设方案V2.0.docx'
]
3 years ago
}
},
2 years ago
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.id = options.id
this.getInfo()
3 years ago
},
methods: {
2 years ago
// 获取个人信息
getInfo() {
const team = uni.getStorageSync('team')
my({
partnerId: team.partnerId,
teamId: team.teamId
}).then(({ my }) => {
this.email = my.info.email
}).catch(e => {})
},
myChange(e) {
this.otherVal = ''
},
otherChange(e) {
this.myVal = ''
3 years ago
},
2 years ago
// 提交
submit() {
const { otherEmail } = this
2 years ago
if (this.myVal && !this.email) return this.$util.errMsg('请选择其他邮箱!')
2 years ago
if (this.otherVal && !otherEmail) return this.$util.errMsg('请输入邮箱!')
mailFileSend({
copyWriting: this.files[this.id],
mail: this.myVal ? this.email : otherEmail
}).then(res => {
this.$util.sucMsg('发送成功!')
setTimeout(() => {
uni.navigateBack()
}, 1000)
}).catch(e => {})
3 years ago
},
}
}
</script>
<style scoped lang="scss">
.form {
padding: 15px;
background-color: #fff;
}
.line {
display: flex;
align-items: center;
margin-bottom: 15px;
text {
margin: 0 10px 0 -20px;
}
}
</style>