优化页面展示逻辑

This commit is contained in:
weipengfei 2023-07-25 16:45:04 +08:00
parent 47671e03fc
commit 1aecb5f7e8
3 changed files with 37 additions and 31 deletions

View File

@ -20,7 +20,7 @@
<uni-icons type="location"></uni-icons> <uni-icons type="location"></uni-icons>
<view class="location">区域:</view> <view class="location">区域:</view>
</view> </view>
<view style="flex: 1;">{{company.province_name+company.city_name+company.area_name+company.address}}</view> <view style="flex: 1;">{{company.province_name+company.city_name+company.area_name+company.street_name+company.address}}</view>
</view> </view>
</view> </view>
</block> </block>

View File

@ -78,7 +78,11 @@
} }
else Toast(this.timeCount+'秒后再支付!') else Toast(this.timeCount+'秒后再支付!')
}, },
async goRecharge() { goRecharge() {
// console.log(obj);
uni.showLoading({
title:'获取支付信息',
success: async () => {
let { data } = await recharge({ let { data } = await recharge({
money: this.payMoney.money money: this.payMoney.money
}); });
@ -102,10 +106,6 @@
"timestamp": res1.data.config.timestamp, // "timestamp": res1.data.config.timestamp, //
"sign": res1.data.config.paySign "sign": res1.data.config.paySign
} }
// console.log(obj);
uni.showLoading({
title:'获取微信支付信息',
success: () => {
uni.getProvider({ uni.getProvider({
service: 'payment', service: 'payment',
success: (paymentList) => { success: (paymentList) => {
@ -119,7 +119,7 @@
// orderInfo: res1.data.config, // orderInfo: res1.data.config,
orderInfo: obj, orderInfo: obj,
success: (e) => { success: (e) => {
console.log('成功', e); // console.log('', e);
uni.hideLoading(); uni.hideLoading();
payStatus({ payStatus({
order_id: data.order_id, order_id: data.order_id,
@ -141,7 +141,9 @@
title: '支付失败!' title: '支付失败!'
}) })
}, },
complete: () => {}, complete: () => {
this.payMoney.money = '';
},
}); });
} }
}) })

View File

@ -100,10 +100,14 @@
let res = await userWithdraw({ let res = await userWithdraw({
amount: this.payMoney.money amount: this.payMoney.money
}); });
Toast(res.msg); uni.showToast({
icon:'success',
title: res.msg
})
// //
let info = this.$store.state.app.userInfo; let info = this.$store.state.app.userInfo;
info.user_money -= this.payMoney.money; this.payMoney.money = '';
info.user_money = (info.user_money - this.payMoney.money).toFixed(2);
this.$store.commit('setUserInfo', info); this.$store.commit('setUserInfo', info);
} }
}, },