weekXiYi.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="agreement-page">
  3. <!-- 顶部间距占位 -->
  4. <view class="top-spacing"></view>
  5. <!-- 顶部导航栏 -->
  6. <view class="page-header">
  7. <!-- 返回图标 -->
  8. <view class="back-icon" @click="goBack">
  9. <u-icon name="arrow-leftward" size="36" color="#333"></u-icon>
  10. </view>
  11. <text class="header-title">会员服务协议</text>
  12. </view>
  13. <!-- 富文本内容区域 -->
  14. <scroll-view class="content-container" scroll-y="true">
  15. <view class="agreement-content" v-html="content"></view>
  16. <!-- 底部提示 -->
  17. <view class="agreement-footer">
  18. <text class="footer-text">以上协议内容最终解释权归本平台所有</text>
  19. </view>
  20. </scroll-view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. content: ''
  28. }
  29. },
  30. onLoad() {
  31. this.getGuize();
  32. },
  33. methods: {
  34. getGuize() {
  35. this.$Request.getT('/app/common/type/315').then(res => {
  36. if (res.code === 0) {
  37. this.content = res.data.value;
  38. } else {
  39. this.content = '<div style="text-align:center;padding:50upx;">协议内容加载失败,请稍后重试</div>';
  40. }
  41. }).catch(err => {
  42. console.error('协议加载失败:', err);
  43. this.content = '<div style="text-align:center;padding:50upx;">协议内容加载失败,请检查网络连接</div>';
  44. });
  45. },
  46. // 返回上一页
  47. goBack() {
  48. uni.navigateBack({
  49. delta: 1
  50. });
  51. }
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. /* 页面整体样式 */
  57. .agreement-page {
  58. width: 100%;
  59. min-height: 100vh;
  60. background: #FFFFFF;
  61. display: flex;
  62. flex-direction: column;
  63. }
  64. /* 顶部间距占位 - 控制整体下移的距离 */
  65. .top-spacing {
  66. height: 60upx; /* 可根据需要调整这个值来控制下移距离 */
  67. background-color: #FFFFFF;
  68. }
  69. /* 顶部导航栏 */
  70. .page-header {
  71. height: 88upx;
  72. line-height: 88upx;
  73. text-align: center;
  74. border-bottom: 1px solid #EEEEEE;
  75. background-color: #fff;
  76. position: sticky;
  77. top: 60upx; /* 对应top-spacing的高度 */
  78. z-index: 10;
  79. /* 开启flex布局,实现返回按钮和标题的排列 */
  80. display: flex;
  81. align-items: center;
  82. padding: 0 20upx;
  83. }
  84. /* 返回图标样式 */
  85. .back-icon {
  86. position: absolute;
  87. left: 20upx;
  88. top: 50%;
  89. transform: translateY(-50%);
  90. width: 44upx;
  91. height: 44upx;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. }
  96. .header-title {
  97. font-size: 36upx;
  98. font-weight: 600;
  99. color: #333333;
  100. /* 让标题居中显示 */
  101. flex: 1;
  102. }
  103. /* 内容滚动容器 */
  104. .content-container {
  105. flex: 1;
  106. padding: 32upx;
  107. box-sizing: border-box;
  108. }
  109. /* 富文本内容样式 */
  110. .agreement-content {
  111. font-size: 28upx;
  112. line-height: 1.8;
  113. color: #333333;
  114. }
  115. /* 富文本内部元素样式重置 */
  116. .agreement-content >>> p {
  117. margin: 0 0 20upx 0;
  118. }
  119. .agreement-content >>> h1,
  120. .agreement-content >>> h2,
  121. .agreement-content >>> h3 {
  122. font-weight: 600;
  123. margin: 30upx 0 15upx 0;
  124. }
  125. .agreement-content >>> h1 {
  126. font-size: 32upx;
  127. }
  128. .agreement-content >>> h2 {
  129. font-size: 30upx;
  130. }
  131. .agreement-content >>> ul,
  132. .agreement-content >>> ol {
  133. padding-left: 40upx;
  134. margin: 10upx 0;
  135. }
  136. .agreement-content >>> li {
  137. margin-bottom: 10upx;
  138. }
  139. .agreement-content >>> a {
  140. color: #007AFF;
  141. text-decoration: underline;
  142. }
  143. /* 底部提示 */
  144. .agreement-footer {
  145. margin-top: 40upx;
  146. padding-top: 20upx;
  147. border-top: 1px solid #EEEEEE;
  148. }
  149. .footer-text {
  150. font-size: 24upx;
  151. color: #999999;
  152. text-align: center;
  153. }
  154. </style>