文件
yjyf/yjyf-app/components/user/UserHomeView.vue
MiAn 3ebd795cbb feat(ui): 新增/优化界面样式、图标及交互组件
- 新增多个功能图标(箭头、盾牌、位置等)
- 优化全局按钮、标签、输入框等组件样式
- 修复导航栏高度计算逻辑,适配微信小程序
- 优化消息页、订单页、个人中心等页面布局
- 修复微信支付配置及通知接口问题
2026-11-09 09:57:22 +08:00

1198 行
30 KiB
Vue

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

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

<template>
<view class="home-view">
<!-- ==================== 1. 独立吸顶 TopBar(实体品牌橙常驻 · 彻底稳住胶囊与状态栏) ==================== -->
<YjyfNavBar
theme="orange"
title="优匠优服"
:fixed="true"
:placeholder="true"
>
<template #left>
<view class="nav-loc-pill clickable-hover" @tap="onCitySwitch">
<image class="nav-loc-icon" src="/static/icons/location-pin-white.svg" mode="aspectFit" />
<text class="nav-loc-text">全国服务</text>
<view class="nav-loc-arrow"></view>
</view>
</template>
</YjyfNavBar>
<!-- ==================== 2. 搜索条区域(品牌橙色底座 · 与 TopBar 自然接壤) ==================== -->
<view class="hero-search-area" :style="{ marginTop: (-navHeight) + 'px', paddingTop: (navHeight + 6) + 'px' }">
<!-- 白玉悬浮搜索坞 -->
<view class="search-dock-box" @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. 主页面内容容器 (标准边距 · 自然层叠) ==================== -->
<view class="main-body">
<!-- 核心品类金刚区 (3 行 5 列共 15 个标准类目,全真实数据驱动) -->
<view class="cats-card">
<view class="cats-grid">
<view
class="cat-cell clickable-hover"
v-for="c in displayCats"
:key="c.id"
@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>
<!-- 官方轮播 Banner (真实 fa_banner 数据驱动) -->
<view class="banner-section" v-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>
<!-- 平台信息展示 -->
<block v-if="b.theme === 'brand'">
<view class="brand-bar">
<image class="brand-shield" src="/static/icons/shield.svg" mode="aspectFit" />
<text class="brand-heading">{{ b.title || '优匠优服' }}</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>
<text class="foot-date" v-if="b.date_text">{{ b.date_text }}</text>
</view>
</block>
<!-- 活动 / 服务主题 -->
<block v-else>
<view class="slide-content">
<view class="slide-left-text">
<view class="slide-badge-box" v-if="b.badge">
<text class="badge-main">{{ b.badge }}</text>
</view>
<text class="slide-title">{{ b.title }}</text>
<text class="slide-sub" v-if="b.subtitle">{{ b.subtitle }}</text>
</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="banner-dots" v-if="banners.length > 1">
<view
v-for="(b, bi) in banners"
:key="'dot-' + b.id"
class="banner-dot"
:class="{ on: bannerIndex === bi }"
@tap="goBanner(bi)"
></view>
</view>
</view>
<!-- 优匠履约保障承诺条(真实接口 assures 驱动) -->
<view class="assure-bar" v-if="assures && assures.length">
<view class="assure-item" v-for="(txt, idx) in assures" :key="idx">
<image class="assure-icon" src="/static/icons/shield.svg" mode="aspectFit" />
<text class="assure-text">{{ txt }}</text>
</view>
</view>
<!-- ==================== 5. 双 Tab 核心板块:【热门推荐】与【服务动态】 ==================== -->
<view class="content-tab-section">
<!-- 双 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')"
>
<text class="tab-text">热门推荐</text>
<view class="tab-badge-pill hot-badge">热选</view>
<view class="tab-active-indicator" v-if="activeContentTab === 'hot'"></view>
</view>
<!-- Tab 2: 服务动态 (严格展示真实已完工工单实况与好评) -->
<view
class="tab-item clickable-hover"
:class="{ active: activeContentTab === 'cases' }"
@tap="switchContentTab('cases')"
>
<text class="tab-text">服务动态</text>
<view class="tab-badge-pill done-badge">已完工</view>
<view class="tab-active-indicator" v-if="activeContentTab === 'cases'"></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>
<!-- Tab 1 视图:热门服务推荐(按真实成交量+品类均衡+一口价多维推荐) -->
<view class="services-grid" v-if="activeContentTab === 'hot' && hotServices && hotServices.length">
<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" mode="aspectFill" />
<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>
<!-- Tab 2 视图:全平台已完工工单实况流(100% 真实已完工驱动 · 看实况与真实评价) -->
<view class="order-flow-grid" v-else-if="activeContentTab === 'cases' && recentOrders && recentOrders.length">
<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
v-if="order.image_url"
class="flow-card-img"
:src="order.image_url"
mode="aspectFill"
/>
<view class="media-top-gradient"></view>
<view class="flow-status-badge badge-done">
<view class="status-dot-green"></view>
<text class="badge-status-txt">已完工</text>
</view>
</view>
<!-- 卡片下半部详情(服务名称、脱敏地点与完工时间、价格与看实况按钮) -->
<view class="flow-card-content">
<text class="flow-card-title">{{ order.service_name }}</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-price-box">
<text class="price-symbol">¥</text>
<text class="price-num">{{ order.pay_amount }}</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="empty-state-box" v-else>
<image class="empty-state-icon" src="/static/icons/empty.svg" mode="aspectFit" />
<text class="empty-state-text">{{ activeContentTab === 'hot' ? '暂无热门服务推荐' : '暂无完工工单动态' }}</text>
</view>
</view>
<!-- 页面底部安全呼吸留白 (彻底避让悬浮立即下单大圆球,杜绝遮挡) -->
<view class="page-bottom-space"></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 } 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';
const emit = defineEmits(['switch-tab']);
/* ---------- 系统适配:状态栏 / 导航栏高度 ---------- */
const navHeight = ref(getNavBarMetrics().totalNavHeight);
/* ---------- 响应式数据(100% 真实接口驱动) ---------- */
const banners = ref([]);
const bannerIndex = ref(0);
const showBanners = ref(true);
const cats = ref([]);
const hotServices = ref([]);
const recentOrders = ref([]);
const assures = ref([]);
const badge = ref({ coupon: 0, unread: 0 });
/* ---------- 核心双 Tab 切换:'hot' (精选一口价) | 'cases' (服务动态实况) ---------- */
const activeContentTab = ref('hot');
const switchContentTab = (t) => {
activeContentTab.value = t;
};
/* ---------- 核心品类金刚区:3 行 5 列展示 15 个标准类目(第 15 个固定为【全部分类】) ---------- */
const displayCats = computed(() => {
const raw = (cats.value || []).slice(0, 15);
return raw.map((c, idx) => {
if (idx === 14 || c.id === 15 || c.name === '其它' || c.name === '其他' || c.name === '全部分类') {
return {
...c,
name: '全部分类',
is_more: true
};
}
return c;
});
});
/* ---------- 真实类目图标(100% 接口网络图片,严禁本地兜底) ---------- */
const getCatIcon = (c) => {
return (c && c.icon_url) ? c.icon_url : '';
};
/* ---------- 加载首页聚合数据(真实接口) ---------- */
async function loadHome() {
try {
await ensureSilentLogin();
} catch (e) {}
try {
const res = await api.home();
cats.value = res.cats || [];
hotServices.value = res.hot || [];
recentOrders.value = res.recent_orders || [];
assures.value = res.assures || [];
badge.value = res.badge || { coupon: 0, unread: 0 };
if (res.banners && res.banners.length) banners.value = res.banners;
if (bannerIndex.value >= banners.value.length) bannerIndex.value = 0;
} catch (e) {}
}
/* ---------- 交互逻辑 ---------- */
const toast = (title) => uni.showToast({ title, icon: 'none' });
function needLogin() {
if (isLogin()) return true;
toLogin();
return false;
}
const onCitySwitch = () => {
toast('已覆盖全国主要城市');
};
const onSearch = () => {
uni.navigateTo({ url: '/pages/category/category' });
};
const onMoreServices = () => {
uni.navigateTo({ url: '/pages/category/category' });
};
/* ---------- 商品抽屉联动 ---------- */
const showPickerDrawer = ref(false);
const activeDrawerCatId = ref(1);
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 || [],
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(() => {
loadHome();
});
defineExpose({
load: loadHome
});
</script>
<style scoped>
.home-view {
min-height: 100vh;
background: #F5F6F8;
padding-bottom: 220rpx;
position: relative;
overflow-x: hidden;
box-sizing: border-box;
}
/* ---------- 1. TopBar 左侧定位药丸 (嵌入 YjyfNavBar #left) ---------- */
.nav-loc-pill {
display: inline-flex;
align-items: center;
justify-content: center;
height: 48rpx;
padding: 0 18rpx;
background: rgba(255, 255, 255, 0.22);
border-radius: 24rpx;
border: 1rpx solid rgba(255, 255, 255, 0.35);
backdrop-filter: blur(8rpx);
margin-left: 16rpx;
line-height: 1;
transition: background 0.2s ease;
}
.nav-loc-icon {
width: 24rpx;
height: 24rpx;
flex-shrink: 0;
}
.nav-loc-text {
font-size: 24rpx;
font-weight: 700;
color: #FFFFFF;
margin: 0 6rpx;
white-space: nowrap;
line-height: 1;
}
.nav-loc-arrow {
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 8rpx solid #FFFFFF;
}
/* ---------- 2. 搜索条区域 (橙色底座 · 与 TopBar 共享连续渐变) ---------- */
.hero-search-area {
background-color: #F0710D;
background-image: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
background-size: 100% 600rpx;
background-position: 0 0;
background-repeat: no-repeat;
padding: 12rpx 24rpx 48rpx;
border-bottom-left-radius: 36rpx;
border-bottom-right-radius: 36rpx;
box-sizing: border-box;
}
.search-dock-box {
height: 76rpx;
background: #FFFFFF;
border-radius: 38rpx;
display: flex;
align-items: center;
padding: 0 8rpx 0 24rpx;
box-shadow: 0 6rpx 20rpx rgba(180, 50, 0, 0.10);
box-sizing: border-box;
}
.search-icon {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.search-placeholder {
flex: 1;
margin-left: 14rpx;
font-size: 26rpx;
color: #9CA3AF;
line-height: 1;
}
.search-action-btn {
height: 60rpx;
padding: 0 28rpx;
border-radius: 30rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
line-height: 1;
box-shadow: 0 4rpx 10rpx rgba(240, 113, 13, 0.28);
}
.search-action-txt {
font-size: 24rpx;
font-weight: 700;
color: #FFFFFF;
letter-spacing: 1rpx;
line-height: 1;
}
/* ---------- 3. 主体内容容器 ---------- */
.main-body {
padding: 0 24rpx;
position: relative;
z-index: 10;
box-sizing: border-box;
}
/* 金刚区 (纯白大卡,3 行 5 列共 15 个标准类目,全真实数据驱动) */
.cats-card {
background: #FFFFFF;
border-radius: 24rpx;
padding: 22rpx 8rpx 16rpx;
box-shadow: 0 6rpx 20rpx rgba(15, 23, 42, 0.04);
border: 1rpx solid #F0F0F2;
margin-top: -24rpx;
margin-bottom: 20rpx;
box-sizing: border-box;
}
.cats-grid {
display: flex;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
}
.cat-cell {
width: 20%;
display: flex;
flex-direction: column;
align-items: center;
padding: 10rpx 0;
box-sizing: border-box;
}
.cat-icon-container {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.16s ease;
}
.cat-cell:active .cat-icon-container {
transform: scale(0.92);
}
.cat-icon-image {
width: 72rpx;
height: 72rpx;
}
.cat-cell-name {
margin-top: 10rpx;
font-size: 24rpx;
color: #2D3748;
font-weight: 500;
text-align: center;
white-space: nowrap;
}
/* ---------- 4. 官方轮播 Banner (真实后台数据驱动) ---------- */
.banner-section {
margin-bottom: 20rpx;
}
.banner-swiper {
height: 196rpx;
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
}
.banner-card {
position: relative;
height: 100%;
padding: 20rpx 24rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
}
.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.2) 100%);
z-index: 2;
}
/* 平台实力 Banner */
.brand-bar {
display: flex;
align-items: center;
}
.brand-shield {
width: 26rpx;
height: 26rpx;
margin-right: 8rpx;
}
.brand-heading {
font-size: 26rpx;
font-weight: 800;
color: #111827;
}
.brand-stats {
display: flex;
align-items: center;
justify-content: space-around;
margin: 6rpx 0;
}
.stat-unit {
display: flex;
flex-direction: column;
align-items: center;
}
.stat-v {
font-size: 32rpx;
font-weight: 900;
color: #EA580C;
letter-spacing: -0.5rpx;
}
.stat-l {
font-size: 22rpx;
color: #4B5563;
margin-top: 4rpx;
}
.brand-foot {
display: flex;
align-items: center;
justify-content: space-between;
}
.foot-desc {
font-size: 22rpx;
color: #6B7280;
}
.foot-date {
font-size: 22rpx;
color: #EA580C;
font-weight: 600;
}
/* 活动主题 Banner */
.slide-content {
position: relative;
z-index: 3;
display: flex;
align-items: center;
justify-content: space-between;
height: 100%;
}
.slide-left-text {
display: flex;
flex-direction: column;
}
.slide-badge-box {
display: flex;
align-items: center;
margin-bottom: 6rpx;
}
.badge-main {
display: inline-flex;
align-items: center;
justify-content: center;
height: 36rpx;
line-height: 36rpx;
text-align: center;
padding: 0 12rpx;
border-radius: 8rpx;
background: #EA580C;
color: #FFFFFF;
font-size: 22rpx;
font-weight: 700;
}
.slide-title {
font-size: 32rpx;
font-weight: 800;
color: #111827;
}
.slide-sub {
font-size: 22rpx;
color: #4B5563;
margin-top: 4rpx;
}
.banner-dots {
display: flex;
align-items: center;
justify-content: center;
margin-top: 10rpx;
}
.banner-dot {
width: 10rpx;
height: 8rpx;
border-radius: 4rpx;
background: #D1D5DB;
margin: 0 6rpx;
transition: all 0.2s ease;
}
.banner-dot.on {
width: 26rpx;
background: #EA580C;
}
/* ---------- 4.1 履约服务保障条 (真实接口驱动) ---------- */
.assure-bar {
display: flex;
align-items: center;
justify-content: space-around;
background: #FFFFFF;
height: 72rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
padding: 0 16rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.025);
border: 1rpx solid #F0F0F2;
}
.assure-item {
display: flex;
align-items: center;
gap: 8rpx;
}
.assure-icon {
width: 24rpx;
height: 24rpx;
opacity: 0.85;
}
.assure-text {
font-size: 22rpx;
font-weight: 600;
color: #4B5563;
}
/* ---------- 5. 双 Tab 核心板块:【精选服务】与【服务动态】 ---------- */
.content-tab-section {
margin-bottom: 24rpx;
}
.section-tab-bar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 18rpx;
padding: 0 4rpx;
}
.tab-list {
display: flex;
align-items: center;
gap: 36rpx;
}
.tab-item {
position: relative;
display: flex;
align-items: center;
padding-bottom: 12rpx;
cursor: pointer;
}
.tab-text {
font-size: 30rpx;
color: #6B7280;
font-weight: 600;
transition: all 0.2s ease;
}
.tab-item.active .tab-text {
font-size: 34rpx;
font-weight: 900;
color: #111827;
}
.tab-active-indicator {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 44rpx;
height: 6rpx;
border-radius: 3rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
}
.tab-badge-pill {
display: inline-flex;
align-items: center;
justify-content: center;
height: 36rpx;
font-size: 22rpx;
padding: 0 12rpx;
border-radius: 18rpx;
font-weight: 700;
margin-left: 8rpx;
line-height: 1;
}
.tab-badge-pill.hot-badge {
color: #EA580C;
background: #FFF7ED;
border: 1rpx solid #FFEDD5;
}
.tab-badge-pill.done-badge {
color: #059669;
background: #ECFDF5;
border: 1rpx solid #D1FAE5;
}
.title-more {
display: flex;
align-items: center;
}
.more-txt {
font-size: 24rpx;
color: #6B7280;
line-height: 1;
}
.more-arrow {
width: 20rpx;
height: 20rpx;
margin-left: 4rpx;
opacity: 0.6;
}
/* Tab 1 视图:精选一口价服务卡片网格 */
.services-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
}
.service-card {
background: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.05);
border: 1rpx solid #F0F0F2;
display: flex;
flex-direction: column;
box-sizing: border-box;
transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.service-card:active {
transform: scale(0.98);
}
.service-media {
position: relative;
width: 100%;
height: 220rpx;
background: #F8FAFC;
overflow: hidden;
}
.service-img {
width: 100%;
height: 100%;
display: block;
}
.media-top-gradient {
position: absolute;
left: 0;
right: 0;
top: 0;
height: 60rpx;
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: 12rpx;
background: rgba(0, 0, 0, 0.45);
backdrop-filter: blur(8rpx);
color: #FFFFFF;
font-size: 22rpx;
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: 12rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
color: #FFFFFF;
font-size: 22rpx;
font-weight: 700;
box-shadow: 0 2rpx 8rpx rgba(240, 113, 13, 0.35);
}
.service-info {
padding: 16rpx 16rpx 18rpx;
display: flex;
flex-direction: column;
flex: 1;
justify-content: space-between;
}
.service-name {
font-size: 28rpx;
font-weight: 700;
color: #1F1F1F;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 1.4;
margin-bottom: 14rpx;
}
.service-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.service-price {
display: flex;
align-items: baseline;
}
.service-price .price-symbol {
font-size: 24rpx;
font-weight: 800;
color: #F0710D;
}
.service-price .price-num {
font-size: 36rpx;
font-weight: 900;
color: #F0710D;
margin-left: 2rpx;
line-height: 1;
}
.service-price .price-unit {
font-size: 22rpx;
color: #888888;
margin-left: 4rpx;
}
.service-book-btn {
display: inline-flex;
align-items: center;
justify-content: center;
height: 48rpx;
padding: 0 18rpx;
border-radius: 24rpx;
background: #FFF7F0;
border: 1rpx solid #FDE4D0;
line-height: 1;
transition: background 0.15s ease;
}
.service-book-btn:active {
background: #FEE8D8;
}
.book-btn-txt {
font-size: 22rpx;
font-weight: 700;
color: #F0710D;
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: 20rpx;
}
.order-flow-card {
background: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.05);
border: 1rpx solid #F0F0F2;
display: flex;
flex-direction: column;
box-sizing: border-box;
transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.order-flow-card:active {
transform: scale(0.98);
}
.flow-card-media {
position: relative;
width: 100%;
height: 220rpx;
background: #F8FAFC;
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: 12rpx;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6rpx;
line-height: 1;
}
.badge-done {
background: rgba(16, 185, 129, 0.90);
backdrop-filter: blur(8rpx);
box-shadow: 0 2rpx 6rpx rgba(5, 150, 105, 0.25);
}
.status-dot-green {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background: #FFFFFF;
}
.badge-done .badge-status-txt {
color: #FFFFFF;
font-size: 22rpx;
font-weight: 700;
line-height: 1;
}
.flow-card-content {
padding: 16rpx 16rpx 18rpx;
display: flex;
flex-direction: column;
flex: 1;
justify-content: space-between;
}
.flow-card-title {
font-size: 28rpx;
font-weight: 700;
color: #1F1F1F;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 1.4;
margin-bottom: 8rpx;
}
.flow-card-meta {
display: flex;
align-items: center;
margin-bottom: 14rpx;
}
.meta-pin-icon {
width: 20rpx;
height: 20rpx;
flex-shrink: 0;
margin-right: 6rpx;
opacity: 0.6;
}
.flow-card-loc {
font-size: 22rpx;
color: #888888;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
}
.flow-card-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.flow-price-box {
display: flex;
align-items: baseline;
}
.flow-action-btn {
display: inline-flex;
align-items: center;
justify-content: center;
height: 48rpx;
padding: 0 18rpx;
border-radius: 24rpx;
background: #FFF7F0;
border: 1rpx solid #FDE4D0;
line-height: 1;
transition: background 0.15s ease;
}
.flow-action-btn:active {
background: #FEE8D8;
}
.flow-action-txt {
font-size: 22rpx;
font-weight: 700;
color: #F0710D;
line-height: 1;
}
.flow-action-arr {
width: 18rpx;
height: 18rpx;
margin-left: 2rpx;
}
/* ---------- 底部呼吸留白 (彻底避让悬浮大圆球与 TabBar) ---------- */
.page-bottom-space {
height: 220rpx;
}
/* ---------- 空状态缺省兜底 ---------- */
.empty-state-box {
padding: 70rpx 0 90rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #FFFFFF;
border-radius: 20rpx;
border: 1rpx solid #F0F0F2;
}
.empty-state-icon {
width: 100rpx;
height: 100rpx;
opacity: 0.75;
}
.empty-state-text {
font-size: 26rpx;
color: #888888;
margin-top: 18rpx;
}
.clickable-hover:active {
opacity: 0.85;
transform: scale(0.98);
}
</style>