my.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 { useUserStore } from '@/stores/user'
  84. import userAvatar from '/static/images/user-avatar.png'
  85. import wx from '@/business/wx-login.vue'
  86. const user = useUserStore()
  87. const userInfo = computed(() => user.userInfo)
  88. const shortcutList = ref([
  89. {
  90. title: '我的访客',
  91. num: 10
  92. },
  93. {
  94. title: '我的访客',
  95. num: 10
  96. }
  97. ])
  98. const showLogin = ref(false)
  99. </script>
  100. <style lang="scss" scoped>
  101. .status-bar {
  102. height: var(--status-bar-height);
  103. }
  104. .my-top {
  105. background-color: var(--primary);
  106. padding: 60rpx var(--gutter) 0;
  107. margin-bottom: var(--gutter);
  108. }
  109. .top-box {
  110. position: relative;
  111. padding: 60rpx 0;
  112. color: #fff;
  113. &-hd {
  114. font-size: 23px;
  115. font-weight: bold;
  116. }
  117. &-title {
  118. font-size: 16px;
  119. font-weight: 500;
  120. margin-bottom: 10rpx;
  121. }
  122. &-content {
  123. padding: 10rpx 0;
  124. margin-left: 20rpx;
  125. }
  126. }
  127. .short-list {
  128. margin-top: -80rpx;
  129. padding: var(--gutter);
  130. }
  131. .user-info {
  132. display: flex;
  133. }
  134. </style>