my.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view>
  3. <fs-avatar src="/static/images/my-bg.png" shape="square" width="100%" height="288rpx"></fs-avatar>
  4. <view class="my-box">
  5. <view class="layout-box radius-lg top-box">
  6. <view class="user-info" v-if="userInfo.name">
  7. <fs-avatar size="140rpx" border :src="userInfo.photo" v-if="userInfo.photo"></fs-avatar>
  8. <fs-wx-avatar v-else></fs-wx-avatar>
  9. <view class="top-box-content">
  10. <text class="vm title" style="margin-right: 10rpx;">{{userInfo.name}}</text>
  11. <fs-icon type="icon-sex-male" color="#2285FF" v-if="userInfo.sex === '1'"></fs-icon>
  12. <fs-icon type="icon-sex-female" colorType="error" v-if="userInfo.sex === '2'"></fs-icon>
  13. </view>
  14. <fs-icon
  15. class="top-box-edit"
  16. type="icon-edit"
  17. size="40rpx"
  18. link="./userInfo">
  19. </fs-icon>
  20. </view>
  21. <view v-else class="user-info">
  22. <fs-avatar size="140rpx" link="../login/login4" border>去登录</fs-avatar>
  23. </view>
  24. <view :style="{'margin-top': userInfo.name ? '80rpx' : '20rpx'}">
  25. <fs-divide-list :list="shortcutList">
  26. <template #default="{item}">
  27. <view class="top-box-hd">{{item.num || 0}}</view>
  28. <view class="content">{{item.title}}</view>
  29. </template>
  30. </fs-divide-list>
  31. </view>
  32. </view>
  33. </view>
  34. <fs-card gutter :titleStyle="{padding: '0'}">
  35. <template #title>
  36. <view class="title-hd" >常用工具</view>
  37. </template>
  38. <fs-grid :columnNum="4">
  39. <fs-grid-item>
  40. <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
  41. <view class="content">我的发票</view>
  42. </fs-grid-item>
  43. <fs-grid-item>
  44. <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
  45. <view class="content">我的发票</view>
  46. </fs-grid-item>
  47. <fs-grid-item>
  48. <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
  49. <view class="content">我的发票</view>
  50. </fs-grid-item>
  51. <fs-grid-item>
  52. <fs-avatar src="/static/images/invoice.png" size="80rpx"></fs-avatar>
  53. <view class="content">我的发票</view>
  54. </fs-grid-item>
  55. </fs-grid>
  56. </fs-card>
  57. <fs-cell-group arrow border gutter>
  58. <fs-cell link="./licensePlate/list" value="车辆管理">
  59. <template #title>
  60. <fs-icon type="icon-car" colorType="primary"></fs-icon>
  61. </template>
  62. </fs-cell>
  63. <fs-cell link="./address/list" value="地址管理">
  64. <template #title>
  65. <fs-icon type="icon-location" colorType="primary"></fs-icon>
  66. </template>
  67. </fs-cell>
  68. <fs-cell link="./org" value="组织架构">
  69. <template #title>
  70. <fs-icon type="icon-org" colorType="primary"></fs-icon>
  71. </template>
  72. </fs-cell>
  73. <fs-cell link="./addrbook/list" value="通讯录">
  74. <template #title>
  75. <fs-icon type="icon-tongxunlu" colorType="primary"></fs-icon>
  76. </template>
  77. </fs-cell>
  78. </fs-cell-group>
  79. <fs-cell-group arrow border>
  80. <fs-cell link="./notice" value="我的消息">
  81. <template #title>
  82. <fs-icon type="icon-notice" colorType="primary"></fs-icon>
  83. </template>
  84. </fs-cell>
  85. <fs-cell link="./feedback" value="意见反馈">
  86. <template #title>
  87. <fs-icon type="icon-feedback" colorType="primary"></fs-icon>
  88. </template>
  89. </fs-cell>
  90. <fs-cell link="./version" value="版本记录">
  91. <template #title>
  92. <fs-icon type="icon-version" colorType="primary"></fs-icon>
  93. </template>
  94. </fs-cell>
  95. </fs-cell-group>
  96. <fs-gutter height="120rpx"></fs-gutter>
  97. <fs-button round block @click="handleLogout">退出登录</fs-button>
  98. <fs-gutter height="60rpx"></fs-gutter>
  99. </view>
  100. </template>
  101. <script setup>
  102. import { computed, ref } from 'vue'
  103. import { useStore } from 'vuex'
  104. const store = useStore()
  105. const userInfo = computed(() => store.state.userInfo)
  106. const shortcutList = ref([
  107. {
  108. title: '我的访客',
  109. num: 10
  110. },
  111. {
  112. title: '我的访客',
  113. num: 10
  114. }
  115. ])
  116. const handleLogout = () => {
  117. store.dispatch('logout').then(res => {
  118. console.log('logout')
  119. })
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .my-box{
  124. padding: var(--gutter);
  125. margin-top: -200rpx;
  126. z-index: 100;
  127. position: relative;
  128. }
  129. .top-box{
  130. position: relative;
  131. &-edit{
  132. position: absolute;
  133. top: 64rpx;
  134. right: 0rpx;
  135. }
  136. &-hd{
  137. font-size: 23px;
  138. font-weight: bold;
  139. }
  140. &-content{
  141. padding: 10rpx 0;
  142. }
  143. }
  144. .user-info{
  145. position: absolute;
  146. z-index: 10;
  147. left: 50%;
  148. top: -70rpx;
  149. transform: translateX(-50%);
  150. text-align: center;
  151. }
  152. </style>