128 lines
2.9 KiB
Vue
128 lines
2.9 KiB
Vue
<template>
|
||
<view class="containerView">
|
||
<up-cell-group :border="false">
|
||
<up-cell title="收款人姓名">
|
||
<template #right-icon> <up-input border="none" v-model="data.zhiFuBaoName" placeholder="请输入支付宝收款人姓名"></up-input> </template>
|
||
</up-cell>
|
||
<up-cell title="支付宝账号">
|
||
<template #right-icon> <up-input border="none" v-model="data.zhiFuBao" placeholder="请输入要绑定的支付宝手机号"></up-input> </template>
|
||
</up-cell>
|
||
</up-cell-group>
|
||
<button class="confirm-btn" @click="toLogin"
|
||
:disabled="data.logining">绑定账户</button>
|
||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
|
||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款,请须知</view>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { reactive, nextTick, ref } from 'vue';
|
||
import { onReady,onLoad,onShow } from '@dcloudio/uni-app'
|
||
import { updateUser } from '@/api/me/withdraw.js';
|
||
import { commonType } from '@/api/init.js';
|
||
|
||
let data = reactive({
|
||
zhiFuBao: null,
|
||
zhiFuBaoName: null,
|
||
logining: false
|
||
})
|
||
|
||
onLoad(() => {
|
||
data.zhiFuBao = uni.getStorageSync('userInfo').zhiFuBao;
|
||
data.zhiFuBaoName = uni.getStorageSync('userInfo').zhiFuBaoName;
|
||
})
|
||
|
||
function inputChange(e) {
|
||
const key = e.currentTarget.dataset.key;
|
||
data[key] = e.detail.value;
|
||
}
|
||
|
||
async function toLogin() {
|
||
|
||
if (!data.zhiFuBaoName) {
|
||
uni.showToast({
|
||
title: '请设置收款人姓名',
|
||
icon: 'none'
|
||
})
|
||
} else if (!data.zhiFuBao) {
|
||
uni.showToast({
|
||
title: '请设置收款人支付宝账号',
|
||
icon: 'none'
|
||
})
|
||
} else {
|
||
data.logining = true
|
||
let res = await updateUser({
|
||
zhiFuBao: data.zhiFuBao,
|
||
certName: data.zhiFuBaoName,
|
||
})
|
||
if( res) {
|
||
data.logining = false
|
||
let userInfo = uni.getStorageSync('userInfo')
|
||
userInfo.zhiFuBao = data.zhiFuBao
|
||
userInfo.zhiFuBaoName = data.zhiFuBaoName
|
||
uni.setStorageSync('userInfo', userInfo)
|
||
uni.showToast({
|
||
title: '修改成功',
|
||
icon: 'none',
|
||
complete() {
|
||
setTimeout(function() {
|
||
uni.navigateBack();
|
||
}, 1000)
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
}
|
||
|
||
}
|
||
</script>
|
||
|
||
<style lang='scss'>
|
||
page {
|
||
background: #FFFFFF;
|
||
}
|
||
|
||
.containerView {
|
||
padding:30rpx;
|
||
position: relative;
|
||
width: 100%;
|
||
height: 100%;
|
||
overflow: hidden;
|
||
background: #ffffff;
|
||
}
|
||
|
||
.confirm-btn1 {
|
||
width: 300px;
|
||
height: 42px;
|
||
line-height: 42px;
|
||
border-radius: 30px;
|
||
margin-top: 70upx;
|
||
/* background: whitesmoke; */
|
||
background: #ff7581;
|
||
color: #FFFFFF;
|
||
font-size: 32rpx;
|
||
|
||
&:after {
|
||
border: none;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
.confirm-btn {
|
||
width: 300px;
|
||
height: 42px;
|
||
line-height: 42px;
|
||
border-radius: 30px;
|
||
margin-top: 70upx;
|
||
background: #ff7581;
|
||
color: #ffffff;
|
||
font-size: 32rpx;
|
||
border: none;
|
||
&:after {
|
||
border: none;
|
||
}
|
||
}
|
||
</style> |