my.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view class="my-top">
  4. <view class="status-bar"></view>
  5. <view class="radius-lg top-box">
  6. <view class="user-info" v-if="userInfo.name">
  7. <fs-avatar link="./userInfo" size="130rpx" :src="userInfo.photo || userAvatar"></fs-avatar>
  8. <view class="top-box-content">
  9. <view class="top-box-title">{{ userInfo.name }}</view>
  10. <view>{{ userInfo.mobile }}</view>
  11. </view>
  12. </view>
  13. <view v-else class="text-center">
  14. <fs-avatar size="140rpx" link="/modules/common/login/login" border>去登录</fs-avatar>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="short-list">
  19. <fs-divide-list :list="shortcutList">
  20. <template #default="{item}">
  21. <view class="top-box-hd">{{ item.num || 0 }}</view>
  22. <view class="content">{{ item.title }}</view>
  23. </template>
  24. </fs-divide-list>
  25. </view>
  26. <fs-card gutter :titleStyle="{ padding: '0' }">
  27. <template #title>
  28. <view class="title-hd">常用工具</view>
  29. </template>
  30. <fs-grid :columnNum="4">
  31. <fs-grid-item v-for="(item, index) in 4" :key="index">
  32. <fs-avatar src="/static/images/my/invoice.png" size="80rpx"></fs-avatar>
  33. <view class="content">我的发票</view>
  34. </fs-grid-item>
  35. </fs-grid>
  36. </fs-card>
  37. <fs-cell-group arrow border gutter>
  38. <fs-cell link="/modules/common/licensePlate/list" value="车辆管理">
  39. <template #title>
  40. <fs-icon type="icon-car" colorType="primary"></fs-icon>
  41. </template>
  42. </fs-cell>
  43. <fs-cell link="/modules/common/address/list" value="地址管理">
  44. <template #title>
  45. <fs-icon type="icon-location" colorType="primary"></fs-icon>
  46. </template>
  47. </fs-cell>
  48. <fs-cell link="/modules/common/org" value="组织架构">
  49. <template #title>
  50. <fs-icon type="icon-org" colorType="primary"></fs-icon>
  51. </template>
  52. </fs-cell>
  53. <fs-cell link="/modules/common/addrbook/list" value="通讯录">
  54. <template #title>
  55. <fs-icon type="icon-tongxunlu" colorType="primary"></fs-icon>
  56. </template>
  57. </fs-cell>
  58. <fs-cell link="/modules/common/notice" value="我的消息">
  59. <template #title>
  60. <fs-icon type="icon-notice" colorType="primary"></fs-icon>
  61. </template>
  62. </fs-cell>
  63. <fs-cell link="/modules/common/feedback" value="意见反馈">
  64. <template #title>
  65. <fs-icon type="icon-feedback" colorType="primary"></fs-icon>
  66. </template>
  67. </fs-cell>
  68. <fs-cell link="/modules/common/version" value="版本记录">
  69. <template #title>
  70. <fs-icon type="icon-version" colorType="primary"></fs-icon>
  71. </template>
  72. </fs-cell>
  73. <fs-cell link="/modules/common/setting" value="设置">
  74. <template #title>
  75. <fs-icon type="icon-setting" colorType="primary"></fs-icon>
  76. </template>
  77. </fs-cell>
  78. </fs-cell-group>
  79. <wx v-model="showLogin"></wx>
  80. </view>
  81. </template>
  82. <script setup>
  83. import { computed, ref } from 'vue'
  84. import { onShow } from '@dcloudio/uni-app'
  85. import { useUserStore } from '@/stores/user'
  86. import userAvatar from '/static/images/user-avatar.png'
  87. import wx from '@/business/wx-login.vue'
  88. const user = useUserStore()
  89. const userInfo = computed(() => user.userInfo)
  90. const shortcutList = ref([
  91. {
  92. title: '我的访客',
  93. num: 10
  94. },
  95. {
  96. title: '我的访客',
  97. num: 10
  98. }
  99. ])
  100. const showLogin = ref(false)
  101. </script>
  102. <style lang="scss" scoped>
  103. .status-bar {
  104. height: var(--status-bar-height);
  105. }
  106. .my-top {
  107. background-color: var(--primary);
  108. padding: 60rpx var(--gutter) 0;
  109. margin-bottom: var(--gutter);
  110. }
  111. .top-box {
  112. position: relative;
  113. padding: 60rpx 0;
  114. color: #fff;
  115. &-hd {
  116. font-size: 23px;
  117. font-weight: bold;
  118. }
  119. &-title {
  120. font-size: 16px;
  121. font-weight: 500;
  122. margin-bottom: 10rpx;
  123. }
  124. &-content {
  125. padding: 10rpx 0;
  126. margin-left: 20rpx;
  127. }
  128. }
  129. .short-list {
  130. margin-top: -80rpx;
  131. padding: var(--gutter);
  132. }
  133. .user-info {
  134. display: flex;
  135. }
  136. </style>