// 监听 wx 小程序页面回调
const callback = () => {
WeixinJSBridge.on('onPageStateChange', function (res) {
// 此处触发页面返回更新
})
}
if (typeof WeixinJSBridge === 'object' && typeof WeixinJSBridge.invoke === 'function') {
callback()
} else {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', callback, false)
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', callback)
document.attachEvent('onWeixinJSBridgeReady', callback)
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…