index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="privacy-page">
  3. <erp-nav-bar :title="title" />
  4. <scroll-view scroll-y class="content-scroll" :style="{ height: scrollHeight }">
  5. <view class="article-body">
  6. <rich-text :nodes="privacyNodes"></rich-text>
  7. </view>
  8. </scroll-view>
  9. </view>
  10. </template>
  11. <script>
  12. import { getAgreement } from '@/api/system/agreement.js';
  13. import ErpNavBar from '@/components/erp-nav-bar.vue';
  14. export default {
  15. components: { ErpNavBar },
  16. data() {
  17. return {
  18. statusBarHeight: 20,
  19. title: '',
  20. privacyNodes: ''
  21. }
  22. },
  23. computed: {
  24. scrollHeight() {
  25. return `calc(100vh - ${this.statusBarHeight + 44}px)`;
  26. }
  27. },
  28. async onLoad() {
  29. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20;
  30. try {
  31. const res = await getAgreement(2);
  32. this.title = res.data.title;
  33. this.privacyNodes = res.data.content;
  34. } catch (e) {
  35. console.error('[隐私政策] 加载失败', e);
  36. }
  37. },
  38. methods: {
  39. goBack() { uni.navigateBack(); }
  40. }
  41. }
  42. </script>
  43. <style scoped>
  44. .privacy-page {
  45. width: 100vw;
  46. height: 100vh;
  47. background: #ffffff;
  48. display: flex;
  49. flex-direction: column;
  50. }
  51. .content-scroll {
  52. width: 100%;
  53. }
  54. .article-body {
  55. padding: 40rpx;
  56. padding-top: 20rpx;
  57. }
  58. .title {
  59. font-size: 40rpx;
  60. font-weight: bold;
  61. color: #1a1a1a;
  62. margin-bottom: 16rpx;
  63. text-align: center;
  64. }
  65. .update-time {
  66. font-size: 24rpx;
  67. color: #999;
  68. margin-bottom: 40rpx;
  69. text-align: center;
  70. }
  71. .safe-bottom-hint {
  72. margin-top: 80rpx;
  73. text-align: center;
  74. color: #52c41a;
  75. font-size: 24rpx;
  76. opacity: 0.6;
  77. }
  78. </style>