OrderItem.vue 7.3 KB

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