my.vue 3.7 KB

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