index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="agreement-page">
  3. <!-- 顶部渐变背景区域 -->
  4. <view class="header-bg" :style="{ paddingTop: statusBarHeight + 'px' }">
  5. <view class="header-content">
  6. <view class="back-btn" @click="handleBack">
  7. <text class="back-icon">‹</text>
  8. </view>
  9. <text class="header-title">用户协议</text>
  10. <view class="placeholder"></view>
  11. </view>
  12. </view>
  13. <!-- 页面内容 -->
  14. <view class="page-content">
  15. <!-- 协议列表 -->
  16. <view class="agreement-list">
  17. <!-- 用户协议 -->
  18. <view class="list-item" @click="handleUserAgreement">
  19. <view class="item-left">
  20. <image class="item-icon" src="/static/pages-content/my/agreement/user.png" mode="aspectFit" />
  21. <view class="item-info">
  22. <text class="item-title">用户协议</text>
  23. <text class="item-desc">了解使用本应用的相关条款</text>
  24. </view>
  25. </view>
  26. <text class="arrow">›</text>
  27. </view>
  28. <!-- 隐私协议 -->
  29. <view class="list-item" @click="handlePrivacyPolicy">
  30. <view class="item-left">
  31. <image class="item-icon" src="/static/pages-content/my/agreement/privacy.png" mode="aspectFit" />
  32. <view class="item-info">
  33. <text class="item-title">隐私政策</text>
  34. <text class="item-desc">了解我们如何保护您的隐私</text>
  35. </view>
  36. </view>
  37. <text class="arrow">›</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script setup>
  44. import { ref, onMounted } from 'vue'
  45. // 状态栏高度
  46. const statusBarHeight = ref(0)
  47. onMounted(() => {
  48. // 获取系统信息
  49. const systemInfo = uni.getSystemInfoSync()
  50. statusBarHeight.value = systemInfo.statusBarHeight || 0
  51. })
  52. // 返回上一页
  53. const handleBack = () => {
  54. const pages = getCurrentPages()
  55. if (pages.length > 1) {
  56. uni.navigateBack()
  57. } else {
  58. uni.reLaunch({
  59. url: '/pages/index'
  60. })
  61. }
  62. }
  63. // 用户协议
  64. const handleUserAgreement = () => {
  65. uni.navigateTo({
  66. url: '/pages-content/my/aggreement/detail?type=user'
  67. })
  68. }
  69. // 隐私协议
  70. const handlePrivacyPolicy = () => {
  71. uni.navigateTo({
  72. url: '/pages-content/my/aggreement/detail?type=privacy'
  73. })
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .agreement-page {
  78. width: 100%;
  79. min-height: 100vh;
  80. background-color: #f5f5f5;
  81. // 顶部渐变背景
  82. .header-bg {
  83. background: linear-gradient(180deg, #1ec9c9 0%, #1eb8b8 100%);
  84. .header-content {
  85. height: 88rpx;
  86. display: flex;
  87. align-items: center;
  88. justify-content: space-between;
  89. padding: 0 24rpx;
  90. .back-btn {
  91. width: 60rpx;
  92. height: 60rpx;
  93. display: flex;
  94. align-items: center;
  95. justify-content: flex-start;
  96. .back-icon {
  97. font-size: 56rpx;
  98. color: #ffffff;
  99. font-weight: 300;
  100. }
  101. }
  102. .header-title {
  103. flex: 1;
  104. text-align: center;
  105. font-size: 32rpx;
  106. font-weight: 600;
  107. color: #ffffff;
  108. }
  109. .placeholder {
  110. width: 60rpx;
  111. }
  112. }
  113. }
  114. // 页面内容
  115. .page-content {
  116. padding: 24rpx;
  117. // 协议列表
  118. .agreement-list {
  119. .list-item {
  120. background: #ffffff;
  121. border-radius: 16rpx;
  122. padding: 32rpx 24rpx;
  123. margin-bottom: 16rpx;
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  128. &:active {
  129. background-color: #f8f8f8;
  130. }
  131. .item-left {
  132. flex: 1;
  133. display: flex;
  134. align-items: center;
  135. .item-icon {
  136. width: 40rpx;
  137. height: 40rpx;
  138. margin-right: 24rpx;
  139. }
  140. .item-info {
  141. flex: 1;
  142. display: flex;
  143. flex-direction: column;
  144. gap: 8rpx;
  145. .item-title {
  146. font-size: 28rpx;
  147. color: #333333;
  148. font-weight: 500;
  149. }
  150. .item-desc {
  151. font-size: 24rpx;
  152. color: #999999;
  153. line-height: 1.4;
  154. }
  155. }
  156. }
  157. .arrow {
  158. font-size: 40rpx;
  159. color: #cccccc;
  160. font-weight: 300;
  161. margin-left: 16rpx;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. </style>