pending.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="common-page" style="padding: 0;">
  3. <PageScroll
  4. requestStr="/app/workorder/pending"
  5. @updateList="updateList"
  6. ref="scrollRef"
  7. :otherParams="otherParams"
  8. method="get"
  9. >
  10. <view class="list-con" v-if="dataList.length">
  11. <WorkorderItem
  12. v-for="(cell, idx) in dataList"
  13. :key="idx"
  14. :item="cell"
  15. :showDuration="false"
  16. @click="goDetail(cell)"
  17. class="mt-20"
  18. />
  19. </view>
  20. </PageScroll>
  21. </view>
  22. </template>
  23. <script setup>
  24. import { ref } from 'vue'
  25. import { onShow } from '@dcloudio/uni-app'
  26. import PageScroll from '@/components/pageScroll/index.vue'
  27. import WorkorderItem from '../components/workorder-item.vue'
  28. const dataList = ref([])
  29. const scrollRef = ref(null)
  30. const otherParams = ref({
  31. type: 'mall',
  32. status: 'pending'
  33. })
  34. const updateList = (data, page) => {
  35. const mock = [
  36. { waybillCode: 'YT54454654564', taskTypeName: '部分发货', createTime: '2026-05-11 15:00:00' },
  37. { waybillCode: 'YT54454654564', taskTypeName: '部分发货', createTime: '2026-05-11 15:00:00' },
  38. { waybillCode: 'YT54454654564', taskTypeName: '部分发货', createTime: '2026-05-11 15:00:00' },
  39. { waybillCode: 'YT54454654564', taskTypeName: '部分发货', createTime: '2026-05-11 15:00:00' },
  40. { waybillCode: 'YT54454654564', taskTypeName: '部分发货', createTime: '2026-05-11 15:00:00' },
  41. ]
  42. dataList.value = Array.isArray(data) && data.length ? data : mock
  43. }
  44. const refreshList = () => {
  45. scrollRef.value?.resetUpScroll()
  46. }
  47. const goDetail = (cell) => {
  48. const code = cell?.waybillCode || ''
  49. uni.navigateTo({
  50. url: `/pages/order/mall/detail?waybillCode=${code}`
  51. })
  52. }
  53. onShow(() => {
  54. refreshList()
  55. })
  56. </script>
  57. <style lang="scss" scoped>
  58. .list-con {
  59. padding: 10rpx 30rpx;
  60. gap: 30rpx;
  61. }
  62. </style>