From 83c35e09326f40f2ad6e5b68a97d1cfc3da115f5 Mon Sep 17 00:00:00 2001 From: yml Date: Fri, 22 May 2026 19:25:57 +0800 Subject: [PATCH] [Snow Team] mobile-ui-mvp: auto-commit work --- frontend/src/views/mobile/MobileHomeView.vue | 241 ++++++++++++++----- 1 file changed, 178 insertions(+), 63 deletions(-) diff --git a/frontend/src/views/mobile/MobileHomeView.vue b/frontend/src/views/mobile/MobileHomeView.vue index d198f3a..92c6157 100644 --- a/frontend/src/views/mobile/MobileHomeView.vue +++ b/frontend/src/views/mobile/MobileHomeView.vue @@ -8,9 +8,16 @@ const loading = ref(false) const loadFailed = ref(false) const listings = ref([]) const filterOpen = ref(false) -const activeSort = ref('推荐') +const activeSort = ref('默认') -const sortOptions = ['推荐', '低价', '高哈夫币', '免押优先'] +const channels = [ + { label: '全部', icon: '🔥' }, + { label: '高哈夫币', icon: '💰' }, + { label: '低押金', icon: '🛡️' }, + { label: '扫码号', icon: '📱' }, + { label: '包夜', icon: '🌙' }, +] +const sortOptions = ['默认', '价格', '比例', '哈夫币', '筛选'] const quickFilters = ['三角洲行动', '安卓/扫码', '高段位', '可包夜'] const fallbackListings: Listing[] = [ @@ -90,6 +97,18 @@ const fallbackListings: Listing[] = [ const displayListings = computed(() => (listings.value.length > 0 ? listings.value : fallbackListings)) +const platformStats = computed(() => { + const items = displayListings.value + const totalCoin = items.reduce((sum, item) => sum + Number(item.haf_coin_amount || 0), 0) + const lowDeposit = items.filter((item) => Number(item.deposit_amount || 0) <= 120).length + + return [ + { value: `${items.length}+`, label: '在线租号' }, + { value: formatCoin(totalCoin), label: '哈夫币总量' }, + { value: `${lowDeposit}个`, label: '低押账号' }, + ] +}) + onMounted(loadListings) async function loadListings() { @@ -110,6 +129,13 @@ function formatCoin(amount: number) { } return `${amount}` } + +function formatRatio(item: Listing) { + if (!item.price_hourly) { + return '--' + } + return `${Math.round(item.haf_coin_amount / item.price_hourly / 10000)}W/元` +}