This commit is contained in:
zmj 2024-05-15 18:36:33 +08:00
parent c5a5557da8
commit 39a49b1b43
2 changed files with 17 additions and 9 deletions

View File

@ -722,7 +722,7 @@
}) })
}, },
submit() { submit() {
// console.log(this.formData) console.log(this.formData)
this.$refs.formData.validate().then(res => { this.$refs.formData.validate().then(res => {
this.handAdd() this.handAdd()
}).catch(errors => { }).catch(errors => {
@ -768,6 +768,12 @@
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
this.isSet2() this.isSet2()
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',') 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) { if (option.product_id) {
this.formData.product_id = option.product_id this.formData.product_id = option.product_id
this.mode = 'edit' this.mode = 'edit'
@ -781,9 +787,18 @@
delete this.formData.image_list delete this.formData.image_list
if (!this.formData.imageList) this.formData.imageList = [] if (!this.formData.imageList) this.formData.imageList = []
this.oldToNew(this.formData) 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(this.formData, 'formDATA')
}) })
} }
console.log(JSON.parse(option.formData))
}, },
onBackPress: function(e) { onBackPress: function(e) {
this.showlay = true this.showlay = true

View File

@ -256,13 +256,11 @@
uni.$u.toast(errList[0]) uni.$u.toast(errList[0])
return return
} }
console.log(this.attrValue)
// //
this.formData.attr[0].detail = [] this.formData.attr[0].detail = []
this.attrValue.forEach(item => { this.attrValue.forEach(item => {
typeof(item.detail) == 'object' ? typeof(item.detail) == 'object' ?
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku) 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.attr[0].detail.push(item.sku)
}) })
this.formData.attrValue = this.attrValue this.formData.attrValue = this.attrValue
@ -270,11 +268,7 @@
item.is_use = item.is_use ? '0' : '1' item.is_use = item.is_use ? '0' : '1'
}) })
let that = this let that = this
// this.formData.attrValue.forEach((item, index) => { console.log(this.formData.attrValue)
// item.detail. = this.formData.attr[index].value
// item.sku = this.formData.attr[index].value
// })
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0' this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
uni.redirectTo({ uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}` url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
@ -302,7 +296,6 @@
detail: [], detail: [],
}) })
} }
console.log(this.formData)
} }
} }