房间奖励显示
This commit is contained in:
parent
f508d1765a
commit
99592a6e52
@ -31,13 +31,29 @@
|
|||||||
>
|
>
|
||||||
EN
|
EN
|
||||||
</button>
|
</button>
|
||||||
<div class="language-menu" data-language-menu hidden>
|
<div
|
||||||
<button type="button" data-lang-option="en">EN</button>
|
class="language-menu"
|
||||||
<button type="button" data-lang-option="ar">AR</button>
|
data-language-menu
|
||||||
<button type="button" data-lang-option="tr">TR</button>
|
hidden
|
||||||
<button type="button" data-lang-option="es">ES</button>
|
>
|
||||||
<button type="button" data-lang-option="zh">ZH</button>
|
<button type="button" data-lang-option="en">
|
||||||
<button type="button" data-lang-option="id">ID</button>
|
EN
|
||||||
|
</button>
|
||||||
|
<button type="button" data-lang-option="ar">
|
||||||
|
AR
|
||||||
|
</button>
|
||||||
|
<button type="button" data-lang-option="tr">
|
||||||
|
TR
|
||||||
|
</button>
|
||||||
|
<button type="button" data-lang-option="es">
|
||||||
|
ES
|
||||||
|
</button>
|
||||||
|
<button type="button" data-lang-option="zh">
|
||||||
|
ZH
|
||||||
|
</button>
|
||||||
|
<button type="button" data-lang-option="id">
|
||||||
|
ID
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
@ -96,7 +112,6 @@
|
|||||||
<div class="table-divider" aria-hidden="true"></div>
|
<div class="table-divider" aria-hidden="true"></div>
|
||||||
<div class="table-content" id="tierTable"></div>
|
<div class="table-content" id="tierTable"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
@ -106,13 +121,24 @@
|
|||||||
aria-label="My room reward progress"
|
aria-label="My room reward progress"
|
||||||
data-i18n-aria="roomReward.progressLabel"
|
data-i18n-aria="roomReward.progressLabel"
|
||||||
>
|
>
|
||||||
<img class="user-avatar" id="userAvatar" src="./assets/294_8091.png" alt="" />
|
<img
|
||||||
|
class="user-avatar"
|
||||||
|
id="userAvatar"
|
||||||
|
src="./assets/294_8091.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
<div class="user-name" id="userName">Namename...</div>
|
<div class="user-name" id="userName">Namename...</div>
|
||||||
<div class="user-id" id="userId">ID: 123456789</div>
|
<div class="user-id" id="userId">ID: 123456789</div>
|
||||||
<div class="metric-label contribution-label" data-i18n="roomReward.contribution">
|
<div
|
||||||
|
class="metric-label contribution-label"
|
||||||
|
data-i18n="roomReward.contribution"
|
||||||
|
>
|
||||||
This week's contribution:
|
This week's contribution:
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-label rewards-label" data-i18n="roomReward.rewards">
|
<div
|
||||||
|
class="metric-label rewards-label"
|
||||||
|
data-i18n="roomReward.rewards"
|
||||||
|
>
|
||||||
This week's rewards:
|
This week's rewards:
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@ -151,7 +177,10 @@
|
|||||||
!window.localStorage.getItem('room_reward_lang_ready')
|
!window.localStorage.getItem('room_reward_lang_ready')
|
||||||
) {
|
) {
|
||||||
window.localStorage.setItem('hyapp_h5_lang', 'en');
|
window.localStorage.setItem('hyapp_h5_lang', 'en');
|
||||||
window.localStorage.setItem('room_reward_lang_ready', '1');
|
window.localStorage.setItem(
|
||||||
|
'room_reward_lang_ready',
|
||||||
|
'1'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
document.documentElement.lang = 'en';
|
document.documentElement.lang = 'en';
|
||||||
@ -160,6 +189,6 @@
|
|||||||
</script>
|
</script>
|
||||||
<script src="../../common/i18n.js?v=20260606c"></script>
|
<script src="../../common/i18n.js?v=20260606c"></script>
|
||||||
<script src="../../common/api.js?v=20260606c"></script>
|
<script src="../../common/api.js?v=20260606c"></script>
|
||||||
<script src="./script.js?v=20260608b"></script>
|
<script src="./script.js?v=20260629a"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -133,7 +133,9 @@
|
|||||||
document.getElementById('userAvatar').src = data.user.avatar;
|
document.getElementById('userAvatar').src = data.user.avatar;
|
||||||
document.getElementById('userName').textContent =
|
document.getElementById('userName').textContent =
|
||||||
data.user.name || t('roomReward.roomOwner', 'Room owner');
|
data.user.name || t('roomReward.roomOwner', 'Room owner');
|
||||||
document.getElementById('userId').textContent = userIDText(data.user.id);
|
document.getElementById('userId').textContent = userIDText(
|
||||||
|
data.user.id
|
||||||
|
);
|
||||||
document.getElementById('contributionValue').textContent =
|
document.getElementById('contributionValue').textContent =
|
||||||
data.user.contributionReward;
|
data.user.contributionReward;
|
||||||
document.getElementById('weeklyRewardValue').textContent =
|
document.getElementById('weeklyRewardValue').textContent =
|
||||||
@ -162,7 +164,10 @@
|
|||||||
|
|
||||||
function updateBodyHeight() {
|
function updateBodyHeight() {
|
||||||
var scale = window.innerWidth / 375;
|
var scale = window.innerWidth / 375;
|
||||||
document.documentElement.style.setProperty('--app-scale', String(scale));
|
document.documentElement.style.setProperty(
|
||||||
|
'--app-scale',
|
||||||
|
String(scale)
|
||||||
|
);
|
||||||
document.body.style.minHeight =
|
document.body.style.minHeight =
|
||||||
Math.ceil(viewport.offsetHeight * scale) + 'px';
|
Math.ceil(viewport.offsetHeight * scale) + 'px';
|
||||||
}
|
}
|
||||||
@ -193,6 +198,13 @@
|
|||||||
return String(Math.floor(number));
|
return String(Math.floor(number));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wholeNumberWithThousands(value) {
|
||||||
|
var number = Number(value || 0);
|
||||||
|
if (!Number.isFinite(number)) return '0';
|
||||||
|
// Bottom user progress must keep the real integer so compact rounding cannot make an unreached tier look reached.
|
||||||
|
return Math.floor(number).toLocaleString('en-US');
|
||||||
|
}
|
||||||
|
|
||||||
function trimFixed(value) {
|
function trimFixed(value) {
|
||||||
var fixed = value >= 10 ? value.toFixed(0) : value.toFixed(1);
|
var fixed = value >= 10 ? value.toFixed(0) : value.toFixed(1);
|
||||||
return fixed.replace(/\.0$/, '');
|
return fixed.replace(/\.0$/, '');
|
||||||
@ -244,8 +256,8 @@
|
|||||||
valueFrom(user, 'avatar') ||
|
valueFrom(user, 'avatar') ||
|
||||||
valueFrom(room, 'coverUrl', 'cover_url') ||
|
valueFrom(room, 'coverUrl', 'cover_url') ||
|
||||||
'./assets/294_8091.png',
|
'./assets/294_8091.png',
|
||||||
contributionReward: compactNumber(currentCoinSpent),
|
contributionReward: wholeNumberWithThousands(currentCoinSpent),
|
||||||
weeklyReward: compactNumber(expectedReward),
|
weeklyReward: wholeNumberWithThousands(expectedReward),
|
||||||
canClaimContribution: currentCoinSpent > 0,
|
canClaimContribution: currentCoinSpent > 0,
|
||||||
canClaimWeeklyReward: expectedReward > 0,
|
canClaimWeeklyReward: expectedReward > 0,
|
||||||
},
|
},
|
||||||
@ -259,7 +271,11 @@
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
reward: plainWholeNumber(
|
reward: plainWholeNumber(
|
||||||
valueFrom(tier, 'rewardCoinAmount', 'reward_coin_amount')
|
valueFrom(
|
||||||
|
tier,
|
||||||
|
'rewardCoinAmount',
|
||||||
|
'reward_coin_amount'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user