feat(mobile): 优化订单个人中心与足迹界面

This commit is contained in:
yml
2026-11-16 18:25:37 +08:00
parent a9970c3ae1
commit 29a16483ac
6 changed files with 802 additions and 454 deletions
@@ -1,8 +1,9 @@
.mobile-profile-shell {
min-height: 100dvh;
background: #f4f6f8;
color: #1a202c;
padding: 0 0 calc(64px + env(safe-area-inset-bottom));
background: #f4f4f2;
color: #252a31;
padding: 0 0 calc(52px + env(safe-area-inset-bottom));
--van-primary-color: #a95522;
}
/* ========== Hero Header ========== */
@@ -378,7 +379,7 @@
color: #9ca3af;
}
.unread-cell-value {
color: #ef4444;
color: #a55757;
font-weight: 700;
}
@@ -476,7 +477,7 @@
display: flex;
flex-direction: column;
height: 100%;
background: #f5f6f8;
background: #f4f4f2;
}
.settings-header {
@@ -485,7 +486,7 @@
justify-content: space-between;
padding: 16px;
background: #fff;
border-bottom: 1px solid #eee;
border-bottom: 1px solid #e9e8e6;
}
.settings-header h2 {
@@ -499,9 +500,10 @@
width: 32px;
height: 32px;
place-items: center;
border: none;
background: none;
color: #999;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #f7f7f5;
color: #73787e;
cursor: pointer;
}
@@ -549,10 +551,10 @@
width: 34px;
height: 34px;
place-items: center;
border: none;
border-radius: 12px;
background: #f4f6f8;
color: #64748b;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #f7f7f5;
color: #73787e;
}
.profile-preview {
@@ -561,8 +563,8 @@
gap: 12px;
margin: 18px 0;
padding: 14px;
border-radius: 14px;
background: #f7faff;
border-radius: 8px;
background: #f9f7f5;
}
.profile-preview-avatar {
@@ -572,8 +574,8 @@
flex: 0 0 auto;
place-items: center;
overflow: hidden;
border-radius: 16px;
background: #1477ff;
border-radius: 8px;
background: #a95522;
color: #fff;
font-size: 22px;
font-weight: 900;
@@ -669,7 +671,7 @@
width: 100%;
height: 46px;
border: 1px solid #e1e7ef;
border-radius: 12px;
border-radius: 8px;
background: #fff;
color: #17233d;
font-size: 14px;
@@ -678,14 +680,14 @@
}
.editor-field input:focus {
border-color: #1477ff;
box-shadow: 0 0 0 3px rgba(20, 119, 255, 0.1);
border-color: #b87a53;
box-shadow: 0 0 0 3px rgba(169, 85, 34, 0.1);
}
.profile-save-btn {
height: 44px;
margin-top: 6px;
background: #1477ff;
background: #a95522;
border-color: transparent;
font-weight: 800;
}
@@ -931,11 +933,12 @@
/* ========== Compact mobile account center ========== */
.profile-hero {
position: relative;
padding: 15px 16px 14px;
border: 0;
border-radius: 0 0 18px 18px;
background: linear-gradient(165deg, #fff8f1 0%, #ffffff 76%);
box-shadow: 0 5px 18px rgba(154, 89, 25, 0.045);
margin: 12px 12px 0;
padding: 15px;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.035);
}
.hero-setting-btn {
@@ -945,7 +948,8 @@
z-index: 1;
width: 32px;
height: 32px;
border-color: #f2dfd0;
border-color: #e8e6e3;
background: #f8f8f6;
}
.profile-hero-content {
@@ -953,16 +957,17 @@
}
.avatar-circle {
width: 62px;
height: 62px;
width: 58px;
height: 58px;
border: 2px solid #ffffff;
box-shadow:
0 0 0 1px #f0d8c6,
0 5px 12px rgba(185, 104, 34, 0.1);
background: #f7eee7;
color: #a95522;
box-shadow: 0 0 0 1px #ebddd3;
}
.user-nickname {
font-size: 18px;
font-weight: 700;
}
.user-meta {
@@ -971,9 +976,19 @@
}
.owner-quality-tag {
border-color: #edcd91;
background: #fff3da !important;
color: #995b08 !important;
border-color: #eadbc9 !important;
background: #f8f1e9 !important;
color: #8b6238 !important;
}
.verified-tag {
background: #eef4ef !important;
color: #55705d !important;
}
.unverified-tag {
background: #f8eded !important;
color: #985858 !important;
}
.hero-status-row {
@@ -981,9 +996,9 @@
align-items: center;
justify-content: space-between;
gap: 8px;
margin-top: 13px;
padding-top: 11px;
border-top: 1px solid #f4e9df;
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #eeeeec;
}
.hero-level-pill,
@@ -998,20 +1013,20 @@
.hero-level-pill {
min-width: 0;
gap: 5px;
padding: 0 9px;
border: 1px solid #f1dccb;
border-radius: 999px;
background: rgba(255, 255, 255, 0.82);
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
}
.hero-level-pill span {
color: #8d7c70;
color: #858a90;
font-size: 9px;
}
.hero-level-pill strong {
overflow: hidden;
color: #b65308;
color: #9c542b;
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
@@ -1019,23 +1034,23 @@
.hero-level-pill .van-icon {
flex: 0 0 auto;
color: #b98e6d;
color: #a58975;
}
.hero-level-pill.is-store {
border-color: #ccebd9;
background: #f3fbf6;
border: 0;
background: transparent;
}
.hero-level-pill.is-store strong {
color: #13864c;
color: #55705d;
}
.hero-benefits-btn {
flex: 0 0 auto;
gap: 2px;
padding: 0;
color: #7e8794;
color: #858a90;
font-size: 10px;
font-weight: 700;
}
@@ -1043,12 +1058,12 @@
.asset-overview-card {
display: grid;
grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
margin: 12px 16px 0;
margin: 10px 12px 0;
overflow: hidden;
border: 1px solid #eceff3;
border-radius: 14px;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.03);
}
.asset-points {
@@ -1057,10 +1072,10 @@
align-items: center;
gap: 9px;
min-width: 0;
padding: 13px 11px;
padding: 13px 12px;
border: 0;
border-right: 1px solid #f0f2f5;
background: linear-gradient(135deg, #fff9f3 0%, #ffffff 88%);
border-right: 1px solid #ececea;
background: #ffffff;
text-align: left;
}
@@ -1070,12 +1085,12 @@
height: 34px;
flex: 0 0 auto;
place-items: center;
border-radius: 10px;
border-radius: 8px;
}
.points-icon {
background: #ffeadc;
color: #ef6200;
background: #f7f1eb;
color: #a65b31;
}
.asset-copy {
@@ -1091,7 +1106,7 @@
}
.asset-copy strong {
color: #252d3b;
color: #252a31;
font-size: 18px;
line-height: 1.15;
}
@@ -1106,7 +1121,7 @@
}
.asset-arrow {
color: #b9aea3;
color: #a58975;
}
.asset-wallet {
@@ -1114,7 +1129,7 @@
align-content: center;
gap: 6px;
min-width: 0;
padding: 12px 13px;
padding: 12px;
background: #ffffff;
}
@@ -1136,7 +1151,7 @@
padding: 0;
border: 0;
background: transparent;
color: #b27035;
color: #9c6746;
font-size: 9px;
font-weight: 700;
}
@@ -1144,7 +1159,7 @@
.asset-wallet-main > strong {
min-width: 0;
overflow: hidden;
color: #222a37;
color: #252a31;
font-size: 19px;
line-height: 1.2;
text-overflow: ellipsis;
@@ -1155,10 +1170,10 @@
flex: 0 0 auto;
min-height: 26px;
padding: 0 9px;
border: 1px solid #f3c8aa;
border-radius: 999px;
background: #fff8f2;
color: #d95b00;
border: 1px solid #a95522;
border-radius: 6px;
background: #a95522;
color: #ffffff;
font-size: 10px;
font-weight: 800;
}
@@ -1166,17 +1181,17 @@
.quality-entry-card {
display: grid;
gap: 9px;
margin: 12px 16px 0;
margin: 10px 12px 0;
padding: 12px 13px;
border: 1px solid #eee2d3;
border-radius: 14px;
background: linear-gradient(135deg, #fffaf4 0%, #ffffff 74%);
box-shadow: 0 4px 14px rgba(134, 85, 34, 0.025);
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.03);
}
.quality-entry-card.is-active {
border-color: #e6c17c;
background: linear-gradient(135deg, #fff8e9 0%, #ffffff 74%);
border-color: #dfd1c2;
background: #ffffff;
}
.quality-entry-head,
@@ -1203,10 +1218,10 @@
height: 30px;
flex: 0 0 auto;
place-items: center;
border: 1px solid #efd7b9;
border-radius: 9px;
background: #fff1df;
color: #cf670c;
border: 1px solid #eadfd6;
border-radius: 8px;
background: #f8f2ed;
color: #9c6746;
}
.quality-entry-copy {
@@ -1240,7 +1255,7 @@
flex-wrap: wrap;
gap: 6px 10px;
padding-top: 8px;
border-top: 1px solid #f3eadf;
border-top: 1px solid #eeeeec;
}
.quality-entry-summary span {
@@ -1256,7 +1271,7 @@
padding: 0;
border: 0;
background: transparent;
color: #bd681b;
color: #9c6746;
font-size: 9px;
font-weight: 700;
}
@@ -1266,7 +1281,7 @@
justify-content: space-between;
gap: 8px;
padding-top: 8px;
border-top: 1px solid #f3eadf;
border-top: 1px solid #eeeeec;
}
.quality-entry-actions > span,
@@ -1308,11 +1323,11 @@
.service-panel,
.more-services-card {
margin: 12px 16px 0;
border: 1px solid #eceff3;
border-radius: 14px;
margin: 10px 12px 0;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.03);
}
.service-panel {
@@ -1329,7 +1344,7 @@
.service-section-head h3 {
margin: 0;
color: #202733;
color: #252a31;
font-size: 13px;
}
@@ -1340,7 +1355,7 @@
padding: 0;
border: 0;
background: transparent;
color: #8a929f;
color: #8b908f;
font-size: 9px;
}
@@ -1373,49 +1388,49 @@
width: 36px;
height: 36px;
place-items: center;
border-radius: 10px;
border-radius: 8px;
transition: transform 0.15s ease;
}
.service-icon.warning {
background: #fff5de;
color: #d89000;
background: #f8f3e9;
color: #8c6a38;
}
.service-icon.info {
background: #edf4ff;
color: #3178d9;
background: #f2f4f5;
color: #667680;
}
.service-icon.primary {
background: #eef4ff;
color: #1d6dd1;
background: #f5f1ed;
color: #7d6657;
}
.service-icon.success {
background: #ebf9f3;
color: #159a6b;
background: #eef4ef;
color: #55705d;
}
.service-icon.orange {
background: #fff0e7;
color: #e96508;
background: #f8eee6;
color: #9c542b;
}
.service-icon.gold {
background: #fff6e6;
color: #c78a21;
background: #f8f2e7;
color: #8e6a32;
}
.service-icon.teal {
background: #e9f8f7;
color: #13938d;
background: #eff4f3;
color: #5b7773;
}
.service-item > span {
overflow: hidden;
max-width: 100%;
color: #4a5361;
color: #555b62;
font-size: 10px;
font-weight: 600;
text-overflow: ellipsis;
@@ -1425,17 +1440,17 @@
.service-divider {
height: 1px;
margin: 13px 0;
background: #f0f2f5;
background: #eeeeec;
}
.more-services-card {
overflow: hidden;
margin-bottom: 14px;
margin-bottom: 12px;
}
.more-services-title {
padding: 13px 14px 8px;
color: #4e5867;
color: #555b62;
font-size: 11px;
font-weight: 800;
}
@@ -1443,11 +1458,12 @@
.more-services-card :deep(.van-cell) {
padding: 11px 14px;
font-size: 13px;
color: #3e444b;
}
.more-services-card :deep(.van-cell__left-icon) {
margin-right: 9px;
color: #9a7454;
color: #8b7362;
}
/* ========== 响应式适配 ========== */
@@ -626,7 +626,7 @@ function resolveAvatarURL(url: string | undefined | null) {
size="small"
round
type="primary"
color="#ff6a00"
color="#a95522"
:loading="qualityOwnerLoading"
:disabled="
(qualityOwnerStatus?.available_balance_cent || 0) <
@@ -641,7 +641,7 @@ function resolveAvatarURL(url: string | undefined | null) {
round
plain
type="primary"
color="#a45b16"
color="#8d674c"
:loading="qualityOwnerOnlineLoading"
@click="handleOnlineQualityOwnerPayment"
>
@@ -780,7 +780,7 @@ function resolveAvatarURL(url: string | undefined | null) {
<van-button
round
type="primary"
color="#7c3aed"
color="#a95522"
:disabled="!qualityOwnerAgreementCanConfirm"
@click="confirmQualityOwnerAgreement"
>
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
import { Delete, Star, StarFilled } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -9,16 +8,7 @@ import {
useListingCollections,
type ListingCollectionItem,
} from '@/features/listings/composables/useListingCollections'
import { formatCent, formatMoney } from '@/shared/utils/money'
import {
formatHafCoinM,
formatListingCode,
getCoinWan,
getListingDisplayPrice,
getListingTitle,
} from '@/shared/utils/listingDisplay'
const route = useRoute()
const {
history,
favorites,
@@ -28,8 +18,7 @@ const {
removeFavorite,
clearHistory,
} = useListingCollections()
const activeTab = ref(route.query.tab === 'favorites' ? 'favorites' : 'history')
const isMobilePage = computed(() => route.path.startsWith('/m/'))
const activeTab = ref('history')
const activeItems = computed(() =>
activeTab.value === 'favorites' ? favorites.value : history.value
)
@@ -66,10 +55,6 @@ function handleRemove(item: ListingCollectionItem) {
ElMessage.success('已移除记录')
}
function detailPath(item: ListingCollectionItem) {
return isMobilePage.value ? `/m/listings/${item.listing.id}` : `/listings/${item.listing.id}`
}
function timeText(item: ListingCollectionItem) {
const value = activeTab.value === 'favorites' ? item.favorited_at : item.viewed_at
if (!value) return ''
@@ -78,7 +63,7 @@ function timeText(item: ListingCollectionItem) {
</script>
<template>
<main :class="['collections-page', { mobile: isMobilePage }]">
<main class="collections-page">
<header class="collections-header">
<div>
<p class="eyebrow">Account Memory</p>
@@ -111,10 +96,9 @@ function timeText(item: ListingCollectionItem) {
</button>
</nav>
<el-empty v-if="!activeItems.length && !isMobilePage" :description="emptyText" />
<div v-else-if="!activeItems.length" class="mobile-empty">{{ emptyText }}</div>
<el-empty v-if="!activeItems.length" :description="emptyText" />
<section v-else-if="!isMobilePage" class="pc-list">
<section v-else class="pc-list">
<article v-for="item in activeItems" :key="item.listing.id" class="pc-item">
<div class="item-meta">
<span>{{ timeText(item) }}</span>
@@ -132,39 +116,6 @@ function timeText(item: ListingCollectionItem) {
<ListingCard :listing="item.listing" />
</article>
</section>
<section v-else class="mobile-list">
<article v-for="item in activeItems" :key="item.listing.id" class="mobile-card">
<RouterLink :to="detailPath(item)" class="mobile-card-main">
<img
v-if="item.listing.cover_url || item.listing.screenshot_urls?.[0]"
:src="item.listing.cover_url || item.listing.screenshot_urls?.[0]"
:alt="getListingTitle(item.listing)"
loading="lazy"
decoding="async"
/>
<div v-else class="mobile-cover-empty">HFB</div>
<div class="mobile-info">
<strong>{{ getListingTitle(item.listing) }}</strong>
<small>编号 {{ formatListingCode(item.listing) }}</small>
<div class="mobile-stats">
<span>{{ formatHafCoinM(getCoinWan(item.listing)) }}</span>
<span>押金 ¥{{ formatCent(item.listing.deposit_amount_cent) }}</span>
</div>
<em>¥{{ formatMoney(getListingDisplayPrice(item.listing)) }}</em>
</div>
</RouterLink>
<div class="mobile-card-actions">
<span>{{ timeText(item) }}</span>
<div>
<button type="button" @click="handleToggleFavorite(item)">
{{ isFavorite(item.listing.id) ? '已收藏' : '收藏' }}
</button>
<button type="button" @click="handleRemove(item)">移除</button>
</div>
</div>
</article>
</section>
</main>
</template>
@@ -203,8 +154,7 @@ function timeText(item: ListingCollectionItem) {
}
.collections-header button,
.collection-tabs button,
.mobile-card-actions button {
.collection-tabs button {
border: 0;
cursor: pointer;
}
@@ -257,130 +207,4 @@ function timeText(item: ListingCollectionItem) {
color: #98a2b3;
font-size: 13px;
}
.collections-page.mobile {
min-height: 100vh;
padding: 14px;
background: #f7f8fa;
}
.mobile .collections-header {
padding: 16px;
}
.mobile .collections-header h1 {
font-size: 22px;
}
.mobile .collections-header button {
display: none;
}
.mobile .collection-tabs {
display: grid;
grid-template-columns: 1fr 1fr;
width: 100%;
border-radius: 8px;
}
.mobile .collection-tabs button {
border-radius: 8px;
}
.mobile-empty {
padding: 44px 0;
text-align: center;
color: #98a2b3;
}
.mobile-list {
display: grid;
gap: 10px;
}
.mobile-card {
overflow: hidden;
border-radius: 8px;
background: #fff;
}
.mobile-card-main {
display: grid;
grid-template-columns: 104px 1fr;
gap: 10px;
padding: 10px;
color: inherit;
text-decoration: none;
}
.mobile-card-main img,
.mobile-cover-empty {
width: 104px;
height: 104px;
border-radius: 8px;
object-fit: cover;
}
.mobile-cover-empty {
display: grid;
place-items: center;
background: #f2f4f7;
color: #cbd5e1;
font-weight: 900;
}
.mobile-info {
display: grid;
align-content: start;
gap: 6px;
min-width: 0;
}
.mobile-info strong,
.mobile-info small {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mobile-info small,
.mobile-stats {
color: #667085;
font-size: 12px;
}
.mobile-stats {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.mobile-info em {
color: #ff6a00;
font-style: normal;
font-weight: 800;
}
.mobile-card-actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 8px 10px 10px;
border-top: 1px solid #f2f4f7;
color: #98a2b3;
font-size: 12px;
}
.mobile-card-actions div {
display: flex;
gap: 8px;
}
.mobile-card-actions button {
padding: 5px 9px;
border-radius: 999px;
background: #fff7ed;
color: #ff6a00;
}
</style>
@@ -0,0 +1,416 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { RouterLink, useRoute, useRouter } from 'vue-router'
import { showConfirmDialog, showToast } from 'vant'
import MobileBottomNav from '@/components/MobileBottomNav.vue'
import {
useListingCollections,
type ListingCollectionItem,
} from '@/features/listings/composables/useListingCollections'
import {
formatHafCoinM,
formatListingCode,
getCoinWan,
getListingDisplayPrice,
getListingTitle,
} from '@/shared/utils/listingDisplay'
import { formatCent, formatMoney } from '@/shared/utils/money'
import { formatDateMinute } from '@/shared/utils/time'
const route = useRoute()
const router = useRouter()
const {
history,
favorites,
isFavorite,
toggleFavorite,
removeHistory,
removeFavorite,
clearHistory,
} = useListingCollections()
const activeTab = ref(route.query.tab === 'favorites' ? 'favorites' : 'history')
const activeItems = computed(() =>
activeTab.value === 'favorites' ? favorites.value : history.value
)
const emptyText = computed(() =>
activeTab.value === 'favorites' ? '暂无收藏账号' : '暂无浏览记录'
)
function switchTab(tab: 'history' | 'favorites') {
activeTab.value = tab
router.replace({
path: route.path,
query: tab === 'favorites' ? { tab: 'favorites' } : {},
})
}
async function handleClearHistory() {
try {
await showConfirmDialog({
title: '清空浏览记录',
message: '确认清空全部浏览记录吗?',
confirmButtonText: '清空',
cancelButtonText: '取消',
})
clearHistory()
showToast({ message: '浏览记录已清空', icon: 'passed' })
} catch {
// 用户取消时保持原状。
}
}
function handleToggleFavorite(item: ListingCollectionItem) {
const added = toggleFavorite(item.listing)
showToast({ message: added ? '已收藏' : '已取消收藏', icon: 'passed' })
}
function handleRemove(item: ListingCollectionItem) {
if (activeTab.value === 'favorites') {
removeFavorite(item.listing.id)
showToast({ message: '已取消收藏', icon: 'passed' })
return
}
removeHistory(item.listing.id)
showToast({ message: '已移除记录', icon: 'passed' })
}
function timeText(item: ListingCollectionItem) {
const value = activeTab.value === 'favorites' ? item.favorited_at : item.viewed_at
return value ? formatDateMinute(value) : ''
}
</script>
<template>
<main class="mobile-collections">
<header class="mobile-header">
<button type="button" class="back-button" aria-label="返回" @click="router.back()">
<van-icon name="arrow-left" :size="20" />
</button>
<h1>我的足迹</h1>
<button
v-if="activeTab === 'history' && history.length"
type="button"
class="clear-button"
@click="handleClearHistory"
>
清空
</button>
<span v-else class="header-spacer"></span>
</header>
<section class="memory-intro">
<span>ACCOUNT MEMORY</span>
<p>找回看过和收藏过的账号。</p>
</section>
<nav class="collection-tabs" aria-label="足迹分类">
<button
type="button"
:class="{ active: activeTab === 'history' }"
@click="switchTab('history')"
>
浏览记录 <span>{{ history.length }}</span>
</button>
<button
type="button"
:class="{ active: activeTab === 'favorites' }"
@click="switchTab('favorites')"
>
收藏账号 <span>{{ favorites.length }}</span>
</button>
</nav>
<section class="collection-list">
<van-empty v-if="activeItems.length === 0" :description="emptyText" class="empty-state" />
<template v-else>
<article v-for="item in activeItems" :key="item.listing.id" class="collection-card">
<RouterLink :to="`/m/listings/${item.listing.id}`" class="card-main">
<img
v-if="item.listing.cover_url || item.listing.screenshot_urls?.[0]"
:src="item.listing.cover_url || item.listing.screenshot_urls?.[0]"
:alt="getListingTitle(item.listing)"
loading="lazy"
decoding="async"
/>
<div v-else class="cover-empty">HFB</div>
<div class="card-info">
<strong>{{ getListingTitle(item.listing) }}</strong>
<small>编号 {{ formatListingCode(item.listing) }}</small>
<div class="card-stats">
<span>{{ formatHafCoinM(getCoinWan(item.listing)) }}</span>
<span>押金 ¥{{ formatCent(item.listing.deposit_amount_cent) }}</span>
</div>
<em>¥{{ formatMoney(getListingDisplayPrice(item.listing)) }}</em>
</div>
</RouterLink>
<footer class="card-footer">
<time>{{ timeText(item) }}</time>
<div>
<button
type="button"
class="text-action"
:class="{ 'is-active': isFavorite(item.listing.id) }"
@click="handleToggleFavorite(item)"
>
{{ isFavorite(item.listing.id) ? '已收藏' : '收藏' }}
</button>
<button type="button" class="text-action is-remove" @click="handleRemove(item)">
移除
</button>
</div>
</footer>
</article>
</template>
</section>
<MobileBottomNav />
</main>
</template>
<style scoped>
.mobile-collections {
min-height: 100dvh;
padding-bottom: calc(52px + env(safe-area-inset-bottom));
background: #f4f4f2;
color: #252a31;
}
.mobile-header {
position: sticky;
top: 0;
z-index: 100;
display: grid;
grid-template-columns: 38px minmax(0, 1fr) 52px;
align-items: center;
height: 52px;
padding: 0 10px;
border-bottom: 1px solid #ececea;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 1px 8px rgba(26, 28, 31, 0.03);
backdrop-filter: blur(12px);
}
.mobile-header h1 {
margin: 0;
overflow: hidden;
color: #24282d;
font-size: 17px;
font-weight: 700;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}
.back-button {
display: grid;
width: 34px;
height: 34px;
place-items: center;
border: 1px solid #ececea;
border-radius: 8px;
background: #f7f7f5;
color: #4f555b;
}
.clear-button {
justify-self: end;
min-height: 27px;
padding: 0 8px;
border: 0;
border-radius: 6px;
background: #f7eee7;
color: #96542f;
font: inherit;
font-size: 10px;
font-weight: 600;
}
.header-spacer {
width: 52px;
}
.memory-intro {
padding: 14px 14px 2px;
}
.memory-intro span {
color: #a95522;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.04em;
}
.memory-intro p {
margin: 5px 0 0;
color: #747980;
font-size: 12px;
line-height: 1.5;
}
.collection-tabs {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 3px;
margin: 10px 12px 0;
padding: 3px;
border: 1px solid #e4e3e0;
border-radius: 8px;
background: #edebe8;
}
.collection-tabs button {
min-height: 34px;
border: 0;
border-radius: 6px;
background: transparent;
color: #6f7479;
font: inherit;
font-size: 12px;
font-weight: 600;
}
.collection-tabs button.active {
background: #ffffff;
color: #8d461c;
box-shadow: 0 1px 3px rgba(35, 32, 29, 0.08);
}
.collection-tabs span {
display: inline-flex;
min-width: 18px;
height: 18px;
align-items: center;
justify-content: center;
margin-left: 5px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.7);
font-size: 10px;
}
.collection-tabs button.active span {
background: #f6eee8;
color: #9c542b;
}
.collection-list {
padding: 10px 12px 20px;
}
.empty-state {
padding: 54px 0;
}
.collection-card {
margin-bottom: 8px;
overflow: hidden;
border: 1px solid #e7e6e3;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.03);
}
.card-main {
display: grid;
grid-template-columns: 84px minmax(0, 1fr);
gap: 11px;
padding: 10px;
color: inherit;
text-decoration: none;
}
.card-main img,
.cover-empty {
width: 84px;
height: 84px;
border-radius: 8px;
object-fit: cover;
}
.cover-empty {
display: grid;
place-items: center;
background: #f4f2ef;
color: #aaa49e;
font-size: 14px;
font-weight: 700;
}
.card-info {
display: grid;
min-width: 0;
align-content: start;
gap: 4px;
}
.card-info strong {
display: -webkit-box;
overflow: hidden;
color: #252a31;
font-size: 14px;
line-height: 1.4;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.card-info small {
overflow: hidden;
color: #858a90;
font-size: 10px;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-stats {
display: flex;
flex-wrap: wrap;
gap: 8px;
color: #6f7479;
font-size: 10px;
}
.card-info em {
color: #9c542b;
font-size: 15px;
font-style: normal;
font-weight: 700;
}
.card-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 8px 10px;
border-top: 1px solid #eeeeec;
color: #969b9f;
font-size: 10px;
}
.card-footer > div {
display: flex;
gap: 12px;
}
.text-action {
padding: 0;
border: 0;
background: transparent;
color: #8b6a55;
font: inherit;
font-size: 10px;
font-weight: 600;
}
.text-action.is-active {
color: #9c542b;
}
.text-action.is-remove {
color: #985858;
}
</style>
@@ -343,11 +343,11 @@ async function copyListingCode(order: UserOrderListItem) {
<van-tabs
v-model:active="activeTab"
class="custom-tabs"
line-width="20px"
line-width="18px"
line-height="3px"
color="#1477ff"
title-active-color="#1477ff"
title-inactive-color="#6b7280"
color="#a95522"
title-active-color="#8d461c"
title-inactive-color="#747980"
:border="false"
swipeable
animated
@@ -384,30 +384,32 @@ async function copyListingCode(order: UserOrderListItem) {
<!-- 租赁卡片 -->
<template v-if="item.bizType === 'rental' && item.rental">
<div class="card-body">
<button
class="listing-code-chip"
type="button"
@click.stop="copyListingCode(item.rental)"
>
商品编号 {{ formatListingCode(item.rental) }}
</button>
<h3 class="order-title">{{ item.title }}</h3>
<p v-if="rentalTermChips(item.rental).length" class="rental-terms">
<span
v-for="chip in rentalTermChips(item.rental)"
:key="chip.label"
:class="chip.tone"
<div class="card-body rental-body">
<div class="rental-main">
<button
class="listing-code-chip"
type="button"
@click.stop="copyListingCode(item.rental)"
>
{{ chip.label }} {{ chip.value }}
</span>
</p>
<div class="tag-row">
<span class="info-tag">{{ item.rental.server_region }}</span>
<span class="info-tag">{{ item.rental.login_platform }}</span>
商品编号 {{ formatListingCode(item.rental) }}
</button>
<h3 class="order-title">{{ item.title }}</h3>
<p v-if="rentalTermChips(item.rental).length" class="rental-terms">
<span
v-for="chip in rentalTermChips(item.rental)"
:key="chip.label"
:class="chip.tone"
>
{{ chip.label }} {{ chip.value }}
</span>
</p>
<div class="tag-row">
<span class="info-tag">{{ item.rental.server_region }}</span>
<span class="info-tag">{{ item.rental.login_platform }}</span>
</div>
</div>
<div class="price-row">
<div class="rental-price-panel">
<div class="price-item">
<span class="price-label">{{ amountLabel(item.rental) }}</span>
<span class="price-val">¥{{ money(orderRentAmount(item.rental)) }}</span>
@@ -532,8 +534,10 @@ async function copyListingCode(order: UserOrderListItem) {
<style scoped>
.mobile-orders {
min-height: 100dvh;
background: #f6f8fa;
padding-bottom: calc(64px + env(safe-area-inset-bottom));
padding-bottom: calc(52px + env(safe-area-inset-bottom));
background: #f4f4f2;
color: #252a31;
--van-primary-color: #a95522;
}
.page-header {
@@ -542,11 +546,12 @@ async function copyListingCode(order: UserOrderListItem) {
z-index: 100;
display: flex;
align-items: center;
height: 48px;
padding: 0 12px;
background: rgba(255, 255, 255, 0.94);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(243, 244, 246, 0.8);
height: 52px;
padding: 0 10px;
background: rgba(255, 255, 255, 0.96);
backdrop-filter: blur(12px);
border-bottom: 1px solid #ececea;
box-shadow: 0 1px 8px rgba(26, 28, 31, 0.03);
}
.page-header h1 {
@@ -554,7 +559,7 @@ async function copyListingCode(order: UserOrderListItem) {
font-size: 17px;
font-weight: 700;
text-align: center;
color: #111827;
color: #24282d;
}
.header-title-wrap {
@@ -568,58 +573,59 @@ async function copyListingCode(order: UserOrderListItem) {
.m-site-order-tag {
display: inline-block;
padding: 2px 8px;
border-radius: 999px;
background: rgba(20, 119, 255, 0.1);
border: 1px solid rgba(20, 119, 255, 0.25);
color: #1477ff;
font-size: 11px;
font-weight: 600;
max-width: 110px;
white-space: nowrap;
overflow: hidden;
padding: 2px 7px;
border-radius: 999px;
border: 1px solid #e9d9cd;
background: #f8f1eb;
color: #9c542b;
font-size: 10px;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
}
.site-order-notice-bar {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
background: linear-gradient(90deg, #eff6ff, #f0fdf4);
border-bottom: 1px solid #dbeafe;
font-size: 12px;
color: #1d4ed8;
padding: 7px 14px;
border-bottom: 1px solid #ece6e1;
background: #faf7f4;
color: #7c6657;
font-size: 11px;
font-weight: 500;
}
.site-order-notice-bar .notice-icon {
font-size: 14px;
color: #2563eb;
font-size: 13px;
color: #9c6746;
}
.back-btn {
display: grid;
width: 36px;
height: 36px;
width: 34px;
height: 34px;
place-items: center;
border: none;
background: none;
color: #374151;
border: 1px solid #ececea;
border-radius: 8px;
background: #f7f7f5;
color: #4f555b;
cursor: pointer;
}
.header-spacer {
width: 36px;
width: 34px;
}
.custom-tabs {
position: sticky;
top: 48px;
top: 52px;
z-index: 99;
background: rgba(255, 255, 255, 0.94);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(243, 244, 246, 0.6);
background: rgba(255, 255, 255, 0.96);
backdrop-filter: blur(12px);
border-bottom: 1px solid #ececea;
}
:deep(.van-tabs__nav) {
@@ -633,7 +639,7 @@ async function copyListingCode(order: UserOrderListItem) {
}
.order-list {
padding: 14px 16px;
padding: 12px;
}
.center-loading {
@@ -648,30 +654,28 @@ async function copyListingCode(order: UserOrderListItem) {
.order-card {
background: #ffffff;
border-radius: 16px;
margin-bottom: 14px;
padding: 16px;
box-shadow:
0 4px 18px rgba(0, 0, 0, 0.02),
0 1px 4px rgba(0, 0, 0, 0.02);
border: 1px solid #e7e6e3;
border-radius: 8px;
margin-bottom: 10px;
padding: 14px;
box-shadow: 0 4px 14px rgba(28, 31, 35, 0.035);
transition:
transform 0.1s ease,
box-shadow 0.1s ease;
border: 1px solid rgba(243, 244, 246, 0.9);
background 0.15s,
box-shadow 0.15s;
cursor: pointer;
}
.order-card:active {
transform: scale(0.98);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
background: #faf8f6;
box-shadow: 0 2px 8px rgba(28, 31, 35, 0.03);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px dashed #f3f4f6;
padding-bottom: 9px;
border-bottom: 1px dashed #ececea;
gap: 8px;
}
@@ -684,26 +688,24 @@ async function copyListingCode(order: UserOrderListItem) {
.biz-tag {
flex-shrink: 0;
padding: 2px 6px;
border-radius: 6px;
padding: 0;
background: transparent !important;
font-size: 10px;
font-weight: 800;
font-weight: 700;
line-height: 1.2;
}
.biz-tag.rental {
color: #1477ff;
background: rgba(20, 119, 255, 0.1);
color: #61705f;
}
.biz-tag.crash {
color: #ff6a00;
background: rgba(255, 106, 0, 0.1);
color: #965a35;
}
.order-no {
font-size: 11px;
color: #9ca3af;
color: #95999e;
font-family: monospace;
overflow: hidden;
text-overflow: ellipsis;
@@ -712,133 +714,202 @@ async function copyListingCode(order: UserOrderListItem) {
.status-badge {
flex-shrink: 0;
padding: 4px 8px;
border-radius: 8px;
font-size: 11px;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 0;
background: transparent !important;
font-size: 10px;
font-weight: 700;
line-height: 1;
}
.status-badge::before {
flex: 0 0 5px;
width: 5px;
height: 5px;
border-radius: 50%;
background: currentColor;
content: '';
}
.listing-code-chip {
margin-bottom: 8px;
padding: 4px 9px;
border: 1px solid #dbeafe;
border-radius: 999px;
background: #eff6ff;
color: #2563eb;
font-size: 12px;
font-weight: 800;
max-width: 100%;
overflow: hidden;
margin-bottom: 7px;
padding: 0;
border: 0;
background: transparent;
color: #888d92;
font: inherit;
font-size: 11px;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.badge-pending_payment {
color: #ff6a00;
background: rgba(255, 106, 0, 0.08);
background: #f8eee6;
color: #9c542b;
}
.badge-pending_handoff {
color: #d97706;
background: rgba(217, 119, 6, 0.08);
background: #f8f3e9;
color: #876936;
}
.badge-renting {
color: #1477ff;
background: rgba(20, 119, 255, 0.08);
background: #eef4ef;
color: #55705d;
}
.badge-overdue {
color: #ef4444;
background: rgba(239, 68, 68, 0.08);
background: #f8eded;
color: #9c5656;
}
.badge-pending_return_confirm,
.badge-pending_checkout_confirm {
color: #8b5cf6;
background: rgba(139, 92, 246, 0.08);
background: #f4efeb;
color: #80614f;
}
.badge-pending_checkout_accept {
color: #a855f7;
background: rgba(168, 85, 247, 0.08);
background: #f3f0ec;
color: #776554;
}
.badge-checkout_disputing,
.badge-disputing,
.badge-abnormal {
color: #ef4444;
background: rgba(239, 68, 68, 0.08);
background: #f8eded;
color: #9c5656;
}
.badge-paid {
color: #1477ff;
background: rgba(20, 119, 255, 0.08);
background: #f2f3f2;
color: #666d6b;
}
.badge-receiving {
color: #d97706;
background: rgba(217, 119, 6, 0.1);
background: #f8f3e9;
color: #876936;
}
.badge-completed {
color: #10b981;
background: rgba(16, 185, 129, 0.08);
background: #eef4ef;
color: #55705d;
}
.badge-cancelled,
.badge-closed,
.badge-refunded {
color: #9ca3af;
background: rgba(156, 163, 175, 0.08);
background: #f3f3f2;
color: #858a90;
}
.card-body {
padding: 12px 0 0;
padding: 11px 0 0;
}
.rental-body {
display: grid;
grid-template-columns: minmax(0, 1fr) 118px;
align-items: start;
gap: 12px;
}
.rental-main {
min-width: 0;
}
.order-title {
margin: 0 0 8px;
font-size: 15px;
margin: 0 0 7px;
color: #252a31;
font-size: 14px;
font-weight: 700;
color: #111827;
line-height: 1.4;
line-height: 1.45;
}
.rental-terms {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin: -2px 0 8px;
gap: 8px;
margin: -1px 0 7px;
}
.rental-terms span {
padding: 1px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 800;
line-height: 18px;
position: relative;
padding: 0;
font-size: 10px;
font-weight: 600;
line-height: 16px;
}
.rental-terms span + span::before {
margin-right: 8px;
color: #b1b3b5;
content: '·';
}
.rental-terms .term-rental {
background: #16a34a;
color: #fff;
color: #55705d;
}
.rental-terms .term-loss {
background: #f97316;
color: #fff;
color: #95603a;
}
.tag-row {
display: flex;
gap: 6px;
margin-bottom: 12px;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-bottom: 10px;
}
.rental-main .tag-row {
margin-bottom: 0;
}
.info-tag {
position: relative;
padding: 0;
background: transparent;
color: #676d73;
font-size: 11px;
color: #6b7280;
background: #f3f4f6;
padding: 3px 8px;
border-radius: 6px;
font-weight: 500;
font-weight: 600;
}
.info-tag + .info-tag::before {
margin-right: 8px;
color: #b1b3b5;
content: '·';
}
.price-row {
display: flex;
background: #f9fafb;
border-radius: 12px;
padding: 10px 14px;
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
border: 1px solid #eeeeec;
border-radius: 8px;
background: #f8f8f6;
}
.rental-price-panel {
display: grid;
gap: 9px;
padding: 0;
}
.rental-price-panel .price-item {
gap: 3px;
}
.rental-price-panel .price-label {
text-align: right;
}
.rental-price-panel .price-val {
align-items: flex-end;
font-size: 16px;
}
.rental-price-panel .price-item + .price-item {
padding-top: 8px;
border-top: 1px solid #efefed;
}
.price-item {
@@ -849,31 +920,31 @@ async function copyListingCode(order: UserOrderListItem) {
.price-label {
font-size: 10px;
color: #9ca3af;
color: #8a8f95;
}
.price-val {
display: flex;
flex-direction: column;
align-items: flex-end;
color: #9c542b;
font-size: 15px;
font-weight: 800;
color: #ff5f00;
font-weight: 700;
}
.price-val em {
font-style: normal;
font-size: 10px;
font-weight: 600;
color: #2563eb;
color: #8b6a55;
}
.price-val.deposit {
color: #374151;
color: #343a40;
}
.price-sub {
color: #10b981;
color: #55705d;
font-size: 11px;
font-weight: 700;
}
@@ -887,13 +958,13 @@ async function copyListingCode(order: UserOrderListItem) {
.crash-cover {
width: 64px;
height: 64px;
border-radius: 10px;
border-radius: 8px;
overflow: hidden;
background: #f0f3f8;
background: #f3f3f1;
display: flex;
align-items: center;
justify-content: center;
color: #a0aec0;
color: #92979c;
font-size: 12px;
}
@@ -910,7 +981,7 @@ async function copyListingCode(order: UserOrderListItem) {
.crash-meta {
margin: 0 0 8px;
font-size: 13px;
color: #8a94a6;
color: #81868c;
}
.crash-price {
@@ -925,16 +996,16 @@ async function copyListingCode(order: UserOrderListItem) {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid #f3f4f6;
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #eeeeec;
}
.time-box {
display: flex;
align-items: center;
gap: 4px;
color: #9ca3af;
color: #92979c;
}
.clock-icon {
@@ -947,7 +1018,7 @@ async function copyListingCode(order: UserOrderListItem) {
.detail-link {
font-size: 12px;
color: #1477ff;
color: #9c542b;
font-weight: 600;
display: flex;
align-items: center;
@@ -955,13 +1026,16 @@ async function copyListingCode(order: UserOrderListItem) {
}
.pay-hint {
color: #ff5f00;
color: #9c542b;
}
.hide-btn {
height: 28px;
padding: 0 12px;
font-size: 12px;
border-color: #e5cece !important;
background: #ffffff !important;
color: #985858 !important;
font-size: 11px;
}
.footer-action {
@@ -972,11 +1046,29 @@ async function copyListingCode(order: UserOrderListItem) {
.pay-btn {
height: 28px !important;
padding: 0 16px !important;
font-size: 12px !important;
padding: 0 14px !important;
border: 1px solid #a95522 !important;
background: #a95522 !important;
color: #ffffff !important;
font-size: 11px !important;
font-weight: 700 !important;
background: linear-gradient(135deg, #ff8c00, #ff5f00) !important;
border: none !important;
box-shadow: 0 4px 10px rgba(255, 95, 0, 0.2) !important;
box-shadow: none !important;
}
@media (max-width: 360px) {
.rental-body {
grid-template-columns: 1fr;
}
.rental-price-panel {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rental-price-panel .price-item + .price-item {
padding-top: 0;
padding-left: 10px;
border-top: 0;
border-left: 1px solid #e9e9e7;
}
}
</style>
+1 -1
View File
@@ -16,7 +16,7 @@ export const mobileRoutes: RouteRecordRaw[] = [
{
path: '/m/listings/collections',
name: 'mobile-listing-collections',
component: () => import('@/features/listings/views/ListingCollectionsView.vue'),
component: () => import('@/features/listings/views/MobileListingCollectionsView.vue'),
meta: { layout: 'blank' },
},
{