Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3049b2a1b9 | ||
|
|
59dfd5897c | ||
|
|
5777fbf9ea | ||
|
|
69a42cd6fc | ||
|
|
d1e87498f5 | ||
|
|
9f13a21263 | ||
|
|
6747501963 | ||
|
|
b94d0a4486 | ||
|
|
8ec4ef304f | ||
|
|
f6c282237d | ||
|
|
e821203c54 | ||
|
|
adbd52a2c5 | ||
|
|
b48c8e1e55 | ||
|
|
9276bd6140 | ||
|
|
748c4563fd | ||
|
|
2a6b86977c | ||
|
|
044b26d035 | ||
|
|
b6bbb0b219 | ||
|
|
8b3ac20e34 | ||
|
|
eb01701709 | ||
|
|
eeb6b91e0a | ||
|
|
381e609001 | ||
|
|
41a380562a | ||
|
|
476cb64ee2 |
@@ -24,6 +24,12 @@
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* xuchao: html 层兜底暖米底色 —— 内容不足一屏的页面(如 我的)在固定导航上方
|
||||
不会露出默认白底形成白带;有自己底色的页面不受影响 */
|
||||
html {
|
||||
background-color: #FDECE2;
|
||||
}
|
||||
|
||||
/* xuchao: 修复默认导航栏在微信 WebView 内顶部超宽空白(参加/使用指南、协议等页)——
|
||||
uni-app 内置 H5 导航栏高度为 calc(44px + env(safe-area-inset-top)),页面模板带
|
||||
viewport-fit=cover 时,部分 Android 微信 WebView 会误报状态栏高度(而 H5 视口本
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// xuchao: 账号级本地缓存集中管理。权益页首屏会读这些缓存做兜底展示,
|
||||
// 换账号/退出时漏清就会把上一个账号的中奖状态、卡号、到期时间当成当前账号的数据展示。
|
||||
// xuchao: loginWay 记录登录方式(ysf=云闪付免密 / sms=手机验证码)——付款码仅对免密登录开放,
|
||||
// 换账号/退出后必须清掉,否则会把上个账号的免密状态带给新账号
|
||||
const ACCOUNT_KEYS = ['token', 'phone', 'isAuth', 'hasWin', 'cardNumber', 'expiresTime',
|
||||
'rightsCount', 'totalValueFen', 'authFlowStarted', 'authName', 'authIdNo']
|
||||
'rightsCount', 'totalValueFen', 'authFlowStarted', 'authName', 'authIdNo', 'loginWay']
|
||||
|
||||
export default {
|
||||
// 清空当前账号的本地会话与权益缓存(定位 lng/lat 属于设备信息,不在此列)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// xuchao: 卡片角标用的区县简称。后端 districtName 返回的是 region.name 行政区划全称
|
||||
// (如「芷江侗族自治县」「怀化高新技术产业开发区」),列表缩略图只有 75px,必须缩短显示
|
||||
export function shortDistrict(name) {
|
||||
if (!name) return ''
|
||||
return name
|
||||
.replace('高新技术产业开发区', '高新区')
|
||||
.replace(/(苗族|侗族|瑶族|回族|土家族|各族)*自治县$/, '')
|
||||
.replace(/(苗族|侗族|瑶族|回族|土家族|各族)*自治州$/, '')
|
||||
.replace(/([^市])县$/, '$1')
|
||||
}
|
||||
@@ -12,6 +12,8 @@ const StoreDetailUrl = 'mp-api/hhrsStore/detail'
|
||||
const RightsListUrl = 'mp-api/hhrsRights/list'
|
||||
const RightsDetailUrl = 'mp-api/hhrsRights/detail'
|
||||
const EligibilityUrl = 'mp-api/hhrsRights/eligibility'
|
||||
// xuchao: 认证前资格预检(按 card_bind 卡关联判断,未关联拦截人脸核验,省认证费)
|
||||
const WinnerCheckUrl = 'mp-api/hhrsRights/checkWinner'
|
||||
const AppointmentListUrl = 'mp-api/hhrsRights/appointment/list'
|
||||
const CheckListUrl = 'mp-api/hhrsRights/check/list'
|
||||
// 实名人脸认证(阿里云)
|
||||
@@ -45,6 +47,8 @@ const install = (Vue, vm) => {
|
||||
const getRightsDetail = (params = {}) => vm.$u.post(RightsDetailUrl, params)
|
||||
// xuchao: 注意 identityNo 会触发后端“被动认证”回写,仅在认证流程中传
|
||||
const getEligibility = (params = {}) => vm.$u.post(EligibilityUrl, params)
|
||||
// xuchao: 发起人脸前查证件号是否关联本活动权益卡(card_bind),返回 data.isWinner
|
||||
const checkWinner = (params = {}) => vm.$u.post(WinnerCheckUrl, params)
|
||||
const getAppointmentList = (params = {}) => vm.$u.post(AppointmentListUrl, params)
|
||||
const getCheckList = (params = {}) => vm.$u.post(CheckListUrl, params)
|
||||
const doAppoint = (params = {}) => vm.$u.post(AppointUrl, params)
|
||||
@@ -72,6 +76,7 @@ const install = (Vue, vm) => {
|
||||
getRightsList,
|
||||
getRightsDetail,
|
||||
getEligibility,
|
||||
checkWinner,
|
||||
getAppointmentList,
|
||||
getCheckList,
|
||||
doAppoint,
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// xuchao: 怀化石油汽油减免券——前端常量与工具(全写死,只服务这一个门店,决策 1/10/15)
|
||||
// 价格真相在后端常量(20000 分),此处 200.00 仅展示用,两处改价必须同步
|
||||
// 价格真相=后端配置 hh.voucher.price-fen 经 latest 下发;此处 200.00 仅为接口未返回时的展示兜底
|
||||
|
||||
export const PETROL_SHOP_ID = '851219003520709'
|
||||
export const VOUCHER_PRICE_TEXT = '200.00'
|
||||
// xuchao: 非云闪付环境豁免拦截的联调手机号(决策 13)
|
||||
export const VOUCHER_PAY_WHITELIST_PHONE = '18684839400'
|
||||
|
||||
export const VOUCHER_NAME = '怀化石油汽油电子券'
|
||||
|
||||
export const VOUCHER_GUIDE_TEXT = '请在「云闪付 App」里的「湖南社保卡」小程序首页进入「怀化社保卡」活动中完成购买'
|
||||
export const VOUCHER_CANCEL_TEXT = '支付已取消,请重新支付'
|
||||
|
||||
// 券详情页「使用规则 / 使用流程 / 重要须知」文案,来自石油侧材料(决策 14)
|
||||
export const VOUCHER_USE_RULES = [
|
||||
@@ -35,12 +34,6 @@ export function injectUpSdk() {
|
||||
document.head.appendChild(s)
|
||||
}
|
||||
|
||||
// xuchao: 云闪付容器判定只看 UA——不能掺 window.upsdk 是否已加载(SDK 是异步注入的,
|
||||
// 首屏点击时可能还没 load 完,会把云闪付内首点误判为站外)。UA 关键字真机实测后定稿。
|
||||
export function isUnionPayApp() {
|
||||
if (typeof navigator === 'undefined' || !navigator.userAgent) return false
|
||||
return /unionpay|upsdk|云闪付/i.test(navigator.userAgent)
|
||||
}
|
||||
|
||||
// xuchao: open-api/hhService/voucher/* 为双层壳:外层 errcode,内层 data.code 才是业务码
|
||||
// (同 login.vue 的 isBizOk 判定,提到公共层复用)
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<!-- xuchao: 列表页「所属县区 + 所属类型」筛选条。两个入口等宽平分并占满容器宽,无底色,
|
||||
选中态只用品牌蓝字表达;面板第一行「全部 X」即清空该维度(所以没有独立重置按钮)。
|
||||
选项与各选项条数由列表接口在响应里一并返回,已按关键词与另一维度筛算好(districts/categories 首项即「全部」)。 -->
|
||||
<view class="hfb" v-if="ready">
|
||||
<view class="hfb-row">
|
||||
<view class="hfb-item" v-if="districtReady" :class="{ 'hfb-item--on': !!districtId }" @click="toggle('district')">
|
||||
<text class="hfb-text">{{ districtText }}</text>
|
||||
<view class="hfb-caret" :class="{ 'hfb-caret--up': openKey === 'district' }">
|
||||
<u-icon name="arrow-down-fill" size="20" :color="districtId ? '#E0342B' : '#bbbbbb'"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hfb-item" v-if="categoryReady" :class="{ 'hfb-item--on': !!category }" @click="toggle('category')">
|
||||
<text class="hfb-text">{{ categoryText }}</text>
|
||||
<view class="hfb-caret" :class="{ 'hfb-caret--up': openKey === 'category' }">
|
||||
<u-icon name="arrow-down-fill" size="20" :color="category ? '#E0342B' : '#bbbbbb'"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="hfb-mask" v-if="openKey" @click="close"></view>
|
||||
<view class="hfb-panel" v-if="openKey">
|
||||
<scroll-view scroll-y class="hfb-list">
|
||||
<view class="hfb-opt" v-for="o in openOptions" :key="o.value"
|
||||
:class="{ 'hfb-opt--sel': current === o.value }" @click="pick(o.value)">
|
||||
<text class="hfb-opt-label">{{ o.label }}</text>
|
||||
<text class="hfb-opt-count">{{ o.count }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'hhrs-filter-bar',
|
||||
props: {
|
||||
// xuchao: [{value,label,count}],首项为「全部 X」(value=''),县区 value 是行政区划码
|
||||
districts: { type: Array, default: () => [] },
|
||||
categories: { type: Array, default: () => [] },
|
||||
districtId: { type: String, default: '' },
|
||||
category: { type: String, default: '' }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openKey: '',
|
||||
// xuchao: 记住见过的 value→label,避免关键词把选中项挤出选项列表后入口只能显示区划码
|
||||
labelCache: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// xuchao: 选项首项固定是「全部」,长度>1 才算该维度真有可选项。
|
||||
// 某维度没有可选项(如商铺未录入「所在地区」)时只隐藏它自己的入口,
|
||||
// 两个都没有则整条筛选不渲染,避免出现点开是空面板
|
||||
districtReady() { return this.districts.length > 1 },
|
||||
categoryReady() { return this.categories.length > 1 },
|
||||
ready() { return this.districtReady || this.categoryReady },
|
||||
openOptions() {
|
||||
return this.openKey === 'district' ? this.districts : this.categories
|
||||
},
|
||||
current() {
|
||||
return this.openKey === 'district' ? this.districtId : this.category
|
||||
},
|
||||
districtText() {
|
||||
return this.districtId ? this.cachedLabel('district', this.districtId) : '所属县区'
|
||||
},
|
||||
categoryText() {
|
||||
return this.category ? this.cachedLabel('category', this.category) : '所属类型'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
districts(list) { this.remember(list, 'district') },
|
||||
categories(list) { this.remember(list, 'category') }
|
||||
},
|
||||
created() {
|
||||
this.remember(this.districts, 'district')
|
||||
this.remember(this.categories, 'category')
|
||||
},
|
||||
methods: {
|
||||
remember(list, kind) {
|
||||
// xuchao: 必须用 $set,Vue2 对新增对象键不做响应,入口文字会跟不上缓存
|
||||
(list || []).forEach(o => {
|
||||
if (o.value) this.$set(this.labelCache, kind + ':' + o.value, o.label)
|
||||
})
|
||||
},
|
||||
cachedLabel(kind, value) {
|
||||
return this.labelCache[kind + ':' + value] || value
|
||||
},
|
||||
toggle(key) {
|
||||
// xuchao: 再点同一个入口即收起,避免面板卡在打开态
|
||||
this.openKey = this.openKey === key ? '' : key
|
||||
},
|
||||
close() {
|
||||
this.openKey = ''
|
||||
},
|
||||
pick(value) {
|
||||
if (this.openKey === 'district') {
|
||||
this.$emit('change', { districtId: value, category: this.category })
|
||||
} else {
|
||||
this.$emit('change', { districtId: this.districtId, category: value })
|
||||
}
|
||||
this.openKey = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
/* xuchao: 根节点贴在 sticky 头部内,面板绝对定位到筛选条下方。
|
||||
只留上内边距:与列表的 12px 间隔必须落在头部的白底之外(各页 .list-area 的 padding-top),
|
||||
放在这里会是白色,头部白底和白色卡片连成一片,看上去就等于没有间隔 */
|
||||
.hfb {
|
||||
position: relative;
|
||||
padding: 24rpx 0 0;
|
||||
}
|
||||
|
||||
.hfb-row {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.hfb-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hfb-item--on {
|
||||
color: #E0342B;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.hfb-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hfb-caret {
|
||||
display: flex;
|
||||
transition: transform 0.18s;
|
||||
}
|
||||
|
||||
.hfb-caret--up {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* xuchao: 遮罩绝对定位在筛选条下方(不用 fixed)—— fixed 会盖进 sticky 头部的层叠上下文,
|
||||
把搜索栏和筛选条一起压灰。这里从筛选条下边缘开始向下铺满一屏,列表变暗、头部保持原色 */
|
||||
.hfb-mask {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: -12px;
|
||||
right: -12px;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
z-index: 90;
|
||||
}
|
||||
|
||||
/* xuchao: 面板左右各超出 12px(与页面头部的 12px 内边距等值,用 px 才能在各屏宽下都对齐),
|
||||
使面板与手机边缘齐平 */
|
||||
.hfb-panel {
|
||||
position: absolute;
|
||||
left: -12px;
|
||||
right: -12px;
|
||||
top: 100%;
|
||||
z-index: 100;
|
||||
background: #ffffff;
|
||||
border-radius: 0 0 28rpx 28rpx;
|
||||
box-shadow: 0 20rpx 48rpx rgba(0, 0, 0, 0.12);
|
||||
padding: 12rpx 12rpx 16rpx;
|
||||
}
|
||||
|
||||
.hfb-list {
|
||||
max-height: 620rpx;
|
||||
}
|
||||
|
||||
.hfb-opt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 84rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hfb-opt--sel {
|
||||
background: #e6f2ff;
|
||||
color: #E0342B;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.hfb-opt-label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.hfb-opt-count {
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
color: #bbbbbb;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<!-- xuchao: 首页改版自定义底部导航 —— tab 切图含图标+文字(原生 tabBar 会再叠一层文字),
|
||||
仅在 活动首页/我的 两页复用,reLaunch 模拟 tab 切换语义 -->
|
||||
<view class="tabbar">
|
||||
<view class="tab" @click="go('home')">
|
||||
<image class="tab-ico" :src="current === 'home' ? '/static/hhrs2_tab_home_on.png' : '/static/hhrs2_tab_home_off.png'" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="tab" @click="go('mine')">
|
||||
<image class="tab-ico" :src="current === 'mine' ? '/static/hhrs2_tab_mine_on.png' : '/static/hhrs2_tab_mine_off.png'" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HhrsTabbar',
|
||||
props: {
|
||||
// xuchao: 当前高亮 tab,home | mine
|
||||
current: { type: String, default: 'home' }
|
||||
},
|
||||
methods: {
|
||||
go(tab) {
|
||||
if (tab === this.current) return
|
||||
const url = tab === 'home' ? '/pages/index/index' : '/pages/mine/mine'
|
||||
uni.reLaunch({ url })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* xuchao: 条高 128、图标 80 —— 上下各留 24rpx 等距边(tab 切图内容本身贴画布边缘,
|
||||
必须靠容器留白撑出呼吸空间);iPhone 底部安全区由 padding-bottom 追加,不影响内容区等距 */
|
||||
.tabbar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
height: 128rpx;
|
||||
background: #FFFFFF;
|
||||
border-top: 1px solid #F3E5D8;
|
||||
display: flex;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.tab {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.tab-ico {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<!-- xuchao: 「查询我的中奖结果」半屏弹层。链路:
|
||||
打开 → getEligibility(phone):已认证直接出结果;未认证 → 输入证件号 →
|
||||
getWinnerDates 判期次(空=暂无已开奖记录)→ checkWinner(identityNo) 出中奖/未中奖。
|
||||
证件号仅内存使用不落缓存;CTA 跳转后自关。 -->
|
||||
<view class="qsm-mask" v-if="visible" @click="close">
|
||||
<view class="qsm-sheet" @click.stop>
|
||||
<view class="qsm-head">
|
||||
<text class="qsm-title">查询我的中奖结果</text>
|
||||
<view class="qsm-close" @click="close">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2 2l10 10M12 2L2 12" stroke="#9A8574" stroke-width="2" stroke-linecap="round"/></svg>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加载中 -->
|
||||
<view class="qsm-state" v-if="phase === 'loading'">
|
||||
<view class="qsm-spin"></view>
|
||||
<text class="qsm-state-t">正在查询…</text>
|
||||
</view>
|
||||
|
||||
<!-- 未认证:输入证件号 -->
|
||||
<view v-else-if="phase === 'input'">
|
||||
<text class="qsm-desc">为保障权益发放安全,请填写办卡登记的身份证号码进行核验</text>
|
||||
<input class="qsm-input" v-model="idNo" type="idcard" maxlength="18" placeholder="请输入 18 位身份证号码" placeholder-class="qsm-ph" />
|
||||
<text class="qsm-privacy">证件号码仅用于核对中奖名单,不会保存</text>
|
||||
<view class="qsm-btn" :class="{ dis: querying }" @click="query">
|
||||
{{ querying ? '查询中…' : '立即查询' }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结果:已开奖期数内查无此证件(未认证查询 / 已认证未中奖共用) -->
|
||||
<view class="qsm-state" v-else-if="phase === 'lost'">
|
||||
<view class="qsm-ico gray"><svg width="20" height="20" viewBox="0 0 20 20"><path d="M6 6l8 8M14 6l-8 8" stroke="#fff" stroke-width="2.2" stroke-linecap="round"/></svg></view>
|
||||
<text class="qsm-state-t">很遗憾,本期未中奖</text>
|
||||
<text class="qsm-state-s">持社保卡在合作商户消费,下期自动获得抽奖资格</text>
|
||||
<!-- xuchao: 主 CTA 跳权益包明细长图(有内容);参加指南页内容运营整理中,暂不引导(2026-10-23 定) -->
|
||||
<view class="qsm-btn" @click="nav('/pages/rights/rights?status=noWin')">看看权益包</view>
|
||||
<view class="qsm-btn-line">
|
||||
<text class="qsm-link" @click="nav('/pages/winners/winners')">中奖名单公示</text>
|
||||
</view>
|
||||
<text class="qsm-tip" v-if="fromIdQuery">如您在其他手机号下持卡,请切换登录后再查询</text>
|
||||
</view>
|
||||
|
||||
<!-- 结果:中奖未认证 -->
|
||||
<view class="qsm-state" v-else-if="phase === 'won-auth'">
|
||||
<view class="qsm-ico gold"><svg width="22" height="22" viewBox="0 0 22 22"><path d="M4.5 11.5l4.5 4.5 8.5-9" stroke="#8A4A06" stroke-width="2.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg></view>
|
||||
<text class="qsm-state-t dark">恭喜您!获得千元权益包</text>
|
||||
<text class="qsm-state-s">完成实名认证后即可领取使用</text>
|
||||
<view class="qsm-btn" @click="nav('/pages/rights/rights?status=auth')">立即认证领取</view>
|
||||
</view>
|
||||
|
||||
<!-- 结果:已认证已中奖 -->
|
||||
<view class="qsm-state" v-else-if="phase === 'won-has'">
|
||||
<view class="qsm-ico gold"><svg width="22" height="22" viewBox="0 0 22 22"><path d="M4.5 11.5l4.5 4.5 8.5-9" stroke="#8A4A06" stroke-width="2.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg></view>
|
||||
<text class="qsm-state-t dark">您已获得千元权益包</text>
|
||||
<text class="qsm-state-s" v-if="expires">权益 {{ expires }} 到期,请及时使用</text>
|
||||
<text class="qsm-state-s" v-else>10 项权益待您使用</text>
|
||||
<view class="qsm-btn" @click="nav('/pages/rights/rights?status=info')">查看我的权益包</view>
|
||||
</view>
|
||||
|
||||
<!-- 本期暂未开奖(无任何已开奖记录) -->
|
||||
<view class="qsm-state" v-else-if="phase === 'not-drawn'">
|
||||
<view class="qsm-ico amber"><svg width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7.5" stroke="#fff" stroke-width="1.8" fill="none"/><path d="M10 6v4.5l3 1.8" stroke="#fff" stroke-width="1.8" stroke-linecap="round" fill="none"/></svg></view>
|
||||
<text class="qsm-state-t">本期暂未开奖</text>
|
||||
<text class="qsm-state-s">中奖名单预计于 2026 年 11 月上旬公布,敬请期待</text>
|
||||
<view class="qsm-btn line" @click="close">知道了,继续逛</view>
|
||||
</view>
|
||||
|
||||
<!-- 查询失败 -->
|
||||
<view class="qsm-state" v-else-if="phase === 'error'">
|
||||
<view class="qsm-ico gray"><svg width="20" height="20" viewBox="0 0 20 20"><path d="M10 5v7M10 15.2v.2" stroke="#fff" stroke-width="2.2" stroke-linecap="round"/></svg></view>
|
||||
<text class="qsm-state-t">{{ errText }}</text>
|
||||
<view class="qsm-btn" @click="start">重试</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HhrsWinnerSheet',
|
||||
props: {
|
||||
visible: { type: Boolean, default: false }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
phase: 'loading',
|
||||
idNo: '',
|
||||
querying: false,
|
||||
fromIdQuery: false,
|
||||
expires: '',
|
||||
errText: '查询失败,请稍后重试'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(v) { if (v) this.start() }
|
||||
},
|
||||
methods: {
|
||||
close() { this.$emit('close') },
|
||||
nav(url) { this.$emit('close'); uni.navigateTo({ url }) },
|
||||
// xuchao: 打开即查资格。getEligibility 对未认证用户 hasWin 不可信(spec 见需求定稿),
|
||||
// 故 isAuth=false 一律走证件输入两段式;成功/失败都释放 querying
|
||||
start() {
|
||||
this.phase = 'loading'
|
||||
this.querying = false
|
||||
this.fromIdQuery = false
|
||||
this.idNo = ''
|
||||
const phone = uni.getStorageSync('phone')
|
||||
if (!phone) { this.phase = 'error'; this.errText = '请先登录'; return }
|
||||
this.$u.api.getEligibility({ phone }).then(res => {
|
||||
if (res.errcode !== 0 || !res.data) { this.errText = res.errmsg || '查询失败,请稍后重试'; this.phase = 'error'; return }
|
||||
this.applyEligibility(res.data)
|
||||
}).catch(() => { this.errText = '查询失败,请稍后重试'; this.phase = 'error' })
|
||||
},
|
||||
applyEligibility(d) {
|
||||
if (!d.isAuth) { this.phase = 'input'; return }
|
||||
if (d.hasWin) {
|
||||
this.expires = d.expiresTime ? String(d.expiresTime).slice(0, 10) : ''
|
||||
this.phase = 'won-has'
|
||||
} else {
|
||||
this.phase = 'lost'
|
||||
}
|
||||
},
|
||||
query() {
|
||||
if (this.querying) return
|
||||
if (!/^\d{17}[0-9Xx]$/.test(this.idNo.trim())) {
|
||||
uni.showToast({ title: '请输入正确的 18 位身份证号码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const idNo = this.idNo.trim()
|
||||
this.querying = true
|
||||
this.$u.api.getWinnerDates().then(dRes => {
|
||||
// xuchao: 无任何已开奖记录 = 暂未开奖(新轮次排期暂无接口,见交付说明的边界限制)
|
||||
if (dRes.errcode === 0 && Array.isArray(dRes.data) && dRes.data.length === 0) {
|
||||
return { skip: 'not-drawn' }
|
||||
}
|
||||
return this.$u.api.checkWinner({ identityNo: idNo }).then(r => ({ skip: null, r }))
|
||||
}).then(out => {
|
||||
this.querying = false
|
||||
if (out.skip === 'not-drawn') { this.phase = 'not-drawn'; return }
|
||||
const res = out.r
|
||||
if (res.errcode !== 0 || !res.data) {
|
||||
this.errText = res.errmsg || '查询失败,请稍后重试'
|
||||
this.phase = 'error'
|
||||
return
|
||||
}
|
||||
this.fromIdQuery = true
|
||||
this.phase = res.data.isWinner ? 'won-auth' : 'lost'
|
||||
}).catch(() => {
|
||||
this.querying = false
|
||||
this.errText = '查询失败,请稍后重试'
|
||||
this.phase = 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.qsm-mask {
|
||||
position: fixed;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
background: rgba(40, 20, 10, 0.55);
|
||||
z-index: 999;
|
||||
}
|
||||
.qsm-sheet {
|
||||
position: absolute;
|
||||
left: 0; right: 0; bottom: 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 28rpx 28rpx 0 0;
|
||||
padding: 36rpx 32rpx calc(40rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.qsm-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.qsm-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
color: #33200F;
|
||||
}
|
||||
.qsm-close {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 4rpx;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.qsm-desc {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
color: #6B5140;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.qsm-input {
|
||||
height: 96rpx;
|
||||
background: #F8F1E7;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 26rpx;
|
||||
font-size: 30rpx;
|
||||
color: #33200F;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
.qsm-ph { color: #B8A28E; font-size: 28rpx; letter-spacing: 0; }
|
||||
.qsm-privacy {
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #B8A28E;
|
||||
margin-top: 14rpx;
|
||||
text-align: center;
|
||||
}
|
||||
/* xuchao: .qsm-state 是 align-items:center 的 flex 列,子项宽度=内容宽会塌陷,
|
||||
主按钮必须显式撑满(input 态在普通块级流里 100% 同样成立,两态统一) */
|
||||
.qsm-btn {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-top: 32rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 46rpx;
|
||||
background: linear-gradient(90deg, #D8431F, #E8542F 55%, #F0703C);
|
||||
color: #FFF;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
letter-spacing: 2rpx;
|
||||
box-shadow: 0 8rpx 18rpx rgba(216, 67, 31, 0.25);
|
||||
}
|
||||
.qsm-btn.dis { opacity: .6; }
|
||||
.qsm-btn.line {
|
||||
background: #FFF;
|
||||
color: #D8431F;
|
||||
border: 2rpx solid #F0C6B4;
|
||||
box-shadow: none;
|
||||
}
|
||||
.qsm-btn-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 20rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
.qsm-link { font-size: 26rpx; color: #D8431F; font-weight: 600; }
|
||||
.qsm-sep { font-size: 22rpx; color: #E6D4C2; }
|
||||
.qsm-tip {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 22rpx;
|
||||
color: #B8A28E;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.qsm-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 14rpx 0 4rpx;
|
||||
}
|
||||
.qsm-state-t {
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
color: #33200F;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
.qsm-state-t.dark { color: #33200F; }
|
||||
.qsm-state-s {
|
||||
font-size: 26rpx;
|
||||
color: #8A6E56;
|
||||
margin-top: 12rpx;
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.qsm-ico {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.qsm-ico.gold {
|
||||
background: radial-gradient(circle at 32% 28%, #FFEEC0, #F0C267 65%, #D99A31);
|
||||
box-shadow: 0 8rpx 16rpx rgba(217, 154, 49, 0.35);
|
||||
}
|
||||
.qsm-ico.gray { background: linear-gradient(160deg, #B9AEC5, #8E839B); }
|
||||
.qsm-ico.amber { background: linear-gradient(160deg, #F0B25C, #E79A30); }
|
||||
.qsm-spin {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 50%;
|
||||
border: 5rpx solid #F2E3CE;
|
||||
border-top-color: #E8542F;
|
||||
margin: 20rpx auto;
|
||||
animation: qsm-rot 0.9s linear infinite;
|
||||
}
|
||||
@keyframes qsm-rot { to { transform: rotate(360deg); } }
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
# 第一期中奖名单导入记录(2026-09-29)
|
||||
|
||||
## 背景
|
||||
|
||||
怀化市社保卡千万好礼促消费活动第一期开奖名单产生后,需导入 UAT 库 `dscp_business_uat.hhrs_winner` 表,供公示页 https://hh.hn12301.net/#/pages/winners/winners 展示。
|
||||
|
||||
## 数据来源
|
||||
|
||||
| 文件 | 内容 |
|
||||
| --- | --- |
|
||||
| `抽奖-中奖数据.xlsx`(2026-09-29 10:21 导出) | 第一期中奖名单原始文件:2000 人(姓名+脱敏身份证号) |
|
||||
| `抽奖-中奖数据-匹配hhrs_lottery_pool-batch1.csv` | 与抽奖池 `hhrs_lottery_pool`(batch_no=1)匹配结果:2001 行(1 人双卡) |
|
||||
|
||||
## 导入内容与校验
|
||||
|
||||
- 导入通道:直连 UAT MySQL,事务内导入,前后计数复核通过。
|
||||
- 导入行数:**2000**(batch1 CSV 2001 行按 姓名+证件号 去重;会同县「杨明 431225********4219」池中有两条卡记录,保留 pool_id 较小的一条,业务侧如需明确以哪张卡中奖需另行核实)。
|
||||
- 表结构:UAT 库 `hhrs_winner` 实际为抽奖池版结构(`id, pool_id, member_name, county, member_identity_no, member_phone, created_time, updated_time`),无奖品/开奖日期列。
|
||||
- 字段取值:`id` 与 `pool_id` 均取抽奖池记录 id(一一对应、可溯源);`county` 取自池表;证件/手机号为池表脱敏值(库内即脱敏,公示展示不受影响);`created_time=NOW()`(2026-09-29 14:27)。
|
||||
- 同步操作:对应 2000 条池记录 `won` 置 1(与抽奖台「公布即回写」语义一致)。
|
||||
- 旧数据:导入前表为空,无清理动作。
|
||||
|
||||
## 已知问题(导入前即存在)
|
||||
|
||||
dscp-uat 当前部署的后端与上表结构不匹配:
|
||||
|
||||
- `mp-api/hhrsWinner/dates`、`mp-api/hhrsWinner/list` 均返回 `errcode 99999`(部署代码按旧 prize 版 schema 查询,`draw_date/card_model_id` 列已不存在);
|
||||
- `open-api/hhrsDraw/*`(抽奖台后台)在该服务上为 404,抽奖台实际使用的后端未部署在此环境。
|
||||
|
||||
因此公示页当前显示「暂无数据/接口失败」,**与本次导入的数据无关**;待与现表结构匹配的新版后端部署后,第一期名单即可展示,数据无需重导。
|
||||
|
||||
## 补充排查发现(2026-09-29 下午)
|
||||
|
||||
1. UAT 库中还存在抽奖后台配套表 `hhrs_draw_activity` / `hhrs_draw_round`(2026-09-28 建),即抽奖台新版后端的排期数据:
|
||||
- **第一期官方开奖日期 = 2026-09-29**(「2026 金秋千万好礼 · 第一期(9·29 专场)」,活动 status=1 已发布);
|
||||
- 排期设计:9·29 专场三场 600+700+700=2000 人,分别绑定 batch 1/2/3;全部轮次 status=0(待开奖)、seed/drawn_time 为空 → **抽奖台自动回写链路从未成功跑通**(与 dscp-uat 上 hhrsDraw 接口 404 相符);
|
||||
- 实际交付的第一期名单是「batch1 一次抽 2000 人」,与排期表的三场拆分不一致——若后续场次仍按排期表取 batch2/3,不受本次导入影响(批次天然互斥)。
|
||||
2. 公示页要立即显示名单,零部署方案为:`hhrs_winner` 增加旧接口所需 8 列(card_model_id/member_id/prize_*/draw_date/remark,均可空,兼容新版写入),并回填:card_model_id=747609734826757、draw_date='2026-09-29'、prize_name='怀化市社保卡千万好礼促消费千元权益包'、prize_type='权益包'、prize_amount=100000(分,即 1000 元)。**待用户批准后执行**。
|
||||
3. 前端「隐藏手机号」改动(本地已完成)生效路径:HBuilderX CLI 可本地构建,产物上传 121.43.239.220:/home/hh/html 需要 SSH 权限(凭据在 Obsidian 运维手册)。
|
||||
|
||||
## 前端配套改动(本地已改,未发布)
|
||||
|
||||
`hhrs/pages/winners/winners.vue`:
|
||||
|
||||
1. 按业务要求移除「手机号码」列(表头、行、样式、按手机号过滤逻辑),搜索框改为仅按姓名。
|
||||
2. 修复「名单未翻到的人物搜索无结果」(如 王球莲):搜索原本只在前端已加载的 10 条/页内过滤,后端列表接口无姓名检索参数;现改为输入关键字/点搜索时按 500 条大页自动拉全当期名单(实测第一期 4 次请求共 2000 条)再本地过滤,全量结果按期缓存;拉取失败静默降级为已加载部分可搜。
|
||||
|
||||
需 HBuilderX 构建后上传 121.43.239.220:/home/hh/html 生效(`sh h5-release.sh` → 产物 scp 原子切换)。
|
||||
|
||||
## 发布结果(2026-09-29 16:07 线上实测)
|
||||
|
||||
已发布生效:入口 `index.8ec4f995.js` → `index.e438708b.js`,修复分片 `pages-winners-winners.a875331e.js`(含 loadAll 全量搜索)公网 200。浏览器实测:不翻页直接搜「王球莲」命中 1 条(4 个 pageSize=500 请求自动拉全),姓名/身份证/手机号三列正常。四站点回归 hh/pxdy/mkh5/api/dw 全 200。发布过程偏差(目录切换替代覆盖式)已按手册补救:旧 hash 资源全量还原、`._*` AppleDouble 清理、webroot 备份 `/root/hh-html-backup-20260929-presearchfix.tar.gz`。winners.vue 源码改动尚未 commit。
|
||||
|
||||
## 追加修复(2026-09-30):完整手机号搜索
|
||||
|
||||
**问题**:接口下发的手机号为掩码形态(`185****6312`),用户输入完整明文号码时「包含」比对必然落空(旧版即存在)。**修法**(winners.vue 过滤逻辑):输入为 8~11 位纯数字时,先按「前3+****+后4」转成同型掩码精确比对,原有明文包含比对保留(兼容输号段场景)。线上实测搜 `18570996312` 命中「粟欢欢」,姓名搜索不受影响。
|
||||
|
||||
**发布**(2026-09-30 11:2x):入口 `index.e438708b.js` → `index.c7052d8a.js`,分片 `pages-winners-winners.ec4a4d4c.js` 公网 200。按手册**覆盖式**发布(先铺 static 保留旧 hash、最后换 index.html、清 `._*`)。发布通道变更:服务器已装部署公钥(`~/.ssh/hh_121.43.239.220_ed25519`,备注 claude-deploy-hh),发布不再需要手输密码;authorized_keys 仅追加该公钥一行。
|
||||
|
||||
## 追加修复(2026-09-30 第二批):空态闪现 + 完整身份证搜索
|
||||
|
||||
1. **「暂无数据」闪现**:首屏日期接口未回、搜索触发全量拉取期间,列表区改为显示「查询中...」加载态(`datesLoaded` 标志 + `loadingAll` + `loadStatus==='loading'` 三重守卫),仅真正无结果才落空态。
|
||||
2. **完整身份证号搜索**:与手机号同因(接口下发 `433***********0040` 形态掩码),17 位数字+校验位(含 x)输入转「前3+11星+后4」同型掩码精确比对;占位符更新「搜索姓名/手机号/身份证号」。
|
||||
3. **掩码等值固有口径**:身份证中段 8 位库内不可逆,前3+后4 同型者一并命中(实测合成号命中 熊金花/王球莲/刘元香 3 人),属预期行为,非 bug。
|
||||
4. **发布**(免密覆盖式):入口 `index.c7052d8a.js` → `index.5506cf30.js`,分片 `pages-winners-winners.c4b5297b.js`。线上实测:手机全号→粟欢欢 1 条;身份证全号→3 条含目标;姓名→王球莲 1 条;加载期无空态闪现。winners.vue 两批改动截至本次未 commit。
|
||||
|
||||
## 第二期显示上线(2026-10-15)
|
||||
|
||||
第二期(round_id=857957849362501,开奖日 2026-10-15)2000 人已由**新抽奖后端自动回写** `hhrs_winner`(姓名/县区/明文手机/明文证件/pool_id 齐全),但新后端不认识老公示接口依赖的遗留列,故由我回填:`card_model_id=747609734826757`、`draw_date='2026-10-15'`(取自 hhrs_draw_round)、prize_name/type/amount 同期初口径。回填 2000/2000,复核 4000 行两期无遗漏。
|
||||
|
||||
**期次标签修复**:后端 dates 接口按日期倒序返回,前端按序号标"第 N 期"会把二期(10-15)顶成"第1期";前端 loadDates 中改为日期正序后再编号(一期=最早开奖日)。发布后实测:第1期=2026-09-29、第2期=2026-10-15,顶部合计 4,000,二期列表/关键字搜索(服务端 LIKE)全部正常。入口 `index.cdabe0c1.js`,分片 `pages-winners-winners.fe9810db.js`。
|
||||
|
||||
**注意**:此后每一期都由新后端自动回写(不再手工导入),但**每期需补跑一次上述回填**(三个遗留列),否则页面不可见;若后端改为写入这些列则免。
|
||||
@@ -0,0 +1,48 @@
|
||||
-- ============================================================
|
||||
-- 怀化社保卡商户板块改版 · 品牌表 DDL
|
||||
-- 需求文档:品牌表建表与接口需求_2026-10-26.md
|
||||
-- 执行顺序:① 本文件建表/加列 → ② 导入脚本回填(另交) → ③ 接口发布
|
||||
-- 环境:dscp_business_uat 与 生产库 各执行一次(两库不同机器)
|
||||
-- ============================================================
|
||||
|
||||
-- 1. 品牌表(平台通用命名风格,无前缀;其他项目通过自有方式关联 brand_id)
|
||||
CREATE TABLE `brand` (
|
||||
`id` BIGINT NOT NULL COMMENT '雪花ID',
|
||||
`name` VARCHAR(50) NOT NULL COMMENT '品牌名称(唯一业务名,收集表①B列)',
|
||||
`logo` VARCHAR(255) COMMENT '品牌LOGO图片URL(OSS)',
|
||||
`brand_type` VARCHAR(30) COMMENT '品牌类型(连锁餐饮/连锁商超等,运营自定文本)',
|
||||
`introduction` TEXT COMMENT '品牌简介',
|
||||
`discount_type` TINYINT COMMENT '优惠类型:1满减券 2折扣券 3立减券 4余额券 5免费体验 6固定价 9其他',
|
||||
`discount_display` VARCHAR(50) COMMENT '列表展示文案(如:满200减8元 / 9.8折)',
|
||||
`threshold_fen` INT COMMENT '优惠门槛(分;折扣类为空)',
|
||||
`discount_value` INT COMMENT '优惠力度(满减/立减=减额分;折扣=折数×10,如9.8折存98)',
|
||||
`pay_mode` VARCHAR(30) COMMENT '付款方式(付款码,扫一扫…多值逗号分隔)',
|
||||
`pay_rule` VARCHAR(50) COMMENT '付款规则(如:付款立减)',
|
||||
`discount_rules` TEXT COMMENT '优惠说明(富文本HTML,后台富文本编辑器维护,详情页编号列表直接渲染)',
|
||||
`service_phone` VARCHAR(20) COMMENT '客服电话(详情页/列表拨号用)',
|
||||
`remark` VARCHAR(500) COMMENT '优惠原文备份(迁移追溯,兼容 shop_relation.remark)',
|
||||
`status` TINYINT DEFAULT 1 COMMENT '1上架 0下架',
|
||||
`sort` INT DEFAULT 0 COMMENT '排序',
|
||||
`is_deleted` BIT(1) DEFAULT b'0',
|
||||
`created_by` VARCHAR(50),
|
||||
`created_time` DATETIME,
|
||||
`updated_by` VARCHAR(50),
|
||||
`updated_time` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_brand_name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='品牌表';
|
||||
|
||||
-- 2. 商铺表挂品牌(其余字段复用现有:logo/lat/lng/mobile/business_time/main_pic 均已存在)
|
||||
ALTER TABLE `shop`
|
||||
ADD COLUMN `brand_id` BIGINT NULL COMMENT 'FK brand.id' AFTER `merchant_id`,
|
||||
ADD INDEX `idx_shop_brand_id` (`brand_id`);
|
||||
|
||||
-- 3. 权益项目:card_resource_rule 大部分复用现有字段,仅新增一列 use_mode——
|
||||
-- 权益内容物 → resource_name/introduce;可用次数 → total_times/month_times/day_times;
|
||||
-- 是否预约 → is_appointment/can_appointment/advance_days/advance_hour;
|
||||
-- 使用规则/注意事项 → notice/card_instruction;状态 → status/resource_status。
|
||||
-- ⚠ settlement_way/check_settlement_type 属于财务结算域(结算单/分成/买断链路),
|
||||
-- 不可挪用为用户端核销方式。用户端"核销方式"用新列:
|
||||
ALTER TABLE `card_resource_rule`
|
||||
ADD COLUMN `use_mode` VARCHAR(30) NULL COMMENT '使用/核销方式(展示用):付款码/扫一扫/权益券核销/出示页面/现场登记' AFTER `settlement_way`;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
# 商户品牌改版 · 后端需求说明(建表 + 接口 + 数据导入)
|
||||
|
||||
日期:2026-10-26 前端:hhrs(怀化人社 H5)+ 管理后台 配套:`brand_ddl_2026-10-26.sql`、《怀化商户信息优化模板_终版预填v2》收集表
|
||||
|
||||
## 1. 背景与目标
|
||||
|
||||
商户折扣列表页、详情页按新版 UI 改版(品牌头图卡 + 结构化红色权益 + 优惠说明富文本 + 同品牌门店清单)。数据模型:
|
||||
|
||||
```
|
||||
brand(品牌:统一优惠信息) 1 ── N shop(门店:地址/坐标/电话)
|
||||
card_resource_rule(权益项 126 条,复用现有字段) N ── 1 shop
|
||||
```
|
||||
|
||||
新增仅一张 `brand` 表 + `shop.brand_id` 一列;权益项零 DDL(复用 card_resource_rule 现有字段)。
|
||||
|
||||
## 2. DDL(见 brand_ddl_2026-10-26.sql)
|
||||
|
||||
- 新建 `brand`:字段与枚举注释齐全;`discount_rules` 为 **TEXT 富文本 HTML**(后台富文本编辑器维护,口径同 shop.description);
|
||||
- `shop` 加 `brand_id`(索引);
|
||||
- UAT 与生产两套库各执行一次。
|
||||
|
||||
## 3. 接口改动(jxxx-dscp)
|
||||
|
||||
### 3.1 `mp-api/hhrsStore/list`、`hhrsStore/detail`
|
||||
|
||||
现有链路:shop_relation(channel_type=15) → shop。改动:
|
||||
|
||||
- shop 查询后按 `brand_id` join `brand`(status=1 且未删除),Response 增加:
|
||||
`brandId、brandName、brandLogo、brandType、brandIntroduction、discountType、discountDisplay、thresholdFen、discountValue、payMode、payRule、discountRules(富文本)、servicePhone`;
|
||||
- **兼容回退**:`brand_id` 为空或品牌未上架 → 沿用现有 `merchantDiscount`(shop_relation.remark),保证未迁移门店不断档;
|
||||
- `detail` 增加 `brandShops`:同 `brand_id` 门店清单(id/name/address/lat/lng/distance/mobile/businessTime),供详情页"适用门店"展示+导航+拨号(**该清单只展示,不跳二级页**);
|
||||
- `list` 增加透出 `lng/lat`(地图/距离已算,前端导航按钮要用原始坐标)。
|
||||
|
||||
### 3.2 `mp-api/hhrsRights/list`、`hhrsRights/detail`
|
||||
|
||||
Response 补充映射 card_resource_rule 现有列:
|
||||
`totalTimes、monthTimes、dayTimes(可用次数)、isAppointment/advanceDays/advanceHour(预约)、notice、cardInstruction(使用说明)、useMode(核销方式,新列见 DDL)`。
|
||||
⚠ 注意:`settlement_way/check_settlement_type` 为财务结算域字段(结算单导出/分成/买断 Handler 在用),与用户端"核销方式"语义不同,本次不复用、不改动,新增 `use_mode` 承载展示口径。
|
||||
|
||||
### 3.3 管理后台(dscp-html-manage)——2026-10-26 确认同批执行
|
||||
|
||||
**后端新增管理端接口(与 mp 接口分开,走后台鉴权域):**
|
||||
- `brand/page`(名称/类型/状态筛选+分页)、`brand/save`(新增/编辑)、`brand/delete`(软删)、`brand/simpleList`(下拉数据源:id+name,仅上架);
|
||||
- shop 保存接口支持 `brand_id` 字段;card_resource_rule 保存接口支持 `use_mode` 字段。
|
||||
|
||||
**前端管理页:**
|
||||
1. 新菜单「品牌管理」(位置:与商铺管理同组;权限码沿用平台现有规范);
|
||||
2. 品牌列表页:名称/类型/优惠文案/状态列 + 搜索、新增、编辑、上下架、删除;
|
||||
3. 品牌表单:名称(必填、重名提示)、LOGO(复用现有 OSS 上传组件)、品牌类型、客服电话、优惠类型(下拉枚举 1-6/9)、优惠信息(展示文案)、门槛/力度(表单填"元/折",提交转分/×10)、付款方式(多选)、付款规则、品牌简介、**优惠说明(富文本编辑器,复用 shop.description 同款组件,走 XSS 过滤链)**、排序、状态;
|
||||
4. 商铺表单(shop/form):新增「所属品牌」下拉(远程搜索 brand/simpleList,写入 shop.brand_id);现有渠道 remark 输入保留(长期双轨);
|
||||
5. 权益资源规则表单:「核销方式 use_mode」下拉(付款码/扫一扫/权益券核销/出示页面/现场登记)。
|
||||
|
||||
**上线顺序建议**:建表 → 后端接口 → 管理页 → Excel 导入存量 → 前端两页面改版。
|
||||
|
||||
## 4. 数据导入(回收《终版预填v2》后由前端侧脚本执行,SQL 交后端审核)
|
||||
|
||||
1. 读收集表①:按品牌建 `brand` 187 行(优惠类型文案→枚举、优惠信息拆 threshold/value、优惠说明三段转富文本 `<p>` 并自动标色数字);
|
||||
2. 读收集表②:按"门店ID"列 UPDATE `shop`:`brand_id`(名称→新id映射)、`logo`、`lat/lng`、`mobile`、`business_time`、`main_pic`;无 brand_id 锚点的新店按 INSERT 走后台新增流程;
|
||||
3. 读收集表③:按"规则ID"列 UPDATE `card_resource_rule` 现有字段(times/预约/notice)+ 新列 `use_mode`(核销方式);
|
||||
4. 图片:logo(Pxxx_logo.png)与门头照(Sxxxx_photo.jpg)打包批量传 OSS(hn12301 bucket),URL 回填;
|
||||
5. 流程:脚本先 **dry-run 输出匹配统计**(命中/未匹配/冲突清单)→ 事务内执行 UAT → 页面验收 → 同包生产;
|
||||
6. 表内 14 家无坐标门店、27 条解析失败品牌文案,业务已补齐后再导。
|
||||
|
||||
## 5. 确认结论(2026-10-26 后端已答复)
|
||||
|
||||
| # | 事项 | 结论 |
|
||||
|---|---|---|
|
||||
| 1 | brand 表规范 | **照抄本 DDL** |
|
||||
| 2 | 核销方式落位 | 查实 `settlement_way/check_settlement_type` 属财务结算域(结算单/分成/买断链路在用),**不可挪用**;改为 `card_resource_rule` 新增 `use_mode VARCHAR(30)` 列承载(DDL 已更新)——待产品/后端确认这唯一新增列 |
|
||||
| 3 | discount_type 枚举 | **按暂定 1-6/9 执行** |
|
||||
| 4 | 富文本 XSS | **走现有过滤链**(同 shop.description 口径) |
|
||||
| 5 | remark 回退 | **长期双轨**:brand_id 缺失/未上架时前端永远回退 shop_relation.remark;导入脚本对已迁品牌行两边同步写,remark 不下线 |
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# 商户列表/详情页改版 · 后端数据需求说明(2026-10-23 · v4 修订)
|
||||
|
||||
## 〇、模型澄清(重要,业务已确认)
|
||||
|
||||
**商铺 = 品牌,权益直接挂在现有商铺(shop 表)记录上,不新增品牌层级**;
|
||||
详情页 = 商铺权益详情页,页内"适用门店"仅是同品牌商铺的展示清单(导航/电话),**没有门店二级页面**。
|
||||
同品牌多店优惠统一:数据上各店行相同即可(由收集表"代表行 + 同组引用"机制导入时自动扩展,见收集表 v4 说明)。
|
||||
|
||||
## 一、调研结论(基于 dscp_business_dev 库实查 + UAT 接口实测)
|
||||
|
||||
| 现有资产 | 与本次的关系 |
|
||||
|---|---|
|
||||
| `shop` 表 | 已有 `logo`、`lat/lng`、`business_time`、`mobile`、`main_pic`、`ticket_info`、`merchant_id`(主体/开票方,营销维度不使用它) |
|
||||
| `promotion_coupon(_template)` | 已有结构化优惠字段(discount_type/percent/price/limit_price),仅作字段设计参考,本次不接入券体系 |
|
||||
| `card_resource_rule` | 权益包 126 条权益项规则表,②收集表数据源 |
|
||||
|
||||
hhrs 接口 `mp-api/hhrsStore/list` 目前只透出部分字段(image=门头照、merchantDiscount=拼接文本、坐标未返回)。
|
||||
**环境注意**:UAT 接口返回的 177 家与 120.26.254.65 的 dev 库仅 15 条重合,dscp-uat 服务连的是另一套库——补数据前先确认目标库(问题③)。
|
||||
|
||||
## 二、数据规模实测
|
||||
|
||||
- 商铺全集 **197**(折扣 177 + 场馆 25,重叠 5);
|
||||
- 权益包权益项 **126** 条(`hhrsRights/list`);
|
||||
- 数据缺口(按 UAT/dev 实测):`logo` 基本为默认图、`lat/lng` 大面积缺失、结构化优惠字段无 → 全部走收集表补齐。
|
||||
|
||||
## 三、需要后端做的(存储方案已随模型定死,二选一取消)
|
||||
|
||||
`shop` 表新增结构化权益列(或等价方案),并透出到 hhrsStore 接口:
|
||||
|
||||
```
|
||||
discount_type 券类型枚举(满减/折扣/立减/固定价/免费体验/其他)
|
||||
threshold_fen 门槛(分,可空)
|
||||
discount_value 力度(折扣=折数×10;满减=减让分)
|
||||
pay_mode 核销方式枚举(社保卡付款码/云闪付扫一扫/权益券核销/出示页面/现场登记)
|
||||
discount_display 列表展示文案(如“满100减10元”)
|
||||
rules_json 优惠说明条目数组(详情页编号列表,含限次/低消/除外)
|
||||
brand_group 品牌组名(同优惠多店归组的键,导入时按组扩展权益列)
|
||||
```
|
||||
|
||||
接口:`hhrsStore/list`、`hhrsStore/detail` 增加透出 `logo、lat、lng、上述新列、同组门店清单(brand_group 下各店 名称/地址/坐标/电话,详情页适用门店用)`。
|
||||
兼容:结构化列/`logo` 为空时前端回退 `merchantDiscount` 文本与门头照,可逐店迁移不断档。
|
||||
|
||||
## 四、需要后端回答的三个问题
|
||||
|
||||
① `shop.usage_note`/`ticket_info` 原始设计语义,可否承载"核销说明/付款码配置"?
|
||||
② 核销方式=付款码的商铺,三方商户号存 `shop_relation` 还是新列?
|
||||
③ dscp-uat 与生产 hhrs 服务各自的 DB 指向(导入前必须确认,dev 库≠UAT 库已实锤)。
|
||||
|
||||
## 五、前端改造范围(数据就绪后)
|
||||
|
||||
- 列表页 `pages/discount/discount.vue`:行样式重构(logo + 券类型标签 + 右侧结构化红色权益 + 距离),一行=一个商铺权益;
|
||||
- 详情页(新增或在 venue/detail 上改造):商铺权益详情 = 头部卡(logo/角标/付款码按钮)+ 优惠说明编号卡 + 同品牌门店清单卡(展示 + 导航/电话,**不跳二级页**);
|
||||
- 权益包详情(rights)套用同一套样式,数据来自权益项规则扩展字段;
|
||||
- 「付款码」按钮动作待产品确认渠道;首页「全城好礼商户」宫格同源受益。
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# xuchao: hhrs H5 发布脚本 —— HBuilderX 构建不吃项目根 index.html(静态标签会被丢),
|
||||
# 云闪付控件(upsdk)必须静态标签加载才能注册控件桥(路线B,2026-09-28 定),
|
||||
# 故构建后把标签注入产物 index.html 再打包上传。发布 = sh h5-release.sh
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
rm -rf unpackage/dist/build/web
|
||||
/Applications/HBuilderX.app/Contents/MacOS/cli publish web --project hhrs
|
||||
BUILT=unpackage/dist/build/web/index.html
|
||||
# 注入云闪付 SDK 静态标签(幂等:已有则跳过)
|
||||
grep -q "open.95516.com" "$BUILT" || sed -i '' 's#<title>怀化人社</title>#<title>怀化人社</title><script src="https://open.95516.com/s/open/js/upsdk.js" data-upsdk="1"></script>#' "$BUILT"
|
||||
grep -q "open.95516.com" "$BUILT" && echo "[h5-release] upsdk 静态标签已在产物 index.html"
|
||||
tar czf /tmp/hh-voucher/web_release.tgz -C unpackage/dist/build/web .
|
||||
echo "[h5-release] 产物就绪:/tmp/hh-voucher/web_release.tgz —— 用 expect rsh.exp scp 上传后原子切换"
|
||||
@@ -51,6 +51,12 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/detail",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/petrol/orderConfirm",
|
||||
"style": {
|
||||
@@ -100,25 +106,5 @@
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"custom": true,
|
||||
"color": "#999999",
|
||||
"selectedColor": "#007aff",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/shouye.png",
|
||||
"selectedIconPath": "static/shouye_select.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mine",
|
||||
"iconPath": "static/wode.png",
|
||||
"selectedIconPath": "static/wode_select.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
}
|
||||
|
||||
@@ -4,32 +4,38 @@
|
||||
<view class="search-area">
|
||||
<view class="nav-row">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<u-icon name="arrow-left" color="#333333" size="40"></u-icon>
|
||||
<u-icon name="arrow-left" color="#333333" size="32"></u-icon>
|
||||
<text class="back-text">返回</text>
|
||||
</view>
|
||||
<view class="search-bar">
|
||||
<u-icon name="search" color="#8e8e93" size="36"></u-icon>
|
||||
<u-icon name="search" color="#8e8e93" size="30"></u-icon>
|
||||
<input class="search-input" v-model="keyword" placeholder="请搜索商户名" confirm-type="search" @confirm="onSearch" />
|
||||
<view class="search-btn" @click="onSearch">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- xuchao: 所属县区 + 所属类型筛选,选项与联动条数由列表接口一并返回 -->
|
||||
<hhrs-filter-bar :districts="filters.districts" :categories="filters.categories"
|
||||
:district-id="districtId" :category="category" @change="onFilterChange" />
|
||||
</view>
|
||||
|
||||
<!-- 商户列表 -->
|
||||
<!-- 商户列表(xuchao: 参考图行样式——logo+券类型标签+付款方式,右列结构化优惠+距离;未迁移门店回退旧文案) -->
|
||||
<view class="list-area">
|
||||
<view class="venue-card" v-for="item in list" :key="item.shopId" @click="goDetail(item)">
|
||||
<image class="card-img" :src="item.image" mode="aspectFill" />
|
||||
<view class="card-thumb">
|
||||
<image class="card-img" :src="item.brandLogo || item.image" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<text class="card-name">{{ item.name }}</text>
|
||||
<text class="card-category">{{ item.category }}</text>
|
||||
<!-- xuchao: 地址与距离同属一个模块 -->
|
||||
<view class="card-address-row">
|
||||
<text class="card-address">{{ item.address }}</text>
|
||||
<view class="card-distance" v-if="item.distance !== null">
|
||||
<u-icon name="map" color="#999999" size="24"></u-icon>
|
||||
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
||||
<text class="card-name">{{ item.brandName || item.name }}</text>
|
||||
<!-- xuchao: 参考图为纵向三行——店名 / 券类型标签 / 付款方式,标签与付款码不同行 -->
|
||||
<text class="tag-coupon" v-if="couponLabel(item)">{{ couponLabel(item) }}</text>
|
||||
<text class="card-pay">{{ item.payMode || item.category || '' }}</text>
|
||||
</view>
|
||||
<view class="offer-col">
|
||||
<view class="offer" v-if="item.discountDisplay">
|
||||
<text v-for="(seg, si) in splitOffer(item.discountDisplay)" :key="si" :class="seg.n ? 'offer-num' : 'offer-txt'">{{ seg.t }}</text>
|
||||
</view>
|
||||
<text class="offer-fallback" v-else>{{ item.merchantDiscount || item.category || '' }}</text>
|
||||
<text class="offer-dist" v-if="item.distance !== null && item.distance !== undefined">直线{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="hasScrolled" class="nomore-area">
|
||||
@@ -40,7 +46,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// xuchao: 县区 + 类型筛选条,三个列表页共用(pages.json 的 easycom 只给 u- 前缀配了规则,这里显式引入)
|
||||
import HhrsFilterBar from '@/components/hhrs-filter-bar/hhrs-filter-bar.vue'
|
||||
|
||||
export default {
|
||||
components: { HhrsFilterBar },
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
@@ -53,7 +63,11 @@ export default {
|
||||
lat: '',
|
||||
loadStatus: 'loadmore',
|
||||
hasScrolled: false,
|
||||
reqSeq: 0
|
||||
reqSeq: 0,
|
||||
// xuchao: 筛选条件与面板选项(选项由列表响应带回)
|
||||
districtId: '',
|
||||
category: '',
|
||||
filters: { districts: [], categories: [] }
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -78,6 +92,16 @@ export default {
|
||||
this.loadMore()
|
||||
},
|
||||
methods: {
|
||||
// xuchao: 券类型角标:品牌结构化类型优先;无品牌的未迁移门店不显示角标(避免与业态文字重复)
|
||||
couponLabel(item) {
|
||||
const map = { 1: '满减券', 2: '折扣券', 3: '立减券', 4: '余额券', 5: '免费体验', 6: '固定价', 9: '其他' }
|
||||
return item.discountType ? map[item.discountType] : (item.brandId ? '优惠' : '')
|
||||
},
|
||||
// xuchao: 优惠文案拆「数字段/文字段」,数字放大红色(对齐参考图)
|
||||
splitOffer(s) {
|
||||
const parts = String(s).split(/(\d+(?:\.\d+)?)/).filter(x => x !== '')
|
||||
return parts.map(t => ({ t, n: /^\d/.test(t) }))
|
||||
},
|
||||
loadList() {
|
||||
// xuchao: 请求序号 —— 新请求直接取代在途请求,过期响应整体丢弃(修复搜索竞态,故不再用 loading 提前 return)
|
||||
const seq = ++this.reqSeq
|
||||
@@ -91,9 +115,16 @@ export default {
|
||||
}
|
||||
if (this.lng) params.lng = this.lng
|
||||
if (this.lat) params.lat = this.lat
|
||||
if (this.districtId) params.districtId = this.districtId
|
||||
if (this.category) params.category = this.category
|
||||
this.$u.api.getStoreList(params).then(res => {
|
||||
if (seq !== this.reqSeq) return
|
||||
if (res.errcode === 0 && res.data) {
|
||||
// xuchao: 面板选项随列表一起回来(后端已按关键词与另一维度算好条数)
|
||||
this.filters = {
|
||||
districts: res.data.districts || [],
|
||||
categories: res.data.categories || []
|
||||
}
|
||||
const list = res.data.list || []
|
||||
if (this.pageNo === 1) {
|
||||
this.list = list
|
||||
@@ -133,13 +164,19 @@ export default {
|
||||
}
|
||||
},
|
||||
goDetail(item) {
|
||||
// xuchao: type=2 标记商户折扣入口,详情页据此展示商品信息+商户优惠模块
|
||||
uni.navigateTo({ url: '/pages/venue/detail?id=' + item.shopId + '&type=2' })
|
||||
// xuchao: 商户折扣行跳品牌详情页(含适用门店/优惠说明);文旅场馆仍走 venue/detail
|
||||
uni.navigateTo({ url: '/pages/shop/detail?id=' + item.shopId })
|
||||
},
|
||||
onSearch() {
|
||||
this.pageNo = 1
|
||||
this.list = []
|
||||
this.loadList()
|
||||
},
|
||||
// xuchao: 换筛选条件即回第 1 页重查(关键词保持不变,两者为 AND)
|
||||
onFilterChange(e) {
|
||||
this.districtId = e.districtId
|
||||
this.category = e.category
|
||||
this.onSearch()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,11 +191,12 @@ export default {
|
||||
|
||||
.search-area {
|
||||
background-color: #ffffff;
|
||||
padding: 6px 12px;
|
||||
// xuchao: 滚动时固定在页面顶部
|
||||
// xuchao: 底部留 8px,与下方列表灰色间隔衔接,白块不再贴死卡片
|
||||
padding: 6px 12px 8px;
|
||||
// xuchao: 滚动时固定在页面顶部;z-index 高于筛选遮罩(90),保证面板与选中态不被压住
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.nav-row {
|
||||
@@ -171,7 +209,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 44px;
|
||||
height: 36px;
|
||||
flex-shrink: 0;
|
||||
gap: 2px;
|
||||
}
|
||||
@@ -185,30 +223,31 @@ export default {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 44px;
|
||||
height: 36px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #f2f2f7;
|
||||
border-radius: 100px;
|
||||
padding: 4px 8px;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
padding: 4px 10px;
|
||||
font-size: 13px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 50px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.list-area {
|
||||
// xuchao: 顶部 12px 必须是页面灰底(不能放进头部的白底里),否则与白色卡片连成一片看不出间隔
|
||||
padding: 12px;
|
||||
// xuchao: border-box 防止 padding 撑出页面横向滚动
|
||||
box-sizing: border-box;
|
||||
@@ -216,23 +255,33 @@ export default {
|
||||
|
||||
.venue-card {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #f2f2f7;
|
||||
border-radius: 6px;
|
||||
border-radius: 16rpx;
|
||||
width: 702rpx;
|
||||
padding: 24px 12px;
|
||||
gap: 12px;
|
||||
padding: 28rpx 24rpx;
|
||||
gap: 20rpx;
|
||||
box-shadow: 0 2px 3px #f2f2f7;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
border-radius: 6px;
|
||||
.card-thumb {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
/* xuchao: image 由 thumb 裁圆角,自身不再设圆角 */
|
||||
.card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
@@ -241,12 +290,13 @@ export default {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
align-items: flex-start;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #000000;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
@@ -254,43 +304,68 @@ export default {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-category {
|
||||
font-size: 14px;
|
||||
color: #727272;
|
||||
margin-top: 8px;
|
||||
// xuchao: 分类为空也预留一行高度,防止卡片内容底部对齐时名称上下跳动
|
||||
min-height: 20px;
|
||||
line-height: 20px;
|
||||
.tag-coupon {
|
||||
flex-shrink: 0;
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
background: #f2f3f5;
|
||||
border-radius: 6rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.card-address-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.card-address {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 14px;
|
||||
color: #727272;
|
||||
.card-pay {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-distance {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
/* xuchao: 右侧优惠列——数字放大红色(对齐参考图),offer 与直线距离间隔一行行距 */
|
||||
.offer-col {
|
||||
flex-shrink: 0;
|
||||
max-width: 230rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.distance-text {
|
||||
font-size: 12px;
|
||||
color: #727272;
|
||||
.offer {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.offer-num {
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
color: #E60012;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.offer-txt {
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
color: #E60012;
|
||||
}
|
||||
|
||||
.offer-fallback {
|
||||
font-size: 22rpx;
|
||||
color: #E60012;
|
||||
text-align: right;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.offer-dist {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.nomore-area {
|
||||
|
||||
@@ -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>
|
||||
|
||||
<!-- 怀化社保卡折扣商户:按后台分类取前 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>
|
||||
<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>
|
||||
|
||||
<!-- 活动指南 -->
|
||||
<view class="guide-section">
|
||||
<view class="section-title">
|
||||
<view class="title-line"></view>
|
||||
<text class="title-text">活动指南</text>
|
||||
</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>
|
||||
</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: 云闪付入口是"免密换人",本机上一个账号的会话与权益缓存必须先丢弃:
|
||||
@@ -91,6 +138,8 @@
|
||||
// 就会变成 Bearer [object Object],把所有鉴权接口全打挂
|
||||
const issued = typeof res.data.accessToken === 'string' ? res.data.accessToken : ''
|
||||
if (issued) uni.setStorageSync('token', issued)
|
||||
// xuchao: 标记本次会话为云闪付免密登录——商户详情付款码按此放行
|
||||
uni.setStorageSync('loginWay', 'ysf')
|
||||
this.$u.api.getEligibility({ phone: res.data.mobile, identityNo: res.data.idNo || '', name: res.data.name || '' }).then(eRes => {
|
||||
if (eRes.errcode === 0) {
|
||||
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
||||
@@ -150,6 +199,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: 与商户折扣页同款跳转——品牌详情页
|
||||
uni.navigateTo({ url: '/pages/shop/detail?id=' + s.shopId })
|
||||
},
|
||||
goRights() {
|
||||
// xuchao: 免密登录还没返回时不放行,避免带着空/旧身份进权益页
|
||||
if (this.tokenLoginPending) {
|
||||
@@ -176,100 +242,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-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>
|
||||
|
||||
@@ -131,6 +131,8 @@ export default {
|
||||
const issued = [payload.accessToken, payload.token].find(v => typeof v === 'string' && v.length > 0)
|
||||
uni.setStorageSync('token', issued || '')
|
||||
uni.setStorageSync('phone', this.phone)
|
||||
// xuchao: 标记登录方式为手机验证码——付款码仅放行云闪付免密登录(ysf),验证码登录会被引导
|
||||
uni.setStorageSync('loginWay', 'sms')
|
||||
this.$u.api.getEligibility({ phone: this.phone, identityNo: '', name: '' }).then(eRes => {
|
||||
if (eRes.errcode === 0) {
|
||||
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
||||
@@ -139,7 +141,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'
|
||||
@@ -239,7 +244,7 @@ export default {
|
||||
|
||||
.code-btn {
|
||||
font-size: 26rpx;
|
||||
color: #0088FF;
|
||||
color: #E0342B;
|
||||
padding: 0 24rpx;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
@@ -254,7 +259,7 @@ export default {
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
text-align: center;
|
||||
background-color: #0088FF;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
@@ -272,7 +277,7 @@ export default {
|
||||
.checkbox {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 2rpx solid #0088FF;
|
||||
border: 2rpx solid #E8542F;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -282,7 +287,7 @@ export default {
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
background-color: #0088FF;
|
||||
background-color: #E8542F;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
@@ -297,7 +302,7 @@ export default {
|
||||
|
||||
.agreement-link {
|
||||
font-size: 24rpx;
|
||||
color: #0088FF;
|
||||
color: #E0342B;
|
||||
}
|
||||
|
||||
/* xuchao: 顶部返回导航条(负外边距抵消页面左右 padding,通栏展示) */
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT,
|
||||
VOUCHER_PAY_WHITELIST_PHONE, isUnionPayApp, bizOk, bizMsg, bizData
|
||||
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT, VOUCHER_CANCEL_TEXT,
|
||||
bizOk, bizMsg, bizData
|
||||
} from '@/common/petrolVoucher.js'
|
||||
|
||||
export default {
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
uni.redirectTo({ url: '/pages/index/login?redirect=' + encodeURIComponent('/pages/venue/detail?id=851219003520709&type=2') })
|
||||
return
|
||||
}
|
||||
this.loadUpSdk() // xuchao: 运行时注入云闪付 SDK(构建模板不可靠,见 loadUpSdk 注释)
|
||||
this.loadUpSdk() // xuchao: 运行时兜底注入(静态标签已在发布脚本注入产物 index.html,见 h5-release.sh)
|
||||
if (options.orderNo) this.orderNo = options.orderNo
|
||||
this.initFromServer()
|
||||
},
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
this._upSdkPromise = loading
|
||||
return loading
|
||||
},
|
||||
// xuchao: 价格展示以服务端 latest 为准(测试期 0.01);已有待支付单自动续用;已发券直接跳券详情
|
||||
// xuchao: 价格展示以服务端 latest 为准;已有待支付单自动续用;已发券直接跳券详情
|
||||
initFromServer() {
|
||||
this.$u.api.voucherLatest({ phone: this.phone }).then(res => {
|
||||
if (!bizOk(res)) return
|
||||
@@ -133,11 +133,8 @@ export default {
|
||||
},
|
||||
onConfirmPay() {
|
||||
if (this.submitting) return
|
||||
// xuchao: 容器拦截——非云闪付且非联调白名单号,弹窗不发起支付(决策 11/13)
|
||||
if (!isUnionPayApp() && this.phone !== VOUCHER_PAY_WHITELIST_PHONE) {
|
||||
this.guideModal = true
|
||||
return
|
||||
}
|
||||
// xuchao: 不做容器/白名单前置拦截,直接发起;云闪付控件在站外唤不起时
|
||||
// 由 pay 的 fail 回调统一弹「去云闪付」指引模态(决策 11 修订:去白名单)
|
||||
this.submitting = true
|
||||
this.doPay()
|
||||
},
|
||||
@@ -168,7 +165,9 @@ export default {
|
||||
const ready = await this.loadUpSdk()
|
||||
if (!ready) {
|
||||
this.submitting = false
|
||||
uni.showToast({ title: '支付组件加载失败,请稍后重试', icon: 'none' })
|
||||
// xuchao: 临时诊断(定位弹窗真因后移除):SDK 加载不出来时展示 UA 片段
|
||||
this.guideText = '支付SDK未能加载[诊断] UA=' + (typeof navigator !== 'undefined' ? String(navigator.userAgent).slice(0, 120) : 'N/A')
|
||||
this.guideModal = true
|
||||
return
|
||||
}
|
||||
window.upsdk.pluginReady(() => {
|
||||
@@ -177,9 +176,12 @@ export default {
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages/petrol/voucherDetail?orderNo=' + this.orderNo })
|
||||
},
|
||||
fail: () => {
|
||||
fail: (err) => {
|
||||
// xuchao: 控件回调失败(含用户取消)。按 xuchao 要求文案定为取消提示;
|
||||
// [诊断] 行临时保留采集真实错误码,区分"取消"与"容器不支持"后移除并分文案
|
||||
this.submitting = false
|
||||
uni.showToast({ title: '支付未完成,可在门店页继续支付', icon: 'none' })
|
||||
this.guideText = VOUCHER_CANCEL_TEXT + '\n[诊断] ' + JSON.stringify(err || {})
|
||||
this.guideModal = true
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view v-if="detail">
|
||||
<!-- xuchao: 底部「立即预约」是 fixed 不占位,短屏滚到底会把「权益说明」压住;
|
||||
有底栏时给内容区预留 80px(底栏 68px + 12px 呼吸位)+ 安全区 -->
|
||||
<view v-if="detail" :class="{ 'has-bottom-bar': detail.isAppointment }">
|
||||
<!-- 门店信息卡片(信息+地址合并容器) -->
|
||||
<view class="store-card">
|
||||
<view class="store-main">
|
||||
@@ -280,7 +282,7 @@ export default {
|
||||
.section-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
@@ -312,8 +314,8 @@ export default {
|
||||
}
|
||||
|
||||
.date-card.active {
|
||||
background-color: #0088ff;
|
||||
border-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
border-color: #E8542F;
|
||||
}
|
||||
|
||||
.date-card.disabled {
|
||||
@@ -378,8 +380,8 @@ export default {
|
||||
}
|
||||
|
||||
.time-slot-card.active {
|
||||
background-color: #0088ff;
|
||||
border-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
border-color: #E8542F;
|
||||
}
|
||||
|
||||
.slot-name {
|
||||
@@ -420,7 +422,7 @@ export default {
|
||||
|
||||
.discount-tag-icon {
|
||||
font-size: 16px;
|
||||
color: #0088ff;
|
||||
color: #E0342B;
|
||||
}
|
||||
|
||||
.discount-title {
|
||||
@@ -442,6 +444,11 @@ export default {
|
||||
}
|
||||
|
||||
/* 底部预约按钮 */
|
||||
/* xuchao: 内容区为 fixed 底栏预留的高度,短屏下「权益说明」才不会被遮住 */
|
||||
.has-bottom-bar {
|
||||
padding-bottom: calc(80px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
@@ -454,7 +461,7 @@ export default {
|
||||
}
|
||||
|
||||
.book-btn {
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
<text class="nav-title">权益资格认证</text>
|
||||
</view>
|
||||
<!-- 返回按钮(顶部,非auth状态)-->
|
||||
<view class="back-btn" :class="{ 'back-btn--black': status === 'noWin' }" @click="goBack" v-if="status !== 'auth'">
|
||||
<u-icon name="arrow-left" :color="status === 'noWin' ? '#000000' : '#ffffff'" size="40"></u-icon>
|
||||
<!-- xuchao: noWin 整页为深蓝色调权益包长图,返回按钮统一用白色(原 noWin 黑色已去掉) -->
|
||||
<view class="back-btn" @click="goBack" v-if="status !== 'auth'">
|
||||
<u-icon name="arrow-left" color="#ffffff" size="40"></u-icon>
|
||||
<text class="back-text">返回</text>
|
||||
</view>
|
||||
<!-- 状态1: 权益资格认证 -->
|
||||
@@ -51,10 +52,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 状态2: 未中奖 -->
|
||||
<view v-if="status === 'noWin'" class="empty-container">
|
||||
<image class="empty-img" src="https://aliyunoss.hn12301.net/hhrs/hhrs_wzj.png" mode="widthFix" />
|
||||
<text class="empty-text">您暂未中奖</text>
|
||||
<!-- 状态2: 未中奖(无权益) -->
|
||||
<!-- xuchao: 整页展示权益包明细长图,不再显示「您暂未中奖」提示与占位图标 -->
|
||||
<view v-if="status === 'noWin'">
|
||||
<image class="qyb-detail-img" src="https://zhihuiyou.oss-cn-shenzhen.aliyuncs.com/hhrs/hhrs_qyb1.jpg" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
<!-- 状态3: 权益信息 -->
|
||||
@@ -89,7 +90,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- xuchao: Tab + 搜索 + 县区/类型筛选一起吸顶;筛选只作用于「待使用」(另两个 Tab 的接口不返回地址与分类) -->
|
||||
<view class="info-sticky">
|
||||
<!-- Tab 切换 -->
|
||||
<view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index" class="tab-item"
|
||||
@@ -97,20 +100,27 @@
|
||||
<text class="tab-text">{{ tab }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-area" v-if="currentTab==0">
|
||||
<view class="search-bar">
|
||||
<u-icon name="search" color="#cccccc" size="24"></u-icon>
|
||||
<input class="search-input" v-model="keyword" placeholder="搜索权益商家" @confirm="onSearch" />
|
||||
</view>
|
||||
<!-- xuchao: 所属县区 + 所属类型筛选,选项与联动条数由列表接口一并返回 -->
|
||||
<hhrs-filter-bar :districts="filters.districts" :categories="filters.categories"
|
||||
:district-id="districtId" :category="category" @change="onFilterChange" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 权益列表 -->
|
||||
<!-- xuchao: 三 Tab 列表统一改普通容器 + 页面级触底分页(scroll-view 无固定高度时 scrolltolower 永不触发) -->
|
||||
<view class="list-area" v-if="currentTab==0">
|
||||
<view class="list-area list-area--todo" v-if="currentTab==0">
|
||||
<view class="rights-card" v-for="item in rightsList" :key="item.ruleId" @click="goDetail(item)">
|
||||
<view class="card-thumb">
|
||||
<image class="card-img" :src="item.image" mode="aspectFill" />
|
||||
<!-- xuchao: 左上角所属地区角标(districtName 来自商铺「所在地区」,未录入则不显示) -->
|
||||
<text class="card-area" v-if="item.districtName">{{ shortDistrict(item.districtName) }}</text>
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<view class="card-name">{{ item.name }}</view>
|
||||
<view class="card-category">{{ item.category }}</view>
|
||||
@@ -171,7 +181,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// xuchao: 角标区县简称(后端返回的是行政区划全称)
|
||||
import { shortDistrict } from '@/common/district.js'
|
||||
// xuchao: 县区 + 类型筛选条,三个列表页共用(pages.json 的 easycom 只给 u- 前缀配了规则,这里显式引入)
|
||||
import HhrsFilterBar from '@/components/hhrs-filter-bar/hhrs-filter-bar.vue'
|
||||
|
||||
export default {
|
||||
components: { HhrsFilterBar },
|
||||
data() {
|
||||
return {
|
||||
status: 'auth',
|
||||
@@ -189,6 +205,14 @@
|
||||
tabs: ['待使用', '已预约', '已使用'],
|
||||
currentTab: 0,
|
||||
keyword: '',
|
||||
// xuchao: 待使用列表的县区/类型筛选条件与面板选项(选项由列表响应带回)
|
||||
districtId: '',
|
||||
category: '',
|
||||
filters: { districts: [], categories: [] },
|
||||
// xuchao: 待使用列表的县区/类型筛选条件与面板选项(选项由列表响应带回)
|
||||
districtId: '',
|
||||
category: '',
|
||||
filters: { districts: [], categories: [] },
|
||||
rightsList: [],
|
||||
appointmentList: [],
|
||||
checkList: [],
|
||||
@@ -262,6 +286,7 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
shortDistrict,
|
||||
// xuchao: 缓存的权益状态可能过期(中奖/权益包会变化),每次进页面仅凭手机号向服务端
|
||||
// 复查最新状态并覆盖缓存(不带证件号,避免触发被动认证)
|
||||
refreshStatus() {
|
||||
@@ -421,6 +446,35 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
// xuchao: 认证前预检——证件号未关联本活动权益卡(card_bind)就不发起人脸核验,避免白花实名认证费用
|
||||
this.$u.api.checkWinner({
|
||||
identityNo: (this.form.idNumber || '').trim()
|
||||
}).then(res => {
|
||||
if (res.errcode !== 0 || !res.data) {
|
||||
uni.showToast({
|
||||
title: res.errmsg || '查询中奖状态失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!res.data.isWinner) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您暂未中奖,请中奖后再进入认证',
|
||||
showCancel: false
|
||||
})
|
||||
return
|
||||
}
|
||||
this.startFaceVerify()
|
||||
}).catch(() => {
|
||||
// xuchao: 预检查询异常一律不放行进人脸,网络恢复后可重试
|
||||
uni.showToast({
|
||||
title: '查询中奖状态失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
startFaceVerify() {
|
||||
uni.setStorageSync('authName', this.form.realName)
|
||||
uni.setStorageSync('authIdNo', this.form.idNumber)
|
||||
// xuchao: 标记已发起认证流程,取消后停留在认证页,不自动恢复
|
||||
@@ -495,10 +549,19 @@
|
||||
params.keyword = this.keyword
|
||||
params.lng = this.lng
|
||||
params.lat = this.lat
|
||||
if (this.districtId) params.districtId = this.districtId
|
||||
if (this.category) params.category = this.category
|
||||
request = this.$u.api.getRightsList(params)
|
||||
}
|
||||
request.then(res => {
|
||||
if (seq !== p.reqSeq) return
|
||||
// xuchao: 筛选面板选项只随「待使用」列表返回,另两个 Tab 不覆盖
|
||||
if (tab === 0 && res.errcode === 0 && res.data) {
|
||||
this.filters = {
|
||||
districts: res.data.districts || [],
|
||||
categories: res.data.categories || []
|
||||
}
|
||||
}
|
||||
if (res.errcode === 0 && res.data) {
|
||||
const list = res.data.list || []
|
||||
const prev = this.listOf(tab)
|
||||
@@ -538,6 +601,12 @@
|
||||
onSearch() {
|
||||
this.loadList(0, true)
|
||||
},
|
||||
// xuchao: 换筛选条件即回第 1 页重查(关键词保持不变,两者为 AND)
|
||||
onFilterChange(e) {
|
||||
this.districtId = e.districtId
|
||||
this.category = e.category
|
||||
this.loadList(0, true)
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/rights/detail?id=' + item.ruleId
|
||||
@@ -579,7 +648,7 @@
|
||||
.title-bar {
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
border-radius: 2px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
@@ -641,7 +710,7 @@
|
||||
|
||||
.auth-btn {
|
||||
margin: 24px 0;
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
@@ -668,28 +737,9 @@
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 未中奖空状态 */
|
||||
.empty-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 160px;
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 18px;
|
||||
color: #999999;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
/* 权益信息 - 蓝色横幅 */
|
||||
.banner-area {
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
padding: 80px 16px 96px;
|
||||
border-radius: 0 0 50px 50px;
|
||||
}
|
||||
@@ -714,7 +764,7 @@
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #ffffff;
|
||||
color: #0088ff;
|
||||
color: #E0342B;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
line-height: 18px;
|
||||
@@ -794,11 +844,20 @@
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
/* xuchao: Tab + 搜索 + 筛选条一起吸顶。padding-top 替代原 tab-bar 的 margin-top,
|
||||
否则吸顶后顶部会留一条能透出列表内容的缝隙;z-index 需高于筛选遮罩(90) */
|
||||
.info-sticky {
|
||||
background-color: #ffffff;
|
||||
padding-top: 12px;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
/* Tab 切换 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
background-color: #ffffff;
|
||||
margin-top: 12px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
@@ -817,7 +876,7 @@
|
||||
transform: translateX(-50%);
|
||||
width: 24px;
|
||||
height: 3px;
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
@@ -827,13 +886,14 @@
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #0088ff;
|
||||
color: #E0342B;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 搜索栏 */
|
||||
.search-area {
|
||||
padding: 12px;
|
||||
/* xuchao: 底部留白交给筛选条的 20rpx 上内边距,保证三段间距一致 */
|
||||
padding: 12px 12px 0;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
@@ -841,6 +901,10 @@
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
background-color: #ffffff;
|
||||
/* xuchao: 头部改白底后,白色搜索框在白色吸顶栏上必须描边才分得出来;
|
||||
显式 border-box 保证加边框后高度仍是 36px */
|
||||
border: 1px solid #e5e5ea;
|
||||
box-sizing: border-box;
|
||||
border-radius: 18px;
|
||||
padding: 0 12px;
|
||||
gap: 8px;
|
||||
@@ -861,6 +925,12 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* xuchao: 「待使用」列表顶部 24rpx(=12px) 灰底间隔,与卡片之间的间距一致,
|
||||
也与筛选条和列表之间的 12px 对齐;只加在这个 Tab,不影响「已预约/已使用」 */
|
||||
.list-area--todo {
|
||||
padding-top: 24rpx;
|
||||
}
|
||||
|
||||
.nomore-area {
|
||||
width: 100%;
|
||||
padding-bottom: 24px;
|
||||
@@ -876,13 +946,39 @@
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
.card-thumb {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* xuchao: image 由 thumb 裁圆角,自身不再设圆角 */
|
||||
.card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card-area {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
padding: 1px 5px;
|
||||
border-radius: 0 0 6px 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
color: #ffffff;
|
||||
font-size: 10px;
|
||||
line-height: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
width: 490rpx;
|
||||
margin-left: 14rpx;
|
||||
@@ -969,9 +1065,10 @@
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* xuchao: noWin 状态(无中奖空态页)返回按钮改黑色 */
|
||||
.back-btn--black .back-text {
|
||||
color: #000000;
|
||||
/* xuchao: 无权益(未中奖)页整页展示的权益包明细长图,通栏 */
|
||||
.qyb-detail-img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* xuchao: 顶部返回导航条(auth状态) */
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<!-- xuchao: 商户(品牌)详情页,按参考图三卡布局;brand 未关联/后端未发布时全部字段走回退,页面不留白 -->
|
||||
<view class="page">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-bar">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<u-icon name="arrow-left" color="#333333" size="40"></u-icon>
|
||||
<text class="back-text">返回</text>
|
||||
</view>
|
||||
<text class="nav-title">商户详情</text>
|
||||
<view style="width: 100rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view class="body" v-if="shop">
|
||||
<!-- 头部卡 -->
|
||||
<view class="head-card">
|
||||
<view class="head-top">
|
||||
<view class="logo-box">
|
||||
<image class="logo" :src="shop.brandLogo || shop.image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<text class="head-name">{{ shop.brandName || shop.name }}</text>
|
||||
<view class="badge" v-if="badgeMain">
|
||||
<text class="badge-main">{{ badgeMain }}</text>
|
||||
<text class="badge-sub" v-if="badgeSub">{{ badgeSub }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="head-divider"></view>
|
||||
<view class="head-meta">
|
||||
<text class="meta-line" v-if="shop.brandType || shop.category">{{ shop.brandType || shop.category }}</text>
|
||||
<text class="meta-line" v-if="shop.businessTime">营业时间:{{ shop.businessTime }}</text>
|
||||
</view>
|
||||
<view class="pay-btn" @click="onPayCode">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="7" height="7" rx="1.5" stroke="#fff" stroke-width="2"/><rect x="14" y="3" width="7" height="7" rx="1.5" stroke="#fff" stroke-width="2"/><rect x="3" y="14" width="7" height="7" rx="1.5" stroke="#fff" stroke-width="2"/><path d="M14 14h3v3h-3zM18 18h3v3h-3z" fill="#fff"/></svg>
|
||||
<text class="pay-btn-text">付款码</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠说明 -->
|
||||
<view class="card">
|
||||
<view class="card-title"><view class="bar"></view><text>优惠说明</text></view>
|
||||
<!-- 品牌富文本优先 -->
|
||||
<rich-text v-if="shop.discountRules" :nodes="shop.discountRules" class="rules-rich"></rich-text>
|
||||
<!-- 回退:merchantDiscount/remark 按分号换行拆编号列表 -->
|
||||
<view v-else-if="fallbackRules.length">
|
||||
<view class="rule-line" v-for="(r, i) in fallbackRules" :key="i">
|
||||
<text class="rule-no">{{ i + 1 }}</text>
|
||||
<text class="rule-txt">{{ r }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text v-else class="rule-empty">到店出示社保卡咨询店员</text>
|
||||
</view>
|
||||
|
||||
<!-- 适用门店 -->
|
||||
<view class="card" v-if="shops.length">
|
||||
<view class="shops-head">
|
||||
<text class="shops-title">适用门店<text class="shops-count">(共{{ shops.length }}家)</text></text>
|
||||
<view class="shops-more" v-if="shops.length > 4 && !showAll" @click="showAll = true">
|
||||
<text>查看全部</text><view class="chev"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop-row" v-for="(s, i) in visibleShops" :key="s.shopId">
|
||||
<view class="pin">
|
||||
<svg width="15" height="19" viewBox="0 0 15 19"><path d="M7.5 1C4 1 1.2 3.8 1.2 7.3c0 4.5 6.3 10.7 6.3 10.7s6.3-6.2 6.3-10.7C13.8 3.8 11 1 7.5 1z" fill="#E8542F"/><circle cx="7.5" cy="7.2" r="2.4" fill="#fff"/></svg>
|
||||
</view>
|
||||
<view class="shop-info">
|
||||
<text class="shop-name">{{ s.name }}</text>
|
||||
<text class="shop-addr">{{ s.address }}</text>
|
||||
</view>
|
||||
<view class="shop-right">
|
||||
<text class="shop-dist" v-if="s.distance != null">{{ s.distance < 1 ? Math.round(s.distance * 1000) + 'm' : s.distance.toFixed(1) + 'km' }}</text>
|
||||
<view class="icon-btn" @click.stop="navTo(s)">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M12 2 20 21l-8-5.2L4 21Z" fill="#333"/></svg>
|
||||
</view>
|
||||
<view class="icon-btn" @click.stop="callShop(s)" v-if="s.mobile">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M5 4h4l1.8 4.3-2.4 1.7a12 12 0 0 0 5.6 5.6l1.7-2.4L20 15v4a1.8 1.8 0 0 1-2 1.8C9.7 20 4 14.3 3.2 6A1.8 1.8 0 0 1 5 4Z" fill="#333"/></svg>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="collapse" v-if="showAll && shops.length > 4" @click="showAll = false">收起 <text class="chev up"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="loading-tip" v-else>加载中…</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopId: '',
|
||||
shop: null,
|
||||
showAll: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// xuchao: 角标主文案 = 结构化优惠文案;未迁移回退从原文提取优惠词(X折/满X减X),避免整段撑爆角标
|
||||
badgeMain() {
|
||||
if (!this.shop) return ''
|
||||
if (this.shop.discountDisplay) return this.shop.discountDisplay
|
||||
const m = (this.shop.merchantDiscount || '').match(/(\d+(?:\.\d+)?折|满\s*\d+(?:\.\d+)?\s*(?:元)?\s*减\s*\d+(?:\.\d+)?\s*元|立减\s*\d+(?:\.\d+)?\s*元|免费体验)/)
|
||||
if (m) return m[1].replace(/\s/g, '')
|
||||
const t = (this.shop.merchantDiscount || '').split(/[;;\n]/)[0]
|
||||
return t ? t.slice(0, 8) : ''
|
||||
},
|
||||
badgeSub() {
|
||||
if (!this.shop) return ''
|
||||
if (this.shop.discountDisplay) return this.shop.payRule || (this.shop.payMode ? '付款立减' : '付款立减')
|
||||
return ''
|
||||
},
|
||||
fallbackRules() {
|
||||
const t = (this.shop && (this.shop.merchantDiscount || this.shop.usageNote)) || ''
|
||||
return t.split(/[;;\n]/).map(x => x.trim()).filter(Boolean)
|
||||
},
|
||||
shops() {
|
||||
if (!this.shop) return []
|
||||
if (this.shop.brandShops && this.shop.brandShops.length) return this.shop.brandShops
|
||||
// xuchao: 品牌未关联时退化为当前单店一行,模块结构不消失
|
||||
return [{ shopId: this.shop.shopId, name: this.shop.name, address: this.shop.address,
|
||||
distance: this.shop.distance, mobile: this.shop.servicePhone,
|
||||
lng: this.shop.lng, lat: this.shop.lat }]
|
||||
},
|
||||
visibleShops() {
|
||||
return this.showAll ? this.shops : this.shops.slice(0, 4)
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.shopId = options.id || options.shopId
|
||||
const lng = uni.getStorageSync('lng')
|
||||
const lat = uni.getStorageSync('lat')
|
||||
const params = { shopId: this.shopId }
|
||||
if (lng) params.lng = lng
|
||||
if (lat) params.lat = lat
|
||||
this.$u.api.getStoreDetail(params).then(res => {
|
||||
if (res.errcode === 0 && res.data) {
|
||||
this.shop = res.data
|
||||
} else {
|
||||
uni.showToast({ title: res.errmsg || '门店不存在', icon: 'none' })
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
const pages = getCurrentPages()
|
||||
if (pages.length > 1) uni.navigateBack()
|
||||
else uni.reLaunch({ url: '/pages/index/index' })
|
||||
},
|
||||
// xuchao: 付款码——对齐 ysf 项目首页做法:upsdk.qrCodePay() 由云闪付容器原生拉起付款码,无 web 跳转。
|
||||
// SDK 加载复用加油页验证过的注入模式;拉不起的场景(非容器/加载失败/非免密登录)统一弹 payGuide
|
||||
onPayCode() {
|
||||
this.loadUpSdk().then(ready => {
|
||||
if (!ready) { this.payGuide(); return }
|
||||
try {
|
||||
// xuchao: 微信等普通浏览器里 upsdk 脚本能加载但桥永不就绪,pluginReady 回调不到;
|
||||
// 3 秒无响应即判定非云闪付容器(容器内通常 <1s 已拉起付款码)
|
||||
let bridged = false
|
||||
const timer = setTimeout(() => { if (!bridged) this.payGuide() }, 3000)
|
||||
window.upsdk.pluginReady(() => {
|
||||
bridged = true
|
||||
clearTimeout(timer)
|
||||
// xuchao: 付款码依赖云闪付账号与社保卡的绑定关系——只对免密登录(ysf)会话开放;
|
||||
// 验证码登录/未登录时容器钱包账号与本活动身份可能不一致,提示而不是拉起
|
||||
if (uni.getStorageSync('loginWay') !== 'ysf') { this.payGuide(); return }
|
||||
try { window.upsdk.qrCodePay() }
|
||||
catch (e) { uni.showToast({ title: '拉起付款码失败,请重试', icon: 'none' }) }
|
||||
})
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '拉起付款码失败,请重试', icon: 'none' })
|
||||
}
|
||||
})
|
||||
},
|
||||
// xuchao: 付款码不可用时的统一提示(运营定稿文案;按反馈改为轻提示两行显示,不用确认弹窗)
|
||||
payGuide() {
|
||||
uni.showToast({
|
||||
title: '暂时无法使用付款码\n请登录云闪付 app 打开付款码进行使用',
|
||||
icon: 'none',
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
// xuchao: upsdk 运行时注入并返回就绪 Promise(与 petrol/orderConfirm 同一模式,全局只注入一次;
|
||||
// 不能依赖 index.html 静态标签——HBuilderX 构建的 H5 模板不吃根 index.html)
|
||||
loadUpSdk(timeout = 9000) {
|
||||
if (typeof window === 'undefined' || typeof document === 'undefined') return Promise.resolve(false)
|
||||
if (window.upsdk) return Promise.resolve(true)
|
||||
if (this._upSdkPromise) return this._upSdkPromise
|
||||
const loading = new Promise(resolve => {
|
||||
let done = false
|
||||
const finish = v => { if (!done) { done = true; resolve(v) } }
|
||||
const exists = document.querySelector('script[data-upsdk]')
|
||||
if (exists) {
|
||||
const t0 = Date.now()
|
||||
const timer = setInterval(() => {
|
||||
if (window.upsdk) { clearInterval(timer); finish(true) }
|
||||
else if (Date.now() - t0 > timeout) { clearInterval(timer); finish(false) }
|
||||
}, 200)
|
||||
return
|
||||
}
|
||||
const s = document.createElement('script')
|
||||
s.src = 'https://open.95516.com/s/open/js/upsdk.js'
|
||||
s.setAttribute('data-upsdk', '1')
|
||||
s.onload = () => finish(!!window.upsdk)
|
||||
s.onerror = () => finish(false)
|
||||
document.head.appendChild(s)
|
||||
setTimeout(() => finish(!!window.upsdk), timeout)
|
||||
})
|
||||
this._upSdkPromise = loading
|
||||
return loading
|
||||
},
|
||||
navTo(s) {
|
||||
if (!s.lng || !s.lat) {
|
||||
uni.showToast({ title: '该门店暂未录入坐标', icon: 'none' })
|
||||
return
|
||||
}
|
||||
// #ifdef H5
|
||||
window.open('https://uri.amap.com/marker?position=' + s.lng + ',' + s.lat + '&name=' + encodeURIComponent(s.name), '_blank')
|
||||
// #endif
|
||||
},
|
||||
callShop(s) {
|
||||
if (!s.mobile) return
|
||||
uni.makePhoneCall({ phoneNumber: String(s.mobile), fail: () => uni.showToast({ title: '拨号取消', icon: 'none' }) })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.page { min-height: 100vh; background: #F6EFE6; }
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.nav-bar {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
height: 88rpx; padding: 0 24rpx; padding-top: var(--status-bar-height);
|
||||
background: #FFF;
|
||||
}
|
||||
.back-btn { display: flex; align-items: center; width: 100rpx; }
|
||||
.back-text { font-size: 28rpx; color: #333; margin-left: 4rpx; }
|
||||
.nav-title { font-size: 34rpx; font-weight: 600; color: #333; }
|
||||
|
||||
.body { padding: 24rpx; }
|
||||
|
||||
.head-card {
|
||||
background: linear-gradient(180deg, #FFF7EC 0%, #FFFDF9 40%, #FFFFFF 100%);
|
||||
border-radius: 28rpx; padding: 28rpx;
|
||||
}
|
||||
.head-top { display: flex; align-items: center; gap: 20rpx; }
|
||||
.logo-box {
|
||||
width: 96rpx; height: 96rpx; border-radius: 16rpx; overflow: hidden;
|
||||
background: #fff; border: 1rpx solid #F2E4D0; flex-shrink: 0;
|
||||
}
|
||||
.logo { width: 100%; height: 100%; display: block; }
|
||||
.head-name {
|
||||
flex: 1; min-width: 0; font-size: 36rpx; font-weight: 800; color: #33200F;
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.badge {
|
||||
flex-shrink: 0; min-width: 132rpx; border-radius: 14rpx; padding: 12rpx 16rpx;
|
||||
background: linear-gradient(160deg, #F0623A, #D8431F);
|
||||
display: flex; flex-direction: column; align-items: center;
|
||||
box-shadow: 0 6rpx 14rpx rgba(216, 67, 31, .35);
|
||||
}
|
||||
.badge-main { font-size: 30rpx; font-weight: 900; color: #fff; line-height: 1.2; white-space: nowrap; }
|
||||
.badge-sub { font-size: 18rpx; color: rgba(255, 255, 255, .92); margin-top: 4rpx; white-space: nowrap; }
|
||||
.head-divider { height: 1rpx; background: #F3E7D7; margin: 24rpx 0 18rpx; }
|
||||
.head-meta { display: flex; flex-direction: column; gap: 8rpx; }
|
||||
.meta-line { font-size: 24rpx; color: #8A6E56; }
|
||||
.pay-btn {
|
||||
margin-top: 28rpx; height: 88rpx; border-radius: 16rpx;
|
||||
background: linear-gradient(90deg, #D8431F, #E8542F 55%, #F0703C);
|
||||
display: flex; align-items: center; justify-content: center; gap: 12rpx;
|
||||
box-shadow: 0 8rpx 18rpx rgba(216, 67, 31, .28);
|
||||
}
|
||||
.pay-btn-text { font-size: 32rpx; font-weight: 700; color: #fff; letter-spacing: 2rpx; }
|
||||
|
||||
.card { background: #fff; border-radius: 28rpx; padding: 28rpx; margin-top: 24rpx; }
|
||||
.card-title { display: flex; align-items: center; gap: 14rpx; font-size: 32rpx; font-weight: 800; color: #33200F; }
|
||||
.bar { width: 8rpx; height: 30rpx; border-radius: 4rpx; background: linear-gradient(180deg, #F6613C, #E01818); }
|
||||
.rules-rich { display: block; margin-top: 20rpx; font-size: 28rpx; color: #4A3A2E; line-height: 1.7; }
|
||||
.rule-line { display: flex; margin-top: 20rpx; }
|
||||
.rule-no { width: 32rpx; flex-shrink: 0; font-size: 28rpx; color: #4A3A2E; line-height: 1.7; }
|
||||
.rule-txt { flex: 1; font-size: 28rpx; color: #4A3A2E; line-height: 1.7; }
|
||||
.rule-empty { display: block; margin-top: 16rpx; font-size: 26rpx; color: #B8A28E; }
|
||||
|
||||
.shops-head { display: flex; align-items: center; justify-content: space-between; }
|
||||
.shops-title { font-size: 32rpx; font-weight: 800; color: #33200F; }
|
||||
.shops-count { font-size: 24rpx; font-weight: 400; color: #A78D75; }
|
||||
.shops-more { display: flex; align-items: center; gap: 4rpx; font-size: 26rpx; color: #E0342B; font-weight: 600; }
|
||||
.chev { width: 10rpx; height: 10rpx; border-top: 3rpx solid #E0342B; border-right: 3rpx solid #E0342B; transform: rotate(45deg); }
|
||||
.chev.up { transform: rotate(-135deg); width: 8rpx; height: 8rpx; }
|
||||
|
||||
.shop-row {
|
||||
display: flex; align-items: center; gap: 16rpx;
|
||||
padding: 26rpx 0; border-bottom: 1rpx solid #F5EDE2;
|
||||
}
|
||||
.shop-row:last-child { border-bottom: none; }
|
||||
.pin { flex-shrink: 0; }
|
||||
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6rpx; }
|
||||
.shop-name { font-size: 28rpx; font-weight: 700; color: #33200F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.shop-addr { font-size: 22rpx; color: #A78D75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.shop-right { display: flex; align-items: center; gap: 14rpx; flex-shrink: 0; }
|
||||
.shop-dist { font-size: 22rpx; color: #C8542B; margin-right: 4rpx; }
|
||||
.icon-btn {
|
||||
width: 56rpx; height: 56rpx; border-radius: 50%; background: #F6F2EC;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.collapse { text-align: center; font-size: 24rpx; color: #A78D75; padding-top: 20rpx; display: flex; align-items: center; justify-content: center; gap: 8rpx; }
|
||||
.loading-tip { text-align: center; color: #B8A28E; font-size: 26rpx; padding: 120rpx 0; }
|
||||
</style>
|
||||
@@ -31,7 +31,7 @@
|
||||
<!-- 商户电话(取商铺客服电话字段,多个用,分隔,点击拨号) -->
|
||||
<view class="discount-section" v-if="servicePhoneList.length">
|
||||
<view class="section-title">
|
||||
<u-icon name="phone-fill" color="#1296DB" size="34"></u-icon>
|
||||
<u-icon name="phone-fill" color="#E0342B" size="34"></u-icon>
|
||||
<text class="discount-title">商户电话</text>
|
||||
</view>
|
||||
<view class="discount-list">
|
||||
@@ -113,8 +113,10 @@ export default {
|
||||
return this.detailType !== '2'
|
||||
},
|
||||
isPetrol() {
|
||||
// xuchao: 业务调整:该商铺不再需要特殊购买处理,前端入口整体隐藏;券页面/接口/SDK注入均保留,恢复时去掉下面的 return false 即可
|
||||
return false
|
||||
// xuchao: 后端券服务探活(latest 返回 price)后才展示购券模块——后端未部署期间整模块自动隐藏,无死入口
|
||||
return this.loaded && String(this.shopId) === PETROL_SHOP_ID && !this.isVenue && !!(this.voucher && this.voucher.price)
|
||||
// return this.loaded && String(this.shopId) === PETROL_SHOP_ID && !this.isVenue && !!(this.voucher && this.voucher.price)
|
||||
},
|
||||
voucherBtnText() {
|
||||
const s = this.voucher ? this.voucher.statusCode : -1
|
||||
@@ -335,7 +337,7 @@ export default {
|
||||
|
||||
.discount-tag-icon {
|
||||
font-size: 16px;
|
||||
color: #0088ff;
|
||||
color: #E0342B;
|
||||
}
|
||||
|
||||
.discount-title {
|
||||
@@ -358,7 +360,7 @@ export default {
|
||||
|
||||
/* xuchao: 可点击拨号的电话样式 */
|
||||
.phone-link {
|
||||
color: #0088ff;
|
||||
color: #E0342B;
|
||||
}
|
||||
|
||||
/* xuchao: 石油汽油券购买模块 */
|
||||
@@ -372,7 +374,7 @@ export default {
|
||||
.voucher-ticket {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(135deg, #0d6fe0, #2f9bff);
|
||||
background: linear-gradient(135deg, #D8431F, #F0703C);
|
||||
border-radius: 8px;
|
||||
padding: 14px;
|
||||
color: #ffffff;
|
||||
@@ -387,7 +389,7 @@ export default {
|
||||
height: 42px;
|
||||
margin-top: 12px;
|
||||
border-radius: 8px;
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
font-size: 15px;
|
||||
display: flex;
|
||||
|
||||
@@ -13,22 +13,31 @@
|
||||
<view class="search-btn" @click="onSearch">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- xuchao: 所属县区 + 所属类型筛选,选项与联动条数由列表接口一并返回 -->
|
||||
<hhrs-filter-bar :districts="filters.districts" :categories="filters.categories"
|
||||
:district-id="districtId" :category="category" @change="onFilterChange" />
|
||||
</view>
|
||||
|
||||
<!-- 场馆列表 -->
|
||||
<view class="list-area">
|
||||
<view class="venue-card" v-for="item in list" :key="item.shopId">
|
||||
<view class="card-thumb">
|
||||
<image class="card-img" :src="item.image" mode="aspectFill" />
|
||||
<!-- xuchao: 左上角所属地区角标(districtName 来自商铺「所在地区」,未录入则不显示) -->
|
||||
<text class="card-area" v-if="item.districtName">{{ shortDistrict(item.districtName) }}</text>
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<text class="card-name">{{ item.name }}</text>
|
||||
<text class="card-category">{{ item.category }}</text>
|
||||
<view class="card-bottom">
|
||||
<text class="card-address">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="card-distance" v-if="item.distance !== null">
|
||||
<u-icon name="map" color="#999999" size="24"></u-icon>
|
||||
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="hasScrolled" class="nomore-area">
|
||||
<u-loadmore :status="loadStatus" :load-text="{ loadmore: '', loading: '加载中...', nomore: '我也是有底线的' }" />
|
||||
</view>
|
||||
@@ -37,7 +46,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// xuchao: 角标区县简称(后端返回的是行政区划全称)
|
||||
import { shortDistrict } from '@/common/district.js'
|
||||
// xuchao: 县区 + 类型筛选条,三个列表页共用(pages.json 的 easycom 只给 u- 前缀配了规则,这里显式引入)
|
||||
import HhrsFilterBar from '@/components/hhrs-filter-bar/hhrs-filter-bar.vue'
|
||||
|
||||
export default {
|
||||
components: { HhrsFilterBar },
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
@@ -50,7 +65,11 @@ export default {
|
||||
lat: '',
|
||||
loadStatus: 'loadmore',
|
||||
hasScrolled: false,
|
||||
reqSeq: 0
|
||||
reqSeq: 0,
|
||||
// xuchao: 筛选条件与面板选项(选项由列表响应带回)
|
||||
districtId: '',
|
||||
category: '',
|
||||
filters: { districts: [], categories: [] }
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -68,6 +87,7 @@ export default {
|
||||
this.loadMore()
|
||||
},
|
||||
methods: {
|
||||
shortDistrict,
|
||||
loadList() {
|
||||
// xuchao: 请求序号 —— 新请求直接取代在途请求,过期响应整体丢弃(修复搜索竞态,故不再用 loading 提前 return)
|
||||
const seq = ++this.reqSeq
|
||||
@@ -81,9 +101,16 @@ export default {
|
||||
}
|
||||
if (this.lng) params.lng = this.lng
|
||||
if (this.lat) params.lat = this.lat
|
||||
if (this.districtId) params.districtId = this.districtId
|
||||
if (this.category) params.category = this.category
|
||||
this.$u.api.getStoreList(params).then(res => {
|
||||
if (seq !== this.reqSeq) return
|
||||
if (res.errcode === 0 && res.data) {
|
||||
// xuchao: 面板选项随列表一起回来(后端已按关键词与另一维度算好条数)
|
||||
this.filters = {
|
||||
districts: res.data.districts || [],
|
||||
categories: res.data.categories || []
|
||||
}
|
||||
const list = res.data.list || []
|
||||
if (this.pageNo === 1) {
|
||||
this.list = list
|
||||
@@ -126,6 +153,12 @@ export default {
|
||||
this.pageNo = 1
|
||||
this.list = []
|
||||
this.loadList()
|
||||
},
|
||||
// xuchao: 换筛选条件即回第 1 页重查(关键词保持不变,两者为 AND)
|
||||
onFilterChange(e) {
|
||||
this.districtId = e.districtId
|
||||
this.category = e.category
|
||||
this.onSearch()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,11 +173,11 @@ export default {
|
||||
|
||||
.search-area {
|
||||
background-color: #ffffff;
|
||||
padding: 6px 12px;
|
||||
/* xuchao: 滚动时固定在页面顶部 */
|
||||
padding: 6px 12px 0;
|
||||
/* xuchao: 滚动时固定在页面顶部;z-index 高于筛选遮罩(90),保证面板与选中态不被压住 */
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.nav-row {
|
||||
@@ -186,7 +219,7 @@ export default {
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
padding: 4px 10px;
|
||||
@@ -195,6 +228,7 @@ export default {
|
||||
}
|
||||
|
||||
.list-area {
|
||||
/* xuchao: 顶部 12px 必须是页面灰底(不能放进头部的白底里),否则与白色卡片连成一片看不出间隔 */
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
@@ -207,16 +241,42 @@ export default {
|
||||
padding: 24px 12px;
|
||||
gap: 12px;
|
||||
box-shadow: 0 2px 3px #f2f2f7;
|
||||
margin-bottom: 12px;
|
||||
margin: 12px;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
.card-thumb {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* xuchao: image 由 thumb 裁圆角,自身不再设圆角 */
|
||||
.card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card-area {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
padding: 1px 5px;
|
||||
border-radius: 0 0 6px 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
color: #ffffff;
|
||||
font-size: 10px;
|
||||
line-height: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
flex: 1;
|
||||
/* xuchao: flex 项默认 min-width:auto,nowrap 地址会把列宽撑破卡片;置 0 后子元素在实宽内省略 */
|
||||
@@ -224,12 +284,18 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-category {
|
||||
@@ -241,13 +307,22 @@ export default {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.card-bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-top: 8px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.card-address {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
color: #727272;
|
||||
margin-top: 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.card-distance {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<view class="search-area">
|
||||
<view class="search-bar">
|
||||
<u-icon name="search" color="#8e8e93" size="36"></u-icon>
|
||||
<input class="search-input" v-model="keyword" placeholder="搜索姓名/手机号" confirm-type="search" @confirm="onSearch" />
|
||||
<input class="search-input" v-model="keyword" placeholder="搜索姓名/手机号/身份证号" confirm-type="search" @confirm="onSearch" />
|
||||
<view class="search-btn" @click="onSearch">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -62,7 +62,10 @@
|
||||
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
|
||||
</view>
|
||||
</template>
|
||||
<!-- xuchao: 无名单时展示空态 -->
|
||||
<!-- xuchao: 无名单时展示空态;全量拉取/首屏预取进行中显示查询态,避免"暂无数据"闪现 -->
|
||||
<view class="loadmore-area" v-else-if="!datesLoaded || loadStatus === 'loading'">
|
||||
<u-loadmore status="loading" loading-text="查询中..." />
|
||||
</view>
|
||||
<view class="empty-area" v-else>
|
||||
<u-icon name="empty" size="60" color="#c8c8c8"></u-icon>
|
||||
<text class="empty-text">暂无数据</text>
|
||||
@@ -82,28 +85,37 @@ export default {
|
||||
pageNos: {},
|
||||
pageSize: 10,
|
||||
totals: {},
|
||||
// xuchao: 各期全量人数(无关键字),仅用于顶部"已产生"总数;搜索态不影响该统计
|
||||
periodTotals: {},
|
||||
// xuchao: 各期当前生效的查询关键字(loadMore 续拉用它,而非输入框实时值)
|
||||
queryKeywords: {},
|
||||
// xuchao: 各期请求序号,丢弃乱序返回的旧响应
|
||||
reqSeqs: {},
|
||||
totalWinners: 0,
|
||||
inFlight: 0,
|
||||
loadStatusMap: {},
|
||||
// xuchao: 期次日期接口是否已回,首屏未回前显示查询态而非空态
|
||||
datesLoaded: false,
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// xuchao: 服务端已按关键字模糊过滤,前端直接渲染当期列表
|
||||
currentList() {
|
||||
const list = this.winnerData[this.currentTab] || []
|
||||
if (!this.keyword) return list
|
||||
const kw = this.keyword.trim().toLowerCase()
|
||||
if (!kw) return list
|
||||
return list.filter(item =>
|
||||
(item.memberName && item.memberName.toLowerCase().includes(kw)) ||
|
||||
(item.memberPhone && item.memberPhone.includes(kw))
|
||||
)
|
||||
return this.winnerData[this.currentTab] || []
|
||||
},
|
||||
// xuchao: 各期独立的加载状态,避免并行请求互相覆盖
|
||||
loadStatus() {
|
||||
return this.loadStatusMap[this.currentTab] || 'nomore'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// xuchao: 关键字防抖 400ms 后走服务端模糊搜索(姓名/手机号/身份证任意片段)
|
||||
keyword() {
|
||||
clearTimeout(this._kwTimer)
|
||||
this._kwTimer = setTimeout(() => this.search(), 400)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadDates()
|
||||
},
|
||||
@@ -113,8 +125,10 @@ export default {
|
||||
methods: {
|
||||
loadDates() {
|
||||
this.$u.api.getWinnerDates().then(res => {
|
||||
this.datesLoaded = true
|
||||
if (res.errcode === 0 && res.data) {
|
||||
const dates = res.data
|
||||
// xuchao: 后端按日期倒序返回,期次须按开奖日期正序(最早=第一期),否则二期会被标成"第1期"
|
||||
const dates = res.data.slice().sort()
|
||||
this.tabs = dates.map((date, index) => ({
|
||||
name: `第${index + 1}期`,
|
||||
date: date
|
||||
@@ -124,74 +138,87 @@ export default {
|
||||
data[index] = []
|
||||
})
|
||||
this.winnerData = data
|
||||
// xuchao: 预置各期 key,保证 totals/pageNos/loadStatusMap 的响应式
|
||||
// xuchao: 预置各期 key,保证响应式
|
||||
this.totals = {}
|
||||
this.pageNos = {}
|
||||
this.loadStatusMap = {}
|
||||
this.periodTotals = {}
|
||||
this.queryKeywords = {}
|
||||
this.reqSeqs = {}
|
||||
dates.forEach((date, index) => {
|
||||
this.$set(this.totals, index, 0)
|
||||
this.$set(this.pageNos, index, 1)
|
||||
this.$set(this.loadStatusMap, index, 'loading')
|
||||
this.$set(this.periodTotals, index, 0)
|
||||
this.$set(this.queryKeywords, index, '')
|
||||
this.$set(this.reqSeqs, index, 0)
|
||||
})
|
||||
// xuchao: 预取各期第一页,汇总已产生总人数
|
||||
if (this.tabs.length > 0) {
|
||||
// xuchao: 预取各期第一页(无关键字),汇总已产生总人数
|
||||
this.tabs.forEach((tab, index) => {
|
||||
this.loadWinnerList(index, 1, true)
|
||||
this.loadTab(index, 1, '')
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => { this.datesLoaded = true })
|
||||
},
|
||||
loadWinnerList(tabIndex, pageNo, allowConcurrent) {
|
||||
// xuchao: 拉取某期某页;keyword 走服务端 LIKE(姓名/手机/身份证任意片段),空串=不过滤
|
||||
loadTab(tabIndex, pageNo, keyword) {
|
||||
if (!this.tabs[tabIndex]) return
|
||||
if (this.inFlight > 0 && !allowConcurrent) return
|
||||
// xuchao: 本期页码独立计算,缺省续拉该期下一页
|
||||
const page = pageNo || (this.pageNos[tabIndex] || 1)
|
||||
const kw = keyword || ''
|
||||
// xuchao: 递增序号,返回时仅最新请求生效,丢弃连续输入产生的乱序旧响应
|
||||
const seq = (this.reqSeqs[tabIndex] || 0) + 1
|
||||
this.$set(this.reqSeqs, tabIndex, seq)
|
||||
this.inFlight++
|
||||
this.$set(this.loadStatusMap, tabIndex, 'loading')
|
||||
const drawDate = this.tabs[tabIndex].date
|
||||
this.$u.api.getWinnerList({
|
||||
pageNo: page,
|
||||
pageNo: pageNo,
|
||||
pageSize: this.pageSize,
|
||||
drawDate: drawDate
|
||||
drawDate: this.tabs[tabIndex].date,
|
||||
keyword: kw
|
||||
}).then(res => {
|
||||
if (seq !== this.reqSeqs[tabIndex]) return
|
||||
if (res.errcode === 0 && res.data) {
|
||||
const list = res.data.list || []
|
||||
const prev = this.winnerData[tabIndex] || []
|
||||
this.$set(this.pageNos, tabIndex, page)
|
||||
if (page === 1) {
|
||||
this.$set(this.winnerData, tabIndex, list)
|
||||
} else {
|
||||
const prev = pageNo > 1 ? (this.winnerData[tabIndex] || []) : []
|
||||
this.$set(this.winnerData, tabIndex, prev.concat(list))
|
||||
}
|
||||
this.$set(this.pageNos, tabIndex, pageNo)
|
||||
this.$set(this.queryKeywords, tabIndex, kw)
|
||||
this.$set(this.totals, tabIndex, res.data.total || 0)
|
||||
// xuchao: 各期总人数求和,用于顶部幸运持卡人数
|
||||
this.totalWinners = Object.values(this.totals).reduce((sum, n) => sum + n, 0)
|
||||
// xuchao: 顶部总数只累计"无关键字"的全量人数,搜索态不会让它缩水
|
||||
if (!kw) {
|
||||
this.$set(this.periodTotals, tabIndex, res.data.total || 0)
|
||||
this.totalWinners = Object.values(this.periodTotals).reduce((s, n) => s + n, 0)
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
this.inFlight--
|
||||
if (seq !== this.reqSeqs[tabIndex]) return
|
||||
const len = (this.winnerData[tabIndex] || []).length
|
||||
const total = this.totals[tabIndex] || 0
|
||||
this.$set(this.loadStatusMap, tabIndex, len === 0 || len >= total ? 'nomore' : 'loadmore')
|
||||
})
|
||||
},
|
||||
// xuchao: 执行一次关键字搜索(当期回到第1页);输入防抖与点搜索按钮都走这里
|
||||
search() {
|
||||
this.loadTab(this.currentTab, 1, (this.keyword || '').trim())
|
||||
},
|
||||
loadMore() {
|
||||
const tab = this.currentTab
|
||||
const total = this.totals[tab] || 0
|
||||
const len = (this.winnerData[tab] || []).length
|
||||
if (len < total && this.inFlight === 0) {
|
||||
this.loadWinnerList(tab, (this.pageNos[tab] || 1) + 1)
|
||||
this.loadTab(tab, (this.pageNos[tab] || 1) + 1, this.queryKeywords[tab] || '')
|
||||
}
|
||||
},
|
||||
switchTab(index) {
|
||||
this.currentTab = index
|
||||
// xuchao: 不再重置全局 pageNo(各期游标自带);空列表补拉首页时允许并发,
|
||||
// 避免首屏预取仍在途时切期被丢弃后一直显示“暂无数据”
|
||||
if ((this.winnerData[index] || []).length === 0) {
|
||||
this.loadWinnerList(index, 1, true)
|
||||
// xuchao: 关键字作用于"正在看的这期"——若输入关键字与该期已生效查询不同则重查,否则复用已加载结果
|
||||
const kw = (this.keyword || '').trim()
|
||||
if (kw !== (this.queryKeywords[index] || '')) {
|
||||
this.loadTab(index, 1, kw)
|
||||
} else {
|
||||
const total = this.totals[index] || 0
|
||||
this.$set(this.loadStatusMap, index, this.winnerData[index].length >= total ? 'nomore' : 'loadmore')
|
||||
const len = (this.winnerData[index] || []).length
|
||||
this.$set(this.loadStatusMap, index, len === 0 || len >= total ? 'nomore' : 'loadmore')
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
@@ -204,7 +231,9 @@ export default {
|
||||
}
|
||||
},
|
||||
onSearch() {
|
||||
// 前端过滤,无需重新请求
|
||||
// xuchao: 点搜索/键盘确认 → 立即搜索,取消待执行的防抖
|
||||
clearTimeout(this._kwTimer)
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +282,7 @@ export default {
|
||||
}
|
||||
|
||||
.banner-title {
|
||||
color: #0D387D;
|
||||
color: #C0301B;
|
||||
font-weight: 700;
|
||||
font-size: 32px;
|
||||
line-height: normal;
|
||||
@@ -277,7 +306,7 @@ export default {
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(-135deg, #4981D2 0%, #1853AF 100%);
|
||||
background: linear-gradient(-135deg, #E8542F 0%, #C0301B 100%);
|
||||
}
|
||||
|
||||
.stats-gift {
|
||||
@@ -342,7 +371,7 @@ export default {
|
||||
|
||||
.tab-item.active .tab-label,
|
||||
.tab-item.active .tab-date {
|
||||
color: #3d85ff;
|
||||
color: #E0342B;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
@@ -350,7 +379,7 @@ export default {
|
||||
bottom: 0;
|
||||
width: 24px;
|
||||
height: 4px;
|
||||
background-color: #3d85ff;
|
||||
background-color: #E0342B;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
@@ -378,7 +407,7 @@ export default {
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #0088ff;
|
||||
background-color: #E8542F;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
padding: 4px 10px;
|
||||
|
||||
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 443 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 640 B |
|
Before Width: | Height: | Size: 594 B |
|
Before Width: | Height: | Size: 996 B |
|
Before Width: | Height: | Size: 860 B |
@@ -16,7 +16,7 @@
|
||||
|
||||
/* 行为相关颜色 */
|
||||
@import 'uview-ui/theme.scss';
|
||||
$uni-color-primary: #007aff;
|
||||
$uni-color-primary: #E8542F;
|
||||
$uni-color-success: #4cd964;
|
||||
$uni-color-warning: #f0ad4e;
|
||||
$uni-color-error: #dd524d;
|
||||
|
||||
@@ -9,10 +9,10 @@ $u-light-color: #c0c4cc;
|
||||
$u-border-color: #e4e7ed;
|
||||
$u-bg-color: #f3f4f6;
|
||||
|
||||
$u-type-primary: #2979ff;
|
||||
$u-type-primary-light: #ecf5ff;
|
||||
$u-type-primary-disabled: #a0cfff;
|
||||
$u-type-primary-dark: #2b85e4;
|
||||
$u-type-primary: #E8542F;
|
||||
$u-type-primary-light: #FDEFEA;
|
||||
$u-type-primary-disabled: #F5B8A3;
|
||||
$u-type-primary-dark: #D8431F;
|
||||
|
||||
$u-type-warning: #ff9900;
|
||||
$u-type-warning-disabled: #fcbd71;
|
||||
|
||||
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 326 KiB |
|
After Width: | Height: | Size: 425 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.4 KiB |