orderItem.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="order-card">
  3. <!-- 用户信息 -->
  4. <view class="user-info">
  5. <image class="avatar" src="https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png" mode="aspectFill"></image>
  6. <view class="user-details">
  7. <text class="username">微信用户(南**)</text>
  8. <text class="date">共卖出7本书</text>
  9. <text class="date">来自河南省郑州市中牟县</text>
  10. </view>
  11. <view class="user-details right-items">
  12. <text class="date">2024-06-01 17:00:00</text>
  13. <text class="status" :style="{ color: statusColor }">[待收货审核]</text>
  14. </view>
  15. </view>
  16. <!-- 订单信息 -->
  17. <view class="order-info">
  18. </view>
  19. <!-- 订单详情 -->
  20. <view class="order-details">
  21. <view class="detail-row">
  22. <text>订单ID:</text>
  23. <text class="link" @click="copyToClipboard(orderId)">{{ orderId }}</text>
  24. <text>运单号:</text>
  25. <text class="link" @click="copyToClipboard(trackingId)">{{ trackingId }}</text>
  26. </view>
  27. <view class="detail-row">
  28. <text>预估金额:{{ estimatedAmount }}</text>
  29. <text>审核金额:{{ auditAmount }}</text>
  30. </view>
  31. <view class="detail-row">
  32. <text>内部备注:{{ internalNote }}</text>
  33. </view>
  34. </view>
  35. <!-- 操作按钮 -->
  36. <view class="action-buttons">
  37. <u-button size="small" @click="handleAudit">到货审核</u-button>
  38. <u-button size="small" @click="handleView">查看</u-button>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. import {
  44. ref
  45. } from 'vue'
  46. // 模拟数据
  47. const orderId = ref('66478425')
  48. const trackingId = ref('DPK202356410215')
  49. const estimatedAmount = ref('66.6')
  50. const auditAmount = ref('待核')
  51. const internalNote = ref('已反馈')
  52. const statusColor = ref('#FF4D4F')
  53. // 复制到剪贴板
  54. const copyToClipboard = (text) => {
  55. uni.setClipboardData({
  56. data: text,
  57. success: () => {
  58. uni.showToast({
  59. title: '复制成功',
  60. icon: 'success'
  61. })
  62. }
  63. })
  64. }
  65. // 到货审核
  66. const handleAudit = () => {
  67. console.log('到货审核')
  68. // 处理到货审核逻辑
  69. }
  70. // 查看
  71. const handleView = () => {
  72. console.log('查看')
  73. // 处理查看逻辑
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .order-card {
  78. background: #FFFFFF;
  79. border-radius: 8rpx;
  80. padding: 20rpx;
  81. margin-bottom: 20rpx;
  82. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  83. .user-info {
  84. display: flex;
  85. align-items: flex-start;
  86. margin-bottom: 20rpx;
  87. .avatar {
  88. width: 80rpx;
  89. height: 80rpx;
  90. border-radius: 40rpx;
  91. margin-right: 20rpx;
  92. }
  93. .user-details {
  94. flex: 1;
  95. display: flex;
  96. flex-direction: column;
  97. &.right-items{
  98. align-items: flex-end;
  99. }
  100. .username {
  101. font-size: 28rpx;
  102. color: #333333;
  103. margin-bottom: 4rpx;
  104. }
  105. .date {
  106. font-size: 24rpx;
  107. color: #999999;
  108. }
  109. .status {
  110. font-size: 24rpx;
  111. font-weight: bold;
  112. }
  113. }
  114. }
  115. .order-details {
  116. font-size: 26rpx;
  117. color: #333333;
  118. margin-bottom: 20rpx;
  119. .detail-row {
  120. display: flex;
  121. justify-content: space-between;
  122. margin-bottom: 8rpx;
  123. .link {
  124. color: #007BFF;
  125. text-decoration: underline;
  126. cursor: pointer;
  127. }
  128. }
  129. }
  130. .action-buttons {
  131. display: flex;
  132. justify-content: space-between;
  133. :deep(.u-button) {
  134. flex: 1;
  135. margin: 0 10rpx;
  136. height: 60rpx;
  137. font-size: 26rpx;
  138. }
  139. }
  140. }
  141. </style>