zoujiandong da6e4ae551 8.29
2025-08-29 09:46:07 +08:00

41 lines
855 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<!-- H5/APP 使用 web-view 也可 plus 下直接 openURL 更流畅这里统一 -->
<!-- 小程序端必须使用 web-view -->
<!-- #ifdef MP -->
<web-view :src="safeUrl"></web-view>
<!-- #endif -->
<!-- #ifndef MP -->
<view class="tip">仅小程序内使用内嵌浏览器其它端请直接打开外部浏览器</view>
<!-- #endif -->
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const safeUrl = ref('')
onLoad((query) => {
// 兼容编码后的 url
const raw = query && (query.url || '')
try {
safeUrl.value = decodeURIComponent(raw)
} catch (e) {
safeUrl.value = raw
}
})
</script>
<style>
.container{
min-height: 100vh;
}
.tip{
padding: 24rpx;
color: #666;
font-size: 28rpx;
}
</style>