index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section" style="position: relative">
  5. <view class="flex padding justify-between">
  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 style="position: relative;top:24rpx;" v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  11. </image>
  12. <view v-if="!name" @click="handleToLogin" class="login-tip">
  13. 点击登录
  14. </view>
  15. <view v-if="name" @click="handleToInfo" class="user-info">
  16. <view class="u_title" style="font-size: 32rpx">
  17. 用户名:{{ name }}
  18. </view>
  19. </view>
  20. </view>
  21. <view @click="handleToInfo" class="flex align-center" style="width: 180rpx;position: absolute;right:-6rpx;top:130rpx;">
  22. <text sytle="font-size:24rpx">个人信息</text>
  23. <view class="iconfont icon-right"></view>
  24. </view>
  25. </view>
  26. <view v-if="user != null" style="position: absolute;bottom: 80rpx;text-align: left;padding-left:184rpx;font-size: 32rpx">
  27. 单&nbsp;&nbsp;&nbsp;&nbsp;位:{{ user.dept.deptName }}
  28. </view>
  29. </view>
  30. <view class="content-section" style="margin-top:122rpx">
  31. <view class="mine-actions grid col-4 text-center" style="display: none">
  32. <view class="action-item" @click="handleJiaoLiuQun">
  33. <view class="iconfont icon-friendfill text-pink icon"></view>
  34. <text class="text">交流群</text>
  35. </view>
  36. <view class="action-item" @click="handleBuilding">
  37. <view class="iconfont icon-service text-blue icon"></view>
  38. <text class="text">在线客服</text>
  39. </view>
  40. <view class="action-item" @click="handleBuilding">
  41. <view class="iconfont icon-community text-mauve icon"></view>
  42. <text class="text">反馈社区</text>
  43. </view>
  44. <view class="action-item" @click="handleBuilding">
  45. <view class="iconfont icon-dianzan text-green icon"></view>
  46. <text class="text">点赞我们</text>
  47. </view>
  48. </view>
  49. <view class="menu-list" >
  50. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  51. <view class="menu-item-box">
  52. <view class="iconfont icon-user menu-icon"></view>
  53. <view>编辑资料</view>
  54. </view>
  55. </view>
  56. <!-- <view class="list-cell list-cell-arrow" @click="handleHelp">-->
  57. <!-- <view class="menu-item-box">-->
  58. <!-- <view class="iconfont icon-help menu-icon"></view>-->
  59. <!-- <view>常见问题</view>-->
  60. <!-- </view>-->
  61. <!-- </view>-->
  62. <!-- <view class="list-cell list-cell-arrow" @click="handleAbout">-->
  63. <!-- <view class="menu-item-box">-->
  64. <!-- <view class="iconfont icon-aixin menu-icon"></view>-->
  65. <!-- <view>关于我们</view>-->
  66. <!-- </view>-->
  67. <!-- </view>-->
  68. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  69. <view class="menu-item-box">
  70. <view class="iconfont icon-setting menu-icon"></view>
  71. <view>应用设置</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import storage from '@/utils/storage'
  80. export default {
  81. data() {
  82. return {
  83. user:this.$store.state.user.user,
  84. name: this.$store.state.user.name,
  85. version: getApp().globalData.config.appInfo.version
  86. }
  87. },
  88. computed: {
  89. avatar() {
  90. return this.$store.state.user.avatar
  91. },
  92. windowHeight() {
  93. return uni.getSystemInfoSync().windowHeight - 50
  94. }
  95. },
  96. methods: {
  97. handleToInfo() {
  98. this.$tab.navigateTo('/pages/mine/info/index')
  99. },
  100. handleToEditInfo() {
  101. this.$tab.navigateTo('/pages/mine/info/edit')
  102. },
  103. handleToSetting() {
  104. this.$tab.navigateTo('/pages/mine/setting/index')
  105. },
  106. handleToLogin() {
  107. this.$tab.reLaunch('/pages/login')
  108. },
  109. handleToAvatar() {
  110. this.$tab.navigateTo('/pages/mine/avatar/index')
  111. },
  112. handleLogout() {
  113. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  114. this.$store.dispatch('LogOut').then(() => {
  115. this.$tab.reLaunch('/pages/index')
  116. })
  117. })
  118. },
  119. handleHelp() {
  120. this.$tab.navigateTo('/pages/mine/help/index')
  121. },
  122. handleAbout() {
  123. this.$tab.navigateTo('/pages/mine/about/index')
  124. },
  125. handleJiaoLiuQun() {
  126. this.$modal.showToast('QQ群:133713780')
  127. },
  128. handleBuilding() {
  129. this.$modal.showToast('模块建设中~')
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. page {
  136. background-color: #f5f6f7;
  137. }
  138. .mine-container {
  139. width: 100%;
  140. height: 100%;
  141. .header-section {
  142. padding: 15px 15px 45px 15px;
  143. background-color: #3c96f3;
  144. color: white;
  145. .login-tip {
  146. font-size: 18px;
  147. margin-left: 10px;
  148. }
  149. .cu-avatar {
  150. border: 2px solid #eaeaea;
  151. .icon {
  152. font-size: 40px;
  153. }
  154. }
  155. .user-info {
  156. margin-left: 15px;
  157. .u_title {
  158. font-size: 18px;
  159. line-height: 30px;
  160. }
  161. }
  162. }
  163. .content-section {
  164. position: relative;
  165. top: -50px;
  166. .mine-actions {
  167. margin: 15px 15px;
  168. padding: 20px 0px;
  169. border-radius: 8px;
  170. background-color: white;
  171. .action-item {
  172. .icon {
  173. font-size: 28px;
  174. }
  175. .text {
  176. display: block;
  177. font-size: 13px;
  178. margin: 8px 0px;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. </style>