fix: update achievement sorting and invite reward copy
This commit is contained in:
parent
2175b7a886
commit
54e49a9bf5
@ -822,6 +822,36 @@
|
||||
Number((item && item.unlocked_at_ms) || 0) > 0
|
||||
);
|
||||
}
|
||||
function sortOrderOf(item) {
|
||||
var def = definitionOf(item);
|
||||
var value =
|
||||
def.sort_order !== undefined
|
||||
? def.sort_order
|
||||
: def.sortOrder;
|
||||
var numeric = Number(value || 0);
|
||||
return Number.isFinite(numeric) ? numeric : 0;
|
||||
}
|
||||
function sortAchievementsForBadgePage(items) {
|
||||
return (items || [])
|
||||
.map(function (item, index) {
|
||||
return { index: index, item: item };
|
||||
})
|
||||
.sort(function (left, right) {
|
||||
var leftUnlocked = isUnlocked(left.item) ? 1 : 0;
|
||||
var rightUnlocked = isUnlocked(right.item) ? 1 : 0;
|
||||
if (leftUnlocked !== rightUnlocked) {
|
||||
return rightUnlocked - leftUnlocked;
|
||||
}
|
||||
var sortDelta =
|
||||
sortOrderOf(right.item) -
|
||||
sortOrderOf(left.item);
|
||||
if (sortDelta !== 0) return sortDelta;
|
||||
return left.index - right.index;
|
||||
})
|
||||
.map(function (entry) {
|
||||
return entry.item;
|
||||
});
|
||||
}
|
||||
function titleOf(item) {
|
||||
var resource = resourceOf(item);
|
||||
var def = definitionOf(item);
|
||||
@ -1002,7 +1032,8 @@
|
||||
merged
|
||||
);
|
||||
}
|
||||
return merged;
|
||||
// 成就接口按配置排序分页返回;H5 徽章墙需要先把所有页收齐,再按用户已解锁优先重排,避免未解锁项插在已解锁徽章之间。
|
||||
return sortAchievementsForBadgePage(merged);
|
||||
});
|
||||
}
|
||||
function loadTab(name) {
|
||||
|
||||
@ -90,10 +90,8 @@
|
||||
src="./assets/generated/reward-topup-visual.png"
|
||||
alt=""
|
||||
/>
|
||||
<strong id="rewardTopUpPercent">1%</strong>
|
||||
<span data-i18n="invite.friendTopUp"
|
||||
>Friend's Top-Up</span
|
||||
>
|
||||
<strong id="rewardTopUpPercent">+1000</strong>
|
||||
<span data-i18n="invite.friendTopUp">Friend Gets</span>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
"invite.copied": "تم النسخ",
|
||||
"invite.copyFailed": "فشل النسخ",
|
||||
"invite.successfulInvite": "دعوة ناجحة",
|
||||
"invite.friendTopUp": "شحن الصديق",
|
||||
"invite.friendTopUp": "يحصل الصديق",
|
||||
"invite.copyInviteLink": "نسخ رابط الدعوة",
|
||||
"invite.copyInviteCode": "نسخ رمز الدعوة",
|
||||
"invite.linkInviter": "ربط الداعي",
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
"invite.copied": "Copied",
|
||||
"invite.copyFailed": "Copy failed",
|
||||
"invite.successfulInvite": "Successful Invite",
|
||||
"invite.friendTopUp": "Friend's Top-Up",
|
||||
"invite.friendTopUp": "Friend Gets",
|
||||
"invite.copyInviteLink": "Copy invitation link",
|
||||
"invite.copyInviteCode": "Copy invitation code",
|
||||
"invite.linkInviter": "Bind User",
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
"invite.copied": "Copiado",
|
||||
"invite.copyFailed": "Error al copiar",
|
||||
"invite.successfulInvite": "Invitación exitosa",
|
||||
"invite.friendTopUp": "Recarga del amigo",
|
||||
"invite.friendTopUp": "Tu amigo recibe",
|
||||
"invite.copyInviteLink": "Copiar enlace de invitación",
|
||||
"invite.copyInviteCode": "Copiar código de invitación",
|
||||
"invite.linkInviter": "Vincular invitador",
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
"invite.copied": "Disalin",
|
||||
"invite.copyFailed": "Gagal menyalin",
|
||||
"invite.successfulInvite": "Undangan Berhasil",
|
||||
"invite.friendTopUp": "Top up teman",
|
||||
"invite.friendTopUp": "Teman mendapat",
|
||||
"invite.copyInviteLink": "Salin tautan undangan",
|
||||
"invite.copyInviteCode": "Salin kode undangan",
|
||||
"invite.linkInviter": "Tautkan pengundang",
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
"invite.copied": "Kopyalandı",
|
||||
"invite.copyFailed": "Kopyalama başarısız",
|
||||
"invite.successfulInvite": "Başarılı Davet",
|
||||
"invite.friendTopUp": "Arkadaş yüklemesi",
|
||||
"invite.friendTopUp": "Arkadaş kazanır",
|
||||
"invite.copyInviteLink": "Davet bağlantısını kopyala",
|
||||
"invite.copyInviteCode": "Davet kodunu kopyala",
|
||||
"invite.linkInviter": "Davetçiyi bağla",
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
"invite.copied": "已复制",
|
||||
"invite.copyFailed": "复制失败",
|
||||
"invite.successfulInvite": "成功邀请",
|
||||
"invite.friendTopUp": "好友充值",
|
||||
"invite.friendTopUp": "朋友获得",
|
||||
"invite.copyInviteLink": "复制邀请链接",
|
||||
"invite.copyInviteCode": "复制邀请码",
|
||||
"invite.linkInviter": "绑定邀请人",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user