<script lang="ts" setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'

definePage({
  style: {
    navigationBarTitleText: '',
  },
  excludeLoginPath: true,
})

const webviewUrl = ref('')

onLoad((options?: any) => {
  if (options?.url) {
    webviewUrl.value = decodeURIComponent(options.url)
  }
})
</script>

<template>
  <view class="webview-page">
    <web-view v-if="webviewUrl" :src="webviewUrl" />
    <view v-else class="flex h-screen items-center justify-center text-[#999]">
      链接无效
    </view>
  </view>
</template>

<style lang="scss" scoped>
.webview-page {
  width: 100%;
  height: 100vh;
}
</style>
