Compare commits

2 Commits
AHXW ... main

Author SHA1 Message Date
f5f6885318 修复bug 2026-06-05 17:50:17 +08:00
5379380d33 修复支付bug 2026-06-05 17:30:05 +08:00
5 changed files with 33 additions and 20 deletions

View File

@@ -174,8 +174,13 @@
this.resetAndLoad(); this.resetAndLoad();
}, },
formatMoney(val) { formatMoney(val) {
if (!val && val !== 0) return '—'; if (val === null || val === undefined || isNaN(val)) return '—';
return '¥' + Number(val).toFixed(2); val = Number(val);
if (val >= 100000) {
const wan = val / 10000;
return '¥' + wan + '万';
}
return '¥' + val.toFixed(2);
}, },
resetAndLoad(){ resetAndLoad(){
this.loadStatus = 'more'; this.loadStatus = 'more';

View File

@@ -162,8 +162,9 @@
formatMoney(val) { formatMoney(val) {
if (val === null || val === undefined || isNaN(val)) return '—'; if (val === null || val === undefined || isNaN(val)) return '—';
val = Number(val); val = Number(val);
if (val >= 10000) { if (val >= 100000) {
return '¥' + (val / 10000).toFixed(2) + '万'; const wan = val / 10000;
return '¥' + wan + '万';
} }
return '¥' + val.toFixed(2); return '¥' + val.toFixed(2);
}, },
@@ -255,14 +256,14 @@
signType: order.miniPayRequest.signType, signType: order.miniPayRequest.signType,
paySign: order.miniPayRequest.paySign, paySign: order.miniPayRequest.paySign,
success: () => { success: () => {
this.isPaying = false;
billList.forEach(b => b.checked = false); billList.forEach(b => b.checked = false);
this.updateSelected(); this.updateSelected();
this.refresh(); this.refresh();
this.isPaying = false;
}, },
fail: (err) => { fail: (err) => {
this.payFailCallback(err, orderId);
this.isPaying = false; this.isPaying = false;
this.payFailCallback(err, orderId);
} }
}); });

View File

@@ -164,8 +164,9 @@
formatMoney(val) { formatMoney(val) {
if (val === null || val === undefined || isNaN(val)) return '—'; if (val === null || val === undefined || isNaN(val)) return '—';
val = Number(val); val = Number(val);
if (val >= 10000) { if (val >= 100000) {
return '¥' + (val / 10000).toFixed(2) + '万'; const wan = val / 10000;
return '¥' + wan + '万';
} }
return '¥' + val.toFixed(2); return '¥' + val.toFixed(2);
}, },
@@ -257,14 +258,14 @@
signType: order.miniPayRequest.signType, signType: order.miniPayRequest.signType,
paySign: order.miniPayRequest.paySign, paySign: order.miniPayRequest.paySign,
success: () => { success: () => {
this.isPaying = false;
billList.forEach(b => b.checked = false); billList.forEach(b => b.checked = false);
this.updateSelected(); this.updateSelected();
this.refresh(); this.refresh();
this.isPaying = false;
}, },
fail: (err) => { fail: (err) => {
this.payFailCallback(err, orderId);
this.isPaying = false; this.isPaying = false;
this.payFailCallback(err, orderId);
} }
}); });

View File

@@ -161,8 +161,9 @@
formatMoney(val) { formatMoney(val) {
if (val === null || val === undefined || isNaN(val)) return '—'; if (val === null || val === undefined || isNaN(val)) return '—';
val = Number(val); val = Number(val);
if (val >= 10000) { if (val >= 100000) {
return '¥' + (val / 10000).toFixed(2) + '万'; const wan = val / 10000;
return '¥' + wan + '万';
} }
return '¥' + val.toFixed(2); return '¥' + val.toFixed(2);
}, },
@@ -233,14 +234,14 @@
signType: order.miniPayRequest.signType, signType: order.miniPayRequest.signType,
paySign: order.miniPayRequest.paySign, paySign: order.miniPayRequest.paySign,
success: () => { success: () => {
this.isPaying = false;
billList.forEach(b => b.checked = false); billList.forEach(b => b.checked = false);
this.updateSelected(); this.updateSelected();
this.refresh(); this.refresh();
this.isPaying = false;
}, },
fail: (err) => { fail: (err) => {
this.payFailCallback(err, orderId);
this.isPaying = false; this.isPaying = false;
this.payFailCallback(err, orderId);
} }
}); });

View File

@@ -145,6 +145,8 @@
opacity: 0, opacity: 0,
extraIcons: [] // 右侧额外图标 extraIcons: [] // 右侧额外图标
}, },
// 用户信息(响应式)
userInfo: uni.getStorageSync('userInfo') || {}
} }
}, },
@@ -163,9 +165,9 @@
staticHost() { staticHost() {
return this.$config.staticUrl return this.$config.staticUrl
}, },
user() { user() {
return uni.getStorageSync('userInfo') || {} return this.userInfo
} }
}, },
@@ -210,17 +212,20 @@
}).then(obj => { }).then(obj => {
if(obj.flag){ if(obj.flag){
console.log("更新缓存中用户信息") console.log("更新缓存中用户信息")
uni.setStorageSync('userInfo', { const newUserInfo = {
userType: obj.data.userType, userType: obj.data.userType,
oaAuth: obj.data.oaAuth, oaAuth: obj.data.oaAuth,
cusNo: obj.data.cusNo, cusNo: obj.data.cusNo,
userName: obj.data.userName, userName: obj.data.userName,
openId: obj.data.openId, openId: obj.data.openId,
subscribe: obj.data.subscribeMsg subscribe: obj.data.subscribeMsg
}) }
uni.setStorageSync('userInfo', newUserInfo)
// 更新响应式数据
this.userInfo = newUserInfo
} }
}); });
}, },
logout() { logout() {
this.$u.vuex('vuex_token', ''); this.$u.vuex('vuex_token', '');