接口对接
This commit is contained in:
parent
8e12de58b1
commit
83ffcf10c8
|
|
@ -7,8 +7,8 @@ export default {
|
||||||
uni.addInterceptor('request', {
|
uni.addInterceptor('request', {
|
||||||
invoke(args) {
|
invoke(args) {
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
args.url = 'https://www.opsoul.com' + args.url;
|
// args.url = 'https://www.opsoul.com' + args.url;
|
||||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
// args.url = 'http://10.45.137.214:80' + args.url;
|
// args.url = 'http://10.45.137.214:80' + args.url;
|
||||||
if (args.data) {
|
if (args.data) {
|
||||||
args.data.deptId = globalData.deptId;
|
args.data.deptId = globalData.deptId;
|
||||||
|
|
@ -248,7 +248,15 @@ export default {
|
||||||
},
|
},
|
||||||
async bindBankCard(params) {
|
async bindBankCard(params) {
|
||||||
let res = await uni.request({
|
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',
|
method: 'POST',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
curUserInfo: {}
|
curUserInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
if (this.curAccountType === '1') {
|
if (this.curAccountType === '1') {
|
||||||
let params = {
|
let params = {
|
||||||
...this.formData,
|
...this.formData,
|
||||||
customerId: this.curUserInfo.workerId
|
workerId: this.curUserInfo.workerId
|
||||||
}
|
}
|
||||||
let res = await this.$request.bindBankCard(params);
|
let res = await this.$request.bindBankCard(params);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,19 @@
|
||||||
<block slot="content">提现</block>
|
<block slot="content">提现</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="margin-lr-sm margin-tb-lg shadow-warp">
|
<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 @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>提现帐号绑定</view>
|
||||||
<view><text class="cuIcon-right"></text></view>
|
<view><text class="cuIcon-right"></text></view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="bg-white padding solid-bottom">
|
<view class="bg-white padding solid-bottom">
|
||||||
<view class="text-right text-lg">
|
<view class="text-right text-lg">
|
||||||
<text>可提现金额:</text>
|
<text>可提现金额:</text>
|
||||||
|
|
@ -49,10 +58,32 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
balance: '0.00',
|
balance: '0.00',
|
||||||
imgList: []
|
imgList: [],
|
||||||
|
curUserInfo: {},
|
||||||
|
bindBankCard: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.reloadData();
|
||||||
|
},
|
||||||
methods: {
|
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() {
|
bindAccount() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/my/bank-account-bind'
|
url: '/pages/my/bank-account-bind'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue