Compare commits

...

5 Commits

Author SHA1 Message Date
赵毅
c8c4cd6bd4 完成物业缴费是否允许跳付的逻辑 2025-10-28 10:25:25 +08:00
赵毅
f0189c6f2c 优化我的小区页面代码,使控制台不会出现报错 2025-10-27 16:09:33 +08:00
赵毅
def0aef656 优化净水小程序的跳转 2025-10-27 11:01:15 +08:00
赵毅
a6eebd287c 跳转到净水小程序 2025-10-27 10:04:07 +08:00
赵毅
4df3526466 优化详情页进入购物车页面的逻辑 2025-10-27 09:43:53 +08:00
4 changed files with 162 additions and 57 deletions

View File

@ -735,7 +735,7 @@ export default {
} }
// ID // ID
this.defaultInfoList = this.originalDefaultInfoList.filter(info => info.id === item.id); this.defaultInfoList = this.originalDefaultInfoList.filter(info => info?.id === item?.id);
return; return;
} }

View File

@ -57,7 +57,9 @@
<view class="payItem_tit"> <view class="payItem_tit">
<view class="payItem_left"> <view class="payItem_left">
<checkbox :checked="item.check" @click="checkChange(item, index)" <checkbox :checked="item.check" @click="checkChange(item, index)"
v-if="item.community_order_rows.some(itemObj => itemObj.pay_status == 1)"></checkbox> v-if="item.community_order_rows.some(itemObj => itemObj.pay_status == 1)"
:disabled="!canSelectBill(index)">
</checkbox>
<view style="margin-left: 24rpx">{{ item.order_date }}</view> <view style="margin-left: 24rpx">{{ item.order_date }}</view>
</view> </view>
<view class="payItem_right"> <view class="payItem_right">
@ -73,8 +75,8 @@
</view> </view>
<view v-if="item.more"> <view v-if="item.more">
<view class="payItem_List" v-for="(items, indes) in item.community_order_rows" :key="items.order_id"> <view class="payItem_List" v-for="(items, indes) in item.community_order_rows" :key="items.order_id">
<checkbox :checked="items.check" @click="itemsCheckChange(items, indes, index)" <checkbox :checked="items.check" @click="itemsCheckChange(items, indes, index)" v-if="items.pay_status == 1"
v-if="items.pay_status == 1"></checkbox> :disabled="!canSelectItem(indes, index)"></checkbox>
<view class="Item_time" v-if="items.billing_cycle == 1"> <view class="Item_time" v-if="items.billing_cycle == 1">
{{ items.order_date }} {{ items.order_date }}
</view> </view>
@ -279,6 +281,7 @@ export default {
currentCommunity: "", // currentCommunity: "", //
currentCommunityAddr: "", // currentCommunityAddr: "", //
Bill: "", // Bill: "", //
Bill2: "", //
balanceMoney: 0, // balanceMoney: 0, //
currentMoney: 0, // currentMoney: 0, //
@ -289,6 +292,7 @@ export default {
page_num: 1, page_num: 1,
payOrderList: [], payOrderList: [],
flag: false, flag: false,
isAllow: false,
}; };
}, },
onLoad(options) { onLoad(options) {
@ -387,9 +391,10 @@ export default {
page_num: 1, page_num: 1,
page_size: 50, page_size: 50,
}).then((res) => { }).then((res) => {
this.isAllow = res.rows[0].community.bill_allow_skip_payment === 1;
this.roomList = res.rows; this.roomList = res.rows;
if (!this.currentRoom.room_id) { if (!this.currentRoom.room_id) {
this.currentRoom = this.roomList[0] this.currentRoom = this.roomList[0]
} }
this.selectedRoomId = this.currentRoom.room_id; this.selectedRoomId = this.currentRoom.room_id;
this.getOrderList().then(() => { this.getOrderList().then(() => {
@ -405,6 +410,7 @@ export default {
// //
selectRoom(item) { selectRoom(item) {
this.getRoomSelect()
// ID // ID
this.selectedRoomId = item.room_id; this.selectedRoomId = item.room_id;
// //
@ -451,7 +457,30 @@ export default {
ite.check = false; ite.check = false;
}); });
}); });
//
res.rows.sort((a, b) => {
// community_order_rowsorder_date
const yearA = a.community_order_rows && a.community_order_rows.length > 0 ? parseInt(a.community_order_rows[0].order_date) : 0;
const yearB = b.community_order_rows && b.community_order_rows.length > 0 ? parseInt(b.community_order_rows[0].order_date) : 0;
//
if (yearA !== yearB) {
return yearA - yearB;
}
//
const monthA = a.community_order_rows && a.community_order_rows.length > 0 ? parseInt(a.community_order_rows[0].order_datetime) : 0;
const monthB = b.community_order_rows && b.community_order_rows.length > 0 ? parseInt(b.community_order_rows[0].order_datetime) : 0;
return monthA - monthB;
});
this.Bill = res.rows; this.Bill = res.rows;
this.Bill2 = res.rows.reduce((result, item) => {
const paidOrders = item.community_order_rows.filter(ite => ite.pay_status == 1);
return result.concat(paidOrders);
}, []);
resolve(); resolve();
}).catch((error) => { }).catch((error) => {
reject(error); reject(error);
@ -462,49 +491,107 @@ export default {
changeCheck(e, index) { changeCheck(e, index) {
this.Bill[index].more = !this.Bill[index].more; this.Bill[index].more = !this.Bill[index].more;
}, },
//
canSelectBill(index) {
if (this.isAllow) return true;
//
if (index === 0) return true;
//
for (let i = 0; i < index; i++) {
const yearBill = this.Bill[i];
//
const hasUnpaid = yearBill.community_order_rows.some(item => item.pay_status === 1);
if (hasUnpaid) {
return false;
}
}
return true;
},
//
canSelectItem(indes, index) {
if (this.isAllow) return true;
//
if (!this.canSelectBill(index)) {
return false;
}
//
if (indes === 0) return true;
//
const yearBill = this.Bill[index];
for (let i = 0; i < indes; i++) {
if (yearBill.community_order_rows[i].pay_status === 1) {
return false;
}
}
return true;
},
// //
checkChange(e, index) { checkChange(e, index) {
this.Bill[index].check = !this.Bill[index].check; //
this.Bill[index].community_order_rows.forEach((item) => { if (this.canSelectBill(index)) {
if (item.pay_status == 1) { this.Bill[index].check = !this.Bill[index].check;
item.check = this.Bill[index].check; this.Bill[index].community_order_rows.forEach((item, indes) => {
} //
}); if (item.pay_status == 1 && this.canSelectItem(indes, index)) {
item.check = this.Bill[index].check;
//
let money = 0;
this.Bill.forEach((item) => {
item.community_order_rows.forEach((ite) => {
if (ite.check && ite.pay_status == 1) {
money += ite.money;
} }
}); });
});
this.currentMoney = money ? money.toFixed(2) : 0.00; //
let money = 0;
this.Bill.forEach((item) => {
item.community_order_rows.forEach((ite) => {
if (ite.check && ite.pay_status == 1) {
money += ite.money;
}
});
});
this.currentMoney = money ? money.toFixed(2) : 0.00;
}
}, },
// //
itemsCheckChange(e, indes, index) { itemsCheckChange(e, indes, index) {
this.Bill[index].community_order_rows[indes].check = //
!this.Bill[index].community_order_rows[indes].check; if (this.canSelectItem(indes, index)) {
// this.Bill[index].community_order_rows[indes].check =
let isAll = this.Bill[index].community_order_rows.every((item) => { !this.Bill[index].community_order_rows[indes].check;
return item.check;
}); //
if (isAll) { let isAll = this.Bill[index].community_order_rows.every((item, idx) => {
this.Bill[index].check = true; //
} else { if (item.pay_status === 1 && this.canSelectItem(idx, index)) {
this.Bill[index].check = false; return item.check;
}
//Billcommunity_order_rows
let money = 0;
this.Bill.forEach((item) => {
item.community_order_rows.forEach((ite) => {
if (ite.check) {
money += ite.money;
} }
//
return true;
}); });
});
this.currentMoney = money ? money.toFixed(2) : 0.00; if (isAll) {
this.Bill[index].check = true;
} else {
this.Bill[index].check = false;
}
//
let money = 0;
this.Bill.forEach((item) => {
item.community_order_rows.forEach((ite) => {
if (ite.check && ite.pay_status == 1) {
money += ite.money;
}
});
});
this.currentMoney = money ? money.toFixed(2) : 0.00;
}
}, },
// //
changePayType(e) { changePayType(e) {

View File

@ -40,7 +40,8 @@
</view> </view>
</view> </view>
<view class="GG_rigth" @click="showSizePopup"> <view class="GG_rigth" @click="showSizePopup">
{{ info.commodity_goods_info_list ? info.commodity_goods_info_list.length : 0 }}<u-icon size="26rpx" name="arrow-right"></u-icon> {{ info.commodity_goods_info_list ? info.commodity_goods_info_list.length : 0 }}<u-icon size="26rpx"
name="arrow-right"></u-icon>
</view> </view>
</view> </view>
@ -177,7 +178,7 @@
<view class="car_right" v-if=" <view class="car_right" v-if="
info.commodity_goods_info_list[currentGGIndex].stock_quantity > 0 && info.commodity_goods_info_list[currentGGIndex].stock_quantity > 0 &&
(!info.commodity_goods_info_list[currentGGIndex].cart_count || (!info.commodity_goods_info_list[currentGGIndex].cart_count ||
info.commodity_goods_info_list[currentGGIndex].cart_count.count == 0) info.commodity_goods_info_list[currentGGIndex].cart_count.count == 0)
" @click="addCar"> " @click="addCar">
加入购物车 加入购物车
</view> </view>
@ -188,8 +189,9 @@
"> ">
加入购物车 加入购物车
</view> </view>
<view class="car_right car_right_disabled" v-if="info.commodity_goods_info_list[currentGGIndex].stock_quantity < 1"> <view class="car_right car_right_disabled"
v-if="info.commodity_goods_info_list[currentGGIndex].stock_quantity < 1">
已售罄 已售罄
</view> </view>
</view> </view>
@ -435,7 +437,6 @@ export default {
request(apiArr.getGoodsInfo, "POST", { request(apiArr.getGoodsInfo, "POST", {
id: this.id, id: this.id,
}).then((res) => { }).then((res) => {
console.log(res);
// //
res.commodity_goods_info_list.forEach((item) => { res.commodity_goods_info_list.forEach((item) => {
@ -458,7 +459,6 @@ export default {
}); });
} }
this.info = res; this.info = res;
console.log("this.info", this.info.commodity_goods_info_list);
// //
let selectedIndex = 0; let selectedIndex = 0;
@ -517,14 +517,17 @@ export default {
// //
getShopCar() { getShopCar() {
request(apiArr.getCarCount, "POST", {}).then((res) => { request(apiArr.getCarCount, "POST", {}).then((res) => {
this.carNum = res.total;
this.prevCarNum = res.total; this.prevCarNum = res.total;
}); });
}, },
getShopCarList() { getShopCarList() {
request(apiArr.getCar, "POST", {}).then((res) => { return request(apiArr.getCar, "POST", {}).then((res) => {
this.carOrderList = res.commodity_cart_list; //
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
this.carNum = res.total;
return res;
}); });
}, },
@ -655,20 +658,23 @@ export default {
}, },
onReachBottom() { }, onReachBottom() { },
onShow() { onShow() {
this.getShopCarList(); this.getShopCarList().then(() => {
this.getGoodsInfo(); this.getGoodsInfo();
this.getShopCar(); this.getShopCar();
this.getComment(); this.getComment();
});
}, },
//( id count 0 ) //( id count 0 )
onHide() { onHide() {
let goods_id_and_count = []; let goods_id_and_count = [];
this.info.commodity_goods_info_list.forEach((item) => { this.info.commodity_goods_info_list.forEach((item) => {
goods_id_and_count.push({ if (item.cart_count) {
goods_id: item.id, goods_id_and_count.push({
count: item.cart_count ? item.cart_count.count : 0, goods_id: item.id,
}); count: item.cart_count.count,
});
}
}); });
request(apiArr.updateCar, "POST", { request(apiArr.updateCar, "POST", {

View File

@ -99,7 +99,7 @@
<view class="serverList1_right" v-if="serverRightList.length > 0"> <view class="serverList1_right" v-if="serverRightList.length > 0">
<view :class="['serverItemRight', `serverItemRight${index + 1}`]" <view :class="['serverItemRight', `serverItemRight${index + 1}`]"
v-for="(item, index) in serverRightList" :key="index"> v-for="(item, index) in serverRightList" :key="index">
<image :src="item.pic_src" mode="" @tap="index === 0 ? toAdvertisingView(serverRightList) : headerServerClick(item)"/> <image :src="item.pic_src" mode="" @tap="index === 0 ? toAdvertisingView(serverRightList) : goToPurify(item)"/>
</view> </view>
</view> </view>
</view> </view>
@ -360,6 +360,18 @@ export default {
NavgateTo('/packages/advertising/index/index?id=' + item.id, { isLogin: false }) NavgateTo('/packages/advertising/index/index?id=' + item.id, { isLogin: false })
}, },
//
goToPurify() {
uni.navigateToMiniProgram({
appId: 'wx77b22c0a0018e580',
path: 'pages/newLogin/newLogin',
envVersion: 'release',
success(res) {
//
}
})
},
async goToWuye() { async goToWuye() {
uni.removeStorageSync('order_dispatch_permission'); uni.removeStorageSync('order_dispatch_permission');
uni.removeStorageSync('work_order_permission'); uni.removeStorageSync('work_order_permission');