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.

212 lines
4.2 KiB

  1. <template>
  2. <view class="main">
  3. <view :style="{height:iSMT+'px'}"></view>
  4. <view style="height:1.5vh;"></view>
  5. <view class="setting-list">
  6. <view class="setting-item">
  7. <text class="item-label">头像</text>
  8. <view class="item-right">
  9. <image src="/static/avatar.png" class="avatar" mode="aspectFill"></image>
  10. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  11. </view>
  12. </view>
  13. <view class="setting-item">
  14. <text class="item-label">昵称</text>
  15. <view class="item-right">
  16. <text class="item-text">DeepChart</text>
  17. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  18. </view>
  19. </view>
  20. <view class="setting-item">
  21. <text class="item-label">ID</text>
  22. <view class="item-right">
  23. <text class="item-text">{{ jwcode }}</text>
  24. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  25. </view>
  26. </view>
  27. <view class="setting-item">
  28. <text class="item-label">密码</text>
  29. <view class="item-right">
  30. <text class="item-text">qwertyuiop</text>
  31. <uni-icons type="eye" size="16" class="eye-icon"></uni-icons>
  32. </view>
  33. </view>
  34. <view class="setting-item" @click="goToPassword">
  35. <text class="item-label">修改密码</text>
  36. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  37. </view>
  38. <view class="setting-item">
  39. <text class="item-label">注销账号</text>
  40. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  41. </view>
  42. <view class="setting-item" @click="goToBind">
  43. <text class="item-label">绑定账号</text>
  44. <uni-icons type="arrowright" size="16" class="arrow"></uni-icons>
  45. </view>
  46. </view>
  47. <view style="height:1.5vh;"></view>
  48. <view class="logout" @click="showLogout = true">
  49. <text>退出登录</text>
  50. </view>
  51. <view class="logout-confirm" v-if="showLogout">
  52. <view class="logoutDialog">
  53. <view class="tips">是否退出登录</view>
  54. <view class="tips-button">
  55. <button class="confirm-btn" @click="handleConfirmLogout">确认</button>
  56. <button class="cancel-btn" @click="showLogout = false">取消</button>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script setup>
  63. import {
  64. ref,
  65. onMounted
  66. } from 'vue'
  67. const iSMT = ref(0)
  68. const jwcode = ref('90047681')
  69. const showLogout = ref(false)
  70. const handleConfirmLogout = () => {
  71. showLogout.value = false
  72. uni.showToast({
  73. title: '退出登录成功',
  74. icon: 'none',
  75. })
  76. }
  77. const goToBind = () =>{
  78. uni.navigateTo({
  79. url:'../setting/bind'
  80. })
  81. }
  82. const goToPassword = () =>{
  83. uni.navigateTo({
  84. url:'../setting/password'
  85. })
  86. }
  87. onMounted(() => {
  88. iSMT.value = uni.getSystemInfoSync().statusBarHeight;
  89. })
  90. </script>
  91. <style scoped>
  92. .setting-list {
  93. height: 49vh;
  94. background-color: #fff;
  95. }
  96. .setting-item {
  97. display: flex;
  98. align-items: center;
  99. height: 7vh;
  100. padding: 0 40rpx;
  101. border-bottom: 1rpx solid #eee;
  102. }
  103. .setting-item:last-child {
  104. border-bottom: none;
  105. }
  106. .item-label {
  107. font-size: 28rpx;
  108. flex: 1;
  109. }
  110. .item-right {
  111. display: flex;
  112. align-items: center;
  113. }
  114. .avatar {
  115. width: 60rpx;
  116. height: 60rpx;
  117. border-radius: 50%;
  118. margin-right: 20rpx;
  119. background-color: #999;
  120. }
  121. .item-text {
  122. margin-right: 20rpx;
  123. font-size: 28rpx;
  124. }
  125. .arrow,
  126. .eye-icon {
  127. color: #999;
  128. }
  129. .logout {
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. height: 7vh;
  134. font-size: 28rpx;
  135. color: #f56c6c;
  136. background-color: white;
  137. }
  138. .logout-confirm {
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. width: 100%;
  143. height: 100%;
  144. background-color: rgba(0, 0, 0, 0.5);
  145. display: flex;
  146. justify-content: center;
  147. align-items: center;
  148. z-index: 999;
  149. }
  150. .logoutDialog {
  151. width: 500rpx;
  152. background-color: #fff;
  153. border-radius: 12rpx;
  154. padding: 40rpx;
  155. display: flex;
  156. flex-direction: column;
  157. align-items: center;
  158. }
  159. .tips {
  160. font-size: 32rpx;
  161. margin-bottom: 40rpx;
  162. }
  163. .tips-button {
  164. display: flex;
  165. width: 100%;
  166. justify-content: space-between;
  167. }
  168. .confirm-btn,
  169. .cancel-btn {
  170. width: 180rpx;
  171. height: 60rpx;
  172. line-height: 60rpx;
  173. border-radius: 30rpx;
  174. font-size: 28rpx;
  175. }
  176. .confirm-btn {
  177. background-color: #fff;
  178. color: #000;
  179. border: 1rpx solid #ddd;
  180. }
  181. .cancel-btn {
  182. background-color: #000;
  183. color: #fff;
  184. border: none;
  185. }
  186. </style>