接口对接
This commit is contained in:
parent
c749df3323
commit
6bb5de68be
|
|
@ -6,9 +6,9 @@ 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://10.45.110.67:80' + args.url;
|
// args.url = 'http://10.45.110.67:80' + args.url;
|
||||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
if (args.data) {
|
if (args.data) {
|
||||||
args.data.deptId = globalData.deptId;
|
args.data.deptId = globalData.deptId;
|
||||||
args.data.from = globalData.from;
|
args.data.from = globalData.from;
|
||||||
|
|
@ -328,5 +328,13 @@ export default {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
return res[1].data;
|
return res[1].data;
|
||||||
|
},
|
||||||
|
async getBindBankCardByCustomerId(params) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/customer/bankcard/getByCustomerId',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,11 @@
|
||||||
<view class="flex justify-between margin-top-sm">
|
<view class="flex justify-between margin-top-sm">
|
||||||
<view class="text-xxl">{{myMoneyBag.balance}}</view>
|
<view class="text-xxl">{{myMoneyBag.balance}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end margin-top-sm align-center">
|
<view v-if="bindBankCard && bindBankCard.bankNum" class="flex justify-end margin-top-sm align-center">
|
||||||
<view class="margin-lr-sm text-lg">{{myMoneyBag.bankNum}}</view>
|
<view class="margin-lr-sm text-lg">{{bindBankCard.encodeBankNum}}</view>
|
||||||
|
<view class="cu-btn bg-white radius" @click="bindBankAccount">账户另绑</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="flex justify-end margin-top-sm align-center">
|
||||||
<view class="cu-btn bg-white radius" @click="bindBankAccount">账户绑定</view>
|
<view class="cu-btn bg-white radius" @click="bindBankAccount">账户绑定</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -51,14 +54,16 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
openStatusArr: [['0']], //0打开,1收起
|
openStatusArr: [['0']], //0打开,1收起
|
||||||
myMoneyBag: {}
|
myMoneyBag: {},
|
||||||
|
curUserInfo: {},
|
||||||
|
bindBankCard: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// TODO: 查询展示绑定的账户
|
this.reloadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
async loadData() {
|
||||||
|
|
@ -66,6 +71,18 @@
|
||||||
for(let i = 0; i < this.myMoneyBag.bill.length - 1; i++) {
|
for(let i = 0; i < this.myMoneyBag.bill.length - 1; i++) {
|
||||||
this.openStatusArr.concat(['1']);
|
this.openStatusArr.concat(['1']);
|
||||||
}
|
}
|
||||||
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
this.loadBindBankCard();
|
||||||
|
},
|
||||||
|
async reloadData() {
|
||||||
|
this.loadBindBankCard();
|
||||||
|
},
|
||||||
|
async loadBindBankCard() {
|
||||||
|
let res = await this.$request.getBindBankCardByCustomerId({
|
||||||
|
customerId: this.curUserInfo.customerId
|
||||||
|
});
|
||||||
|
this.bindBankCard = res.data;
|
||||||
|
this.bindBankCard.encodeBankNum = '****' + this.bindBankCard.bankNum.substring(this.bindBankCard.bankNum.length - 4);
|
||||||
},
|
},
|
||||||
showDetail() {
|
showDetail() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue