index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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: 'enter',
  38. title: '冰排入库',
  39. icon: 'icon-bingpairuku',
  40. color: '#03a9f4',
  41. },{
  42. id: 'out',
  43. title: '冰排出库',
  44. icon: 'icon-bingpaichuku',
  45. color: '#00ff49',
  46. },{
  47. id: 'manage',
  48. title: '冰排追溯管理',
  49. icon: 'icon-bingpaiguanli',
  50. color: '#00eaff',
  51. },{
  52. id: 'book',
  53. title: '地址簿',
  54. icon: 'icon-dizhibu',
  55. color: '#ffdc00',
  56. }, {
  57. id: 'add',
  58. title: '添加运单',
  59. icon: 'icon-tianjiadingdan',
  60. color: '#1cc723',
  61. }],
  62. }
  63. },
  64. created() {
  65. this.homeUserType = 3
  66. this.tableList = this.userList
  67. },
  68. methods: {
  69. getOperate(value) {
  70. if (this.token) {
  71. if (['truck', 'unload', 'signfor', 'enter', 'out'].includes(value.id)) {
  72. uni.navigateTo({
  73. url: '/pages/order/delivery?id=' + value.id + '&title=' + value.title
  74. });
  75. } else if (value.id == 'add') {
  76. uni.navigateTo({
  77. url: '/pages/order/addWaybill?title=添加运单&type=1'
  78. });
  79. } else if (value.id == 'book') {
  80. uni.navigateTo({
  81. url: '/pages/order/addressBook'
  82. });
  83. } else if (value.id == 'manage') {
  84. uni.navigateTo({
  85. url: '/pages/home/IceManagement'
  86. });
  87. }
  88. } else {
  89. uni.$u.toast('请先登录')
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. .card_index_bgc {
  97. padding-top: constant(safe-area-inset-top);
  98. padding-top: env(safe-area-inset-top);
  99. background-image: linear-gradient(#a9e3f1, #f3f4f6);
  100. }
  101. .company_name {
  102. font-size: 36rpx;
  103. padding: 50rpx 30rpx 20rpx 30rpx;
  104. font-weight: 600;
  105. }
  106. .card_swiper {
  107. padding: 20rpx 20rpx 0rpx 20rpx;
  108. }
  109. .card_operate {
  110. display: flex;
  111. flex-wrap: wrap;
  112. justify-content: flex-start;
  113. background-color: #fff;
  114. padding: 20rpx 0rpx;
  115. margin: 20rpx;
  116. border-radius: 20rpx;
  117. }
  118. .btn_item_tab {
  119. width: 25%;
  120. display: flex;
  121. align-items: center;
  122. flex-direction: column;
  123. margin: 10rpx 0rpx;
  124. }
  125. .card_image {
  126. width: 90rpx;
  127. height: 90rpx;
  128. border-radius: 30rpx;
  129. margin-bottom: 10rpx;
  130. }
  131. .icon_image {
  132. font-size: 50rpx;
  133. color: #fff;
  134. }
  135. .item_title_tab {
  136. font-size: 26rpx;
  137. color: #606266;
  138. }
  139. </style>