update
This commit is contained in:
parent
0679938eb2
commit
3aa320055c
@ -1,42 +1,41 @@
|
||||
// pinia仓库
|
||||
import { defineStore } from "pinia"
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useMainStore = defineStore("counter", {
|
||||
state: () => {
|
||||
return {
|
||||
hasDraw: true, //是否有抽奖机会
|
||||
token: '',
|
||||
posterId: 3, //测试结果
|
||||
hasPrize: false, //是否有奖品
|
||||
prizeCode: 'oggSVMbeLgSK', //兑换码
|
||||
prizeMoney: '8.88', //金额
|
||||
drawKey: '',
|
||||
}
|
||||
state: () => {
|
||||
return {
|
||||
hasDraw: true, //是否有抽奖机会
|
||||
token: "",
|
||||
posterId: 3, //测试结果
|
||||
hasPrize: false, //是否有奖品
|
||||
prizeCode: "oggSVMbeLgSK", //兑换码
|
||||
prizeMoney: "8.88", //金额
|
||||
drawKey: "",
|
||||
};
|
||||
},
|
||||
// 相当于computed属性,对state进行二次加工
|
||||
getters: {},
|
||||
// 异步处理方法
|
||||
actions: {
|
||||
updateToken(data) {
|
||||
this.token = data.authorization;
|
||||
this.hasDraw = data.drawNumber == 0 ? false : true;
|
||||
},
|
||||
// 相当于computed属性,对state进行二次加工
|
||||
getters: {},
|
||||
// 异步处理方法
|
||||
actions: {
|
||||
updateToken(data) {
|
||||
this.token = data.authorization
|
||||
this.hasDraw = data.drawNumber == 0 ? false : true
|
||||
|
||||
},
|
||||
updatePrize(data) {
|
||||
this.prizeCode = data.prizeCode
|
||||
this.prizeMoney = data.prizeAmount
|
||||
this.hasPrize = true
|
||||
},
|
||||
updatePosterId(id) {
|
||||
this.posterId = id
|
||||
},
|
||||
updateDrawKey(data) {
|
||||
console.log('保存结果:', data);
|
||||
this.drawKey = data.subKey
|
||||
this.hasDraw = data.drawFlag
|
||||
},
|
||||
updateDraw(value) {
|
||||
this.hasDraw = false
|
||||
}
|
||||
updatePrize(data) {
|
||||
this.prizeCode = data.prizeCode;
|
||||
this.prizeMoney = data.prizeAmount;
|
||||
this.hasPrize = true;
|
||||
},
|
||||
})
|
||||
updatePosterId(id) {
|
||||
this.posterId = id;
|
||||
},
|
||||
updateDrawKey(data) {
|
||||
console.log("保存结果:", data);
|
||||
this.drawKey = data.subKey;
|
||||
this.hasDraw = data.drawFlag;
|
||||
},
|
||||
updateDraw(value) {
|
||||
this.hasDraw = false;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user