34 lines
646 B
Vue
34 lines
646 B
Vue
<template>
|
|
<view class="webview-container">
|
|
<web-view :src="url"></web-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
|
|
const url = ref('')
|
|
|
|
// 页面加载时获取参数
|
|
onLoad((options) => {
|
|
if (options && options.url) {
|
|
// 解码URL参数
|
|
url.value = decodeURIComponent(options.url)
|
|
console.log('Webview loading URL:', url.value)
|
|
} else {
|
|
// 默认URL
|
|
url.value = 'https://www.720yun.com/vr/cd4jtOyusw4'
|
|
}
|
|
})
|
|
|
|
// onLoad 需要从 @dcloudio/uni-app 导入
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
</script>
|
|
|
|
<style scoped>
|
|
.webview-container {
|
|
width: 100%;
|
|
height: 100vh;
|
|
}
|
|
</style>
|