logistics.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="container">
  3. <!-- 物流头部信息 -->
  4. <view class="logistics-header">
  5. <view class="flex-items-between">
  6. <view class="font28">物流公司: {{ logisticsCompany }}</view>
  7. <view>
  8. <text class="font28 mar-r-10">单号: {{ logisticsNumber }}</text>
  9. <text class="copy-btn" @tap="copyContent">复制</text>
  10. </view>
  11. </view>
  12. </view>
  13. <!-- 物流轨迹列表 -->
  14. <view class="logistics-trace">
  15. <uni-steps :options="logisticsList" direction="column" :active="0"></uni-steps>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. logisticsCompany: '顺丰速运',
  24. logisticsNumber: '',
  25. logisticsList: [{
  26. desc: '2025-03-25 10:00:00',
  27. title: '【深圳转运中心】已发出,下一站【北京转运中心】'
  28. },
  29. {
  30. desc: '2025-03-24 15:30:00',
  31. title: '【深圳站点】已收件'
  32. },
  33. {
  34. desc: '2025-03-24 13:00:00',
  35. title: '卖家已发货'
  36. }
  37. ]
  38. };
  39. },
  40. methods: {
  41. copyContent() {
  42. uni.setClipboardData({
  43. data: this.logisticsNumber,
  44. success: () => {
  45. uni.showToast({
  46. title: '复制成功',
  47. icon: 'none'
  48. });
  49. }
  50. });
  51. }
  52. },
  53. onLoad(op) {
  54. this.logisticsNumber = op.expressCode
  55. }
  56. };
  57. </script>
  58. <style scoped>
  59. .container {
  60. padding: 20rpx;
  61. background-color: #f8f8f8;
  62. }
  63. .logistics-header {
  64. background-color: #ffffff;
  65. border-radius: 10rpx;
  66. padding: 32rpx;
  67. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  68. margin-bottom: 20rpx;
  69. }
  70. .company-logo {
  71. width: 80rpx;
  72. height: 80rpx;
  73. margin-right: 20rpx;
  74. }
  75. .company-logo image {
  76. width: 100%;
  77. height: 100%;
  78. }
  79. .logistics-trace {
  80. min-height: calc(100vh - 20rpx - 32rpx - 20rpx - 20rpx);
  81. /* 减去容器内边距、头部内边距、头部底部外边距和自身内边距 */
  82. background-color: #ffffff;
  83. border-radius: 10rpx;
  84. padding: 20rpx;
  85. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  86. }
  87. .copy-btn {
  88. background-color: #ffffff;
  89. border: 1px solid #999999;
  90. color: #333333;
  91. padding: 5rpx 10rpx;
  92. /* 减少按钮的内边距 */
  93. border-radius: 8rpx;
  94. font-size: 28rpx;
  95. }
  96. </style>