From ac5d579a8c0df7b52f0c43d9b7b5c5bae919c6d7 Mon Sep 17 00:00:00 2001 From: yixu Date: Sun, 14 Sep 2025 19:15:51 +0800 Subject: [PATCH] update --- src/components/Lottery.vue | 24 ++++++++++++------------ src/components/MyPhoto.vue | 4 +++- src/components/SynthesizedResults.vue | 20 ++++++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/components/Lottery.vue b/src/components/Lottery.vue index 5a0d915..6e188cd 100644 --- a/src/components/Lottery.vue +++ b/src/components/Lottery.vue @@ -119,21 +119,21 @@ watch(() => props.show, async (newVal) => { shakeTimeline.play() //TODO: 延时测试,上限删掉 - await Sleep(2000) + // await Sleep(2000) shakeTimeline.pause() - // const lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' }) + const lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' }) // TODO: 测试数据 - const lottteryResult = { - res: { status: 200 }, - json: { - id: 0, - code: "HEIGAI_42_GPJ_500ML", - prize_code: 'HEIGAI_42_GPJ_500ML', - coupon_type: "scene", - name: "泸州老窖的一瓶酒" - } - } + // const lottteryResult = { + // res: { status: 200 }, + // json: { + // id: 0, + // code: "HEIGAI_42_GPJ_500ML", + // prize_code: 'HEIGAI_42_GPJ_500ML', + // coupon_type: "scene", + // name: "泸州老窖的一瓶酒" + // } + // } if (lottteryResult.res.status !== 200) { emit('close') diff --git a/src/components/MyPhoto.vue b/src/components/MyPhoto.vue index 9c6b3b8..d19cd16 100644 --- a/src/components/MyPhoto.vue +++ b/src/components/MyPhoto.vue @@ -77,7 +77,8 @@ let mergeId = ''; // 切换边框状态 const toggleBorder = (item, index) => { activeBorders.value = activeBorders.value.map(() => false); - + // 如果没有打榜,点击切换图片时,把当前背景图赋值给globalStore.result_url做为最新的背景图 + globalStore.result_url = item.result_url; activeBorders.value[index] = true; mergeId = item.id; }; @@ -95,6 +96,7 @@ const handleDabangClick = () => { .then(response => response.json()) .then(data => { ElMessage.success('打榜成功!'); + displayZhuli.value = true; console.log('Success:', data); globalStore.chartsBattle = true; return { success: true, data }; diff --git a/src/components/SynthesizedResults.vue b/src/components/SynthesizedResults.vue index 7ba6b72..9fc8e17 100644 --- a/src/components/SynthesizedResults.vue +++ b/src/components/SynthesizedResults.vue @@ -9,7 +9,6 @@ import Haibao from "@/libs/haibao"; import mask from "../assets/images/haibao-mask.png"; import haibaoCoverBorder from "../assets/images/haibao-cover.png"; import bg from "../assets/images/haibao-bg.png" -import userPicture from "../assets/images/home-bg.png"; //TODO: globalStore.result_url 这里得图片后面要换成用户参榜的图片 defineProps({ show: true @@ -101,14 +100,14 @@ const handleHaibao = async () => { }) }) } -let userPictureVal = userPicture; -const getBackgroundImage = () => { - if (globalStore.result_url) { - return userPictureVal = globalStore.result_url; - } else { - return userPictureVal; - } -}; +// let userPictureVal = userPicture; +// const getBackgroundImage = () => { +// if (globalStore.result_url) { +// return userPictureVal = globalStore.result_url; +// } else { +// return userPictureVal; +// } +// };