<template>
  <view><rich-text :nodes="nodes"></rich-text> </view>
</template>

<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getAgreement } from "../../../api/user";

const nodes = ref(``);

Taro.useLoad((e) => {
  Taro.setNavigationBarTitle({
    title: e.name,
  });
  get_data(e.type);
});

const get_data = async (type: string) => {
  const res = await getAgreement();
  switch (type) {
    case "1":
      nodes.value = res.data.data.user;
      break;
    case "2":
      nodes.value = res.data.data.policy;
      break;
    case "3":
      nodes.value = res.data.data.integral;
      break;
  }
};
</script>

<style lang="scss">
@import "./index.scss";
</style>
