index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="container">
  3. <view class="header">
  4. <view class="avatar">
  5. <image src="@/static/desktop-logo.png" mode=""></image>
  6. </view>
  7. <view class="base-info">
  8. <view class="base-info-item">{{userInfo?.realName || '未命名用户'}}</view>
  9. <!-- <view class="base-info-item">{{userInfo?.sex || "性别"}}</view>
  10. <view class="base-info-item">{{userInfo?.age || "年龄"}}</view> -->
  11. </view>
  12. <!-- <view class="guide" @click="goToPage('/pages/mine/setting/index')">
  13. <text>编辑信息</text>
  14. <u-icon name="arrow-right" color="#fff" size="14" customStyle="margin-left:10rpx"></u-icon>
  15. </view> -->
  16. </view>
  17. <view class="func">
  18. <view class="func-item" @click="goToPage('/pages/mine/verify-email/index')">
  19. <view class="func-name">
  20. <view class="func-icon">
  21. <image src="@/static/pass-change.png" mode=""></image>
  22. </view>
  23. 密码修改
  24. </view>
  25. <u-icon name="arrow-right" color="#343437" size="14" customStyle="margin-left:10rpx"></u-icon>
  26. </view>
  27. <view class="func-item" @click="goToPage('/pages/mine/account-manage/index')">
  28. <view class="func-name">
  29. <view class="func-icon">
  30. <image src="@/static/account-manage.png" mode=""></image>
  31. </view>
  32. 账号管理
  33. </view>
  34. <u-icon name="arrow-right" color="#343437" size="14" customStyle="margin-left:10rpx"></u-icon>
  35. </view>
  36. <view class="func-item">
  37. <view class="func-name">
  38. <view class="func-icon">
  39. <image src="@/static/vision-now.png" mode=""></image>
  40. </view>
  41. 当前版本
  42. </view>
  43. <view class="vision-now">{{visionText}}</view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script setup>
  49. import {
  50. ref
  51. } from "vue"
  52. import {
  53. onLoad
  54. } from "@dcloudio/uni-app"
  55. import {
  56. getInfo
  57. } from "@/api/login.js"
  58. function goToPage(url) {
  59. uni.navigateTo({
  60. url
  61. })
  62. }
  63. let userInfo = ref(null)
  64. let visionText = ref(null)
  65. onLoad(() => {
  66. let vision = uni.getStorageSync('visionNow')
  67. visionText.value = vision ? 'V ' + vision : '获取版本失败'
  68. getInfo().then(res => {
  69. userInfo.value = res.data.user;
  70. if (userInfo.value.realName.length > 8) {
  71. let tempName = userInfo.value.realName
  72. userInfo.value.realName = tempName.substring(0, 7) + '...'
  73. }
  74. })
  75. })
  76. </script>
  77. <style lang="scss">
  78. .header {
  79. width: 92%;
  80. height: 36%;
  81. margin: 0 auto;
  82. z-index: 1;
  83. background: url('@/static/mine_bg.png') no-repeat;
  84. background-size: 494rpx 504rpx;
  85. background-position: 50% 120%;
  86. .avatar {
  87. position: absolute;
  88. top: 9.8%;
  89. left: 4%;
  90. width: 128rpx;
  91. height: 128rpx;
  92. border-radius: 50%;
  93. background-color: #fff;
  94. image {
  95. width: 100%;
  96. height: 100%;
  97. border-radius: 50%;
  98. }
  99. }
  100. .base-info {
  101. position: absolute;
  102. top: 9.8%;
  103. left: calc(4% + 168rpx);
  104. display: flex;
  105. justify-content: space-between;
  106. height: 128rpx;
  107. width: 306rpx;
  108. .base-info-item {
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. font-size: 36rpx;
  113. font-weight: 500;
  114. color: #FFF;
  115. }
  116. }
  117. .guide {
  118. position: absolute;
  119. top: 9.8%;
  120. right: 4%;
  121. display: flex;
  122. align-items: center;
  123. height: 128rpx;
  124. font-size: 28rpx;
  125. color: #fff;
  126. }
  127. }
  128. .func {
  129. position: absolute;
  130. top: 20.5%;
  131. left: 0;
  132. width: 100%;
  133. height: 79.5%;
  134. padding: 40rpx 4%;
  135. box-sizing: border-box;
  136. background-color: #fff;
  137. border-radius: 40rpx 40rpx 0rpx 0rpx;
  138. .func-item {
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. width: 100%;
  143. height: 112rpx;
  144. font-size: 36rpx;
  145. color: #343437;
  146. line-height: 30rpx;
  147. }
  148. .func-name {
  149. display: flex;
  150. align-items: center;
  151. }
  152. .func-icon {
  153. width: 44rpx;
  154. height: 44rpx;
  155. border-radius: 50%;
  156. margin-right: 36rpx;
  157. image {
  158. width: 100%;
  159. height: 100%;
  160. border-radius: 50%;
  161. }
  162. }
  163. }
  164. </style>