优化接口

This commit is contained in:
duan
2024-06-04 15:45:49 +08:00
parent a54580549a
commit bdd5a6a325
4 changed files with 29 additions and 11 deletions

View File

@@ -388,15 +388,16 @@
case 'addcart':
this.cartLists = msg
if (msg.data.length != 0) {
let nums = 0
msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个
console.log(this.skuidsearch,'调试1')
console.log(item.skuId,'调试2')
if (item.skuId == this.skuidsearch) {
this.$set(this, 'amountcartNumber', item.number)
} else {
this.$set(this, 'amountcartNumber', 0)
}
nums = item.number
}
// else {
// this.$set(this, 'amountcartNumber', 0)
// }
})
this.$set(this, 'amountcartNumber', nums)
} else {
this.$set(this, 'amountcartNumber', 0)
}