32 changed files with 1633 additions and 294 deletions
@ -0,0 +1,287 @@ |
|||||
|
<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> |
||||
@ -0,0 +1,190 @@ |
|||||
|
<template> |
||||
|
<view class="container"> |
||||
|
<view class="head"> |
||||
|
<uni-group mode="card" v-for="(item,index) in creatorAccountList" :key="index"> |
||||
|
<view class="slot-box">真实姓名:{{item.name}}</view> |
||||
|
<view class="slot-box">身份证号:{{item.idNo}}</view> |
||||
|
<view class="slot-box" v-if="item.type == '0'">微信账号:{{item.accountNo}}</view> |
||||
|
<view class="slot-box" v-if="item.type == '1'">银行卡账号:{{item.accountNo}}</view> |
||||
|
<view class="slot-box" v-if="item.type == '2'">支付宝账号:{{item.accountNo}}</view> |
||||
|
<view class="line-box"></view> |
||||
|
<view class="btn-box"> |
||||
|
<uni-tag :circle="true" text="设为默认" type="primary" v-if="item.isUse == '0'" class="btn" |
||||
|
@click="$noMultipleClicks(setDefault,item.id)" inverted="true"/> |
||||
|
<uni-tag :circle="true" text="删除" type="default" v-if="item.isUse == '0'" class="btn" |
||||
|
@click="$noMultipleClicks(delAccount,item.id)" inverted="true"/> |
||||
|
</view> |
||||
|
</uni-group> |
||||
|
</view> |
||||
|
<view class="foot"> |
||||
|
<button class="creatorAccountAddBtn" size="default" :loading="loadingFlag" @click="creatorAccountAdd('/pages-userInfo/creatorAccount/createAccount')">添加收款账户</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getCreatorAccount,deleteAccount,setDefaultAccountStatus |
||||
|
} from '@/api/userInfo.js' |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
creatorAccountList: [], |
||||
|
userInfo: {}, |
||||
|
type: 0, |
||||
|
noClick:true, //防止重复提交 |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
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.getCreatorAccount(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 查询艺术家账户列表 |
||||
|
async getCreatorAccount() { |
||||
|
let that = this; |
||||
|
const res = await getCreatorAccount(that.userInfo.id) |
||||
|
console.log('res', res) |
||||
|
if (res.data.code === 200) { |
||||
|
that.creatorAccountList.push(...res.data.data) |
||||
|
console.log('creatorAccountList', that.creatorAccountList) |
||||
|
} else { |
||||
|
uni.showModal({ |
||||
|
content: '获取艺术家账户列表数据加载失败!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//设置艺术家收款账户默认状态 |
||||
|
setDefault(id){ |
||||
|
let that = this; |
||||
|
const param = { |
||||
|
id: id, |
||||
|
status: '1', |
||||
|
creatorId: that.userInfo.id |
||||
|
} |
||||
|
setDefaultAccountStatus(param).then(res =>{ |
||||
|
if (res.data.code === 200) { |
||||
|
uni.showToast({ |
||||
|
title: '操作成功!', |
||||
|
duration: 2000, |
||||
|
mask: true, |
||||
|
success() { |
||||
|
//刷新 |
||||
|
setTimeout(() => { |
||||
|
uni.redirectTo({ |
||||
|
url: '/pages-userInfo/creatorAccount/creatorAccount' |
||||
|
}); |
||||
|
}, 1000) |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
uni.showModal({ |
||||
|
content: "设置艺术家收款账户默认状态失败!", |
||||
|
showCancel: false, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
//设为默认收款账户 |
||||
|
delAccount(id){ |
||||
|
uni.showModal({ |
||||
|
title: '提示', |
||||
|
content: '确认删除该收款账户?', |
||||
|
success(resp) { |
||||
|
if(resp.confirm){ |
||||
|
let that = this; |
||||
|
const ids = [] |
||||
|
ids.push(parseInt(id)) |
||||
|
deleteAccount(ids).then(res =>{ |
||||
|
if (res.data.code === 200) { |
||||
|
uni.showToast({ |
||||
|
title: '删除成功!', |
||||
|
duration: 2000, |
||||
|
mask: true, |
||||
|
success() { |
||||
|
//刷新 |
||||
|
setTimeout(() => { |
||||
|
uni.redirectTo({ |
||||
|
url: '/pages-userInfo/creatorAccount/creatorAccount' |
||||
|
}); |
||||
|
}, 2000) |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
uni.showModal({ |
||||
|
content: "删除收款账户失败!", |
||||
|
showCancel: false, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
creatorAccountAdd(url){ |
||||
|
uni.navigateTo({ |
||||
|
url: url |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less"> |
||||
|
.creatorAccountAddBtn{ |
||||
|
width: 710rpx; |
||||
|
height: 60rpx; |
||||
|
background-color: royalblue; |
||||
|
color: #ffffff; |
||||
|
font-size: 30rpx; |
||||
|
line-height: 62rpx; |
||||
|
border-radius: 17rpx; |
||||
|
margin-top:100rpx; |
||||
|
} |
||||
|
.foot{ |
||||
|
margin-top:630rpx; |
||||
|
} |
||||
|
.slot-box{ |
||||
|
font-size: 30rpx; |
||||
|
text-align: justify; |
||||
|
} |
||||
|
.line-box{ |
||||
|
border: 1rpx #B3B3B3 solid; |
||||
|
margin-top: 30rpx; |
||||
|
} |
||||
|
.btn-box{ |
||||
|
position: relative; |
||||
|
flex-direction: row; |
||||
|
justify-content: flex-end; |
||||
|
display: flex; |
||||
|
margin-left: 200rpx; |
||||
|
margin-top: 20rpx; |
||||
|
.btn{ |
||||
|
padding-left: 20rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -1,96 +1,451 @@ |
|||||
<template> |
<template> |
||||
<view class="container"> |
<view class="page-bg"> |
||||
钱包余额:{{userInfo.amt}} |
<view class="main-container"> |
||||
<button class="withdrawBtn" size="default" :loading="loadingFlag" @click="" :disabled="checkUpload">提现</button> |
<view class="tl-panel"> |
||||
<uni-list> |
<view class="tl-font-28-29">提现金额</view> |
||||
<uni-list-item title="管理收款账户" :show-extra-icon="true" :extra-icon="wallet" link to="/pages-userInfo/setting/compoSign"></uni-list-item> |
<view class="input-box"> |
||||
<uni-list-item title="提现记录" :show-extra-icon="true" :extra-icon="withlog" link to="/pages-userInfo/withdraw/withdrawLog"></uni-list-item> |
¥ <input type="text" placeholder="输入金额" placeholder-class="pch" |
||||
</uni-list> |
class="input-value" @blur="checkAmt()" value="" v-model="amt"/> |
||||
|
</view> |
||||
|
<view class="tl-font-28-9b">当前余额为¥{{userInfo.amt}} </view> |
||||
|
<view class="tl-font-28-9b">小贴士:提现金额不少于1元 </view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="tl-red tl-title-62" v-if="checkFlag == true">输入金额超过当前余额</view> |
||||
|
|
||||
|
<view class="tl-font-28-29 tl-title-60">选择提现至</view> |
||||
|
|
||||
|
<view class="tl-panel-2 tl-flex-row"> |
||||
|
<radio-group @change="radioChange"> |
||||
|
<label v-for="(item, index) in creatorAccountList" :key="index"> |
||||
|
<view class="withdrawBox"> |
||||
|
<view v-if="item.type == '0'"> |
||||
|
<image :src="payType[0].icon" class="tl-img-76"></image> |
||||
|
</view> |
||||
|
<view v-if="item.type == '1'"> |
||||
|
<image :src="payType[1].icon" class="tl-img-76"></image> |
||||
|
</view> |
||||
|
<view v-if="item.type == '2'"> |
||||
|
<image :src="payType[2].icon" class="tl-img-76"></image> |
||||
|
</view><!-- 0->微信 1->银行卡 2->支付宝 --> |
||||
|
<view class="tl-font-28-34 tl-name" v-if="item.type == '0'">{{payType[0].title}} {{item.accountNo}}</view> |
||||
|
<view class="tl-font-28-34 tl-name" v-if="item.type == '1'">{{payType[1].title}} {{item.accountNo}}</view> |
||||
|
<view class="tl-font-28-34 tl-name" v-if="item.type == '2'">{{payType[2].title}} {{item.accountNo}}</view> |
||||
|
<view> |
||||
|
<radio :value="item" color="#F2C827" :checked="item.isUse === '1'" class="radioStyle"/> |
||||
|
</view> |
||||
|
</view> |
||||
|
</label> |
||||
|
</radio-group> |
||||
|
</view> |
||||
|
<view class="tl-footer"> |
||||
|
<button class="tl-btn-686 tl-font-28-29" @click="$noMultipleClicks(withdraw)">提现</button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
</view> |
</view> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
import { |
||||
|
getWithdrawList,getCreatorAccount, |
||||
|
checkWithdraw,withdraw, |
||||
|
getCreatorInfo |
||||
|
} from '@/api/userInfo.js' |
||||
export default { |
export default { |
||||
data() { |
data() { |
||||
return { |
return { |
||||
|
amt: '', |
||||
userInfo: {}, |
userInfo: {}, |
||||
wallet: { |
checkFlag: false, |
||||
color:'#0000ff', |
noClick:true, //防止重复提交 |
||||
size: '22', |
creatorAccountList:[], |
||||
type: 'wallet' |
accountNo: '', |
||||
|
type: '', |
||||
|
current: 0, |
||||
|
payType: [{ |
||||
|
icon: '/static/wxPay.png', |
||||
|
title: '微信', |
||||
}, |
}, |
||||
withlog: { |
{ |
||||
color:'#0000ff', |
icon: '/static/wxPay.png', |
||||
size: '22', |
title: '银行卡', |
||||
type: 'compose' |
|
||||
}, |
}, |
||||
|
{ |
||||
|
icon: '/static/aliPay.png', |
||||
|
title: '支付宝', |
||||
|
}], |
||||
} |
} |
||||
|
|
||||
}, |
}, |
||||
created() { |
created() { |
||||
const userInfoSync = uni.getStorageSync('userInfo') |
const userInfo = uni.getStorageSync('userInfo') |
||||
this.userInfo = userInfoSync |
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.getCreatorAccount(); |
||||
|
} |
||||
|
|
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
targetToDetail(orderId) { |
// 查询艺术家账户列表 |
||||
console.log('orderId', orderId) |
async getCreatorAccount() { |
||||
if (orderId) { |
let that = this; |
||||
uni.navigateTo({ |
const res = await getCreatorAccount(that.userInfo.id) |
||||
url: 'withdrawDetail?orderId=' + orderId, |
console.log('res', res) |
||||
|
if (res.data.code === 200) { |
||||
|
that.creatorAccountList.push(...res.data.data) |
||||
|
for (let param of res.data.data) { |
||||
|
if(param.isUse === '1'){ |
||||
|
that.accountNo = param.accountNo; |
||||
|
that.type = param.type; |
||||
|
} |
||||
|
} |
||||
|
console.log('creatorAccountList', that.creatorAccountList) |
||||
|
} else { |
||||
|
uni.showModal({ |
||||
|
content: '获取艺术家账户列表数据加载失败!', |
||||
|
showCancel: false |
||||
}); |
}); |
||||
} |
} |
||||
}, |
}, |
||||
|
|
||||
|
radioChange: function(evt) { |
||||
|
console.log(JSON.stringify(evt.detail.value)); |
||||
|
let that = this; |
||||
|
that.type = evt.detail.value.type; |
||||
|
that.accountNo = evt.detail.value.accountNo; |
||||
|
console.log(that.type); |
||||
|
console.log(that.accountNo); |
||||
|
}, |
||||
|
|
||||
|
//检查是否超出余额 |
||||
|
checkAmt:function(){ |
||||
|
let that = this; |
||||
|
if(parseFloat(that.amt) > parseFloat(that.userInfo.amt)){ |
||||
|
that.checkFlag = true; |
||||
|
}else{ |
||||
|
that.checkFlag = false; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//提现 |
||||
|
async withdraw(){ |
||||
|
let that = this; |
||||
|
console.log('点击了提现,金额为',that.type) |
||||
|
if(that.amt == null || that.amt == ''){ |
||||
|
uni.showModal({ |
||||
|
content: '请输入提现金额!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
if(that.checkFlag == true){ |
||||
|
console.log('that.checkFlag',that.checkFlag) |
||||
|
uni.showModal({ |
||||
|
content: '输入金额超过可提现余额!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
}else{ |
||||
|
//校验服务器是否可以提现 |
||||
|
const param = { |
||||
|
creatorId: that.userInfo.id, |
||||
|
amt: that.amt |
||||
|
} |
||||
|
const checkRes = await checkWithdraw(param); |
||||
|
if(checkRes.data.code === 200){ |
||||
|
if(checkRes.data.data === true){ |
||||
|
//可提现 |
||||
|
const withdrawParam = { |
||||
|
creatorId: that.userInfo.id, |
||||
|
amt: that.amt, |
||||
|
accountNo: that.accountNo, |
||||
|
channel: that.type |
||||
|
} |
||||
|
const withdrawRes = await withdraw(withdrawParam); |
||||
|
if(withdrawRes.data.code === 200){ |
||||
|
//更新艺术家缓存 |
||||
|
const creatorInfo = await getCreatorInfo(that.userInfo.id); |
||||
|
console.log('creatorInfo',creatorInfo) |
||||
|
if(creatorInfo.data.code === 200){ |
||||
|
uni.setStorage({ |
||||
|
key: 'userInfo', |
||||
|
data: creatorInfo.data.data, |
||||
|
success() { |
||||
|
uni.showModal({ |
||||
|
title: '提示', |
||||
|
content: '发起提现成功,请等待审核!', |
||||
|
showCancel: false, |
||||
|
success() { |
||||
|
uni.reLaunch({ |
||||
|
url: '/pages-userInfo/withdraw/withdrawIndex' |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}) |
||||
|
}else{ |
||||
|
uni.showModal({ |
||||
|
content: '获取艺术家信息失败!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}else{ |
||||
|
uni.showModal({ |
||||
|
content: '发起提现申请失败!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
}else{ |
||||
|
//不可提现 |
||||
|
uni.showModal({ |
||||
|
content: '输入金额超过可提现余额!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
}else{ |
||||
|
uni.showModal({ |
||||
|
content: '检查艺术家是否可提现失败!', |
||||
|
showCancel: false |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
// await checkWithdraw(param).then(res =>{ |
||||
|
// if(res.data.code === 200){ |
||||
|
// if(res.data.data === true){ |
||||
|
// //可提现 |
||||
|
// const withdrawParam = { |
||||
|
// creatorId: that.userInfo.id, |
||||
|
// amt: that.amt, |
||||
|
// accountNo: that.accountNo, |
||||
|
// channel: that.type |
||||
|
// } |
||||
|
// await withdraw(withdrawParam).then(resp =>{ |
||||
|
// if(res.data.code === 200){ |
||||
|
// uni.showToast({ |
||||
|
// title: '发起提现成功,请等待审核!', |
||||
|
// duration: 2000, |
||||
|
// success() { |
||||
|
// uni.reLaunch({ |
||||
|
// url: '/pages-userInfo/withdraw/withdrawIndex' |
||||
|
// }); |
||||
|
// } |
||||
|
// }); |
||||
|
// }else{ |
||||
|
// uni.showModal({ |
||||
|
// content: '发起提现申请失败!', |
||||
|
// showCancel: false |
||||
|
// }); |
||||
|
// } |
||||
|
// }) |
||||
|
// }else{ |
||||
|
// //不可提现 |
||||
|
// uni.showModal({ |
||||
|
// content: '输入金额超过可提现余额!', |
||||
|
// showCancel: false |
||||
|
// }); |
||||
|
// } |
||||
|
// }else{ |
||||
|
// uni.showModal({ |
||||
|
// content: '检查艺术家是否可提现失败!', |
||||
|
// showCancel: false |
||||
|
// }); |
||||
|
// } |
||||
|
// }) |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss"> |
<style lang="scss"> |
||||
.withdrawBtn{ |
.page-bg { |
||||
width: 750rpx; |
width: 100vw; |
||||
height: 60rpx; |
height: 100vh; |
||||
background-color: royalblue; |
overflow: hidden; |
||||
color: #ffffff; |
background-size: 750rpx auto; |
||||
font-size: 30rpx; |
background-color: #F7F7F7; |
||||
line-height: 62rpx; |
|
||||
border-radius: 17rpx; |
|
||||
margin-top:100rpx; |
|
||||
} |
|
||||
.uni-list-item__icon-img { |
|
||||
border-radius: 16rpx; |
|
||||
} |
|
||||
.ivOver{ |
|
||||
width: 100%; |
|
||||
height:100rpx; |
|
||||
line-height: 100rpx; |
|
||||
text-align: center; |
|
||||
background: #fff; |
|
||||
font-size: 20rpx; |
|
||||
} |
} |
||||
.box { |
|
||||
|
.main-container { |
||||
|
width: 686rpx; |
||||
|
margin: 0 auto; |
||||
display: flex; |
display: flex; |
||||
padding-right: 16rpx; |
|
||||
flex: 1; |
|
||||
color: #3b4144; |
|
||||
flex-direction: column; |
flex-direction: column; |
||||
justify-content: center; |
margin-top: 36rpx; |
||||
overflow: hidden; |
} |
||||
|
.tl-panel{ |
||||
|
width: 686rpx; |
||||
|
height: 296rpx; |
||||
|
padding: 32rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
.tl-font-28-29{ |
||||
|
font-size: 28rpx; |
||||
|
font-family: PingFangSC-Regular, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #292929; |
||||
|
} |
||||
|
.tl-font-28-9b{ |
||||
|
font-size: 28rpx; |
||||
|
font-family: PingFangSC-Regular, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #9B9B9B; |
||||
|
margin-top: 18rpx; |
||||
} |
} |
||||
.box-bot { |
.tl-font-32-29{ |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFangSC-Regular, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #292929; |
||||
|
} |
||||
|
.input-box { |
||||
|
height: 100rpx; |
||||
|
width: 650rpx; |
||||
display: flex; |
display: flex; |
||||
margin-top: 10rpx; |
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
font-size: 60rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: bold; |
||||
|
color: #43413C; |
||||
|
opacity: 1; |
||||
|
border-bottom: 2rpx solid #E7E9EE;; |
||||
} |
} |
||||
.box-bot view { |
.input-box .input-value { |
||||
border-radius: 6rpx; |
flex: 1 auto; |
||||
border: 2rpx solid #4d6aff; |
margin-left: 10rpx; |
||||
padding: 4rpx 10rpx; |
height: 80rpx; |
||||
margin-right: 10rpx; |
|
||||
font-size: 24rpx; |
|
||||
} |
} |
||||
.uni-list-item__content-title { |
|
||||
|
.tl-flex-row{ |
||||
|
display: flex; |
||||
|
justify-content: space-around; |
||||
|
align-items: center; |
||||
|
flex-wrap: wrap; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.tl-panel-2{ |
||||
|
width: 686rpx; |
||||
|
padding: 32rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
.tl-title-60{ |
||||
|
margin: 30rpx 0 20rpx 0; |
||||
|
} |
||||
|
|
||||
|
.tl-title-62{ |
||||
|
margin: 25rpx 0 30rpx 0; |
||||
|
} |
||||
|
|
||||
|
.tl-panel-card{ |
||||
|
width: 194rpx; |
||||
|
height: 136rpx; |
||||
|
line-height: 136rpx; |
||||
|
background: #F7F7F7; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
.active{ |
||||
|
background: #FEF5DD; |
||||
|
border-radius: 8rpx; |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFangSC-Medium, PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: #F2C827; |
||||
|
} |
||||
|
|
||||
|
.tl-footer{ |
||||
|
margin-top: 120rpx; |
||||
|
} |
||||
|
.tl-btn-686{ |
||||
|
width: 686rpx; |
||||
|
height: 88rpx; |
||||
|
line-height: 88rpx; |
||||
|
background: #185dff; |
||||
|
border-radius: 8rpx; |
||||
|
color:white; |
||||
|
} |
||||
|
.tl-blue{ |
||||
font-size: 28rpx; |
font-size: 28rpx; |
||||
color: #3b4144; |
font-family: PingFangSC-Regular, PingFang SC; |
||||
overflow: hidden; |
font-weight: 400; |
||||
|
color: #2793F2; |
||||
|
} |
||||
|
|
||||
|
.tl-img-76{ |
||||
|
width: 76rpx; |
||||
|
height: 76rpx; |
||||
|
border-radius: 38rpx; |
||||
|
} |
||||
|
.tl-red{ |
||||
|
font-size: 24rpx; |
||||
|
font-family: PingFangSC-Regular, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #E04646; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/*** 模态框 ***/ |
||||
|
.tl-flex-row{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.tl-line-down{ |
||||
|
border-bottom: 2rpx solid #EAEAEA; |
||||
|
margin: 60rpx 0 20rpx 0; |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.tl-line-16{ |
||||
|
width: 748rpx; |
||||
|
height: 16rpx; |
||||
|
background: #F7F7F7; |
||||
|
} |
||||
|
.tl-font-60-02{ |
||||
|
font-size: 60rpx; |
||||
|
font-family: DINAlternate-Bold, DINAlternate; |
||||
|
font-weight: bold; |
||||
|
color: #020202; |
||||
|
} |
||||
|
.tl-font-24-9b{ |
||||
|
font-size: 24rpx; |
||||
|
font-family: PingFangSC-Regular, PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #9B9B9B; |
||||
|
} |
||||
|
.ml-12{ |
||||
|
margin-left: 12rpx; |
||||
|
} |
||||
|
|
||||
|
.tl-text{ |
||||
|
width: 450rpx; |
||||
|
display: -webkit-box; /*弹性伸缩盒子模型显示*/ |
||||
|
-webkit-box-orient: vertical; /*排列方式*/ |
||||
|
-webkit-line-clamp: 1; /*显示文本行数(这里控制多少行隐藏)*/ |
||||
|
overflow: hidden; /*溢出隐藏*/ |
||||
|
} |
||||
|
.withdrawBox{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
margin: 40rpx 40rpx 20rpx 10rpx; |
||||
|
} |
||||
|
.radioStyle{ |
||||
|
margin-left: 200rpx; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
|||||
@ -0,0 +1,111 @@ |
|||||
|
<template> |
||||
|
<view class="container"> |
||||
|
<view class="head"> |
||||
|
<uni-icons type="medal" size="50"/> |
||||
|
<view class="box"> |
||||
|
<text>钱包余额</text> |
||||
|
</view> |
||||
|
<view class="box"> |
||||
|
<text>¥{{userInfo.amt}}</text> |
||||
|
</view> |
||||
|
<button class="withdrawBtn" size="default" :loading="loadingFlag" @click="withdraw('/pages-userInfo/withdraw/withdraw')" :disabled="checkUpload">发起提现</button> |
||||
|
</view> |
||||
|
<view class="bottom"> |
||||
|
<uni-group mode="card"> |
||||
|
<uni-list> |
||||
|
<uni-list-item title="管理收款账户" :show-extra-icon="true" :extra-icon="wallet" link to="/pages-userInfo/creatorAccount/creatorAccount"></uni-list-item> |
||||
|
<uni-list-item title="提现记录" :show-extra-icon="true" :extra-icon="withlog" link to="/pages-userInfo/withdraw/withdrawLog"></uni-list-item> |
||||
|
</uni-list> |
||||
|
</uni-group> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
userInfo: {}, |
||||
|
wallet: { |
||||
|
color:'#0000ff', |
||||
|
size: '22', |
||||
|
type: 'wallet' |
||||
|
}, |
||||
|
withlog: { |
||||
|
color:'#0000ff', |
||||
|
size: '22', |
||||
|
type: 'compose' |
||||
|
}, |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
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') |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// targetToDetail(orderId) { |
||||
|
// console.log('orderId', orderId) |
||||
|
// if (orderId) { |
||||
|
// uni.navigateTo({ |
||||
|
// url: 'withdrawDetail?orderId=' + orderId, |
||||
|
// }); |
||||
|
// } |
||||
|
// }, |
||||
|
withdraw(url){ |
||||
|
uni.navigateTo({ |
||||
|
url: url |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.container{ |
||||
|
.head{ |
||||
|
margin-bottom: 50rpx; |
||||
|
text-align: center; |
||||
|
.box{ |
||||
|
//border:1px red solid; |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.withdrawBtn{ |
||||
|
width: 710rpx; |
||||
|
height: 60rpx; |
||||
|
background-color: royalblue; |
||||
|
color: #ffffff; |
||||
|
font-size: 30rpx; |
||||
|
line-height: 62rpx; |
||||
|
border-radius: 17rpx; |
||||
|
margin-top:100rpx; |
||||
|
} |
||||
|
.uni-list-item__icon-img { |
||||
|
border-radius: 16rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-list-item__content-title { |
||||
|
font-size: 28rpx; |
||||
|
color: #3b4144; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
</style> |
||||
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,24 @@ |
|||||
|
// 防止处理多次点击
|
||||
|
function noMultipleClicks(methods, info) { |
||||
|
// methods是需要点击后需要执行的函数, info是点击需要传的参数
|
||||
|
let that = this; |
||||
|
if (that.noClick) { |
||||
|
// 第一次点击
|
||||
|
that.noClick= false; |
||||
|
if(info && info !== '') { |
||||
|
// info是执行函数需要传的参数
|
||||
|
methods(info); |
||||
|
} else { |
||||
|
methods(); |
||||
|
} |
||||
|
setTimeout(()=> { |
||||
|
that.noClick= true; |
||||
|
}, 2000) |
||||
|
} else { |
||||
|
// 这里是重复点击的判断
|
||||
|
} |
||||
|
} |
||||
|
//导出
|
||||
|
export default { |
||||
|
noMultipleClicks,//禁止多次点击
|
||||
|
} |
||||
Loading…
Reference in new issue