index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section">
  5. <view class="flex padding justify-between" style="justify-content: flex-start !important;">
  6. <view class="flex align-center">
  7. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  8. <view class="iconfont icon-people text-gray icon"></view>
  9. </view>
  10. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round"
  11. mode="widthFix">
  12. </image>
  13. <!-- <view v-if="!name" @click="handleToLogin" class="login-tip">
  14. 点击登录
  15. </view> -->
  16. </view>
  17. <view @click="handleToInfo" class="flex align-center" style="position: absolute; left: 200rpx; top: 80rpx; width: 440rpx;">
  18. <view v-if="name" @click="handleToInfo" class="user-info">
  19. <view class="u_title">
  20. 用户名:{{ name }}
  21. </view>
  22. <view class="u_no">
  23. 备注:{{ user.remark }}
  24. <!-- 身份证:222222222222222222 -->
  25. </view>
  26. </view>
  27. <view style="position: absolute; top: 8rpx; right: -80rpx;">
  28. <text>个人信息</text>
  29. <view class="iconfont icon-right"></view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="content-section">
  35. <view class="menu-list">
  36. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  37. <view class="menu-item-box">
  38. <view class="iconfont icon-user menu-icon"></view>
  39. <view>编辑资料</view>
  40. </view>
  41. </view>
  42. <view class="list-cell list-cell-arrow" @click="handleLogout">
  43. <view class="menu-item-box">
  44. <view class="iconfont icon-setting menu-icon"></view>
  45. <view>退出登录</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import storage from '@/utils/storage'
  54. import {
  55. getUserProfile
  56. } from "@/api/system/user"
  57. export default {
  58. data() {
  59. return {
  60. name: this.$store.state.user.name,
  61. version: getApp().globalData.config.appInfo.version,
  62. user: {}
  63. }
  64. },
  65. onLoad() {
  66. getUserProfile().then(response => {
  67. this.user = response.data
  68. })
  69. },
  70. computed: {
  71. avatar() {
  72. return this.$store.state.user.avatar
  73. },
  74. windowHeight() {
  75. return uni.getSystemInfoSync().windowHeight - 50
  76. }
  77. },
  78. methods: {
  79. handleToInfo() {
  80. this.$tab.navigateTo('/pages/mine/info/index')
  81. },
  82. handleToEditInfo() {
  83. this.$tab.navigateTo('/pages/mine/info/edit')
  84. },
  85. handleToSetting() {
  86. this.$tab.navigateTo('/pages/mine/setting/index')
  87. },
  88. handleToLogin() {
  89. this.$tab.reLaunch('/pages/login')
  90. },
  91. handleToAvatar() {
  92. this.$tab.navigateTo('/pages/mine/avatar/index')
  93. },
  94. handleLogout() {
  95. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  96. this.$store.dispatch('LogOut').then(() => {
  97. this.$tab.reLaunch('/pages/index')
  98. })
  99. })
  100. },
  101. handleHelp() {
  102. this.$tab.navigateTo('/pages/mine/help/index')
  103. },
  104. handleAbout() {
  105. this.$tab.navigateTo('/pages/mine/about/index')
  106. },
  107. handleJiaoLiuQun() {
  108. this.$modal.showToast('QQ群:133713780')
  109. },
  110. handleBuilding() {
  111. this.$modal.showToast('模块建设中~')
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss">
  117. page {
  118. background-color: #f5f6f7;
  119. }
  120. .mine-container {
  121. width: 100%;
  122. height: 100%;
  123. .header-section {
  124. padding: 15px 15px 15px 15px;
  125. background-color: #3c9cff;
  126. color: white;
  127. .login-tip {
  128. font-size: 18px;
  129. margin-left: 10px;
  130. }
  131. .cu-avatar {
  132. border: 2px solid #eaeaea;
  133. .icon {
  134. font-size: 40px;
  135. }
  136. }
  137. .user-info {
  138. margin-left: 15px;
  139. .u_title {
  140. font-size: 18px;
  141. line-height: 30px;
  142. }
  143. }
  144. }
  145. .content-section {
  146. position: relative;
  147. // top: -50px;
  148. .mine-actions {
  149. margin: 15px 15px;
  150. padding: 20px 0px;
  151. border-radius: 8px;
  152. background-color: white;
  153. .action-item {
  154. .icon {
  155. font-size: 28px;
  156. }
  157. .text {
  158. display: block;
  159. font-size: 13px;
  160. margin: 8px 0px;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>