Files
gjt_mini/pages/webview/index.vue
2025-12-30 09:44:46 +08:00

39 lines
813 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view>
<!-- WebView 组件 -->
<web-view ref="webView" :src="url" @message="handleGetMessage"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: '' // WebView 的初始地址
}
},
onLoad: function (option) {
this.url = decodeURIComponent(option.url)
this.type = option.type
},
methods: {
handleGetMessage: function(e) {
console.log(e,'\n进入handleGetMessage方法')
console.log('handleGetMessage',e)
if(e.detail.data[0].result=='success'){
// 如果是人脸验证,则需要额外再跳一层
if (this.type == "face") {
console.log("人脸识别方式")
uni.navigateBack()
} else {
// 页面会自动往回跳1层短信认证时不需要手动uni.navigateBack
console.log("短信验证方式")
}
}
},
},
}
</script>