From fec01de9c00cde9eba0d334aa73960a9d7aa3baa Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Wed, 22 Nov 2023 15:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=9A=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=9A=84=E6=B7=BB=E5=8A=A0/=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/product/addGood/addGood.vue | 9 +- pages/product/addGood/specGood.vue | 178 ++++++++++++++++++++++------- 2 files changed, 142 insertions(+), 45 deletions(-) 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 @@