msgwebview.vue
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-28 18:19:19
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-09-06 14:42:32
* @FilePath: \gl-tape\pages\common\webview.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<web-view ref="webview" :src="url"></web-view>
</template>
<script type="text/ecmascript-6">
import systemTrack from '../../mixin/systemTrack';
export default {
name: '',
data () {
return {
url: '',
viewerUrl: '/hybrid/html/web/viewer.html',
}
},
mixins: [systemTrack],
onLoad (options) {
console.log(options,'options')
if(options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
else this.url = options.url
if (options.title) {
this.url = `${this.url}&title=${options.title}`
}
},
mounted () {
},
methods: {
onBackPress(options) {
if (options.from === 'backbutton') {
// 阻止默认返回
this.back()
return true
}
return false
},
back () {
uni.navigateBack()
uni.$emit('pageBack')
},
}
}
</script>
<style scoped lang="scss"></style>