feat: 更新

This commit is contained in:
dengtongyu committed 2023-04-17 09:11:07 +08:00
1 parent 145fbcf834
commit 851c940895
3 files changed
+18 -7

No files matched your search

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