orderInformation.vue 20 KB

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