接口对接
This commit is contained in:
parent
c749df3323
commit
6bb5de68be
|
|
@ -6,9 +6,9 @@ export default {
|
|||
uni.addInterceptor('request', {
|
||||
invoke(args) {
|
||||
// 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://127.0.0.1:80' + args.url;
|
||||
args.url = 'http://127.0.0.1:80' + args.url;
|
||||
if (args.data) {
|
||||
args.data.deptId = globalData.deptId;
|
||||
args.data.from = globalData.from;
|
||||
|
|
@ -328,5 +328,13 @@ export default {
|
|||
data: params
|
||||
})
|
||||
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="text-xxl">{{myMoneyBag.balance}}</view>
|
||||
</view>
|
||||
<view class="flex justify-end margin-top-sm align-center">
|
||||
<view class="margin-lr-sm text-lg">{{myMoneyBag.bankNum}}</view>
|
||||
<view v-if="bindBankCard && bindBankCard.bankNum" class="flex justify-end margin-top-sm align-center">
|
||||
<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>
|
||||
</view>
|
||||
|
|
@ -51,14 +54,16 @@
|
|||
data() {
|
||||
return {
|
||||
openStatusArr: [['0']], //0打开,1收起
|
||||
myMoneyBag: {}
|
||||
myMoneyBag: {},
|
||||
curUserInfo: {},
|
||||
bindBankCard: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
onShow() {
|
||||
// TODO: 查询展示绑定的账户
|
||||
this.reloadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
|
|
@ -66,6 +71,18 @@
|
|||
for(let i = 0; i < this.myMoneyBag.bill.length - 1; i++) {
|
||||
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() {
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
Loading…
Reference in New Issue