setting.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <s-layout class="set-wrap" :title="t('common.system')" :bgStyle="{ color: '#fff' }">
  3. <view class="header-box ss-flex-col ss-row-center ss-col-center">
  4. <image class="logo-img ss-m-b-46" src="@/static/zxlogo.png" mode="aspectFit"></image>
  5. <view class="name ss-m-b-24">{{ appInfo.name }}</view>
  6. </view>
  7. <view class="container-list">
  8. <uni-list :border="false">
  9. <uni-list-item :title="t('common.current_version')" :rightText="appInfo.version" showArrow clickable :border="false"
  10. class="list-border" @tap="onCheckUpdate" />
  11. <uni-list-item :title="t('common.local_cache')" :rightText="storageSize" showArrow :border="false" class="list-border" />
  12. <uni-list-item :title="t('common.about_us')" showArrow clickable :border="false" class="list-border" @tap="
  13. sheep.$router.go('/pages/public/richtext', {
  14. title: '关于我们'
  15. })
  16. " />
  17. <!-- 为了过审 只有 iOS-App 有注销账号功能 -->
  18. <uni-list-item v-if="isLogin && sheep.$platform.os === 'ios' && sheep.$platform.name === 'App'"
  19. :title="t('common.logout_account')" rightText="" showArrow clickable :border="false" class="list-border"
  20. @click="onLogoff" />
  21. </uni-list>
  22. </view>
  23. <view class="set-footer ss-flex-col ss-row-center ss-col-center">
  24. <view class="agreement-box ss-flex ss-col-center ss-m-b-40">
  25. <view class="ss-flex ss-col-center ss-m-b-10">
  26. <view class="tcp-text" @tap="
  27. sheep.$router.go('/pages/public/richtext', {
  28. title: '用户协议'
  29. })
  30. ">
  31. {{ t('account.user_agreement') }}
  32. </view>
  33. <view class="agreement-text">&nbsp; {{ t('account.and') }} &nbsp;</view>
  34. <view class="tcp-text" @tap="
  35. sheep.$router.go('/pages/public/richtext', {
  36. title: '隐私协议'
  37. })
  38. ">
  39. {{ t('account.privacy_policy') }}
  40. </view>
  41. </view>
  42. </view>
  43. <!-- <view class="copyright-text ss-m-b-10">{{ appInfo.copyright }}</view> -->
  44. <!-- <view class="copyright-text">{{ appInfo.copytime }}</view> -->
  45. </view>
  46. <!-- <su-fixed bottom placeholder>
  47. <view class="ss-p-x-20 ss-p-b-40">
  48. <button class="loginout-btn ss-reset-button ui-BG-Main ui-Shadow-Main" @tap="onLogout" v-if="isLogin">
  49. 退出登录
  50. </button>
  51. </view>
  52. </su-fixed> -->
  53. </s-layout>
  54. </template>
  55. <script setup>
  56. import sheep from '@/sheep';
  57. import {
  58. computed,
  59. reactive
  60. } from 'vue';
  61. import AuthUtil from '@/sheep/api/member/auth';
  62. import { t } from '@/locale'
  63. const appInfo = computed(() => sheep.$store('app').info);
  64. const isLogin = computed(() => sheep.$store('user').isLogin);
  65. const storageSize = uni.getStorageInfoSync().currentSize + 'Kb';
  66. const state = reactive({
  67. showModal: false,
  68. });
  69. function onCheckUpdate() {
  70. sheep.$platform.checkUpdate();
  71. // 小程序初始化时已检查更新
  72. // H5实时更新无需检查
  73. // App 1.跳转应用市场更新 2.手动热更新 3.整包更新
  74. }
  75. // 注销账号
  76. function onLogoff() {
  77. uni.showModal({
  78. title: t('setting.prompt'),
  79. content: t('common.confirm_logout'),
  80. success: async function(res) {
  81. if (!res.confirm) {
  82. return;
  83. }
  84. const {
  85. code
  86. } = await AuthUtil.logout();
  87. if (code !== 0) {
  88. return;
  89. }
  90. sheep.$store('user').logout();
  91. sheep.$router.go('/pages/index/user');
  92. },
  93. });
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .container-list {
  98. width: 100%;
  99. }
  100. .set-title {
  101. margin: 0 30rpx;
  102. }
  103. .header-box {
  104. padding: 100rpx 0;
  105. .logo-img {
  106. width: 160rpx;
  107. height: 160rpx;
  108. border-radius: 50%;
  109. }
  110. .name {
  111. font-size: 42rpx;
  112. font-weight: 400;
  113. color: $dark-3;
  114. }
  115. .version {
  116. font-size: 32rpx;
  117. font-weight: 500;
  118. line-height: 32rpx;
  119. color: $gray-b;
  120. }
  121. }
  122. .set-footer {
  123. margin: 100rpx 0 0 0;
  124. .copyright-text {
  125. font-size: 22rpx;
  126. font-weight: 500;
  127. color: $gray-c;
  128. line-height: 30rpx;
  129. }
  130. .agreement-box {
  131. font-size: 26rpx;
  132. font-weight: 500;
  133. .tcp-text {
  134. color: var(--ui-BG-Main);
  135. }
  136. .agreement-text {
  137. color: $dark-9;
  138. }
  139. }
  140. }
  141. .loginout-btn {
  142. width: 100%;
  143. height: 80rpx;
  144. border-radius: 40rpx;
  145. font-size: 30rpx;
  146. }
  147. .list-border {
  148. font-size: 28rpx;
  149. font-weight: 400;
  150. color: #333333;
  151. border-bottom: 2rpx solid #eeeeee;
  152. }
  153. :deep(.uni-list-item__content-title) {
  154. font-size: 28rpx;
  155. font-weight: 500;
  156. color: #333;
  157. }
  158. :deep(.uni-list-item__extra-text) {
  159. color: #bbbbbb;
  160. font-size: 28rpx;
  161. }
  162. </style>