Commit 66a4a652 by crushh

update: dist

parent 8dc50a78
......@@ -28,9 +28,9 @@
</div>
<div class="rightForm">
<dm-steps :active="active" simple>
<dm-step title="1.基础配置" @click.native="active = 0"></dm-step>
<dm-step title="2.奖项配置" @click.native="active = 1"></dm-step>
<dm-step title="3.规则配置" @click.native="active = 2"></dm-step>
<dm-step title="1.基础配置"></dm-step>
<dm-step title="2.奖项配置"></dm-step>
<dm-step title="3.规则配置"></dm-step>
</dm-steps>
<div class="formContent">
<baseConfig :gameStatus="gameStatus" :templateArr="templateData" :echoData="baseForm" v-show="active == 0" @change="handleBaseConfigChange" @nextStep="data => nextStep(1, data)" />
......@@ -142,9 +142,10 @@ export default {
this.gameStatus = status;
}
const { ruleId, winChance, filterJson, filterJsonView, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, shareRuleDesc } = gameRuleInfo;
gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.parse(item.conditionJson);
});
gameRuleConditionList &&
gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.parse(item.conditionJson);
});
let cardIdArr = [];
gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
......
......@@ -156,9 +156,7 @@ import Sortable from 'sortablejs';
export default {
data() {
const prizeNoticeStockVal = (rule, value, callback) => {
if (this.prizeForm.prizeNoticeFlag) {
console.log(value);
console.log(new RegExp('([1-9]{1}\\d{0,9})|(0{1})').test(value));
if (this.prizeForm.prizeNoticeFlag == 1) {
if (!new RegExp('([1-9]{1}\\d{0,9})|(0{1})').test(value)) {
callback(new Error('请输入不超过1000000的数字'));
return;
......@@ -393,18 +391,27 @@ export default {
},
submit() {
let invalid = false;
let arr = [];
this.prizeForm.gamePrizeList.forEach(item => {
if (item.prizeType == 2 && item.status != 0 && !item.isOld) {
invalid = true;
this.$message.error(`${item.prizeName}${item.status == 1 ? '删除' : '失效'},请重新关联奖品`);
return;
}
if (item.prizeType == 0) {
arr.push(item);
}
});
if (!arr.length) {
this.$message.error('请至少包含一个谢谢参与的奖项');
return;
}
if (invalid) return;
this.$refs.prizeForm.validate((val, obj) => {
if (val) {
const data = { ...this.prizeForm };
let data = { ...this.prizeForm };
data = JSON.parse(JSON.stringify(data));
data.gamePrizeList.forEach(item => {
if (item.prizeImageUrl) {
item.prizeImageUrl = item.prizeImageUrl.imgUrl || '';
......
......@@ -129,7 +129,7 @@ import gicNewMemberGroup from '@/components/dm-new-member-group/index.vue';
export default {
data() {
const filterJsonVal = (rule, value, callback) => {
if ((this.ruleForm.memberType == 0 && !this.ruleForm.hasSearchData) || (this.ruleForm.memberType == 1 && !this.selectedGroupIds)) {
if (this.ruleForm.memberType == 1 && !this.selectedGroupIds) {
callback(new Error('请选择参与人群'));
return;
}
......@@ -253,9 +253,10 @@ export default {
echoData(val) {
const { ruleId, filterJson, filterJsonView, gameRuleConditionList, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, shareRuleDesc, memberWeightView, creatorId } = val;
let obj = {};
gameRuleConditionList.forEach(item => {
obj[item.conditionType] = item;
});
gameRuleConditionList &&
gameRuleConditionList.forEach(item => {
obj[item.conditionType] = item;
});
this.ruleForm.gameRuleConditionList.forEach(item => {
if (obj[item.type]) {
item.conditionType = obj[item.type].conditionType;
......
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