You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
2.9 KiB

  1. <template>
  2. <view class="main">
  3. <view :style="{height:iSMT+'px'}"></view>
  4. <view class="top">
  5. <view class="top-list">
  6. <text>语言</text>
  7. <text class="language">中文简体</text>
  8. <uni-icons type="arrowright" size="16" class="arrow" />
  9. </view>
  10. <view class="top-list" @click="goToFont">
  11. <text>字体大小</text>
  12. <uni-icons type="arrowright" size="16" class="arrow" />
  13. </view>
  14. <view class="top-list" @click="goToTheme">
  15. <text>主题切换</text>
  16. <uni-icons type="arrowright" size="16" class="arrow" />
  17. </view>
  18. </view>
  19. <view class="center">
  20. <view class="center-list" @click="goToMessage">
  21. <text>消息推送</text>
  22. <uni-icons type="arrowright" size="16" class="arrow" />
  23. </view>
  24. </view>
  25. <view class="bottom">
  26. <view class="bottom-list" @click="goToServer">
  27. <text>切换服务器</text>
  28. <uni-icons type="arrowright" size="16" class="arrow" />
  29. </view>
  30. <view class="bottom-list" @click="clearCache">
  31. <text>清理缓存</text>
  32. <text class="cache">{{ cache }}M</text>
  33. <uni-icons type="arrowright" size="16" class="arrow" />
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script setup>
  39. import {
  40. ref,
  41. onMounted
  42. } from 'vue'
  43. const iSMT = ref(0)
  44. const cache = ref('45.5')
  45. const goToFont = () => {
  46. uni.navigateTo({
  47. url: '/pages/setting/font'
  48. })
  49. }
  50. const goToTheme = () => {
  51. uni.navigateTo({
  52. url: '/pages/setting/theme'
  53. })
  54. }
  55. const goToMessage = () => {
  56. uni.navigateTo({
  57. url: '/pages/setting/message'
  58. })
  59. }
  60. const goToServer = () => {
  61. uni.navigateTo({
  62. url: '/pages/setting/server'
  63. })
  64. }
  65. const clearCache = () => {
  66. cache.value = 0
  67. uni.showToast({
  68. title: '清理成功',
  69. icon: 'success',
  70. duration: 1500
  71. })
  72. }
  73. onMounted(() => {
  74. // 状态栏高度
  75. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  76. console.log('看看高度', iSMT.value)
  77. })
  78. </script>
  79. <style>
  80. .top {
  81. margin-top: 1.5vh;
  82. height: 21vh;
  83. background-color: white;
  84. }
  85. .top-list {
  86. width: 630rpx;
  87. height: 7vh;
  88. display: flex;
  89. align-items: center;
  90. margin: 0 40rpx;
  91. padding: 0 10rpx;
  92. border-bottom: 1rpx solid #eee;
  93. }
  94. .top-list:last-child {
  95. border-bottom: none;
  96. }
  97. .language {
  98. margin-left: 55%;
  99. font-size: 14px;
  100. color: rgb(203, 203, 203);
  101. }
  102. .arrow {
  103. margin-left: auto;
  104. }
  105. .center {
  106. background-color: white;
  107. height: 7vh;
  108. display: flex;
  109. align-items: center;
  110. margin-top: 1vh;
  111. }
  112. .center-list {
  113. width: 630rpx;
  114. margin: 0rpx 40rpx;
  115. display: flex;
  116. padding: 0 10rpx;
  117. }
  118. .center-list>.arrow {
  119. margin-right: 0;
  120. }
  121. .bottom {
  122. height: 13.5vh;
  123. background-color: white;
  124. margin-top: 1vh;
  125. }
  126. .bottom-list {
  127. width: 630rpx;
  128. height: 7vh;
  129. display: flex;
  130. align-items: center;
  131. margin: 0 40rpx;
  132. padding: 0 10rpx;
  133. border-bottom: 1rpx solid #eee;
  134. }
  135. .cache {
  136. margin-left: 55%;
  137. font-size: 14px;
  138. color: rgb(203, 203, 203);
  139. }
  140. .bottom-list:last-child {
  141. border-bottom: none;
  142. }
  143. </style>