diff --git a/distribution/income-details/index.vue b/distribution/income-details/index.vue index cebd4e1..8369648 100644 --- a/distribution/income-details/index.vue +++ b/distribution/income-details/index.vue @@ -50,8 +50,8 @@ style="align-items: baseline; justify-content: flex-end" > 总计: - - {{ centerUserInfo.totalIncome }} + {{ totalIncome }} @@ -113,6 +113,7 @@ {}); + onLoad(async (opt) => { await getCouponShopsAjax(); @@ -314,13 +316,24 @@ onLoad(async (opt) => { } if (opt.shopId) { querForm.value.shopId = opt.shopId; - const findItem = couponShops.value.find((item) => item.id == opt.shopId); + const findItem = shopList.value.find((item) => item.shopId == opt.shopId); querForm.value.shopName = findItem.shopName || ""; } centerUser(); getIncomeDetailsAjax(); }); +const totalIncome=computed(()=>{ + if(!querForm.value.shopId){ + return centerUserInfo.value?(centerUserInfo.value.totalIncome||0):0; + } + const findItem = shopList.value.find((item) => item.shopId == querForm.value.shopId ); + if(findItem){ + return findItem.income||0 + } + return 0 +}) + watch( () => querForm.value.status, (newVal, oldVal) => {