diff --git a/.env.fat b/.env.fat index a959004..f7426f3 100644 --- a/.env.fat +++ b/.env.fat @@ -1,6 +1,6 @@ VITE_MODE = fat -VITE_HOST = https://test.szxgl.cn -VITE_CDN = https://test.szxgl.cn -VITE_FOLDER = /vite -VITE_API = /vite-api +VITE_HOST = https://wmm-stg.pingan.com.cn +VITE_CDN = https://cdn.xglpa.com +VITE_FOLDER = /vite-4 +VITE_API = /intfgw/data/mmoactivity VITE_URL = https://w-stg.pingan.com.cn/lckj/pawm-mmo-activity-xgl-frontend/index.html diff --git a/src/api/index.js b/src/api/index.js index 7f9054a..351a78a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -50,4 +50,12 @@ export function exchangePrize(data, authorization) { true, authorization ); +} + +// 分享接口 +export function getShareConfig(data, authorization) { + return http.post("/h5/Oauth/getShareConfig", + data, + true, + ); } \ No newline at end of file diff --git a/src/assets/images/share.jpg b/src/assets/images/share.jpg new file mode 100644 index 0000000..6f3e6bc Binary files /dev/null and b/src/assets/images/share.jpg differ diff --git a/src/components/Draw.vue b/src/components/Draw.vue index 75d1637..338accc 100644 --- a/src/components/Draw.vue +++ b/src/components/Draw.vue @@ -32,16 +32,21 @@ const drawFn = (event) => { ); try { - const res = await drawApi({}, userStore.token); + const res = await drawApi( + { subAnswerKey: userStore.drawKey }, + userStore.token + ); if (res.code == 0) { // isDrawn后端判断有没有中奖 hasPrize.value = res.data.isDrawn == 1 ? true : false; // true 中奖 || false 未中奖 + userStore.updateDraw(); // 更新抽奖机会 - // if (res.data.isDrawn == 1) { - // hasPrize.value = true - // } else { - // hasPrize.value = false - // } + // 有奖品的话更新奖品信息 + if (res.data.isDrawn == 1) { + money.value = res.data.prizeAmount; + code.value = res.data.prizeCode; + userStore.updatePrize(res.data); + } } else { hasPrize.value = false; // true 中奖 || false 未中奖 } @@ -60,15 +65,6 @@ const drawFn = (event) => { }); gsap.killTweensOf(".draw-light,.draw"); }, 1000); - - // setTimeout(() => { - // hasPrize.value = false // true 中奖 || false 未中奖 - // showResult.value = true - // console.log("showResult:", showResult.value); - // Toast.clear() - // gsap.from('.result-container', { duration: 0.5, scale: 0.7, autoAlpha: 0 }) - // gsap.killTweensOf('.draw-light,.draw') - // }, 3000) }); }; diff --git a/src/components/Loading.vue b/src/components/Loading.vue index 5fa9567..a80393d 100644 --- a/src/components/Loading.vue +++ b/src/components/Loading.vue @@ -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(() => { }); }); }); - - -