fix(workOrderDashboard): 修复图片URL处理逻辑并优化钱包页面代码
修复社区列表图片URL处理逻辑,当pic为空时返回空字符串而非拼接无效URL。优化钱包页面代码格式,调整onLoad和onShow生命周期方法顺序,保持代码逻辑清晰。
This commit is contained in:
parent
fbc48066f6
commit
f697ec362c
@ -17,15 +17,18 @@
|
||||
<view class="walletBox">
|
||||
<view class="walletBox_top">钱包</view>
|
||||
<view class="walletBox_content">
|
||||
<view class="walletBox_item" @click="goWallet(1, walletInfo.receivable ? walletInfo.receivable.toFixed(2) : '0.00')">
|
||||
<view class="walletBox_item"
|
||||
@click="goWallet(1, walletInfo.receivable ? walletInfo.receivable.toFixed(2) : '0.00')">
|
||||
<view>{{ walletInfo.receivable ? walletInfo.receivable.toFixed(2) : "0.00" }}元</view>
|
||||
<view class="walletBox_item_text">应收</view>
|
||||
</view>
|
||||
<view class="walletBox_item" @click="goWallet(2, walletInfo.received ? walletInfo.received.toFixed(2) : '0.00')">
|
||||
<view class="walletBox_item"
|
||||
@click="goWallet(2, walletInfo.received ? walletInfo.received.toFixed(2) : '0.00')">
|
||||
<view>{{ walletInfo.received ? walletInfo.received.toFixed(2) : "0.00" }}元</view>
|
||||
<view class="walletBox_item_text">已收</view>
|
||||
</view>
|
||||
<view class="walletBox_item" @click="goWallet(3, walletInfo.pending ? walletInfo.pending.toFixed(2) : '0.00')">
|
||||
<view class="walletBox_item"
|
||||
@click="goWallet(3, walletInfo.pending ? walletInfo.pending.toFixed(2) : '0.00')">
|
||||
<view>{{ walletInfo.pending ? walletInfo.pending.toFixed(2) : "0.00" }}元</view>
|
||||
<view class="walletBox_item_text">待收物业费</view>
|
||||
</view>
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user