setting.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="setting-container">
  3. <!-- 自定义导航,可复用headerInfo组件,这里简单写一个 -->
  4. <!-- <view class="nav-header">
  5. <view class="back-btn" @click="goBack">
  6. <image src="/static/img/arrow-left.png" class="back-icon"></image>
  7. </view>
  8. <text class="nav-title">设置</text>
  9. <view class="placeholder"></view>
  10. </view> -->
  11. <!-- 设置项卡片 -->
  12. <view class="menu-section">
  13. <view class="menu-card">
  14. <!-- 用户协议 -->
  15. <view class="menu-item" @click="toUserAgreement">
  16. <view class="menu-item-left">
  17. <!-- <image src="/static/img/mine/icon-mine-policy.png" class="menu-icon"></image> -->
  18. <text class="menu-text">用户协议</text>
  19. </view>
  20. <image src="/static/img/arrow-right.png" class="arrow-icon"></image>
  21. </view>
  22. <!-- 隐私条款(隐私政策) -->
  23. <view class="menu-item" @click="toPrivacyPolicy">
  24. <view class="menu-item-left">
  25. <!-- <image src="/static/img/mine/icon-mine-policy.png" class="menu-icon"></image> -->
  26. <text class="menu-text">隐私条款</text>
  27. </view>
  28. <image src="/static/img/arrow-right.png" class="arrow-icon"></image>
  29. </view>
  30. <!-- 个人信息已收集清单 -->
  31. <view class="menu-item" @click="toUserInfoList">
  32. <view class="menu-item-left">
  33. <!-- <image src="/static/img/mine/icon-mine-policy.png" class="menu-icon"></image> -->
  34. <text class="menu-text">个人信息已收集清单</text>
  35. </view>
  36. <image src="/static/img/arrow-right.png" class="arrow-icon"></image>
  37. </view>
  38. <!-- 第三方信息共享清单 -->
  39. <view class="menu-item" @click="toThirdPartyList">
  40. <view class="menu-item-left">
  41. <!-- <image src="/static/img/mine/icon-mine-policy.png" class="menu-icon"></image> -->
  42. <text class="menu-text">第三方信息共享清单</text>
  43. </view>
  44. <image src="/static/img/arrow-right.png" class="arrow-icon"></image>
  45. </view>
  46. <!-- 注销账号 -->
  47. <!-- <view class="menu-item" @click="cancelAccount">
  48. <view class="menu-item-left">
  49. <text class="menu-text">注销账号</text>
  50. </view>
  51. <image src="/static/img/arrow-right.png" class="arrow-icon"></image>
  52. </view> -->
  53. <!-- 退出登录 -->
  54. <!-- <view class="menu-item logout-item" @click="userLogoutFn">
  55. <text class="menu-text logout-text">退出登录</text>
  56. </view> -->
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script setup>
  62. import { ref } from "vue";
  63. import { useAppStore } from "@/stores/app";
  64. const appStore = useAppStore();
  65. // 返回上一页
  66. function goBack() {
  67. uni.navigateBack();
  68. }
  69. // 跳转到用户协议
  70. function toUserAgreement() {
  71. uni.navigateTo({
  72. url: '/pages/webView/webView?title=用户协议&url=' + encodeURIComponent('https://rjsd.mychery.com/user_agreement.html')
  73. });
  74. }
  75. // 跳转到隐私政策
  76. function toPrivacyPolicy() {
  77. uni.navigateTo({
  78. url: '/pages/webView/webView?title=隐私条款&url=' + encodeURIComponent('https://rjsd.mychery.com/privacy_policy.html')
  79. });
  80. }
  81. // 跳转到个人信息收集清单
  82. function toUserInfoList() {
  83. uni.navigateTo({
  84. url: '/pages/webView/webView?title=个人信息已收集清单&url=' + encodeURIComponent('https://rjsd.mychery.com/userinfo.html')
  85. });
  86. }
  87. // 跳转到第三方信息共享清单
  88. function toThirdPartyList() {
  89. uni.navigateTo({
  90. url: '/pages/webView/webView?title=第三方信息共享清单&url=' + encodeURIComponent('https://rjsd.mychery.com/third_userinfo.html')
  91. });
  92. }
  93. // 注销账号(需单独处理,此处先弹窗提示)
  94. function cancelAccount() {
  95. uni.showModal({
  96. title: '提示',
  97. content: '确认要注销账号吗?注销后所有数据将被清除且无法恢复。',
  98. success: (res) => {
  99. if (res.confirm) {
  100. // 这里可以调用注销接口
  101. uni.showToast({ title: '注销功能暂未开放', icon: 'none' });
  102. }
  103. }
  104. });
  105. }
  106. // 退出登录
  107. function userLogoutFn() {
  108. uni.showModal({
  109. title: '提示',
  110. content: '确认要退出登录吗?',
  111. success: function(res) {
  112. if (res.confirm) {
  113. appStore.LOGOUT();
  114. uni.navigateBack(); // 退出后返回上一页
  115. }
  116. }
  117. });
  118. }
  119. </script>
  120. <style lang="less" scoped>
  121. .setting-container {
  122. height: 100vh;
  123. background: #F5F7FA;
  124. padding: 0 20rpx;
  125. .nav-header {
  126. display: flex;
  127. align-items: center;
  128. justify-content: space-between;
  129. padding: 28rpx 16rpx 20rpx;
  130. background: transparent;
  131. .back-btn {
  132. width: 60rpx;
  133. height: 60rpx;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. .back-icon {
  138. width: 48rpx;
  139. height: 48rpx;
  140. }
  141. }
  142. .nav-title {
  143. font-size: 36rpx;
  144. font-weight: 600;
  145. color: #333333;
  146. }
  147. .placeholder {
  148. width: 60rpx;
  149. height: 60rpx;
  150. }
  151. }
  152. .menu-section {
  153. padding-top: 20rpx;
  154. .menu-card {
  155. overflow: hidden;
  156. }
  157. .menu-item {
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. padding: 32rpx;
  162. background: #FFFFFF;
  163. border-radius: 24rpx;
  164. margin-bottom: 20rpx;
  165. min-height: 112rpx;
  166. .menu-item-left {
  167. display: flex;
  168. align-items: center;
  169. gap: 24rpx;
  170. flex: 1;
  171. }
  172. .menu-icon {
  173. width: 48rpx;
  174. height: 48rpx;
  175. flex-shrink: 0;
  176. }
  177. .menu-text {
  178. font-size: 32rpx;
  179. font-weight: 500;
  180. color: #333333;
  181. line-height: 45rpx;
  182. }
  183. .arrow-icon {
  184. width: 48rpx;
  185. height: 48rpx;
  186. opacity: 0.5;
  187. flex-shrink: 0;
  188. }
  189. &.logout-item {
  190. height: 88rpx;
  191. background: #FEEAEA;
  192. border-radius: 32rpx;
  193. display: flex;
  194. justify-content: center;
  195. align-items: center;
  196. .logout-text {
  197. font-weight: 400;
  198. font-size: 32rpx;
  199. color: #F52929;
  200. text-align: center;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>