diff --git a/src/components/luckyGridView/main.vue b/src/components/luckyGridView/main.vue index 2205107..a4c8835 100644 --- a/src/components/luckyGridView/main.vue +++ b/src/components/luckyGridView/main.vue @@ -87,8 +87,8 @@ export default { "remainTicketNum", "drawType", "maxVauePrizeIndex", - "curTicketRuleValue", - "lotteryPrizeItemList" + "lotteryPrizeItemList", + "curLotteryTimesPrize" ]), prizesImages() { if (this.drawType === "turntable1") return this.blueImages; @@ -222,10 +222,10 @@ export default { ); if ( this.remainTicketNum === 0 || - this.remainTicketNum < this.curTicketRuleValue + this.remainTicketNum < this.curLotteryTimesPrize ) { // this.$toast.fail("余额不足!"); - const dValue = this.curTicketRuleValue - this.remainTicketNum; + const dValue = this.curLotteryTimesPrize - this.remainTicketNum; if (localNoticeStatus) { this.buyAndLottery(dValue); return; diff --git a/src/config/index.js b/src/config/index.js index 2fb2db2..36b106a 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -18,6 +18,10 @@ const host = (PASSID, GATEWAY) => { const money = "金币"; const unit = "门票"; +const turntable = { + turntable1: 2, + turntable2: 5 +}; module.exports = { appName, @@ -25,5 +29,6 @@ module.exports = { VUE_APP_PROXY, host, money, - unit + unit, + turntable }; diff --git a/src/store/index.js b/src/store/index.js index e8e486b..6506326 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -11,7 +11,7 @@ import { buyPack } from "@/api"; import { getMsgFromDevice, getQueryString } from "@/lib/tool"; -import { unit } from "@/config"; +import { unit, turntable } from "@/config"; const info = getMsgFromDevice(); const locateObj = getQueryString(); @@ -115,6 +115,12 @@ export default new Vuex.Store({ ticketRuleConfig: state => { return state.ticketRuleConfig; }, + curLotteryPrize: state => { + return turntable[state.drawType]; + }, + curLotteryTimesPrize: (state, getters) => { + return getters.curLotteryPrize * getters.curTicketRuleValue; + }, ticketRuleList: (state, getters) => { const list = []; if (!getters.ticketRule) return list; @@ -124,7 +130,7 @@ export default new Vuex.Store({ const { times } = val; list.push({ label: element.name, - desc: `${times}${unit}`, + desc: `${times * getters.curLotteryPrize}${unit}`, value: times, ruleType: element.ruleType });