privacy.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <cwg-page-wrapper class="permission-page" :isHeaderFixed="true">
  3. <cwg-header :title="title" :showBack="true" />
  4. <view class="content">
  5. <view class="privacy" v-html="privacy"></view>
  6. </view>
  7. </cwg-page-wrapper>
  8. </template>
  9. <script setup lang="ts">
  10. import { ref, onMounted, computed } from 'vue'
  11. import { ucardApi } from '@/api/ucard'
  12. import { onLoad } from '@dcloudio/uni-app'
  13. import { useI18n } from "vue-i18n";
  14. const { t } = useI18n();
  15. const type = ref(1);
  16. onLoad((o) => {
  17. type.value = o?.type || 1;
  18. getPrivacy();
  19. });
  20. const titleMap: Record<number, string> = {
  21. 1: t('mine.p15'),
  22. 2: t('mine.p16'),
  23. 3: t('mine.p17'),
  24. 4: t('mine.p18'),
  25. };
  26. const title = computed(() => {
  27. return titleMap[type.value]
  28. });
  29. const privacy = ref('');
  30. const getPrivacy = async () => {
  31. const res = await ucardApi.getAppPrivacyPolicyPage({ page: { current: 1, row: 10 }, type: type.value });
  32. if (res.code === 200) {
  33. privacy.value = res.data[0].content;
  34. }
  35. };
  36. </script>
  37. <style lang="scss" scoped>
  38. @import "@/uni.scss";
  39. .permission-page {
  40. min-height: 100vh;
  41. background-color: #f5f5f5;
  42. padding: px2rpx(12) !important;
  43. .content {}
  44. }
  45. </style>