Commit 0b3ac2b8 by crushh

update: dist

parents 67c88ec0 21f34e5b
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title></title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//at.alicdn.com/t/font_3229694_f4zx0uhc8y.css><script src=//at.alicdn.com/t/font_3229694_f4zx0uhc8y.js></script><link rel=stylesheet href=//at.alicdn.com/t/font_2996579_1d7th3zc6it.css><script src=//at.alicdn.com/t/font_2996579_1d7th3zc6it.js></script><link src=//at.alicdn.com/t/font_2859043_udehp133w1.css><script src=//at.alicdn.com/t/font_2859043_udehp133w1.js></script><link href=/marketing/static/css/main.e6025e8230bcef5e075c6b77ab62070f.css rel=stylesheet></head><body><div id=app><div class=el-loading-spinner style="width: 98%;"><svg viewBox="25 25 50 50" class=circular><circle cx=50 cy=50 r=20 fill=none class=path></circle></svg></div></div><script>(function() {
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title></title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//at.alicdn.com/t/font_3229694_f4zx0uhc8y.css><script src=//at.alicdn.com/t/font_3229694_f4zx0uhc8y.js></script><link rel=stylesheet href=//at.alicdn.com/t/font_2996579_1d7th3zc6it.css><script src=//at.alicdn.com/t/font_2996579_1d7th3zc6it.js></script><link src=//at.alicdn.com/t/font_2859043_udehp133w1.css><script src=//at.alicdn.com/t/font_2859043_udehp133w1.js></script><link href=/marketing/static/css/main.966989d8056dfdc3bbbe7087713985cf.css rel=stylesheet></head><body><div id=app><div class=el-loading-spinner style="width: 98%;"><svg viewBox="25 25 50 50" class=circular><circle cx=50 cy=50 r=20 fill=none class=path></circle></svg></div></div><script>(function() {
var src = '/component/static/import-component.js?timestrap=' + new Date().getTime();
var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host;
document.write('<script src="//' + host + src + '"><\/script>');
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/upload-file.1.0.10.js></script><script type=text/javascript src=/marketing/static/js/manifest.c0b4c8a05a5e1b40e212.js></script><script type=text/javascript src=/marketing/static/js/vendor.f17f3d28b64b648f6606.js></script><script type=text/javascript src=/marketing/static/js/main.47e9a9414b50c78a8ffd.js></script></body></html>
\ No newline at end of file
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/upload-file.1.0.10.js></script><script type=text/javascript src=/marketing/static/js/manifest.fb17607178359fc99f98.js></script><script type=text/javascript src=/marketing/static/js/vendor.f17f3d28b64b648f6606.js></script><script type=text/javascript src=/marketing/static/js/main.e948bddc0356249bab8c.js></script></body></html>
\ No newline at end of file
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 a=window.webpackJsonp_marketing;window.webpackJsonp_marketing=function(n,c,o){for(var d,f,i,u=0,b=[];u<n.length;u++)f=n[u],r[f]&&b.push(r[f][0]),r[f]=0;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&(e[d]=c[d]);for(a&&a(n,c,o);b.length;)b.shift()();if(o)for(u=0;u<o.length;u++)i=t(t.s=o[u]);return i};var n={},r={24:0};function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.e=function(e){var a=r[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var n=new Promise(function(n,t){a=r[e]=[n,t]});a[2]=n;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:"632f7f37dc48f13d197e",2:"2d97ab8f38d7e456013e",3:"a741212ac8ec32665405",4:"2d43047a94aef3fd92d9",5:"8e2749d3a189eeb56c2e",6:"9a995f0cdff670d4f8d3",7:"e204eb08edf4921f88da",8:"8d9c6b1eac82ed1a52b3",9:"648d4e9bf392d8980030",10:"da8008653f8c25addc3a",11:"7c2067b1ba786ef1b65c",12:"f1227cca53669d779b78",13:"561f1251a85d1802fce4",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 a=r[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}return o.onerror=o.onload=f,c.appendChild(o),n},t.m=e,t.c=n,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="/marketing/",t.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp_marketing;window.webpackJsonp_marketing=function(r,c,o){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],a[d]&&b.push(a[d][0]),a[d]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);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:"5a15f5ff36fff690959e",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 f=setTimeout(d,12e4);function d(){o.onerror=o.onload=null,clearTimeout(f);var n=a[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),a[e]=void 0)}return o.onerror=o.onload=d,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
<template>
<div>
<dm-layout :projectName="projectName" v-if="$store.getters.getShowLayout">
<dm-layout :projectName="projectName">
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!this.$route.meta.keepAlive" />
</dm-layout>
<div v-else>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!this.$route.meta.keepAlive" />
</div>
</div>
</template>
<script>
......
import Vue from 'vue';
import Router from 'vue-router';
import routes from './routes';
import store from '@/store';
import axios from 'axios';
// import axios from 'axios';
console.log(routes);
Vue.use(Router);
let router = new Router({
......@@ -29,29 +29,27 @@ router.beforeEach((to, from, next) => {
Object.keys(to.params).map(key => {
path = path.replace(to.params[key], `:${key}`);
});
if (to.meta.hiddenLayout) {
store.dispatch('setShowLayout', false);
}
axios
.get(`/api-plug/rate-limit?requestPath=${path}&enterpriseId=${store.state.marketing.enterpriseId}`)
.then(limitRes => {
// 这个接口不规范 不用封装的request
// code: 0正常 1必填参数未填写 2限流
if (limitRes.data.resultCode == 1) {
store.commit('updateLimit', true); // 更新正在限流
next({ path: '/limit' });
} else {
store.commit('updateLimit', false);
if (to.path == '/limit') {
next('/');
}
next();
}
})
.catch(() => {
next();
});
// next();
// axios
// .get(`/api-plug/rate-limit?requestPath=${path}&enterpriseId=${store.state.marketing.enterpriseId}`)
// .then(limitRes => {
// // 这个接口不规范 不用封装的request
// // code: 0正常 1必填参数未填写 2限流
// if (limitRes.data.resultCode == 1) {
// store.commit('updateLimit', true); // 更新正在限流
// next({ path: '/limit' });
// } else {
// store.commit('updateLimit', false);
// if (to.path == '/limit') {
// next('/');
// }
// next();
// }
// })
// .catch(() => {
// next();
// });
next();
});
export default router;
......@@ -230,42 +230,6 @@ export default {
}
},
{
path: 'cmh/add',
name: '新建拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'add',
path: '/game/cmh',
hiddenLayout: true
}
},
{
path: 'cmh/edit/:id',
name: '编辑拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'edit',
hiddenLayout: true
}
},
{
path: 'cmh/info/:id',
name: '查看拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/info.vue'),
meta: {
type: 'info'
}
},
{
path: 'cmh/copy/:id',
name: '复制拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'copy',
hiddenLayout: true
}
},
{
path: 'cmh/statistics/:id',
name: '拆盲盒数据统计',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
......@@ -291,3 +255,41 @@ export default {
}
]
};
export const cmhDetail = [
{
path: '/game/cmh/add',
name: '新建拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'add',
path: '/game/cmh',
hiddenLayout: true
}
},
{
path: '/game/cmh/edit/:id',
name: '编辑拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'edit',
hiddenLayout: true
}
},
{
path: '/game/cmh/info/:id',
name: '查看拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/info.vue'),
meta: {
type: 'info'
}
},
{
path: '/game/cmh/copy/:id',
name: '复制拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'copy',
hiddenLayout: true
}
}
];
......@@ -9,7 +9,7 @@ import activityCenter from '@/views/activityCenter';
//微信营销
import wechat from './modules/wechat';
//游戏营销
import game from './modules/game';
import game, { cmhDetail } from './modules/game';
//短信营销
import message from './modules/message';
//卡券营销
......@@ -66,6 +66,7 @@ export default [
ai
]
},
...cmhDetail,
{
path: '/401',
name: '未授权',
......
......@@ -175,5 +175,11 @@ export const getGameTemplateByType = params => requests(PREFIX + '/game-pro/get-
// 生成小程序游戏链接
export const generateMiniProgramLink = params => requests('api-admin/get-page-link-game', params);
// 生成小程序游戏链接-拆盲盒
export const getQrGame = params => requests(PREFIX + '/game-pro/get-qr-game', params, true, false, 'get');
//卡券回显 key 卡券ID ; value 卡券状态 0正常 1删除 2失效
export const cardView = params => requests(PREFIX + '/game-pro/card-view', params, true);
// 停止游戏-拆盲盒
export const stopGame = params => requests(PREFIX + '/game-pro/stop-game', params, true, false, 'get');
......@@ -59,9 +59,6 @@ const actions = {
async getIsShowSelfData(state) {
let res = await getIsShowSelf();
this.commit('mutations_auth', res.result);
},
setShowLayout({ commit }, item) {
commit('mutations_Layout', item);
}
};
......
......@@ -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="refresh" 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" 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.trim="baseForm.gameRule" show-word-limit :autosize="{ minRows: 4 }" type="textarea" /> </el-form-item>
</div>
<dm-sub-title type="line">展示信息配置</dm-sub-title>
......@@ -139,7 +139,7 @@ export default {
baseForm: {
gameName: '',
gameTime: [],
gameRule: '1、幸运盲盒大抽奖,惊喜好礼抽不停。</br>2、活动最终解释权归品牌方所有。',
gameRule: '1、幸运盲盒大抽奖,惊喜好礼抽不停。2、活动最终解释权归品牌方所有。',
templateId: '',
backMusicFlag: 1,
adsFlag: 1,
......@@ -230,6 +230,10 @@ export default {
}
},
methods: {
handleDateChange(val) {
console.log(val);
this.$emit('change', this.baseForm);
},
handleTemplateChange(val) {
this.baseForm.templateId = val;
const data = this.templateArr.filter(item => item.templateId == val)[0].gameTemplateMaterialList;
......
......@@ -7,7 +7,7 @@
</div>
<div class="rightBtn">
<el-button @click="returnNext">退出</el-button>
<el-button type="primary">发布并预览</el-button>
<!-- <el-button type="primary">发布并预览</el-button> -->
</div>
</div>
<div class="content">
......@@ -35,10 +35,14 @@
<div class="formContent">
<baseConfig :gameStatus="gameStatus" :templateArr="templateData" :echoData="baseForm" v-show="active == 0" @change="handleBaseConfigChange" @nextStep="data => nextStep(1, data)" />
<prizeConfig :gameStatus="gameStatus" :invalidCard="invalidCard" :prizeMax="prizeMax" :echoData="prizeForm" :prizeMin="prizeMin" v-show="active == 1" @nextStep="data => nextStep(2, data)" @prevStep="step => (active = step)" />
<ruleConfig :gameStatus="gameStatus" :shareCard="shareCard" :shareReport="shareReport" :echoData="ruleForm" v-show="active == 2" @nextStep="data => submit(3, data)" @prevStep="step => (active = step)" :btnLoading="btnLoading" />
<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>
</div>
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true" :showFooter="true">
<el-button @click="editRenew">重新编辑</el-button>
<el-button type="primary" @click="$router.push('/game/cmh')">进入游戏列表</el-button>
</links>
</div>
</template>
......@@ -50,9 +54,13 @@ import prizeConfig from './prize-config.vue';
import ruleConfig from './rule-config.vue';
import { getGameTemplateByType, initActivity, getGameDetail, cardView } from '@/service/api/gameApi.js';
import gameTemplate from './gameTemplate';
import links from '../common/links';
export default {
data() {
return {
linkShow: false,
linksObj: {},
active: 0,
menuActive: 0,
templateData: [],
......@@ -75,7 +83,8 @@ export default {
ruleForm: {},
gameId: '',
gameStatus: 0,
invalidCard: {}
invalidCard: {},
gameTime: []
};
},
computed: {
......@@ -96,14 +105,13 @@ export default {
baseConfig,
gameTemplate,
prizeConfig,
ruleConfig
ruleConfig,
links
},
mounted() {
this.getGameTemplateByType();
},
destroyed() {
this.$store.dispatch('setShowLayout', true);
},
watch: {
templateId(val) {
const data = this.templateData.filter(item => item.templateId == val)[0];
......@@ -168,7 +176,7 @@ export default {
handleBaseConfigChange(data) {
console.log('handleBaseConfigChange----->');
console.log(data);
const { backImageUrl, noticeImageUrl, adsImageUrl, gameName, templateId, shareCard, shareReport } = data;
const { backImageUrl, noticeImageUrl, adsImageUrl, gameName, templateId, shareCard, shareReport, gameTime } = data;
this.bgImg = backImageUrl;
this.tipsImg = noticeImageUrl;
this.boxImg = data.prizeStyleJson[0].imageNoSelectUrl;
......@@ -177,10 +185,16 @@ export default {
this.templateId = templateId;
this.shareCard = shareCard;
this.shareReport = shareReport;
this.gameTime = gameTime;
},
returnNext() {
this.$store.dispatch('setShowLayout', true);
this.$router.go(-1);
this.$confirm('退出后,当前编辑没有保存的数据会丢失,确认要退出吗?', {
type: 'warning'
})
.then(() => {
this.$router.push('/game/cmh');
})
.catch(() => {});
},
handleMenuSelect(index) {
this.menuActive = index;
......@@ -246,36 +260,51 @@ export default {
}
});
}
let submitData = {
gameRuleInfo, // 游戏规则信息
gameRuleConditionList, // 游戏规则-参与门槛
gamePrizeList, //游戏奖品信息
gameExt,
templateType: 1, // 1盲盒
prizeNoticeStock,
prizeNoticeFlag,
adsFlag,
bulletFlag,
backMusicFlag,
templateId,
gameRule,
startDate: gameTime[0],
endDate: gameTime[1],
gameName
};
if (this.isEdit) {
submitData.gameId = this.gameId;
}
this.btnLoading = true;
initActivity(submitData)
.then(res => {
if (res) {
this.$message.success('保存成功');
this.$route.meta.refresh = true;
this.$router.go(-1);
}
})
.finally((this.btnLoading = false));
this.$confirm('确认发布游戏?', {
type: 'warning'
}).then(() => {
let submitData = {
gameRuleInfo, // 游戏规则信息
gameRuleConditionList, // 游戏规则-参与门槛
gamePrizeList, //游戏奖品信息
gameExt,
templateType: 1, // 1盲盒
prizeNoticeStock,
prizeNoticeFlag,
adsFlag,
bulletFlag,
backMusicFlag,
templateId,
gameRule,
startDate: gameTime[0],
endDate: gameTime[1],
gameName
};
if (this.isEdit) {
submitData.gameId = this.gameId;
}
this.btnLoading = true;
initActivity(submitData)
.then(res => {
if (res) {
const { result } = res;
this.$message.success('发布成功');
this.getLink(result);
this.$route.meta.refresh = true;
}
})
.finally((this.btnLoading = false));
});
},
getLink(row) {
const { startDate, gameId, gameName } = row;
this.gameId = gameId;
this.linksObj = { gameName, gameId, gameStartTime: startDate };
this.linkShow = true;
},
editRenew() {
window.location.href = window.location.origin + `/marketing/#/game/cmh/edit/${this.gameId}`;
// this.$router.push(`/game/cmh/edit/${this.gameId}`);
}
}
};
......
......@@ -344,8 +344,6 @@ img {
width: 48px;
height: 16px;
}
.game-name-box {
}
.ad-image {
margin: 39px 15px 15px;
......
......@@ -80,24 +80,26 @@
</el-table-column>
</el-table>
<dm-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.pageNum" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
<links :show.sync="linkShow" :obj="linksObj" :gameTypeName="gameTypeName"></links>
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true"></links>
</section>
</template>
<script>
import { api as viewerApi } from 'v-viewer';
import { cmhPage } from '@/service/api/gameApi.js';
import linksMixin from '../common/linksMixin.js';
import { cmhPage, stopGame } from '@/service/api/gameApi.js';
import links from '../common/links';
import { formatDateTimeByType } from '@/utils/index.js';
import dmDropdown from '@/components/dm-drop-down/dm-drop-down';
export default {
mixins: [linksMixin],
components: {
dmDropdown
dmDropdown,
links
},
data() {
return {
formatDateTimeByType,
linkShow: false,
linksObj: {},
listParams: {
gameName: '',
status: '',
......@@ -107,6 +109,7 @@ export default {
pageSize: 20
},
total: 0,
gameId: '',
tableList: [],
gameStatusOptions: [
{
......@@ -175,12 +178,12 @@ export default {
{
text: '链接',
props: {
limitCode: this.$buttonCode.marketingCmhUrl
limitCode: this.$buttonCode.marketingCmhLink
},
visible: row => {
return (row.status === 1 || row.status === 0) && this.$getButtonLimit(this.$buttonCode.marketingCmhUrl);
return (row.status === 1 || row.status === 0) && this.$getButtonLimit(this.$buttonCode.marketingCmhLink);
},
handler: row => this.setLinks(row, 6)
handler: row => this.getLink(row)
},
{
text: '终止',
......@@ -190,7 +193,7 @@ export default {
visible: row => {
return row.status === 1 && this.$getButtonLimit(this.$buttonCode.marketingCmhStop);
},
handler: row => this.stopPlan(row)
handler: row => this.stopGame(row)
},
{
text: '数据',
......@@ -209,6 +212,27 @@ export default {
this.getTableList();
},
methods: {
getLink(row) {
const { startDate, gameId, gameName } = row;
this.linksObj = { gameName, gameId, gameStartTime: startDate };
this.linkShow = true;
},
stopGame(row) {
const { gameId } = row;
this.$confirm('终止后游戏结束,用户无法继续参与。是否确认终止?', '终止提示', {
confirmButtonText: '终止',
cancelBUttonText: '取消',
type: 'warning'
})
.then(() => {
stopGame({ gameId }).then(res => {
console.log(res);
this.$message.success('终止成功');
this.getTableList();
});
})
.catch(() => {});
},
refresh() {
this.listParams.pageNum = 1;
this.getTableList();
......
<template>
<div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!this.$route.meta.keepAlive" />
</div>
</template>
<script>
export default {};
</script>
<style></style>
......@@ -11,7 +11,7 @@
<div v-show="ruleForm.memberType == 0">
<vue-gic-people v-bind="storeParams" projectName="marketing" :triggerReset="true" :isAdd="isAdd" :hasSearchData="ruleForm.hasSearchData" :useId="ruleForm.memberWeightView.searchId" sceneValue="member" ref="peopleFilter" @findFilter="findFilter" @getBackData="getBackData" @editShow="toggleTag = true" @editHide="toggleTag = false" @hideBtn="toggleTag = false" />
<div class="gic-people--button" v-show="toggleTag">
<el-button size="small" type="primary" @click="getData">确 定</el-button>
<el-button size="small" type="primary" @click="getData" :disabled="isDisabled">确 定</el-button>
<el-button size="small" @click="cancelFilter">取 消</el-button>
</div>
</div>
......@@ -34,7 +34,7 @@
<el-form-item>
<div class="shareBox" v-show="ruleForm.playConditionFlag == 1">
<div v-for="(item, index) in ruleForm.gameRuleConditionList" :key="item.conditionType">
<div v-show="index == 0">
<div v-if="index == 0">
<div class="flex mb10"><el-checkbox v-model="item.conditionType" :true-label="2" :false-label="-1" :disabled="isDisabled" /> <span class="ml10">赠与免费游戏次数</span></div>
<el-form-item :prop="'gameRuleConditionList.' + index + '.' + 'value'" v-show="item.conditionType == 2">
<el-select class="w140" v-model="item.conditionJson.type" :disabled="isDisabled">
......@@ -45,7 +45,7 @@
<span class="ml10">次游戏次数</span>
</el-form-item>
</div>
<div v-show="index == 1">
<div v-if="index == 1">
<div class="flex mb10"><el-checkbox v-model="item.conditionType" :true-label="0" :false-label="-1" /> <span class="ml10">消耗积分获得游戏次数</span></div>
<div v-show="item.conditionType == 0">
<el-form-item label="参与游戏每次消耗积分" :prop="'gameRuleConditionList.' + index + '.conditionJson.' + 'value'">
......@@ -61,7 +61,7 @@
</el-form-item>
</div>
</div>
<div v-show="index == 2">
<div v-if="index == 2">
<div class="flex mb10"><el-checkbox v-model="item.conditionType" :true-label="1" :false-label="-1" /><span class="ml10"> 邀请好友助力获得游戏次数</span></div>
<div v-show="item.conditionType == 1">
<el-form-item label="邀请机制" label-width="80px"> 每成功邀请<el-input-number v-model="item.conditionJson.inviteNum" :min="1" class="w110 ml10 mr10" controls-position="right" />人可获得 <el-input-number v-model="item.conditionJson.value" :min="1" class="w110 ml10 mr10" controls-position="right" />次游戏</el-form-item>
......@@ -110,7 +110,7 @@
</div>
</div>
</el-form-item>
<el-form-item label="每人最多可玩次数" prop="playTimes" :rules="rules.playTimes"> <el-input v-model="ruleForm.playTimes" class="w140" placeholder="上限1000" :disabled="isDisabled" />次游戏次数 </el-form-item>
<el-form-item label="每人最多可玩次数" prop="playTimes" :rules="rules.playTimes"> <el-input v-model.number="ruleForm.playTimes" class="w140" placeholder="上限1000" :disabled="isDisabled" />次游戏次数 </el-form-item>
<el-form-item label="分享" prop="shareFlag">
<el-switch v-model="ruleForm.shareFlag" :active-value="1" :inactive-value="0" />
<div class="tips">关闭后用户无法分享小程序</div>
......@@ -136,7 +136,6 @@ export default {
callback();
};
const mpUrlViewVal = (rule, value, callback) => {
console.log(value);
if (this.ruleForm.gameRuleConditionList[1].conditionType != -1 && !this.ruleForm.gameRuleConditionList[1].conditionJson.dumpPath) {
callback(new Error('请选择'));
return;
......@@ -144,7 +143,6 @@ export default {
callback();
};
const shareTitleVal = (rule, value, callback) => {
console.log(value);
if (this.ruleForm.gameRuleConditionList[2].conditionType != -1 && this.ruleForm.gameRuleConditionList[2].conditionJson.type == 11 && !this.ruleForm.gameRuleConditionList[2].conditionJson.shareTitle) {
callback(new Error('请输入'));
return;
......@@ -152,7 +150,6 @@ export default {
callback();
};
const subscribeMsgVal = (rule, value, callback) => {
console.log(value);
if (this.ruleForm.gameRuleConditionList[2].conditionType != -1 && this.ruleForm.gameRuleConditionList[2].conditionJson.type == 12 && !this.ruleForm.gameRuleConditionList[2].conditionJson.subscribeMsg) {
callback(new Error('请输入'));
return;
......@@ -219,14 +216,15 @@ export default {
rules: {
memberType: { required: true, message: '请选择' },
memberDesc: { type: 'string', required: true, message: '未配置游戏说明', trigger: 'blur' },
// playTimes: { type: 'number', required: true, message: '请输入不超过1000的数字', max: 1000, min: 1 },
playTimes: { type: 'number', required: true, message: '请输入不超过1000的数字', max: 1000, min: 1 },
playConditionFlag: { required: true },
mpUrlView: { validator: mpUrlViewVal },
shareTitle: { validator: shareTitleVal },
filterJson: { validator: filterJsonVal },
subscribeMsg: { validator: subscribeMsgVal }
},
isAdd: this.$route.meta.type === 'add'
isAdd: this.$route.meta.type === 'add',
gameDays: 0
};
},
props: {
......@@ -237,6 +235,10 @@ export default {
echoData: {
type: Object,
default: () => {}
},
gameTime: {
type: Object,
default: () => []
}
},
watch: {
......@@ -273,6 +275,14 @@ export default {
}
this.ruleForm = Object.assign(this.ruleForm, { ruleId, memberDesc, memberType, playConditionFlag, playTimes, shareFlag, shareImageUrl, shareRuleDesc, memberWeightView, creatorId, filterJsonView });
console.log(this.ruleForm);
},
gameTime(val) {
console.log(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;
}
}
},
components: {
......@@ -374,6 +384,15 @@ export default {
this.$message.error('请至少勾选一项');
return;
}
const conditionType2 = this.ruleForm.gameRuleConditionList.filter(item => item.conditionType == 2);
if (this.ruleForm.playConditionFlag == 1 && conditionType2.length && conditionType2[0].conditionJson.type == 21) {
const maxTimes = conditionType2[0].conditionJson.type == 21 ? conditionType2[0].conditionJson.value : conditionType2[0].conditionJson.value * this.gameDays;
if (maxTimes > this.ruleForm.playTimes) {
this.$message.error(`每人最多可玩次数需大于免费游戏次数${maxTimes}`);
return;
}
}
this.$refs.ruleForm.validate((val, obj) => {
if (val) {
const data = { ...this.ruleForm };
......
......@@ -31,7 +31,7 @@
<script>
import VueQr from 'vue-qr';
import { formatDateTimeByType } from '@/utils/index.js';
import { generateMiniProgramLink } from '@/service/api/gameApi.js';
import { generateMiniProgramLink, getQrGame } from '@/service/api/gameApi.js';
import { api as viewerApi } from 'v-viewer';
import 'viewerjs/dist/viewer.css';
export default {
......@@ -57,6 +57,10 @@ export default {
showFooter: {
type: Boolean,
default: false
},
isNew: {
type: Boolean,
default: false
}
},
data() {
......@@ -77,7 +81,11 @@ export default {
url: ''
};
this.createQrImg();
this.generateMiniProgramLink();
if (this.isNew) {
this.getQrGame();
} else {
this.generateMiniProgramLink();
}
}
}
},
......@@ -119,6 +127,16 @@ export default {
this.loading = false;
});
},
getQrGame() {
this.loading = true;
getQrGame({ id: this.obj.gameId })
.then(res => {
this.miniprogram = res.result;
})
.finally(() => {
this.loading = false;
});
},
close() {
this.$emit('update:show', false);
},
......
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