index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section">
  5. <view class="flex padding justify-between">
  6. <view class="flex">
  7. <image :src="avatar" class="cu-avatar xl round" mode="widthFix">
  8. </image>
  9. <view class="user-info">
  10. <view class="u_title text-bold">
  11. {{ name }}
  12. </view>
  13. <view class="sub_title">
  14. 系统管理员
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="content-section">
  21. <view class="menu-list">
  22. <view class="list-cell list-cell-arrow" @click="handleBuilding">
  23. <view class="menu-item-box">
  24. <view class="iconfont icon-setting menu-icon"></view>
  25. <view>企业管理</view>
  26. </view>
  27. </view>
  28. <view class="list-cell list-cell-arrow" @click="handleHelp">
  29. <view class="menu-item-box">
  30. <view class="iconfont icon-help menu-icon"></view>
  31. <view>帮助中心</view>
  32. </view>
  33. </view>
  34. <view class="list-cell list-cell-arrow" @click="handleAbout">
  35. <view class="menu-item-box">
  36. <view class="iconfont icon-aixin menu-icon"></view>
  37. <view>联系我们</view>
  38. </view>
  39. </view>
  40. <view class="list-cell list-cell-arrow" @click="handleLogout">
  41. <view class="menu-item-box">
  42. <view class="iconfont icon-user menu-icon"></view>
  43. <view>退出登录</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import storage from '@/utils/storage'
  52. export default {
  53. data() {
  54. return {
  55. name: this.$store.state.user.name,
  56. version: getApp().globalData.config.appInfo.version
  57. }
  58. },
  59. computed: {
  60. avatar() {
  61. return this.$store.state.user.avatar
  62. },
  63. windowHeight() {
  64. return uni.getSystemInfoSync().windowHeight - 50
  65. }
  66. },
  67. methods: {
  68. handleToInfo() {
  69. this.$tab.navigateTo('/pages/mine/info/index')
  70. },
  71. handleToEditInfo() {
  72. this.$tab.navigateTo('/pages/mine/info/edit')
  73. },
  74. handleToSetting() {
  75. this.$tab.navigateTo('/pages/mine/setting/index')
  76. },
  77. handleToLogin() {
  78. this.$tab.reLaunch('/pages/login')
  79. },
  80. handleToAvatar() {
  81. this.$tab.navigateTo('/pages/mine/avatar/index')
  82. },
  83. handleLogout() {
  84. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  85. this.$store.dispatch('LogOut').then(() => {
  86. this.$tab.reLaunch('/pages/index')
  87. })
  88. })
  89. },
  90. handleHelp() {
  91. this.$tab.navigateTo('/pages/mine/help/index')
  92. },
  93. handleAbout() {
  94. this.$tab.navigateTo('/pages/mine/about/index')
  95. },
  96. handleJiaoLiuQun() {
  97. this.$modal.showToast('微信搜索 naidaguo 后,添加好友后拉你进技术交流群')
  98. },
  99. handleBuilding() {
  100. this.$modal.showToast('移动端暂不支持该功能,请到PC端处理~')
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. page {
  107. background-color: #f5f6f7;
  108. }
  109. .mine-container {
  110. width: 100%;
  111. height: 100%;
  112. .header-section {
  113. // padding: 15px 15px 45px 15px;
  114. background-color: white;
  115. // color: white;
  116. .login-tip {
  117. font-size: 18px;
  118. margin-left: 10px;
  119. }
  120. .cu-avatar {
  121. border: 2px solid #eaeaea;
  122. .icon {
  123. font-size: 40px;
  124. }
  125. }
  126. .user-info {
  127. margin-left: 15px;
  128. display: flex;
  129. .u_title {
  130. font-size: 18px;
  131. line-height: 30px;
  132. }
  133. .sub_title{
  134. font-size: 12px;
  135. height: 30px;
  136. // line-height: 30px;
  137. margin-left: 15px;
  138. background-color: #f5f6f7;
  139. padding: 5px 8px;
  140. border-radius: 20px;
  141. display: flex;
  142. justify-content: center;
  143. align-items: center;
  144. }
  145. }
  146. }
  147. .content-section {
  148. position: relative;
  149. // top: -50px;
  150. .mine-actions {
  151. margin: 15px 15px;
  152. padding: 20px 0px;
  153. border-radius: 8px;
  154. background-color: white;
  155. .action-item {
  156. .icon {
  157. font-size: 28px;
  158. }
  159. .text {
  160. display: block;
  161. font-size: 13px;
  162. margin: 8px 0px;
  163. }
  164. }
  165. }
  166. }
  167. }
  168. </style>