qa-regulatory-gwj-app/pages/map/map.vue

49 lines
1.1 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view>
<web-view id="webview" :src="url" @message="messageChange"></web-view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
url: '',
}
},
onLoad(option) {
let _this = this;
const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
// 监听acceptDataFromOpenerPage事件获取上一页面通过eventChannel传送到当前页面的数据
eventChannel.on('acceptDataFromOpenerPage', function (data) {
_this.init(data.data.title);
})
},
onBackPress(options) {
return false;
},
methods: {
init(title) {
this.url = ("/hybrid/html/jsmap.html?t=" + new Date().getTime() + '&title=' + title);
},
messageChange(e) {
uni.setStorageSync("info", e.detail.data[0]);
const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
eventChannel.emit('acceptDataFromOpenedPage', {data: e.detail.data[0]});
uni.navigateBack();
}
}
}
</script>
<style scoped>
page,
uni-page-body,
.container {
background: rgba(245, 245, 245, 1);
min-height: calc(100%);
}
</style>