orderInformation.vue 19 KB

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