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.

101 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 />
2 years ago
<view class="bind" @click="$util.to('../email/email')">绑定</view>
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
url: '',
2 years ago
email: '',
otherEmail: '',
myVal: 1,
2 years ago
otherVal: '',
checkList: [{
3 years ago
text: '',
value: 1
}],
}
},
2 years ago
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
2 years ago
this.url = options.url
2 years ago
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({
2 years ago
copyWriting: this.url,
2 years ago
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;
}
}
2 years ago
.bind {
margin-left: 20rpx;
font-size: 26rpx;
color: #1f83ff;
white-space: nowrap;
}
3 years ago
</style>