OrderItem.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <template>
  2. <view class="card">
  3. <view class="card-header">
  4. <text class="waybill-number">运单号:JDVA401410370033</text>
  5. <image src="/static/img/copy.png" @click="copyWaybillNumber"></image>
  6. </view>
  7. <view class="content">
  8. <!-- 左侧寄件人信息 -->
  9. <view class="sender-info">
  10. <view class="city-tag">洛阳市</view>
  11. <view class="name">下海龙</view>
  12. </view>
  13. <view class="translate">
  14. <view class="status">待取件</view>
  15. <image src="/static/img/translte-1.png"></image>
  16. </view>
  17. <!-- 右侧收件人信息 -->
  18. <view class="receiver-info">
  19. <view class="city-tag">北京市</view>
  20. <view class="name">周欣源</view>
  21. </view>
  22. </view>
  23. <!-- 状态信息 -->
  24. <view class="section-continer">
  25. <view class="timeline">
  26. <view class="dot">
  27. <view class="timeline-dot dot-active"></view>
  28. </view>
  29. <view class="timeline-line line-active"></view>
  30. </view>
  31. <view class="status-section">
  32. <view class="status-badge status-collected">已代收</view>
  33. <view class="status-detail">
  34. 快件已投递至【北京海淀区北京大学菜鸟驿北京海淀区北京大学菜鸟驿北京海淀区北京大学菜鸟驿北京海淀区北京大学菜鸟驿】
  35. </view>
  36. <view class="status-time">2026-01-11 17:32:32</view>
  37. </view>
  38. </view>
  39. <!-- 操作按钮 -->
  40. <view class="action-buttons">
  41. <view class="action-btn" @click="showExpressTrack">
  42. <text class="btn-text">物流轨迹</text>
  43. </view>
  44. <view class="action-btn" @click="showOrderInfo">
  45. <text class="btn-text">运单详情</text>
  46. </view>
  47. <view class="action-btn btn-cancel">
  48. <text class="btn-text">运单取消</text>
  49. </view>
  50. </view>
  51. <!-- 物流轨迹弹框 -->
  52. <TrackPopup
  53. v-model:showPopup="showTrackPopup"
  54. :expressData="expressData"
  55. :orderNo="orderDetail.externalWaybillNo"
  56. />
  57. </view>
  58. </template>
  59. <script setup>
  60. import { ref, defineProps, defineEmits } from 'vue'
  61. import TrackPopup from './TrackPopup.vue'
  62. const emit = defineEmits(['success'])
  63. const props = defineProps({
  64. isGrab: {
  65. type: Boolean,
  66. default: false
  67. },
  68. orderDetail: {
  69. type: Object,
  70. default: () => ({
  71. goodsMainImage: null,
  72. goodsName: null,
  73. id: undefined,
  74. orderCreateTime: '',
  75. shopConfirmStatus: "",
  76. shopEvaluateStatus: '',
  77. shopDispatchVerifyStatus: "",
  78. shopGoodsId: undefined,
  79. shopOrderAmount: undefined,
  80. shopOrderId: "",
  81. shopOrderNum: 1,
  82. shopOrderStatus: "1",
  83. shopPrice: 102,
  84. shopRefundReviewStatus: null,
  85. shopServiceStatus: null,
  86. shopUserTime: null,
  87. userId: "1989219383070896130",
  88. userNickName: "bonjour",
  89. userPhone: "17639845061"
  90. })
  91. }
  92. })
  93. // 控制弹框显示
  94. const showTrackPopup = ref(false)
  95. const expressData = ref({
  96. company: '顺丰速运',
  97. number: 'JDVA401410370033',
  98. status: '待取件'
  99. })
  100. // 显示物流轨迹弹框
  101. const showExpressTrack = () => {
  102. // 这里可以调用API获取物流信息
  103. // 暂时使用模拟数据
  104. showTrackPopup.value = true
  105. }
  106. const showOrderInfo = () => {
  107. uni.navigateTo({
  108. url:'/pages/order/order_detail'
  109. })
  110. }
  111. // 复制运单号
  112. const copyWaybillNumber = () => {
  113. uni.setClipboardData({
  114. data: 'JDVA401410370033',
  115. success: () => {
  116. uni.showToast({
  117. title: '运单号已复制',
  118. icon: 'success'
  119. })
  120. }
  121. })
  122. }
  123. </script>
  124. <style scoped lang="less">
  125. .card {
  126. background-color: #fff;
  127. border-radius: 32rpx;
  128. margin-bottom: 20rpx;
  129. padding: 20rpx;
  130. .card-header {
  131. height: 45rpx;
  132. margin-bottom: 20rpx;
  133. display: flex;
  134. align-items: center;
  135. .waybill-number {
  136. height: 100%;
  137. line-height: 45rpx;
  138. font-size: 28rpx;
  139. color: #333;
  140. font-weight: 500;
  141. }
  142. image {
  143. width: 50rpx;
  144. height: 50rpx;
  145. padding: 10rpx;
  146. margin-left: 8rpx;
  147. flex-shrink: 0;
  148. }
  149. }
  150. .content {
  151. display: flex;
  152. justify-content: space-between;
  153. align-items: center;
  154. margin-bottom: 20rpx;
  155. .sender-info,
  156. .receiver-info {
  157. flex: 1;
  158. display: flex;
  159. flex-direction: column;
  160. align-items: center;
  161. min-width: 0; /* 防止flex子元素溢出 */
  162. .city-tag {
  163. max-width: 250rpx;
  164. height: 52rpx;
  165. font-size: 36rpx;
  166. color: #333333;
  167. line-height: 52rpx;
  168. font-weight: bold;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. white-space: nowrap;
  172. }
  173. .name {
  174. max-width: 250rpx;
  175. height: 44rpx;
  176. font-weight: 400;
  177. font-size: 28rpx;
  178. color: #333333;
  179. line-height: 44rpx;
  180. margin-top: 8rpx;
  181. overflow: hidden;
  182. text-overflow: ellipsis;
  183. white-space: nowrap;
  184. }
  185. }
  186. .translate {
  187. display: flex;
  188. flex-direction: column;
  189. align-items: center;
  190. justify-content: center;
  191. width: 160rpx;
  192. flex-shrink: 0;
  193. .status {
  194. height: 44rpx;
  195. font-weight: 400;
  196. font-size: 28rpx;
  197. color: #333333;
  198. line-height: 44rpx;
  199. overflow: hidden;
  200. text-overflow: ellipsis;
  201. white-space: nowrap;
  202. max-width: 100%;
  203. }
  204. image {
  205. height: 28rpx;
  206. width: 160rpx;
  207. margin-top: 8rpx;
  208. flex-shrink: 0;
  209. }
  210. }
  211. }
  212. .section-continer {
  213. display: flex;
  214. background-color: #F5F7FA;
  215. border-radius: 16rpx;
  216. padding: 20rpx;
  217. margin-bottom: 20rpx;
  218. .timeline {
  219. display: flex;
  220. flex-direction: column;
  221. align-items: center;
  222. width: 34rpx;
  223. margin-right: 20rpx;
  224. flex-shrink: 0;
  225. .dot {
  226. width: 34rpx;
  227. height: 34rpx;
  228. border-radius: 50%;
  229. background-color: #C1D5FF;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. flex-shrink: 0;
  234. }
  235. .timeline-dot {
  236. width: 18rpx;
  237. height: 18rpx;
  238. border-radius: 50%;
  239. &.dot-active {
  240. background-color: #1B64F0;
  241. }
  242. }
  243. .timeline-line {
  244. flex: 1;
  245. width: 4rpx;
  246. box-sizing: border-box;
  247. margin-top: 10rpx;
  248. &.line-active {
  249. border-left: 4rpx dashed #1B64F0;
  250. }
  251. }
  252. }
  253. .status-section {
  254. flex: 1;
  255. min-width: 0;
  256. .status-badge {
  257. margin-bottom: 8rpx;
  258. height: 48rpx;
  259. font-weight: 400;
  260. font-size: 32rpx;
  261. color: #333333;
  262. line-height: 48rpx;
  263. overflow: hidden;
  264. text-overflow: ellipsis;
  265. white-space: nowrap;
  266. }
  267. .status-detail {
  268. font-weight: 400;
  269. font-size: 28rpx;
  270. color: #333333;
  271. line-height: 44rpx;
  272. margin-top: 8rpx;
  273. overflow: hidden;
  274. text-overflow: ellipsis;
  275. white-space: nowrap;
  276. }
  277. .status-time {
  278. margin-top: 8rpx;
  279. height: 40rpx;
  280. font-weight: 400;
  281. font-size: 24rpx;
  282. color: #999999;
  283. line-height: 40rpx;
  284. overflow: hidden;
  285. text-overflow: ellipsis;
  286. white-space: nowrap;
  287. }
  288. }
  289. }
  290. .action-buttons {
  291. margin-top: 20rpx;
  292. display: flex;
  293. justify-content: flex-end;
  294. .action-btn {
  295. display: flex;
  296. justify-content: center;
  297. align-items: center;
  298. width: 160rpx;
  299. height: 60rpx;
  300. border-radius: 80rpx;
  301. border: 2rpx solid #F1F3F8;
  302. margin-left: 20rpx;
  303. &:first-child {
  304. margin-left: 0;
  305. }
  306. &:last-child {
  307. margin-right: 0;
  308. }
  309. .btn-text {
  310. font-size: 28rpx;
  311. color: #333;
  312. overflow: hidden;
  313. text-overflow: ellipsis;
  314. white-space: nowrap;
  315. }
  316. &.btn-cancel {
  317. background-color: #fff5f5;
  318. .btn-text {
  319. color: #ff6b6b;
  320. }
  321. }
  322. /* 添加点击效果 */
  323. &:active {
  324. opacity: 0.7;
  325. }
  326. }
  327. }
  328. }
  329. </style>