Compare commits
8
Commits
be4aafa6fd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b15ca69811 | ||
|
|
6bc9b2c0d7 | ||
|
|
9f02144df7 | ||
|
|
88f4d48c80 | ||
|
|
ffe42d48c5 | ||
|
|
4daa4f3f5f | ||
|
|
1005f6bd22 | ||
|
|
b9895049d1 |
@@ -23,4 +23,23 @@
|
|||||||
Arial, Helvetica, sans-serif;
|
Arial, Helvetica, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* xuchao: 修复默认导航栏在微信 WebView 内顶部超宽空白(参加/使用指南、协议等页)——
|
||||||
|
uni-app 内置 H5 导航栏高度为 calc(44px + env(safe-area-inset-top)),页面模板带
|
||||||
|
viewport-fit=cover 时,部分 Android 微信 WebView 会误报状态栏高度(而 H5 视口本
|
||||||
|
就位于微信原生标题栏下方、并未被遮挡),导致导航栏被垫高。强制回退固定 44px。
|
||||||
|
标准浏览器/ iOS 中该 env 值为 0,此覆盖无副作用 */
|
||||||
|
uni-page-head .uni-page-head {
|
||||||
|
height: 44px !important;
|
||||||
|
padding-top: 7px !important;
|
||||||
|
}
|
||||||
|
uni-page-head .uni-page-head ~ .uni-placeholder {
|
||||||
|
height: 44px !important;
|
||||||
|
}
|
||||||
|
uni-page-head[uni-page-head-type='default'] ~ uni-page-wrapper {
|
||||||
|
height: calc(100% - 44px) !important;
|
||||||
|
}
|
||||||
|
.uni-app--showtabbar uni-page-head[uni-page-head-type='default'] ~ uni-page-wrapper {
|
||||||
|
height: calc(100% - 44px) !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+13
-8
@@ -1,10 +1,8 @@
|
|||||||
// xuchao: 怀化石油汽油减免券——前端常量与工具(全写死,只服务这一个门店,决策 1/10/15)
|
// xuchao: 怀化石油汽油减免券——前端常量与工具(全写死,只服务这一个门店,决策 1/10/15)
|
||||||
// 价格真相在后端常量(20000 分),此处 200.00 仅展示用,两处改价必须同步
|
// 价格真相=后端配置 hh.voucher.price-fen 经 latest 下发;此处 200.00 仅为接口未返回时的展示兜底
|
||||||
|
|
||||||
export const PETROL_SHOP_ID = '851219003520709'
|
export const PETROL_SHOP_ID = '851219003520709'
|
||||||
export const VOUCHER_PRICE_TEXT = '200.00'
|
export const VOUCHER_PRICE_TEXT = '200.00'
|
||||||
// xuchao: 非云闪付环境豁免拦截的联调手机号(决策 13)
|
|
||||||
export const VOUCHER_PAY_WHITELIST_PHONE = '18684839400'
|
|
||||||
|
|
||||||
export const VOUCHER_NAME = '怀化石油汽油电子券'
|
export const VOUCHER_NAME = '怀化石油汽油电子券'
|
||||||
|
|
||||||
@@ -22,13 +20,20 @@ export const VOUCHER_USE_FLOW = [
|
|||||||
'支付差额可选:油卡 / 现金等'
|
'支付差额可选:油卡 / 现金等'
|
||||||
]
|
]
|
||||||
|
|
||||||
// xuchao: 云闪付容器判定只看 UA——不能掺 window.upsdk 是否已加载(SDK 是异步注入的,
|
// xuchao: 云闪付 SDK 前置预热注入。HBuilderX 的 H5 构建不吃项目根 index.html(静态标签会被丢),
|
||||||
// 首屏点击时可能还没 load 完,会把云闪付内首点误判为站外)。UA 关键字真机实测后定稿。
|
// 只能在 main.js 最早期(document-start、App 挂载前)动态注入,逼近 xghmall 的 head 静态加载时机,
|
||||||
export function isUnionPayApp() {
|
// 让云闪付原生控件桥在首屏就注册,避免到确认订单页才注入导致 upsdk.pay 唤不起。
|
||||||
if (typeof navigator === 'undefined' || !navigator.userAgent) return false
|
// 与 orderConfirm 页的 loadUpSdk 共用同一 script[data-upsdk] 标记,全局只注入一次。
|
||||||
return /unionpay|upsdk|云闪付/i.test(navigator.userAgent)
|
export function injectUpSdk() {
|
||||||
|
if (typeof document === 'undefined' || typeof window === 'undefined') return
|
||||||
|
if (window.upsdk || document.querySelector('script[data-upsdk]')) return
|
||||||
|
const s = document.createElement('script')
|
||||||
|
s.src = 'https://open.95516.com/s/open/js/upsdk.js'
|
||||||
|
s.setAttribute('data-upsdk', '1')
|
||||||
|
document.head.appendChild(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// xuchao: open-api/hhService/voucher/* 为双层壳:外层 errcode,内层 data.code 才是业务码
|
// xuchao: open-api/hhService/voucher/* 为双层壳:外层 errcode,内层 data.code 才是业务码
|
||||||
// (同 login.vue 的 isBizOk 判定,提到公共层复用)
|
// (同 login.vue 的 isBizOk 判定,提到公共层复用)
|
||||||
export function bizOk(res) {
|
export function bizOk(res) {
|
||||||
|
|||||||
Executable
+14
@@ -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 上传后原子切换"
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
import App from './App'
|
import App from './App'
|
||||||
|
import { injectUpSdk } from '@/common/petrolVoucher.js'
|
||||||
|
|
||||||
|
// xuchao: 云闪付控件 SDK 预热——HBuilderX 构建不吃根 index.html,静态标签无效,
|
||||||
|
// 在 App 挂载前(document-start 最早 JS 点)注入,逼近静态 head 加载时机(石油券支付修复)
|
||||||
|
injectUpSdk()
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|||||||
+4
-47
@@ -19,14 +19,10 @@
|
|||||||
<view class="title-line"></view>
|
<view class="title-line"></view>
|
||||||
<text class="title-text">活动指南</text>
|
<text class="title-text">活动指南</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- xuchao: 图内已带标题/副标题/官方指南角标,不再叠加文字层,只保留图片 -->
|
||||||
<view class="guide-list">
|
<view class="guide-list">
|
||||||
<view class="guide-card" v-for="(item, index) in guideList" :key="index" @click="goPage(item.url)">
|
<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>
|
<image class="guide-bg" :src="item.bg" mode="scaleToFill"></image>
|
||||||
<view class="guide-info">
|
|
||||||
<text class="guide-title">{{ item.title }}</text>
|
|
||||||
<text class="guide-sub">{{ item.sub }}</text>
|
|
||||||
<view class="guide-tag">官方指南</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -47,15 +43,12 @@
|
|||||||
],
|
],
|
||||||
guideList: [
|
guideList: [
|
||||||
{
|
{
|
||||||
title: '“千万好礼促消费”活动指南',
|
// xuchao: ?v= 为图片版本参数,运营换图必须同步更新日期,否则各平台 WebView/CDN 会继续命中旧缓存
|
||||||
sub: '千元权益包、商户惠民福利',
|
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_cjzn.png?v=20260928',
|
||||||
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_cjzn.png',
|
|
||||||
url: '/pages/guide/join'
|
url: '/pages/guide/join'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '社保卡领取及使用指南',
|
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_syzn.png?v=20260928',
|
||||||
sub: '全流程办理及激活指引',
|
|
||||||
bg: 'https://aliyunoss.hn12301.net/hhrs/hhrs_syzn.png',
|
|
||||||
url: '/pages/guide/use'
|
url: '/pages/guide/use'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -266,7 +259,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.guide-card {
|
.guide-card {
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 252rpx;
|
height: 252rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
@@ -279,40 +271,5 @@
|
|||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guide-info {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guide-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #0088FF;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guide-sub {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #949AA0;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guide-tag {
|
|
||||||
display: inline-block;
|
|
||||||
width: fit-content;
|
|
||||||
padding: 4px 10px;
|
|
||||||
background-color: #e6f2ff;
|
|
||||||
color: #0088FF;
|
|
||||||
font-size: 12px;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT,
|
VOUCHER_NAME, VOUCHER_PRICE_TEXT, VOUCHER_GUIDE_TEXT,
|
||||||
VOUCHER_PAY_WHITELIST_PHONE, isUnionPayApp, bizOk, bizMsg, bizData
|
bizOk, bizMsg, bizData
|
||||||
} from '@/common/petrolVoucher.js'
|
} from '@/common/petrolVoucher.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -81,7 +81,7 @@ export default {
|
|||||||
uni.redirectTo({ url: '/pages/index/login?redirect=' + encodeURIComponent('/pages/venue/detail?id=851219003520709&type=2') })
|
uni.redirectTo({ url: '/pages/index/login?redirect=' + encodeURIComponent('/pages/venue/detail?id=851219003520709&type=2') })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.loadUpSdk() // xuchao: 运行时注入云闪付 SDK(构建模板不可靠,见 loadUpSdk 注释)
|
this.loadUpSdk() // xuchao: 运行时兜底注入(静态标签已在发布脚本注入产物 index.html,见 h5-release.sh)
|
||||||
if (options.orderNo) this.orderNo = options.orderNo
|
if (options.orderNo) this.orderNo = options.orderNo
|
||||||
this.initFromServer()
|
this.initFromServer()
|
||||||
},
|
},
|
||||||
@@ -95,6 +95,16 @@ export default {
|
|||||||
const loading = new Promise(resolve => {
|
const loading = new Promise(resolve => {
|
||||||
let done = false
|
let done = false
|
||||||
const finish = v => { if (!done) { done = true; resolve(v) } }
|
const finish = v => { if (!done) { done = true; resolve(v) } }
|
||||||
|
const exists = document.querySelector('script[data-upsdk]')
|
||||||
|
if (exists) {
|
||||||
|
// main.js 已预热注入:轮询等 window.upsdk 出现(避免重复插标签)
|
||||||
|
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')
|
const s = document.createElement('script')
|
||||||
s.src = 'https://open.95516.com/s/open/js/upsdk.js'
|
s.src = 'https://open.95516.com/s/open/js/upsdk.js'
|
||||||
s.setAttribute('data-upsdk', '1')
|
s.setAttribute('data-upsdk', '1')
|
||||||
@@ -106,7 +116,7 @@ export default {
|
|||||||
this._upSdkPromise = loading
|
this._upSdkPromise = loading
|
||||||
return loading
|
return loading
|
||||||
},
|
},
|
||||||
// xuchao: 价格展示以服务端 latest 为准(测试期 0.01);已有待支付单自动续用;已发券直接跳券详情
|
// xuchao: 价格展示以服务端 latest 为准;已有待支付单自动续用;已发券直接跳券详情
|
||||||
initFromServer() {
|
initFromServer() {
|
||||||
this.$u.api.voucherLatest({ phone: this.phone }).then(res => {
|
this.$u.api.voucherLatest({ phone: this.phone }).then(res => {
|
||||||
if (!bizOk(res)) return
|
if (!bizOk(res)) return
|
||||||
@@ -123,11 +133,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onConfirmPay() {
|
onConfirmPay() {
|
||||||
if (this.submitting) return
|
if (this.submitting) return
|
||||||
// xuchao: 容器拦截——非云闪付且非联调白名单号,弹窗不发起支付(决策 11/13)
|
// xuchao: 不做容器/白名单前置拦截,直接发起;云闪付控件在站外唤不起时
|
||||||
if (!isUnionPayApp() && this.phone !== VOUCHER_PAY_WHITELIST_PHONE) {
|
// 由 pay 的 fail 回调统一弹「去云闪付」指引模态(决策 11 修订:去白名单)
|
||||||
this.guideModal = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.submitting = true
|
this.submitting = true
|
||||||
this.doPay()
|
this.doPay()
|
||||||
},
|
},
|
||||||
@@ -158,7 +165,7 @@ export default {
|
|||||||
const ready = await this.loadUpSdk()
|
const ready = await this.loadUpSdk()
|
||||||
if (!ready) {
|
if (!ready) {
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
uni.showToast({ title: '支付组件加载失败,请稍后重试', icon: 'none' })
|
this.guideModal = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
window.upsdk.pluginReady(() => {
|
window.upsdk.pluginReady(() => {
|
||||||
@@ -168,8 +175,10 @@ export default {
|
|||||||
uni.redirectTo({ url: '/pages/petrol/voucherDetail?orderNo=' + this.orderNo })
|
uni.redirectTo({ url: '/pages/petrol/voucherDetail?orderNo=' + this.orderNo })
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
|
// xuchao: 唤起失败(多为不在云闪付内)→ 指引模态;云闪付内取消也会走这里,
|
||||||
|
// 订单仍保留可"继续支付",统一用文案引导,不做环境猜测
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
uni.showToast({ title: '支付未完成,可在门店页继续支付', icon: 'none' })
|
this.guideModal = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<!-- 场馆列表 -->
|
<!-- 场馆列表 -->
|
||||||
<view class="list-area">
|
<view class="list-area">
|
||||||
<view class="venue-card" v-for="item in list" :key="item.shopId" @click="goDetail(item)">
|
<view class="venue-card" v-for="item in list" :key="item.shopId">
|
||||||
<image class="card-img" :src="item.image" mode="aspectFill" />
|
<image class="card-img" :src="item.image" mode="aspectFill" />
|
||||||
<view class="card-info">
|
<view class="card-info">
|
||||||
<text class="card-name">{{ item.name }}</text>
|
<text class="card-name">{{ item.name }}</text>
|
||||||
@@ -122,9 +122,6 @@ export default {
|
|||||||
uni.reLaunch({ url: '/pages/index/index' })
|
uni.reLaunch({ url: '/pages/index/index' })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
|
||||||
uni.navigateTo({ url: '/pages/venue/detail?id=' + item.shopId })
|
|
||||||
},
|
|
||||||
onSearch() {
|
onSearch() {
|
||||||
this.pageNo = 1
|
this.pageNo = 1
|
||||||
this.list = []
|
this.list = []
|
||||||
@@ -207,7 +204,6 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #f2f2f7;
|
border: 1px solid #f2f2f7;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
width: 702rpx;
|
|
||||||
padding: 24px 12px;
|
padding: 24px 12px;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
box-shadow: 0 2px 3px #f2f2f7;
|
box-shadow: 0 2px 3px #f2f2f7;
|
||||||
@@ -223,6 +219,8 @@ export default {
|
|||||||
|
|
||||||
.card-info {
|
.card-info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
/* xuchao: flex 项默认 min-width:auto,nowrap 地址会把列宽撑破卡片;置 0 后子元素在实宽内省略 */
|
||||||
|
min-width: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
@@ -250,7 +248,6 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
max-width: 200px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-distance {
|
.card-distance {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<image class="banner-icon" src="https://aliyunoss.hn12301.net/hhrs/hhrs_zjgs.png" mode="aspectFit"></image>
|
<image class="banner-icon" src="https://aliyunoss.hn12301.net/hhrs/hhrs_zjgs.png" mode="aspectFit"></image>
|
||||||
<text class="banner-title">中奖名单公示</text>
|
<text class="banner-title">中奖名单公示</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="banner-subtitle">总计 10,000份权益包,分三期公证抽取</text>
|
<text class="banner-subtitle">总计 10,000份权益包,全程公证抽取</text>
|
||||||
<view class="stats-card">
|
<view class="stats-card">
|
||||||
<image class="stats-gift" src="https://aliyunoss.hn12301.net/hhrs/hhrs_xyckr.png" mode="aspectFit"></image>
|
<image class="stats-gift" src="https://aliyunoss.hn12301.net/hhrs/hhrs_xyckr.png" mode="aspectFit"></image>
|
||||||
<text class="stats-label">已产生</text>
|
<text class="stats-label">已产生</text>
|
||||||
|
|||||||
Reference in New Issue
Block a user