info-card.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="info-card">
  3. <view class="row">
  4. <text class="label">快递单号:</text>
  5. <text class="value">{{ detail.waybillCode || '-' }}</text>
  6. </view>
  7. <view class="row" v-if="detail.orderId">
  8. <text class="label">订单号:</text>
  9. <text class="link" @tap="copy(detail.orderId)">{{ detail.orderId }}</text>
  10. </view>
  11. <view class="row">
  12. <text class="label">{{ type === 'mall' ? '任务类型:' : '任务类型:' }}</text>
  13. <text class="value">{{ detail.taskTypeName || detail.taskType || '-' }}</text>
  14. <text class="sub" v-if="detail.taskTypeExt">{{ detail.taskTypeExt }}</text>
  15. </view>
  16. <view class="row">
  17. <text class="label">{{ type === 'mall' ? '验货状态:' : '订单状态:' }}</text>
  18. <text class="value">{{ detail.verifyStatusName || detail.orderStatusName || '-' }}</text>
  19. </view>
  20. <view class="row">
  21. <text class="label">任务详情:</text>
  22. <text class="value">{{ detail.taskDetail || '-' }}</text>
  23. </view>
  24. <view class="row">
  25. <text class="label">创建人:</text>
  26. <text class="value">{{ detail.createUser || '-' }}</text>
  27. </view>
  28. <view class="row">
  29. <text class="label">创建时间:</text>
  30. <text class="value">{{ detail.createTime || '-' }}</text>
  31. </view>
  32. <view class="row" v-if="detail.taskStatusName">
  33. <text class="label">任务状态:</text>
  34. <text class="status" :class="{ danger: detail.taskStatusName === '待处理' }">{{ detail.taskStatusName }}</text>
  35. </view>
  36. <view class="image-wrap" v-if="imgSrc">
  37. <u-image :src="imgSrc" width="150rpx" height="150rpx" radius="8" mode="aspectFill"
  38. @click="preview"></u-image>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. import { computed } from 'vue'
  44. const props = defineProps({
  45. detail: {
  46. type: Object,
  47. default: () => ({})
  48. },
  49. type: {
  50. type: String,
  51. default: 'recycle'
  52. }
  53. })
  54. const imgSrc = computed(() => props.detail.imageUrl || props.detail.imgPath || '')
  55. const copy = (text) => {
  56. if (!text) return
  57. uni.setClipboardData({ data: String(text) })
  58. }
  59. const preview = () => {
  60. if (!imgSrc.value) return
  61. uni.previewImage({ urls: [imgSrc.value] })
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .info-card {
  66. background: #ffffff;
  67. border-radius: 12rpx;
  68. padding: 20rpx;
  69. }
  70. .row {
  71. display: flex;
  72. align-items: baseline;
  73. margin-bottom: 12rpx;
  74. }
  75. .label {
  76. font-size: 28rpx;
  77. color: #666666;
  78. }
  79. .value {
  80. font-size: 28rpx;
  81. color: #333333;
  82. }
  83. .link {
  84. font-size: 28rpx;
  85. color: #1b77f0;
  86. }
  87. .sub {
  88. margin-left: 16rpx;
  89. font-size: 26rpx;
  90. color: #22ac38;
  91. }
  92. .status {
  93. font-size: 28rpx;
  94. color: #22ac38;
  95. }
  96. .status.danger {
  97. color: #ff4d4f;
  98. }
  99. .image-wrap {
  100. margin: 16rpx 0;
  101. }
  102. </style>