orderItem.vue 3.5 KB

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