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.
287 lines
7.7 KiB
287 lines
7.7 KiB
<template>
|
|
<view class="container">
|
|
<view class="head">
|
|
<view>
|
|
<uni-group mode="card">
|
|
<uni-icons type="paperplane-filled" size="20"></uni-icons><text class="textstyle">小贴士:</text><br/>
|
|
<text class="textstyle">1.为了您的资金安全及合规,体现将通过第三方支付提供安全通道实现。</text><br/>
|
|
<text class="textstyle">2.应银行监管要求,每人每月限额10万元,最多绑定4个收款账户。</text><br/>
|
|
<text class="textstyle">3.一旦提现成功,设置的收款账户不可更改。</text>
|
|
</uni-group>
|
|
</view>
|
|
<view>
|
|
<uni-group mode="card">
|
|
<uni-forms validate-trigger='blur' :modelValue="accountInfo" label-position="top" labelWidth="80" ref="form">
|
|
<uni-forms-item label="真实姓名" required name="name">
|
|
<uni-easyinput v-model="accountInfo.name" placeholder="请输入真实姓名" />
|
|
</uni-forms-item>
|
|
<uni-forms-item label="身份证号" required name="idNo">
|
|
<uni-easyinput v-model="accountInfo.idNo" placeholder="请输入身份证号" />
|
|
</uni-forms-item>
|
|
<uni-forms-item label="支付宝账号" required name="accountNo">
|
|
<uni-easyinput v-model="accountInfo.accountNo" placeholder="请输入支付宝账号" />
|
|
</uni-forms-item>
|
|
<uni-forms-item label="预留电话" required name="phone">
|
|
<uni-easyinput v-model="accountInfo.phone" placeholder="请输入预留电话" />
|
|
</uni-forms-item>
|
|
<!-- <uni-forms-item label="请选择" required>
|
|
|
|
</uni-forms-item> -->
|
|
</uni-forms>
|
|
</uni-group>
|
|
</view>
|
|
</view>
|
|
<view class="foot">
|
|
<view>
|
|
<button class="confirmBtn" size="default" @click="$noMultipleClicks(submitAccount)">确定添加</button>
|
|
</view>
|
|
<view>
|
|
<text class="textstyle">本人确认已同意并遵守<text class="specialText" @click="goto('/pages-userInfo/setting/compoSign')">《艺术家合作协议》</text> 及
|
|
<text class="specialText" @click="goto('/pages-userInfo/setting/secretSign')">《艺术家隐私协议》</text>的基础上,承诺已阅读并同意遵守<text class="specialText"
|
|
@click="goto('/pages-userInfo/setting/secretSign')">《共享经济合作合办协议》</text>,按照协议内容提供合法合规服务。</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getAccount,addCreatorAccount,
|
|
checkAccountExist,checkAccountUpToFour
|
|
} from '@/api/userInfo.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
userInfo: {},
|
|
existFlag: false,
|
|
upToFourFlag: false,
|
|
noClick:true, //防止重复提交
|
|
accountInfo:{
|
|
name:'',
|
|
idNo:'',
|
|
accountNo:'',
|
|
phone:''
|
|
},
|
|
rules: {
|
|
name: {
|
|
rules: [{
|
|
required: true,
|
|
errorMessage: '请输入姓名'
|
|
}, {
|
|
minLength: 2,
|
|
maxLength: 4,
|
|
errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符'
|
|
}]
|
|
},
|
|
idNo: {
|
|
rules: [{
|
|
required: true,
|
|
errorMessage: '请输入身份证号'
|
|
},{
|
|
pattern: '[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]',
|
|
errorMessage: '请输入正确的身份证号'
|
|
}]
|
|
},
|
|
accountNo: {
|
|
rules: [
|
|
{
|
|
required: true,
|
|
errorMessage: '请输入支付宝账号'
|
|
},
|
|
{
|
|
validateFunction: this.checkAccount,
|
|
}
|
|
]
|
|
},
|
|
phone: {
|
|
rules: [{
|
|
required: true,
|
|
errorMessage: '请输入手机号'
|
|
},
|
|
{
|
|
pattern: '^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$',
|
|
errorMessage: '请输入正确的手机号'
|
|
},
|
|
{
|
|
validateFunction: (data) => {
|
|
// 异步需要返回 Promise 对象
|
|
return new Promise((resolve, reject) => {
|
|
if (data.length = 11) {
|
|
resolve()
|
|
} else {
|
|
reject(new Error('手机号长度应为11个字符'))
|
|
}
|
|
})
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
}
|
|
},
|
|
mounted() {
|
|
//设置校验规则
|
|
this.$refs.form.setRules(this.rules);
|
|
},
|
|
created() {
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
if (!userInfo) {
|
|
console.log('havent userInfo')
|
|
uni.showModal({
|
|
content: '艺术家账户过期,请重新登录!',
|
|
showCancel: false,
|
|
success() {
|
|
//没有缓存则跳转登录页面
|
|
uni.reLaunch({
|
|
url: '/pages/login/login'
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
this.userInfo = userInfo;
|
|
console.log('have userInfo')
|
|
}
|
|
|
|
this.checkAccountUpToFour();
|
|
},
|
|
|
|
methods: {
|
|
//检查收款账户是否超过4个
|
|
async checkAccountUpToFour() {
|
|
const res = await checkAccountUpToFour(this.userInfo.id);
|
|
if (res.data.code === 200) {
|
|
if(res.data.data != true){
|
|
//不存在则放行,存在则提示
|
|
this.upToFourFlag = false;
|
|
console.log('status',this.upToFourFlag)
|
|
return;
|
|
}else{
|
|
this.upToFourFlag = true;
|
|
console.log('status',this.upToFourFlag)
|
|
}
|
|
} else {
|
|
uni.showModal({
|
|
content: '检查收款账户失败!',
|
|
showCancel: false
|
|
});
|
|
}
|
|
},
|
|
|
|
//检查艺术家收款账户是否存在
|
|
checkAccount(){
|
|
return new Promise((resolve, reject) => {
|
|
let that = this;
|
|
const param = {
|
|
creatorId: that.userInfo.id,
|
|
accountNo:that.accountInfo.accountNo
|
|
}
|
|
checkAccountExist(param).then(res => {
|
|
if (res.data.code === 200) {
|
|
if(res.data.data != true){
|
|
//不存在则放行,存在则提示
|
|
that.existFlag = false;
|
|
return;
|
|
}else{
|
|
that.existFlag = true;
|
|
return reject(new Error('该收款账户已存在'))
|
|
}
|
|
}else{
|
|
uni.showModal({
|
|
content: '检查收款账户失败!',
|
|
showCancel: false
|
|
});
|
|
}
|
|
});
|
|
});
|
|
},
|
|
|
|
//保存数据并跳转
|
|
submitAccount(){
|
|
let that = this;
|
|
if(that.existFlag == true){
|
|
uni.showModal({
|
|
content: '收款账户已存在!',
|
|
showCancel: false
|
|
});
|
|
}else{
|
|
if(that.upToFourFlag == true){
|
|
uni.showModal({
|
|
content: '绑定收款账户已达最大上限!',
|
|
showCancel: false,
|
|
success() {
|
|
uni.redirectTo({
|
|
url: '/pages-userInfo/creatorAccount/creatorAccount'
|
|
})
|
|
}
|
|
});
|
|
}else{
|
|
const param = {
|
|
creatorId: that.userInfo.id,
|
|
name: that.accountInfo.name,
|
|
idNo: that.accountInfo.idNo,
|
|
phone:that.accountInfo.phone,
|
|
accountNo:that.accountInfo.accountNo,
|
|
type: '2' //此处默认先添加为支付宝账户,后续微信支付了即可添加微信
|
|
}
|
|
//新增艺术家账户
|
|
addCreatorAccount(param).then(res => {
|
|
if (res.data.code === 200) {
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title:'添加成功!',
|
|
duration: 1500,
|
|
success() {
|
|
setTimeout(function () {
|
|
uni.redirectTo({
|
|
url: '/pages-userInfo/creatorAccount/creatorAccount'
|
|
})
|
|
}, 1500);
|
|
}
|
|
})
|
|
}else{
|
|
uni.showModal({
|
|
content: '添加收款账户失败!',
|
|
showCancel: false
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
},
|
|
|
|
//跳转到置顶路径
|
|
goto:function(url){
|
|
console.log('111111111111111111111')
|
|
// uni.navigateTo({
|
|
// url: url
|
|
// })
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="less">
|
|
.confirmBtn{
|
|
width: 710rpx;
|
|
height: 60rpx;
|
|
background-color: royalblue;
|
|
color: #ffffff;
|
|
font-size: 30rpx;
|
|
line-height: 62rpx;
|
|
border-radius: 17rpx;
|
|
margin-top:100rpx;
|
|
}
|
|
.foot{
|
|
margin-top:100rpx;
|
|
}
|
|
.textstyle{
|
|
font-size: 25rpx;
|
|
}
|
|
.specialText{
|
|
color: blue;
|
|
// display: inline-block;
|
|
font-size: 25rpx;
|
|
}
|
|
|
|
</style>
|
|
|