Commit 398fc1be by crushh

Merge branch 'feature/游戏营销' into master

parents 71b2cd8f b3a4b2f7
......@@ -3,7 +3,7 @@
<dm-sub-title type="line">基本信息</dm-sub-title>
<div class="mt20">
<el-form-item label="游戏名称" prop="gameName"> <el-input maxlength="10" class="w382" @change="handleNameChange" v-model.trim="baseForm.gameName" show-word-limit :disabled="isDisabled" placeholder="请输入游戏名称" /> </el-form-item>
<el-form-item label="游戏时间" prop="gameTime"><el-date-picker class="w382" v-model="baseForm.gameTime" :disabled="isDisabled" :picker-options="pickerOptions" value-format="timestamp" @change="handleDateChange" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker></el-form-item>
<el-form-item label="游戏时间" prop="gameTime"><el-date-picker class="w382" v-model="baseForm.gameTime" :disabled="isDisabled" :picker-options="pickerOptions" value-format="timestamp" @change="handleDateChange(val, 'gameTime')" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker></el-form-item>
<el-form-item label="游戏说明" prop="gameRule"> <el-input maxlength="500" class="w382" v-model="baseForm.gameRule" show-word-limit :autosize="{ minRows: 4 }" type="textarea" /> </el-form-item>
</div>
<dm-sub-title type="line">展示信息配置</dm-sub-title>
......@@ -253,7 +253,7 @@ export default {
handleDateChange(val, type) {
console.log(val, type);
this.$emit('change', this.baseForm);
if (type) {
if (type == 'adsFlag') {
this.$nextTick(_ => {
const adsImg = document.getElementsByClassName('adsImg');
adsImg[0].scrollIntoView({
......@@ -264,6 +264,8 @@ export default {
behavior: 'smooth'
});
});
} else if (type == 'gameTime' && this.baseForm.gameTime && this.baseForm.gameTime.length) {
this.baseForm.gameTime[1] = this.baseForm.gameTime[1] + 86399000;
}
},
handleTemplateChange(val) {
......
......@@ -182,7 +182,7 @@ export default {
memberDesc: '',
playConditionFlag: 1,
shareFlag: 0,
playTimes: 1000,
playTimes: '',
filterJsonView: '',
shareImageUrl: '',
memberWeightView: { searchId: '' },
......@@ -299,10 +299,9 @@ export default {
console.log(this.ruleForm);
},
gameTime(val) {
if (val.length) {
console.log(val[1] - val[0]);
console.log((val[1] - val[0]) / (24 * 60 * 60 * 1000) + 1);
this.gameDays = (val[1] - val[0]) / (24 * 60 * 60 * 1000) + 1;
if (val && val.length) {
this.gameDays = (val[1] - val[0]) / (24 * 60 * 60 * 1000);
console.log(this.gameDays);
this.gameDays = this.gameDays.toFixed();
}
}
......@@ -406,6 +405,16 @@ export default {
this.$refs.ruleForm.clearValidate(name);
},
validateData() {
this.$refs.ruleForm.validate(val => {
this.boolVal = val;
if (!val) {
this.scrollToError(this);
}
});
if (!this.boolVal) {
this.$message.error('请确认规则设置的必填字段都已填写且通过校验');
return false;
}
if (this.ruleForm.memberType == 0 && this.toggleTag && !this.ruleForm.filterJsonView) {
this.$message.error('人群筛选未保存条件');
return false;
......@@ -422,16 +431,7 @@ export default {
return false;
}
}
this.$refs.ruleForm.validate(val => {
this.boolVal = val;
if (!val) {
this.scrollToError(this);
}
});
if (!this.boolVal) {
this.$message.error('请确认规则设置的必填字段都已填写且通过校验');
return false;
}
return true;
},
nextStep(noNext) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment