|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <web-view :src="src" >
|
|
|
+ <web-view :src="src" @message="handlePostMessage">
|
|
|
</web-view>
|
|
|
</template>
|
|
|
|
|
|
@@ -27,7 +27,8 @@ export default {
|
|
|
webviewServer: server_url,
|
|
|
uuid: '',
|
|
|
bgAudioManager: '',
|
|
|
- lastPlayTime: 0
|
|
|
+ lastPlayTime: 0,
|
|
|
+ openlocation:false
|
|
|
};
|
|
|
},
|
|
|
onLoad(query) {
|
|
|
@@ -109,6 +110,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handlePostMessage(e){
|
|
|
+ if(e.detail?.data.length&&e.detail?.data[0]=='1'){
|
|
|
+ this.openlocation = true
|
|
|
+ // this.getStartLocationUpdate()
|
|
|
+ }else{
|
|
|
+ this.openlocation = false
|
|
|
+ // uni.offLocationChange()
|
|
|
+ }
|
|
|
+ console.log(this.openlocation,'接收消息', e)
|
|
|
+ },
|
|
|
PlayVoice(url) {
|
|
|
//测试背景音频播放
|
|
|
try {
|