orderInfo.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="info">
  3. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
  4. activeColor="#007aff">
  5. </uni-segmented-control>
  6. <view class="content">
  7. <view v-show="current === 0">
  8. <view class="order-no">
  9. <view>
  10. <text>派送单号: {{ item.order_no }}</text>
  11. <image @click="copyString(item.order_no)" class="icon" src="/static/copy.png"
  12. mode="aspectFill" />
  13. </view>
  14. <uni-tag :text="item.status_text" type="primary" circle></uni-tag>
  15. </view>
  16. <view class="box-card">
  17. <view class="label-icon">
  18. <text class="label-title">地址信息</text>
  19. </view>
  20. <view class="label-content">
  21. <text>
  22. {{ item!.address.first_name + ' ' + item!.address.last_name }}
  23. </text>
  24. <text v-if="item!.address.mobile">
  25. +{{ item!.address.mobile_code + ' ' + item!.address.mobile }}
  26. <br />
  27. </text>
  28. <text v-if="item!.address.email">
  29. {{ item!.address.email }}
  30. <br />
  31. </text>
  32. <text>
  33. {{ item!.address.address_line_1 }}
  34. <br />
  35. </text>
  36. <text v-if="item!.address.address_line_2">
  37. {{ item!.address.address_line_2 }}
  38. <br />
  39. </text>
  40. <text v-if="item!.address.address_line_3">
  41. {{ item!.address.address_line_3 }}
  42. <br />
  43. </text>
  44. <text>
  45. {{ item!.address.city + ' ' + item!.address.district }}
  46. <br />
  47. </text>
  48. <text>
  49. {{ item!.address.province }}
  50. <br />
  51. </text>
  52. <text>
  53. {{ item!.address.zip_code }}
  54. <br />
  55. </text>
  56. </view>
  57. </view>
  58. <view class="box-card">
  59. <text>客户派送日期:
  60. <uni-dateformat v-if="item.delivery_date" :date="item.delivery_date"
  61. format='yyyy-MM-dd'></uni-dateformat>
  62. <text v-else>无</text>
  63. <br />
  64. </text>
  65. <text>备注: {{ item.remark || '无' }}</text>
  66. </view>
  67. <view class="box-card">
  68. <view class="label-icon">
  69. <text class="label-title">物流信息</text>
  70. </view>
  71. <view class="label-content">
  72. <text>派送渠道类型:
  73. <uni-tag :text="delivery_type[item.delivery_type]" type="primary"></uni-tag>
  74. <br />
  75. </text>
  76. <text v-if="Number(item.delivery_type) === 1">司机:
  77. {{ deliveryOrderOptions['driver_id'][item.driver_id] || '无' }}
  78. <br />
  79. </text>
  80. <text v-if="Number(item.delivery_type) === 2">快递公司:
  81. <uni-tag :text="item.express.name || '无'" type="success" size="small" circle></uni-tag>
  82. <br />
  83. </text>
  84. <text>物流单号:
  85. {{ item.express_no || '无' }}
  86. <br />
  87. </text>
  88. <text>追踪单号: {{ item.express_tracking_number || '无' }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view v-show="current === 1">
  93. 选项卡2的内容
  94. </view>
  95. </view>
  96. <uni-popup ref="messageRef" type="message">
  97. <uni-popup-message :type="messageType" :message="messageText" :duration="2000"></uni-popup-message>
  98. </uni-popup>
  99. </view>
  100. </template>
  101. <script setup lang="ts">
  102. import { reactive, ref } from 'vue';
  103. import { onLoad } from '@dcloudio/uni-app';
  104. import { pickupWaybillDeliveryOrderURL } from '@/utils/api.js';
  105. const current = ref(0);
  106. const items = ref(['基本信息', '运单详情']);
  107. const loading = ref(false);
  108. const token = ref();
  109. const waybillDelivery = ref([]);
  110. const messageType = ref();
  111. const messageText = ref();
  112. const messageRef = ref();
  113. const item = ref();
  114. const deliveryOrderOptions = ref({});
  115. const delivery_type = ref({
  116. '1': '英途派送',
  117. '2': '第三方物流',
  118. })
  119. onLoad((query) => {
  120. token.value = uni.getStorageSync('token');
  121. item.value = uni.getStorageSync('selectItem');
  122. deliveryOrderOptions.value = uni.getStorageSync('deliveryOrderOptions');
  123. console.log(item.value);
  124. // getInfo(query.id);
  125. });
  126. const onClickItem = (e : any) => {
  127. if (current.value != e.currentIndex) {
  128. current.value = e.currentIndex;
  129. }
  130. }
  131. const copyString = (str : string) => {
  132. uni.setClipboardData({
  133. data: str,
  134. success: function () {
  135. uni.showToast({
  136. title: '复制成功',
  137. icon: 'success',
  138. duration: 2000
  139. });
  140. },
  141. fail: function () {
  142. console.log('复制失败');
  143. }
  144. });
  145. };
  146. </script>
  147. <style lang="scss" scoped>
  148. .info {
  149. padding: 20rpx;
  150. font-size: 30rpx;
  151. line-height: 50rpx;
  152. .icon {
  153. margin-left: 5rpx;
  154. width: 24rpx;
  155. height: 24rpx;
  156. }
  157. .content {
  158. margin-top: 20rpx;
  159. .order-no {
  160. display: flex;
  161. flex-direction: row;
  162. justify-content: space-between;
  163. align-items: center;
  164. }
  165. }
  166. .box-card {
  167. margin-top: 10rpx;
  168. padding: 10rpx;
  169. border: 1rpx gray dashed;
  170. border-radius: 20rpx;
  171. }
  172. .label-content {
  173. // margin-top: 10rpx;
  174. }
  175. }
  176. </style>