setting.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <ie-page bg-color="#f8fcff">
  3. <ie-navbar title="关于" />
  4. <view class="flex items-center justify-center py-80">
  5. <ie-image src="/static/logo.png" custom-class="w-160 h-160" mode="widthFix" />
  6. </view>
  7. <uv-cell-group class="bg-white !flex-none">
  8. <uv-cell v-for="item in settings" :icon="item.icon" :is-link="item.isLink" :title="item.title" :value="item.value"
  9. icon-style="font-size: 20px;" @click="item.handler()" />
  10. </uv-cell-group>
  11. </ie-page>
  12. </template>
  13. <script lang="ts" setup>
  14. import { useTransferPage } from '@/hooks/useTransferPage';
  15. import { useAppStore } from '@/store/appStore';
  16. import { useUserStore } from '@/store/userStore';
  17. const appStore = useAppStore();
  18. const userStore = useUserStore();
  19. const { transferTo, routes } = useTransferPage();
  20. const contactPhone = computed(() => userStore.orgInfo.contactPhone);
  21. const settings = computed(() => [
  22. {
  23. title: '服务协议',
  24. icon: 'empty-order',
  25. isLink: true,
  26. handler: () => {
  27. transferTo(routes.pageUserProtocol);
  28. }
  29. },
  30. {
  31. title: '隐私政策',
  32. icon: 'lock',
  33. isLink: true,
  34. handler: () => {
  35. transferTo(routes.pagePrivacyPolicy);
  36. }
  37. },
  38. {
  39. title: '清除数据',
  40. icon: 'empty-page',
  41. isLink: true,
  42. value: '',
  43. handler: () => {
  44. // 清除所有本地数据,重启 app
  45. uni.$ie.showModal({
  46. title: '提示',
  47. content: '清除数据后需要重新登录\n是否继续?',
  48. }).then(confirm => {
  49. if (confirm) {
  50. uni.clearStorageSync();
  51. setTimeout(() => {
  52. // 再次尝试清除,防止有补偿机制
  53. uni.clearStorageSync();
  54. // #ifdef H5
  55. window.location.href = '/h5/';
  56. // #endif
  57. // #ifdef MP-WEIXIN
  58. wx.restartMiniProgram({
  59. path: '/pagesMain/pages/splash/splash'
  60. });
  61. // #endif
  62. }, 100);
  63. }
  64. })
  65. }
  66. },
  67. {
  68. title: '当前版本',
  69. icon: 'tags',
  70. value: appStore.systemInfo?.appVersion,
  71. handler: () => {
  72. }
  73. },
  74. {
  75. title: '注销账号',
  76. icon: 'trash',
  77. isLink: true,
  78. handler: async () => {
  79. uni.$ie.showModal({
  80. title: '注销账号',
  81. content: '是否注销账号,注销后卡号将不能再注册使用系统且永久失效。请谨慎操作!'
  82. }).then(confirm => {
  83. if (confirm) {
  84. userStore.deleteAccount();
  85. }
  86. });
  87. }
  88. },
  89. {
  90. title: 'APP备案号',
  91. icon: 'empty-permission',
  92. value: '湘ICP备18012964号-8A',
  93. handler: () => {
  94. }
  95. },
  96. {
  97. title: '客服电话',
  98. icon: 'server-man',
  99. value: contactPhone.value,
  100. handler: () => {
  101. userStore.callContactPhone();
  102. }
  103. }
  104. ]);
  105. </script>
  106. <style lang="scss"></style>