Commit 469556b0 by chenwq

秒杀活动改代码

1 parent 6635021b
......@@ -170,7 +170,8 @@ export default {
name: 'activityName',
width: '320px',
type: 'input',
maxlength: 20
maxlength: 20,
isDisabled: false
},
{
label: '活动宣传图',
......@@ -179,6 +180,7 @@ export default {
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -193,7 +195,8 @@ export default {
name: 'promotion',
width: '320px',
type: 'input',
maxlength: 20
maxlength: 20,
isDisabled: false
},
{
label: '活动时间',
......@@ -227,9 +230,7 @@ export default {
this.apear = 'see'
this.title = '查看'
this.isDisabled = true
this.editFormData[0].isDisabled = true
this.editFormData[1].isDisabled = true
this.editFormData[2].isDisabled = true
this.changeFormAttr('editFormData', 'isDisabled', ['活动名称', '活动宣传图', '活动宣传语'], true)
} else if (addOrEdit == 2) {
this.apear = 'edit'
this.title = '编辑'
......@@ -256,6 +257,12 @@ export default {
},
methods: {
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
limitPriceForInput(val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var _regRule = regRule || 'priceReg'
if (val && this.reg[_regRule].test(val + '')) {
......@@ -309,11 +316,11 @@ export default {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.editFormData[5].isHide = false
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.editFormData[5].isHide = true
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
......@@ -465,7 +472,7 @@ export default {
delete param.activityPrice
delete param.goodsStock
param.specificationDetailList = []
this.nameToValSpecsList.forEach(function(item) {
this.nameToValSpecsList.forEach(function (item) {
var obj = {
retailPrice: (item.activityPrice * 100).toFixed(0), //存的分,需乘100
stock: item.goodsStock,
......@@ -548,7 +555,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!