Commit 20c1e969 by crushh

update: dist

parent 6d2312b6
......@@ -6,7 +6,8 @@
<span>幸运盲盒</span>
</div>
<div class="rightBtn">
<el-button @click="returnNext">退出</el-button>
<el-button @click="returnNext" v-if="!isInfo">退出</el-button>
<el-button @click="$router.go(-1)" v-else>返回</el-button>
<!-- <el-button type="primary">发布并预览</el-button> -->
</div>
</div>
......@@ -38,7 +39,7 @@
<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" v-show="isInfo" />
<info :data="echoData" :invalidCard="invalidCard" v-show="isInfo" />
</div>
<links :show.sync="linkShow" :obj="linksObj" gameTypeName="幸运盲盒" :isNew="true" :showFooter="true">
<el-button @click="editRenew">重新编辑</el-button>
......
......@@ -16,8 +16,10 @@
<el-descriptions column="3">
<el-descriptions-item label="游戏模板"> {{ form.gameName }}</el-descriptions-item>
<el-descriptions-item label="背景音乐">
{{ form.gameExt && form.gameExt.backMusicUrl.materialName }}
<el-button type="text" @click="handleListen"> <i :class="['iconfont fz14', isPlay ? 'icon-zanting' : 'icon-kaiqi']"></i> 点击试听</el-button>
<div v-if="form.backMusicFlag == 1">
{{ form.gameExt && form.gameExt.backMusicUrl.materialName }} <el-button type="text" @click="handleListen"> <i :class="['iconfont fz14', isPlay ? 'icon-zanting' : 'icon-kaiqi']"></i> 点击试听</el-button>
</div>
<div v-else>未开启</div>
</el-descriptions-item>
<el-descriptions-item label="氛围弹幕">{{ form.bulletFlag == 0 ? '未开启' : '已开启' }}</el-descriptions-item>
<el-descriptions-item label="广告位">{{ form.adsFlag == 0 ? '未开启' : `已开启(小程序路径:${form.gameExt && JSON.parse(form.gameExt.mpUrlView.materialValue).name})` }}</el-descriptions-item>
......@@ -54,8 +56,8 @@
</td>
<td class="cell">
<div v-if="item.prizeType == 2">
<el-tag v-show="item.status == 1" size="mini" type="danger" class="tagIcon">删除</el-tag>
<el-tag v-show="item.status == 2" size="mini" type="danger" class="tagIcon">失效</el-tag>
<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>
<span> {{ item.prizeName }}</span>
</div>
<div v-if="item.prizeType == 1">
......@@ -91,8 +93,12 @@
<el-descriptions-item label="参与人群"> </el-descriptions-item>
<el-descriptions-item label="适用人群说明">{{ form.gameRuleInfo && form.gameRuleInfo.memberDesc }}</el-descriptions-item>
</el-descriptions>
<div v-if="form.gameRuleInfo.memberType == 0">
<vue-gic-people :isAdd="false" projectName="marketing" :hasSearchData="form.filterJson" :useId="form.memberWeightView.searchId" sceneValue="member" ref="peopleFilter" />
<div v-show="form.gameRuleInfo.memberType == 0">
<vue-gic-people projectName="marketing" :isAdd="false" :hasSearchData="hasSearchData" :useId="form.memberWeightView.searchId" @findFilter="findFilter" @getBackData="getBackData" sceneValue="member" ref="peopleFilter" @editShow="toggleTag = true" @editHide="toggleTag = false" @hideBtn="toggleTag = false" />
<div class="gic-people--button" v-show="toggleTag">
<el-button size="small" type="primary" :disabled="true"> </el-button>
<el-button size="small" @click="cancelFilter"> </el-button>
</div>
</div>
<div v-if="form.gameRuleInfo.memberType == 1">
<gic-new-member-group onlyRead :selectedIds="form.gameRuleInfo.filterJson" style="width:100%" />
......@@ -161,7 +167,7 @@
<script>
import { formatDateTimeByType } from '@/utils/index.js';
import { cardView } from '@/service/api/gameApi.js';
import gicNewMemberGroup from '@/components/dm-new-member-group/index.vue';
const music = new Audio();
export default {
......@@ -169,39 +175,74 @@ export default {
data: {
type: Object,
default: () => {}
},
invalidCard: {
type: Object,
default: () => {}
}
},
data() {
return {
toggleTag: false,
form: {
gameRuleInfo: {}
},
hasSearchData: '',
isPlay: false,
prizeType: {
0: '谢谢参与',
1: '积分',
2: '卡券'
}
},
isAdd: this.$route.meta.type === 'add'
};
},
components: {
gicNewMemberGroup
},
computed: {
storeParams() {
return !this.isAdd ? { creatorId: this.form.creatorId } : {};
}
},
watch: {
data(val) {
console.log(val);
this.form = JSON.parse(JSON.stringify(val));
this.form.gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.parse(item.conditionJson);
});
if (this.form.playConditionFlag == 1) {
this.form.gameRuleConditionList.forEach(item => {
item.conditionJson = JSON.parse(item.conditionJson);
});
}
let startDateStr = formatDateTimeByType(this.form.startDate, 'yyyy-MM-dd');
let endDateStr = formatDateTimeByType(this.form.endDate, 'yyyy-MM-dd');
this.form.gameTimeStr = startDateStr + ' 至 ' + endDateStr;
this.calculateRate();
this.handleCard();
},
invalidCard(val) {
this.form.gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
item.status = val[item.prizeRelationId].invalid;
} else {
item.status = 0;
}
});
this.form.gamePrizeList = this.form.gamePrizeList.splice(0);
}
},
methods: {
// 取消
cancelFilter() {
this.$refs.peopleFilter.cancelSet();
},
getBackData(val) {
console.log(val);
this.ruleForm.filterJsonView = val;
},
// 子组件触发父组件事件,返回过滤条件数据
findFilter(val) {
console.log(val);
this.hasSearchData = val;
},
calculateRate() {
const prizeNumTotal = this.form.gamePrizeList.map(item => (item.prizeType != 0 ? item.prizeStock : 0)).reduce((pre, current) => pre + current);
this.form.gamePrizeList.forEach(item => {
......@@ -222,25 +263,6 @@ export default {
this.isPlay = !this.isPlay;
music.src = this.form.gameExt.backMusicUrl.materialValue;
this.isPlay ? music.play() : music.pause();
},
async handleCard() {
let cardIdArr = [];
this.form.gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
cardIdArr.push(item.prizeRelationId);
}
item.status = 0;
});
console.log(cardIdArr);
if (cardIdArr.length) {
const { result } = await cardView({ ids: cardIdArr.join(',') });
this.invalidCard = result; // 1删除 2失效
this.form.gamePrizeList.forEach(item => {
if (item.prizeType == 2) {
item.status = this.invalidCard[item.prizeRelationId].invalid;
}
});
}
}
}
};
......
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