Browse Source

修改基础路径

songtongtong/feature-20250717104937-众筹
no99 4 weeks ago
parent
commit
e7dc44ceb2
  1. 2
      .env.development
  2. 2
      .env.production
  3. 64
      src/views/choujiang/hxl-cj/cj.vue

2
.env.development

@ -2,7 +2,7 @@
VITE_ENV = 'development' VITE_ENV = 'development'
VITE_OUTPUT_DIR = 'dev' VITE_OUTPUT_DIR = 'dev'
# public path # public path
VITE_PUBLIC_PATH = /
VITE_PUBLIC_PATH = /test
#新数据接口 #新数据接口
VITE_APP_API_BASE_URL = "https://dbqb.nfdxy.net/devLotApi" VITE_APP_API_BASE_URL = "https://dbqb.nfdxy.net/devLotApi"

2
.env.production

@ -2,7 +2,7 @@
VITE_ENV = 'production' VITE_ENV = 'production'
VITE_OUTPUT_DIR = 'dist' VITE_OUTPUT_DIR = 'dist'
# public path # public path
VITE_PUBLIC_PATH = /aixiaocaishen
VITE_PUBLIC_PATH = /
# VITE_PUBLIC_PATH = / # VITE_PUBLIC_PATH = /
# Whether to open mock # Whether to open mock

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

@ -375,7 +375,7 @@ const initAll = async () => {
prizes.value.forEach((item, index) => { prizes.value.forEach((item, index) => {
item.type = index; item.type = index;
item.count = item.amount; item.count = item.amount;
item.leftCount = item.amount; //
item.leftCount = item.remainNum; //
item.hasCount = item.amount; // item.hasCount = item.amount; //
item.isLook = false; // item.isLook = false; //
EACH_COUNT.push(item.perWin); EACH_COUNT.push(item.perWin);
@ -916,7 +916,7 @@ function switchPage(direction) {
const object = threeDCards[cardIndex]; const object = threeDCards[cardIndex];
const cardPage = Math.floor(index / cardsPerPage); const cardPage = Math.floor(index / cardsPerPage);
const isVisible = cardPage === newPage; const isVisible = cardPage === newPage;
const wasVisible = cardPage === pageIndex.value;
// //
const pageNowIndex = index % cardsPerPage; const pageNowIndex = index % cardsPerPage;
const pageLocate = pageLocates[cardPage][pageNowIndex]; const pageLocate = pageLocates[cardPage][pageNowIndex];
@ -929,11 +929,53 @@ function switchPage(direction) {
// "pageLocate", // "pageLocate",
// pageLocate // pageLocate
// ); // );
//
let targetY;
if (isVisible) {
//
if (direction === "next") {
//
targetY = pageLocate.y;
} else {
//
targetY = pageLocate.y;
}
} else {
//
if (direction === "next") {
//
targetY = pageLocate.y + 1000;
} else {
//
targetY = pageLocate.y - 1000;
}
}
//
let startY;
if (wasVisible) {
//
startY = object.position.y;
} else {
//
if (direction === "next") {
//
startY = pageLocate.y - 1000;
} else {
//
startY = pageLocate.y + 1000;
}
}
//
object.position.y = startY;
new TWEEN.Tween(object.position) new TWEEN.Tween(object.position)
.to( .to(
{ {
x: pageLocate.x, x: pageLocate.x,
y: isVisible ? pageLocate.y : pageLocate.y + 1000,
y: targetY,
z: 2100, z: 2100,
}, },
duration duration
@ -1072,16 +1114,17 @@ const lotteryBtn = () => {
getPrizeUsers.value = []; getPrizeUsers.value = [];
let params = { let params = {
gradeName: currentPrize.value.gradeName,
prizeName: currentPrize.value.prizeName,
gradeId: currentPrize.value.gradeId,
prizeId: currentPrize.value.prizeId,
perWin: currentPrize.value.perWin, perWin: currentPrize.value.perWin,
remainNum: currentPrize.value.leftCount,
}; };
// API // API
startLotteryApi(params) startLotteryApi(params)
.then((res) => { .then((res) => {
// API // API
getPrizeUsers.value = res.data || [];
console.log("API返回结果:", res.data);
getPrizeUsers.value = res.data.data || [];
console.log("API返回结果:", res.data.data);
}) })
.catch((err) => { .catch((err) => {
console.error("API调用失败:", err); console.error("API调用失败:", err);
@ -1113,7 +1156,8 @@ const lottery = () => {
selectedCardIndex = []; selectedCardIndex = [];
// , // ,
for (let i = 0; i < getPrizeUsers.value; i++) {
for (let i = 0; i < getPrizeUsers.value.length; i++) {
console.log("111", getPrizeUsers.value[i]);
currentLuckys.push(getPrizeUsers.value[i]); currentLuckys.push(getPrizeUsers.value[i]);
currentPrize.value.hasCount--; currentPrize.value.hasCount--;
@ -1163,7 +1207,7 @@ function random(num) {
*/ */
function changeCard(cardIndex, user) { function changeCard(cardIndex, user) {
let card = threeDCards[cardIndex].element; let card = threeDCards[cardIndex].element;
// console.log("user", user);
card.innerHTML = `<div class="name">${user.jwcode}</div>`; card.innerHTML = `<div class="name">${user.jwcode}</div>`;
} }
@ -1175,7 +1219,7 @@ function changeSelectedCard(cardIndex, user) {
let card = threeDCards[cardIndex].element; let card = threeDCards[cardIndex].element;
card.innerHTML = `<div class="name">${user[1]}</div>`;
card.innerHTML = `<div class="name">${user.jwcode}</div>`;
} }
/** /**
* 切换名牌背景 * 切换名牌背景

Loading…
Cancel
Save