parcel_detail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar title="订单详情" fixed border autoBack @leftClick="leftClick">
  5. <template #right>
  6. <navMenu :options="{ icon: 'icon-home', text: '主页' }" />
  7. </template>
  8. </Navbar>
  9. <view class="content">
  10. <!-- <view class="tip">
  11. <trans _t="订单流程" />:&nbsp;
  12. <trans _t="处理中" />
  13. <i class="icon-font icon-question2"></i>
  14. </view> -->
  15. <parcelList :item="detail" />
  16. <view class="order_info">
  17. <view class="order_no">
  18. <trans _t="订单号" />:
  19. <view class="_no">{{ detail.orderNo }}</view>
  20. </view>
  21. <view class="copy_btn">
  22. <up-copy :content="detail.orderNo" :notice="t('复制成功')">
  23. <trans _t="复制" />
  24. </up-copy>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="list_of_details">
  29. <ParcelDetailParticulars
  30. :mapOptions="detailListMap[0]"
  31. :datas="
  32. detail
  33. ? {
  34. ...detail.templateData,
  35. act_weight:
  36. detail.templateData && detail.templateData.continue_weight
  37. ? detail.templateData.continue_weight
  38. : 0,
  39. estimate_price:
  40. detail.templateData && detail.templateData.first_price
  41. ? detail.templateData.first_price
  42. : '0.00',
  43. }
  44. : {}
  45. "
  46. ></ParcelDetailParticulars>
  47. </view>
  48. <view class="list_of_details" v-if="detail && detail.status > 10">
  49. <ParcelDetailParticulars
  50. :mapOptions="detailListMap[1]"
  51. :datas="detail"
  52. ></ParcelDetailParticulars>
  53. </view>
  54. <view class="list_of_details" v-if="detail && detail.status > 10">
  55. <ParcelDetailParticulars
  56. :mapOptions="detailListMap[2]"
  57. :datas="detail"
  58. ></ParcelDetailParticulars>
  59. </view>
  60. <view class="list_of_details" v-if="detail && !!detail.expressNo">
  61. <view class="order_footer-delivery-btn"
  62. ><trans class="menu_text" _t="查看物流"
  63. /></view>
  64. </view>
  65. </view>
  66. </Theme>
  67. </template>
  68. <script setup>
  69. import Navbar from "@/components/navbar";
  70. import navMenu from "@/components/nav_menu";
  71. import ParcelDetailParticulars from "./components/parcel_detail_particulars";
  72. import { SHOP_PACKAGES_DETAIL } from "@/api";
  73. import { ref, nextTick, computed } from "vue";
  74. import { onLoad } from "@dcloudio/uni-app";
  75. import parcelList from "./components/parcel_list";
  76. import { t } from "@/locale";
  77. import { Moneyhtml } from "@/utils";
  78. import { useSystemStore, useTabbarStore } from "@/store";
  79. const useSystem = useSystemStore();
  80. const useTabbar = useTabbarStore();
  81. const orderid = ref("");
  82. const detail = ref({});
  83. const symbol = computed(() => useSystem.getSymbol);
  84. const isOrder = ref(false);
  85. const detailListMap = [
  86. {
  87. title: "预付费用明细",
  88. mapField: [
  89. { label: "预估费用", key: "estimate_price" },
  90. { label: "预估运费", key: "", unit: "" },
  91. { label: "预估运费重", key: "", unit: "", fontColor: "#777" },
  92. { label: "首重", key: "first_price", unit: "g", fontColor: "#777" },
  93. { label: "续重", key: "continue_price", unit: "g", fontColor: "#777" },
  94. { label: "操作费", key: "opt_price", unit: "" },
  95. { label: "报关费", key: "customs_costs", unit: "" },
  96. { label: "燃油附加费", key: "fuel_costs", unit: "" },
  97. { label: "偏远地区费用", key: "area_price", unit: "" },
  98. { label: "旺季附加费", key: "wj_price", unit: "" },
  99. { label: "运费优惠", key: "", unit: "", symbol: "-" },
  100. ],
  101. },
  102. {
  103. title: "实际运费明细",
  104. mapField: [
  105. { label: "实际费用", key: "money" },
  106. { label: "实际运费", key: "postAmt" },
  107. { label: "实际计费重", key: "act_weight", unit: "g", fontColor: "#777" },
  108. { label: "实际体积", key: "act_volume", unit: "m³", fontColor: "#777" },
  109. { label: "首重", key: "first_price", unit: "g", fontColor: "#777" },
  110. { label: "续重", key: "continue_price", unit: "g", fontColor: "#777" },
  111. { label: "操作费", key: "opt_price", unit: "" },
  112. { label: "报关费", key: "customs_costs", unit: "" },
  113. { label: "燃油附加费", key: "fuel_costs", unit: "" },
  114. { label: "偏远地区费用", key: "area_price", unit: "" },
  115. { label: "旺季附加费", key: "wj_price", unit: "" },
  116. ],
  117. },
  118. {
  119. title: "其他费用明细",
  120. mapField: [
  121. { label: "其他费用", key: "other_price" },
  122. { label: "打包费", key: "pack_price" },
  123. ],
  124. },
  125. ];
  126. const leftClick = () => {
  127. if (isOrder.value) {
  128. uni.switchTab({ url: "/pages/order/index" });
  129. useTabbar.getPageCur("order");
  130. } else {
  131. uni.navigateBack();
  132. }
  133. };
  134. onLoad((options) => {
  135. orderid.value = options.orderid;
  136. isOrder.value = options.isOrder || false;
  137. nextTick(() => {
  138. getDetail();
  139. });
  140. });
  141. const getDetail = async () => {
  142. try {
  143. const res = await SHOP_PACKAGES_DETAIL(orderid.value);
  144. detail.value = res.data;
  145. } catch (error) {}
  146. };
  147. </script>
  148. <style lang="less" scoped>
  149. @import url("@/style.less");
  150. .wrap {
  151. min-height: 100vh;
  152. background-color: var(--bg);
  153. .content {
  154. padding: 24rpx;
  155. .tip {
  156. .flex_position(flex-end);
  157. color: var(--primary);
  158. .size(28rpx);
  159. .icon-font {
  160. .size(48rpx);
  161. }
  162. }
  163. .order_info {
  164. background-color: var(--light);
  165. margin-top: 24rpx;
  166. border-radius: 16rpx;
  167. padding: 24rpx;
  168. .ver();
  169. .order_no {
  170. flex: 1;
  171. .flex();
  172. color: var(--text);
  173. .size(24rpx);
  174. line-height: 40rpx;
  175. ._no {
  176. font-weight: 600;
  177. flex: 1;
  178. }
  179. }
  180. .copy_btn {
  181. border: 1px solid var(--primary);
  182. border-radius: 40rpx;
  183. color: var(--primary);
  184. padding: 0 16rpx;
  185. .size(24rpx);
  186. line-height: 40rpx;
  187. }
  188. }
  189. }
  190. .list_of_details {
  191. padding: 0 48rpx 40rpx;
  192. }
  193. .list_of_details:nth-child(2) {
  194. :deep(
  195. .particulars__list
  196. .particulars__item:first-child
  197. .particulars__item-right
  198. ) {
  199. color: red !important;
  200. }
  201. }
  202. .order_footer-delivery-btn {
  203. display: flex;
  204. justify-content: center;
  205. align-items: center;
  206. padding: 20rpx 30rpx;
  207. border-radius: 12rpx;
  208. border: 1px solid var(--black);
  209. background-color: var(--black);
  210. color: var(--light);
  211. font-size: 30rpx;
  212. }
  213. }
  214. </style>