shezhi.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="container">
  3. <!-- 头像 -->
  4. <view class="touxiang">
  5. <view class="tou">头像</view>
  6. <view class="avatar"><image :src=" userInfo.avatar || '../../static/error/missing-face.png' "></image></view>
  7. </view>
  8. <!-- 昵称 -->
  9. <view class="nicheng">
  10. <view class="text">昵称</view>
  11. <view class="username">{{ userInfo.nickname || '游客' }}</view>
  12. </view>
  13. <view class="yaoqing">
  14. <view class="ma">邀请码</view>
  15. <view class="shu">102320</view>
  16. </view>
  17. <view class="zhanghu">
  18. <view class="qq">账户</view>
  19. <view class="number">13911111111</view>
  20. </view>
  21. <view class="btn"><text>退出登录</text></view>
  22. </view>
  23. </template>
  24. <script>
  25. import { edit } from '@/api/user'
  26. export default {
  27. data () {
  28. return {
  29. userInfo: {}
  30. }
  31. },
  32. created () {
  33. this.loadUser ()
  34. },
  35. methods: {
  36. nav (url) {
  37. uni.navigateTo({
  38. url
  39. })
  40. },
  41. async loadUser () {
  42. const { data } = await edit ()
  43. console.log(data)
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .container {
  50. background-color: #F2F3F5;
  51. width: 750rpx;
  52. height: 1334rpx;
  53. .touxiang {
  54. height: 120rpx;
  55. display: flex;
  56. justify-content: space-between;
  57. align-items: center;
  58. background-color: #fff;
  59. .tou {
  60. font-size: 32rpx;
  61. font-family: PingFang SC;
  62. font-weight: 400;
  63. color: #333333;
  64. margin-left: 25rpx;
  65. }
  66. .avatar {
  67. image {
  68. width: 80rpx;
  69. height: 80rpx;
  70. border-radius: 50%;
  71. margin-right: 25rpx;
  72. }
  73. }
  74. }
  75. .nicheng {
  76. height: 100rpx;
  77. display: flex;
  78. justify-content: space-between;
  79. align-items: center;
  80. background-color: #fff;
  81. border-bottom: 1rpx solid #F0F0F0;
  82. margin-top: 20rpx;
  83. .text {
  84. font-size: 32rpx;
  85. font-family: PingFang SC;
  86. font-weight: 400;
  87. color: #333333;
  88. margin-left: 25rpx;
  89. }
  90. .username {
  91. font-size: 28rpx;
  92. font-family: PingFang SC;
  93. font-weight: 400;
  94. color: #333333;
  95. margin-right: 25rpx;
  96. }
  97. }
  98. .yaoqing {
  99. height: 100rpx;
  100. display: flex;
  101. justify-content: space-between;
  102. align-items: center;
  103. background-color: #fff;
  104. border-bottom: 1rpx solid #F0F0F0;
  105. .ma {
  106. font-size: 32rpx;
  107. font-family: PingFang SC;
  108. font-weight: 400;
  109. color: #333333;
  110. margin-left: 25rpx;
  111. }
  112. .shu {
  113. font-size: 28rpx;
  114. font-family: PingFang SC;
  115. font-weight: 400;
  116. color: #333333;
  117. margin-right: 25rpx;
  118. }
  119. }
  120. .zhanghu {
  121. height: 100rpx;
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. background-color: #fff;
  126. .qq {
  127. font-size: 32rpx;
  128. font-family: PingFang SC;
  129. font-weight: 400;
  130. color: #333333;
  131. margin-left: 25rpx;
  132. }
  133. .number {
  134. font-size: 28rpx;
  135. font-family: PingFang SC;
  136. font-weight: 400;
  137. color: #333333;
  138. margin-right: 25rpx;
  139. }
  140. }
  141. .btn {
  142. width: 560rpx;
  143. height: 80rpx;
  144. background: #6EAB4E;
  145. border-radius: 40rpx;
  146. margin-top: 157rpx;
  147. margin-left: 95rpx;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. text {
  152. font-size: 30rpx;
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. color: #FFFFFF;
  156. }
  157. }
  158. }
  159. </style>