diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index cbb71fc..bb9be21 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -38,13 +38,6 @@ - - - 付款码(测试) - {{ payDiag }} - - @@ -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 上方形成一条白带两条缝 */