文件
fenleixinxi/uniapp/pages/index/index.vue
MiAn cb12bf5fc8 feat: 新增地址选择插件及订阅消息等多项功能优化
- 新增地址选择插件,支持地图位置选择并返回地址和经纬度
- 新增微信订阅消息发送功能,支持审核结果、提现通知等场景
- 新增订单支付状态查询、提现收款人姓名保存等接口
- 新增服务区域管理,支持按省市区划分并同步到信息发布
- 新增资金流水和营收报表导出功能
- 新增可用优惠券查询、订单退款拆分处理等功能
- 优化后台角标显示、首页数据统计、UI配置下发等
- 修复订单支付并发问题、地区管理逻辑等
2026-10-22 17:14:56 +08:00

890 行
24 KiB
Vue

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<template>
<view class="fc-page home">
<!-- 顶部:LOGO + 定位 + 消息 + 搜索 -->
<view class="home__header">
<view class="home__header-status" :style="{ height: statusBarHeight + 'px' }"></view>
<view
class="home__header-bar"
:style="{
paddingRight: (capsulePadding || 12) + 'px',
minHeight: (navBarHeight || 44) + 'px',
}"
>
<image class="fc-logo fc-logo--sm" :src="logoUrl()" mode="aspectFit" />
<view class="home__location" @click="useCurrentLocation">
<image class="home__location-icon" :src="iconUrl('home-location')" mode="aspectFit" />
<text class="home__location-text fc-ellipsis">{{ currentCityText }}</text>
<text class="home__location-arrow">▾</text>
</view>
<view class="home__msg" @click="go('/pages/message/index')">
<image class="fc-icon fc-icon--sm" :src="iconUrl('home-bell')" mode="aspectFit" />
<view v-if="unread > 0" class="home__msg-dot">{{ unread }}</view>
</view>
</view>
<view class="home__search" @click="goSearch">
<image class="fc-icon fc-icon--sm" :src="iconUrl('home-search')" mode="aspectFit" />
<text class="home__search-ph">搜索招聘、租房、二手…</text>
</view>
</view>
<!-- 轮播广告位:后台渐变底色 + 页面 CSS 装饰层 + 白色插画(视觉规则见 common/assets/banners.js) -->
<swiper class="home__banner" circular autoplay :interval="4000" :duration="500" indicator-dots
indicator-color="rgba(255,255,255,0.45)" indicator-active-color="#ffffff">
<swiper-item v-for="(b, i) in banners" :key="b.id">
<view class="home__banner-item" :class="{ 'home__banner-item--custom': !!b.image }" :style="{ background: bannerBg(b, i) }" @click="goBanner(b)">
<!-- 1. 后台已配置自定义海报图:全幅高清展示,不叠加文字遮挡画面 -->
<image v-if="b.image" class="home__banner-photo" :src="b.image" mode="aspectFill" />
<!-- 2. 未配置图片:启用内置「春绿渐变底 + 白色徽章插画 + 精选文案」兜底卡片 -->
<template v-else>
<view class="home__banner-deco">
<view class="home__banner-glow"></view>
<view class="home__banner-vein"></view>
<view class="home__banner-hill home__banner-hill--far"></view>
<view class="home__banner-hill home__banner-hill--near"></view>
<view class="home__banner-badge">
<view class="home__banner-ring home__banner-ring--outer"></view>
<view class="home__banner-ring home__banner-ring--inner"></view>
<image class="home__banner-art" :src="bannerArtUrl(i)" mode="aspectFit" />
<view v-if="bannerHasValue(i)" class="home__banner-value">
<view class="home__banner-value-dot"></view>
<view class="home__banner-value-dot home__banner-value-dot--sm"></view>
</view>
</view>
</view>
<!-- 左侧压暗罩与文字浮层:仅在内置兜底卡片显示 -->
<view class="home__banner-shade"></view>
<view class="home__banner-text">
<text class="home__banner-tag">同城精选</text>
<text class="home__banner-title">{{ b.title }}</text>
<view class="home__banner-cta">
<text class="home__banner-cta-text">立即查看 ›</text>
</view>
</view>
</template>
</view>
</swiper-item>
</swiper>
<!-- 分类导航 -->
<view class="fc-card home__cats">
<view class="home__cats-head">
<text class="home__cats-title">同城分类</text>
<text class="home__cats-more" @click="goCategoryTab">全部分类 ›</text>
</view>
<view class="home__cats-grid">
<view v-for="c in categories" :key="c.id" class="home__cat" @click="goCategory(c)">
<view class="home__cat-icon">
<image class="home__cat-badge" :src="catIcon(c)" mode="aspectFit" />
</view>
<text class="home__cat-name">{{ c.name }}</text>
</view>
</view>
</view>
<!-- 会员引导条 -->
<view class="home__vip" @click="go('/pages/member/index')">
<view class="home__vip-left">
<image class="fc-icon fc-icon--md" :src="iconUrl('home-crown')" mode="aspectFit" />
<view class="home__vip-texts">
<text class="home__vip-title">{{ vipTitle }}</text>
<text class="home__vip-sub">{{ vipSub }}</text>
</view>
</view>
<view class="home__vip-btn">{{ isMember ? '查看权益' : '立即开通' }}</view>
</view>
<!-- 筛选排序 -->
<view class="home__filter">
<view v-for="s in sorts" :key="s.value" class="home__filter-item"
:class="{ 'home__filter-item--active': sort === s.value }" @click="changeSort(s.value)">
<text>{{ s.label }}</text>
</view>
<fc-area-picker
class="home__filter-area"
:areas="areaRows"
:value="areaId"
allow-all
variant="chip"
placeholder="区域"
@change="onAreaChange"
/>
</view>
<!-- 骨架屏 -->
<view v-if="loading && !list.length">
<view v-for="i in 3" :key="i" class="fc-post-card home__skeleton">
<view class="fc-skeleton home__skeleton-thumb"></view>
<view class="home__skeleton-body">
<view class="fc-skeleton home__skeleton-line" style="width: 80%"></view>
<view class="fc-skeleton home__skeleton-line" style="width: 50%"></view>
<view class="fc-skeleton home__skeleton-line" style="width: 35%"></view>
</view>
</view>
</view>
<fc-empty v-else-if="!list.length" text="附近暂无信息,换个筛选条件试试" btn-text="去发布"
@action="go('/pages/post/create')" />
<view v-else>
<fc-post-card v-for="p in list" :key="p.id" :post="p" @click="goDetail" />
<view class="home__loadmore">
<text v-if="loading">加载中…</text>
<text v-else-if="!hasMore">— 已经到底啦 —</text>
<text v-else @click="loadMore">加载更多</text>
</view>
</view>
<view class="home__tabbar-space"></view>
<fc-tabbar :current="0" />
</view>
</template>
<script>
import FcPostCard from '@/components/fc-post-card/fc-post-card.vue'
import FcTabbar from '@/components/fc-tabbar/fc-tabbar.vue'
import FcEmpty from '@/components/fc-empty/fc-empty.vue'
import FcAreaPicker from '@/components/fc-area-picker/fc-area-picker.vue'
import homeApi from '@/common/api/home.js'
import memberApi from '@/common/api/member.js'
import messageApi from '@/common/api/message.js'
import { useUserStore } from '@/common/store/index.js'
import { iconUrl, logoUrl, categoryIconUrl, loadUiConfig, uiState } from '@/common/store/ui.js'
import { bannerArtUrl, bannerHasValue, bannerBg } from '@/common/assets/banners.js'
import { getNavMetrics } from '@/common/utils/navbar.js'
export default {
components: { FcPostCard, FcTabbar, FcEmpty, FcAreaPicker },
data() {
return {
statusBarHeight: 20,
navBarHeight: 44,
capsulePadding: 0,
// 顶栏定位文案:由真实定位/区域选择驱动,不再写死具体区(原为「贵阳 · 观山湖区」)
location: '',
unread: 0,
banners: [],
categories: [],
list: [],
page: 1,
size: 10,
hasMore: true,
loading: false,
sort: 'new',
// 区域筛选:业务只按服务区域(区县)筛选
areaId: 0,
areaText: '',
manualArea: false,
lat: null,
lng: null,
// 请求序号:快速切换排序/区域时丢弃过期响应,避免旧结果覆盖新筛选
reqSeq: 0,
// 平铺服务区域(每条自带省/市/区县),交给级联选择器分组
areaRows: [],
// 会员权益 / 套餐(/member/benefits、/member/plans),用于下方会员引导条
benefits: {},
plans: [],
sorts: [
{ label: '最新', value: 'new' },
{ label: '最热', value: 'hot' },
{ label: '价格', value: 'price' },
{ label: '附近', value: 'nearby' },
],
}
},
computed: {
isMember() {
try {
return useUserStore().isMember.value
} catch (e) {
return false
}
},
/** 会员引导条主标题:折扣文案来自 /member/benefits(无则退回通用文案) */
vipTitle() {
if (this.isMember) return '会员权益已生效'
const discount = this.benefits && this.benefits.postDiscount
return discount ? `开通会员,发布${discount}` : '开通会员,享专属特权'
},
/** 会员引导条副标题:免费查看条数来自 /member/benefits,价格取 /member/plans 最低价 */
/**
* 顶栏显示的城市或区域文案(优先当前筛选区域,其次真实定位,缺省回退到同城服务)
*/
currentCityText() {
if (this.areaText) return this.areaText
if (this.location) return this.location
const first = (this.areaRows || [])[0]
if (first && first.city) return first.city
return '同城服务'
},
vipSub() {
if (this.isMember) {
const freeView = Number(this.benefits && this.benefits.freeView)
return freeView > 0 ? `每日免费查看 ${freeView} 条联系方式` : '尊享会员专属权益'
}
const prices = (this.plans || [])
.map((p) => Number(p.price))
.filter((n) => n > 0)
const min = prices.length ? Math.min.apply(null, prices) : 0
return min > 0 ? `超值月卡 ¥${min} 起` : '超值会员权益,立即开通'
},
},
onLoad() {
try {
const m = getNavMetrics()
this.statusBarHeight = m.statusBarHeight
this.navBarHeight = m.navBarHeight
this.capsulePadding = m.capsulePadding
} catch (e) {}
// 拉取后台自定义的 LOGO 与图标配置(失败自动用内置默认图)
loadUiConfig()
// LBS:取一次坐标(失败静默降级,不阻塞首页)
this.fetchLocation()
this.bootstrap()
},
// 每次切回首页都强制重新拉取后台配置:
// 否则 loadUiConfig 内部的 `if (loaded && !force) return` 会让后台改动
// 必须重启小程序才生效,表现为「后台改了前端不变」。
onShow() {
loadUiConfig(true)
// 登录状态可能在别处变化(如从登录页返回),回首页时同步未读角标
this.loadUnread()
},
/** 转发标题统一取后台「小程序配置 → 分享标题」 */
onShareAppMessage() {
return {
title: uiState.shareTitle || uiState.siteName || '同城分类信息',
path: '/pages/index/index',
}
},
/** 分享到朋友圈 */
onShareTimeline() {
return {
title: uiState.shareTitle || uiState.siteName || '同城分类信息',
query: '',
}
},
onPullDownRefresh() {
this.page = 1
this.hasMore = true
// 手动下拉时也同步一次后台配置
loadUiConfig(true)
this.bootstrap().finally(() => uni.stopPullDownRefresh())
},
onReachBottom() {
this.loadMore()
},
methods: {
// 图标/LOGO 地址(由后台配置决定,未配置时用内置图标)
iconUrl,
logoUrl,
// 轮播:内置白色插画 + 金色价值点缀(规则见 common/assets/banners.js)
bannerArtUrl,
bannerHasValue,
bannerBg,
catIcon(c) {
return (c.iconKey && iconUrl(c.iconKey)) || categoryIconUrl(c.id)
},
async bootstrap() {
this.loading = true
try {
const [banners, categories] = await Promise.all([homeApi.banners(), homeApi.categories()])
this.banners = banners
this.categories = categories
} catch (e) {
console.warn('首页基础数据加载失败', e)
}
// 区域 / 会员引导 / 未读角标:各自静默加载,任一失败都不阻塞首页
this.loadAreas()
this.loadMemberCard()
this.loadUnread()
await this.fetchFeed(true)
this.loading = false
},
/** 服务区域(后台「区域管理」下发,平铺:每条自带省/市/区县) */
async loadAreas() {
try {
const rows = await homeApi.areas()
this.areaRows = Array.isArray(rows) ? rows : []
} catch (e) {}
},
/** 会员权益与套餐(首页会员引导条) */
async loadMemberCard() {
try {
const [benefits, plans] = await Promise.all([memberApi.benefits(), memberApi.plans()])
this.benefits = benefits || {}
this.plans = Array.isArray(plans) ? plans : []
} catch (e) {}
},
/**
* 未读消息数(首页消息角标)。
* /message/unread-count 需要登录态,未登录时直接置 0,
* 避免走 request.js 的 401 处理把游客强制跳转到登录页。
*/
async loadUnread() {
let logged = false
try {
logged = !!useUserStore().isLogin.value
} catch (e) {}
if (!logged) {
this.unread = 0
return
}
try {
const res = await messageApi.unreadCount()
this.unread = Number((res && res.count) || 0)
} catch (e) {
this.unread = 0
}
},
/**
* 取用户坐标(gcj02,与后端 LBS 口径一致)。
* 失败静默降级:不弹提示、不阻塞首页,仅本次请求不带 lat/lng。
*/
fetchLocation() {
if (typeof uni === 'undefined' || !uni.getLocation) return
uni.getLocation({
type: 'gcj02',
success: (res) => {
this.lat = res.latitude
this.lng = res.longitude
// 坐标到手后:先按定位匹配区域,再刷新一次信息流
this.applyLocationArea().finally(() => {
this.page = 1
this.fetchFeed(true)
})
},
fail: () => {},
})
},
/**
* 把定位坐标转换成区域筛选默认值(用户手动切换过则不覆盖)
*/
async applyLocationArea() {
if (this.manualArea || this.lat == null || this.lng == null) return
try {
const found = await homeApi.locate({ lat: this.lat, lng: this.lng })
if (found && found.areaId) {
this.areaId = Number(found.areaId) || 0
this.areaText = found.district || ''
this.location = found.city || ''
}
} catch (e) {}
},
async fetchFeed(reset = false) {
const seq = ++this.reqSeq
this.loading = true
try {
const res = await homeApi.feed({
page: this.page,
size: this.size,
sort: this.sort,
areaId: this.areaId || undefined,
lat: this.lat != null ? this.lat : undefined,
lng: this.lng != null ? this.lng : undefined,
})
// 期间又切换了排序/区域:以最后一次请求为准
if (seq !== this.reqSeq) return
this.list = reset ? res.list : this.list.concat(res.list)
this.hasMore = res.hasMore
} catch (e) {
if (seq !== this.reqSeq) return
uni.showToast({ title: '加载失败,请稍后重试', icon: 'none' })
} finally {
if (seq === this.reqSeq) this.loading = false
}
},
loadMore() {
if (!this.hasMore || this.loading) return
this.page += 1
this.fetchFeed()
},
changeSort(v) {
if (this.sort === v) return
this.sort = v
this.page = 1
this.fetchFeed(true)
// 「附近」依赖坐标:无坐标时补取一次定位(成功后自动重排)
if (v === 'nearby' && (this.lat == null || this.lng == null)) {
uni.showToast({ title: '正在获取定位…', icon: 'none' })
this.fetchLocation()
}
},
/** 级联选择器选中服务区域(null = 全部区域) */
onAreaChange(area) {
this.areaId = area ? Number(area.areaId) || 0 : 0
this.areaText = area ? area.district || '' : ''
this.manualArea = true
this.page = 1
this.fetchFeed(true)
},
/** 使用当前位置:清除手动选择,重新定位并匹配区域 */
useCurrentLocation() {
this.manualArea = false
this.fetchLocation()
uni.showToast({ title: '已按当前位置匹配', icon: 'none' })
},
/**
* 页面跳转助手
* @param {string} url 目标路径
*/
go(url) {
if (!url) return
uni.navigateTo({ url })
},
/**
* 规范跳转到全部分类 Tab 页面
*/
goCategoryTab() {
// #ifdef H5
uni.redirectTo({
url: '/pages/category/index',
fail: () => uni.reLaunch({ url: '/pages/category/index' }),
})
// #endif
// #ifndef H5
uni.reLaunch({ url: '/pages/category/index' })
// #endif
},
goSearch() {
uni.navigateTo({ url: '/pages/search/index' })
},
goCategory(c) {
uni.navigateTo({ url: `/pages/post/list?categoryId=${c.id}&name=${encodeURIComponent(c.name)}` })
},
/**
* 点击轮播项跳转处理
* @param {Object} b 轮播数据对象(含 title, image, link 等)
*/
goBanner(b) {
if (!b || !b.link) return
const url = String(b.link).trim()
if (!url) return
if (/^https?:\/\//i.test(url)) {
// #ifdef H5
window.location.href = url
// #endif
// #ifndef H5
uni.setClipboardData({
data: url,
success: () => uni.showToast({ title: '链接已复制,可前往浏览器打开', icon: 'none' })
})
// #endif
return
}
const targetUrl = url.startsWith('/') ? url : `/${url}`
const tabPages = ['/pages/index/index', '/pages/category/index', '/pages/message/index', '/pages/my/index']
const pathOnly = targetUrl.split('?')[0]
if (tabPages.includes(pathOnly)) {
uni.switchTab({ url: pathOnly })
} else {
uni.navigateTo({
url: targetUrl,
fail: (err) => {
console.warn('轮播跳转失败:', err)
}
})
}
},
goDetail(p) {
uni.navigateTo({ url: `/pages/detail/detail?id=${p.id}` })
},
},
}
</script>
<style lang="scss" scoped>
.home__header {
background: $fc-gradient-hero;
padding-bottom: 70rpx;
}
.home__header-bar {
display: flex;
align-items: center;
padding: 6rpx 24rpx 0;
gap: 16rpx;
}
.home__location {
display: inline-flex;
align-items: center;
height: 54rpx;
padding: 0 18rpx 0 14rpx;
background: rgba(255, 255, 255, 0.2);
border: 1rpx solid rgba(255, 255, 255, 0.35);
border-radius: 999rpx;
cursor: pointer;
transition: all 0.2s ease;
min-width: 0;
&:active {
opacity: 0.85;
transform: scale(0.98);
}
}
.home__location-icon {
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
.home__location-text {
font-size: 26rpx;
color: #ffffff;
font-weight: 600;
max-width: 220rpx;
}
.home__location-arrow {
font-size: 20rpx;
color: rgba(255, 255, 255, 0.85);
margin-left: 6rpx;
}
.home__search {
margin: 20rpx 24rpx 0;
height: 72rpx;
border-radius: $fc-radius-pill;
background: rgba(255, 255, 255, 0.94);
display: flex;
align-items: center;
padding: 0 24rpx;
}
.home__search-ph {
margin-left: 12rpx;
font-size: $fc-font-sm;
color: $fc-text-placeholder;
}
.home__msg {
position: relative;
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
}
.home__msg-dot {
position: absolute;
top: -4rpx;
right: -8rpx;
min-width: 30rpx;
height: 30rpx;
padding: 0 6rpx;
border-radius: 999rpx;
background: #ffffff;
color: $fc-primary-text;
font-size: 20rpx;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
}
/* ---------- 轮播卡:绿底 + 中性装饰层 + 白色插画 ---------- */
.home__banner {
height: 300rpx;
margin: -50rpx 24rpx 0;
border-radius: $fc-radius-lg;
overflow: hidden;
box-shadow: $fc-shadow-lg;
}
.home__banner-item {
position: relative;
height: 100%;
overflow: hidden;
padding: 26rpx 0 26rpx 32rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.home__banner-item--custom {
padding: 0;
}
/* 后台自定义整幅配图(优先) */
.home__banner-photo {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
/* 装饰层:一律用中性半透明白 / 深绿,跟随任何后台底色都不会串色 */
.home__banner-deco {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.home__banner-glow {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-image: radial-gradient(circle at 80% 44%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 46%,
rgba(255, 255, 255, 0) 72%);
}
.home__banner-vein {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-image: repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1rpx,
rgba(255, 255, 255, 0) 1rpx, rgba(255, 255, 255, 0) 54rpx);
}
.home__banner-hill {
position: absolute;
border-radius: 50%;
}
.home__banner-hill--far {
left: -26%;
width: 152%;
top: 194rpx;
height: 260rpx;
background: rgba(4, 48, 42, 0.22);
}
.home__banner-hill--near {
left: -14%;
width: 128%;
top: 236rpx;
height: 240rpx;
background: rgba(4, 48, 42, 0.26);
}
/* 大圆徽章:双环 + 白色插画(与 LOGO 的白色定位针同一手法) */
.home__banner-badge {
position: absolute;
right: 14rpx;
top: 50%;
width: 220rpx;
height: 220rpx;
margin-top: -110rpx;
display: flex;
align-items: center;
justify-content: center;
}
.home__banner-ring {
position: absolute;
left: 50%;
top: 50%;
border-radius: 50%;
}
.home__banner-ring--outer {
width: 218rpx;
height: 218rpx;
margin: -109rpx 0 0 -109rpx;
border: 2rpx solid rgba(255, 255, 255, 0.14);
}
.home__banner-ring--inner {
width: 164rpx;
height: 164rpx;
margin: -82rpx 0 0 -82rpx;
border: 2rpx dotted rgba(255, 255, 255, 0.26);
}
.home__banner-art {
width: 116rpx;
height: 116rpx;
}
/* 金色「价值点缀」:只给「直降 / 免费」这类价值主张(像嵌在圆环上的一颗宝石) */
.home__banner-value {
position: absolute;
right: 10rpx;
top: 30rpx;
display: flex;
align-items: center;
}
.home__banner-value-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background: $fc-accent-light;
box-shadow: 0 0 16rpx rgba(245, 166, 35, 0.7);
}
.home__banner-value-dot--sm {
width: 10rpx;
height: 10rpx;
margin-left: 12rpx;
background: $fc-accent;
box-shadow: none;
}
/* 左侧压暗罩 + 文字(白字在任何底色上都够清透) */
.home__banner-shade {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.1) 44%,
rgba(255, 255, 255, 0) 70%);
}
.home__banner-text {
position: relative;
width: 62%;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.home__banner-tag {
padding: 4rpx 16rpx;
border-radius: $fc-radius-pill;
background: rgba(255, 255, 255, 0.72);
border: 2rpx solid rgba(255, 255, 255, 0.45);
color: $fc-primary-ink;
font-size: 22rpx;
letter-spacing: 1rpx;
}
.home__banner-title {
margin-top: 14rpx;
color: $fc-primary-ink;
font-size: 34rpx;
font-weight: 700;
line-height: $fc-leading-tight;
text-shadow: 0 2rpx 10rpx rgba(255, 255, 255, 0.35);
}
.home__banner-cta {
margin-top: 16rpx;
padding: 8rpx 24rpx;
border-radius: $fc-radius-pill;
background: rgba(255, 255, 255, 0.94);
box-shadow: 0 6rpx 18rpx rgba(4, 48, 42, 0.18);
}
.home__banner-cta-text {
color: $fc-primary-text;
font-size: 24rpx;
font-weight: 600;
}
.home__cats {
margin-top: 24rpx;
}
.home__cats-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
}
.home__cats-title {
font-size: $fc-font-lg;
font-weight: 700;
color: $fc-text;
}
.home__cats-more {
font-size: $fc-font-sm;
color: $fc-text-secondary;
}
.home__cats-grid {
display: flex;
flex-wrap: wrap;
}
.home__cat {
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 24rpx;
}
.home__cat-icon {
width: 88rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
}
.home__cat-badge {
width: 88rpx;
height: 88rpx;
border-radius: 26rpx;
transition: transform 0.15s ease;
box-shadow: 0 4rpx 14rpx rgba(4, 48, 30, 0.05);
&:active {
transform: scale(0.96);
}
}
.home__cat-name {
margin-top: 12rpx;
font-size: 24rpx;
color: $fc-text-regular;
line-height: 1.2;
font-weight: 500;
}
.home__vip {
margin: 0 24rpx 24rpx;
padding: 24rpx 28rpx;
border-radius: $fc-radius-lg;
background: $fc-gradient-warm;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: $fc-shadow;
}
.home__vip-left {
display: flex;
align-items: center;
}
.home__vip-texts {
display: flex;
flex-direction: column;
}
.home__vip-title {
color: #ffffff;
font-size: $fc-font-lg;
font-weight: 700;
line-height: $fc-leading-tight;
}
.home__vip-sub {
color: rgba(255, 255, 255, 0.9);
font-size: $fc-font-xs;
margin-top: 8rpx;
}
.home__vip-btn {
padding: 12rpx 28rpx;
border-radius: $fc-radius-pill;
background: #ffffff;
color: $fc-primary-text;
font-size: $fc-font-sm;
font-weight: 700;
}
.home__filter {
display: flex;
align-items: center;
padding: 0 24rpx 16rpx;
}
.home__filter-item {
margin-right: 28rpx;
font-size: $fc-font;
color: $fc-text-secondary;
&--active {
color: $fc-primary-text;
font-weight: 700;
}
}
.home__filter-area {
margin-left: auto;
}
.home__skeleton {
display: flex;
background: #ffffff;
}
.home__skeleton-thumb {
width: 200rpx;
height: 200rpx;
flex: 0 0 200rpx;
margin-right: 24rpx;
}
.home__skeleton-body {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.home__skeleton-line {
height: 26rpx;
}
.home__loadmore {
text-align: center;
padding: 24rpx 0 32rpx;
font-size: $fc-font-sm;
color: $fc-text-placeholder;
}
.home__tabbar-space {
height: 130rpx;
}
</style>