index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <!-- 首页 -->
  3. <view class="card_index_bgc">
  4. <view class="company_name" v-if="userInfo.dept">{{userInfo.dept.name || ''}}</view>
  5. <x-statistics :userType="homeUserType" :orderStatistics="orderStatistics"></x-statistics>
  6. <view class="card_operate">
  7. <view class="btn_item_tab" v-for="(item,index) in tableList" :key="index" @click="getOperate(item)">
  8. <view class="card_image center_in" :style="{backgroundColor:item.color}">
  9. <span class="iconfont icon_image" :class="item.icon"></span>
  10. </view>
  11. <view class="item_title_tab">{{item.title}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. token: {
  20. type: String,
  21. default: () => '',
  22. },
  23. userInfo: {
  24. type: Object,
  25. default: () => {},
  26. },
  27. orderStatistics: {
  28. type: Object,
  29. default: () => {},
  30. }
  31. },
  32. data() {
  33. return {
  34. homeUserType: 1,
  35. tableList: [],
  36. userList: [{
  37. id: 'add',
  38. title: '添加运单',
  39. icon: 'icon-tianjiadingdan',
  40. color: '#1cc723',
  41. }],
  42. }
  43. },
  44. created() {
  45. this.homeUserType = 3
  46. this.tableList = this.userList
  47. },
  48. methods: {
  49. getOperate(value) {
  50. if (this.token) {
  51. if (['truck', 'unload', 'signfor', 'put', 'out'].includes(value.id)) {
  52. uni.navigateTo({
  53. url: '/pages/order/delivery?id=' + value.id + '&title=' + value.title
  54. });
  55. } else if (value.id == 'add') {
  56. uni.navigateTo({
  57. url: '/pages/order/addWaybill?title=添加订单&type=1'
  58. });
  59. } else if (value.id == 'details') {
  60. uni.navigateTo({
  61. url: '/pages/home/particulars?title=true'
  62. });
  63. } else if (value.id == 'detailsil') {
  64. uni.navigateTo({
  65. url: '/pages/home/particulars?title=false'
  66. });
  67. }
  68. } else {
  69. uni.$u.toast('请先登录')
  70. }
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .card_index_bgc {
  77. padding-top: constant(safe-area-inset-top);
  78. padding-top: env(safe-area-inset-top);
  79. background-image: linear-gradient(#a9e3f1, #f3f4f6);
  80. }
  81. .company_name {
  82. font-size: 36rpx;
  83. padding: 50rpx 30rpx 20rpx 30rpx;
  84. font-weight: 600;
  85. }
  86. .card_swiper {
  87. padding: 20rpx 20rpx 0rpx 20rpx;
  88. }
  89. .card_operate {
  90. display: flex;
  91. flex-wrap: wrap;
  92. justify-content: flex-start;
  93. background-color: #fff;
  94. padding: 20rpx 0rpx;
  95. margin: 20rpx;
  96. border-radius: 20rpx;
  97. }
  98. .btn_item_tab {
  99. width: 25%;
  100. display: flex;
  101. align-items: center;
  102. flex-direction: column;
  103. margin: 10rpx 0rpx;
  104. }
  105. .card_image {
  106. width: 90rpx;
  107. height: 90rpx;
  108. border-radius: 30rpx;
  109. margin-bottom: 10rpx;
  110. }
  111. .icon_image {
  112. font-size: 50rpx;
  113. color: #fff;
  114. }
  115. .item_title_tab {
  116. font-size: 26rpx;
  117. color: #606266;
  118. }
  119. </style>