修改购物车逻辑

This commit is contained in:
2025-08-11 15:48:44 +08:00
parent 9c0be00fbd
commit ff5e4af2d4
3 changed files with 21 additions and 16 deletions

View File

@ -256,8 +256,11 @@
// 添加到购物车(默认商品数量+1,可以让后端连表查询商品数量字段)
async addCartFun(item) {
console.log("🚀 ~ addCartFun ~ item:", item)
uni.navigateTo({
url: `/pages/shop/shop?id=${item.id}&showPopup=true`
})
return
// 限购逻辑
if (item.first_category_id === 1 || item.first_category_id === 2) {
// 统计购物车中同类商品的总数量
@ -346,7 +349,7 @@
// 去结算
goSettle() {
console.log(this.cartLists)
console.log(this.cartLists)
this.showCart = false
const goods = this.cartLists.map(item => {
return {