index.vue 5.4 KB

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