- 新增用户消息中心组件 UserMessageView - 新增师傅消息中心组件 MasterMessageView - 新增用户订单列表组件 UserOrdersView - 重构订单列表页,复用独立组件 - 新增系统工具 getWindowInfoSafe 兼容多端系统信息获取 - 重构 TabBar 组件,支持单母页模式和事件回调 - 优化消息跳转逻辑,支持角色自适应 Tab 切换
1003 行
24 KiB
Vue
1003 行
24 KiB
Vue
<template>
|
||
<view class="home-view">
|
||
<!-- ==================== 1. 顶部通栏鲜活纯正暖橙沉浸区域 ==================== -->
|
||
<view class="hero-header-wrap" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||
<!-- 顶部微光光晕装饰 (防溢出裁切) -->
|
||
<view class="hero-glow glow-1"></view>
|
||
<view class="hero-glow glow-2"></view>
|
||
|
||
<!-- 状态栏 & 导航条 -->
|
||
<view class="navbar-bar" :style="{ height: navBarHeight + 'px' }">
|
||
<view class="nav-loc clickable-hover" @tap="onCitySwitch">
|
||
<image class="nav-loc-icon" src="/static/icons/menu-address.svg" mode="aspectFit" />
|
||
<text class="nav-loc-text">全国服务</text>
|
||
<view class="nav-loc-arrow"></view>
|
||
</view>
|
||
|
||
<view class="nav-brand">
|
||
<text class="brand-title">优匠优服</text>
|
||
</view>
|
||
|
||
<view class="nav-msg-box clickable-hover" @tap="onMessage">
|
||
<image class="nav-msg-icon" src="/static/icons/nav-bell.svg" mode="aspectFit" />
|
||
<view class="nav-msg-badge" v-if="badge.unread > 0"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 白玉悬浮微光搜索坞 -->
|
||
<view class="search-dock-wrap">
|
||
<view class="search-bar" @tap="onSearch">
|
||
<image class="search-icon" src="/static/icons/search-gray.svg" mode="aspectFit" />
|
||
<text class="search-ph">搜索服务项目或商品</text>
|
||
<view class="search-action-btn">
|
||
<text class="search-action-txt">搜索</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 柔和过渡底边,使金刚区白卡自然融入 -->
|
||
<view class="hero-bottom-curve"></view>
|
||
</view>
|
||
|
||
<!-- ==================== 2. 主页面容器 (自然流向上微层叠) ==================== -->
|
||
<view class="main-body">
|
||
|
||
<!-- 核心品类金刚区 (纯白玉卡片,大厂无多余框浮雕设计) -->
|
||
<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>
|
||
|
||
<!-- 快捷服务通道 (聚焦核心业务动作,无冗余文字堆砌) -->
|
||
<view class="quick-channels-grid">
|
||
<view class="channel-card clickable-hover" @tap="onQuickChannel('install')">
|
||
<view class="channel-texts">
|
||
<text class="channel-title">极速安装</text>
|
||
<view class="channel-tag tag-orange">一口价</view>
|
||
</view>
|
||
<image class="channel-icon" src="/static/icons/scene-install.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<view class="channel-card clickable-hover" @tap="onQuickChannel('repair')">
|
||
<view class="channel-texts">
|
||
<text class="channel-title">专业快修</text>
|
||
<view class="channel-tag tag-blue">先测后报</view>
|
||
</view>
|
||
<image class="channel-icon" src="/static/icons/scene-repair.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<view class="channel-card clickable-hover" @tap="onQuickChannel('measure')">
|
||
<view class="channel-texts">
|
||
<text class="channel-title">全屋勘测</text>
|
||
<view class="channel-tag tag-purple">免费上门</view>
|
||
</view>
|
||
<image class="channel-icon" src="/static/icons/scene-measure.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<view class="channel-card clickable-hover" @tap="onQuickChannel('tear')">
|
||
<view class="channel-texts">
|
||
<text class="channel-title">送装拆旧</text>
|
||
<view class="channel-tag tag-green">旧物代搬</view>
|
||
</view>
|
||
<image class="channel-icon" src="/static/icons/scene-tear.svg" mode="aspectFit" />
|
||
</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>
|
||
|
||
<!-- 热门服务 (100% 真实接口驱动 · 干净双列布局) -->
|
||
<view class="hot-section" v-if="hotServices.length > 0">
|
||
<view class="section-title-bar">
|
||
<view class="title-left">
|
||
<view class="title-bar"></view>
|
||
<text class="title-main">热门服务</text>
|
||
</view>
|
||
<view class="title-more clickable-hover" @tap="onMore">
|
||
<text class="more-txt">全部</text>
|
||
<image class="more-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 双列服务卡片 -->
|
||
<view class="hot-cards-grid">
|
||
<view
|
||
class="hot-grid-card clickable-hover"
|
||
v-for="item in hotServices"
|
||
:key="item.id"
|
||
@tap="onHotService(item)"
|
||
>
|
||
<!-- 卡片顶部插图/封面 -->
|
||
<view class="grid-card-media" v-if="item.image_url || item.image">
|
||
<image
|
||
class="card-real-img"
|
||
:src="item.image_url || item.image"
|
||
mode="aspectFill"
|
||
/>
|
||
<view class="card-badge">{{ item.price_type === 'quote' ? '师傅报价' : '一口价' }}</view>
|
||
</view>
|
||
|
||
<!-- 卡片详情内容(剔除同义反复的无用标签) -->
|
||
<view class="grid-card-content">
|
||
<text class="grid-card-title">{{ item.name }}</text>
|
||
|
||
<view class="grid-price-row">
|
||
<view class="grid-price-wrap">
|
||
<text class="grid-price-symbol">¥</text>
|
||
<text class="grid-price-num">{{ item.base_price }}</text>
|
||
<text class="grid-price-unit">/{{ item.unit || '件' }}起</text>
|
||
</view>
|
||
<view class="grid-book-btn">
|
||
<text class="grid-book-txt">预约</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</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 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 { getWindowInfoSafe } from '@/utils/system.js';
|
||
|
||
const emit = defineEmits(['switch-tab']);
|
||
|
||
/* ---------- 系统适配:状态栏 / 导航栏高度 ---------- */
|
||
const statusBarHeight = ref(20);
|
||
const navBarHeight = ref(44);
|
||
|
||
try {
|
||
const info = getWindowInfoSafe();
|
||
if (info && info.statusBarHeight) statusBarHeight.value = info.statusBarHeight;
|
||
if (typeof uni.getMenuButtonBoundingClientRect === 'function') {
|
||
const menu = uni.getMenuButtonBoundingClientRect();
|
||
if (menu && menu.height) navBarHeight.value = (menu.top - statusBarHeight.value) * 2 + menu.height;
|
||
}
|
||
} catch (e) {}
|
||
|
||
/* ---------- 响应式数据(100% 真实接口驱动) ---------- */
|
||
const banners = ref([]);
|
||
const bannerIndex = ref(0);
|
||
const showBanners = ref(true);
|
||
const cats = ref([]);
|
||
const hotServices = ref([]);
|
||
const badge = ref({ coupon: 0, unread: 0 });
|
||
|
||
/* ---------- 核心品类金刚区:3 行 5 列展示 15 个标准类目(真实接口驱动) ---------- */
|
||
const displayCats = computed(() => {
|
||
return cats.value.slice(0, 15);
|
||
});
|
||
|
||
/* ---------- 真实类目图标(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 || [];
|
||
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 onMessage = () => {
|
||
if (!needLogin()) return;
|
||
emit('switch-tab', 2);
|
||
};
|
||
|
||
/* ---------- 商品抽屉联动 ---------- */
|
||
const showPickerDrawer = ref(false);
|
||
const activeDrawerCatId = ref(1);
|
||
const activeDrawerCatName = ref('家具');
|
||
|
||
const onCat = (c) => {
|
||
if (c.icon === 'more' || c.id === 'more' || c.name === '全部服务' || c.name === '更多') {
|
||
onMore();
|
||
return;
|
||
}
|
||
activeDrawerCatId.value = c.id;
|
||
activeDrawerCatName.value = c.name;
|
||
showPickerDrawer.value = true;
|
||
};
|
||
|
||
const onQuickChannel = (channelKey) => {
|
||
if (cats.value.length > 0) {
|
||
const target = cats.value[0];
|
||
activeDrawerCatId.value = target.id;
|
||
activeDrawerCatName.value = target.name;
|
||
showPickerDrawer.value = true;
|
||
} else {
|
||
uni.navigateTo({ url: '/pages/order/quick' });
|
||
}
|
||
};
|
||
|
||
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`
|
||
});
|
||
};
|
||
|
||
const onMore = () => uni.navigateTo({ url: '/pages/category/category' });
|
||
|
||
/* ---------- 热门爆款服务卡片点击 ---------- */
|
||
const onHotService = (item) => {
|
||
if (item && item.id) {
|
||
uni.navigateTo({ url: `/pages/service/detail?id=${item.id}` });
|
||
}
|
||
};
|
||
|
||
/* ---------- 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. 顶部 Header 整体渐变容器 (自然流,杜绝切层) ---------- */
|
||
.hero-header-wrap {
|
||
position: relative;
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
padding-left: 24rpx;
|
||
padding-right: 24rpx;
|
||
padding-bottom: 48rpx;
|
||
overflow: hidden;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 柔和顶部装饰光晕 */
|
||
.hero-glow {
|
||
position: absolute;
|
||
border-radius: 50%;
|
||
filter: blur(35rpx);
|
||
pointer-events: none;
|
||
}
|
||
.glow-1 {
|
||
width: 280rpx;
|
||
height: 280rpx;
|
||
top: -80rpx;
|
||
right: -30rpx;
|
||
background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
|
||
}
|
||
.glow-2 {
|
||
width: 200rpx;
|
||
height: 200rpx;
|
||
bottom: 10rpx;
|
||
left: -40rpx;
|
||
background: radial-gradient(circle, rgba(255, 230, 200, 0.20) 0%, rgba(255, 230, 200, 0) 70%);
|
||
}
|
||
|
||
/* TopBar 导航条 */
|
||
.navbar-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
position: relative;
|
||
z-index: 5;
|
||
}
|
||
.nav-loc {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 6rpx 16rpx;
|
||
background: rgba(255, 255, 255, 0.22);
|
||
border-radius: 28rpx;
|
||
border: 1rpx solid rgba(255, 255, 255, 0.35);
|
||
backdrop-filter: blur(8rpx);
|
||
}
|
||
.nav-loc-icon {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
}
|
||
.nav-loc-text {
|
||
font-size: 22rpx;
|
||
font-weight: 700;
|
||
color: #FFFFFF;
|
||
margin: 0 4rpx 0 6rpx;
|
||
}
|
||
.nav-loc-arrow {
|
||
width: 0;
|
||
height: 0;
|
||
border-left: 5rpx solid transparent;
|
||
border-right: 5rpx solid transparent;
|
||
border-top: 6rpx solid #FFFFFF;
|
||
}
|
||
|
||
/* 中间品牌名 */
|
||
.nav-brand {
|
||
position: absolute;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.brand-title {
|
||
font-size: 34rpx;
|
||
font-weight: 900;
|
||
color: #FFFFFF;
|
||
letter-spacing: 1.5rpx;
|
||
text-shadow: 0 2rpx 6rpx rgba(180, 50, 0, 0.2);
|
||
}
|
||
|
||
/* 右侧消息铃铛 */
|
||
.nav-msg-box {
|
||
position: relative;
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
border-radius: 30rpx;
|
||
background: rgba(255, 255, 255, 0.22);
|
||
border: 1rpx solid rgba(255, 255, 255, 0.35);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
backdrop-filter: blur(8rpx);
|
||
}
|
||
.nav-msg-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
}
|
||
.nav-msg-badge {
|
||
position: absolute;
|
||
top: 8rpx;
|
||
right: 8rpx;
|
||
width: 14rpx;
|
||
height: 14rpx;
|
||
border-radius: 50%;
|
||
background: #EF4444;
|
||
border: 2rpx solid #FFFFFF;
|
||
}
|
||
|
||
/* 白玉悬浮搜索坞 */
|
||
.search-dock-wrap {
|
||
margin-top: 18rpx;
|
||
position: relative;
|
||
z-index: 5;
|
||
}
|
||
.search-bar {
|
||
height: 80rpx;
|
||
background: #FFFFFF;
|
||
border-radius: 40rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 0 6rpx 0 24rpx;
|
||
box-shadow: 0 6rpx 20rpx rgba(180, 50, 0, 0.15);
|
||
box-sizing: border-box;
|
||
}
|
||
.search-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
.search-ph {
|
||
flex: 1;
|
||
margin-left: 14rpx;
|
||
font-size: 25rpx;
|
||
color: #9CA3AF;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.search-action-btn {
|
||
height: 66rpx;
|
||
padding: 0 30rpx;
|
||
border-radius: 33rpx;
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
box-shadow: 0 4rpx 10rpx rgba(234, 88, 12, 0.30);
|
||
}
|
||
.search-action-txt {
|
||
font-size: 25rpx;
|
||
font-weight: 700;
|
||
color: #FFFFFF;
|
||
letter-spacing: 1rpx;
|
||
}
|
||
|
||
/* 柔和底部白色弧形过渡条 (使金刚区白卡无缝自然衔接) */
|
||
.hero-bottom-curve {
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 24rpx;
|
||
background: #F5F6F8;
|
||
border-radius: 24rpx 24rpx 0 0;
|
||
}
|
||
|
||
/* ---------- 2. 主体内容容器 (负边距浮于弧形上方,无裁切) ---------- */
|
||
.main-body {
|
||
padding: 0 24rpx;
|
||
margin-top: -24rpx;
|
||
position: relative;
|
||
z-index: 10;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 金刚区 (纯白大卡,舒展极简,无多余彩色框框) */
|
||
.cats-card {
|
||
background: #FFFFFF;
|
||
border-radius: 24rpx;
|
||
padding: 24rpx 10rpx 12rpx;
|
||
box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.04);
|
||
border: 1rpx solid #F1F3F7;
|
||
margin-bottom: 22rpx;
|
||
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: 8rpx 0 14rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
.cat-icon-container {
|
||
width: 88rpx;
|
||
height: 88rpx;
|
||
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: 76rpx;
|
||
height: 76rpx;
|
||
}
|
||
.cat-cell-name {
|
||
margin-top: 8rpx;
|
||
font-size: 24rpx;
|
||
color: #1F2937;
|
||
font-weight: 600;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* ---------- 3. 自营专项四大保障通道 (2x2 网格) ---------- */
|
||
.quick-channels-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: 16rpx;
|
||
margin-bottom: 22rpx;
|
||
}
|
||
.channel-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
padding: 20rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.02);
|
||
border: 1rpx solid #F1F5F9;
|
||
box-sizing: border-box;
|
||
}
|
||
.channel-texts {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6rpx;
|
||
}
|
||
.channel-title {
|
||
font-size: 28rpx;
|
||
font-weight: 800;
|
||
color: #111827;
|
||
line-height: 1.2;
|
||
}
|
||
.channel-tag {
|
||
align-self: flex-start;
|
||
padding: 2rpx 10rpx;
|
||
border-radius: 6rpx;
|
||
font-size: 18rpx;
|
||
font-weight: 700;
|
||
}
|
||
.tag-orange {
|
||
background: #FFF7ED;
|
||
color: #EA580C;
|
||
}
|
||
.tag-blue {
|
||
background: #F0F9FF;
|
||
color: #0284C7;
|
||
}
|
||
.tag-purple {
|
||
background: #FAF5FF;
|
||
color: #7E22CE;
|
||
}
|
||
.tag-green {
|
||
background: #F0FDF4;
|
||
color: #15803D;
|
||
}
|
||
.channel-icon {
|
||
width: 58rpx;
|
||
height: 58rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* ---------- 4. 官方轮播 Banner ---------- */
|
||
.banner-section {
|
||
margin-bottom: 24rpx;
|
||
}
|
||
.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: 20rpx;
|
||
color: #4B5563;
|
||
margin-top: 2rpx;
|
||
}
|
||
.brand-foot {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.foot-desc {
|
||
font-size: 20rpx;
|
||
color: #6B7280;
|
||
}
|
||
.foot-date {
|
||
font-size: 18rpx;
|
||
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 {
|
||
padding: 2rpx 12rpx;
|
||
border-radius: 8rpx;
|
||
background: #EA580C;
|
||
color: #FFFFFF;
|
||
font-size: 18rpx;
|
||
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;
|
||
}
|
||
|
||
/* ---------- 5. 热门精选服务 (现代双列电商瀑布流卡片) ---------- */
|
||
.hot-section {
|
||
margin-bottom: 24rpx;
|
||
}
|
||
.section-title-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 16rpx;
|
||
padding: 0 4rpx;
|
||
}
|
||
.title-left {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.title-bar {
|
||
width: 8rpx;
|
||
height: 30rpx;
|
||
border-radius: 4rpx;
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
margin-right: 12rpx;
|
||
}
|
||
.title-main {
|
||
font-size: 32rpx;
|
||
font-weight: 900;
|
||
color: #111827;
|
||
}
|
||
.title-more {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.more-txt {
|
||
font-size: 24rpx;
|
||
color: #6B7280;
|
||
}
|
||
.more-arrow {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
margin-left: 4rpx;
|
||
opacity: 0.6;
|
||
}
|
||
|
||
/* 双列卡片网格 */
|
||
.hot-cards-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: 16rpx;
|
||
}
|
||
.hot-grid-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
overflow: hidden;
|
||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
|
||
border: 1rpx solid #EDF2F7;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-sizing: border-box;
|
||
}
|
||
.grid-card-media {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 160rpx;
|
||
background: linear-gradient(135deg, #FFF7ED 0%, #F8FAFC 100%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
.card-real-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
.card-badge {
|
||
position: absolute;
|
||
left: 12rpx;
|
||
top: 12rpx;
|
||
padding: 2rpx 10rpx;
|
||
border-radius: 6rpx;
|
||
background: rgba(17, 24, 39, 0.65);
|
||
color: #FFFFFF;
|
||
font-size: 18rpx;
|
||
font-weight: 700;
|
||
backdrop-filter: blur(4rpx);
|
||
}
|
||
|
||
.grid-card-content {
|
||
padding: 16rpx 16rpx 18rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex: 1;
|
||
justify-content: space-between;
|
||
}
|
||
.grid-card-title {
|
||
font-size: 27rpx;
|
||
font-weight: 800;
|
||
color: #111827;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
margin-bottom: 14rpx;
|
||
}
|
||
|
||
.grid-price-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.grid-price-wrap {
|
||
display: flex;
|
||
align-items: baseline;
|
||
}
|
||
.grid-price-symbol {
|
||
font-size: 22rpx;
|
||
font-weight: 800;
|
||
color: #EA580C;
|
||
}
|
||
.grid-price-num {
|
||
font-size: 34rpx;
|
||
font-weight: 900;
|
||
color: #EA580C;
|
||
margin-left: 2rpx;
|
||
}
|
||
.grid-price-unit {
|
||
font-size: 20rpx;
|
||
color: #9CA3AF;
|
||
margin-left: 4rpx;
|
||
}
|
||
.grid-book-btn {
|
||
padding: 8rpx 20rpx;
|
||
border-radius: 20rpx;
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
box-shadow: 0 4rpx 10rpx rgba(234, 88, 12, 0.30);
|
||
}
|
||
.grid-book-txt {
|
||
font-size: 22rpx;
|
||
font-weight: 700;
|
||
color: #FFFFFF;
|
||
}
|
||
|
||
/* ---------- 底部呼吸留白 ---------- */
|
||
.page-bottom-space {
|
||
height: 36rpx;
|
||
}
|
||
|
||
.clickable-hover:active {
|
||
opacity: 0.85;
|
||
transform: scale(0.98);
|
||
}
|
||
</style>
|