From c2a7d375ec715826fbdb4d1badb9661fc5d5fda2 Mon Sep 17 00:00:00 2001 From: chenjiajun Date: Sun, 15 Nov 2020 21:04:44 +0800 Subject: [PATCH] fix bug --- src/views/activity/bargain/form.vue | 41 +++++++++++++++---------- src/views/activity/combination/form.vue | 19 +++++++----- src/views/activity/seckill/form.vue | 20 +++++++----- src/views/components/Editor.vue | 3 +- src/views/shop/order/index.vue | 2 +- src/views/tools/aliPay/config.vue | 4 +-- 6 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/views/activity/bargain/form.vue b/src/views/activity/bargain/form.vue index ef89328..5601330 100644 --- a/src/views/activity/bargain/form.vue +++ b/src/views/activity/bargain/form.vue @@ -3,7 +3,7 @@ - + @@ -121,6 +121,11 @@ export default { } }, form: { + //that.form.minPrice = 0 + //that.form.num = 1 + //that.form.bargainMaxPrice = 0 + //that.form.bargainMinPrice = 0 + //that.form.bargainNum = 1 id: '', productId: '', title: '', @@ -135,14 +140,14 @@ export default { stopTime: '', storeName: '', price: '', - minPrice: '', - num: '', - bargainMaxPrice: '', - bargainMinPrice: '', - bargainNum: '', + minPrice: 0, + num: 1, + bargainMaxPrice: 0, + bargainMinPrice: 0, + bargainNum: 1, status: 1, description: '', - giveIntegral: '', + giveIntegral: 0, info: '', cost: '', sort: 0, @@ -164,12 +169,13 @@ export default { }, watch: { 'form.imageArr': function(val) { - if (val) { + if (val && Array.isArray(val)) { this.form.image = val.join(',') } }, 'form.sliderImageArr': function(val) { - if (val) { + console.log("aaa:"+val) + if (val && Array.isArray(val)) { this.form.images = val.join(',') } }, @@ -186,10 +192,13 @@ export default { let that = this; getInfo(id).then(async res => { let data = res.productInfo; - console.log('data:'+data) + console.info('data:'+JSON.stringify(data)) if(data){ let cate_id = parseInt(data.cate_id) || 0; - that.form = data; + //that.form = data; + Object.keys(that.form).forEach(key=>{ + if(data[key]) that.form[key] = data[key]; + }) that.form.productId = data.id that.form.cate_id = cate_id; that.form.title = data.store_name @@ -198,11 +207,11 @@ export default { that.form.imageArr = data.image that.form.sliderImageArr = data.slider_image that.form.status = 1 - that.form.minPrice = 0 - that.form.num = 1 - that.form.bargainMaxPrice = 0 - that.form.bargainMinPrice = 0 - that.form.bargainNum = 1 + //that.form.minPrice = 0 + //that.form.num = 1 + //that.form.bargainMaxPrice = 0 + //that.form.bargainMinPrice = 0 + //that.form.bargainNum = 1 } that.templateList = res.tempList; diff --git a/src/views/activity/combination/form.vue b/src/views/activity/combination/form.vue index 4e49356..b6462fb 100644 --- a/src/views/activity/combination/form.vue +++ b/src/views/activity/combination/form.vue @@ -69,7 +69,7 @@ - + @@ -258,10 +258,10 @@ export default { sliderImageArr: [], title: '', attr: '', - people: '1', + people: 1, info: '', price: '', - sort: '', + sort: 0, sales: '', stock: '', addTime: '', @@ -274,7 +274,7 @@ export default { description: '', startTime: '', stopTime: '', - effectiveTime: '', + effectiveTime: 1, cost: '', unitName: '', combination: 1, @@ -376,7 +376,7 @@ export default { // }, 'formValidate.slider_image': function(val) { - if (val) { + if (val && Array.isArray(val)) { this.formValidate.images = val.join(',') } }, @@ -510,15 +510,18 @@ export default { let data = res.productInfo; if(data){ that.attrs = data.items || []; - that.formValidate = data; + //that.formValidate = data; + Object.keys(that.formValidate).forEach(key=>{ + if(data[key]) that.formValidate[key] = data[key]; + }) that.formValidate.id = 0; that.formValidate.productId = id that.formValidate.title = data.store_name that.formValidate.info = data.store_info that.formValidate.unitName = data.unit_name that.formValidate.isShow = 1 - that.formValidate.people = 1 - that.formValidate.effectiveTime = 1 + // that.formValidate.people = 0 + // that.formValidate.effectiveTime = 0 that.oneFormValidate = [data.attr]; that.formValidate.header = []; that.generate(null); diff --git a/src/views/activity/seckill/form.vue b/src/views/activity/seckill/form.vue index 730b380..ce855ec 100644 --- a/src/views/activity/seckill/form.vue +++ b/src/views/activity/seckill/form.vue @@ -65,7 +65,7 @@ - + @@ -252,10 +252,11 @@ export default { } }, formValidate: { + slider_image: [], otPrice: '', giveIntegral: '', status: '', - num: '', + num: 1, id: 0, timeId: null, seckillId: 0, @@ -270,7 +271,7 @@ export default { people: '', info: '', price: '', - sort: '', + sort: 0, sales: '', stock: '', addTime: '', @@ -279,7 +280,7 @@ export default { isDel: 0, merUse: '', isPostage: '', - postage: '', + postage: 0, description: '', startTime: '', stopTime: '', @@ -377,7 +378,7 @@ export default { watch: { 'formValidate.slider_image': function(val) { - if (val) { + if (val && Array.isArray(val)) { this.formValidate.images = val.join(',') } }, @@ -515,7 +516,10 @@ export default { if(data){ let cate_id = parseInt(data.cate_id) || 0; that.attrs = data.items || []; - that.formValidate = data; + //that.formValidate = data; + Object.keys(that.formValidate).forEach(key=>{ + if(data[key]) that.formValidate[key] = data[key]; + }) that.formValidate.id = 0; that.formValidate.productId = id that.formValidate.cate_id = cate_id; @@ -523,9 +527,9 @@ export default { that.formValidate.title = data.store_name that.formValidate.info = data.store_info that.formValidate.unitName = data.unit_name - that.formValidate.sliderImageArr = data.slider_image + //that.formValidate.sliderImageArr = data.slider_image that.formValidate.status = 1 - that.formValidate.num = 1 + //that.formValidate.num = 1 that.formValidate.header = []; that.generate(null); that.manyFormValidate = data.attrs; diff --git a/src/views/components/Editor.vue b/src/views/components/Editor.vue index 1426c9b..a9f9d6b 100644 --- a/src/views/components/Editor.vue +++ b/src/views/components/Editor.vue @@ -41,9 +41,8 @@ export default { } }, mounted() { - // console.log(222) - console.log(this.value) this.editor = new E(this.$refs.editor) + this.editor.customConfig = this.editor.customConfig ? this.editor.customConfig : this.editor.config this.editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片 // 不可修改 this.editor.customConfig.uploadImgHeaders = this.headers diff --git a/src/views/shop/order/index.vue b/src/views/shop/order/index.vue index 5725171..7ab559c 100644 --- a/src/views/shop/order/index.vue +++ b/src/views/shop/order/index.vue @@ -664,7 +664,7 @@ orderNum += 1; orderPrice += item.totalPrice; storeNum += item.totalNum; - user.push(item.userDTO.account); + user.push(item.userDTO.nickname); }) user = Array.from(new Set(user)); this.caculateInfo = { diff --git a/src/views/tools/aliPay/config.vue b/src/views/tools/aliPay/config.vue index 8e01f39..c0c2953 100644 --- a/src/views/tools/aliPay/config.vue +++ b/src/views/tools/aliPay/config.vue @@ -1,6 +1,6 @@