Compare commits

...

2 Commits

Author SHA1 Message Date
0a71636436 Merge branch 'qjl'
# Conflicts:
#	unpackage/dist/dev/mp-weixin/project.private.config.json
2025-07-18 17:00:02 +08:00
4c379ec7e5 feat:新增物品详情注释 2025-07-18 16:47:54 +08:00
2 changed files with 14 additions and 45 deletions

View File

@ -267,6 +267,7 @@ export default {
}).then(res => {
console.log(res);
this.info = res
//
res.commodity_goods_info_list.forEach(item => {
item.goods_detail_pic = item.goods_detail_pic.split(',')
item.goods_carousel = item.goods_carousel.split(',')
@ -290,14 +291,8 @@ export default {
});
},
// changeGG2(item, index) {
// request(apiArr.addCar,"POST",{
// goods_id:item.id,
// count:1
// })
// },
//
changeGG(item, index) {
this.currentGG = item
this.currentGGIndex = index
@ -319,7 +314,7 @@ export default {
})
},
//
//( id )
getShopCarList() {
request(apiArr.getCar, 'POST', {}).then(res => {
this.carOrderList = res.commodity_cart_list
@ -327,67 +322,41 @@ export default {
},
addCar() {
let that = this
//
let goods_id_and_count = []
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = { count: 1 }
this.info.commodity_goods_info_list.forEach(item => {
console.log(item);
goods_id_and_count.push({
goods_id: item.id,
count: item.cart_count.count
count: 1
})
})
// update
request(apiArr.updateCar, "POST", {
goods_id_and_count
}).then(res => {
that.getShopCar()
that.getShopCarList()
})
// let flag = false
// this.carOrderList.forEach(item => {
// if (item.goods_id == this.info.commodity_goods_info_list[this.currentGGIndex].id) {
// flag = true
// }
// })
// console.log(flag);
// if (flag) {
// this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = { count: 1 }
// let carNum = 0
// this.info.commodity_goods_info_list.forEach(item => {
// carNum += item.cart_count.count
// })
// this.carNum = carNum
// } else {
// }
},
//
changeCar(newValue) {
//
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count.count = newValue.value
//
this.carOrderList.forEach(item=>{
if(item.commodity_goods_info.id == this.info.commodity_goods_info_list[this.currentGGIndex].id){
console.log(item,'item');
item.count = newValue.value
}
})
//
let carNum = 0
this.carOrderList.forEach(item=>{
carNum += item.count
})
// let carNum = 0
// this.info.commodity_goods_info_list.forEach(item => {
// if (item.cart_count) {
// carNum += item.cart_count.count
// }
// })
this.carNum = carNum
},

View File

@ -8,15 +8,15 @@
"miniprogram": {
"list": [
{
"name": "packages/shop/address/index",
"pathName": "packages/shop/address/index",
"query": "",
"name": "packages/shop/goods/index",
"pathName": "packages/shop/goods/index",
"query": "id=30",
"scene": null,
"launchMode": "default"
},
{
"name": "packages/shop/addAddress/index",
"pathName": "packages/shop/addAddress/index",
"name": "packages/shop/shopCar/index",
"pathName": "packages/shop/shopCar/index",
"query": "",
"launchMode": "default",
"scene": null