剩下兑奖逻辑
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user