剩下兑奖逻辑

This commit is contained in:
Andy Leong
2024-01-21 21:22:16 +08:00
parent 57b35eb7e4
commit 22a4a20c97
12 changed files with 114 additions and 86 deletions

View File

@@ -3,12 +3,12 @@ import { Toast } from "vant";
import gsap from "gsap";
import Preloader from "@/plugins/Preloader";
import { loadImg, pageImg } from "@/data/imgList";
import { getMyPrize } from '@/api'
import { useMainStore } from '@/store'
import { getMyPrize } from "@/api";
import { useMainStore } from "@/store";
// 页面配置初始化
const emit = defineEmits(["LoadPage"]);
const userStore = useMainStore()
const userStore = useMainStore();
const loadNum = ref(0);
@@ -45,19 +45,18 @@ onMounted(() => {
duration: 0.2,
autoAlpha: 1,
onComplete: () => {
if(import.meta.env.VITE_MODE!='dev'){
getMyPrize({}, userStore.token).then(
res => {
if (import.meta.env.VITE_MODE != "dev") {
getMyPrize({}, userStore.token).then((res) => {
if (res.code == 0) {
console.log('我的奖品', res);
if(res.data){
// userStore.updatePrize(code,money)
console.log("我的奖品", res);
if (res.data) {
console.log("有奖品");
userStore.updatePrize(res.data);
}
}
}
)
});
}
Preloader({
name: "内页资源",
imgs: pageImg,
@@ -81,9 +80,6 @@ onMounted(() => {
});
});
});
</script>
<template>