接口对接
This commit is contained in:
parent
8e12de58b1
commit
83ffcf10c8
|
|
@ -7,8 +7,8 @@ export default {
|
|||
uni.addInterceptor('request', {
|
||||
invoke(args) {
|
||||
// request 触发前拼接 url
|
||||
args.url = 'https://www.opsoul.com' + args.url;
|
||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'https://www.opsoul.com' + args.url;
|
||||
args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://10.45.137.214:80' + args.url;
|
||||
if (args.data) {
|
||||
args.data.deptId = globalData.deptId;
|
||||
|
|
@ -248,7 +248,15 @@ export default {
|
|||
},
|
||||
async bindBankCard(params) {
|
||||
let res = await uni.request({
|
||||
url: '/customer/bankcard/bind',
|
||||
url: '/worker/bank/bind',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getBindBankCardByWorkerId(params) {
|
||||
let res = await uni.request({
|
||||
url: '/worker/bank/getByWorkerId',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
curUserInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
if (this.curAccountType === '1') {
|
||||
let params = {
|
||||
...this.formData,
|
||||
customerId: this.curUserInfo.workerId
|
||||
workerId: this.curUserInfo.workerId
|
||||
}
|
||||
let res = await this.$request.bindBankCard(params);
|
||||
if (res.code === 0) {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,18 @@
|
|||
<block slot="content">提现</block>
|
||||
</cu-custom>
|
||||
<view class="margin-lr-sm margin-tb-lg shadow-warp">
|
||||
<view class="bg-gray flex justify-between align-center text-xl padding" @click="bindAccount">
|
||||
<view>提现帐号绑定</view>
|
||||
<view><text class="cuIcon-right"></text></view>
|
||||
<view @click="bindAccount">
|
||||
<view v-if="bindBankCard && bindBankCard.bankNum" class="bg-gray flex justify-between align-center text-xl padding">
|
||||
<view>
|
||||
<text class="cu-tag bg-main-color light margin-right-sm">已绑定</text>
|
||||
<text>{{bindBankCard.encodeBankNum}}</text>
|
||||
</view>
|
||||
<view>帐号另绑<text class="cuIcon-right"></text></view>
|
||||
</view>
|
||||
<view v-else class="bg-gray flex justify-between align-center text-xl padding">
|
||||
<view>提现帐号绑定</view>
|
||||
<view><text class="cuIcon-right"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding solid-bottom">
|
||||
<view class="text-right text-lg">
|
||||
|
|
@ -49,10 +58,32 @@
|
|||
data() {
|
||||
return {
|
||||
balance: '0.00',
|
||||
imgList: []
|
||||
imgList: [],
|
||||
curUserInfo: {},
|
||||
bindBankCard: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
onShow() {
|
||||
this.reloadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.loadBindBankCard();
|
||||
},
|
||||
async reloadData() {
|
||||
this.loadBindBankCard();
|
||||
},
|
||||
async loadBindBankCard() {
|
||||
let res = await this.$request.getBindBankCardByWorkerId({
|
||||
workerId: this.curUserInfo.workerId
|
||||
});
|
||||
this.bindBankCard = res.data;
|
||||
this.bindBankCard.encodeBankNum = '****' + this.bindBankCard.bankNum.substring(this.bindBankCard.bankNum.length - 4);
|
||||
},
|
||||
bindAccount() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/bank-account-bind'
|
||||
|
|
|
|||
Loading…
Reference in New Issue