orderInformation.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <view class="page">
  3. <view class="top" v-if="orderInformation.type != 'group_package'">
  4. <view class="title">
  5. {{ orderTitle }}
  6. </view>
  7. <view class="prompt">
  8. {{ orderDetail }}
  9. </view>
  10. </view>
  11. <view class="packaging" v-if="orderInformation.type == 'group_package'">
  12. <view class="packaging-top">
  13. <view class="">
  14. {{
  15. orderInformation.goods[0].type_text +
  16. "&nbsp;" +
  17. "|" +
  18. "&nbsp" +
  19. orderInformation.containerBase.transport_type_name
  20. }}
  21. </view>
  22. <view style="color: #f83224"> {{ orderInformation.status_text }} </view>
  23. </view>
  24. <view class="packaging-center">
  25. <view class="packaging-left">
  26. <view class="left-top"> 东莞仓库 </view>
  27. <view class="left-bottom"> 始发地 </view>
  28. </view>
  29. <image class="jiantou" src="../../static/mine/339.png" mode=""></image>
  30. <view class="packaging-left">
  31. <view class="left-top">
  32. {{ orderInformation.containerBase.country_name }}
  33. </view>
  34. <view class="left-bottom"> 目的地 </view>
  35. </view>
  36. </view>
  37. <view class="packaging-time">
  38. <view class="time">
  39. <text>开始时间:</text>
  40. <text>{{
  41. orderInformation.containerBase.begin_date + "&emsp;"
  42. }}</text>
  43. </view>
  44. <view class="time">
  45. <text>截止时间:</text>
  46. <text>{{ orderInformation.containerBase.end_date }}</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="photo" v-if="orderInformation.status == 'unpaid'">
  51. <view class="_weight">
  52. <text>称重重量</text>
  53. <text>{{ orderInformation.actual_weight }}kg</text>
  54. </view>
  55. <view class="_weight">
  56. <text>称重图片</text>
  57. <!-- <view class="_image"> </view> -->
  58. <image
  59. :src="orderInformation.weight_images"
  60. mode="scaleToFill"
  61. class="_image"
  62. />
  63. </view>
  64. <view class="photo-bottom">
  65. <text class="_text-1">需付款</text>
  66. <view class="price">
  67. <text style="font-size: 20rpx">¥</text>
  68. <text>{{ orderInformation.actual_price.split(".")[0] }}</text
  69. >.
  70. <text style="font-size: 20rpx">{{
  71. orderInformation.actual_price.split(".")[1]
  72. }}</text>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="address">
  77. <view class="name-phone">
  78. <view class="send"> 寄 </view>
  79. <view class="name"> {{ orderInformation.from_name }} </view>
  80. <view class="phone"> {{ orderInformation.from_mobile }} </view>
  81. </view>
  82. <view class="address-detail">
  83. {{ orderInformation.from_full_address }}
  84. </view>
  85. <view class="name-phone">
  86. <view class="send"> 收 </view>
  87. <view class="name"> {{ orderInformation.to_name }} </view>
  88. <view class="phone"> {{ orderInformation.to_mobile }} </view>
  89. </view>
  90. <view class="address-detail _bottom">
  91. {{ orderInformation.to_full_address }}
  92. </view>
  93. <image
  94. style="height: 4rpx; margin-bottom: 40rpx"
  95. src="../../static/mine/338.png"
  96. mode=""
  97. ></image>
  98. <view class="_label-list" v-for="item in orderInformation.goods">
  99. <view class="information">
  100. <text class="_label">物品信息:</text>
  101. <text class="_value">{{ item.name }}</text>
  102. </view>
  103. <view class="information">
  104. <text class="_label">件数:</text>
  105. <text class="_value">{{ item.number }}</text>
  106. </view>
  107. <view class="information">
  108. <text class="_label">重量:</text>
  109. <text class="_value">{{ item.actual_weight }}kg</text>
  110. </view>
  111. <view class="information">
  112. <text class="_label">类型:</text>
  113. <text class="_value">{{ item.type_text }}</text>
  114. </view>
  115. <view style="display: flex">
  116. <text class="_label">跨境物流:</text>
  117. <view class="_value">
  118. <text
  119. >{{ orderInformation.transportType.name_cn + "&nbsp;" }}
  120. </text>
  121. <text> | {{ orderInformation.containerBase.name }}</text>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="num-information">
  127. <view class="order" style="">
  128. <text class="_label-1">订单编号</text>
  129. <view class="num">
  130. <text>{{ orderInformation.order_no }}</text
  131. >{{ "&nbsp;" + "|" + "&nbsp;"
  132. }}<text @click="cope(orderInformation.order_no)">复制</text>
  133. </view>
  134. </view>
  135. <view class="order">
  136. <text class="_label-1">下单时间</text>
  137. <view class="num">{{ orderInformation.created_at }} </view>
  138. </view>
  139. <view
  140. class="order"
  141. v-if="
  142. orderInformation.status == 'overseas_undelivered' ||
  143. orderInformation.status == 'overseas_delivered' ||
  144. orderInformation.status == 'domestic_delivered' ||
  145. orderInformation.status == 'finished'
  146. "
  147. >
  148. <text class="_label-1">付款时间</text>
  149. <view class="num"> {{ orderInformation.paid_at }} </view>
  150. </view>
  151. <view
  152. class="order"
  153. v-if="
  154. (orderInformation.status == 'overseas_delivered' &&
  155. orderInformation.status != 'domestic_delivered') ||
  156. orderInformation.status == 'finished'
  157. "
  158. >
  159. <text class="_label-1">发货时间</text>
  160. <view class="num"> 2023-11-24 22:31 </view>
  161. </view>
  162. <view class="order" v-if="orderInformation.status == 'finished'">
  163. <text class="_label-1">签收时间</text>
  164. <view class="num"> 2023-11-24 22:31 </view>
  165. </view>
  166. </view>
  167. <view class="pay">
  168. <text>已付</text>
  169. <text style="color: #f83224; font-weight: 600">{{
  170. orderInformation.estimated_price
  171. }}</text>
  172. </view>
  173. <view
  174. class="footer"
  175. v-if="
  176. orderInformation.status == 'domestic_delivered' ||
  177. orderInformation.status == 'overseas_delivered' ||
  178. orderInformation.status == 'finished'
  179. "
  180. >
  181. <button
  182. class="btn-1"
  183. @click="toLogistics"
  184. v-if="orderInformation.status == 'finished'"
  185. >
  186. 删除
  187. </button>
  188. <button class="btn-1" @click="toLogistics">查看物流</button>
  189. <button
  190. class="btn-1"
  191. @click="fillInformation"
  192. v-if="orderInformation.status == 'domestic_undelivered'"
  193. >
  194. 填写物流信息
  195. </button>
  196. <button
  197. class="btn-2"
  198. @click="toPay"
  199. v-if="orderInformation.status == 'unpaid'"
  200. >
  201. 立即付款
  202. </button>
  203. </view>
  204. <view
  205. class="footer"
  206. v-else-if="
  207. orderInformation.status == 'domestic_undelivered' ||
  208. orderInformation.status == 'unpaid' ||
  209. orderInformation.status == 'group_unpaid'
  210. "
  211. >
  212. <button
  213. class="btn-1"
  214. @click="fillInformation"
  215. v-if="
  216. orderInformation.type == 'mall_order' &&
  217. orderInformation.status == 'domestic_undelivered'
  218. "
  219. >
  220. 填写物流信息
  221. </button>
  222. <button
  223. class="btn-2"
  224. @click="toSending"
  225. v-if="
  226. (orderInformation.type == 'group_package' ||
  227. orderInformation.type == 'express_order') &&
  228. orderInformation.status == 'domestic_undelivered'
  229. "
  230. >
  231. 去寄件
  232. </button>
  233. <button
  234. class="btn-2"
  235. @click="toPay"
  236. v-if="
  237. orderInformation.status == 'unpaid' ||
  238. orderInformation.status == 'group_unpaid'
  239. "
  240. >
  241. 立即付款
  242. </button></view
  243. >
  244. <Fill :show="show" @close="close" />
  245. </view>
  246. </template>
  247. <script>
  248. import Fill from "./component/fill.vue";
  249. export default {
  250. components: {
  251. Fill,
  252. },
  253. data() {
  254. return {
  255. orderStauts: 0,
  256. orderTitle: "",
  257. orderDetail: "",
  258. packageId: "",
  259. orderInformation: {},
  260. show: false,
  261. };
  262. },
  263. computed: {},
  264. onLoad(options) {
  265. this.orderStauts = options.orderStatus;
  266. this.getDetail();
  267. },
  268. created() {},
  269. methods: {
  270. cope(str) {
  271. uni.setClipboardData({
  272. data: str,
  273. success() {
  274. uni.showToast({
  275. title: "复制成功",
  276. icon: "none",
  277. });
  278. },
  279. });
  280. },
  281. //去寄件
  282. toSending() {
  283. uni.navigateTo({
  284. url: "/pageD/sending/sending?orderId=" + this.orderInformation.id,
  285. });
  286. },
  287. setStatus(num) {
  288. this.orderStauts = num;
  289. },
  290. //查看物流进度
  291. toLogistics() {
  292. uni.navigateTo({
  293. url: "/pageD/logisticsProgress/logisticsProgress",
  294. });
  295. },
  296. //填写物流信息
  297. fillInformation() {
  298. this.show = true;
  299. },
  300. //关闭弹窗
  301. close(value) {
  302. this.show = false;
  303. if (value.expressCode) {
  304. uni.$u.http
  305. .post(`/api/express-order/delivery/${this.orderInformation.id}`, {
  306. domestic_logistics_company_code: value.expressCode,
  307. domestic_logistics_no: value.expressNum,
  308. })
  309. .then((res) => {
  310. this.getDetail();
  311. uni.showToast({
  312. title: "已保存",
  313. });
  314. });
  315. }
  316. },
  317. //去支付
  318. toPay() {
  319. uni.navigateTo({
  320. url: `/pageD/paymentOrder/paymentOrder?money=${this.orderInformation.estimated_price}&weight=${this.orderInformation.goods[0].actual_weight}&packageType=${this.orderInformation.goods[0].type_text}&num=${this.orderInformation.goods[0].number}&orderid=${this.orderInformation.id}&type=${this.orderInformation.type}`,
  321. });
  322. },
  323. getDetail() {
  324. uni.$u.http.get(`/api/express-order/${this.orderStauts}`).then((res) => {
  325. this.orderInformation = res;
  326. if (this.orderInformation.status == "domestic_delivered") {
  327. //设置顶部标题栏颜色
  328. uni.setNavigationBarColor({
  329. frontColor: "#000000",
  330. backgroundColor: "#f4f4f4",
  331. });
  332. this.orderDetail = "商品已寄往平台,正在运输中";
  333. this.orderTitle = this.orderInformation.status_text;
  334. } else if (this.orderInformation.status == "unpaid") {
  335. //设置顶部标题栏颜色
  336. uni.setNavigationBarColor({
  337. frontColor: "#000000",
  338. backgroundColor: "#f4f4f4",
  339. });
  340. this.orderDetail = "商品已打包称重,等待用户付款";
  341. this.orderTitle = this.orderInformation.status_text;
  342. } else if (this.orderInformation.status == "overseas_undelivered") {
  343. //设置顶部标题栏颜色
  344. uni.setNavigationBarColor({
  345. frontColor: "#000000",
  346. backgroundColor: "#f4f4f4",
  347. });
  348. this.orderDetail = "等待平台发货";
  349. this.orderTitle = this.orderInformation.status_text;
  350. } else if (this.orderInformation.status == "overseas_delivered") {
  351. //设置顶部标题栏颜色
  352. uni.setNavigationBarColor({
  353. frontColor: "#000000",
  354. backgroundColor: "#f4f4f4",
  355. });
  356. this.orderDetail = "商品已发出,很快将发货至您的手中";
  357. this.orderTitle = this.orderInformation.status_text;
  358. } else if (this.orderStauts == 4) {
  359. //设置顶部标题栏颜色
  360. uni.setNavigationBarColor({
  361. frontColor: "#000000",
  362. backgroundColor: "#ffffff",
  363. });
  364. uni.setNavigationBarTitle({
  365. title: "拼包详情",
  366. });
  367. } else if (
  368. this.orderInformation.status == "finished" ||
  369. this.orderInformation.status == "overseas_received"
  370. ) {
  371. //设置顶部标题栏颜色
  372. uni.setNavigationBarColor({
  373. frontColor: "#000000",
  374. backgroundColor: "#f4f4f4",
  375. });
  376. this.orderDetail = "订单签收,交易已完成";
  377. this.orderTitle = this.orderInformation.status_text;
  378. } else if (this.orderInformation.status == "domestic_received") {
  379. //设置顶部标题栏颜色
  380. uni.setNavigationBarColor({
  381. frontColor: "#000000",
  382. backgroundColor: "#f4f4f4",
  383. });
  384. this.orderDetail = "等待中转称重发出";
  385. this.orderTitle = this.orderInformation.status_text;
  386. } else if (this.orderInformation.status == "closed") {
  387. //设置顶部标题栏颜色
  388. uni.setNavigationBarColor({
  389. frontColor: "#000000",
  390. backgroundColor: "#f4f4f4",
  391. });
  392. this.orderDetail = "订单关闭";
  393. this.orderTitle = this.orderInformation.status_text;
  394. } else if (this.orderInformation.status == "refunded") {
  395. //设置顶部标题栏颜色
  396. uni.setNavigationBarColor({
  397. frontColor: "#000000",
  398. backgroundColor: "#f4f4f4",
  399. });
  400. this.orderDetail = "订单已退款";
  401. this.orderTitle = this.orderInformation.status_text;
  402. } else if (this.orderInformation.status == "refunding") {
  403. //设置顶部标题栏颜色
  404. uni.setNavigationBarColor({
  405. frontColor: "#000000",
  406. backgroundColor: "#f4f4f4",
  407. });
  408. this.orderDetail = "订单正在申请退款";
  409. this.orderTitle = this.orderInformation.status_text;
  410. } else if (this.orderInformation.status == "domestic_undelivered") {
  411. //设置顶部标题栏颜色
  412. uni.setNavigationBarColor({
  413. frontColor: "#000000",
  414. backgroundColor: "#f4f4f4",
  415. });
  416. this.orderDetail = "商品等待发货中";
  417. this.orderTitle = this.orderInformation.status_text;
  418. }
  419. });
  420. },
  421. },
  422. };
  423. </script>
  424. <style lang="scss" scoped>
  425. .page {
  426. padding: 20rpx 24rpx;
  427. position: relative;
  428. .title {
  429. font-size: 44rpx;
  430. color: #222;
  431. font-weight: 600;
  432. }
  433. .prompt {
  434. font-size: 24rpx;
  435. color: rgba(34, 34, 34, 0.5);
  436. margin-top: 12rpx;
  437. }
  438. .packaging {
  439. border-radius: 16rpx;
  440. background-color: #fff;
  441. padding: 30rpx 20rpx;
  442. .packaging-top {
  443. display: flex;
  444. justify-content: space-between;
  445. font-size: 28rpx;
  446. color: #222;
  447. }
  448. .packaging-center {
  449. display: flex;
  450. justify-content: space-around;
  451. align-items: center;
  452. margin-top: 26rpx;
  453. background-color: #f5f5f5;
  454. border-radius: 10rpx;
  455. padding: 20rpx 0;
  456. .jiantou {
  457. width: 130rpx;
  458. height: 10rpx;
  459. }
  460. .packaging-left {
  461. text-align: center;
  462. .left-top {
  463. font-size: 32rpx;
  464. color: #222;
  465. font-weight: 600;
  466. }
  467. .left-bottom {
  468. margin-top: 10rpx;
  469. font-size: 24rpx;
  470. color: rgba(34, 34, 34, 0.5);
  471. }
  472. }
  473. }
  474. .packaging-time {
  475. font-size: 28rpx;
  476. display: flex;
  477. align-items: center;
  478. margin-top: 28rpx;
  479. }
  480. }
  481. .photo {
  482. background-color: #fff;
  483. border-radius: 16rpx;
  484. padding: 20rpx 20rpx;
  485. margin-top: 20rpx;
  486. ._weight {
  487. display: flex;
  488. justify-content: space-between;
  489. font-size: 26rpx;
  490. color: rgba(34, 34, 34, 0.8);
  491. margin-bottom: 32rpx;
  492. ._image {
  493. width: 160rpx;
  494. height: 90rpx;
  495. // background-color: #d8d8d8;
  496. border-radius: 4rpx;
  497. }
  498. }
  499. .photo-bottom {
  500. display: flex;
  501. justify-content: flex-end;
  502. align-items: center;
  503. border-top: 2rpx solid rgba(151, 151, 151, 0.1);
  504. padding-top: 24rpx;
  505. .price {
  506. color: #f83224;
  507. font-weight: 600;
  508. }
  509. ._text-1 {
  510. font-size: 26rpx;
  511. }
  512. }
  513. }
  514. .address {
  515. padding: 36rpx 34rpx;
  516. background-color: #fff;
  517. border-radius: 10rpx;
  518. margin-top: 32rpx;
  519. .name-phone {
  520. display: flex;
  521. align-items: flex-end;
  522. .send {
  523. width: 40rpx;
  524. height: 40rpx;
  525. background-color: #000;
  526. color: #fff;
  527. border-radius: 50%;
  528. font-size: 22rpx;
  529. text-align: center;
  530. line-height: 40rpx;
  531. }
  532. .name {
  533. font-weight: 600;
  534. font-size: 30rpx;
  535. color: #222;
  536. margin-right: 28rpx;
  537. margin-left: 28rpx;
  538. }
  539. .phone {
  540. font-size: 24rpx;
  541. color: #777;
  542. }
  543. }
  544. .address-detail {
  545. font-size: 26rpx;
  546. color: #555;
  547. margin-top: 16rpx;
  548. margin-left: 60rpx;
  549. padding-bottom: 36rpx;
  550. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  551. margin-bottom: 34rpx;
  552. }
  553. ._bottom {
  554. border: none;
  555. margin-bottom: 0;
  556. }
  557. ._label-list {
  558. display: flex;
  559. flex-wrap: wrap;
  560. justify-content: space-between;
  561. .information {
  562. width: 49%;
  563. margin-bottom: 28rpx;
  564. font-size: 28rpx;
  565. }
  566. ._label {
  567. color: #666;
  568. font-size: 28rpx;
  569. }
  570. ._value {
  571. font-size: 28rpx;
  572. color: #333;
  573. }
  574. }
  575. }
  576. .num-information {
  577. background-color: #fff;
  578. border-radius: 16rpx;
  579. margin-top: 20rpx;
  580. padding: 28rpx 20rpx 2rpx 28rpx;
  581. .order {
  582. display: flex;
  583. justify-content: space-between;
  584. font-size: 28rpx;
  585. margin-bottom: 28rpx;
  586. ._label-1 {
  587. color: #666;
  588. }
  589. .num {
  590. color: #333;
  591. }
  592. }
  593. }
  594. .pay {
  595. display: flex;
  596. padding: 22rpx 28rpx;
  597. justify-content: space-between;
  598. margin-top: 20rpx;
  599. background-color: #fff;
  600. border-radius: 16rpx;
  601. }
  602. .footer {
  603. display: flex;
  604. justify-content: flex-end;
  605. background-color: #fff;
  606. position: fixed;
  607. bottom: 0;
  608. left: 0;
  609. width: 100%;
  610. height: 146rpx;
  611. padding-top: 20rpx;
  612. .btn-1 {
  613. height: 76rpx;
  614. padding: 0;
  615. margin: 0;
  616. font-size: 28rpx;
  617. color: #222;
  618. min-width: 188rpx;
  619. background-color: #fff;
  620. border-radius: 38rpx;
  621. border: 2rpx solid #979797;
  622. margin-right: 20rpx;
  623. }
  624. .btn-2 {
  625. height: 76rpx;
  626. padding: 0;
  627. margin: 0;
  628. font-size: 28rpx;
  629. color: #fff;
  630. min-width: 188rpx;
  631. background-color: #f83224;
  632. border-radius: 38rpx;
  633. margin-right: 20rpx;
  634. }
  635. }
  636. }
  637. </style>