index.vue 3.9 KB

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