index.vue 5.1 KB

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