Browse Source

Merge branch 'hongxilin/feature-20250710175148-抽奖' into milestone-20250722-抽奖

pangluotong/feature-20250712103401-抽奖
no99 3 weeks ago
parent
commit
26d0e8aefd
  1. 30
      src/views/choujiang/hxl-cj/cj.vue
  2. 100
      src/views/zhongchou/index.vue

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

@ -507,6 +507,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,9 +519,14 @@ 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(
@ -542,9 +552,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++;
} }
@ -1389,8 +1407,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;

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;
} }

Loading…
Cancel
Save