|
|
@@ -213,7 +213,17 @@
|
|
|
this.popData.spec_key = ''
|
|
|
this.popData.num = 0
|
|
|
this.popData.spec_ids = []
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ this.popData.num =0;
|
|
|
+ if(this.cartData.goods_list.length>0){
|
|
|
+ this.cartData.goods_list.forEach(item=>{
|
|
|
+ if(item.spec_sku_id===this.popData.spec_key){
|
|
|
+ this.popData.num = item.goods_number
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
this.popData.spec_list = res.data.spec_list
|
|
|
this.popData.spec_attr = res.data.spec_attr
|
|
|
this.$refs.popupGG.open();
|
|
|
@@ -230,14 +240,11 @@
|
|
|
spec_ids.sort((a, b) => a - b);
|
|
|
let spec_key = spec_ids.join('_')
|
|
|
this.popData.spec_key = spec_key
|
|
|
- console.log(this.popData.spec_list[spec_key])
|
|
|
if (this.popData.spec_list[spec_key] !== undefined) {
|
|
|
- this.popData.price = this.popData.spec_list[spec_key].seckill_money > 0 ? this.popData.spec_list[
|
|
|
- spec_key].seckill_money : this.popData.spec_list[spec_key].price
|
|
|
+ this.popData.price = this.popData.spec_list[spec_key].seckill_money > 0 ? this.popData.spec_list[spec_key].seckill_money : this.popData.spec_list[spec_key].price
|
|
|
this.popData.line_price = this.popData.spec_list[spec_key].line_price
|
|
|
this.popData.goods_spec_id = this.popData.spec_list[spec_key].goods_spec_id + ''
|
|
|
- let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id === row
|
|
|
- .goods_spec_id)
|
|
|
+ let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id*1 === row.goods_spec_id*1)
|
|
|
if (cartKey >= 0) {
|
|
|
this.popData.num = this.cartData.goods_list[cartKey].goods_number
|
|
|
}
|