- 新增售后详情页面 aftersale-detail.vue - 优化售后列表 UI 样式,增加加载/空态/错误状态处理 - 修复售后列表跳转逻辑,新增下拉刷新功能 - 修复师傅入驻接口数组参数 500 崩溃问题 - 优化竞价单选定报价流程,修复订单状态错误问题 - 新增订单售后相关展示逻辑,包括售后状态、操作入口等 - 更新版本号至 1.0.88,配置微信小程序 AppID
2754 行
76 KiB
Vue
2754 行
76 KiB
Vue
<template>
|
||
<view class="home-view">
|
||
<!-- ==================== 1. 独立吸顶 TopBar(简洁居中品牌标题 · 摒弃多余假下拉胶囊) ==================== -->
|
||
<YjyfNavBar
|
||
theme="orange"
|
||
title="优匠优服"
|
||
:fixed="true"
|
||
:placeholder="true"
|
||
/>
|
||
|
||
<YjyfRefreshScroll
|
||
class="home-scroll"
|
||
theme="orange"
|
||
:nav-offset="navHeight"
|
||
:refresh-task="loadHome"
|
||
@scrolltolower="loadMore"
|
||
@scroll="onHomeScroll"
|
||
>
|
||
<!-- ==================== 2. 沉浸式渐变过渡舞台(连续品牌渐变 + 纵向柔和消隐底座,无缝承托搜索坞与金刚区) ==================== -->
|
||
<view class="hero-stage">
|
||
<!-- 连续渐变背景幕布:上接 TopBar 零折痕,下向页面灰底平滑羽化消隐,彻底消除生硬折角 -->
|
||
<view class="hero-backdrop" :style="{ backgroundPosition: '0 -' + navHeight + 'px' }">
|
||
<view class="hero-backdrop-fade"></view>
|
||
</view>
|
||
|
||
<!-- 白玉悬浮搜索坞 -->
|
||
<view class="search-dock-wrap">
|
||
<view class="search-dock-box clickable-hover" @tap="onSearch">
|
||
<image class="search-icon" src="/static/icons/search-gray.svg" mode="aspectFit" />
|
||
<text class="search-placeholder">搜索服务项目或商品</text>
|
||
<view class="search-action-btn">
|
||
<text class="search-action-txt">搜索</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 核心品类金刚区 (3 行 5 列共 15 个标准类目,首屏 1:1 等高流光骨架 -> 真实数据错峰显影) -->
|
||
<view class="cats-card">
|
||
<view class="cats-grid" v-if="homeBooting && !displayCats.length">
|
||
<view class="sk-cat-cell" v-for="n in 15" :key="'sk-cat-' + n">
|
||
<view class="sk-cat-ico shimmer"></view>
|
||
<view class="sk-cat-txt shimmer"></view>
|
||
</view>
|
||
</view>
|
||
<view class="cats-grid" v-else>
|
||
<view
|
||
class="cat-cell clickable-hover"
|
||
v-for="(c, ci) in displayCats"
|
||
:key="c.id"
|
||
:style="{ animationDelay: Math.min(Math.floor(ci / 5) * 45 + (ci % 5) * 14, 150) + 'ms' }"
|
||
@tap="onCat(c)"
|
||
>
|
||
<view class="cat-icon-container">
|
||
<image class="cat-icon-image" :src="getCatIcon(c)" mode="aspectFit" />
|
||
</view>
|
||
<text class="cat-cell-name">{{ c.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 3. 主页面内容容器 (标准模数边距 · 一体化衔接) ==================== -->
|
||
<view class="main-body">
|
||
|
||
<!-- 官方轮播 Banner 1:1 等高骨架态(首屏零高度跳变) -->
|
||
<view class="banner-skeleton-card" v-if="showBanners && homeBooting && !banners.length">
|
||
<view class="sk-banner-left">
|
||
<view class="sk-bn-badge-row">
|
||
<view class="sk-bn-badge shimmer"></view>
|
||
<view class="sk-bn-tag shimmer"></view>
|
||
</view>
|
||
<view class="sk-bn-title shimmer"></view>
|
||
<view class="sk-bn-sub shimmer"></view>
|
||
</view>
|
||
<view class="sk-bn-cta shimmer"></view>
|
||
<view class="sk-bn-dots">
|
||
<view class="sk-bn-dot on"></view>
|
||
<view class="sk-bn-dot"></view>
|
||
<view class="sk-bn-dot"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 官方轮播 Banner (真实 fa_banner 数据驱动,内嵌指示点与右侧行动构图) -->
|
||
<view class="banner-section banner-reveal" v-else-if="showBanners && banners.length">
|
||
<swiper
|
||
class="banner-swiper"
|
||
:current="bannerIndex"
|
||
:autoplay="banners.length > 1"
|
||
:interval="4500"
|
||
:duration="400"
|
||
circular
|
||
@change="onBannerChange"
|
||
>
|
||
<swiper-item v-for="b in banners" :key="b.id">
|
||
<view class="banner-card" :class="'theme-' + b.theme + (b.image ? ' has-image' : '')" @tap="onBanner(b)">
|
||
<image v-if="b.image" class="banner-bg-img" :src="b.image" mode="aspectFill" />
|
||
<view v-if="b.image" class="banner-mask"></view>
|
||
<image
|
||
v-else
|
||
class="banner-deco-img"
|
||
:src="b.theme === 'brand' ? '/static/icons/banner-deco-brand.svg' : '/static/icons/banner-deco-service.svg'"
|
||
mode="aspectFit"
|
||
/>
|
||
|
||
<!-- 平台信息展示 -->
|
||
<block v-if="b.theme === 'brand'">
|
||
<view class="brand-bar">
|
||
<view class="brand-title-group">
|
||
<image class="brand-shield" src="/static/icons/shield.svg" mode="aspectFit" />
|
||
<text class="brand-heading">{{ b.title || '优匠优服' }}</text>
|
||
</view>
|
||
<text class="brand-date-tag" v-if="b.date_text">{{ b.date_text }}</text>
|
||
</view>
|
||
<view class="brand-stats" v-if="b.stats && b.stats.length">
|
||
<view class="stat-unit" v-for="(s, si) in b.stats" :key="si">
|
||
<text class="stat-v">{{ s.value }}</text>
|
||
<text class="stat-l">{{ s.label }}</text>
|
||
</view>
|
||
</view>
|
||
<view class="brand-foot" v-if="b.subtitle">
|
||
<text class="foot-desc">{{ b.subtitle }}</text>
|
||
</view>
|
||
</block>
|
||
|
||
<!-- 活动 / 服务主题 -->
|
||
<block v-else>
|
||
<view class="slide-content">
|
||
<view class="slide-left-text">
|
||
<view class="slide-badge-box" v-if="b.badge || b.date_text">
|
||
<text class="badge-main" v-if="b.badge">{{ b.badge }}</text>
|
||
<text class="badge-sub-tag" v-if="b.date_text">{{ b.date_text }}</text>
|
||
</view>
|
||
<text class="slide-title">{{ b.title }}</text>
|
||
<text class="slide-sub" v-if="b.subtitle">{{ b.subtitle }}</text>
|
||
</view>
|
||
<view class="slide-right-cta" v-if="b.action_text">
|
||
<view class="banner-cta-btn">
|
||
<text class="banner-cta-txt">{{ b.action_text }}</text>
|
||
<image class="banner-cta-arr" src="/static/icons/arrow-right-white.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
</view>
|
||
</swiper-item>
|
||
</swiper>
|
||
|
||
<view class="banner-dots" :class="{ 'is-on-image': banners[bannerIndex] && banners[bannerIndex].image }" v-if="banners.length > 1">
|
||
<view
|
||
v-for="(b, bi) in banners"
|
||
:key="'dot-' + b.id"
|
||
class="banner-dot"
|
||
:class="{ on: bannerIndex === bi }"
|
||
@tap.stop="goBanner(bi)"
|
||
></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 4. 双 Tab 核心板块:【热门推荐】与【服务动态】 ==================== -->
|
||
<view class="content-tab-section">
|
||
<!-- 一体化粘性列表控制头(融合双 Tab 导航 + 排序筛选栏 + 已选条件胶囊,支持上滑吸顶悬浮感知) -->
|
||
<view class="feed-control-panel" :class="{ 'is-elevated': isStickyElevated }">
|
||
<!-- 第一行:双 Tab 切换导航条 -->
|
||
<view class="section-tab-bar">
|
||
<view class="tab-list">
|
||
<!-- Tab 1: 热门服务推荐 -->
|
||
<view
|
||
class="tab-item clickable-hover"
|
||
:class="{ active: activeContentTab === 'hot' }"
|
||
@tap="switchContentTab('hot')"
|
||
>
|
||
<view class="tab-title-wrap">
|
||
<text class="tab-text">热门推荐</text>
|
||
<view class="tab-active-indicator"></view>
|
||
</view>
|
||
<view class="tab-badge-pill hot-badge">热选</view>
|
||
</view>
|
||
|
||
<!-- Tab 2: 服务动态 (业主晒单) -->
|
||
<view
|
||
class="tab-item clickable-hover"
|
||
:class="{ active: activeContentTab === 'cases' }"
|
||
@tap="switchContentTab('cases')"
|
||
>
|
||
<view class="tab-title-wrap">
|
||
<text class="tab-text">服务动态</text>
|
||
<view class="tab-active-indicator"></view>
|
||
</view>
|
||
<view class="tab-badge-pill done-badge">晒单</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="title-more clickable-hover" @tap="onMoreServices">
|
||
<text class="more-txt">全部服务</text>
|
||
<image class="more-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 第二行:4 列轻量化排序与筛选栏(前 3 项为排序胶囊,右侧独立分隔多维筛选入口) -->
|
||
<view class="jd-sort-bar">
|
||
<!-- 1. 综合推荐 -->
|
||
<view
|
||
class="jd-sort-item clickable-hover"
|
||
:class="{ active: sortMode === 'default' }"
|
||
@tap="onSelectSort('default')"
|
||
>
|
||
<view class="jd-sort-pill">
|
||
<text class="jd-sort-txt">综合推荐</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 2. 销量 -->
|
||
<view
|
||
class="jd-sort-item clickable-hover"
|
||
:class="{ active: sortMode === 'sales' }"
|
||
@tap="onSelectSort('sales')"
|
||
>
|
||
<view class="jd-sort-pill">
|
||
<text class="jd-sort-txt">销量</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 3. 价格 ⇅(点击在从低到高 ▲ / 从高到低 ▼ 之间切换) -->
|
||
<view
|
||
class="jd-sort-item clickable-hover"
|
||
:class="{ active: sortMode === 'price_asc' || sortMode === 'price_desc' }"
|
||
@tap="onTogglePriceSort"
|
||
>
|
||
<view class="jd-sort-pill">
|
||
<text class="jd-sort-txt">价格</text>
|
||
<image
|
||
class="jd-price-caret"
|
||
:src="priceSortIcon"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="jd-sort-divider"></view>
|
||
|
||
<!-- 4. 筛选 ▽(点击打开右侧多维条件筛选抽屉,筛选时不改变当前排序方向) -->
|
||
<view
|
||
class="jd-sort-item jd-filter-trigger clickable-hover"
|
||
:class="{ active: hasActiveFilter || showFilterDrawer }"
|
||
@tap="openFilterDrawer"
|
||
>
|
||
<view class="jd-sort-pill">
|
||
<text class="jd-sort-txt">{{ activeFilterCount > 0 ? `筛选(${activeFilterCount})` : '筛选' }}</text>
|
||
<image
|
||
class="jd-filter-icon"
|
||
:src="(hasActiveFilter || showFilterDrawer) ? '/static/icons/filter-orange.svg' : '/static/icons/filter-dark.svg'"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 已生效筛选条件快捷标签条(清晰反馈当前生效条件与匹配总数,支持单项移除或一键清空) -->
|
||
<view class="jd-active-chips-bar" v-if="activeFilterChips.length > 0">
|
||
<scroll-view class="jd-chips-scroll" scroll-x :show-scrollbar="false">
|
||
<view class="jd-chips-track">
|
||
<view
|
||
class="jd-chip-pill clickable-hover"
|
||
v-for="chip in activeFilterChips"
|
||
:key="chip.key"
|
||
@tap="removeFilterChip(chip.key)"
|
||
>
|
||
<text class="jd-chip-txt">{{ chip.label }}</text>
|
||
<image class="jd-chip-close" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="jd-chips-clear clickable-hover" @tap="resetFilters">
|
||
<text class="jd-chips-clear-txt">清空</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 1:1 同构双列骨架屏加载态(首屏启动/切换筛选/排序/Tab 时平滑过渡,彻底消灭空状态误闪与高度抖动) -->
|
||
<view class="skeleton-grid" v-if="homeBooting || feedLoading">
|
||
<view class="skeleton-card" v-for="n in 6" :key="'sk-' + activeContentTab + '-' + n">
|
||
<view class="sk-media shimmer">
|
||
<view class="sk-media-pill"></view>
|
||
</view>
|
||
<view class="sk-body" v-if="activeContentTab === 'hot'">
|
||
<view class="sk-line sk-title shimmer"></view>
|
||
<view class="sk-foot">
|
||
<view class="sk-price shimmer"></view>
|
||
<view class="sk-btn shimmer"></view>
|
||
</view>
|
||
</view>
|
||
<view class="sk-body sk-body-case" v-else>
|
||
<view class="sk-line sk-case-title shimmer"></view>
|
||
<view class="sk-line sk-case-quote shimmer"></view>
|
||
<view class="sk-line sk-case-meta shimmer"></view>
|
||
<view class="sk-foot">
|
||
<view class="sk-score shimmer"></view>
|
||
<view class="sk-btn shimmer"></view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- Tab 1 视图:热门服务推荐(按真实成交量+品类均衡+一口价多维推荐) -->
|
||
<block v-else-if="activeContentTab === 'hot' && hotServices && hotServices.length">
|
||
<view class="services-grid">
|
||
<view
|
||
class="service-card clickable-hover"
|
||
v-for="item in hotServices"
|
||
:key="item.id"
|
||
@tap="onHotService(item)"
|
||
>
|
||
<view class="service-media">
|
||
<image
|
||
class="service-img"
|
||
:src="item.image_url || '/static/icons/service-default.svg'"
|
||
mode="aspectFill"
|
||
lazy-load
|
||
/>
|
||
<view class="media-top-gradient"></view>
|
||
<text class="service-cat-badge">{{ item.cat_name }}</text>
|
||
<text class="service-recommend-tag" v-if="item.tag">{{ item.tag }}</text>
|
||
</view>
|
||
<view class="service-info">
|
||
<text class="service-name">{{ item.name }}</text>
|
||
<view class="service-bottom">
|
||
<view class="service-price">
|
||
<text class="price-symbol">¥</text>
|
||
<text class="price-num">{{ item.base_price }}</text>
|
||
<text class="price-unit">/{{ item.unit || '件' }}起</text>
|
||
</view>
|
||
<view class="service-book-btn">
|
||
<text class="book-btn-txt">去预约</text>
|
||
<image class="book-btn-arr" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 分页加载状态栏 -->
|
||
<view class="feed-load-footer">
|
||
<view class="load-more-box" v-if="feedLoadingMore">
|
||
<view class="loading-spinner"></view>
|
||
<text class="load-more-txt">正在加载更多服务...</text>
|
||
</view>
|
||
<view class="load-more-box clickable-hover" v-else-if="feedHasMore" @tap="loadMore">
|
||
<text class="load-more-txt">上滑或点击加载更多</text>
|
||
</view>
|
||
<view class="no-more-box" v-else>
|
||
<view class="no-more-line"></view>
|
||
<text class="no-more-txt">已经到底啦 · 共 {{ feedTotal }} 项服务</text>
|
||
<view class="no-more-line"></view>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
|
||
<!-- Tab 2 视图:业主主动晒单动态流(仅展示用户主动公开晒单与真实评价) -->
|
||
<block v-else-if="activeContentTab === 'cases' && recentOrders && recentOrders.length">
|
||
<view class="order-flow-grid">
|
||
<view
|
||
class="order-flow-card clickable-hover"
|
||
v-for="order in recentOrders"
|
||
:key="order.id"
|
||
@tap="onOrderCase(order.id)"
|
||
>
|
||
<!-- 卡片顶部晒单图片与业主晒单徽标 -->
|
||
<view class="flow-card-media">
|
||
<image
|
||
class="flow-card-img"
|
||
:src="order.image_url || '/static/icons/service-default.svg'"
|
||
mode="aspectFill"
|
||
lazy-load
|
||
/>
|
||
<view class="media-top-gradient"></view>
|
||
<view class="flow-status-badge badge-done">
|
||
<image class="showcase-badge-ico" src="/static/icons/showcase-white.svg" mode="aspectFit" />
|
||
<text class="badge-status-txt">{{ order.status_text || '业主晒单' }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 卡片下半部详情(服务名称、真实晒单评语、脱敏地点与评分) -->
|
||
<view class="flow-card-content">
|
||
<text class="flow-card-title">{{ order.service_name }}</text>
|
||
<text class="flow-card-quote" v-if="order.review_content">{{ order.review_content }}</text>
|
||
<view class="flow-card-meta">
|
||
<image class="meta-pin-icon" src="/static/icons/location-pin.svg" mode="aspectFit" />
|
||
<text class="flow-card-loc">{{ order.location }} · {{ order.time_ago }}</text>
|
||
</view>
|
||
|
||
<view class="flow-card-bottom">
|
||
<view class="flow-score-box">
|
||
<image class="flow-star-ico" src="/static/icons/star-orange.svg" mode="aspectFit" />
|
||
<text class="flow-score-txt">{{ order.review_score || 5 }}.0分</text>
|
||
</view>
|
||
<view class="flow-action-btn">
|
||
<text class="flow-action-txt">看晒单</text>
|
||
<image class="flow-action-arr" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 分页加载状态栏 -->
|
||
<view class="feed-load-footer">
|
||
<view class="load-more-box" v-if="feedLoadingMore">
|
||
<view class="loading-spinner"></view>
|
||
<text class="load-more-txt">正在加载更多晒单...</text>
|
||
</view>
|
||
<view class="load-more-box clickable-hover" v-else-if="feedHasMore" @tap="loadMore">
|
||
<text class="load-more-txt">上滑或点击加载更多</text>
|
||
</view>
|
||
<view class="no-more-box" v-else>
|
||
<view class="no-more-line"></view>
|
||
<text class="no-more-txt">已经到底啦 · 共 {{ feedTotal }} 条晒单</text>
|
||
<view class="no-more-line"></view>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
|
||
<!-- 空状态或加载失败兜底 -->
|
||
<view class="empty-state-box" v-else-if="homeError || feedError">
|
||
<image class="empty-state-icon" src="/static/icons/empty-service.svg" mode="aspectFit" />
|
||
<text class="empty-state-text">{{ feedError || homeError }}</text>
|
||
<view class="empty-reset-btn clickable-hover" @tap="loadHome">
|
||
<text class="empty-reset-txt">重新加载</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 空状态缺省兜底(覆盖无热门推荐或无业主晒单动态场景,带一键重置筛选) -->
|
||
<view class="empty-state-box" v-else>
|
||
<image class="empty-state-icon" src="/static/icons/empty-service.svg" mode="aspectFit" />
|
||
<text class="empty-state-text">{{ activeContentTab === 'hot' ? '当前筛选下暂无服务项目' : '当前筛选下暂无业主晒单' }}</text>
|
||
<view class="empty-reset-btn clickable-hover" v-if="hasActiveFilter" @tap="resetFilters">
|
||
<text class="empty-reset-txt">重置筛选条件</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 页面底部安全呼吸留白 (彻底避让悬浮立即下单大圆球,杜绝遮挡) -->
|
||
<view class="page-bottom-space"></view>
|
||
</view>
|
||
</YjyfRefreshScroll>
|
||
|
||
<!-- ==================== 京东式右侧滑出多维筛选抽屉(双向阻尼滑入滑出,脱离 .main-body 层叠上下文) ==================== -->
|
||
<view class="jd-drawer-mask" :class="{ 'is-open': drawerActive }" v-if="drawerMounted" @tap="closeFilterDrawer">
|
||
<view class="jd-drawer-panel" :style="{ paddingTop: (navHeight + 8) + 'px' }" @tap.stop>
|
||
<scroll-view class="jd-drawer-scroll" scroll-y :show-scrollbar="false">
|
||
<!-- 仅在【服务动态】下优先展示:服务地区 (fa_showcase.region) -->
|
||
<view class="jd-sec-block" v-if="activeContentTab === 'cases' && regionList.length > 0">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('region')">
|
||
<text class="jd-sec-title">服务地区</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.region }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.region">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="reg in regionList"
|
||
:key="reg"
|
||
:class="{ on: draftFilter.region === reg }"
|
||
@tap="toggleDraftField('region', reg, '')"
|
||
>
|
||
<text class="jd-tag-txt">{{ reg }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 通用核心维度 1:服务类目 (fa_service_cat) -->
|
||
<view class="jd-sec-block">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('cat')">
|
||
<text class="jd-sec-title">服务类目</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.cat }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.cat">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="fc in filterCats"
|
||
:key="'jd-cat-' + fc.id"
|
||
:class="{ on: Number(draftFilter.catId) === Number(fc.id) }"
|
||
@tap="toggleDraftCat(fc.id)"
|
||
>
|
||
<text class="jd-tag-txt">{{ fc.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 【热门推荐】维度 2:服务工项 (fa_service_type) -->
|
||
<view class="jd-sec-block" v-if="activeContentTab === 'hot' && drawerServiceTypes.length > 0">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('type')">
|
||
<text class="jd-sec-title">服务工项</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.type }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.type">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="st in drawerServiceTypes"
|
||
:key="'jd-st-' + st.code"
|
||
:class="{ on: draftFilter.serviceType === st.code }"
|
||
@tap="toggleDraftField('serviceType', st.code, 'all')"
|
||
>
|
||
<text class="jd-tag-txt">{{ st.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 【服务动态】维度 2:具体项目 (fa_showcase.service_id) -->
|
||
<view class="jd-sec-block" v-if="activeContentTab === 'cases' && drawerShowcaseServices.length > 0">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('service')">
|
||
<text class="jd-sec-title">服务项目</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.service }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.service">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="srv in drawerShowcaseServices"
|
||
:key="'jd-srv-' + srv.id"
|
||
:class="{ on: Number(draftFilter.serviceId) === Number(srv.id) }"
|
||
@tap="toggleDraftField('serviceId', Number(srv.id), 0)"
|
||
>
|
||
<text class="jd-tag-txt">{{ srv.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 通用核心维度 3:价格区间 (fa_service.base_price) -->
|
||
<view class="jd-sec-block" v-if="drawerPriceOptions.length">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('price')">
|
||
<text class="jd-sec-title">价格区间</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.price }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.price">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="pr in drawerPriceOptions"
|
||
:key="'jd-pr-' + pr.value"
|
||
:class="{ on: draftFilter.priceRange === pr.value }"
|
||
@tap="toggleDraftField('priceRange', pr.value, 'all')"
|
||
>
|
||
<text class="jd-tag-txt">{{ pr.label }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 【热门推荐】维度 4:计价单位与方式 (fa_service.unit / price_type) -->
|
||
<view class="jd-sec-block" v-if="activeContentTab === 'hot' && drawerUnitOptions.length">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('unit')">
|
||
<text class="jd-sec-title">计价规格</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.unit }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.unit">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="u in drawerUnitOptions"
|
||
:key="'jd-u-' + u.value"
|
||
:class="{ on: draftFilter.unit === u.value }"
|
||
@tap="toggleDraftField('unit', u.value, '')"
|
||
>
|
||
<text class="jd-tag-txt">{{ u.label }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 【服务动态】维度 4:评价口碑 (fa_showcase.tags) -->
|
||
<view class="jd-sec-block" v-if="activeContentTab === 'cases' && drawerCaseTags.length">
|
||
<view class="jd-sec-head clickable-hover" @tap="toggleSecFold('tag')">
|
||
<text class="jd-sec-title">业主口碑</text>
|
||
<image
|
||
class="jd-sec-arrow"
|
||
:class="{ folded: foldedSecs.tag }"
|
||
src="/static/icons/chevron-down-gray.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
<view class="jd-tag-grid" v-if="!foldedSecs.tag">
|
||
<view
|
||
class="jd-tag-cell clickable-hover"
|
||
v-for="tg in drawerCaseTags"
|
||
:key="'jd-tg-' + tg.value"
|
||
:class="{ on: draftFilter.tag === tg.value }"
|
||
@tap="toggleDraftField('tag', tg.value, 'all')"
|
||
>
|
||
<text class="jd-tag-txt">{{ tg.label }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<!-- 抽屉底部:京东式左【重置】右【确定(实时件数)】一体双按钮栏 -->
|
||
<view class="jd-drawer-footer">
|
||
<view class="jd-btn-group">
|
||
<view class="jd-btn-reset clickable-hover" @tap="onResetDraftFilter">
|
||
<text class="jd-btn-reset-txt">重置</text>
|
||
</view>
|
||
<view class="jd-btn-confirm clickable-hover" @tap="onConfirmDraftFilter">
|
||
<text class="jd-btn-confirm-txt">确定 ({{ feedTotal }}个{{ activeContentTab === 'hot' ? '服务' : '晒单' }})</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 商品与规格选择抽屉 ==================== -->
|
||
<GoodsPickerDrawer
|
||
v-model:visible="showPickerDrawer"
|
||
:cat-id="activeDrawerCatId"
|
||
:cat-name="activeDrawerCatName"
|
||
@select="onSpecSelected"
|
||
@custom="onCustomOrder"
|
||
/>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, computed, onMounted, onBeforeUnmount } from 'vue';
|
||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||
import GoodsPickerDrawer from '@/components/GoodsPickerDrawer.vue';
|
||
import api from '@/utils/api.js';
|
||
import { isLogin, toLogin } from '@/utils/request.js';
|
||
import { ensureSilentLogin } from '@/utils/wxlogin.js';
|
||
import { getNavBarMetrics } from '@/utils/system.js';
|
||
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
|
||
|
||
const emit = defineEmits(['switch-tab']);
|
||
|
||
/* ---------- 系统适配:状态栏 / 导航栏高度 ---------- */
|
||
const navHeight = ref(getNavBarMetrics().totalNavHeight);
|
||
|
||
/* ---------- 首页首屏骨架屏与交互状态 ---------- */
|
||
const homeBooting = ref(true);
|
||
const homeError = ref('');
|
||
const feedError = ref('');
|
||
const isStickyElevated = ref(false);
|
||
|
||
const onHomeScroll = (e) => {
|
||
const top = (e && e.detail && typeof e.detail.scrollTop === 'number') ? e.detail.scrollTop : 0;
|
||
if (!isStickyElevated.value && top > 228) {
|
||
isStickyElevated.value = true;
|
||
} else if (isStickyElevated.value && top < 196) {
|
||
isStickyElevated.value = false;
|
||
}
|
||
};
|
||
|
||
/* ---------- 响应式数据(100% 真实接口驱动) ---------- */
|
||
const banners = ref([]);
|
||
const bannerIndex = ref(0);
|
||
const showBanners = ref(true);
|
||
const cats = ref([]);
|
||
const catServicesMap = ref({});
|
||
const showcaseServices = ref([]);
|
||
const serviceTypesDict = ref([]);
|
||
const regionList = ref([]);
|
||
const hotServices = ref([]);
|
||
const recentOrders = ref([]);
|
||
const badge = ref({ coupon: 0, unread: 0 });
|
||
|
||
/* ---------- 核心双 Tab 与京东式排序 + 右侧筛选抽屉状态 ---------- */
|
||
const activeContentTab = ref('hot');
|
||
// 排序状态:'default'(综合推荐) | 'sales'(销量) | 'price_asc'(价格从低到高) | 'price_desc'(价格从高到低)
|
||
// 在筛选抽屉中修改任何筛选条件时,sortMode 严格保持不变!
|
||
const sortMode = ref('default');
|
||
|
||
// 已生效的筛选条件
|
||
const filterCatId = ref(0);
|
||
const filterServiceType = ref('all');
|
||
const priceRange = ref('all');
|
||
const filterUnit = ref('');
|
||
const filterRegion = ref('');
|
||
const filterServiceId = ref(0);
|
||
const caseTag = ref('all');
|
||
|
||
// 筛选抽屉开关与双向阻尼动画状态(挂载与激活态解耦,确保关闭也有平滑滑出动画)
|
||
const showFilterDrawer = ref(false);
|
||
const drawerMounted = ref(false);
|
||
const drawerActive = ref(false);
|
||
let drawerOpenTimer = null;
|
||
let drawerCloseTimer = null;
|
||
|
||
const draftFilter = ref({
|
||
catId: 0,
|
||
serviceType: 'all',
|
||
priceRange: 'all',
|
||
unit: '',
|
||
region: '',
|
||
serviceId: 0,
|
||
tag: 'all'
|
||
});
|
||
const foldedSecs = ref({
|
||
region: false,
|
||
cat: false,
|
||
type: false,
|
||
service: false,
|
||
price: false,
|
||
unit: false,
|
||
tag: false
|
||
});
|
||
|
||
const feedPage = ref(1);
|
||
const feedLimit = 6;
|
||
const feedTotal = ref(0);
|
||
const feedHasMore = ref(false);
|
||
const feedLoading = ref(true);
|
||
const feedLoadingMore = ref(false);
|
||
|
||
/* ---------- 价格排序双向箭头图标 ---------- */
|
||
const priceSortIcon = computed(() => {
|
||
if (sortMode.value === 'price_asc') return '/static/icons/sort-asc.svg';
|
||
if (sortMode.value === 'price_desc') return '/static/icons/sort-desc.svg';
|
||
return '/static/icons/sort-both.svg';
|
||
});
|
||
|
||
/* ---------- 筛选可用的服务大类(剔除“其它/全部分类”) ---------- */
|
||
const filterCats = computed(() => {
|
||
return (cats.value || []).filter(c => {
|
||
if (!c || !c.id) return false;
|
||
if (c.id === 15 || c.name === '其它' || c.name === '其他' || c.name === '全部分类') return false;
|
||
return true;
|
||
});
|
||
});
|
||
|
||
/* ---------- 抽屉内工项字典选项(100% 后端 fa_service_type 真实字典驱动) ---------- */
|
||
const drawerServiceTypes = computed(() => {
|
||
return Array.isArray(serviceTypesDict.value) ? serviceTypesDict.value : [];
|
||
});
|
||
|
||
/* ---------- 抽屉内晒单服务项目选项(支持跟随所选类目联动) ---------- */
|
||
const drawerShowcaseServices = computed(() => {
|
||
const cid = Number(draftFilter.value.catId) || 0;
|
||
const raw = showcaseServices.value || [];
|
||
const filtered = cid > 0 ? raw.filter(s => Number(s.cat_id) === cid) : raw;
|
||
const seen = new Set();
|
||
const res = [];
|
||
filtered.forEach(s => {
|
||
const sid = Number(s.id);
|
||
if (sid > 0 && !seen.has(sid)) {
|
||
seen.add(sid);
|
||
res.push({ id: sid, name: String(s.name || ''), cat_id: Number(s.cat_id) });
|
||
}
|
||
});
|
||
return res;
|
||
});
|
||
|
||
/* ---------- 抽屉内价格区间、计价单位、口碑标签选项(100% 后端 home.filter_options 真实驱动) ---------- */
|
||
const drawerPriceOptions = ref([]);
|
||
const drawerUnitOptions = ref([]);
|
||
const drawerCaseTags = ref([]);
|
||
|
||
/* ---------- 已生效筛选条件胶囊列表与计数(直观反馈当前生效条件) ---------- */
|
||
const activeFilterChips = computed(() => {
|
||
const chips = [];
|
||
if (activeContentTab.value === 'cases' && filterRegion.value !== '') {
|
||
chips.push({ key: 'region', label: filterRegion.value });
|
||
}
|
||
if (filterCatId.value > 0) {
|
||
const cObj = (cats.value || []).find(c => Number(c.id) === Number(filterCatId.value));
|
||
chips.push({ key: 'catId', label: cObj ? cObj.name : '指定类目' });
|
||
}
|
||
if (activeContentTab.value === 'hot' && filterServiceType.value !== 'all') {
|
||
const stObj = (drawerServiceTypes.value || []).find(s => s.code === filterServiceType.value);
|
||
chips.push({ key: 'serviceType', label: stObj ? stObj.name : filterServiceType.value });
|
||
}
|
||
if (activeContentTab.value === 'cases' && filterServiceId.value > 0) {
|
||
const srvObj = (showcaseServices.value || []).find(s => Number(s.id) === Number(filterServiceId.value));
|
||
chips.push({ key: 'serviceId', label: srvObj ? srvObj.name : '指定项目' });
|
||
}
|
||
if (priceRange.value !== 'all') {
|
||
const prObj = drawerPriceOptions.value.find(p => p.value === priceRange.value);
|
||
chips.push({ key: 'priceRange', label: prObj ? prObj.label : priceRange.value });
|
||
}
|
||
if (activeContentTab.value === 'hot' && filterUnit.value !== '') {
|
||
const uObj = drawerUnitOptions.value.find(u => u.value === filterUnit.value);
|
||
chips.push({ key: 'unit', label: uObj ? uObj.label : `按${filterUnit.value}计价` });
|
||
}
|
||
if (activeContentTab.value === 'cases' && caseTag.value !== 'all') {
|
||
const tgObj = drawerCaseTags.value.find(t => t.value === caseTag.value);
|
||
chips.push({ key: 'tag', label: tgObj ? tgObj.label : caseTag.value });
|
||
}
|
||
return chips;
|
||
});
|
||
|
||
const activeFilterCount = computed(() => activeFilterChips.value.length);
|
||
|
||
/* ---------- 是否存在已生效的筛选条件(高亮“筛选 ▽”按钮) ---------- */
|
||
const hasActiveFilter = computed(() => activeFilterCount.value > 0);
|
||
|
||
/* ---------- 排序栏点击交互:前 3 项直接切换排序 ---------- */
|
||
const onSelectSort = (mode) => {
|
||
if (sortMode.value === mode) return;
|
||
sortMode.value = mode;
|
||
loadFeed(true);
|
||
};
|
||
|
||
const onTogglePriceSort = () => {
|
||
if (sortMode.value === 'price_asc') {
|
||
sortMode.value = 'price_desc';
|
||
} else {
|
||
sortMode.value = 'price_asc';
|
||
}
|
||
loadFeed(true);
|
||
};
|
||
|
||
/* ---------- 抽屉内选择实时同步生效(点击选项立即刷新列表与匹配总数,点击遮罩或确定关闭均保留结果,且不改变排序方向) ---------- */
|
||
const syncDraftToActiveAndLoad = (silentSkeleton = true) => {
|
||
filterCatId.value = draftFilter.value.catId;
|
||
filterServiceType.value = draftFilter.value.serviceType;
|
||
priceRange.value = draftFilter.value.priceRange;
|
||
filterUnit.value = draftFilter.value.unit;
|
||
filterRegion.value = draftFilter.value.region;
|
||
filterServiceId.value = draftFilter.value.serviceId;
|
||
caseTag.value = draftFilter.value.tag;
|
||
loadFeed(true, silentSkeleton);
|
||
};
|
||
|
||
const openFilterDrawer = () => {
|
||
if (drawerCloseTimer) {
|
||
clearTimeout(drawerCloseTimer);
|
||
drawerCloseTimer = null;
|
||
}
|
||
draftFilter.value = {
|
||
catId: filterCatId.value,
|
||
serviceType: filterServiceType.value,
|
||
priceRange: priceRange.value,
|
||
unit: filterUnit.value,
|
||
region: filterRegion.value,
|
||
serviceId: filterServiceId.value,
|
||
tag: caseTag.value
|
||
};
|
||
showFilterDrawer.value = true;
|
||
drawerMounted.value = true;
|
||
if (drawerOpenTimer) clearTimeout(drawerOpenTimer);
|
||
drawerOpenTimer = setTimeout(() => {
|
||
drawerActive.value = true;
|
||
drawerOpenTimer = null;
|
||
}, 16);
|
||
};
|
||
|
||
const closeFilterDrawer = () => {
|
||
if (drawerOpenTimer) {
|
||
clearTimeout(drawerOpenTimer);
|
||
drawerOpenTimer = null;
|
||
}
|
||
showFilterDrawer.value = false;
|
||
drawerActive.value = false;
|
||
if (drawerCloseTimer) clearTimeout(drawerCloseTimer);
|
||
drawerCloseTimer = setTimeout(() => {
|
||
if (!showFilterDrawer.value) {
|
||
drawerMounted.value = false;
|
||
}
|
||
drawerCloseTimer = null;
|
||
}, 240);
|
||
};
|
||
|
||
const toggleSecFold = (secKey) => {
|
||
foldedSecs.value[secKey] = !foldedSecs.value[secKey];
|
||
};
|
||
|
||
const toggleDraftCat = (cid) => {
|
||
const numId = Number(cid) || 0;
|
||
if (Number(draftFilter.value.catId) === numId) {
|
||
draftFilter.value.catId = 0;
|
||
} else {
|
||
draftFilter.value.catId = numId;
|
||
if (draftFilter.value.serviceId > 0) {
|
||
const ok = (showcaseServices.value || []).some(
|
||
s => Number(s.id) === Number(draftFilter.value.serviceId) && Number(s.cat_id) === numId
|
||
);
|
||
if (!ok) draftFilter.value.serviceId = 0;
|
||
}
|
||
}
|
||
syncDraftToActiveAndLoad(true);
|
||
};
|
||
|
||
const toggleDraftField = (field, val, defaultVal) => {
|
||
if (draftFilter.value[field] === val) {
|
||
draftFilter.value[field] = defaultVal;
|
||
} else {
|
||
draftFilter.value[field] = val;
|
||
}
|
||
syncDraftToActiveAndLoad(true);
|
||
};
|
||
|
||
const removeFilterChip = (key) => {
|
||
if (key === 'catId') {
|
||
filterCatId.value = 0;
|
||
draftFilter.value.catId = 0;
|
||
} else if (key === 'serviceType') {
|
||
filterServiceType.value = 'all';
|
||
draftFilter.value.serviceType = 'all';
|
||
} else if (key === 'priceRange') {
|
||
priceRange.value = 'all';
|
||
draftFilter.value.priceRange = 'all';
|
||
} else if (key === 'unit') {
|
||
filterUnit.value = '';
|
||
draftFilter.value.unit = '';
|
||
} else if (key === 'region') {
|
||
filterRegion.value = '';
|
||
draftFilter.value.region = '';
|
||
} else if (key === 'serviceId') {
|
||
filterServiceId.value = 0;
|
||
draftFilter.value.serviceId = 0;
|
||
} else if (key === 'tag') {
|
||
caseTag.value = 'all';
|
||
draftFilter.value.tag = 'all';
|
||
}
|
||
loadFeed(true);
|
||
};
|
||
|
||
const onResetDraftFilter = () => {
|
||
draftFilter.value = {
|
||
catId: 0,
|
||
serviceType: 'all',
|
||
priceRange: 'all',
|
||
unit: '',
|
||
region: '',
|
||
serviceId: 0,
|
||
tag: 'all'
|
||
};
|
||
syncDraftToActiveAndLoad(true);
|
||
};
|
||
|
||
const onConfirmDraftFilter = () => {
|
||
closeFilterDrawer();
|
||
// 注意:此处绝不修改 sortMode,严格保持当前排序方向不变
|
||
syncDraftToActiveAndLoad(false);
|
||
};
|
||
|
||
const switchContentTab = (t) => {
|
||
if (activeContentTab.value === t) return;
|
||
closeFilterDrawer();
|
||
activeContentTab.value = t;
|
||
loadFeed(true);
|
||
};
|
||
|
||
const resetFilters = () => {
|
||
closeFilterDrawer();
|
||
filterCatId.value = 0;
|
||
filterServiceType.value = 'all';
|
||
priceRange.value = 'all';
|
||
filterUnit.value = '';
|
||
filterRegion.value = '';
|
||
filterServiceId.value = 0;
|
||
caseTag.value = 'all';
|
||
loadFeed(true);
|
||
};
|
||
|
||
/* ---------- 核心品类金刚区:3 行 5 列展示前 14 个高频类目 + 第 15 个固定为【全部分类】 ---------- */
|
||
const displayCats = computed(() => {
|
||
const list = cats.value || [];
|
||
if (!list.length) return [];
|
||
const isOtherItem = (c) => c && (Number(c.id) === 15 || c.name === '其它' || c.name === '其他' || c.name === '全部分类');
|
||
const normalCats = list.filter(c => c && !isOtherItem(c));
|
||
const moreCat = list.find(isOtherItem);
|
||
const top14 = normalCats.slice(0, 14);
|
||
if (moreCat) {
|
||
top14.push({
|
||
...moreCat,
|
||
name: '全部分类',
|
||
is_more: true
|
||
});
|
||
}
|
||
return top14;
|
||
});
|
||
|
||
/* ---------- 真实类目图标(100% 接口网络图片,严禁本地兜底) ---------- */
|
||
const getCatIcon = (c) => {
|
||
return (c && c.icon_url) ? c.icon_url : '';
|
||
};
|
||
|
||
/* ---------- 分页拉取底部列表数据(支持排序切换、右侧抽屉多维筛选与上滑触底追加) ---------- */
|
||
async function loadFeed(reset = true, silentSkeleton = false) {
|
||
if (reset) {
|
||
feedPage.value = 1;
|
||
if (!silentSkeleton) {
|
||
feedLoading.value = true;
|
||
}
|
||
} else {
|
||
if (feedLoading.value || feedLoadingMore.value || !feedHasMore.value) return;
|
||
feedLoadingMore.value = true;
|
||
}
|
||
|
||
try {
|
||
const tab = activeContentTab.value;
|
||
const params = {
|
||
tab: tab,
|
||
cat_id: filterCatId.value,
|
||
service_id: tab === 'cases' ? filterServiceId.value : 0,
|
||
service_type: tab === 'hot' ? filterServiceType.value : 'all',
|
||
unit: tab === 'hot' ? filterUnit.value : '',
|
||
region: tab === 'cases' ? filterRegion.value : '',
|
||
tag: (tab === 'cases' && caseTag.value !== 'all') ? caseTag.value : '',
|
||
price_range: priceRange.value,
|
||
page: feedPage.value,
|
||
limit: feedLimit,
|
||
sort: sortMode.value
|
||
};
|
||
const res = await api.homeFeed(params);
|
||
const list = (res && res.list) ? res.list : [];
|
||
feedError.value = '';
|
||
feedTotal.value = Number(res && res.total) || 0;
|
||
feedHasMore.value = Boolean(res && res.has_more);
|
||
|
||
if (tab === 'hot') {
|
||
hotServices.value = reset ? list : [...hotServices.value, ...list];
|
||
} else {
|
||
recentOrders.value = reset ? list : [...recentOrders.value, ...list];
|
||
}
|
||
} catch (e) {
|
||
const msg = (e && (e.message || e.msg)) || '加载失败,请稍后重试';
|
||
if (reset) {
|
||
feedError.value = msg;
|
||
} else {
|
||
feedPage.value = Math.max(1, feedPage.value - 1);
|
||
uni.showToast({ title: msg, icon: 'none' });
|
||
}
|
||
} finally {
|
||
feedLoading.value = false;
|
||
feedLoadingMore.value = false;
|
||
}
|
||
}
|
||
|
||
function loadMore() {
|
||
if (feedLoading.value || feedLoadingMore.value || !feedHasMore.value) return;
|
||
feedPage.value += 1;
|
||
loadFeed(false);
|
||
}
|
||
|
||
/* ---------- 加载首页聚合数据(并发拉取 + 并发去重锁,消除串行瀑布等待与重复触发) ---------- */
|
||
let homeLoadingPromise = null;
|
||
|
||
const applyHomePayload = (res) => {
|
||
if (!res) return;
|
||
cats.value = res.cats || [];
|
||
catServicesMap.value = res.cat_services || {};
|
||
showcaseServices.value = res.showcase_services || [];
|
||
serviceTypesDict.value = res.service_types_dict || [];
|
||
regionList.value = res.regions || [];
|
||
const fo = res.filter_options || {};
|
||
drawerPriceOptions.value = Array.isArray(fo.price_ranges) ? fo.price_ranges : [];
|
||
drawerUnitOptions.value = Array.isArray(fo.units) ? fo.units : [];
|
||
drawerCaseTags.value = Array.isArray(fo.case_tags) ? fo.case_tags : [];
|
||
badge.value = res.badge || { coupon: 0, unread: 0 };
|
||
banners.value = Array.isArray(res.banners) ? res.banners : [];
|
||
if (bannerIndex.value >= banners.value.length) bannerIndex.value = 0;
|
||
};
|
||
|
||
async function loadHome() {
|
||
if (homeLoadingPromise) return homeLoadingPromise;
|
||
|
||
const hasExistingCats = Boolean(cats.value && cats.value.length > 0);
|
||
const hasExistingList = activeContentTab.value === 'hot'
|
||
? Boolean(hotServices.value && hotServices.value.length > 0)
|
||
: Boolean(recentOrders.value && recentOrders.value.length > 0);
|
||
|
||
if (!hasExistingCats) {
|
||
homeBooting.value = true;
|
||
}
|
||
homeError.value = '';
|
||
feedError.value = '';
|
||
|
||
homeLoadingPromise = (async () => {
|
||
const wasLoggedIn = isLogin();
|
||
const silentLoginTask = wasLoggedIn
|
||
? Promise.resolve(true)
|
||
: ensureSilentLogin().catch(() => false);
|
||
|
||
const homeTask = (async () => {
|
||
try {
|
||
const res = await api.home();
|
||
applyHomePayload(res);
|
||
} catch (e) {
|
||
homeError.value = (e && (e.message || e.msg)) || '首页数据加载失败,请重试';
|
||
} finally {
|
||
homeBooting.value = false;
|
||
}
|
||
})();
|
||
|
||
const feedTask = loadFeed(true, hasExistingList);
|
||
|
||
await Promise.all([homeTask, feedTask]);
|
||
|
||
// 若首次冷启动刚完成静默登录,后台无感补拉一次角标,不阻塞首屏渲染
|
||
if (!wasLoggedIn) {
|
||
const loggedNow = await silentLoginTask;
|
||
if (loggedNow && isLogin()) {
|
||
try {
|
||
const fresh = await api.home();
|
||
if (fresh && fresh.badge) badge.value = fresh.badge;
|
||
} catch (e) {
|
||
console.warn('[Home] badge refresh failed:', e);
|
||
}
|
||
}
|
||
}
|
||
})().finally(() => {
|
||
homeBooting.value = false;
|
||
homeLoadingPromise = null;
|
||
});
|
||
|
||
return homeLoadingPromise;
|
||
}
|
||
|
||
/* ---------- 交互逻辑 ---------- */
|
||
const toast = (title) => uni.showToast({ title, icon: 'none' });
|
||
|
||
function needLogin() {
|
||
if (isLogin()) return true;
|
||
toLogin();
|
||
return false;
|
||
}
|
||
|
||
const onSearch = () => {
|
||
uni.navigateTo({ url: '/pages/category/category' });
|
||
};
|
||
|
||
const onMoreServices = () => {
|
||
uni.navigateTo({ url: '/pages/category/category' });
|
||
};
|
||
|
||
/* ---------- 商品抽屉联动 ---------- */
|
||
const showPickerDrawer = ref(false);
|
||
const activeDrawerCatId = ref(0);
|
||
const activeDrawerCatName = ref('');
|
||
|
||
const onCat = (c) => {
|
||
if (c.is_more || c.id === 15 || c.id === 'all_cats' || c.name === '全部分类' || c.name === '全部服务' || c.name === '更多' || c.name === '其它' || c.name === '其他') {
|
||
onMoreServices();
|
||
return;
|
||
}
|
||
activeDrawerCatId.value = c.id;
|
||
activeDrawerCatName.value = c.name;
|
||
showPickerDrawer.value = true;
|
||
};
|
||
|
||
/* ---------- 点击精选服务卡片:直接唤起规格抽屉极速下单 ---------- */
|
||
const onHotService = (item) => {
|
||
if (!item) return;
|
||
if (item.cat_id) {
|
||
activeDrawerCatId.value = item.cat_id;
|
||
activeDrawerCatName.value = item.cat_name || '服务项目';
|
||
showPickerDrawer.value = true;
|
||
} else {
|
||
onMoreServices();
|
||
}
|
||
};
|
||
|
||
/* ---------- 点击卡片进工单实况详情页 ---------- */
|
||
const onOrderCase = (orderId) => {
|
||
if (!orderId) return;
|
||
uni.navigateTo({ url: `/pages/order/case?id=${orderId}` });
|
||
};
|
||
|
||
/* ---------- 点击“约同款”:直接唤起对应品类规格抽屉,完成极速下单闭环 ---------- */
|
||
const onOrderSame = (order) => {
|
||
if (!order) return;
|
||
if (order.cat_id) {
|
||
activeDrawerCatId.value = order.cat_id;
|
||
activeDrawerCatName.value = order.cat_name || '服务项目';
|
||
showPickerDrawer.value = true;
|
||
} else {
|
||
onMoreServices();
|
||
}
|
||
};
|
||
|
||
const onSpecSelected = (spec) => {
|
||
showPickerDrawer.value = false;
|
||
const hitCat = cats.value.find(c => c.id === spec.cat_id) || null;
|
||
const rawAddons = spec.addons && spec.addons.length ? spec.addons : [];
|
||
const extras = rawAddons.map(ad => ({
|
||
id: ad.id,
|
||
key: 'addon_' + ad.id,
|
||
name: ad.name,
|
||
unit: ad.unit || '个',
|
||
price: Number(ad.price) || 0,
|
||
num: 0
|
||
}));
|
||
|
||
const firstGoods = {
|
||
service_id: spec.service_id,
|
||
item_name: spec.item_name,
|
||
spec_id: spec.spec_id || 0,
|
||
spec_name: spec.spec_name,
|
||
cat_id: spec.cat_id,
|
||
cat_name: spec.cat_name,
|
||
cat_icon_url: hitCat ? hitCat.icon_url : '',
|
||
unit: spec.unit || '件',
|
||
base_price: Number(spec.base_price) || 0,
|
||
num: 1,
|
||
service_type: spec.default_service_type || 'install',
|
||
service_type_name: spec.default_service_name || '安装',
|
||
service_types: spec.service_types || [],
|
||
pricing_revision: spec.pricing_revision,
|
||
images: [],
|
||
extras: extras
|
||
};
|
||
uni.setStorageSync('yjyf_first_goods', firstGoods);
|
||
uni.navigateTo({ url: '/pages/order/quick' });
|
||
};
|
||
|
||
const onCustomOrder = () => {
|
||
showPickerDrawer.value = false;
|
||
uni.navigateTo({
|
||
url: `/pages/order/quick?cat_id=15&cat_name=${encodeURIComponent('其它')}&custom=1&mode=quote`
|
||
});
|
||
};
|
||
|
||
/* ---------- Banner 轮播交互 ---------- */
|
||
const onBannerChange = (e) => {
|
||
bannerIndex.value = (e && e.detail && e.detail.current) ? e.detail.current : 0;
|
||
};
|
||
const goBanner = (i) => { bannerIndex.value = i; };
|
||
const onBanner = (b) => {
|
||
if (!b || !b.link) {
|
||
if (b && b.theme === 'brand') return;
|
||
toast('活动详情敬请期待');
|
||
return;
|
||
}
|
||
const link = b.link;
|
||
if (/^https?:\/\//i.test(link)) {
|
||
uni.setClipboardData({ data: link, success: () => toast('链接已复制') });
|
||
return;
|
||
}
|
||
const targetUrl = link.replace(/^\/YJYF\/YJYF/, '/pages/index/index');
|
||
if (targetUrl === '/pages/index/index') {
|
||
uni.reLaunch({ url: targetUrl });
|
||
return;
|
||
}
|
||
uni.navigateTo({ url: targetUrl });
|
||
};
|
||
|
||
onMounted(() => {
|
||
navHeight.value = getNavBarMetrics().totalNavHeight;
|
||
loadHome();
|
||
});
|
||
|
||
onBeforeUnmount(() => {
|
||
if (drawerOpenTimer) {
|
||
clearTimeout(drawerOpenTimer);
|
||
drawerOpenTimer = null;
|
||
}
|
||
if (drawerCloseTimer) {
|
||
clearTimeout(drawerCloseTimer);
|
||
drawerCloseTimer = null;
|
||
}
|
||
});
|
||
|
||
defineExpose({
|
||
load: loadHome,
|
||
loadMore: loadMore
|
||
});
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.home-view {
|
||
height: calc(100vh - 112rpx - constant(safe-area-inset-bottom));
|
||
height: calc(100vh - 112rpx - env(safe-area-inset-bottom));
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
background: $yjyf-bg-page;
|
||
position: relative;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.home-scroll {
|
||
flex: 1;
|
||
height: 0;
|
||
width: 100%;
|
||
}
|
||
|
||
/* ---------- 1. 沉浸式顶区舞台(与 TopBar 共享 135deg 连续渐变 + 纵向柔和消隐底座) ---------- */
|
||
.hero-stage {
|
||
position: relative;
|
||
padding: 16rpx $yjyf-space-md 0;
|
||
margin-bottom: $yjyf-space-md;
|
||
box-sizing: border-box;
|
||
}
|
||
.hero-backdrop {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 320rpx;
|
||
z-index: 0;
|
||
pointer-events: none;
|
||
background-color: $yjyf-primary;
|
||
background-image: $yjyf-gradient-primary;
|
||
background-size: 100% 600rpx;
|
||
background-position: 0 0;
|
||
background-repeat: no-repeat;
|
||
}
|
||
.hero-backdrop-fade {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
height: 200rpx;
|
||
background: linear-gradient(
|
||
180deg,
|
||
rgba(245, 246, 248, 0) 0%,
|
||
rgba(245, 246, 248, 0.56) 54%,
|
||
$yjyf-bg-page 100%
|
||
);
|
||
}
|
||
|
||
/* ---------- 2. 白玉悬浮搜索坞 ---------- */
|
||
.search-dock-wrap {
|
||
position: relative;
|
||
z-index: 2;
|
||
margin-bottom: $yjyf-space-md;
|
||
}
|
||
.search-dock-box {
|
||
height: 80rpx;
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-pill;
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 0 $yjyf-space-xs 0 28rpx;
|
||
box-shadow: 0 8rpx 24rpx rgba(180, 65, 0, 0.12);
|
||
box-sizing: border-box;
|
||
transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
|
||
}
|
||
.search-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
.search-placeholder {
|
||
flex: 1;
|
||
margin-left: $yjyf-space-sm;
|
||
font-size: $yjyf-font-body;
|
||
color: $yjyf-text-muted;
|
||
line-height: 1;
|
||
}
|
||
.search-action-btn {
|
||
height: 64rpx;
|
||
padding: 0 $yjyf-space-lg;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
line-height: 1;
|
||
box-shadow: 0 4rpx 12rpx rgba(240, 113, 13, 0.28);
|
||
}
|
||
.search-action-txt {
|
||
font-size: $yjyf-font-sub;
|
||
font-weight: 700;
|
||
color: $yjyf-bg-card;
|
||
letter-spacing: 1rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* ---------- 3. 核心品类金刚区 (3 行 5 列共 15 个标准类目,首屏 1:1 等高骨架 + 错峰显影) ---------- */
|
||
.cats-card {
|
||
position: relative;
|
||
z-index: 2;
|
||
background: $yjyf-bg-card;
|
||
border-radius: 24rpx;
|
||
padding: $yjyf-space-md $yjyf-space-xs $yjyf-space-sm;
|
||
box-shadow: 0 8rpx 28rpx rgba(31, 31, 31, 0.05);
|
||
box-sizing: border-box;
|
||
}
|
||
.cats-grid {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
}
|
||
.sk-cat-cell {
|
||
width: 20%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: 12rpx 0;
|
||
box-sizing: border-box;
|
||
}
|
||
.sk-cat-ico {
|
||
width: 72rpx;
|
||
height: 72rpx;
|
||
margin: 4rpx 0;
|
||
border-radius: 22rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.sk-cat-txt {
|
||
width: 76rpx;
|
||
height: 24rpx;
|
||
margin: 12rpx 0 4rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.cat-cell {
|
||
width: 20%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: 12rpx 0;
|
||
box-sizing: border-box;
|
||
animation: catCellReveal 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||
}
|
||
@keyframes catCellReveal {
|
||
from {
|
||
opacity: 0;
|
||
transform: translate3d(0, 12rpx, 0);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: translate3d(0, 0, 0);
|
||
}
|
||
}
|
||
.cat-icon-container {
|
||
width: 80rpx;
|
||
height: 80rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||
}
|
||
.cat-cell:active .cat-icon-container {
|
||
transform: scale(0.90);
|
||
}
|
||
.cat-icon-image {
|
||
width: 72rpx;
|
||
height: 72rpx;
|
||
}
|
||
.cat-cell-name {
|
||
margin-top: $yjyf-space-xs;
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-main;
|
||
font-weight: 500;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* ---------- 4. 主体内容容器 ---------- */
|
||
.main-body {
|
||
padding: 0 $yjyf-space-md;
|
||
position: relative;
|
||
z-index: 10;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* ---------- 5. 官方轮播 Banner (1:1 等高骨架屏 + 真实数据平滑揭幕) ---------- */
|
||
.banner-skeleton-card {
|
||
position: relative;
|
||
height: 208rpx;
|
||
margin-bottom: $yjyf-space-md;
|
||
padding: 20rpx $yjyf-space-md 30rpx;
|
||
border-radius: 24rpx;
|
||
background: linear-gradient(135deg, $yjyf-bg-card 0%, $yjyf-primary-bg 100%);
|
||
border: 1rpx solid rgba(240, 113, 13, 0.12);
|
||
box-shadow: $yjyf-shadow-card;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: $yjyf-space-md;
|
||
box-sizing: border-box;
|
||
overflow: hidden;
|
||
}
|
||
.sk-banner-left {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
}
|
||
.sk-bn-badge-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: $yjyf-space-xs;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
.sk-bn-badge {
|
||
width: 112rpx;
|
||
height: 36rpx;
|
||
border-radius: 8rpx;
|
||
background: rgba(240, 113, 13, 0.14);
|
||
}
|
||
.sk-bn-tag {
|
||
width: 136rpx;
|
||
height: 36rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.sk-bn-title {
|
||
width: 72%;
|
||
height: 34rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-border-color;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
.sk-bn-sub {
|
||
width: 86%;
|
||
height: 24rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.sk-bn-cta {
|
||
width: 152rpx;
|
||
height: 56rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(240, 113, 13, 0.14);
|
||
flex-shrink: 0;
|
||
}
|
||
.sk-bn-dots {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 12rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.sk-bn-dot {
|
||
width: 10rpx;
|
||
height: 6rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(240, 113, 13, 0.16);
|
||
margin: 0 5rpx;
|
||
}
|
||
.sk-bn-dot.on {
|
||
width: 24rpx;
|
||
background: rgba(240, 113, 13, 0.32);
|
||
}
|
||
|
||
.banner-section {
|
||
position: relative;
|
||
margin-bottom: $yjyf-space-md;
|
||
}
|
||
.banner-reveal {
|
||
animation: bannerRevealIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||
}
|
||
@keyframes bannerRevealIn {
|
||
from {
|
||
opacity: 0;
|
||
transform: translate3d(0, 10rpx, 0);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: translate3d(0, 0, 0);
|
||
}
|
||
}
|
||
.banner-swiper {
|
||
height: 208rpx;
|
||
border-radius: 24rpx;
|
||
overflow: hidden;
|
||
box-shadow: $yjyf-shadow-card;
|
||
}
|
||
.banner-card {
|
||
position: relative;
|
||
height: 100%;
|
||
padding: 20rpx $yjyf-space-md 30rpx;
|
||
box-sizing: border-box;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
background: linear-gradient(135deg, $yjyf-bg-card 0%, $yjyf-primary-bg 100%);
|
||
border: 1rpx solid rgba(240, 113, 13, 0.14);
|
||
border-radius: 24rpx;
|
||
overflow: hidden;
|
||
transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
|
||
}
|
||
.banner-card:active {
|
||
transform: scale(0.99);
|
||
}
|
||
.banner-card.theme-brand {
|
||
background: linear-gradient(135deg, $yjyf-bg-card 0%, $yjyf-primary-bg 100%);
|
||
}
|
||
.banner-card.has-image {
|
||
border: none;
|
||
}
|
||
.banner-bg-img {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
z-index: 1;
|
||
}
|
||
.banner-mask {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
background: linear-gradient(90deg, rgba(0, 0, 0, 0.60) 0%, rgba(0, 0, 0, 0.18) 100%);
|
||
z-index: 2;
|
||
}
|
||
.banner-deco-img {
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
width: 280rpx;
|
||
height: 100%;
|
||
z-index: 1;
|
||
pointer-events: none;
|
||
}
|
||
|
||
/* 平台实力 Banner */
|
||
.brand-bar {
|
||
position: relative;
|
||
z-index: 3;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.brand-title-group {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.brand-shield {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
margin-right: $yjyf-space-xs;
|
||
}
|
||
.brand-heading {
|
||
font-size: 26rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
.brand-date-tag {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
padding: 2rpx 12rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(240, 113, 13, 0.08);
|
||
}
|
||
.brand-stats {
|
||
position: relative;
|
||
z-index: 3;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
margin: 4rpx 0;
|
||
}
|
||
.stat-unit {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
}
|
||
.stat-v {
|
||
font-size: $yjyf-font-title;
|
||
font-weight: 800;
|
||
color: $yjyf-primary;
|
||
line-height: 1.15;
|
||
}
|
||
.stat-l {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-regular;
|
||
margin-top: 4rpx;
|
||
}
|
||
.brand-foot {
|
||
position: relative;
|
||
z-index: 3;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.foot-desc {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
/* 活动 / 服务主题 Banner */
|
||
.slide-content {
|
||
position: relative;
|
||
z-index: 3;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 100%;
|
||
gap: $yjyf-space-sm;
|
||
}
|
||
.slide-left-text {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
}
|
||
.slide-badge-box {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: $yjyf-space-xs;
|
||
margin-bottom: $yjyf-space-xs;
|
||
}
|
||
.badge-main {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 36rpx;
|
||
line-height: 36rpx;
|
||
padding: 0 14rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-bg-card;
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 700;
|
||
}
|
||
.badge-sub-tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
height: 36rpx;
|
||
line-height: 36rpx;
|
||
padding: 0 12rpx;
|
||
border-radius: 8rpx;
|
||
background: rgba(240, 113, 13, 0.09);
|
||
color: $yjyf-primary;
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
}
|
||
.slide-title {
|
||
font-size: $yjyf-font-title;
|
||
font-weight: 800;
|
||
color: $yjyf-text-main;
|
||
line-height: 1.3;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.banner-card.has-image .slide-title {
|
||
color: $yjyf-bg-card;
|
||
}
|
||
.slide-sub {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-secondary;
|
||
margin-top: 6rpx;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.banner-card.has-image .slide-sub {
|
||
color: rgba(255, 255, 255, 0.86);
|
||
}
|
||
.slide-right-cta {
|
||
flex-shrink: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.banner-cta-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 56rpx;
|
||
padding: 0 22rpx 0 24rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
box-shadow: 0 6rpx 16rpx rgba(240, 113, 13, 0.24);
|
||
}
|
||
.banner-cta-txt {
|
||
font-size: $yjyf-font-sub;
|
||
font-weight: 700;
|
||
color: $yjyf-bg-card;
|
||
line-height: 1;
|
||
}
|
||
.banner-cta-arr {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
margin-left: 4rpx;
|
||
}
|
||
|
||
/* 内嵌轮播指示器(收敛于卡片底部,消除外部散落感) */
|
||
.banner-dots {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 12rpx;
|
||
z-index: 5;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.banner-dot {
|
||
width: 10rpx;
|
||
height: 6rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(240, 113, 13, 0.22);
|
||
margin: 0 5rpx;
|
||
transition: width 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.22s ease;
|
||
}
|
||
.banner-dot.on {
|
||
width: 24rpx;
|
||
background: $yjyf-primary;
|
||
}
|
||
.banner-dots.is-on-image .banner-dot {
|
||
background: rgba(255, 255, 255, 0.42);
|
||
}
|
||
.banner-dots.is-on-image .banner-dot.on {
|
||
background: $yjyf-bg-card;
|
||
}
|
||
|
||
/* ---------- 6. 双 Tab 核心板块与一体化粘性控制头 ---------- */
|
||
.content-tab-section {
|
||
margin-bottom: $yjyf-space-md;
|
||
}
|
||
.feed-control-panel {
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 35;
|
||
background: $yjyf-bg-card;
|
||
border-radius: 24rpx;
|
||
padding: 20rpx $yjyf-space-md 12rpx;
|
||
margin-bottom: $yjyf-space-sm;
|
||
border: 1rpx solid transparent;
|
||
box-shadow: 0 6rpx 24rpx rgba(31, 31, 31, 0.04);
|
||
box-sizing: border-box;
|
||
transition: box-shadow 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
|
||
}
|
||
.feed-control-panel.is-elevated {
|
||
background: rgba(255, 255, 255, 0.96);
|
||
backdrop-filter: blur(12rpx);
|
||
border-color: rgba(240, 113, 13, 0.12);
|
||
box-shadow: 0 12rpx 32rpx rgba(31, 31, 31, 0.08);
|
||
}
|
||
.section-tab-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding-bottom: $yjyf-space-sm;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
}
|
||
.tab-list {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 32rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
.tab-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: $yjyf-space-xs;
|
||
min-height: 56rpx;
|
||
cursor: pointer;
|
||
}
|
||
.tab-title-wrap {
|
||
position: relative;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding-bottom: 8rpx;
|
||
}
|
||
.tab-text {
|
||
font-size: 30rpx;
|
||
color: $yjyf-text-secondary;
|
||
font-weight: 600;
|
||
transition: color 0.2s ease, font-size 0.2s ease;
|
||
line-height: 1.25;
|
||
}
|
||
.tab-item.active .tab-text {
|
||
font-size: $yjyf-font-title;
|
||
font-weight: 800;
|
||
color: $yjyf-text-main;
|
||
}
|
||
.tab-badge-pill {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
padding: 2rpx 10rpx;
|
||
border-radius: 8rpx;
|
||
line-height: 1.3;
|
||
margin-bottom: 6rpx;
|
||
transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||
}
|
||
.tab-item.active .tab-badge-pill {
|
||
transform: translateY(-2rpx);
|
||
}
|
||
.hot-badge {
|
||
color: $yjyf-primary;
|
||
background: $yjyf-primary-bg;
|
||
}
|
||
.done-badge {
|
||
color: $yjyf-success;
|
||
background: rgba(47, 168, 79, 0.10);
|
||
}
|
||
.tab-active-indicator {
|
||
position: absolute;
|
||
bottom: -2rpx;
|
||
left: 50%;
|
||
width: 40rpx;
|
||
height: 6rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
opacity: 0;
|
||
transform: translateX(-50%) scaleX(0.25);
|
||
transform-origin: center;
|
||
transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
|
||
}
|
||
.tab-item.active .tab-active-indicator {
|
||
opacity: 1;
|
||
transform: translateX(-50%) scaleX(1);
|
||
}
|
||
.title-more {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
min-height: 56rpx;
|
||
padding-left: $yjyf-space-sm;
|
||
}
|
||
.more-txt {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-secondary;
|
||
font-weight: 500;
|
||
}
|
||
.more-arrow {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
margin-left: 4rpx;
|
||
opacity: 0.65;
|
||
transition: transform 0.18s ease;
|
||
}
|
||
.title-more:active .more-arrow {
|
||
transform: translateX(4rpx);
|
||
}
|
||
|
||
/* 一体化第二层:轻量化胶囊排序与筛选栏 */
|
||
.jd-sort-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 68rpx;
|
||
padding-top: 8rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
.jd-sort-item {
|
||
flex: 1;
|
||
height: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-width: 0;
|
||
cursor: pointer;
|
||
}
|
||
.jd-sort-pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 52rpx;
|
||
padding: 0 20rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: transparent;
|
||
transition: background-color 0.2s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
|
||
}
|
||
.jd-sort-item.active .jd-sort-pill {
|
||
background: $yjyf-primary-bg;
|
||
}
|
||
.jd-sort-txt {
|
||
font-size: 26rpx;
|
||
color: $yjyf-text-regular;
|
||
font-weight: 400;
|
||
line-height: 1.2;
|
||
white-space: nowrap;
|
||
transition: color 0.18s ease;
|
||
}
|
||
.jd-sort-item.active .jd-sort-txt {
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
.jd-sort-divider {
|
||
width: 1rpx;
|
||
height: 28rpx;
|
||
background: $yjyf-border-color;
|
||
flex-shrink: 0;
|
||
margin: 0 4rpx;
|
||
}
|
||
.jd-price-caret {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
margin-left: 4rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
.jd-filter-icon {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
margin-left: 6rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* 已生效筛选条件快捷胶囊条 */
|
||
.jd-active-chips-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-top: $yjyf-space-xs;
|
||
padding-top: $yjyf-space-sm;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
}
|
||
.jd-chips-scroll {
|
||
flex: 1;
|
||
width: 0;
|
||
white-space: nowrap;
|
||
}
|
||
.jd-chips-track {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
padding-right: 12rpx;
|
||
}
|
||
.jd-chip-pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
height: 48rpx;
|
||
padding: 0 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary;
|
||
animation: chipPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||
}
|
||
@keyframes chipPopIn {
|
||
from {
|
||
opacity: 0;
|
||
transform: scale(0.9);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: scale(1);
|
||
}
|
||
}
|
||
.jd-chip-txt {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
line-height: 1;
|
||
}
|
||
.jd-chip-close {
|
||
width: 18rpx;
|
||
height: 18rpx;
|
||
margin-left: $yjyf-space-xs;
|
||
opacity: 0.75;
|
||
}
|
||
.jd-chips-clear {
|
||
padding: 8rpx 12rpx;
|
||
margin-left: $yjyf-space-xs;
|
||
flex-shrink: 0;
|
||
}
|
||
.jd-chips-clear-txt {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
font-weight: 400;
|
||
}
|
||
|
||
/* 右侧滑出多维条件筛选抽屉(支持打开滑入与关闭滑出双向物理阻尼) */
|
||
.jd-drawer-mask {
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
background: rgba(15, 23, 42, 0.45);
|
||
z-index: 1005;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
transition: opacity 0.22s ease;
|
||
}
|
||
.jd-drawer-mask.is-open {
|
||
opacity: 1;
|
||
pointer-events: auto;
|
||
}
|
||
.jd-drawer-panel {
|
||
width: 610rpx;
|
||
height: 100%;
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-lg 0 0 $yjyf-radius-lg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-sizing: border-box;
|
||
overflow: hidden;
|
||
transform: translate3d(100%, 0, 0);
|
||
transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
|
||
will-change: transform;
|
||
}
|
||
.jd-drawer-mask.is-open .jd-drawer-panel {
|
||
transform: translate3d(0, 0, 0);
|
||
}
|
||
.jd-drawer-scroll {
|
||
flex: 1;
|
||
height: 0;
|
||
padding: 0 28rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
.jd-sec-block {
|
||
padding-bottom: $yjyf-space-lg;
|
||
}
|
||
.jd-sec-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 64rpx;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
.jd-sec-title {
|
||
font-size: $yjyf-font-body;
|
||
color: $yjyf-text-main;
|
||
font-weight: 700;
|
||
line-height: 1.2;
|
||
}
|
||
.jd-sec-arrow {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
transform: rotate(180deg);
|
||
transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
|
||
}
|
||
.jd-sec-arrow.folded {
|
||
transform: rotate(0deg);
|
||
}
|
||
.jd-tag-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||
gap: $yjyf-space-sm;
|
||
}
|
||
.jd-tag-cell {
|
||
height: 68rpx;
|
||
padding: 0 12rpx;
|
||
border-radius: $yjyf-radius-sm;
|
||
background: $yjyf-bg-page;
|
||
border: 1rpx solid transparent;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-sizing: border-box;
|
||
transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
|
||
}
|
||
.jd-tag-txt {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-main;
|
||
font-weight: 400;
|
||
line-height: 1.2;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.jd-tag-cell.on {
|
||
background: $yjyf-primary-bg;
|
||
border-color: $yjyf-primary;
|
||
}
|
||
.jd-tag-cell.on .jd-tag-txt {
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 抽屉底部:左【重置】右【确定】一体双按钮栏 */
|
||
.jd-drawer-footer {
|
||
padding: 20rpx 28rpx calc(env(safe-area-inset-bottom) + 24rpx);
|
||
background: $yjyf-bg-card;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
flex-shrink: 0;
|
||
}
|
||
.jd-btn-group {
|
||
display: flex;
|
||
align-items: center;
|
||
height: 80rpx;
|
||
border-radius: 16rpx;
|
||
overflow: hidden;
|
||
border: 2rpx solid $yjyf-primary;
|
||
box-sizing: border-box;
|
||
}
|
||
.jd-btn-reset {
|
||
flex: 1;
|
||
height: 100%;
|
||
background: $yjyf-bg-card;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.jd-btn-reset-txt {
|
||
font-size: $yjyf-font-body;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
.jd-btn-confirm {
|
||
flex: 1.2;
|
||
height: 100%;
|
||
background: $yjyf-gradient-primary;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.jd-btn-confirm-txt {
|
||
font-size: $yjyf-font-body;
|
||
color: $yjyf-bg-card;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* ---------- 6.2 1:1 同构骨架屏与 GPU 硬件加速流光动画 ---------- */
|
||
.skeleton-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: $yjyf-space-sm;
|
||
}
|
||
.skeleton-card {
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-md;
|
||
overflow: hidden;
|
||
border: 1rpx solid $yjyf-border-color;
|
||
box-shadow: 0 4rpx 16rpx rgba(31, 31, 31, 0.03);
|
||
}
|
||
.sk-media {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 224rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.sk-media-pill {
|
||
position: absolute;
|
||
left: 12rpx;
|
||
top: 12rpx;
|
||
width: 84rpx;
|
||
height: 40rpx;
|
||
border-radius: $yjyf-radius-sm;
|
||
background: rgba(255, 255, 255, 0.52);
|
||
z-index: 2;
|
||
}
|
||
.sk-body {
|
||
padding: $yjyf-space-sm;
|
||
}
|
||
.sk-line {
|
||
border-radius: 8rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.sk-title {
|
||
width: 76%;
|
||
height: 28rpx;
|
||
margin-top: 6rpx;
|
||
margin-bottom: 22rpx;
|
||
}
|
||
.sk-case-title {
|
||
width: 80%;
|
||
height: 28rpx;
|
||
margin-top: 4rpx;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
.sk-case-quote {
|
||
width: 92%;
|
||
height: 22rpx;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
.sk-case-meta {
|
||
width: 62%;
|
||
height: 22rpx;
|
||
margin-bottom: $yjyf-space-sm;
|
||
}
|
||
.sk-foot {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.sk-price {
|
||
width: 104rpx;
|
||
height: 36rpx;
|
||
border-radius: 8rpx;
|
||
background: rgba(240, 113, 13, 0.12);
|
||
}
|
||
.sk-score {
|
||
width: 92rpx;
|
||
height: 28rpx;
|
||
border-radius: 8rpx;
|
||
background: rgba(240, 113, 13, 0.12);
|
||
}
|
||
.sk-btn {
|
||
width: 112rpx;
|
||
height: 48rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
}
|
||
.shimmer {
|
||
position: relative;
|
||
overflow: hidden;
|
||
}
|
||
.shimmer::after {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
left: 0;
|
||
transform: translate3d(-100%, 0, 0);
|
||
background: linear-gradient(
|
||
105deg,
|
||
rgba(255, 255, 255, 0) 20%,
|
||
rgba(255, 255, 255, 0.68) 50%,
|
||
rgba(255, 255, 255, 0) 80%
|
||
);
|
||
animation: skShimmer 1.35s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||
pointer-events: none;
|
||
}
|
||
@keyframes skShimmer {
|
||
100% {
|
||
transform: translate3d(100%, 0, 0);
|
||
}
|
||
}
|
||
/* Tab 1 视图:精选一口价服务卡片网格 */
|
||
.services-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: $yjyf-space-sm;
|
||
}
|
||
.service-card {
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-md;
|
||
overflow: hidden;
|
||
box-shadow: 0 4rpx 16rpx rgba(31, 31, 31, 0.04);
|
||
border: 1rpx solid $yjyf-border-color;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-sizing: border-box;
|
||
transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
|
||
}
|
||
.service-card:active {
|
||
transform: scale(0.98);
|
||
}
|
||
.service-media {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 224rpx;
|
||
background: $yjyf-bg-page;
|
||
overflow: hidden;
|
||
}
|
||
.service-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
display: block;
|
||
}
|
||
.media-top-gradient {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
height: 64rpx;
|
||
background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 100%);
|
||
pointer-events: none;
|
||
}
|
||
.service-cat-badge {
|
||
position: absolute;
|
||
left: 12rpx;
|
||
top: 12rpx;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 40rpx;
|
||
line-height: 40rpx;
|
||
text-align: center;
|
||
padding: 0 14rpx;
|
||
border-radius: $yjyf-radius-sm;
|
||
background: rgba(0, 0, 0, 0.45);
|
||
backdrop-filter: blur(8rpx);
|
||
color: $yjyf-bg-card;
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
letter-spacing: 0.5rpx;
|
||
}
|
||
.service-recommend-tag {
|
||
position: absolute;
|
||
right: 12rpx;
|
||
top: 12rpx;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 40rpx;
|
||
line-height: 40rpx;
|
||
text-align: center;
|
||
padding: 0 14rpx;
|
||
border-radius: $yjyf-radius-sm;
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-bg-card;
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 700;
|
||
box-shadow: 0 2rpx 8rpx rgba(240, 113, 13, 0.35);
|
||
}
|
||
.service-info {
|
||
padding: $yjyf-space-sm;
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex: 1;
|
||
justify-content: space-between;
|
||
}
|
||
.service-name {
|
||
font-size: $yjyf-font-body;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
line-height: 1.4;
|
||
margin-bottom: $yjyf-space-sm;
|
||
}
|
||
.service-bottom {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.service-price {
|
||
display: flex;
|
||
align-items: baseline;
|
||
}
|
||
.service-price .price-symbol {
|
||
font-size: $yjyf-font-sub;
|
||
font-weight: 800;
|
||
color: $yjyf-primary;
|
||
}
|
||
.service-price .price-num {
|
||
font-size: 36rpx;
|
||
font-weight: 900;
|
||
color: $yjyf-primary;
|
||
margin-left: 2rpx;
|
||
line-height: 1;
|
||
}
|
||
.service-price .price-unit {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
margin-left: 4rpx;
|
||
}
|
||
.service-book-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 48rpx;
|
||
padding: 0 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid rgba(240, 113, 13, 0.18);
|
||
line-height: 1;
|
||
transition: background 0.15s ease;
|
||
}
|
||
.service-book-btn:active {
|
||
background: rgba(240, 113, 13, 0.14);
|
||
}
|
||
.book-btn-txt {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 700;
|
||
color: $yjyf-primary;
|
||
line-height: 1;
|
||
}
|
||
.book-btn-arr {
|
||
width: 18rpx;
|
||
height: 18rpx;
|
||
margin-left: 2rpx;
|
||
}
|
||
|
||
/* Tab 2 视图:全平台工单流卡片 */
|
||
.order-flow-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: $yjyf-space-sm;
|
||
}
|
||
.order-flow-card {
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-md;
|
||
overflow: hidden;
|
||
box-shadow: 0 4rpx 16rpx rgba(31, 31, 31, 0.04);
|
||
border: 1rpx solid $yjyf-border-color;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-sizing: border-box;
|
||
transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
|
||
}
|
||
.order-flow-card:active {
|
||
transform: scale(0.98);
|
||
}
|
||
.flow-card-media {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 224rpx;
|
||
background: $yjyf-bg-page;
|
||
overflow: hidden;
|
||
}
|
||
.flow-card-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
display: block;
|
||
}
|
||
.flow-status-badge {
|
||
position: absolute;
|
||
left: 12rpx;
|
||
top: 12rpx;
|
||
height: 40rpx;
|
||
padding: 0 14rpx;
|
||
border-radius: $yjyf-radius-sm;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 6rpx;
|
||
line-height: 1;
|
||
}
|
||
.badge-done {
|
||
background: rgba(47, 168, 79, 0.90);
|
||
backdrop-filter: blur(8rpx);
|
||
box-shadow: 0 2rpx 6rpx rgba(47, 168, 79, 0.25);
|
||
}
|
||
.showcase-badge-ico {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
}
|
||
.badge-done .badge-status-txt {
|
||
color: $yjyf-bg-card;
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 700;
|
||
line-height: 1;
|
||
}
|
||
|
||
.flow-card-content {
|
||
padding: $yjyf-space-sm;
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex: 1;
|
||
justify-content: space-between;
|
||
}
|
||
.flow-card-title {
|
||
font-size: $yjyf-font-body;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
line-height: 1.4;
|
||
margin-bottom: 6rpx;
|
||
}
|
||
.flow-card-quote {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-regular;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
margin-bottom: $yjyf-space-xs;
|
||
}
|
||
.flow-card-meta {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: $yjyf-space-sm;
|
||
}
|
||
.meta-pin-icon {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
flex-shrink: 0;
|
||
margin-right: 6rpx;
|
||
opacity: 0.6;
|
||
}
|
||
.flow-card-loc {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
flex: 1;
|
||
}
|
||
|
||
.flow-card-bottom {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.flow-score-box {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6rpx;
|
||
}
|
||
.flow-star-ico {
|
||
width: 26rpx;
|
||
height: 26rpx;
|
||
}
|
||
.flow-score-txt {
|
||
font-size: 26rpx;
|
||
font-weight: 800;
|
||
color: $yjyf-primary;
|
||
}
|
||
.flow-action-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 48rpx;
|
||
padding: 0 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid rgba(240, 113, 13, 0.18);
|
||
line-height: 1;
|
||
transition: background 0.15s ease;
|
||
}
|
||
.flow-action-btn:active {
|
||
background: rgba(240, 113, 13, 0.14);
|
||
}
|
||
.flow-action-txt {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 700;
|
||
color: $yjyf-primary;
|
||
line-height: 1;
|
||
}
|
||
.flow-action-arr {
|
||
width: 18rpx;
|
||
height: 18rpx;
|
||
margin-left: 2rpx;
|
||
}
|
||
|
||
/* ---------- 分页触底加载与到底状态栏 ---------- */
|
||
.feed-load-footer {
|
||
padding: $yjyf-space-md 0 $yjyf-space-xs;
|
||
min-height: calc(64rpx + #{$yjyf-space-md} + #{$yjyf-space-xs});
|
||
box-sizing: border-box;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.load-more-box {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 64rpx;
|
||
box-sizing: border-box;
|
||
padding: 0 $yjyf-space-lg;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-bg-card;
|
||
border: 1rpx solid $yjyf-border-color;
|
||
gap: 12rpx;
|
||
}
|
||
.loading-spinner {
|
||
width: 26rpx;
|
||
height: 26rpx;
|
||
border-radius: 50%;
|
||
border: 3rpx solid rgba(240, 113, 13, 0.22);
|
||
border-top-color: $yjyf-primary;
|
||
animation: spinAnim 0.75s linear infinite;
|
||
}
|
||
@keyframes spinAnim {
|
||
from { transform: rotate(0deg); }
|
||
to { transform: rotate(360deg); }
|
||
}
|
||
.load-more-txt {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-secondary;
|
||
font-weight: 500;
|
||
}
|
||
.no-more-box {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: $yjyf-space-sm;
|
||
width: 100%;
|
||
}
|
||
.no-more-line {
|
||
width: 64rpx;
|
||
height: 1rpx;
|
||
background: $yjyf-border-color;
|
||
}
|
||
.no-more-txt {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-muted;
|
||
}
|
||
|
||
/* ---------- 底部呼吸留白 (彻底避让悬浮大圆球与 TabBar) ---------- */
|
||
.page-bottom-space {
|
||
height: 96rpx;
|
||
}
|
||
|
||
/* ---------- 空状态缺省兜底 ---------- */
|
||
.empty-state-box {
|
||
padding: 72rpx 0 88rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-md;
|
||
border: 1rpx solid $yjyf-border-color;
|
||
animation: bannerRevealIn 0.24s ease-out both;
|
||
}
|
||
.empty-state-icon {
|
||
width: 104rpx;
|
||
height: 104rpx;
|
||
opacity: 0.75;
|
||
}
|
||
.empty-state-text {
|
||
font-size: 26rpx;
|
||
color: $yjyf-text-secondary;
|
||
margin-top: $yjyf-space-sm;
|
||
}
|
||
.empty-reset-btn {
|
||
margin-top: $yjyf-space-md;
|
||
height: 56rpx;
|
||
padding: 0 $yjyf-space-lg;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.empty-reset-txt {
|
||
font-size: $yjyf-font-sub;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.clickable-hover {
|
||
transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
|
||
}
|
||
.clickable-hover:active {
|
||
opacity: 0.86;
|
||
transform: scale(0.98);
|
||
}
|
||
|
||
/* ---------- 无障碍减弱动态效果保护 (WCAG 2.2) ---------- */
|
||
@media (prefers-reduced-motion: reduce) {
|
||
.cat-cell,
|
||
.banner-reveal,
|
||
.service-card,
|
||
.order-flow-card,
|
||
.jd-chip-pill,
|
||
.empty-state-box,
|
||
.shimmer::after,
|
||
.loading-spinner {
|
||
animation: none !important;
|
||
}
|
||
.service-img,
|
||
.flow-card-img {
|
||
transition: none !important;
|
||
transform: none !important;
|
||
opacity: 1 !important;
|
||
}
|
||
.tab-active-indicator,
|
||
.jd-drawer-mask,
|
||
.jd-drawer-panel {
|
||
transition: none !important;
|
||
}
|
||
}
|
||
</style>
|