xsb-orderList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <script setup lang="ts">
  2. import { StaticUrl } from '@/config'
  3. import router from '@/router'
  4. const props = defineProps<{
  5. orderList: Api.xsbOrderList[]
  6. subPackOrder?: typeof import('@/subPack-xsb/utils/order-data')
  7. subPackConfirm?: typeof import('@/subPack-xsb/utils/confirm-order')
  8. }>()
  9. const _emit = defineEmits<{
  10. 'cancel': [order: Api.xsbOrderList]
  11. 'pay': [orderNumber: string]
  12. 'submit': [order: Api.xsbOrderList]
  13. 'del': [order: Api.xsbOrderList]
  14. 'after-sale': [item: Api.xsbOrderList]
  15. 'refresh': []
  16. }>()
  17. function handleClick(no: string) {
  18. router.push({ name: 'xsb-orderDetaile', params: { id: no } })
  19. }
  20. </script>
  21. <template>
  22. <view v-for="item in orderList" :key="item.orderNumber" class="mt20rpx rounded-16rpx bg-white p24rpx">
  23. <view class="flex items-center justify-between">
  24. <view class="flex items-center">
  25. <image :src="`${StaticUrl}/order-icon.png`" class="h36rpx w36rpx" />
  26. <view class="ml20rpx text-32rpx font-semibold">
  27. {{ item.shopName }}
  28. </view>
  29. </view>
  30. <view class="text-24rpx text-#FF4D3A">
  31. <template v-if="item.hbOrderStatus !== props.subPackOrder?.OrderStatus.PaddingPay">
  32. {{ props.subPackOrder?.handleCommonOrderStatusText(item) }}
  33. </template>
  34. <template v-else>
  35. <view class="flex items-center">
  36. 待支付( 还剩 <wd-count-down :time="props.subPackOrder?.handleCommonOrderStatusText(item)" @finish="$emit('refresh')" /> )
  37. </view>
  38. </template>
  39. </view>
  40. </view>
  41. <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
  42. <view>
  43. <!-- <view class="mb20rpx box-border rounded-16rpx bg-#F9F9F9 p24rpx">
  44. <view class="flex items-center">
  45. <image :src="`${StaticUrl}/order-car.png`" class="h36rpx w36rpx" />
  46. <view class="ml20rpx text-28rpx text-#222 font-semibold">
  47. 预计10:40前可送达
  48. </view>
  49. </view>
  50. <view class="mt18rpx">
  51. 您的订单预计3月7日 10:40前送达
  52. </view>
  53. <view class="mt20rpx">
  54. 2025-03-26 11:56:07
  55. </view>
  56. </view> -->
  57. <view
  58. class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9"
  59. @click="handleClick(item.orderNumber as string)"
  60. >
  61. <view class="box-border h-full w480rpx py28rpx pl20rpx">
  62. <scroll-view scroll-x class="h-full w-full whitespace-nowrap">
  63. <view class="flex items-center">
  64. <view v-for="goods in item.orderItemList" :key="goods.skuId" class="mr50rpx">
  65. <image :src="goods.pic" class="h120rpx w120rpx" />
  66. </view>
  67. </view>
  68. </scroll-view>
  69. </view>
  70. <view class="box-shadow box-border h-full flex-1 flex-shrink-0 px14rpx py40rpx">
  71. <view class="text-center text-32rpx text-#FF4D3A font-semibold">
  72. ¥{{ item.actualTotal }}
  73. </view>
  74. <view class="text-center text-28rpx text-#AAAAAA">
  75. 共{{ item.goodsTotal }}件
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="my24rpx flex items-center justify-end">
  81. <template v-if="item.hbOrderStatus === props.subPackOrder?.OrderStatus.PaddingPay">
  82. <view class="mr20rpx">
  83. <wd-button size="small" plain type="info" @click.stop="$emit('cancel', item)">
  84. 取消订单
  85. </wd-button>
  86. </view>
  87. <view class="mr20rpx">
  88. <wd-button size="small" plain type="error" @click.stop="$emit('pay', item.orderNumber as string)">
  89. 付款
  90. </wd-button>
  91. </view>
  92. </template>
  93. <template v-if="[props.subPackOrder?.OrderStatus.OrderCancel, props.subPackOrder?.OrderStatus.OrderCompleted].includes(item.hbOrderStatus) ">
  94. <view class="mr20rpx">
  95. <wd-button size="small" plain type="info" @click.stop="$emit('del', item)">
  96. 删除订单
  97. </wd-button>
  98. </view>
  99. <!-- <view class="ml20rpx">
  100. <wd-button size="small" plain type="error" >
  101. 再次购买
  102. </wd-button>
  103. </view> -->
  104. </template>
  105. <template v-if="item.hbOrderStatus === props.subPackOrder?.OrderStatus.OrderArrived">
  106. <view class="mr20rpx">
  107. <wd-button size="small" plain type="info" @click.stop="$emit('submit', item)">
  108. 确认收货
  109. </wd-button>
  110. </view>
  111. </template>
  112. <template v-if="item.refundStatus != 2 || [props.subPackOrder?.OrderStatus.OrderCompleted, props.subPackOrder?.OrderStatus.OrderWaitDelivery, props.subPackOrder?.OrderStatus.OrderAccepted].includes(item.hbOrderStatus) ">
  113. <view class="mr20rpx">
  114. <wd-button size="small" plain type="info" @click.stop="$emit('after-sale', item)">
  115. 申请售后
  116. </wd-button>
  117. </view>
  118. </template>
  119. </view>
  120. </view>
  121. </template>
  122. <style lang="scss" scoped></style>