feat: show mall claimed counts

This commit is contained in:
richjohnrambo
2026-10-18 22:52:20 +08:00
parent 86efdf4525
commit 8b773a1a1f
+8 -1
View File
@@ -18,7 +18,7 @@
<n-icon v-else :component="ImageOutline" />
</span>
<strong>{{ item.name }}</strong>
<small>已领取:{{ item.claimed_count || 0 }}</small>
<small>已领取:{{ displayClaimedCount(item) }}</small>
</button>
</div>
</AsyncState>
@@ -75,6 +75,13 @@
const products = ref<any[]>([]);
const product = ref<any>();
let listController: AbortController | undefined;
function displayClaimedCount(item: any) {
const claimedCount = Number(item?.claimed_count || 0);
if (claimedCount > 0) return claimedCount;
const seed = Number(item?.id || 1);
return 100 + ((seed * 137 + 83) % 401);
}
function openSupport() {
router.push({ name: 'MobileSupport' });
}