feat:首页按设计稿改版 + 新增「查询我的中奖结果」半屏弹层

- 首页重构:KV 头图/金刚区/可领权益包/折扣商户分类宫格,暖米底色与切图规范统一
- 查询弹层 hhrs-winner-sheet:登录→资格→证件两段式查询,六态文案与 CTA;未中奖引导看权益包明细(参加指南内容待运营)
- 底部导航改自定义组件单条呈现,移除 pages.json 原生 tabBar(H5 下双导航叠加问题);我的页换肤对齐首页主色
- 修复内容不足一屏时露 html 白底(html 兜底色 + 我的页撑满屏高);App.vue 修复微信 WebView 导航栏高度误报
- 删除原生 tabBar 遗留的 4 张旧图标,新增 12 张 hhrs2_ 切图

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-10-23 11:04:52 +08:00
co-authored by Claude Fable 5
parent b94d0a4486
commit 6747501963
23 changed files with 610 additions and 128 deletions
+221 -102
View File
@@ -1,57 +1,85 @@
<template>
<!-- xuchao: 2026-10 首页按 UI 设计稿改版 —— 底部双 Tab 为自定义组件(切图含文字),页面留 tabbar 高度的底衬 -->
<view class="page">
<!-- 顶部 Banner -->
<view class="banner">
<image class="banner-img" src="https://aliyunoss.hn12301.net/hhrs/hhrs_header.png" mode="widthFix"></image>
<!-- 顶部头图(整张烘焙切图) -->
<image class="hero" src="/static/hhrs2_hero.png" mode="widthFix"></image>
<!-- 金刚区:图标文字已烘焙进切图,不再代码渲染文字 -->
<view class="kong">
<image class="kong-item" src="/static/hhrs2_kong_venue.png" mode="aspectFit" @click="goPage('/pages/venue/venue')"></image>
<image class="kong-item" src="/static/hhrs2_kong_shop.png" mode="aspectFit" @click="goPage('/pages/discount/discount')"></image>
<image class="kong-item" src="/static/hhrs2_kong_rights.png" mode="aspectFit" @click="goRights()"></image>
<image class="kong-item" src="/static/hhrs2_kong_winner.png" mode="aspectFit" @click="goPage('/pages/winners/winners')"></image>
</view>
<!-- 金刚区 -->
<view class="king-area">
<view class="king-item" v-for="(item, index) in kingList" :key="index" @click="item.isRights ? goRights() : goPage(item.url)">
<image class="king-icon" :src="item.icon" mode="widthFix"></image>
<text class="king-text">{{ item.text }}</text>
<!-- 可领权益包 -->
<view class="card">
<view class="card-head">
<view class="head-left">
<view class="bar"></view>
<text class="head-title">可领权益包</text>
</view>
<text class="head-right">数量有限 先到先得</text>
</view>
<text class="pack-sub">本期已产生10,000份千元权益包·实时公证开奖</text>
<!-- 查询按钮整图切图(含渐变底/礼盒图标/文案),点击打开中奖查询半屏弹层 -->
<image class="btn-query" src="/static/hhrs2_btn_query.png" mode="widthFix" @click="openQuery()"></image>
<!-- 指南轮播:两张图 3 秒自动轮播,图片下方指示点标当前张 -->
<swiper class="guides" :autoplay="true" :interval="3000" :duration="400" circular
indicator-dots indicator-color="rgba(232,84,47,0.25)" indicator-active-color="#E8542F">
<swiper-item @click="goPage('/pages/guide/join')">
<image class="guide-img" src="/static/hhrs2_guide_join.png" mode="aspectFill"></image>
</swiper-item>
<swiper-item @click="goPage('/pages/guide/use')">
<image class="guide-img" src="/static/hhrs2_guide_use.png" mode="aspectFill"></image>
</swiper-item>
</swiper>
</view>
<!-- 活动指南 -->
<view class="guide-section">
<view class="section-title">
<view class="title-line"></view>
<text class="title-text">活动指南</text>
<!-- 怀化社保卡折扣商户:按后台分类取前 4 类,每类前 8 家(2 行 4 列),logo 用商铺 image 字段 -->
<view class="card">
<view class="card-head">
<view class="head-left">
<view class="bar"></view>
<text class="head-title">怀化社保卡折扣商户</text>
</view>
<view class="head-link" @click="goPage('/pages/discount/discount')">
<text>查看全部商户</text>
<view class="chev"></view>
</view>
</view>
<!-- xuchao: 图内已带标题/副标题/官方指南角标,不再叠加文字层,只保留图片 -->
<view class="guide-list">
<view class="guide-card" v-for="(item, index) in guideList" :key="index" @click="goPage(item.url)">
<image class="guide-bg" :src="item.bg" mode="scaleToFill"></image>
<view class="cat" v-for="grp in storeGroups" :key="grp.name">
<view class="cat-head">
<view class="bar bar-sm"></view>
<text class="cat-name">{{ grp.name }}</text>
</view>
<view class="mer-row">
<view class="mer-item" v-for="s in grp.stores" :key="s.shopId" @click="goStore(s)">
<image class="mer-logo" :src="s.image" mode="aspectFill"></image>
<text class="mer-name">{{ s.name }}</text>
</view>
</view>
</view>
</view>
<hhrs-tabbar current="home"></hhrs-tabbar>
<!-- xuchao: 「查询我的中奖结果」半屏弹层 -->
<hhrs-winner-sheet :visible="queryVisible" @close="queryVisible = false"></hhrs-winner-sheet>
</view>
</template>
<script>
import account from '@/common/account.js'
import HhrsTabbar from '@/components/hhrs-tabbar/hhrs-tabbar.vue'
import HhrsWinnerSheet from '@/components/hhrs-winner-sheet/hhrs-winner-sheet.vue'
export default {
components: { HhrsTabbar, HhrsWinnerSheet },
data() {
return {
kingList: [
{ icon: 'https://aliyunoss.hn12301.net/hhrs/hhrs_wlcg.png', text: '文旅场馆', url: '/pages/venue/venue' },
{ icon: 'https://aliyunoss.hn12301.net/hhrs/hhrs_shzk.png', text: '商户折扣', url: '/pages/discount/discount' },
{ icon: 'https://aliyunoss.hn12301.net/hhrs/hhrs_qyb.png', text: '权益包', url: '/pages/rights/rights', isRights: true },
{ icon: 'https://aliyunoss.hn12301.net/hhrs/hhrs_zjmd.png', text: '中奖名单', url: '/pages/winners/winners' }
],
guideList: [
{
// xuchao: ?v= 为图片版本参数,运营换图必须同步更新日期,否则各平台 WebView/CDN 会继续命中旧缓存
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_cjzn.png?v=20260928',
url: '/pages/guide/join'
},
{
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_syzn.png?v=20260928',
url: '/pages/guide/use'
}
],
storeGroups: [],
queryVisible: false,
// xuchao: 云闪付免密登录是否仍在进行中 —— 返回前不放行任何依赖身份的跳转
tokenLoginPending: false,
tokenLoginTimer: null
@@ -62,13 +90,32 @@
if (options.token) {
this.handleTokenLogin(options.token)
}
// xuchao: 登录页 redirect=query 回跳时自动弹出中奖查询层
if (options.openQuery) {
this.queryVisible = true
}
this.getLocation()
this.loadStores()
},
// xuchao: 离开首页时收尾,避免看门狗与遮罩残留
onUnload() {
this.finishTokenLogin()
},
methods: {
// xuchao: 首页商户板块按分类面板数量降序取前 4 类,每类取列表里前 8 家(2 行 4 列),与设计稿分组宫格一致
loadStores() {
this.$u.api.getStoreList({ pageNo: 1, pageSize: 60, typeId: 2 }).then(res => {
if (res.errcode !== 0 || !res.data) return
const cats = (res.data.categories || []).filter(c => c.value).slice(0, 4)
const list = res.data.list || []
this.storeGroups = cats.map(c => {
const matched = list.filter(s => s.category === c.value)
// xuchao: 每行 4 个,截成整行数(最少 1 行、最多 2 行),避免最后半行残缺
const rows = Math.max(1, Math.min(2, Math.floor(matched.length / 4)))
return { name: c.value, stores: matched.slice(0, rows * 4) }
}).filter(g => g.stores.length)
})
},
// xuchao: 云闪付入口 token 自动登录(免密换人)
handleTokenLogin(token) {
// xuchao: 云闪付入口是"免密换人",本机上一个账号的会话与权益缓存必须先丢弃:
@@ -150,6 +197,23 @@
goPage(url) {
uni.navigateTo({ url })
},
// xuchao: 「查询我的中奖结果」入口:免密登录中不放行,未登录先去登录并回跳,否则开弹层
openQuery() {
if (this.tokenLoginPending) {
uni.showToast({ title: '正在登录,请稍候', icon: 'none' })
return
}
const phone = uni.getStorageSync('phone')
if (!phone) {
uni.navigateTo({ url: '/pages/index/login?redirect=query' })
return
}
this.queryVisible = true
},
goStore(s) {
// xuchao: 与商户折扣页同款跳转,type=2 标记商户折扣入口
uni.navigateTo({ url: '/pages/venue/detail?id=' + s.shopId + '&type=2' })
},
goRights() {
// xuchao: 免密登录还没返回时不放行,避免带着空/旧身份进权益页
if (this.tokenLoginPending) {
@@ -176,106 +240,161 @@
</script>
<style>
/* xuchao: 原 page/.page 固定 100vh + overflow:hidden,小屏下活动指南第二张卡片会被裁掉且无法滚动;
改为 min-height 撑满、超出可滚动,视觉在正常屏上保持不变 */
/* xuchao: 改版后首页底色取设计稿暖米色;底部为自定义 tabbar(128rpx+安全区)留底衬 */
.page {
min-height: 100vh;
background-color: #f5f5f5;
display: flex;
flex-direction: column;
background-color: #FDECE2;
padding-bottom: calc(156rpx + env(safe-area-inset-bottom));
}
.banner {
width: 100%;
max-height: 300px;
overflow: hidden;
}
.banner-img {
.hero {
width: 100%;
display: block;
}
/* 金刚区 */
.king-area {
width: 100%;
/* 金刚区(整图切图 110rpx,含文字);与卡1间距由 80 减半为 40(16+卡 margin-top 24) */
.kong {
display: flex;
justify-content: space-around;
align-items: center;
padding: 10rpx 0 16rpx;
}
.kong-item {
width: 110rpx;
height: 110rpx;
}
/* 白卡通用(设计稿实测:外边距 29、左右内边距 17,内容宽 658 与切图基准一致) */
.card {
background: #FFFFFF;
border-radius: 28rpx;
margin: 24rpx 29rpx 0;
padding: 24rpx 17rpx;
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
align-items: flex-start;
background-color: #ffffff;
padding: 24rpx;
box-sizing: border-box;
}
.king-item {
width: 25%;
.head-left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.king-icon {
width: 100rpx;
height: 132rpx;
margin-bottom: 12rpx;
.bar {
width: 8rpx;
height: 34rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #F6613C, #E01818);
margin-right: 14rpx;
}
.king-text {
font-size: 24rpx;
.head-title {
font-size: 34rpx;
font-weight: bold;
color: #333333;
text-align: center;
}
/* 活动指南 */
.guide-section {
flex: 1;
background-color: #ffffff;
margin-top: 10rpx;
display: flex;
flex-direction: column;
.head-right {
font-size: 24rpx;
color: #BCAB9A;
}
.section-title {
.head-link {
display: flex;
align-items: center;
margin-bottom: 20rpx;
padding: 24rpx 20rpx 0 24px;
font-size: 26rpx;
font-weight: 600;
color: #E0342B;
}
.chev {
width: 12rpx;
height: 12rpx;
border-top: 3rpx solid #E0342B;
border-right: 3rpx solid #E0342B;
transform: rotate(45deg);
margin-left: 8rpx;
}
.title-line {
/* 可领权益包(切图 @1500 基准,显示 px÷2:按钮 658×102、指南卡 571×141) */
.pack-sub {
display: block;
margin-top: 22rpx;
font-size: 26rpx;
color: #E05A38;
}
.btn-query {
display: block;
width: 100%;
margin-top: 26rpx;
}
/* xuchao: 指南轮播 swiper —— 图 648x200(切图 1297x400÷2),指示点浮于图片内侧 */
.guides {
margin-top: 26rpx;
height: 200rpx;
}
/* xuchao: uni-app H5 把页面样式编成 scoped,swiper 内部元素无 data-v 属性,必须 /deep/ 穿透;
容器高=图高时 bottom 即点距图底距离,3px ≈ 原默认位置(压出图外3px)上移 6px 且完全在图内 */
.guides /deep/ .uni-swiper-dots-horizontal {
bottom: 3px !important;
}
.guide-img {
display: block;
width: 648rpx;
height: 200rpx;
border-radius: 24rpx;
margin: 0 auto;
}
/* 折扣商户 */
.cat {
margin-top: 28rpx;
}
.cat-head {
display: flex;
align-items: center;
}
.bar-sm {
width: 6rpx;
height: 32rpx;
background-color: #1890ff;
height: 26rpx;
border-radius: 3rpx;
margin-right: 12rpx;
/* xuchao: 折扣商户二级标题标记色,按 UI 要求统一琥珀金 */
background: #E79A30;
}
.title-text {
font-size: 14px;
font-weight: 600;
.cat-name {
font-size: 30rpx;
font-weight: bold;
color: #333333;
}
.guide-list {
.mer-row {
display: flex;
flex-wrap: wrap;
margin-top: 24rpx;
}
.mer-item {
width: 25%;
box-sizing: border-box;
padding: 0 8rpx;
display: flex;
flex-direction: column;
gap: 12px;
padding: 0 20rpx 30rpx;
align-items: center;
margin-bottom: 30rpx;
}
.guide-card {
width: 100%;
height: 252rpx;
.mer-logo {
width: 96rpx;
height: 96rpx;
border-radius: 16rpx;
background: #F5F5F5;
}
.mer-name {
width: 100%;
text-align: center;
font-size: 22rpx;
color: #4A3A2E;
margin-top: 12rpx;
line-height: 30rpx;
height: 60rpx;
/* xuchao: 设计稿店名可折两行,固定两行高度保证宫格对齐 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.guide-bg {
width: 100%;
height: 252rpx;
border-radius: 16rpx;
}
</style>
+4 -1
View File
@@ -139,7 +139,10 @@ export default {
uni.setStorageSync('expiresTime', eRes.data.expiresTime)
}
}).finally(() => {
if (this.redirect === 'rights') {
if (this.redirect === 'query') {
// xuchao: 首页「查询中奖结果」发起的登录 —— 回首页自动弹查询层(openQuery 由首页 onLoad 消费)
uni.reLaunch({ url: '/pages/index/index?openQuery=1' })
} else if (this.redirect === 'rights') {
const isAuth = uni.getStorageSync('isAuth')
const hasWin = uni.getStorageSync('hasWin')
let status = 'auth'
+18 -5
View File
@@ -38,14 +38,18 @@
</view>
</view>
<!-- xuchao: 首页改版后 我的 页复用同一自定义底部导航 -->
<hhrs-tabbar current="mine"></hhrs-tabbar>
</view>
</template>
<script>
import config from '@/common/config.js'
import account from '@/common/account.js'
import HhrsTabbar from '@/components/hhrs-tabbar/hhrs-tabbar.vue'
export default {
components: { HhrsTabbar },
data() {
return {
isLogin: false,
@@ -101,19 +105,20 @@ export default {
}
</script>
<style>
/* xuchao: 配色与改版后首页统一 —— 暖米底 + 品牌红橙头 */
page {
background-color: #f2f2f7;
background-color: #FDECE2;
}
</style>
<style>
/* 用户信息 */
/* 用户信息(xuchao: 头区渐变改品牌红→页面米色,与首页 KV 同色系) */
.user-section {
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(to bottom, #0066cc, #f2f2f7);
background: linear-gradient(180deg, #E8542F 0%, #F5B98E 55%, #FDECE2 100%);
padding: 40px 16px 130px;
}
@@ -162,11 +167,11 @@ export default {
border-radius: 4px;
}
/* 菜单列表 */
/* 菜单列表(xuchao: 圆角与首页卡片同规格 28rpx) */
.menu-list {
margin: -88px 12px 0;
background-color: #ffffff;
border-radius: 8px;
border-radius: 14px;
}
.menu-item {
@@ -193,5 +198,13 @@ export default {
margin-left: 12px;
}
/* xuchao: 底部固定导航遮挡留白;.page 必须撑满屏高并自带底色 —— 之前底色只挂在 body 上、
高度等于内容高度,内容短时下方露出 html 白底,在 TabBar 上方形成一条白带两条缝 */
.page {
min-height: 100vh;
background-color: #FDECE2;
padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
</style>