下单页面调整,确认订单页面调整

This commit is contained in:
2025-04-28 11:29:32 +08:00
parent 94cc918357
commit 7c182023a5
39 changed files with 5725 additions and 275 deletions

View File

@@ -164,12 +164,26 @@
if (!item.show) {
return false;
}
// 查找选中的数组里面 统计指定 id 的重复次数
const count = Selectedlist.value.filter(item => item.id === item.id).length;
if (item.Selected) {
Selectedlist.value = Selectedlist.value.filter(i => i.id !== item.id)
fromInfo.list[index].Selected = false
return
}
// 查找选中的数组里面 统计指定 id 的重复次数
const foundObject = mergedArray.value.find(i => i.productId === item.proId)
if (foundObject.num <= count) {
const canSelMaxNum = Orderinfo.shoppingCart.filter((v) => v.productId == item.proId).reduce((prve,
cur) => {
return prve + cur.num * 1
}, 0)
if (canSelMaxNum <= 0) {
uni.showToast({
title: '不可多余商品!',
icon: 'none'
})
return
}
// 查找选中的数组里面 统计指定 id 的重复次数
const count = Selectedlist.value.filter(v => v.couponId == item.couponId).length;
if (count >= canSelMaxNum) {
uni.showToast({
title: '不可多余商品!',
icon: 'none'
@@ -190,18 +204,14 @@
// return false;
// }
if (item.Selected) {
Selectedlist.value = Selectedlist.value.filter(i => i.id !== item.id)
} else {
// 筛查出最低价格
await productmethod()
const matchedItem = lowestPrices.value.find(cartItem => cartItem.productId == item.proId);
Selectedlist.value.push({
...item,
price: matchedItem.price,
memberPrice: matchedItem.memberPrice
})
}
// 筛查出最低价格
await productmethod()
const matchedItem = lowestPrices.value.find(cartItem => cartItem.productId == item.proId);
Selectedlist.value.push({
...item,
price: matchedItem.price,
memberPrice: matchedItem.memberPrice
})
fromInfo.list[index].Selected = !item.Selected
}
@@ -272,13 +282,14 @@
shopUserId: Orderinfo.shopUserId,
})
if (Orderinfo.typeOrder == 2 && res.length>0) {
if (Orderinfo.typeOrder == 2 && res.length > 0) {
res.forEach((item) => {
item.Selected = false
})
res = res.map(item => {
const matchedItem = Orderinfo.shoppingCart.find(cartItem => cartItem.productId == item
.proId);
const matchedItem = Orderinfo.shoppingCart.find(cartItem => {
return cartItem.productId == item.proId
});
const hasMatch = Boolean(matchedItem);
return {
...item,
@@ -336,7 +347,10 @@
Orderinfo.shopUserId = options.shopUserId
Orderinfo.payAmount = options.payAmount
console.log('coupon mounted');
console.log(Orderinfo.payAmount)
console.log(options);
console.log(JSON.parse(decodeURIComponent(options.shoppingCart)));
Orderinfo.shoppingCart = JSON.parse(decodeURIComponent(options.shoppingCart))
}
getCouponList()