chore:下线付款码测试入口(银联侧未开通 hh 域名付款码权限,功能整体暂停)

- 移除「我的」页白名单测试按钮及 onPayTest/诊断/样式(详情页付款码按钮此前已移除)
- loginWay 登录方式标记保留(两行写入,付款码恢复时复用);upsdk 预热保留(加油券支付在用)
- 待银联开放平台为 hh.hn12301.net 登记付款码能力后再评估恢复

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-10-27 19:53:22 +08:00
co-authored by Claude Fable 5
parent d971dfbe0f
commit 069609f409
+1 -98
View File
@@ -38,13 +38,6 @@
</view>
</view>
<!-- xuchao: 付款码真机测试入口——仅白名单手机号可见(UAT 排查云闪付容器链路用);
诊断结果常驻显示在按钮下方,不依赖弹窗/长按 -->
<view class="pay-test" v-if="payTestVisible">
<view class="pay-test-btn" @click="onPayTest">付款码(测试)</view>
<text class="pay-test-diag" v-if="payDiag">{{ payDiag }}</text>
</view>
<!-- xuchao: 首页改版后 我的 页复用同一自定义底部导航 -->
<hhrs-tabbar current="mine"></hhrs-tabbar>
</view>
@@ -60,20 +53,13 @@ export default {
data() {
return {
isLogin: false,
phone: '',
// xuchao: 付款码测试诊断文本(常驻屏幕显示)
payDiag: ''
phone: ''
}
},
computed: {
maskPhone() {
if (!this.phone || this.phone.length < 7) return this.phone
return this.phone.substring(0, 3) + '****' + this.phone.substring(7)
},
// xuchao: 付款码测试白名单(UAT 真机排查用,验证完成后连同按钮一并移除);
// String() 归一防 storage 类型还原成 number
payTestVisible() {
return String(this.phone) === '18684839400'
}
},
onShow() {
@@ -114,60 +100,6 @@ export default {
uni.showToast({ title: '拨号失败,客服电话 ' + config.servicePhone, icon: 'none' })
}
})
},
// xuchao: 付款码真机测试——每步结果写进 payDiag 常驻屏幕;不校验 loginWay(目的即验证容器能力)
onPayTest() {
const diag = []
const t0 = Date.now()
const flush = (tail) => {
diag.push(tail + ' +' + (Date.now() - t0) + 'ms')
this.payDiag = diag.join(';')
console.warn('[paytest]', this.payDiag)
}
diag.push('UA=' + String(navigator.userAgent || '').slice(-40))
const s = document.createElement('script')
s.src = 'https://open.95516.com/s/open/js/upsdk.js'
s.setAttribute('data-upsdk', '1')
s.onload = () => after()
s.onerror = () => flush('SDK脚本加载失败')
if (!document.querySelector('script[data-upsdk]')) document.head.appendChild(s)
const self = this
function waitSdk(n) {
if (window.upsdk) return after()
if (n > 40) return flush('window.upsdk 未出现(9s)')
setTimeout(() => waitSdk(n + 1), 200)
}
function after() {
flush('upsdk=' + typeof window.upsdk)
let bridged = false
setTimeout(() => { if (!bridged) flush('桥未就绪(5s超时=非云闪付容器)') }, 5000)
try {
window.upsdk.pluginReady(() => {
bridged = true
flush('桥就绪')
// xuchao: qrCodePay 带回调 + 页面可见性探测——容器静默拒绝(无回调、无遮挡)也能现形。
// 付款码真弹出必然覆盖 WebView → visibilitychange 是成功信号
let got = false
const onVis = () => {
if (document.hidden) { got = true; flush('页面被覆盖=付款码已弹出') }
}
document.addEventListener('visibilitychange', onVis)
const opts = {
success: r => { got = true; flush('qrCodePay success:' + JSON.stringify(r || {}).slice(0, 60)) },
fail: e => { got = true; flush('qrCodePay fail:' + JSON.stringify(e || {}).slice(0, 90)) }
}
try {
window.upsdk.qrCodePay(opts)
flush('qrCodePay已调用(带回调)')
setTimeout(() => {
if (!got) flush('3s无回调无遮挡=容器静默拒绝(疑域名未在银联登记付款码能力,与ysf域名对照)')
document.removeEventListener('visibilitychange', onVis)
}, 3000)
} catch (e) { flush('qrCodePay异常:' + (e && e.message || e)) }
})
} catch (e) { flush('pluginReady异常:' + (e && e.message || e)) }
}
waitSdk(0)
}
}
}
@@ -266,35 +198,6 @@ export default {
margin-left: 12px;
}
/* xuchao: 付款码测试入口样式(仅白名单可见) */
.pay-test {
margin: 16px 12px 0;
display: flex;
flex-direction: column;
align-items: center;
}
.pay-test-btn {
width: 100%;
height: 46px;
border-radius: 23px;
background: linear-gradient(90deg, #D8431F, #E8542F 55%, #F0703C);
color: #fff;
font-size: 16px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
letter-spacing: 2px;
box-shadow: 0 4px 9px rgba(216, 67, 31, .28);
}
.pay-test-diag {
margin-top: 10px;
font-size: 11px;
color: #8A6E56;
line-height: 1.6;
word-break: break-all;
padding: 0 6px;
}
/* xuchao: 底部固定导航遮挡留白;.page 必须撑满屏高并自带底色 —— 之前底色只挂在 body 上、
高度等于内容高度,内容短时下方露出 html 白底,在 TabBar 上方形成一条白带两条缝 */