chore(斋月打榜活动): 排行榜名称展示调整

This commit is contained in:
hzj 2026-02-02 16:31:39 +08:00
parent 7447a5e2aa
commit c531691fae

View File

@ -330,18 +330,60 @@
<!-- 名称id -->
<div style="flex: 1; min-width: 0; display: flex; flex-direction: column">
<div
style="
color: #fff;
font-weight: 860;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
class="UserNickname"
<!-- 滚动名称 -->
<itemCenter
style="width: 30vw; height: 10vw; min-width: 0"
:imgUrl="imageUrl('userNameBorder')"
:contentStyle="`padding:0;`"
:lazy="true"
>
{{ listItem?.userName }}
</div>
<div style="width: 100%">
<div
style="
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
"
>
<!-- 滚动容器 -->
<div
v-if="isTextOverflow(listItem?.userName || '')"
class="scroll-wrapper"
>
<!-- 2套内容 -->
<div class="scroll-content" v-for="value in 2">
<div
style="
color: #fff;
font-size: 1em;
font-weight: 860;
white-space: nowrap;
"
>
{{ listItem?.userName }}
</div>
</div>
</div>
<div v-else>
<div
style="
color: #fff;
font-size: 1em;
font-weight: 860;
white-space: nowrap;
"
>
{{ listItem?.userName }}
</div>
</div>
</div>
</div>
</itemCenter>
<!-- ID -->
<div style="color: #fff; font-weight: 590" class="UserNickname">
{{ $t('user_id_prefix') }}
{{ listItem?.specialAccount || listItem?.account }}
@ -600,22 +642,20 @@
<!-- 抽奖按钮 -->
<div style="display: flex; justify-content: center; gap: 4vw" class="drawBts">
<!-- 单抽 -->
<itemCenter
style="width: 45vw"
:imgUrl="imageUrl('draw1BtBg')"
<img
:src="imageUrl(getImgName('draw1BtBg'))"
alt=""
style="width: 45vw; display: block; object-fit: cover"
@click="sweepstakes(1)"
>
<div style="font-size: 2em; font-weight: 600">1 Spin</div>
</itemCenter>
/>
<!-- 10连抽 -->
<itemCenter
style="width: 45vw"
:imgUrl="imageUrl('draw10BtBg')"
<img
:src="imageUrl(getImgName('draw10BtBg'))"
alt=""
style="width: 45vw; display: block; object-fit: cover"
@click="sweepstakes(10)"
>
<div style="font-size: 2em; font-weight: 600">10 Spin</div>
</itemCenter>
/>
</div>
<!-- 总抽奖次数 -->
@ -1927,7 +1967,7 @@ const clickReward = (item) => {
const searchPayee = () => {
router.push({
path: '/search-payee',
query: { from: '/new-year', activeAction: 'incomeShow' },
query: { from: '/lucky-dollars-season3', activeAction: 'incomeShow' },
})
}
@ -1936,6 +1976,26 @@ const goToWithdraw = () => {
router.push({ path: '/cash-out', query: { activityId: '2005571533988298753' } })
}
//
const isTextOverflow = (text) => {
//
const tempDiv = document.createElement('div')
tempDiv.style.position = 'absolute'
tempDiv.style.fontSize = '1em'
tempDiv.style.fontWeight = '860'
tempDiv.textContent = text
document.body.appendChild(tempDiv) //
const containerWidth = window.innerWidth * 0.3 //
const textWidth = tempDiv.getBoundingClientRect().width
console.log(`"${text}"的宽度为 ${textWidth}px容器宽度为 ${containerWidth}px`)
document.body.removeChild(tempDiv) //
//
return textWidth > containerWidth
}
//
const coinOptions = ref([
{ id: 1, amount: 10500, price: 1 },
@ -2254,7 +2314,7 @@ const initializePayee = () => {
const savedPayee = getSelectedPayee()
if (savedPayee) {
Object.assign(selectedPayee.value, savedPayee)
handleBt('withdraw')
handleBt('withdrawal')
drawerShowBt('transfer')
}
}
@ -2436,6 +2496,8 @@ const receiveRechargeBadge = async (rewards) => {
//
const initData = async () => {
await Promise.all([
getUserInfo(), //
initializePayee(), //
getWinners(), //
getRanking(), //
@ -2445,8 +2507,6 @@ const initData = async () => {
getConfigsBadgeInfo(), // -
getTaskList(), //
getDrawRecords(), //
getUserInfo(), //
])
}
@ -2501,6 +2561,13 @@ const observer = new IntersectionObserver((entries) => {
//
onMounted(() => {
console.log('route.query.activeAction:', route.query.activeAction)
if (route.query.activeAction == 'incomeShow') {
handleBt('withdrawal')
} else {
handleBt('ranking')
}
connectToAppHandler()
startCountdown() //