index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="container">
  3. <!-- 自定义头部 -->
  4. <view class="custom-header">
  5. <view class="header-left" @click="navBack">
  6. <image class="back-icon" src="/static/icons/chevron_right_dark.svg" style="transform: rotate(180deg);"></image>
  7. </view>
  8. <text class="header-title">设置</text>
  9. <view class="header-right"></view>
  10. </view>
  11. <view class="header-placeholder"></view>
  12. <!-- 个人信息组 -->
  13. <view class="group-card">
  14. <view class="list-item" @click="navTo('profile')">
  15. <text class="item-title">个人资料</text>
  16. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  17. </view>
  18. <view class="list-item" @click="navTo('auth')">
  19. <text class="item-title">认证信息</text>
  20. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  21. </view>
  22. <view class="list-item" @click="navTo('bank')">
  23. <text class="item-title">银行卡信息</text>
  24. <view class="item-right">
  25. <view class="tag-status">已完善</view>
  26. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  27. </view>
  28. </view>
  29. <view class="list-item no-border" @click="navTo('security')">
  30. <text class="item-title">账号与安全</text>
  31. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  32. </view>
  33. </view>
  34. <!-- 应用设置组 -->
  35. <view class="group-card">
  36. <view class="list-item" @click="navTo('push')">
  37. <text class="item-title">推送通知</text>
  38. <view class="item-right">
  39. <text class="item-value">部分开启</text>
  40. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  41. </view>
  42. </view>
  43. <view class="list-item">
  44. <view class="item-row-left">
  45. <text class="item-title">位置上报</text>
  46. <text class="item-subtitle">每隔20分钟自动上报位置</text>
  47. </view>
  48. <switch checked color="#FF5722" style="transform:scale(0.8)"/>
  49. </view>
  50. <view class="list-item" @click="clearCache">
  51. <text class="item-title">清理缓存</text>
  52. <view class="item-right">
  53. <text class="item-value">105.14MB</text>
  54. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  55. </view>
  56. </view>
  57. <view class="list-item no-border" @click="navTo('about')">
  58. <text class="item-title">关于我们</text>
  59. <view class="item-right">
  60. <text class="item-value">v2.0.6</text>
  61. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {}
  71. },
  72. methods: {
  73. navBack() {
  74. uni.navigateBack({
  75. delta: 1
  76. });
  77. },
  78. navTo(type) {
  79. let url = '';
  80. switch(type) {
  81. case 'profile':
  82. url = '/pages/mine/settings/profile/index';
  83. break;
  84. case 'auth':
  85. url = '/pages/mine/settings/auth/index';
  86. break;
  87. case 'bank':
  88. url = '/pages/mine/settings/bank/index';
  89. break;
  90. case 'security':
  91. url = '/pages/mine/settings/security/index';
  92. break;
  93. case 'push':
  94. url = '/pages/mine/settings/notification/index';
  95. break;
  96. case 'about':
  97. url = '/pages/mine/settings/about/index';
  98. break;
  99. default:
  100. console.log('Navigate to:', type);
  101. return;
  102. }
  103. uni.navigateTo({ url });
  104. },
  105. clearCache() {
  106. uni.showToast({ title: '缓存已清理', icon: 'none' });
  107. }
  108. }
  109. }
  110. </script>
  111. <style>
  112. page {
  113. background-color: #F8F8F8;
  114. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  115. }
  116. .custom-header {
  117. position: fixed;
  118. top: 0;
  119. left: 0;
  120. width: 100%;
  121. height: 88rpx;
  122. padding-top: var(--status-bar-height);
  123. background-color: #fff;
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. padding-left: 30rpx;
  128. padding-right: 30rpx;
  129. box-sizing: content-box; /* Exclude padding from height calculation if needed, or adjust */
  130. z-index: 100;
  131. }
  132. .header-placeholder {
  133. height: calc(88rpx + var(--status-bar-height));
  134. }
  135. .back-icon {
  136. width: 40rpx;
  137. height: 40rpx;
  138. }
  139. .header-title {
  140. font-size: 28rpx; /* 14pt */
  141. font-weight: bold;
  142. color: #333;
  143. }
  144. .header-right {
  145. width: 40rpx;
  146. }
  147. .container {
  148. padding: 20rpx 30rpx;
  149. }
  150. .group-card {
  151. background-color: #fff;
  152. border-radius: 20rpx;
  153. padding: 0 30rpx;
  154. margin-bottom: 30rpx;
  155. }
  156. .list-item {
  157. display: flex;
  158. justify-content: space-between;
  159. align-items: center;
  160. height: 100rpx;
  161. border-bottom: 1px solid #F5F5F5;
  162. }
  163. .list-item.no-border {
  164. border-bottom: none;
  165. }
  166. .item-title {
  167. font-size: 28rpx; /* 14pt */
  168. color: #333;
  169. }
  170. .item-right {
  171. display: flex;
  172. align-items: center;
  173. }
  174. .arrow-icon {
  175. width: 28rpx;
  176. height: 28rpx;
  177. opacity: 0.5;
  178. margin-left: 10rpx;
  179. }
  180. .tag-status {
  181. font-size: 22rpx;
  182. color: #4CAF50;
  183. background-color: #F1F8E9;
  184. padding: 4rpx 10rpx;
  185. border-radius: 6rpx;
  186. margin-right: 6rpx;
  187. }
  188. .item-value {
  189. font-size: 28rpx; /* Changed to 14pt (28rpx) */
  190. color: #999;
  191. }
  192. .item-column {
  193. display: flex;
  194. flex-direction: column;
  195. }
  196. .item-row-left {
  197. display: flex;
  198. align-items: center;
  199. }
  200. .item-subtitle {
  201. font-size: 24rpx; /* Changed to 12pt (24rpx) for better legibility */
  202. color: #999;
  203. margin-left: 20rpx; /* Moved to right of title */
  204. margin-top: 0;
  205. }
  206. </style>