detail.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="common-page" style="padding: 0;padding-bottom: 130rpx;">
  3. <InfoCard :detail="detail" type="mall" />
  4. <TrackRecord :records="records" class="mt-20" />
  5. <view class="fixed-bottom">
  6. <u-button type="warning" size="large" @click="onEdit">编辑</u-button>
  7. <u-button type="danger" size="large" @click="onVoid">作废</u-button>
  8. <u-button type="primary" size="large" @click="onFinish">完成</u-button>
  9. </view>
  10. </view>
  11. </template>
  12. <script setup>
  13. import { ref } from 'vue'
  14. import { onLoad } from '@dcloudio/uni-app'
  15. import InfoCard from '@/pages/order/components/info-card.vue'
  16. import TrackRecord from '@/pages/order/components/track-record.vue'
  17. const detail = ref({})
  18. const records = ref([])
  19. const getDetail = async (code) => {
  20. try {
  21. const res = await uni.$u.http.get('/app/workorder/detail', { params: { type: 'mall', waybillCode: code } })
  22. if (res?.code === 200 && res?.data) {
  23. detail.value = res.data
  24. return
  25. }
  26. } catch (e) { }
  27. detail.value = {
  28. waybillCode: code || 'YT54454654564',
  29. taskTypeName: '部分发货',
  30. verifyStatusName: '已验货',
  31. taskDetail: '少发一本',
  32. createUser: 'zzz',
  33. createTime: '2026-05-11 15:00:00',
  34. imageUrl: '/static/img/book.png'
  35. }
  36. records.value = [
  37. { time: '2025-02-11 16:00:00', user: 'aaa', statusText: '发货' }
  38. ]
  39. }
  40. const onEdit = () => {
  41. uni.$u.toast('进入编辑')
  42. }
  43. const onVoid = () => {
  44. uni.$u.toast('已作废')
  45. }
  46. const onFinish = () => {
  47. uni.$u.toast('任务已完成')
  48. }
  49. onLoad((options) => {
  50. getDetail(options.waybillCode)
  51. })
  52. </script>
  53. <style lang="scss" scoped>
  54. .mt-20 {
  55. margin-top: 20rpx;
  56. }
  57. </style>