index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. id: 'home',
  63. title: '首页',
  64. icon: 'icon-tianjiadingdan',
  65. color: '#1cc723',
  66. }],
  67. }
  68. },
  69. created() {
  70. this.homeUserType = 3
  71. this.tableList = this.userList
  72. },
  73. methods: {
  74. getOperate(value) {
  75. if (this.token) {
  76. if (['truck', 'unload', 'signfor', 'enter', 'out'].includes(value.id)) {
  77. uni.navigateTo({
  78. url: '/pages/order/delivery?id=' + value.id + '&title=' + value.title
  79. });
  80. } else if (value.id == 'add') {
  81. uni.navigateTo({
  82. url: '/pages/order/addWaybill?title=添加运单&type=1'
  83. });
  84. } else if (value.id == 'book') {
  85. uni.navigateTo({
  86. url: '/pages/order/addressBook'
  87. });
  88. } else if (value.id == 'manage') {
  89. uni.navigateTo({
  90. url: '/pages/home/IceManagement'
  91. });
  92. } else if (value.id == 'home') {
  93. uni.navigateTo({
  94. url: '/pages/homePage'
  95. });
  96. }
  97. } else {
  98. uni.$u.toast('请先登录')
  99. }
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. .card_index_bgc {
  106. padding-top: constant(safe-area-inset-top);
  107. padding-top: env(safe-area-inset-top);
  108. // background-image: linear-gradient(#a9e3f1, #f3f4f6);
  109. }
  110. .company_name {
  111. font-size: 36rpx;
  112. padding: 50rpx 30rpx 20rpx 30rpx;
  113. font-weight: 600;
  114. }
  115. .card_swiper {
  116. padding: 20rpx 20rpx 0rpx 20rpx;
  117. }
  118. .card_operate {
  119. display: flex;
  120. flex-wrap: wrap;
  121. justify-content: flex-start;
  122. background-color: #fff;
  123. padding: 20rpx 0rpx;
  124. margin: 20rpx;
  125. border-radius: 20rpx;
  126. }
  127. .btn_item_tab {
  128. width: 25%;
  129. display: flex;
  130. align-items: center;
  131. flex-direction: column;
  132. margin: 10rpx 0rpx;
  133. }
  134. .card_image {
  135. width: 90rpx;
  136. height: 90rpx;
  137. border-radius: 30rpx;
  138. margin-bottom: 10rpx;
  139. }
  140. .icon_image {
  141. font-size: 50rpx;
  142. color: #fff;
  143. }
  144. .item_title_tab {
  145. font-size: 26rpx;
  146. color: #606266;
  147. }
  148. </style>