waybillsList.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="history">
  3. <uni-section :title="'数量: ' + waybills.length"></uni-section>
  4. <view class="item" v-for="(item, i) in waybills" :key="i">
  5. <text class="code" :style="{ color: '#666' }">{{ item.order_box_no }}</text>
  6. <text class="type">重量: {{ item.weight }}KG</text>
  7. <view class="sub-items">
  8. <view class="sub-item">
  9. <text class="type">批次/船航/托盘</text>
  10. <text class="type">{{ item.batch_shipping_pallet }}</text>
  11. </view>
  12. <view class="sub-item">
  13. <text class="type">末公里运单号</text>
  14. <text class="type">{{ item.tracking_number|| '无' }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view v-if="waybills.length === 0" class="is-empty">暂无运单</view>
  19. </view>
  20. </template>
  21. <script setup lang="ts">
  22. import { reactive, ref } from 'vue';
  23. import { onLoad } from '@dcloudio/uni-app';
  24. const waybills = ref([]);
  25. const getHistory = () => {
  26. waybills.value = uni.getStorageSync('waybills');
  27. };
  28. onLoad(() => {
  29. getHistory();
  30. });
  31. </script>
  32. <style lang="scss" scoped>
  33. .history {
  34. display: flex;
  35. width: 100%;
  36. flex-direction: column;
  37. justify-items: start;
  38. .type {
  39. padding-right: 20rpx;
  40. font-size: 24rpx;
  41. margin-top: 10rpx;
  42. }
  43. .code {
  44. font-weight: 600;
  45. }
  46. .item {
  47. padding: 20rpx;
  48. font-size: 20rpx;
  49. color: #666;
  50. border-radius: 10rpx;
  51. border: #666 1rpx solid;
  52. margin-bottom: 10rpx;
  53. margin-left: 10rpx;
  54. margin-right: 10rpx;
  55. display: flex;
  56. flex-direction: column;
  57. .sub-items{
  58. display: flex;
  59. flex-direction: row;
  60. .sub-item{
  61. display: flex;
  62. flex:1;
  63. flex-direction: column
  64. }
  65. }
  66. }
  67. .is-empty {
  68. text-align: center;
  69. margin: 40px 0;
  70. color: #999;
  71. }
  72. }
  73. </style>