feat:我的页新增付款码测试入口(仅白名单手机号 18684839400 可见)
- 测试按钮点击后每步诊断结果(UA/SDK加载/桥就绪/qrCodePay)常驻显示在按钮下方, 不依赖弹窗与长按,云闪付真机可直读卡点 - 不校验 loginWay(目的就是验证容器能力);合并修复 mine.vue 双 computed 覆盖笔误 - 验证完成后连同按钮一并移除(临时排查工具) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
b4d8376dd4
commit
881526b104
+82
-1
@@ -38,6 +38,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</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: 首页改版后 我的 页复用同一自定义底部导航 -->
|
<!-- xuchao: 首页改版后 我的 页复用同一自定义底部导航 -->
|
||||||
<hhrs-tabbar current="mine"></hhrs-tabbar>
|
<hhrs-tabbar current="mine"></hhrs-tabbar>
|
||||||
</view>
|
</view>
|
||||||
@@ -53,13 +60,20 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isLogin: false,
|
isLogin: false,
|
||||||
phone: ''
|
phone: '',
|
||||||
|
// xuchao: 付款码测试诊断文本(常驻屏幕显示)
|
||||||
|
payDiag: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
maskPhone() {
|
maskPhone() {
|
||||||
if (!this.phone || this.phone.length < 7) return this.phone
|
if (!this.phone || this.phone.length < 7) return this.phone
|
||||||
return this.phone.substring(0, 3) + '****' + this.phone.substring(7)
|
return this.phone.substring(0, 3) + '****' + this.phone.substring(7)
|
||||||
|
},
|
||||||
|
// xuchao: 付款码测试白名单(UAT 真机排查用,验证完成后连同按钮一并移除);
|
||||||
|
// String() 归一防 storage 类型还原成 number
|
||||||
|
payTestVisible() {
|
||||||
|
return String(this.phone) === '18684839400'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -100,6 +114,43 @@ export default {
|
|||||||
uni.showToast({ title: '拨号失败,客服电话 ' + config.servicePhone, icon: 'none' })
|
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('桥就绪')
|
||||||
|
try { window.upsdk.qrCodePay(); flush('qrCodePay已调用') }
|
||||||
|
catch (e) { flush('qrCodePay异常:' + (e && e.message || e)) }
|
||||||
|
})
|
||||||
|
} catch (e) { flush('pluginReady异常:' + (e && e.message || e)) }
|
||||||
|
}
|
||||||
|
waitSdk(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,6 +249,36 @@ export default {
|
|||||||
margin-left: 12px;
|
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 上、
|
/* xuchao: 底部固定导航遮挡留白;.page 必须撑满屏高并自带底色 —— 之前底色只挂在 body 上、
|
||||||
高度等于内容高度,内容短时下方露出 html 白底,在 TabBar 上方形成一条白带两条缝 */
|
高度等于内容高度,内容短时下方露出 html 白底,在 TabBar 上方形成一条白带两条缝 */
|
||||||
.page {
|
.page {
|
||||||
|
|||||||
Reference in New Issue
Block a user