Initial commit
This commit is contained in:
39
pages/webview/index.vue
Normal file
39
pages/webview/index.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user