list.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!-- 物流包裹-->
  2. <template>
  3. <s-layout title="物流包裹">
  4. <view class="express-wrap">
  5. <su-sticky bgColor="#FFE2B6">
  6. <view class="header ss-flex ss-p-l-24">{{ state.list.length }}个包裹已派送</view>
  7. </su-sticky>
  8. <view
  9. class="express-box"
  10. v-for="item in state.list"
  11. :key="item.type"
  12. @tap="sheep.$router.go('/pages/order/express/log', { id: item.id, orderId: state.orderId })"
  13. >
  14. <view class="express-box-header ss-flex ss-row-between">
  15. <view class="express-box-header-type">{{ item.status_text }}</view>
  16. <view class="express-box-header-num">{{
  17. item.express_name + ' : ' + item.express_no
  18. }}</view>
  19. </view>
  20. <view class="express-box-content">
  21. <view class="content-address">{{ item.logs[0]?.content }}</view>
  22. <view class="" v-if="item.items?.length">
  23. <scroll-view class="scroll-box" scroll-x scroll-anchoring>
  24. <view class="ss-flex">
  25. <view v-for="i in item.items" :key="i" class="ss-m-r-20"
  26. ><image class="content-img" :src="sheep.$url.static(i.goods_image)" />
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </view>
  32. <view class="express-box-foot">共{{ item.items.length }}件商品</view>
  33. </view>
  34. </view>
  35. </s-layout>
  36. </template>
  37. <script setup>
  38. import sheep from '@/sheep';
  39. import { onLoad } from '@dcloudio/uni-app';
  40. import { computed, reactive } from 'vue';
  41. const state = reactive({
  42. list: [],
  43. orderId: '',
  44. });
  45. async function getExpressList(id) {
  46. const { data } = await sheep.$api.order.express(id, '');
  47. state.list = data;
  48. }
  49. onLoad((Option) => {
  50. state.orderId = Option.orderId;
  51. getExpressList(state.orderId);
  52. });
  53. </script>
  54. <style lang="scss" scoped>
  55. .header {
  56. height: 84rpx;
  57. font-size: 30rpx;
  58. font-weight: 500;
  59. color: #a8700d;
  60. }
  61. .express-box {
  62. background: #fff;
  63. padding-bottom: 30rpx;
  64. box-sizing: border-box;
  65. margin-bottom: 20rpx;
  66. .express-box-header {
  67. height: 76rpx;
  68. padding: 0 24rpx;
  69. border-bottom: 2rpx solid rgba(#dfdfdf, 0.5);
  70. .express-box-header-type {
  71. font-size: 26rpx;
  72. font-weight: 500;
  73. color: #999;
  74. }
  75. .express-box-header-num {
  76. font-size: 26rpx;
  77. font-weight: 400;
  78. color: #999999;
  79. }
  80. }
  81. .express-box-content {
  82. padding: 20rpx 24rpx;
  83. .content-address {
  84. font-size: 28rpx;
  85. font-weight: 400;
  86. color: #333333;
  87. line-height: normal;
  88. margin-bottom: 20rpx;
  89. }
  90. .content-img {
  91. width: 180rpx;
  92. height: 180rpx;
  93. }
  94. }
  95. .express-box-foot {
  96. padding: 0 24rpx;
  97. font-size: 24rpx;
  98. font-weight: 400;
  99. color: #999999;
  100. }
  101. }
  102. </style>