From f697ec362caf7e34bf305d23cea062407683fa0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Sat, 1 Nov 2025 09:54:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(workOrderDashboard):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9B=BE=E7=89=87URL=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E9=92=B1=E5=8C=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复社区列表图片URL处理逻辑,当pic为空时返回空字符串而非拼接无效URL。优化钱包页面代码格式,调整onLoad和onShow生命周期方法顺序,保持代码逻辑清晰。 --- packages/workOrderDashboard/guide/index.vue | 37 ++++++++++--------- .../workOrderDashboard/myCommunity/index.vue | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/packages/workOrderDashboard/guide/index.vue b/packages/workOrderDashboard/guide/index.vue index 05812993..97b38d4c 100644 --- a/packages/workOrderDashboard/guide/index.vue +++ b/packages/workOrderDashboard/guide/index.vue @@ -17,15 +17,18 @@ 钱包 - + {{ walletInfo.receivable ? walletInfo.receivable.toFixed(2) : "0.00" }}元 应收 - + {{ walletInfo.received ? walletInfo.received.toFixed(2) : "0.00" }}元 已收 - + {{ walletInfo.pending ? walletInfo.pending.toFixed(2) : "0.00" }}元 待收物业费 @@ -76,6 +79,18 @@ export default { } }, async onLoad() { + }, + async onShow() { + const changeCommData = uni.getStorageSync('changeWorkOrderData'); + this.communityVal = changeCommData ? changeCommData.name : "切换小区"; + + if (changeCommData) { + const params = { + community_id: changeCommData.id, + } + const res = await request(apiArr.communityInfo, "POST", params); + uni.setStorageSync('allow_grab_order', res.allow_grab_order == 1 ? true : false); + } const workOrderPermission = uni.getStorageSync('work_order_permission'); const orderDispatchPermission = uni.getStorageSync('order_dispatch_permission'); this.showWorkOrderSection = !(workOrderPermission === false && orderDispatchPermission === false); @@ -111,18 +126,6 @@ export default { this.getWalletInfo(); }); }, - async onShow() { - const changeCommData = uni.getStorageSync('changeWorkOrderData'); - this.communityVal = changeCommData ? changeCommData.name : "切换小区"; - - if (changeCommData) { - const params = { - community_id: changeCommData.id, - } - const res = await request(apiArr.communityInfo, "POST", params); - uni.setStorageSync('allow_grab_order', res.allow_grab_order == 1 ? true : false); - } - }, methods: { // 获取钱包信息 getWalletInfo() { @@ -149,8 +152,8 @@ export default { // if (type == 2) { // return // } - NavgateTo('/packages/workOrderDashboard/wallet/index?type=' + type + '&community_id=' + changeCommData.id + '&amount=' + amount); - }, + NavgateTo('/packages/workOrderDashboard/wallet/index?type=' + type + '&community_id=' + changeCommData.id + '&amount=' + amount); + }, addCommunity() { NavgateTo("/packages/workOrderDashboard/myCommunity/index"); }, diff --git a/packages/workOrderDashboard/myCommunity/index.vue b/packages/workOrderDashboard/myCommunity/index.vue index d2c425e3..ab2a5864 100644 --- a/packages/workOrderDashboard/myCommunity/index.vue +++ b/packages/workOrderDashboard/myCommunity/index.vue @@ -60,7 +60,7 @@ export default { user_id: uni.getStorageSync('userId'), }).then(res => { res.rows.forEach(item => { - item.pic = item.pic.startsWith('http') ? item.pic : picUrl + item.pic + item.pic = item.pic ? (item.pic.startsWith('http') ? item.pic : picUrl + item.pic) : '' }); this.communityList = res.rows })