Commit 322a3fbc by crushh

update: dist

parent 9335d063
<template>
<div>
<label class="el-button el-button--primary" :class="{ 'is-disabled': copyDisabled }" :style="labelStyle">
<label :class="[textType ? 'el-button el-button--text el-button--small' : 'el-button el-button--primary', copyDisabled ? 'is-disabled' : '']" :style="labelStyle">
<i v-if="icon" :class="icon"></i>
{{ label }}
<input type="file" style="display:none;" :disabled="copyDisabled" accept="image/gif, image/jpeg,image/png" ref="uploader" v-upload="this" />
......@@ -63,6 +63,10 @@ export default {
disabled: {
type: Boolean,
default: false
},
textType: {
type: Boolean,
default: false
}
},
watch: {
......
......@@ -25,9 +25,13 @@ let router = new Router({
router.beforeEach((to, from, next) => {
// 获取是否限流
let path = to.path;
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 => {
......
......@@ -230,7 +230,8 @@ export default {
name: '新建拆盲盒',
component: () => import(/* webpackChunkName: "game" */ '../../views/game/cmh/form.vue'),
meta: {
type: 'add'
type: 'add',
hiddenLayout: true
}
},
{
......
......@@ -29,7 +29,7 @@
<dm-step title="步骤三" @click.native="active = 2"></dm-step>
</dm-steps>
<div class="formContent">
<baseConfig v-if="active == 0" />
<baseConfig :templateArr="templateData" v-if="active == 0" @change="handleBaseConfigChange" />
</div>
<dm-form-bottom class="footer">
<el-button type="primary">保存并下一步</el-button>
......@@ -43,12 +43,15 @@
import steps from '@/views/game/dm-steps/steps';
import step from '@/views/game/dm-step/step';
import baseConfig from './base-config.vue';
import Img from '../../../components/upload/img.vue';
import { getGameTemplateByType } from '@/service/api/gameApi.js';
export default {
data() {
return {
active: 0,
menuActive: 0,
templateData: [],
prizeMax: 10,
prizeMin: 1,
bcImg: {
1: ''
},
......@@ -58,10 +61,17 @@ export default {
components: {
'dm-steps': steps,
'dm-step': step,
baseConfig,
Img
baseConfig
},
mounted() {
this.getGameTemplateByType();
},
methods: {
handleBaseConfigChange(data) {
console.log('handleBaseConfigChange----->');
console.log(data);
},
returnNext() {
this.$store.dispatch('setShowLayout', true);
this.$router.go(-1);
......@@ -69,11 +79,32 @@ export default {
handleMenuSelect(index, indexPath) {
console.log(index, indexPath);
this.menuActive = index;
},
getGameTemplateByType() {
getGameTemplateByType({ templateType: 1 }).then(res => {
if (res.code == 0) {
if (res.result && res.result.length) {
res.result.forEach(item => {
const { gameTemplateMaterialList } = item;
let materialMap = {};
gameTemplateMaterialList.forEach(val => {
if (materialMap.hasOwnProperty(val.materialKey)) {
materialMap[val.materialKey].push(val);
} else {
materialMap[val.materialKey] = [val];
}
});
item.materialMap = materialMap;
});
this.templateData = res.result;
const { prizeMax, prizeMin } = res.result[0];
this.prizeMax = prizeMax;
this.prizeMin = prizeMin;
}
console.log(this.templateData);
}
});
}
},
mounted() {
console.log(this);
this.$store.dispatch('setShowLayout', false);
}
};
</script>
......@@ -106,6 +137,7 @@ export default {
}
.content {
display: flex;
overflow: hidden;
}
.left-content {
width: 520px;
......@@ -155,15 +187,15 @@ export default {
margin: 0 20px 0 13px;
}
.rightForm {
padding: 30px 20px;
padding: 30px 20px 0 30px;
box-sizing: border-box;
width: calc(100vw - 520px);
height: 100vh;
height: calc(100vh - 108px);
background: #ffffff;
.formContent {
margin-top: 20px;
overflow-y: auto;
height: 100%;
height: 90%;
}
.footer {
width: calc(100% - 520px) !important;
......
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