diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue index 28d924a..15b85b3 100644 --- a/pages/product/addGoodDetail/addGoodDetail.vue +++ b/pages/product/addGoodDetail/addGoodDetail.vue @@ -722,7 +722,7 @@ }) }, submit() { - // console.log(this.formData) + console.log(this.formData) this.$refs.formData.validate().then(res => { this.handAdd() }).catch(errors => { @@ -768,6 +768,12 @@ this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet this.isSet2() this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',') + if (this.formData.delivery_way.length == 1) { + this.checkboxList1 = this.checkboxList1.filter(item => { + return item.value == this.formData.delivery_free[0] + }) + } + if (option.product_id) { this.formData.product_id = option.product_id this.mode = 'edit' @@ -781,9 +787,18 @@ delete this.formData.image_list if (!this.formData.imageList) this.formData.imageList = [] this.oldToNew(this.formData) + if (this.formData.delivery_free.length == 1) { + this.checkboxList1 = this.checkboxList1.filter(item => { + return item.value == this.formData.delivery_free[0] + }) + } console.log(this.formData, 'formDATA') }) } + + + console.log(JSON.parse(option.formData)) + }, onBackPress: function(e) { this.showlay = true diff --git a/pages/product/addGoodDetail/goodsPrice.vue b/pages/product/addGoodDetail/goodsPrice.vue index da6f304..f8cfe69 100644 --- a/pages/product/addGoodDetail/goodsPrice.vue +++ b/pages/product/addGoodDetail/goodsPrice.vue @@ -256,13 +256,11 @@ uni.$u.toast(errList[0]) return } - console.log(this.attrValue) // 校验结束 this.formData.attr[0].detail = [] this.attrValue.forEach(item => { typeof(item.detail) == 'object' ? item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku) - console.log(this.formData.attr) this.formData.attr[0].detail.push(item.sku) }) this.formData.attrValue = this.attrValue @@ -270,11 +268,7 @@ item.is_use = item.is_use ? '0' : '1' }) let that = this - // this.formData.attrValue.forEach((item, index) => { - // item.detail.规格名 = this.formData.attr[index].value - // item.sku = this.formData.attr[index].value - - // }) + console.log(this.formData.attrValue) this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0' uni.redirectTo({ url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}` @@ -302,7 +296,6 @@ detail: [], }) } - console.log(this.formData) } }