index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section" :style="{ backgroundColor: themeColor }">
  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. import constant from '@/utils/constant'
  78. export default {
  79. data() {
  80. return {
  81. name: this.$store.state.user.name,
  82. version: getApp().globalData.config.appInfo.version,
  83. themeColor:getApp().globalData.config.appInfo.themeColor
  84. }
  85. },
  86. computed: {
  87. avatar() {
  88. return this.$store.state.user.avatar
  89. },
  90. windowHeight() {
  91. return uni.getSystemInfoSync().windowHeight - 50
  92. }
  93. },
  94. onShow() {
  95. wx.showShareMenu({
  96. withShareTicket: true,
  97. menus: ['shareAppMessage', 'shareTimeline']
  98. });
  99. },
  100. methods: {
  101. handleToInfo() {
  102. this.$tab.navigateTo('/pages/mine/info/index')
  103. },
  104. handleToEditInfo() {
  105. this.$tab.navigateTo('/pages/mine/info/edit')
  106. },
  107. handleToSetting() {
  108. this.$tab.navigateTo('/pages/mine/setting/index')
  109. },
  110. handleToLogin() {
  111. this.$tab.reLaunch('/pages/login')
  112. },
  113. handleToAvatar() {
  114. this.$tab.navigateTo('/pages/mine/avatar/index')
  115. },
  116. handleLogout() {
  117. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  118. this.$store.dispatch('LogOut').then(() => {
  119. this.$tab.reLaunch('/pages/index')
  120. })
  121. })
  122. },
  123. handleHelp() {
  124. this.$tab.navigateTo('/pages/mine/help/index')
  125. },
  126. handleAbout() {
  127. this.$tab.navigateTo('/pages/mine/about/index')
  128. },
  129. handleJiaoLiuQun() {
  130. this.$modal.showToast('QQ群:1003846536')
  131. },
  132. handleBuilding() {
  133. this.$modal.showToast('模块建设中~')
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. page {
  140. background-color: #f5f6f7;
  141. }
  142. .mine-container {
  143. width: 100%;
  144. height: 100%;
  145. .header-section {
  146. padding: 15px 15px 45px 15px;
  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>