Commit e9c4aaa5 by crushh

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

parents b3bc0027 6059d628
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp_marketing;window.webpackJsonp_marketing=function(r,c,o){for(var d,f,i,u=0,b=[];u<r.length;u++)f=r[u],a[f]&&b.push(a[f][0]),a[f]=0;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&(e[d]=c[d]);for(n&&n(r,c,o);b.length;)b.shift()();if(o)for(u=0;u<o.length;u++)i=t(t.s=o[u]);return i};var r={},a={24:0};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.e=function(e){var n=a[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,t){n=a[e]=[r,t]});n[2]=r;var c=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.timeout=12e4,t.nc&&o.setAttribute("nonce",t.nc),o.src=t.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"ecm",4:"message",5:"ewash",6:"scan",7:"recharge",8:"activity",9:"signIn",10:"evaluation",11:"cdKey",12:"popup",13:"msg",15:"calllog"}[e]||e)+"."+{0:"9df7b6d363b92e4c6a9e",1:"3920466424dd3d4adf12",2:"2d97ab8f38d7e456013e",3:"1721cf177828f3ef9e03",4:"2d43047a94aef3fd92d9",5:"8e2749d3a189eeb56c2e",6:"9a995f0cdff670d4f8d3",7:"e204eb08edf4921f88da",8:"8d9c6b1eac82ed1a52b3",9:"648d4e9bf392d8980030",10:"da8008653f8c25addc3a",11:"7c2067b1ba786ef1b65c",12:"f1227cca53669d779b78",13:"02b43cb717829d19e528",14:"be5aa3556f1c4057ad85",15:"410d734e15e42bc183a8",16:"91803d84dca88eb2778e",17:"6c7bfbfbe4bbd7a2633a",18:"3ba3b70d72322dd6fc56",19:"20596c2fde39ba8b7da1",20:"5dbfdb8d97c0910fdde0",21:"ad98c8e9d3749f2f1097"}[e]+".js";var d=setTimeout(f,12e4);function f(){o.onerror=o.onload=null,clearTimeout(d);var n=a[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),a[e]=void 0)}return o.onerror=o.onload=f,c.appendChild(o),r},t.m=e,t.c=r,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/marketing/",t.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -14,7 +14,6 @@ export default {
components: {
description
},
data() {
return {
collapseFlag: false,
......
......@@ -225,33 +225,23 @@ export default {
name: '拆盲盒列表',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/index.vue'),
meta: {
path: '/game/cmh',
keepAlive: true
}
},
{
path: 'cmh/statistics/:id',
name: '拆盲盒数据统计',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'statistics'
}
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue')
},
{
path: 'cmh/statistics/activityDetail/:id',
name: '拆盲盒数据统计-活动明细',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'statistics'
}
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue')
},
{
path: 'cmh/statistics/prizeDetail/:id',
name: '拆盲盒数据统计-奖品明细',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'statistics'
}
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue')
}
]
};
......@@ -261,9 +251,7 @@ export const cmhDetail = [
name: '新建拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'add',
path: '/game/cmh',
hiddenLayout: true
type: 'add'
}
},
{
......@@ -271,8 +259,7 @@ export const cmhDetail = [
name: '编辑拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'edit',
hiddenLayout: true
type: 'edit'
}
},
{
......@@ -288,8 +275,7 @@ export const cmhDetail = [
name: '复制拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'copy',
hiddenLayout: true
type: 'copy'
}
}
];
......@@ -94,7 +94,7 @@
</div>
<el-button type="text" @click="selectLink.show = true"> 选择链接 </el-button>
</el-form-item>
<linktools :remove="[5, 35]" :linkVisible.sync="selectLink.show" :linkData="selectLink.linkData" :can-save="true" :showType="0" @linkSelect="onSaveLink" />
<linktools :remove="[5, 35]" :linkVisible.sync="selectLink.show" :linkData="selectLink.linkData" :can-save="true" @linkSelect="onSaveLink" />
</div>
</el-form-item>
</div>
......@@ -296,7 +296,9 @@ export default {
this.prizeStyleJson = JSON.parse(item.materialValue);
this.baseForm['prizeStyleJson'] = JSON.parse(item.materialValue);
} else {
this.baseForm[item.materialKey] = item.materialValue;
if (!this.baseForm[item.materialKey]) {
this.baseForm[item.materialKey] = item.materialValue;
}
}
if (item.materialKey == 'backMusicUrl') {
if (echo) {
......@@ -341,6 +343,7 @@ export default {
},
handleAdsChange(obj) {
this.baseForm.adsImageUrl = obj.imgUrl;
this.$refs.baseForm.validateField('adsImageUrl');
this.$emit('change', this.baseForm);
},
replace(type, index) {
......@@ -356,6 +359,7 @@ export default {
this.selectLink.linkData = linkData;
this.baseForm.mpUrlView = JSON.stringify(linkData);
this.baseForm.adsLinkUrl = linkData.url;
this.$refs.baseForm.validateField('link');
},
handleNameChange(val) {
this.$emit('change', this.baseForm);
......
......@@ -39,9 +39,9 @@
<ruleConfig :gameStatus="gameStatus" :gameTime="gameTime" :shareCard="shareCard" :shareReport="shareReport" :echoData="ruleForm" v-show="active == 2" @nextStep="data => submit(3, data)" @prevStep="step => (active = step)" :btnLoading="btnLoading" />
</div>
</div>
<info :data="echoData" :invalidCard="invalidCard" v-show="isInfo" />
<info :data="echoData" :invalidCard="invalidCard" v-if="isInfo" />
</div>
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true" :showFooter="true">
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true" :showFooter="true" :showClose="false">
<el-button @click="editRenew">重新编辑</el-button>
<el-button type="primary" @click="$router.push('/game/cmh')">进入游戏列表</el-button>
</links>
......@@ -165,7 +165,7 @@ export default {
if (item.prizeType == 2) {
cardIdArr.push(item.prizeRelationId);
}
if (this.gameStatus == 1) {
if (this.isEdit) {
item.isOld = 1;
}
});
......@@ -241,8 +241,14 @@ export default {
console.log(data);
this.submitData = { ...this.submitData, ...data };
},
async handleGamePrizeList() {
const { gamePrizeList } = this.submitData;
async submit(step, data) {
this.submitData = { ...this.submitData, ...data };
console.log(this.submitData);
this.submitData = JSON.parse(JSON.stringify(this.submitData));
const { ruleId, winChance, filterJson, filterJsonView, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, gameRuleConditionList, gameName, gamePrizeList, prizeNoticeStock, prizeNoticeFlag, adsFlag, bulletFlag, backMusicFlag, templateId, gameRule, gameTime, gameExt } = this.submitData;
const gameRuleInfo = { ruleId, winChance, filterJson, filterJsonView, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, shareRuleDesc: gameName };
let cardIdArr = [];
gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
......@@ -261,23 +267,17 @@ export default {
this.$message.error('存在异常状态的卡券,请返回上一步修改卡券后再提交');
return;
}
let invalidCardName = [];
gamePrizeList.forEach(item => {
if (item.prizeType == 2 && item.prizeStock > result[item.prizeRelationId].stock) {
this.$message.error(`${item.prizeName}奖品数量高于关联库存,请修改奖品数量`);
return;
if (item.prizeType == 2 && !item.isOld && item.prizeStock > result[item.prizeRelationId].stock) {
invalidCardName.push(item.prizeName);
}
});
if (invalidCardName.length) {
this.$message.error(`${invalidCardName.join(',')}奖品数量高于关联库存,请修改奖品数量`);
return;
}
}
this.submitData = Object.assign({ gamePrizeList }, this.submitData);
},
submit(step, data) {
this.submitData = { ...this.submitData, ...data };
console.log(this.submitData);
this.submitData = JSON.parse(JSON.stringify(this.submitData));
this.handleGamePrizeList();
const { ruleId, winChance, filterJson, filterJsonView, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, gameRuleConditionList, gameName, gamePrizeList, prizeNoticeStock, prizeNoticeFlag, adsFlag, bulletFlag, backMusicFlag, templateId, gameRule, gameTime, gameExt } = this.submitData;
const gameRuleInfo = { ruleId, winChance, filterJson, filterJsonView, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, shareRuleDesc: gameName };
gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.stringify(item.conditionJson);
});
......
......@@ -211,6 +211,40 @@ export default {
created() {
this.getTableList();
},
activated() {
console.log('activated');
console.log(this.$route.meta.refresh);
if (this.$route.meta.refresh) {
this.dateTime = [];
this.listParams = {
gameName: '',
status: '',
startTime: '',
endTime: '',
pageNum: 1,
pageSize: 20
};
}
console.log(JSON.stringify(this.listParams));
this.getTableList();
},
beforeRouteEnter(to, from, next) {
// const {
// meta: { type, path, refresh }
// } = from;
// console.log(type, path, refresh);
// if (path !== '/cmh') {
// to.meta.refresh = true;
// } else {
// if (type === 'add' && refresh) {
// to.meta.refresh = true;
// } else {
// to.meta.refresh = false;
// }
// }
console.log(to.meta.refresh);
next();
},
methods: {
getLink(row) {
const { startDate, gameId, gameName } = row;
......
......@@ -185,7 +185,8 @@ export default {
return {
toggleTag: false,
form: {
gameRuleInfo: {}
gameRuleInfo: {},
memberWeightView: {}
},
hasSearchData: '',
isPlay: false,
......@@ -207,8 +208,29 @@ export default {
},
watch: {
data(val) {
this.form = JSON.parse(JSON.stringify(val));
if (this.form.playConditionFlag == 1) {
// const {
// gameRuleInfo, // 游戏规则信息
// gameRuleConditionList, // 游戏规则-参与门槛
// gamePrizeList, //游戏奖品信息
// gameExt,
// prizeNoticeStock,
// prizeNoticeFlag,
// adsFlag,
// bulletFlag,
// backMusicFlag,
// templateId,
// gameRule,
// startDate,
// endDate,
// gameName,
// memberWeightView,
// creatorId,
// gameId,
// status
// } = val;
this.form = { ...val };
console.log(this.form);
if (this.form.gameRuleInfo.playConditionFlag == 1) {
this.form.gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.parse(item.conditionJson);
});
......
......@@ -196,7 +196,6 @@ export default {
prizeName: '谢谢参与',
prizeImageUrl: '',
prizeNumber: 1,
prizeStock: -1,
exchangeType: 0
}
]
......@@ -216,7 +215,8 @@ export default {
}
],
index: 0,
isEdit: this.$route.meta.type === 'edit'
isEdit: this.$route.meta.type === 'edit',
boolVal: true
};
},
props: {
......@@ -262,6 +262,7 @@ export default {
console.log(this.prizeForm);
},
invalidCard(val) {
console.log('invalidCard====>');
this.prizeForm.gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
item.status = val[item.prizeRelationId].invalid;
......@@ -355,6 +356,10 @@ export default {
},
handleTypeChange(val, index) {
console.log(val, index);
this.prizeForm.gamePrizeList[index].prizeName ? delete this.prizeForm.gamePrizeList[index].prizeName : '';
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 : '';
if (val == 0) {
this.calculateRate();
this.prizeForm.gamePrizeList[index].prizeImageUrl = '';
......@@ -364,6 +369,7 @@ export default {
} else if (val == 1) {
this.prizeForm.gamePrizeList[index].prizeImageUrl = { imgUrl: this.imgeType[3], code: this.imgeType[3] };
}
this.$refs.prizeForm.clearValidate(`gamePrizeList.${index}.prizeStock`);
this.prizeForm.gamePrizeList = this.prizeForm.gamePrizeList.splice(0);
},
handlePrizeNumChange(val, index) {
......@@ -396,6 +402,13 @@ export default {
submit() {
let invalid = false;
let arr = [];
this.$refs.prizeForm.validate(val => {
this.boolVal = val;
if (!val) {
this.scrollToError(this);
}
});
if (!this.boolVal) return;
this.prizeForm.gamePrizeList.forEach(item => {
if (item.prizeType == 2 && item.status != 0 && !item.isOld) {
invalid = true;
......@@ -411,32 +424,36 @@ export default {
return;
}
if (invalid) return;
if (this.prizeForm.gamePrizeList.length < this.prizeMin) {
this.$message.error(`请配置至少${this.prizeMin}个奖项`);
return;
}
if (this.prizeForm.gamePrizeList.length > this.prizeMax) {
this.$message.error(`请配置最多${this.prizeMax}个奖项`);
return;
}
this.$refs.prizeForm.validate((val, obj) => {
if (val) {
let data = { ...this.prizeForm };
data = JSON.parse(JSON.stringify(data));
data.gamePrizeList.forEach(item => {
if (item.prizeImageUrl) {
item.prizeImageUrl = item.prizeImageUrl.imgUrl || '';
}
if (item.prizeType != 0) {
if (this.isEdit && item.isOld) {
let num = item.prizeStock - item.prizeStockOriginal;
item.optNum = num;
} else {
item.optNum = item.prizeStock;
}
} else {
item.optNum = -1;
}
});
this.$emit('nextStep', data);
let data = { ...this.prizeForm };
data = JSON.parse(JSON.stringify(data));
data.gamePrizeList.forEach(item => {
if (item.prizeImageUrl) {
item.prizeImageUrl = item.prizeImageUrl.imgUrl || '';
}
if (item.prizeType == 0) {
item.prizeStock = -1;
}
if (item.prizeType != 0) {
if (this.isEdit && item.isOld) {
let num = item.prizeStock - item.prizeStockOriginal;
item.optNum = num;
} else {
item.optNum = item.prizeStock;
}
} else {
this.scrollToError(this);
item.optNum = -1;
}
console.log(obj);
});
this.$emit('nextStep', data);
}
}
};
......
<template>
<el-dialog title="游戏预览" :visible.sync="show" width="600px" :before-close="close">
<el-dialog title="游戏预览" :visible.sync="show" width="600px" :before-close="close" :show-close="showClose">
<div class="link-tip">
<i class="el-icon-info"></i>
非会员进入游戏页面将提示进行认证注册成为会员,认证成功后自动返回游戏页面
......@@ -61,6 +61,10 @@ export default {
isNew: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
}
},
data() {
......
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