orderInformation.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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.gap_price.split(".")[0] }}</text
  69. >.
  70. <text style="font-size: 20rpx">{{
  71. orderInformation.gap_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_cn }}</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 class="order" v-if="isShowPayTime">
  140. <text class="_label-1">付款时间</text>
  141. <view class="num"> {{ orderInformation.paid_at }} </view>
  142. </view>
  143. <view
  144. class="order"
  145. v-if="
  146. (orderInformation.status == 'overseas_delivered' &&
  147. orderInformation.status != 'domestic_delivered') ||
  148. orderInformation.status == 'finished'
  149. "
  150. >
  151. <text class="_label-1">发货时间</text>
  152. <view class="num"> {{ orderInformation.domestic_delivered_at }} </view>
  153. </view>
  154. <view class="order" v-if="orderInformation.status == 'finished'">
  155. <text class="_label-1">签收时间</text>
  156. <view class="num"> {{ orderInformation.overseas_received_at }} </view>
  157. </view>
  158. </view>
  159. <view
  160. class="pay"
  161. v-if="
  162. orderInformation.status != 'group_unpaid' &&
  163. orderInformation.status != 'unpaid'
  164. "
  165. >
  166. <text>{{
  167. orderInformation.status == "group_unpaid" ||
  168. orderInformation.status == "unpaid"
  169. ? "待付"
  170. : "已付"
  171. }}</text>
  172. <text style="color: #f83224; font-weight: 600">{{
  173. orderInformation.actual_price || orderInformation.estimated_price
  174. }}</text>
  175. </view>
  176. <view
  177. class="footer"
  178. v-if="
  179. orderInformation.status == 'domestic_delivered' ||
  180. orderInformation.status == 'overseas_delivered' ||
  181. orderInformation.status == 'finished'
  182. "
  183. >
  184. <button
  185. class="btn-1"
  186. @click="toLogistics"
  187. v-if="orderInformation.status == 'finished'"
  188. >
  189. 删除
  190. </button>
  191. <button class="btn-1" @click="toLogistics">查看物流</button>
  192. <button
  193. class="btn-1"
  194. @click="fillInformation"
  195. v-if="orderInformation.status == 'domestic_undelivered'"
  196. >
  197. 填写物流信息
  198. </button>
  199. <button
  200. class="btn-2"
  201. @click="toPay"
  202. v-if="orderInformation.status == 'unpaid'"
  203. >
  204. 立即付款
  205. </button>
  206. </view>
  207. <view
  208. class="footer"
  209. v-else-if="
  210. orderInformation.status == 'domestic_undelivered' ||
  211. orderInformation.status == 'unpaid' ||
  212. orderInformation.status == 'group_unpaid'
  213. "
  214. >
  215. <button
  216. class="btn-1"
  217. @click="fillInformation"
  218. v-if="
  219. orderInformation.type == 'mall_order' &&
  220. orderInformation.status == 'domestic_undelivered'
  221. "
  222. >
  223. 填写物流信息
  224. </button>
  225. <button
  226. class="btn-2"
  227. @click="toSending"
  228. v-if="
  229. (orderInformation.type == 'group_package' ||
  230. orderInformation.type == 'express_order') &&
  231. orderInformation.status == 'domestic_undelivered'
  232. "
  233. >
  234. 去寄件
  235. </button>
  236. <button
  237. class="btn-2"
  238. @click="toPay"
  239. v-if="
  240. orderInformation.status == 'unpaid' ||
  241. orderInformation.status == 'group_unpaid'
  242. "
  243. >
  244. 立即付款
  245. </button></view
  246. >
  247. <Fill :show="show" @close="close" />
  248. </view>
  249. </template>
  250. <script>
  251. import Fill from "./component/fill.vue";
  252. export default {
  253. components: {
  254. Fill,
  255. },
  256. data() {
  257. return {
  258. orderStauts: 0,
  259. orderTitle: "",
  260. orderDetail: "",
  261. packageId: "",
  262. orderInformation: {},
  263. show: false,
  264. };
  265. },
  266. computed: {
  267. //判断是否显示付款时间
  268. isShowPayTime() {
  269. if (
  270. this.orderInformation.type == "group_package" ||
  271. this.orderInformation.type == "mall_order"
  272. ) {
  273. if (
  274. this.orderInformation.status == "packaging" ||
  275. this.orderInformation.status == "group_unpaid" ||
  276. this.orderInformation.status == "unpaid"
  277. ) {
  278. return false;
  279. } else {
  280. return true;
  281. }
  282. } else if (
  283. this.orderInformation.status == "domestic_undelivered" ||
  284. this.orderInformation.status == "domestic_delivered" ||
  285. this.orderInformation.status == "domestic_received"
  286. ) {
  287. return false;
  288. }
  289. },
  290. },
  291. onLoad(options) {
  292. this.orderStauts = options.orderStatus;
  293. this.getDetail();
  294. },
  295. onShow() {
  296. this.getDetail();
  297. },
  298. created() {},
  299. methods: {
  300. cope(str) {
  301. uni.setClipboardData({
  302. data: str,
  303. success() {
  304. uni.showToast({
  305. title: "复制成功",
  306. icon: "none",
  307. });
  308. },
  309. });
  310. },
  311. //去寄件
  312. toSending() {
  313. uni.navigateTo({
  314. url: "/pageD/sending/sending?orderId=" + this.orderInformation.id,
  315. });
  316. },
  317. setStatus(num) {
  318. this.orderStauts = num;
  319. },
  320. //查看物流进度
  321. toLogistics() {
  322. uni.navigateTo({
  323. url: "/pageD/logisticsProgress/logisticsProgress",
  324. });
  325. },
  326. //填写物流信息
  327. fillInformation() {
  328. this.show = true;
  329. },
  330. //关闭弹窗
  331. close(value) {
  332. this.show = false;
  333. if (value.expressCode) {
  334. uni.$u.http
  335. .post(`/api/express-order/delivery/${this.orderInformation.id}`, {
  336. domestic_logistics_company_code: value.expressCode,
  337. domestic_logistics_no: value.expressNum,
  338. })
  339. .then((res) => {
  340. this.getDetail();
  341. uni.showToast({
  342. title: "已保存",
  343. });
  344. });
  345. }
  346. },
  347. //去支付
  348. toPay() {
  349. uni.navigateTo({
  350. url: `/pageD/paymentOrder/paymentOrder?money=${this.orderInformation.gap_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}`,
  351. });
  352. },
  353. getDetail() {
  354. uni.$u.http.get(`/api/express-order/${this.orderStauts}`).then((res) => {
  355. this.orderInformation = res;
  356. if (this.orderInformation.status == "domestic_delivered") {
  357. //设置顶部标题栏颜色
  358. uni.setNavigationBarColor({
  359. frontColor: "#000000",
  360. backgroundColor: "#f4f4f4",
  361. });
  362. this.orderDetail = "商品已寄往平台,正在运输中";
  363. this.orderTitle = this.orderInformation.status_text;
  364. } else if (this.orderInformation.status == "unpaid") {
  365. //设置顶部标题栏颜色
  366. uni.setNavigationBarColor({
  367. frontColor: "#000000",
  368. backgroundColor: "#f4f4f4",
  369. });
  370. this.orderDetail = "商品已打包称重,等待用户付款";
  371. this.orderTitle = this.orderInformation.status_text;
  372. } else if (this.orderInformation.status == "overseas_undelivered") {
  373. //设置顶部标题栏颜色
  374. uni.setNavigationBarColor({
  375. frontColor: "#000000",
  376. backgroundColor: "#f4f4f4",
  377. });
  378. this.orderDetail = "等待平台发货";
  379. this.orderTitle = this.orderInformation.status_text;
  380. } else if (this.orderInformation.status == "overseas_delivered") {
  381. //设置顶部标题栏颜色
  382. uni.setNavigationBarColor({
  383. frontColor: "#000000",
  384. backgroundColor: "#f4f4f4",
  385. });
  386. this.orderDetail = "商品已发出,很快将发货至您的手中";
  387. this.orderTitle = this.orderInformation.status_text;
  388. } else if (this.orderStauts == 4) {
  389. //设置顶部标题栏颜色
  390. uni.setNavigationBarColor({
  391. frontColor: "#000000",
  392. backgroundColor: "#ffffff",
  393. });
  394. uni.setNavigationBarTitle({
  395. title: "拼包详情",
  396. });
  397. } else if (
  398. this.orderInformation.status == "finished" ||
  399. this.orderInformation.status == "overseas_received"
  400. ) {
  401. //设置顶部标题栏颜色
  402. uni.setNavigationBarColor({
  403. frontColor: "#000000",
  404. backgroundColor: "#f4f4f4",
  405. });
  406. this.orderDetail = "订单签收,交易已完成";
  407. this.orderTitle = this.orderInformation.status_text;
  408. } else if (this.orderInformation.status == "domestic_received") {
  409. //设置顶部标题栏颜色
  410. uni.setNavigationBarColor({
  411. frontColor: "#000000",
  412. backgroundColor: "#f4f4f4",
  413. });
  414. this.orderDetail = "等待中转称重发出";
  415. this.orderTitle = this.orderInformation.status_text;
  416. } else if (this.orderInformation.status == "closed") {
  417. //设置顶部标题栏颜色
  418. uni.setNavigationBarColor({
  419. frontColor: "#000000",
  420. backgroundColor: "#f4f4f4",
  421. });
  422. this.orderDetail = "订单关闭";
  423. this.orderTitle = this.orderInformation.status_text;
  424. } else if (this.orderInformation.status == "refunded") {
  425. //设置顶部标题栏颜色
  426. uni.setNavigationBarColor({
  427. frontColor: "#000000",
  428. backgroundColor: "#f4f4f4",
  429. });
  430. this.orderDetail = "订单已退款";
  431. this.orderTitle = this.orderInformation.status_text;
  432. } else if (this.orderInformation.status == "refunding") {
  433. //设置顶部标题栏颜色
  434. uni.setNavigationBarColor({
  435. frontColor: "#000000",
  436. backgroundColor: "#f4f4f4",
  437. });
  438. this.orderDetail = "订单正在申请退款";
  439. this.orderTitle = this.orderInformation.status_text;
  440. } else if (this.orderInformation.status == "domestic_undelivered") {
  441. //设置顶部标题栏颜色
  442. uni.setNavigationBarColor({
  443. frontColor: "#000000",
  444. backgroundColor: "#f4f4f4",
  445. });
  446. this.orderDetail = "商品等待发货中";
  447. this.orderTitle = this.orderInformation.status_text;
  448. }
  449. });
  450. },
  451. },
  452. };
  453. </script>
  454. <style lang="scss" scoped>
  455. .page {
  456. padding: 20rpx 24rpx;
  457. position: relative;
  458. padding-bottom: 186rpx;
  459. .title {
  460. font-size: 44rpx;
  461. color: #222;
  462. font-weight: 600;
  463. }
  464. .prompt {
  465. font-size: 24rpx;
  466. color: rgba(34, 34, 34, 0.5);
  467. margin-top: 12rpx;
  468. }
  469. .packaging {
  470. border-radius: 16rpx;
  471. background-color: #fff;
  472. padding: 30rpx 20rpx;
  473. .packaging-top {
  474. display: flex;
  475. justify-content: space-between;
  476. font-size: 28rpx;
  477. color: #222;
  478. }
  479. .packaging-center {
  480. display: flex;
  481. justify-content: space-around;
  482. align-items: center;
  483. margin-top: 26rpx;
  484. background-color: #f5f5f5;
  485. border-radius: 10rpx;
  486. padding: 20rpx 0;
  487. .jiantou {
  488. width: 130rpx;
  489. height: 10rpx;
  490. }
  491. .packaging-left {
  492. text-align: center;
  493. .left-top {
  494. font-size: 32rpx;
  495. color: #222;
  496. font-weight: 600;
  497. }
  498. .left-bottom {
  499. margin-top: 10rpx;
  500. font-size: 24rpx;
  501. color: rgba(34, 34, 34, 0.5);
  502. }
  503. }
  504. }
  505. .packaging-time {
  506. font-size: 28rpx;
  507. display: flex;
  508. align-items: center;
  509. margin-top: 28rpx;
  510. }
  511. }
  512. .photo {
  513. background-color: #fff;
  514. border-radius: 16rpx;
  515. padding: 20rpx 20rpx;
  516. margin-top: 20rpx;
  517. ._weight {
  518. display: flex;
  519. justify-content: space-between;
  520. font-size: 26rpx;
  521. color: rgba(34, 34, 34, 0.8);
  522. margin-bottom: 32rpx;
  523. ._image {
  524. width: 160rpx;
  525. height: 90rpx;
  526. // background-color: #d8d8d8;
  527. border-radius: 4rpx;
  528. }
  529. }
  530. .photo-bottom {
  531. display: flex;
  532. justify-content: flex-end;
  533. align-items: center;
  534. border-top: 2rpx solid rgba(151, 151, 151, 0.1);
  535. padding-top: 24rpx;
  536. .price {
  537. color: #f83224;
  538. font-weight: 600;
  539. }
  540. ._text-1 {
  541. font-size: 26rpx;
  542. }
  543. }
  544. }
  545. .address {
  546. padding: 36rpx 34rpx;
  547. background-color: #fff;
  548. border-radius: 10rpx;
  549. margin-top: 32rpx;
  550. .name-phone {
  551. display: flex;
  552. align-items: flex-end;
  553. .send {
  554. width: 40rpx;
  555. height: 40rpx;
  556. background-color: #000;
  557. color: #fff;
  558. border-radius: 50%;
  559. font-size: 22rpx;
  560. text-align: center;
  561. line-height: 40rpx;
  562. }
  563. .name {
  564. font-weight: 600;
  565. font-size: 30rpx;
  566. color: #222;
  567. margin-right: 28rpx;
  568. margin-left: 28rpx;
  569. }
  570. .phone {
  571. font-size: 24rpx;
  572. color: #777;
  573. }
  574. }
  575. .address-detail {
  576. font-size: 26rpx;
  577. color: #555;
  578. margin-top: 16rpx;
  579. margin-left: 60rpx;
  580. padding-bottom: 36rpx;
  581. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  582. margin-bottom: 34rpx;
  583. }
  584. ._bottom {
  585. border: none;
  586. margin-bottom: 0;
  587. }
  588. ._label-list {
  589. display: flex;
  590. flex-wrap: wrap;
  591. justify-content: space-between;
  592. .information {
  593. width: 49%;
  594. margin-bottom: 28rpx;
  595. font-size: 28rpx;
  596. }
  597. ._label {
  598. color: #666;
  599. font-size: 28rpx;
  600. }
  601. ._value {
  602. font-size: 28rpx;
  603. color: #333;
  604. }
  605. }
  606. }
  607. .num-information {
  608. background-color: #fff;
  609. border-radius: 16rpx;
  610. margin-top: 20rpx;
  611. padding: 28rpx 20rpx 2rpx 28rpx;
  612. .order {
  613. display: flex;
  614. justify-content: space-between;
  615. font-size: 28rpx;
  616. margin-bottom: 28rpx;
  617. ._label-1 {
  618. color: #666;
  619. }
  620. .num {
  621. color: #333;
  622. }
  623. }
  624. }
  625. .pay {
  626. display: flex;
  627. padding: 22rpx 28rpx;
  628. justify-content: space-between;
  629. margin-top: 20rpx;
  630. background-color: #fff;
  631. border-radius: 16rpx;
  632. }
  633. .footer {
  634. display: flex;
  635. justify-content: flex-end;
  636. background-color: #fff;
  637. position: fixed;
  638. bottom: 0;
  639. left: 0;
  640. width: 100%;
  641. height: 146rpx;
  642. padding-top: 20rpx;
  643. .btn-1 {
  644. height: 76rpx;
  645. padding: 0;
  646. margin: 0;
  647. font-size: 28rpx;
  648. color: #222;
  649. min-width: 188rpx;
  650. background-color: #fff;
  651. border-radius: 38rpx;
  652. border: 2rpx solid #979797;
  653. margin-right: 20rpx;
  654. }
  655. .btn-2 {
  656. height: 76rpx;
  657. padding: 0;
  658. margin: 0;
  659. font-size: 28rpx;
  660. color: #fff;
  661. min-width: 188rpx;
  662. background-color: #f83224;
  663. border-radius: 38rpx;
  664. margin-right: 20rpx;
  665. }
  666. }
  667. }
  668. </style>