Compare commits

..
1 Commits
12 changed files with 83 additions and 638 deletions
-10
View File
@@ -1,10 +0,0 @@
// xuchao: 卡片角标用的区县简称。后端 districtName 返回的是 region.name 行政区划全称
// (如「芷江侗族自治县」「怀化高新技术产业开发区」),列表缩略图只有 75px,必须缩短显示
export function shortDistrict(name) {
if (!name) return ''
return name
.replace('高新技术产业开发区', '高新区')
.replace(/(苗族|侗族|瑶族|回族|土家族|各族)*自治县$/, '')
.replace(/(苗族|侗族|瑶族|回族|土家族|各族)*自治州$/, '')
.replace(/([^市])县$/, '$1')
}
-1
View File
@@ -7,7 +7,6 @@ export const VOUCHER_PRICE_TEXT = '200.00'
export const VOUCHER_NAME = '怀化石油汽油电子券'
export const VOUCHER_GUIDE_TEXT = '请在「云闪付 App」里的「湖南社保卡」小程序首页进入「怀化社保卡」活动中完成购买'
export const VOUCHER_CANCEL_TEXT = '支付已取消,请重新支付'
// 券详情页「使用规则 / 使用流程 / 重要须知」文案,来自石油侧材料(决策 14)
export const VOUCHER_USE_RULES = [
@@ -1,215 +0,0 @@
<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 ? '#0088ff' : '#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 ? '#0088ff' : '#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: #0088ff;
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: #0088ff;
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>
@@ -1,65 +0,0 @@
# 第一期中奖名单导入记录(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。
+6 -64
View File
@@ -13,19 +13,12 @@
<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" @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>
<image class="card-img" :src="item.image" mode="aspectFill" />
<view class="card-info">
<text class="card-name">{{ item.name }}</text>
<text class="card-category">{{ item.category }}</text>
@@ -47,13 +40,7 @@
</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: '',
@@ -66,11 +53,7 @@ export default {
lat: '',
loadStatus: 'loadmore',
hasScrolled: false,
reqSeq: 0,
// xuchao: 筛选条件与面板选项(选项由列表响应带回)
districtId: '',
category: '',
filters: { districts: [], categories: [] }
reqSeq: 0
}
},
onLoad() {
@@ -95,7 +78,6 @@ export default {
this.loadMore()
},
methods: {
shortDistrict,
loadList() {
// xuchao: 请求序号 —— 新请求直接取代在途请求,过期响应整体丢弃(修复搜索竞态,故不再用 loading 提前 return)
const seq = ++this.reqSeq
@@ -109,16 +91,9 @@ 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
@@ -165,12 +140,6 @@ export default {
this.pageNo = 1
this.list = []
this.loadList()
},
// xuchao: 换筛选条件即回第 1 页重查(关键词保持不变,两者为 AND)
onFilterChange(e) {
this.districtId = e.districtId
this.category = e.category
this.onSearch()
}
}
}
@@ -185,11 +154,11 @@ export default {
.search-area {
background-color: #ffffff;
padding: 6px 12px 0;
// xuchao: 滚动时固定在页面顶部;z-index 高于筛选遮罩(90),保证面板与选中态不被压住
padding: 6px 12px;
// xuchao: 滚动时固定在页面顶部
position: sticky;
top: 0;
z-index: 100;
z-index: 10;
}
.nav-row {
@@ -240,7 +209,6 @@ export default {
}
.list-area {
// xuchao: 顶部 12px 必须是页面灰底(不能放进头部的白底里),否则与白色卡片连成一片看不出间隔
padding: 12px;
// xuchao: border-box 防止 padding 撑出页面横向滚动
box-sizing: border-box;
@@ -260,39 +228,13 @@ export default {
margin-bottom: 12px;
}
.card-thumb {
.card-img {
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: min-width:0 允许 flex 子项收缩到内容宽度以下,配合 nowrap 文本出省略号
-6
View File
@@ -185,12 +185,6 @@
flex-direction: column;
}
.banner {
width: 100%;
max-height: 300px;
overflow: hidden;
}
.banner-img {
width: 100%;
display: block;
+4 -7
View File
@@ -52,7 +52,7 @@
<script>
import {
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT, VOUCHER_CANCEL_TEXT,
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT,
bizOk, bizMsg, bizData
} from '@/common/petrolVoucher.js'
@@ -165,8 +165,6 @@ export default {
const ready = await this.loadUpSdk()
if (!ready) {
this.submitting = false
// xuchao: 临时诊断(定位弹窗真因后移除):SDK 加载不出来时展示 UA 片段
this.guideText = '支付SDK未能加载[诊断] UA=' + (typeof navigator !== 'undefined' ? String(navigator.userAgent).slice(0, 120) : 'N/A')
this.guideModal = true
return
}
@@ -176,11 +174,10 @@ export default {
success: () => {
uni.redirectTo({ url: '/pages/petrol/voucherDetail?orderNo=' + this.orderNo })
},
fail: (err) => {
// xuchao: 控件回调失败(含用户取消)。按 xuchao 要求文案定为取消提示;
// [诊断] 行临时保留采集真实错误码,区分"取消"与"容器不支持"后移除并分文案
fail: () => {
// xuchao: 唤起失败(多为不在云闪付内)→ 指引模态;云闪付内取消也会走这里,
// 订单仍保留可"继续支付",统一用文案引导,不做环境猜测
this.submitting = false
this.guideText = VOUCHER_CANCEL_TEXT + '\n[诊断] ' + JSON.stringify(err || {})
this.guideModal = true
}
})
+1 -8
View File
@@ -1,8 +1,6 @@
<template>
<view class="page">
<!-- xuchao: 底部「立即预约」是 fixed 不占位,短屏滚到底会把「权益说明」压住;
有底栏时给内容区预留 80px(底栏 68px + 12px 呼吸位)+ 安全区 -->
<view v-if="detail" :class="{ 'has-bottom-bar': detail.isAppointment }">
<view v-if="detail">
<!-- 门店信息卡片(信息+地址合并容器) -->
<view class="store-card">
<view class="store-main">
@@ -444,11 +442,6 @@ export default {
}
/* 底部预约按钮 */
/* xuchao: 内容区为 fixed 底栏预留的高度,短屏下「权益说明」才不会被遮住 */
.has-bottom-bar {
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
.bottom-bar {
position: fixed;
bottom: 0;
+17 -102
View File
@@ -89,9 +89,7 @@
</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"
@@ -99,27 +97,20 @@
<text class="tab-text">{{ tab }}</text>
</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 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>
</view>
<!-- 权益列表 -->
<!-- xuchao: 三 Tab 列表统一改普通容器 + 页面级触底分页(scroll-view 无固定高度时 scrolltolower 永不触发) -->
<view class="list-area list-area--todo" v-if="currentTab==0">
<view class="list-area" 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>
<image class="card-img" :src="item.image" mode="aspectFill" />
<view class="card-info">
<view class="card-name">{{ item.name }}</view>
<view class="card-category">{{ item.category }}</view>
@@ -180,13 +171,7 @@
</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',
@@ -204,14 +189,6 @@
tabs: ['待使用', '已预约', '已使用'],
currentTab: 0,
keyword: '',
// xuchao: 待使用列表的县区/类型筛选条件与面板选项(选项由列表响应带回)
districtId: '',
category: '',
filters: { districts: [], categories: [] },
// xuchao: 待使用列表的县区/类型筛选条件与面板选项(选项由列表响应带回)
districtId: '',
category: '',
filters: { districts: [], categories: [] },
rightsList: [],
appointmentList: [],
checkList: [],
@@ -285,7 +262,6 @@
}
},
methods: {
shortDistrict,
// xuchao: 缓存的权益状态可能过期(中奖/权益包会变化),每次进页面仅凭手机号向服务端
// 复查最新状态并覆盖缓存(不带证件号,避免触发被动认证)
refreshStatus() {
@@ -519,19 +495,10 @@
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)
@@ -571,12 +538,6 @@
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
@@ -833,20 +794,11 @@
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;
}
@@ -881,8 +833,7 @@
/* 搜索栏 */
.search-area {
/* xuchao: 底部留白交给筛选条的 20rpx 上内边距,保证三段间距一致 */
padding: 12px 12px 0;
padding: 12px;
}
.search-bar {
@@ -890,10 +841,6 @@
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;
@@ -914,12 +861,6 @@
flex-direction: column;
}
/* xuchao: 「待使用」列表顶部 24rpx(=12px) 灰底间隔,与卡片之间的间距一致,
也与筛选条和列表之间的 12px 对齐;只加在这个 Tab,不影响「已预约/已使用」 */
.list-area--todo {
padding-top: 24rpx;
}
.nomore-area {
width: 100%;
padding-bottom: 24px;
@@ -935,38 +876,12 @@
margin-bottom: 24rpx;
}
.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-img {
width: 150rpx;
height: 150rpx;
border-radius: 6px;
flex-shrink: 0;
}
.card-info {
width: 490rpx;
+1 -3
View File
@@ -113,10 +113,8 @@ 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
+13 -88
View File
@@ -13,29 +13,20 @@
<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>
<image class="card-img" :src="item.image" mode="aspectFill" />
<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 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>
<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 v-if="hasScrolled" class="nomore-area">
@@ -46,13 +37,7 @@
</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: '',
@@ -65,11 +50,7 @@ export default {
lat: '',
loadStatus: 'loadmore',
hasScrolled: false,
reqSeq: 0,
// xuchao: 筛选条件与面板选项(选项由列表响应带回)
districtId: '',
category: '',
filters: { districts: [], categories: [] }
reqSeq: 0
}
},
onLoad() {
@@ -87,7 +68,6 @@ export default {
this.loadMore()
},
methods: {
shortDistrict,
loadList() {
// xuchao: 请求序号 —— 新请求直接取代在途请求,过期响应整体丢弃(修复搜索竞态,故不再用 loading 提前 return)
const seq = ++this.reqSeq
@@ -101,16 +81,9 @@ 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
@@ -153,12 +126,6 @@ export default {
this.pageNo = 1
this.list = []
this.loadList()
},
// xuchao: 换筛选条件即回第 1 页重查(关键词保持不变,两者为 AND)
onFilterChange(e) {
this.districtId = e.districtId
this.category = e.category
this.onSearch()
}
}
}
@@ -173,11 +140,11 @@ export default {
.search-area {
background-color: #ffffff;
padding: 6px 12px 0;
/* xuchao: 滚动时固定在页面顶部;z-index 高于筛选遮罩(90),保证面板与选中态不被压住 */
padding: 6px 12px;
/* xuchao: 滚动时固定在页面顶部 */
position: sticky;
top: 0;
z-index: 100;
z-index: 10;
}
.nav-row {
@@ -228,7 +195,6 @@ export default {
}
.list-area {
/* xuchao: 顶部 12px 必须是页面灰底(不能放进头部的白底里),否则与白色卡片连成一片看不出间隔 */
padding: 12px;
}
@@ -241,42 +207,16 @@ export default {
padding: 24px 12px;
gap: 12px;
box-shadow: 0 2px 3px #f2f2f7;
margin: 12px;
margin-bottom: 12px;
}
.card-thumb {
.card-img {
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 后子元素在实宽内省略 */
@@ -284,18 +224,12 @@ 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 {
@@ -307,22 +241,13 @@ 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 {
+41 -69
View File
@@ -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,10 +62,7 @@
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
</view>
</template>
<!-- xuchao: 无名单时展示空态;全量拉取/首屏预取进行中显示查询态,避免"暂无数据"闪现 -->
<view class="loadmore-area" v-else-if="!datesLoaded || loadStatus === 'loading'">
<u-loadmore status="loading" loading-text="查询中..." />
</view>
<!-- xuchao: 无名单时展示空态 -->
<view class="empty-area" v-else>
<u-icon name="empty" size="60" color="#c8c8c8"></u-icon>
<text class="empty-text">暂无数据</text>
@@ -85,37 +82,28 @@ 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() {
return this.winnerData[this.currentTab] || []
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))
)
},
// xuchao: 各期独立的加载状态,避免并行请求互相覆盖
loadStatus() {
return this.loadStatusMap[this.currentTab] || 'nomore'
}
},
watch: {
// xuchao: 关键字防抖 400ms 后走服务端模糊搜索(姓名/手机号/身份证任意片段)
keyword() {
clearTimeout(this._kwTimer)
this._kwTimer = setTimeout(() => this.search(), 400)
}
},
onLoad() {
this.loadDates()
},
@@ -125,7 +113,6 @@ export default {
methods: {
loadDates() {
this.$u.api.getWinnerDates().then(res => {
this.datesLoaded = true
if (res.errcode === 0 && res.data) {
const dates = res.data
this.tabs = dates.map((date, index) => ({
@@ -137,87 +124,74 @@ export default {
data[index] = []
})
this.winnerData = data
// xuchao: 预置各期 key,保证响应式
// xuchao: 预置各期 key,保证 totals/pageNos/loadStatusMap 的响应式
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: 预取各期第一页(无关键字),汇总已产生总人数
this.tabs.forEach((tab, index) => {
this.loadTab(index, 1, '')
})
// xuchao: 预取各期第一页,汇总已产生总人数
if (this.tabs.length > 0) {
this.tabs.forEach((tab, index) => {
this.loadWinnerList(index, 1, true)
})
}
}
}).catch(() => { this.datesLoaded = true })
})
},
// xuchao: 拉取某期某页;keyword 走服务端 LIKE(姓名/手机/身份证任意片段),空串=不过滤
loadTab(tabIndex, pageNo, keyword) {
loadWinnerList(tabIndex, pageNo, allowConcurrent) {
if (!this.tabs[tabIndex]) return
const kw = keyword || ''
// xuchao: 递增序号,返回时仅最新请求生效,丢弃连续输入产生的乱序旧响应
const seq = (this.reqSeqs[tabIndex] || 0) + 1
this.$set(this.reqSeqs, tabIndex, seq)
if (this.inFlight > 0 && !allowConcurrent) return
// xuchao: 本期页码独立计算,缺省续拉该期下一页
const page = pageNo || (this.pageNos[tabIndex] || 1)
this.inFlight++
this.$set(this.loadStatusMap, tabIndex, 'loading')
const drawDate = this.tabs[tabIndex].date
this.$u.api.getWinnerList({
pageNo: pageNo,
pageNo: page,
pageSize: this.pageSize,
drawDate: this.tabs[tabIndex].date,
keyword: kw
drawDate: drawDate
}).then(res => {
if (seq !== this.reqSeqs[tabIndex]) return
if (res.errcode === 0 && res.data) {
const list = res.data.list || []
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: 顶部总数只累计"无关键字"的全量人数,搜索态不会让它缩水
if (!kw) {
this.$set(this.periodTotals, tabIndex, res.data.total || 0)
this.totalWinners = Object.values(this.periodTotals).reduce((s, n) => s + n, 0)
const prev = this.winnerData[tabIndex] || []
this.$set(this.pageNos, tabIndex, page)
if (page === 1) {
this.$set(this.winnerData, tabIndex, list)
} else {
this.$set(this.winnerData, tabIndex, prev.concat(list))
}
this.$set(this.totals, tabIndex, res.data.total || 0)
// xuchao: 各期总人数求和,用于顶部幸运持卡人数
this.totalWinners = Object.values(this.totals).reduce((sum, n) => sum + 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.loadTab(tab, (this.pageNos[tab] || 1) + 1, this.queryKeywords[tab] || '')
this.loadWinnerList(tab, (this.pageNos[tab] || 1) + 1)
}
},
switchTab(index) {
this.currentTab = index
// xuchao: 关键字作用于"正在看的这期"——若输入关键字与该期已生效查询不同则重查,否则复用已加载结果
const kw = (this.keyword || '').trim()
if (kw !== (this.queryKeywords[index] || '')) {
this.loadTab(index, 1, kw)
// xuchao: 不再重置全局 pageNo(各期游标自带);空列表补拉首页时允许并发,
// 避免首屏预取仍在途时切期被丢弃后一直显示“暂无数据”
if ((this.winnerData[index] || []).length === 0) {
this.loadWinnerList(index, 1, true)
} else {
const total = this.totals[index] || 0
const len = (this.winnerData[index] || []).length
this.$set(this.loadStatusMap, index, len === 0 || len >= total ? 'nomore' : 'loadmore')
this.$set(this.loadStatusMap, index, this.winnerData[index].length >= total ? 'nomore' : 'loadmore')
}
},
goBack() {
@@ -230,9 +204,7 @@ export default {
}
},
onSearch() {
// xuchao: 点搜索/键盘确认 → 立即搜索,取消待执行的防抖
clearTimeout(this._kwTimer)
this.search()
// 前端过滤,无需重新请求
}
}
}