Browse Source

修复砍价秒杀拼团数值不能连续添加的问题

master
hupeng 4 years ago
parent
commit
808a4b37ca
  1. 37
      src/views/activity/bargain/form.vue
  2. 19
      src/views/activity/combination/form.vue
  3. 20
      src/views/activity/seckill/form.vue

37
src/views/activity/bargain/form.vue

@ -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,11 +140,11 @@ export default {
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: '',
bargainMaxPrice: '',
bargainMinPrice: '',
bargainNum: '',
minPrice: 0,
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: 1,
description: '',
giveIntegral: '',
@ -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;

19
src/views/activity/combination/form.vue

@ -69,7 +69,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="拼团人数" prop="people">
<el-input-number v-model="formValidate.people" />
<el-input-number :min="1" :max="99" v-model="formValidate.people" />
</el-form-item>
</el-col>
@ -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);

20
src/views/activity/seckill/form.vue

@ -65,7 +65,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="产品轮播图">
<MaterialList v-model="formValidate.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
@ -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;

Loading…
Cancel
Save