<template>
  <web-view :src="src" />
</template>

<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";

let src = ref("");

const PRIVACY_URL = "https://secret.feihe.com/secret.html";
const MEMBER_URL = "https://secret.feihe.com/index.html";

const urlMap = {
  PRIVACY_URL,
  MEMBER_URL,
};

onLoad((options) => {
  let url = "";

  if (options.type) {
    const type = options.type;
    url = urlMap[type];
  } else {
    url = decodeURIComponent(options.url) || "";
  }

  src.value = url;
});
</script> 