index.vue 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <script setup lang="ts">
  2. import { handleCommonRefundOrderCancel, refundOrderStatusText, refundStatus } from './index'
  3. import { createGlobalLoadingMiddleware } from '@/api/core/middleware'
  4. import router from '@/router'
  5. definePage({
  6. name: 'common-afterSalesList',
  7. islogin: true,
  8. style: {
  9. navigationBarTitleText: '售后列表',
  10. },
  11. })
  12. const { data: refundList, refresh, page, isLastPage } = usePagination((pageNum, pageSize) => Apis.xsb.refundList({ data: { pageNum, pageSize } }), {
  13. immediate: false,
  14. pageNum: 1,
  15. pageSize: 10,
  16. initialData: [],
  17. data: res => res.data?.list,
  18. append: true,
  19. middleware: createGlobalLoadingMiddleware(),
  20. })
  21. onShow(() => {
  22. refresh()
  23. })
  24. onReachBottom(() => {
  25. if (!isLastPage.value) {
  26. page.value++
  27. }
  28. })
  29. async function handleCancel(item: Api.AppRefundOrderListVo) {
  30. await handleCommonRefundOrderCancel(item.refundNumber as string)
  31. refresh()
  32. }
  33. </script>
  34. <template>
  35. <view class="page-xsb px24rpx py24rpx">
  36. <view v-for="item in refundList" :key="item.refundNumber" class="mb24rpx rounded-16rpx bg-white p24rpx">
  37. <view @click="router.push({ name: 'common-afterSalesDetail', params: { refundNumber: `${item.refundNumber}` } })">
  38. <view class="flex items-center justify-between">
  39. <view class="whitespace-nowrap text-28rpx text-#AAAAAA">
  40. 售后编号:{{ item.refundNumber }}
  41. </view>
  42. <view class="text-24rpx text-#222">
  43. {{ refundOrderStatusText[item.refundStatus as keyof typeof refundOrderStatusText] }}
  44. </view>
  45. </view>
  46. <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
  47. <view class="mt24rpx box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9">
  48. <view class="box-border h-full w480rpx py28rpx pl20rpx">
  49. <scroll-view scroll-x class="h-full w-full whitespace-nowrap">
  50. <view class="flex items-center">
  51. <view v-for="items in item.refundProdList" :key="items.id" class="mr50rpx">
  52. <image
  53. :src="items.prodUrl"
  54. class="h120rpx w120rpx"
  55. />
  56. </view>
  57. </view>
  58. </scroll-view>
  59. </view>
  60. <view class="box-shadow box-border h-full flex-1 flex-shrink-0 px14rpx py40rpx">
  61. <view class="text-center text-32rpx text-#FF4D3A font-semibold">
  62. ¥{{ item.refundProdMoney }}
  63. </view>
  64. <view class="text-center text-28rpx text-#AAAAAA">
  65. 共{{ item.refundProdNumber }}件
  66. </view>
  67. </view>
  68. </view>
  69. <view class="mt24rpx rounded-16rpx bg-#F9F9F9 px24rpx py20rpx text-28rpx text-#222">
  70. {{ item.omsOrderRefundRecord?.auditStatusDescribe }}
  71. <text class="text-24rpx text-#AAAAAA">
  72. {{ item.omsOrderRefundRecord?.instructions }}
  73. </text>
  74. </view>
  75. </view>
  76. <view class="mt20rpx flex items-center justify-end">
  77. <wd-button v-if="item.refundStatus == refundStatus.Cancel" plain block type="info" size="small" @click.stop="useSysStore().getRefunOrder(item.orderNumber as string)">
  78. 再次申请
  79. </wd-button>
  80. <wd-button v-if="item.refundStatus == refundStatus.PendingAudit" plain block type="info" size="small" @click.stop="handleCancel(item)">
  81. 取消申请
  82. </wd-button>
  83. </view>
  84. </view>
  85. <wd-status-tip v-if="!refundList.length" image="content" tip="暂无内容" />
  86. </view>
  87. </template>
  88. <style scoped>
  89. </style>