user.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <image :src="avatar" mode="widthFix"></image>
  5. <view class="detail">
  6. <text class="name">{{nick}}</text>
  7. <text class="motto">心若冰清,天塌不惊。万变犹定,神怡气清。</text>
  8. </view>
  9. </view>
  10. <view class="middle">
  11. <view class="item">
  12. <text>用户ID</text>
  13. <text>{{id}}</text>
  14. </view>
  15. <view class="item">
  16. <text>账号</text>
  17. <text>{{account}}</text>
  18. </view>
  19. <view class="item">
  20. <text>姓名</text>
  21. <text>{{name}}</text>
  22. </view>
  23. <view class="item">
  24. <text>电话</text>
  25. <text>{{phone||''}}</text>
  26. </view>
  27. <view class="item" style="border-bottom:#d9d9d9 solid 0upx">
  28. <text>邮箱</text>
  29. <text>{{email||''}}</text>
  30. </view>
  31. </view>
  32. <view class="bottom" @click="exit">
  33. <text>退出登录</text>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import auth from "../../utils/js/auth.js"
  39. export default {
  40. data() {
  41. return {
  42. id:'',
  43. name:'',
  44. account:'',
  45. nick:'',
  46. avatar:'',
  47. phone:'',
  48. email:''
  49. }
  50. },
  51. onLoad() {
  52. this.id=auth.getId()
  53. this.name=auth.getName()
  54. this.account=auth.getAccount()
  55. this.nick=auth.getNick()
  56. this.avatar=auth.getAvatar()
  57. this.phone=auth.getPhone()
  58. this.email=auth.getEmail()
  59. },
  60. methods: {
  61. exit() {
  62. uni.removeStorageSync("token")
  63. uni.reLaunch({
  64. url: "../login/login"
  65. })
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. page {
  72. height: 100vh;
  73. }
  74. .content {
  75. width: 100vw;
  76. height: 100vh;
  77. background-color: #e7e7e7;
  78. }
  79. .top {
  80. height: 250upx;
  81. display: flex;
  82. align-items: center;
  83. background-color: white;
  84. }
  85. .top image {
  86. width: 200upx;
  87. margin-left: 30upx;
  88. }
  89. .top .detail {
  90. height: 200upx;
  91. margin-left: 50upx;
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: center;
  95. }
  96. .top .name {
  97. color: #0055FF;
  98. font-family: 华文彩云;
  99. height: 50upx;
  100. line-height: 50upx;
  101. font-size: 50upx;
  102. }
  103. .top .motto {
  104. color: #0055FF;
  105. font-family: 楷体;
  106. height: 50upx;
  107. line-height: 50upx;
  108. font-size: 20upx;
  109. }
  110. .middle {
  111. margin-top: 20upx;
  112. background-color: white;
  113. display: flex;
  114. flex-direction: column;
  115. align-items: center;
  116. }
  117. .item {
  118. height: 100upx;
  119. width: 90%;
  120. display: flex;
  121. justify-content: space-between;
  122. align-items: center;
  123. border-bottom: #d9d9d9 solid 1upx;
  124. }
  125. .bottom {
  126. height: 100upx;
  127. margin-top: 20upx;
  128. background-color: white;
  129. display: flex;
  130. flex-direction: column;
  131. align-items: center;
  132. justify-content: center;
  133. }
  134. </style>