28 Commits

Author SHA1 Message Date
Ethereal 85e59d9057 修改获奖列表排序逻辑,按照后端返回的数据进行排序 2 weeks ago
no99 9a2a236be8 Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 7290fa6e55 修改没有中奖人数时,换页按键的颜色 3 weeks ago
no99 ee9d622e07 Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 e0cf0e3b8a 优化适配 3 weeks ago
no99 16fcd8eee2 Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 f74faaf131 添加分页防抖 3 weeks ago
no99 3cd6cdfbca 修改分页字体大小,修改获奖名单的位置 3 weeks ago
no99 e33bdd048f 改密码,改标题 3 weeks ago
no99 e49170781e Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 ca3adfa303 添加奖品全部抽完的提示 3 weeks ago
no99 968f752567 Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 c99f7557b2 不做全屏适配 3 weeks ago
no99 9f83a606a2 Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 dffc896e23 全屏适配 3 weeks ago
no99 03a33d83ce 按键防抖,一键变色 3 weeks ago
no99 26d0e8aefd Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖 3 weeks ago
no99 933df9b6ff 笔记本适配 3 weeks ago
no99 f4b2f260ee Merge branch 'milestone-20250722-抽奖' into milestone-20250722-众筹抽奖合并专用分支 3 weeks ago
zhangjiahao 886e194d6c Merge branch 'zhangjiahao/feature-20250717125955-众筹' into milestone-20250723-众筹 3 weeks ago
zhangjiahao 303931b382 优化活动规则样式 3 weeks ago
zhangjiahao 64dd5110e5 后台传入数据进行修改当前市场和进度 3 weeks ago
no99 d6f514155e Merge branch 'milestone-20250722-抽奖' into milestone-20250722-众筹抽奖合并专用分支 4 weeks ago
zhangjiahao 58fb933b5e Merge branch 'milestone-20250723-众筹' into zhangjiahao/feature-20250717125955-众筹 4 weeks ago
zhangjiahao 48ba2c3721 进入页面自动弹出活动规则 4 weeks ago
no99 eac2b28dcc Merge branch 'milestone-20250722-抽奖' into milestone-20250722-众筹抽奖合并专用分支 4 weeks ago
zhangjiahao d858ebcef0 Merge branch 'milestone-20250723-众筹' into milestone-20250722-众筹抽奖合并专用分支 4 weeks ago
zhangjiahao ed5c701407 助力成功动画2s改为1s 4 weeks ago
  1. 3
      README.md
  2. 2
      index.html
  3. 8
      package-lock.json
  4. 1
      package.json
  5. 4
      src/views/choujiang/Login.vue
  6. 235
      src/views/choujiang/hxl-cj/cj.vue
  7. 12
      src/views/choujiang/lottery/PrizePanel.vue
  8. 100
      src/views/zhongchou/index.vue
  9. 22
      vite.config.js.timestamp-1753077096347-78067037e45f7.mjs

3
README.md

@ -9,4 +9,5 @@ npm install vue-router
npm install axios npm install axios
npm install element-plus --save npm install element-plus --save
npm install pinia npm install pinia
npm install three
npm install three
c 安装 lodash 组件,解决数据处理问题

2
index.html

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<title>弘历周年庆</title>
</head> </head>
<body> <body>
<!-- <script src="/src/utils/tween.min.js"></script> --> <!-- <script src="/src/utils/tween.min.js"></script> -->

8
package-lock.json

@ -13,6 +13,7 @@
"axios": "^1.10.0", "axios": "^1.10.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"element-plus": "^2.10.3", "element-plus": "^2.10.3",
"lodash": "^4.17.21",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.4.1", "pinia-plugin-persistedstate": "^4.4.1",
"three": "^0.178.0", "three": "^0.178.0",
@ -1987,8 +1988,9 @@
}, },
"node_modules/lodash": { "node_modules/lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
}, },
"node_modules/lodash-es": { "node_modules/lodash-es": {
"version": "4.17.21", "version": "4.17.21",
@ -4055,7 +4057,7 @@
}, },
"lodash": { "lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash-es": { "lodash-es": {

1
package.json

@ -16,6 +16,7 @@
"axios": "^1.10.0", "axios": "^1.10.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"element-plus": "^2.10.3", "element-plus": "^2.10.3",
"lodash": "^4.17.21",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.4.1", "pinia-plugin-persistedstate": "^4.4.1",
"three": "^0.178.0", "three": "^0.178.0",

4
src/views/choujiang/Login.vue

@ -23,11 +23,11 @@ const handleLogin = () => {
alert('请输入密码'); alert('请输入密码');
return; return;
} }
if (password.value == '000000') {
if (password.value == 'hl2025') {
authStore.login(); authStore.login();
router.push('/hxlCj'); router.push('/hxlCj');
} else { } else {
if (password.value === '123456') {
if (password.value === 'hl2024') {
// //
authStore.login(); // 使Pinia authStore.login(); // 使Pinia
router.push('/choujiang'); router.push('/choujiang');

235
src/views/choujiang/hxl-cj/cj.vue

@ -93,9 +93,13 @@
</div> </div>
</el-scrollbar> </el-scrollbar>
<div class="tableFoot"> <div class="tableFoot">
<span @click="leftPage()" id="leftPage" class="leftPage"><</span>
<span @click="throttledleftPage()" id="leftPage" class="leftPage"
><</span
>
{{ currentPage }}/<span>{{ totalPage }}</span> {{ currentPage }}/<span>{{ totalPage }}</span>
<span @click="rightPage()" id="rightPage" class="rightPage">></span>
<span @click="throttledrightPage()" id="rightPage" class="rightPage"
>></span
>
</div> </div>
</div> </div>
</div> </div>
@ -120,7 +124,12 @@
<div class="btn">{{ cjText }}</div> <div class="btn">{{ cjText }}</div>
</div> </div>
<div v-else> <div v-else>
<div id="lottery" ref="lotteryRef" @click="lotteryBtn()" class="btn">
<div
id="lottery"
ref="lotteryRef"
@click="throttledLotteryBtn()"
class="btn"
>
{{ cjText }} {{ cjText }}
</div> </div>
</div> </div>
@ -142,6 +151,7 @@ import { TrackballControls } from "../../../utils/TrackballControls.js";
import TWEEN from "@tweenjs/tween.js"; import TWEEN from "@tweenjs/tween.js";
import worldcup from "../../../assets/worldcup.mp3"; import worldcup from "../../../assets/worldcup.mp3";
import dong from "../../../assets/dong.mp3"; import dong from "../../../assets/dong.mp3";
import _ from "lodash";
import { import {
getPrizeListApi, getPrizeListApi,
@ -276,14 +286,19 @@ const totalPage = ref(10);
const openGetPrize = async () => { const openGetPrize = async () => {
if (!prizes.value[prizes.value.length - 1].isLook) { if (!prizes.value[prizes.value.length - 1].isLook) {
addQipao("请先揭晓奖品");
addQipao("请先揭晓奖品");
return; return;
} }
pageObj.value = {
pageNum: 1,
pageSize: 14,
};
let res = await getGetPrizeUserListApi(pageObj.value); let res = await getGetPrizeUserListApi(pageObj.value);
getPrizeUserList.value = res.data.list; getPrizeUserList.value = res.data.list;
currentPage.value = res.data.pageNum; currentPage.value = res.data.pageNum;
totalPage.value = res.data.pages;
totalPage.value = res.data.pages == 0 ? 1 : res.data.pages;
isOpen.value = true; isOpen.value = true;
// console.log("currentPrize", currentPrize.value); // console.log("currentPrize", currentPrize.value);
prizes.value.forEach((item) => { prizes.value.forEach((item) => {
@ -295,6 +310,13 @@ const openGetPrize = async () => {
}); });
let scroll = document.getElementById("prizeBar"); let scroll = document.getElementById("prizeBar");
// scroll.style.height = "110px"; // scroll.style.height = "110px";
await nextTick();
if (totalPage.value == 1) {
const rightPageBtn = document.getElementById("rightPage");
rightPageBtn.style.cursor = "not-allowed";
rightPageBtn.style.background = "#ccc";
}
}; };
const closeGetPrize = () => { const closeGetPrize = () => {
@ -314,61 +336,78 @@ const leftPage = async (item) => {
if (currentPage.value == 1) { if (currentPage.value == 1) {
return; return;
} }
if (currentPage.value == totalPage.value) {
const rightPageBtn = document.getElementById("rightPage");
rightPageBtn.style.cursor = "pointer";
rightPageBtn.style.setProperty(
"background",
"linear-gradient(90deg, #ff9800 0%, #ff5722 100%)",
"important"
);
}
currentPage.value--;
pageObj.value.pageNum = currentPage;
let res = await getGetPrizeUserListApi(pageObj.value);
getPrizeUserList.value = res.data.list;
currentPage.value = res.data.pageNum;
if (currentPage.value == 1) {
const leftPageBtn = document.getElementById("leftPage");
leftPageBtn.style.cursor = "not-allowed";
leftPageBtn.style.background = "#ccc";
try {
if (currentPage.value == totalPage.value) {
const rightPageBtn = document.getElementById("rightPage");
rightPageBtn.style.cursor = "pointer";
rightPageBtn.style.setProperty(
"background",
"linear-gradient(90deg, #ff9800 0%, #ff5722 100%)",
"important"
);
}
currentPage.value--;
pageObj.value.pageNum = currentPage;
let res = await getGetPrizeUserListApi(pageObj.value);
getPrizeUserList.value = res.data.list;
currentPage.value = res.data.pageNum;
if (currentPage.value == 1) {
const leftPageBtn = document.getElementById("leftPage");
leftPageBtn.style.cursor = "not-allowed";
leftPageBtn.style.background = "#ccc";
}
} catch (e) {
console.log("error", e);
} }
}; };
const throttledleftPage = _.throttle(leftPage, 500, {
trailing: false,
});
const rightPage = async (item) => { const rightPage = async (item) => {
if (currentPage.value == totalPage.value) {
if (currentPage.value >= totalPage.value) {
return; return;
} }
if (currentPage.value == 1) {
const leftPageBtn = document.getElementById("leftPage");
console.log("leftPageBtn", leftPageBtn);
leftPageBtn.style.cursor = "pointer";
leftPageBtn.style.setProperty(
"background",
"linear-gradient(90deg, #ff9800 0%, #ff5722 100%)",
"important"
);
}
try {
if (currentPage.value == 1) {
const leftPageBtn = document.getElementById("leftPage");
console.log("leftPageBtn", leftPageBtn);
leftPageBtn.style.cursor = "pointer";
leftPageBtn.style.setProperty(
"background",
"linear-gradient(90deg, #ff9800 0%, #ff5722 100%)",
"important"
);
}
currentPage.value++;
pageObj.value.pageNum = currentPage;
let res = await getGetPrizeUserListApi(pageObj.value);
getPrizeUserList.value = res.data.list;
currentPage.value = res.data.pageNum;
currentPage.value++;
pageObj.value.pageNum = currentPage;
let res = await getGetPrizeUserListApi(pageObj.value);
getPrizeUserList.value = res.data.list;
currentPage.value = res.data.pageNum;
if (currentPage.value == totalPage.value) {
const rightPageBtn = document.getElementById("rightPage");
rightPageBtn.style.cursor = "not-allowed";
rightPageBtn.style.background = "#ccc";
if (currentPage.value == totalPage.value) {
const rightPageBtn = document.getElementById("rightPage");
rightPageBtn.style.cursor = "not-allowed";
rightPageBtn.style.background = "#ccc";
}
} catch (e) {
console.log("error", e);
} }
}; };
const throttledrightPage = _.throttle(rightPage, 500, {
trailing: false,
});
// //
const lookPrize = async (item) => { const lookPrize = async (item) => {
// //
if (!joinLottery) { if (!joinLottery) {
addQipao("请先进入抽奖");
addQipao("请先进入抽奖");
return; return;
} }
// //
@ -507,6 +546,11 @@ const initAll = async () => {
}; };
const initCards = () => { const initCards = () => {
const screenWidth = window.innerWidth;
const isLaptop = screenWidth < 1600; //
const baseSpacingX = isLaptop ? 120 : 140;
const baseSpacingY = isLaptop ? 150 : 180;
let member = users.value.slice(), let member = users.value.slice(),
showCards = [], showCards = [],
length = member.length; length = member.length;
@ -514,18 +558,25 @@ const initCards = () => {
let isBold = false; let isBold = false;
let index = 0; let index = 0;
let totalMember = member.length; let totalMember = member.length;
// let position = {
// x: (140 * COLUMN_COUNT - 20) / 2,
// y: (180 * ROW_COUNT - 20) / 2,
// };
let position = { let position = {
x: (140 * COLUMN_COUNT - 20) / 2,
y: (180 * ROW_COUNT - 20) / 2,
x: (baseSpacingX * COLUMN_COUNT - 20) / 2,
y: (baseSpacingY * ROW_COUNT - 20) / 2,
}; };
camera = new THREE.PerspectiveCamera( camera = new THREE.PerspectiveCamera(
40, 40,
window.innerWidth / window.innerHeight,
// window.innerWidth / window.innerHeight,
10,
1, 1,
10000 10000
); );
camera.position.z = 3000; camera.position.z = 3000;
// camera.position.y = 1000;
scene = new THREE.Scene(); scene = new THREE.Scene();
@ -542,9 +593,17 @@ const initCards = () => {
threeDCards.push(object); threeDCards.push(object);
// //
// initCards
const cardSpacingX = isLaptop ? 130 : 155;
const cardSpacingY = isLaptop ? 160 : 195;
var object = new THREE.Object3D(); var object = new THREE.Object3D();
object.position.x = j * 155 - position.x;
object.position.y = -(i * 195) + position.y;
// object.position.x = j * 155 - position.x;
// object.position.y = -(i * 195) + position.y;
// 使
object.position.x = j * cardSpacingX - position.x;
object.position.y = -(i * cardSpacingY) + position.y;
targets.table.push(object); targets.table.push(object);
index++; index++;
} }
@ -565,8 +624,8 @@ const initCards = () => {
} }
renderer = new CSS3DRenderer(); renderer = new CSS3DRenderer();
renderer.setSize(window.innerWidth * 1, window.innerHeight * 0.9);
renderer.domElement.style.margin = "7% 0 0 1%";
renderer.setSize(window.innerWidth * 0.8, window.innerHeight * 0.8);
renderer.domElement.style.margin = "12% 0 0 0 ";
// document.getElementById("container").appendChild(renderer.domElement); // document.getElementById("container").appendChild(renderer.domElement);
if (threeContainer.value) { if (threeContainer.value) {
@ -587,9 +646,10 @@ const initCards = () => {
// //
let joinLottery = false; let joinLottery = false;
// //
const enterLottery = () => {
const enterLottery = async () => {
joinLottery = true; joinLottery = true;
removeHighlight(); removeHighlight();
await nextTick();
// rotate = !rotate; // rotate = !rotate;
rotate = true; rotate = true;
switchScreen("lottery"); switchScreen("lottery");
@ -653,11 +713,13 @@ const createCard = (user, isBold, id) => {
return element; return element;
}; };
function removeHighlight() {
const removeHighlight = async () => {
document.querySelectorAll(".highlight").forEach((node) => { document.querySelectorAll(".highlight").forEach((node) => {
node.classList.remove("highlight");
node.className = "";
node.classList.add("element");
node.style.backgroundColor = "rgb(255,170,22)";
}); });
}
};
function addHighlight() { function addHighlight() {
document.querySelectorAll(".lightitem").forEach((node) => { document.querySelectorAll(".lightitem").forEach((node) => {
@ -1078,16 +1140,21 @@ const lotteryBtn = () => {
// console.log("isLotting", isLotting); // console.log("isLotting", isLotting);
// console.log("currentPrize.value", currentPrize.value); // console.log("currentPrize.value", currentPrize.value);
if (isLotting) { if (isLotting) {
stopLottery();
throttledStopLottery();
return; return;
} }
if (!currentPrize.value.isLook) { if (!currentPrize.value.isLook) {
addQipao("请先揭秘礼品");
addQipao("请先揭秘礼品");
return; return;
} }
if (currentPrize.value.leftCount <= 0) { if (currentPrize.value.leftCount <= 0) {
addQipao("该礼品已抽取完毕,请揭秘下一个礼品。");
if (currentPrize.value.type == 0) {
addQipao("所以礼品都已抽取完毕");
} else {
addQipao("该礼品已抽取完毕,请揭秘下一个礼品");
}
return; return;
} }
@ -1132,9 +1199,10 @@ const lotteryBtn = () => {
const text = "正在抽取[" + currentPrize.value.prizeName + "],调整好姿势"; const text = "正在抽取[" + currentPrize.value.prizeName + "],调整好姿势";
// addQipao(text); // addQipao(text);
}; };
/**
* 抽奖
*/
const throttledLotteryBtn = _.throttle(lotteryBtn, 1000, {
trailing: false,
});
const lottery = () => { const lottery = () => {
rotateBall().then(() => { rotateBall().then(() => {
@ -1174,6 +1242,10 @@ const stopLottery = () => {
playDongAudio(); playDongAudio();
}; };
const throttledStopLottery = _.throttle(stopLottery, 1000, {
trailing: false,
});
const changePrize = async () => { const changePrize = async () => {
let type = currentPrize.value.type; let type = currentPrize.value.type;
@ -1216,13 +1288,15 @@ function changeSelectedCard(cardIndex, user) {
/** /**
* 切换名牌背景 * 切换名牌背景
*/ */
function changeBackground(cardIndex, color) {
const changeBackground = async (cardIndex) => {
let card = threeDCards[cardIndex].element; let card = threeDCards[cardIndex].element;
// card.style.backgroundColor = // card.style.backgroundColor =
// color || "rgba(255,170,22," + (Math.random() * 0.7 + 0.25) + ")"; // color || "rgba(255,170,22," + (Math.random() * 0.7 + 0.25) + ")";
card.style.backgroundColor = color || "rgba(255,170,22,1)";
card.style.border = "2px solid rgba(255, 255, 255, 1)";
}
card.style.backgroundColor = "rgb(255,170,22) !important";
card.style.border = "2px solid rgb(255, 255, 255)";
// await nextTick();
};
/** /**
* 随机切换背景和人员信息 * 随机切换背景和人员信息
@ -1246,7 +1320,7 @@ function shineCard() {
continue; continue;
} }
changeBackground(cardIndex);
// changeBackground(cardIndex);
changeCard(cardIndex, users.value[index]); changeCard(cardIndex, users.value[index]);
} }
}, 500); }, 500);
@ -1279,7 +1353,6 @@ function onWindowResize() {
onMounted(async () => { onMounted(async () => {
initAll(); initAll();
window.addEventListener("resize", onWindowResize, false); window.addEventListener("resize", onWindowResize, false);
}); });
</script> </script>
@ -1300,12 +1373,15 @@ body,
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
justify-content: center; justify-content: center;
align-items: center;
} }
.hllogo { .hllogo {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
width: 20%;
height: auto;
} }
.qipao { .qipao {
@ -1389,8 +1465,8 @@ a {
} }
.element { .element {
width: 15vh;
height: 19vh;
width: 7.5vw;
height: 18.5vh;
/* box-shadow: 0 0 12px rgba(0, 255, 255, 0.5); */ /* box-shadow: 0 0 12px rgba(0, 255, 255, 0.5); */
border: 1px solid rgba(127, 255, 255, 0.25); border: 1px solid rgba(127, 255, 255, 0.25);
text-align: center; text-align: center;
@ -1423,11 +1499,11 @@ button {
height: 70px; height: 70px;
color: #fff; color: #fff;
border: 0; border: 0;
font-size: 2.5vh;
font-size: 20px;
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
padding-top: 5px;
padding-top: 12px;
} }
.highlight { .highlight {
@ -1521,7 +1597,7 @@ button {
justify-content: center; justify-content: center;
flex-wrap: nowrap; flex-wrap: nowrap;
/* color: rgba(127, 255, 255, 0.75); */ /* color: rgba(127, 255, 255, 0.75); */
width: 30vh;
width: 29vh;
height: 9.5vh; height: 9.5vh;
box-sizing: border-box; box-sizing: border-box;
transition: transform 1s ease-in; transition: transform 1s ease-in;
@ -1541,7 +1617,7 @@ button {
align-items: center; align-items: center;
background-color: #ffd283; background-color: #ffd283;
opacity: 0.8; opacity: 0.8;
margin-left: 2vh;
margin-left: 0.8vh;
margin-top: 3.5vh; margin-top: 3.5vh;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
@ -1679,6 +1755,7 @@ button {
} }
.tableFoot { .tableFoot {
font-size: 18px;
color: #e64f39; color: #e64f39;
display: flex; display: flex;
gap: 10px; gap: 10px;
@ -1691,8 +1768,8 @@ button {
/* background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%); */ /* background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%); */
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
width: 35px;
height: 35px;
width: 30px;
height: 30px;
justify-content: center; justify-content: center;
/* align-items: center; */ /* align-items: center; */
} }
@ -1703,8 +1780,8 @@ button {
background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%); background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%);
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
width: 35px;
height: 35px;
width: 30px;
height: 30px;
justify-content: center; justify-content: center;
} }
@ -2005,7 +2082,7 @@ button {
} }
.shine.prize-item { .shine.prize-item {
/* width: 24vh; */
/* width: 29.5vh; */
margin: 1.2vh 0; margin: 1.2vh 0;
} }

12
src/views/choujiang/lottery/PrizePanel.vue

@ -357,16 +357,8 @@ const updateWinners = async () => {
}); });
console.log("updatePrizeList response", response); console.log("updatePrizeList response", response);
// createTimeid
const sortedWinners = response.data.list.sort((a, b) => {
if (a.createTime && b.createTime) {
return new Date(b.createTime) - new Date(a.createTime);
}
// id
return (b.id || 0) - (a.id || 0);
});
fakeWinners.value = sortedWinners;
// 使API
fakeWinners.value = response.data.list;
console.log("updateWinners fakeWinners", fakeWinners.value); console.log("updateWinners fakeWinners", fakeWinners.value);
// //

100
src/views/zhongchou/index.vue

@ -41,7 +41,7 @@
<!-- 美股剩余时间显示 --> <!-- 美股剩余时间显示 -->
<div class="stock-info" :class="{ 'time-almost-up': isTimeAlmostUp }"> <div class="stock-info" :class="{ 'time-almost-up': isTimeAlmostUp }">
<h3>美股实时数据</h3>
<h3>{{ marketName }}实时数据</h3>
<h3>还剩{{ numberToChinese(usDisplayTime) }}分钟</h3> <h3>还剩{{ numberToChinese(usDisplayTime) }}分钟</h3>
</div> </div>
</div> </div>
@ -170,45 +170,43 @@ async function fetchActivity() {
} }
// //
if (data && data.length > 0) {
//
data.forEach(item => {
if (item.market === "美股" && item.marketId === 8) {
// ID
usMarketId.value = item.marketId
// marketStatus
if (item.marketStatus === '已助力') {
usBoostStatus.value = true
} else {
usBoostStatus.value = false
}
// marketCount
if (item.marketCount !== undefined) {
const totalPeople = 1500 // 1500
const currentCount = item.marketCount || 0 //
// (0-100)
const progressPercent = Math.min((currentCount / totalPeople) * 100, 100)
// (15100%)
const usedTime = (progressPercent / 100) * 15
const remainingTime = Math.max(0, 15 - usedTime)
usRemainingTime.value = Math.round(remainingTime)
console.log(`美股助力人数: ${currentCount}/${totalPeople}, 进度: ${progressPercent.toFixed(1)}%, 剩余时间: ${remainingTime.toFixed(1)}分钟`)
//
nextTick(() => {
updateProgressDisplay()
})
}
}
//
// if (item.market === "" && item.marketId === 5) { ... }
})
if (data && data.length > 1) { //
// 使1
const item = data[0] // 使
// ID
usMarketId.value = item.marketId
//
marketName.value = item.market
// marketStatus
if (item.marketStatus === '已助力') {
usBoostStatus.value = true
} else {
usBoostStatus.value = false
}
// marketCount
if (item.marketCount !== undefined) {
const totalPeople = 1500 // 1500
const currentCount = item.marketCount || 0 //
// (0-100)
const progressPercent = Math.min((currentCount / totalPeople) * 100, 100)
// (15100%)
const usedTime = (progressPercent / 100) * 15
const remainingTime = Math.max(0, 15 - usedTime)
usRemainingTime.value = Math.round(remainingTime)
console.log(`${marketName.value}助力人数: ${currentCount}/${totalPeople}, 进度: ${progressPercent.toFixed(1)}%, 剩余时间: ${remainingTime.toFixed(1)}分钟`)
//
nextTick(() => {
updateProgressDisplay()
})
}
} }
} else { } else {
console.error('获取活动失败:', response.message) console.error('获取活动失败:', response.message)
@ -261,6 +259,7 @@ const showRulesModal = ref(false)
// //
const showBoostSuccess = ref(false) const showBoostSuccess = ref(false)
// - marketTwoCount // - marketTwoCount
const marketName = ref('美股') // API
const usRemainingTime = ref(15) // 15 const usRemainingTime = ref(15) // 15
// const hkRemainingTime = ref(6) // // const hkRemainingTime = ref(6) //
const usTotalTime = ref(15) // 15 const usTotalTime = ref(15) // 15
@ -332,6 +331,7 @@ const getQueryVariable = (variable) => {
} }
// //
onMounted(() => { onMounted(() => {
showRulesModal.value = true
nextTick(() => { nextTick(() => {
// //
fetchActivity() fetchActivity()
@ -374,26 +374,25 @@ const handleBoostClick = async (area) => {
}); });
if (response.code === 200) { if (response.code === 200) {
console.log('美股助力成功:', response.message)
console.log(`${marketName.value}助力成功:`, response.message)
// //
showBoostSuccess.value = true showBoostSuccess.value = true
//2s
//1s
setTimeout(() => { setTimeout(() => {
showBoostSuccess.value = false showBoostSuccess.value = false
}, 2000)
}, 1000)
// //
await fetchActivity() await fetchActivity()
console.log('美股已助力状态:', usBoostStatus.value, '剩余时间:', usRemainingTime.value)
console.log(`${marketName.value}已助力状态:`, usBoostStatus.value, '剩余时间:', usRemainingTime.value)
} else { } else {
console.error('美股助力失败:', response.message)
console.error(`${marketName.value}助力失败:`, response.message)
} }
} catch (error) { } catch (error) {
console.error('美股助力请求失败:', error)
console.error(`${marketName.value}助力请求失败:`, error)
} }
} }
} }
const showRulesFunc = () => { const showRulesFunc = () => {
@ -1275,15 +1274,18 @@ const hideRules = () => {
.rules-list { .rules-list {
width: 100%; width: 100%;
line-height: 1.6;
line-height: 1.6; /* 增加行高 */
margin-top: 10%; margin-top: 10%;
margin-left: 10%;
margin-left: 10%; /* 减少左边距 */
padding-right: 5%; /* 添加右边距 */
} }
.rules-list p { .rules-list p {
margin: 10px 0; margin: 10px 0;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; /* 使用更清晰的中文字体 */
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
line-height: 1.7; line-height: 1.7;
} }

22
vite.config.js.timestamp-1753077096347-78067037e45f7.mjs

@ -1,22 +0,0 @@
// vite.config.js
import { defineConfig } from "file:///E:/hxl/gitFile/activityLink/node_modules/vite/dist/node/index.js";
import vue from "file:///E:/hxl/gitFile/activityLink/node_modules/@vitejs/plugin-vue/dist/index.mjs";
var vite_config_default = defineConfig({
plugins: [
vue()
],
server: {
proxy: {
"/Api": {
target: "https://dbqb.nfdxy.net/devLotApi",
// target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/Api/, "")
}
}
}
});
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJFOlxcXFxoeGxcXFxcZ2l0RmlsZVxcXFxhY3Rpdml0eUxpbmtcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkU6XFxcXGh4bFxcXFxnaXRGaWxlXFxcXGFjdGl2aXR5TGlua1xcXFx2aXRlLmNvbmZpZy5qc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRTovaHhsL2dpdEZpbGUvYWN0aXZpdHlMaW5rL3ZpdGUuY29uZmlnLmpzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAndml0ZSdcbmltcG9ydCB2dWUgZnJvbSAnQHZpdGVqcy9wbHVnaW4tdnVlJ1xuXG4vLyBodHRwczovL3ZpdGUuZGV2L2NvbmZpZy9cbi8vIGV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XG4vLyAgIHBsdWdpbnM6IFt2dWUoKV0sXG4vLyB9KVxuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbXG4gICAgdnVlKCksXG4gIF0sXG4gIHNlcnZlcjoge1xuICAgIHByb3h5OiB7XG4gICAgICAnL0FwaSc6IHtcbiAgICAgICAgdGFyZ2V0OiAnaHR0cHM6Ly9kYnFiLm5mZHh5Lm5ldC9kZXZMb3RBcGknLFxuICAgICAgICAvLyB0YXJnZXQ6ICdodHRwOi8vbG9jYWxob3N0OjgwODAnLFxuICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXG4gICAgICAgIHJld3JpdGU6IChwYXRoKSA9PiBwYXRoLnJlcGxhY2UoL15cXC9BcGkvLCAnJylcbiAgICAgIH1cbiAgICB9XG4gIH1cbn0pXG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQTJRLFNBQVMsb0JBQW9CO0FBQ3hTLE9BQU8sU0FBUztBQU9oQixJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixTQUFTO0FBQUEsSUFDUCxJQUFJO0FBQUEsRUFDTjtBQUFBLEVBQ0EsUUFBUTtBQUFBLElBQ04sT0FBTztBQUFBLE1BQ0wsUUFBUTtBQUFBLFFBQ04sUUFBUTtBQUFBO0FBQUEsUUFFUixjQUFjO0FBQUEsUUFDZCxTQUFTLENBQUMsU0FBUyxLQUFLLFFBQVEsVUFBVSxFQUFFO0FBQUEsTUFDOUM7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
Loading…
Cancel
Save