diff --git a/pages/product/addGood/addGood.vue b/pages/product/addGood/addGood.vue index 59263a6..4722576 100644 --- a/pages/product/addGood/addGood.vue +++ b/pages/product/addGood/addGood.vue @@ -545,7 +545,7 @@ // 创建商品 submitCreatedGoods() { console.log('创建商品'); - return console.log('商品规格', this.setFormData.attr); + // return console.log('商品规格', this.setFormData.attr); console.log('是否推荐', this.$refs.commodityRef.addGoodsSecoundData); console.log('商品详情', this.$refs.commodityRef.goodsDis, this.$refs.commodityRef.store_name); if(this.setFormData.spec_type==0){ @@ -610,6 +610,8 @@ changeSpecType2(){ this.showSpecType = false; this.setFormData.spec_type = this.spec_type + ''; + this.setFormData.attrValue = []; + this.setFormData.attr = []; }, // 跳转多规格页面 navToSpecGood(){ @@ -621,8 +623,9 @@ attrValue: JSON.parse(JSON.stringify(this.setFormData.attrValue)), attr: JSON.parse(JSON.stringify(this.setFormData.attr)) }); - uni.$once('updateSpecType', (attr)=>{ - this.setFormData.attrValue = JSON.parse(JSON.stringify(attr)); + uni.$once('updateSpecType', (e)=>{ + this.setFormData.attrValue = JSON.parse(JSON.stringify(e.attrValue)); + this.setFormData.attr = JSON.parse(JSON.stringify(e.attr)); }) } }) diff --git a/pages/product/addGood/specGood.vue b/pages/product/addGood/specGood.vue index baba9bb..eb3dd37 100644 --- a/pages/product/addGood/specGood.vue +++ b/pages/product/addGood/specGood.vue @@ -1,5 +1,5 @@