Commit 519ea4e8 by crushh

update: dist

parent d8bbcd11
......@@ -21,8 +21,8 @@
<div class="iphone">
<span class="gameTitle">{{ gameName }}</span>
<img src="../../../assets/img/Navbar.png" alt="" />
<gameTemplate :ruleData="ruleData" :templateId="templateId" :basicData="previewData" v-if="menuActive == 0" />
<img :src="computedImg" v-else style="min-height:724px;" />
<gameTemplate :ruleData="ruleData" :templateId="templateId" :basicData="previewData" v-show="menuActive == 0" />
<img :src="computedImg" v-show="menuActive != 0" style="min-height:724px;" />
</div>
</div>
<div class="rightForm" v-show="!isInfo">
......@@ -41,7 +41,7 @@
</div>
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true" :showFooter="true" :showClose="false">
<el-button @click="editRenew">重新编辑</el-button>
<el-button type="primary" @click="window.close()">进入游戏列表</el-button>
<el-button type="primary" @click="goList">进入游戏列表</el-button>
</links>
</div>
</template>
......@@ -67,7 +67,7 @@ export default {
prizeMax: 10,
prizeMin: 1,
gameName: '游戏名称',
templateId: '',
templateId: 1,
menuList: ['首页', '活动规则', '我的奖品', '中奖', '未中奖', '分享效果'],
bgImg: '',
tipsImg: '',
......@@ -94,7 +94,13 @@ export default {
0: {},
1: {}
},
previewData: {}
previewData: {},
documentTitle: {
edit: '幸运盲盒编辑',
add: '幸运盲盒新建',
copy: '幸运盲盒复制',
info: '幸运盲盒查看'
}
};
},
computed: {
......@@ -121,9 +127,7 @@ export default {
},
mounted() {
this.getGameTemplateByType();
window.addEventListener('scroll', function(e) {
console.log('scroll');
});
document.title = this.documentTitle[this.$route.meta.type];
},
watch: {
templateId(val) {
......@@ -400,6 +404,9 @@ export default {
window.location.href = window.location.origin + `/marketing/#/game/cmh/edit/${this.gameId}`;
window.location.reload();
// this.$router.push(`/game/cmh/edit/${this.gameId}`);
},
goList() {
window.close();
}
}
};
......
......@@ -158,6 +158,7 @@ export default {
this.bulletImageUrl = bulletImageUrl;
this.backMusicFlag = backMusicFlag;
this.adsFlag = adsFlag;
console.log(this.boxImg);
}
}
}
......
......@@ -56,7 +56,7 @@
{{ prizeType[item.prizeType] }}
</td>
<td class="cell" style="minWidth:200px">
<div v-if="item.prizeType == 2">
<div v-if="item.prizeType == 2" class="flex">
<el-tag v-if="item.status == 1" size="mini" type="danger" class="tagIcon">删除</el-tag>
<el-tag v-if="item.status == 2" size="mini" type="danger" class="tagIcon">失效</el-tag>
<el-tooltip :content="item.cardName" placement="top">
......@@ -97,9 +97,7 @@
<el-descriptions column="3">
<el-descriptions-item label="参与人群">{{ form.gameRuleInfo.memberType == 0 && !form.gameRuleInfo.filterJson ? '全部人群' : '' }} </el-descriptions-item>
<el-descriptions-item label="适用人群说明" :labelStyle="labelStyle">
<div class="ellips">
{{ form.gameRuleInfo && form.gameRuleInfo.memberDesc }}
</div>
{{ form.gameRuleInfo && form.gameRuleInfo.memberDesc }}
</el-descriptions-item>
</el-descriptions>
<div v-show="form.gameRuleInfo.memberType == 0 && form.gameRuleInfo.filterJson">
......@@ -308,11 +306,15 @@ export default {
.invalid {
color: #909399;
}
.tagIcon {
margin-right: 4px;
}
.ellips {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 300px;
display: inline-block;
}
.section {
padding: 20px 0 18px 0;
......
......@@ -28,20 +28,22 @@
<el-table-column min-width="132px">
<template slot="header"> <span class="needCell">奖项设置</span> </template>
<template slot-scope="{ row, $index }">
<div v-if="row.prizeType == 1">
<div v-if="row.prizeType == 2">
<el-form-item label-width="0" :prop="'gamePrizeList.' + $index + '.' + 'prizeNameStr'" :rules="rules.prizeNameStr">
<el-button type="text" @click="selectCard($index)" v-show="!row.prizeRelationId">选择卡券</el-button>
<div class="box" v-show="row.prizeRelationId">
<i v-show="!isDisabled || !row.isOld" class="cardIcon iconfont-components3 icon-cp-close-circle-fill" @click="delCard($index)"></i>
<div :class="['cardBox', row.status == 1 || row.status == 2 ? 'redBorder' : '']">
<el-tag v-show="row.status == 1" size="mini" type="danger" class="tagIcon">删除</el-tag>
<el-tag v-show="row.status == 2" size="mini" type="danger" class="tagIcon">失效</el-tag>
{{ row.prizeNameStr }}
</div>
</div>
</el-form-item>
</div>
<div v-else-if="row.prizeType == 1">
<el-form-item :prop="'gamePrizeList.' + $index + '.' + 'prizeNumber'" :rules="rules.prizeNumber" label-width="0"> <el-input class="inputClass-32" :disabled="isDisabled && row.isOld" v-model.number="row.prizeNumber" @change="val => handlePrizeNumChange(val, $index)" />积分 </el-form-item>
</div>
<el-form-item label-width="0" v-else-if="row.prizeType == 2">
<el-button type="text" @click="selectCard($index)" v-show="!row.prizeRelationId">选择卡券</el-button>
<div class="box" v-show="row.prizeRelationId">
<i v-show="!isDisabled || !row.isOld" class="cardIcon iconfont-components3 icon-cp-close-circle-fill" @click="delCard($index)"></i>
<div :class="['cardBox', row.status == 1 || row.status == 2 ? 'redBorder' : '']">
<el-tag v-show="row.status == 1" size="mini" type="danger" class="tagIcon">删除</el-tag>
<el-tag v-show="row.status == 2" size="mini" type="danger" class="tagIcon">失效</el-tag>
{{ row.prizeNameStr }}
</div>
</div>
</el-form-item>
<el-form-item label-width="0" v-else>
- -
</el-form-item>
......@@ -169,10 +171,12 @@ export default {
}
callback();
};
return {
rules: {
winChance: { type: 'number', required: true, message: '最大值100', max: 100, min: 0 },
prizeNumber: { type: 'number', required: true, message: '最大值1000000', max: 1000000, min: 1 },
prizeNameStr: { type: 'string', required: true, message: '请选择卡券' },
prizeStock: { type: 'number', required: true, message: '最大值1000000', max: 1000000, min: 0 },
prizeNoticeStock: { validator: prizeNoticeStockVal },
prizeName: { type: 'string', required: true, message: '请输入奖品名称' },
......@@ -257,9 +261,6 @@ export default {
if (item.prizeImageUrl) {
item.prizeImageUrl = { imgUrl: item.prizeImageUrl, code: item.prizeImageUrl };
}
if (item.prizeType == 2) {
item.prizeNameStr = item.prizeName;
}
if (this.isEdit) {
item.prizeStockOriginal = item.prizeStock;
} else {
......@@ -287,6 +288,7 @@ export default {
this.prizeForm.gamePrizeList.forEach(item => {
if (item.prizeType == 2 && val[item.prizeRelationId]) {
item.status = val[item.prizeRelationId].invalid;
item.prizeNameStr = val[item.prizeRelationId].name;
if (this.isEdit && item.isOld) {
item.max = item.prizeStock + val[item.prizeRelationId].stock;
} else {
......@@ -358,9 +360,11 @@ export default {
data.status = 0;
data.max = selectedData.couponStock;
this.prizeForm.gamePrizeList = this.prizeForm.gamePrizeList.splice(0);
this.$refs.prizeForm.validateField(`gamePrizeList.${this.index}.prizeNameStr`);
},
addPrize() {
this.prizeForm.gamePrizeList.push({ sort: this.prizeForm.gamePrizeList.length, exchangeType: 0, isOld: 0, prizeName: '' });
this.prizeForm.gamePrizeList.push({ sort: this.prizeForm.gamePrizeList.length, exchangeType: 0, isOld: 0, prizeName: '', prizeNameStr: '' });
},
del(index) {
this.prizeForm.gamePrizeList.splice(index, 1);
......@@ -371,11 +375,14 @@ export default {
data.prizeName = '';
data.prizeRelationId = '';
data.prizeImageUrl = '';
data.prizeNameStr = '';
console.log(data);
this.prizeForm.gamePrizeList = this.prizeForm.gamePrizeList.splice(0);
this.$refs.prizeForm.clearValidate(`gamePrizeList.${index}.prizeStock`);
this.$refs.prizeForm.validateField(`gamePrizeList.${index}.prizeStock`);
},
handleTypeChange(val, index) {
this.prizeForm.gamePrizeList[index].prizeName ? delete this.prizeForm.gamePrizeList[index].prizeName : '';
this.prizeForm.gamePrizeList[index].prizeNameStr ? delete this.prizeForm.gamePrizeList[index].prizeNameStr : '';
this.prizeForm.gamePrizeList[index].prizeNumber ? delete this.prizeForm.gamePrizeList[index].prizeNumber : '';
this.prizeForm.gamePrizeList[index].optNum ? delete this.prizeForm.gamePrizeList[index].optNum : '';
this.prizeForm.gamePrizeList[index].prizeImageUrl ? delete this.prizeForm.gamePrizeList[index].prizeImageUrl : '';
......@@ -427,8 +434,9 @@ export default {
validateData() {
let invalid = false;
let arr = [];
this.$refs.prizeForm.validate(val => {
this.$refs.prizeForm.validate((val, obj) => {
this.boolVal = val;
console.log(obj);
if (!val) {
this.scrollToError(this);
}
......
......@@ -23,12 +23,12 @@
</el-form-item>
<el-form-item label="适用人群说明" prop="memberDesc">
<el-input maxlength="100" type="textarea" class="w382" placeholder="请输入适用人群说明" v-model="ruleForm.memberDesc" show-word-limit :autosize="{ minRows: 4 }" />
<el-input maxlength="100" type="textarea" class="w382" placeholder="请输入适用人群说明" v-model="ruleForm.memberDesc" show-word-limit :autosize="{ minRows: 5 }" />
</el-form-item>
<el-form-item label="参与门槛" prop="playConditionFlag">
<el-radio-group v-model="ruleForm.playConditionFlag" :disabled="isDisabled">
<el-radio :label="0">无门槛</el-radio>
<el-radio :label="1">有门槛</el-radio>
<el-radio :label="0">无门槛</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
......@@ -139,7 +139,7 @@ export default {
data() {
const filterJsonVal = (rule, value, callback) => {
if (this.ruleForm.memberType == 1 && !this.selectedGroupIds) {
callback(new Error('请选择参与人群'));
callback(new Error('客户分组不能为空'));
return;
}
callback();
......@@ -179,7 +179,7 @@ export default {
hasSearchData: '',
memberType: 0,
memberDesc: '',
playConditionFlag: 0,
playConditionFlag: 1,
shareFlag: 0,
playTimes: 1000,
filterJsonView: '',
......@@ -354,7 +354,7 @@ export default {
this.ruleForm.gameRuleConditionList[1].conditionJson.dumpPath = link;
this.ruleForm.gameRuleConditionList[1].conditionJson.mpUrlView = linkData;
this.ruleForm.gameRuleConditionList = this.ruleForm.gameRuleConditionList.splice(0);
this.$refs.baseForm.validateField('gameRuleConditionList.' + 1 + '.conditionJson.' + 'mpUrlView');
this.$refs.ruleForm.validateField('gameRuleConditionList.' + 1 + '.conditionJson.' + 'mpUrlView');
});
},
beforeAvatarUpload(file, key, size1 = 1) {
......
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