This commit is contained in:
yixu
2025-09-14 19:15:51 +08:00
parent e26aae5805
commit ac5d579a8c
3 changed files with 25 additions and 23 deletions

View File

@@ -119,21 +119,21 @@ watch(() => props.show, async (newVal) => {
shakeTimeline.play() shakeTimeline.play()
//TODO: 延时测试,上限删掉 //TODO: 延时测试,上限删掉
await Sleep(2000) // await Sleep(2000)
shakeTimeline.pause() 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: 测试数据 // TODO: 测试数据
const lottteryResult = { // const lottteryResult = {
res: { status: 200 }, // res: { status: 200 },
json: { // json: {
id: 0, // id: 0,
code: "HEIGAI_42_GPJ_500ML", // code: "HEIGAI_42_GPJ_500ML",
prize_code: 'HEIGAI_42_GPJ_500ML', // prize_code: 'HEIGAI_42_GPJ_500ML',
coupon_type: "scene", // coupon_type: "scene",
name: "泸州老窖的一瓶酒" // name: "泸州老窖的一瓶酒"
} // }
} // }
if (lottteryResult.res.status !== 200) { if (lottteryResult.res.status !== 200) {
emit('close') emit('close')

View File

@@ -77,7 +77,8 @@ let mergeId = '';
// 切换边框状态 // 切换边框状态
const toggleBorder = (item, index) => { const toggleBorder = (item, index) => {
activeBorders.value = activeBorders.value.map(() => false); activeBorders.value = activeBorders.value.map(() => false);
// 如果没有打榜点击切换图片时把当前背景图赋值给globalStore.result_url做为最新的背景图
globalStore.result_url = item.result_url;
activeBorders.value[index] = true; activeBorders.value[index] = true;
mergeId = item.id; mergeId = item.id;
}; };
@@ -95,6 +96,7 @@ const handleDabangClick = () => {
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
ElMessage.success('打榜成功!'); ElMessage.success('打榜成功!');
displayZhuli.value = true;
console.log('Success:', data); console.log('Success:', data);
globalStore.chartsBattle = true; globalStore.chartsBattle = true;
return { success: true, data }; return { success: true, data };

View File

@@ -9,7 +9,6 @@ import Haibao from "@/libs/haibao";
import mask from "../assets/images/haibao-mask.png"; import mask from "../assets/images/haibao-mask.png";
import haibaoCoverBorder from "../assets/images/haibao-cover.png"; import haibaoCoverBorder from "../assets/images/haibao-cover.png";
import bg from "../assets/images/haibao-bg.png" import bg from "../assets/images/haibao-bg.png"
import userPicture from "../assets/images/home-bg.png"; //TODO: globalStore.result_url 这里得图片后面要换成用户参榜的图片
defineProps({ defineProps({
show: true show: true
@@ -101,14 +100,14 @@ const handleHaibao = async () => {
}) })
}) })
} }
let userPictureVal = userPicture; // let userPictureVal = userPicture;
const getBackgroundImage = () => { // const getBackgroundImage = () => {
if (globalStore.result_url) { // if (globalStore.result_url) {
return userPictureVal = globalStore.result_url; // return userPictureVal = globalStore.result_url;
} else { // } else {
return userPictureVal; // return userPictureVal;
} // }
}; // };
</script> </script>
<template> <template>
@@ -173,7 +172,7 @@ const getBackgroundImage = () => {
.fullsection { .fullsection {
position: fixed; position: fixed;
top: 0; top: 25vw;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -185,6 +184,7 @@ const getBackgroundImage = () => {
.haibao { .haibao {
position: relative; position: relative;
top: -25vw;
width: 70vw; width: 70vw;
height: 119.444444vw; height: 119.444444vw;
background-image: url("../assets/images/haibao-cover.webp"); background-image: url("../assets/images/haibao-cover.webp");