58 lines
911 B
Vue
58 lines
911 B
Vue
<template>
|
|
<view :style="themeColor" class="vr-page">
|
|
<web-view :src="src" class="vr-webview" @titleUpdate="updateNavbarTitle"></web-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
src: '',
|
|
title: ''
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
this.title = option?.title ?? '';
|
|
this.$api.sendRequest({
|
|
url: '/api/config/defaultvr',
|
|
success: res => {
|
|
if (res.code == 0) {
|
|
this.src = res.data.url;
|
|
this.title = res.data.title;
|
|
}
|
|
},
|
|
fail: res => {
|
|
}
|
|
});
|
|
},
|
|
onShow() {
|
|
this.updateNavbarTitle();
|
|
},
|
|
watch: {
|
|
title(newVal) {
|
|
this.updateNavbarTitle(newVal);
|
|
}
|
|
},
|
|
methods: {
|
|
updateNavbarTitle(newTitle) {
|
|
const title = newTitle ?? this.title;
|
|
uni.setNavigationBarTitle({title});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.vr-page {
|
|
height: 100vh;
|
|
width: 100%;
|
|
background: #fff;
|
|
}
|
|
|
|
.vr-webview {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|