diff --git a/src/store/lottery.js b/src/store/lottery.js index 53e4900..07fceb5 100644 --- a/src/store/lottery.js +++ b/src/store/lottery.js @@ -14,6 +14,9 @@ export const useLotteryStore = defineStore('lottery', () => { const allUsers = ref([]) const isUsersLoaded = ref(false) + const winnerList = ref([]) + + function setWinners(list) { // 如果是数组,则添加到现有数组中;如果是单个项目,则直接添加 if (Array.isArray(list)) { @@ -54,6 +57,10 @@ export const useLotteryStore = defineStore('lottery', () => { return "" } + function setWinnerList(list) { + winnerList.value = list + } + return { lotteryState, setLotteryState, @@ -67,6 +74,8 @@ export const useLotteryStore = defineStore('lottery', () => { allUsers, isUsersLoaded, setAllUsers, - getRandomUserName + getRandomUserName, + winnerList, + setWinnerList } }) \ No newline at end of file diff --git a/src/views/choujiang/hxl-cj/cj.vue b/src/views/choujiang/hxl-cj/cj.vue index d85794a..fa0c0a4 100644 --- a/src/views/choujiang/hxl-cj/cj.vue +++ b/src/views/choujiang/hxl-cj/cj.vue @@ -368,6 +368,7 @@ const initAll = async () => { getPrizeListApi(), getUserListApi(), ]); + console.log("hxl-cj调用一次接口", prizeList); // 奖品列表 prizes.value = prizeList.data; // 用户列表 diff --git a/src/views/choujiang/index.vue b/src/views/choujiang/index.vue index 89b690a..0cddadf 100644 --- a/src/views/choujiang/index.vue +++ b/src/views/choujiang/index.vue @@ -19,6 +19,12 @@ +
+ +
+