index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <view>
  3. <!-- #ifdef MP || APP -->
  4. <NavBar
  5. titleText="订单详情"
  6. :iconColor="iconColor"
  7. :textColor="iconColor"
  8. :isScrolling="isScrolling"
  9. showBack
  10. ></NavBar>
  11. <!-- #endif -->
  12. <view class="headerBg"></view>
  13. <view class="order-details pos-order-details">
  14. <view class="address">
  15. <view v-if="orderInfo.store" class="box acea-row row-middle">
  16. <view class="left">
  17. <view class="text">{{ orderInfo.store.name }}</view>
  18. <view
  19. class="acea-row row-between-wrapper"
  20. @click="
  21. showMaoLocation(
  22. system_store.latitude,
  23. system_store.longitude,
  24. system_store.name,
  25. system_store.detailed_address,
  26. )
  27. "
  28. >
  29. <span class="txt">{{ orderInfo.store.detailed_address }}</span>
  30. <span class="iconfont icon-xiangyou"></span>
  31. </view>
  32. </view>
  33. <view>
  34. <view
  35. class="iconfont icon-tonghua marrt"
  36. @click="makePhone(system_store.phone)"
  37. ></view>
  38. </view>
  39. </view>
  40. <view class="box acea-row row-middle">
  41. <view class="text-box">
  42. <view class="text"
  43. ><text class="iconfont icon-ic_receiving"></text
  44. >{{ orderInfo.nickname }} {{ orderInfo.user_phone }}</view
  45. >
  46. <view class="acea-row row-between-wrapper">
  47. 地址:{{ orderInfo.user_address }}
  48. </view>
  49. </view>
  50. <view class="btn" @click.stop="makePhone(orderInfo.user_phone)">
  51. <text class="iconfont icon-ic_phone"></text>
  52. </view>
  53. <view
  54. class="btn"
  55. @click.stop="
  56. showMaoLocation(
  57. orderInfo.latitude,
  58. orderInfo.longitude,
  59. orderInfo.nickname,
  60. orderInfo.user_address,
  61. )
  62. "
  63. >
  64. <text class="iconfont icon-ic_location"></text>
  65. </view>
  66. </view>
  67. <view class="line">
  68. <image src="/static/images/line.jpg" />
  69. </view>
  70. </view>
  71. <view class="goods-section">
  72. <view class="">订单号:{{ orderInfo.order_id }}</view>
  73. <view
  74. class="goods acea-row"
  75. v-for="(item, index) in orderInfo.cartInfo"
  76. :key="index"
  77. >
  78. <view class="picTxt acea-row">
  79. <image :src="item.productInfo.image" class="pictrue"></image>
  80. <view class="text">
  81. <view class="info line1">
  82. {{ item.productInfo.store_name }}
  83. </view>
  84. <view class="attr line1">{{
  85. item.productInfo.attrInfo.suk
  86. }}</view>
  87. <view class="label">7天无理由退换货·放心购</view>
  88. </view>
  89. </view>
  90. <view class="money">
  91. <baseMoney
  92. :money="item.productInfo.attrInfo.price"
  93. symbolSize="20"
  94. integerSize="32"
  95. decimalSize="20"
  96. ></baseMoney>
  97. <view class="num">共{{ item.cart_num }}件</view>
  98. </view>
  99. </view>
  100. <view class="giveGoods">
  101. <view
  102. class="item acea-row row-between-wrapper"
  103. v-for="(item, index) in giveCartInfo"
  104. :key="index"
  105. >
  106. <view class="picTxt acea-row row-middle">
  107. <view class="pictrue">
  108. <image
  109. :src="item.productInfo.attrInfo.image"
  110. v-if="item.productInfo.attrInfo"
  111. ></image>
  112. <image :src="item.productInfo.image" v-else></image>
  113. </view>
  114. <view class="texts">
  115. <view class="name line1"
  116. >[赠品]{{ item.productInfo.store_name }}</view
  117. >
  118. <view class="limit line1" v-if="item.productInfo.attrInfo">{{
  119. item.productInfo.attrInfo.suk
  120. }}</view>
  121. </view>
  122. </view>
  123. <view class="num">x{{ item.cart_num }}</view>
  124. </view>
  125. <view
  126. class="item acea-row row-between-wrapper"
  127. v-for="(item, index) in giveData.give_coupon"
  128. :key="index"
  129. v-if="giveData.give_coupon.length"
  130. >
  131. <view class="picTxt acea-row row-middle">
  132. <view class="pictrue acea-row row-center-wrapper">
  133. <text class="iconfont icon-pc-youhuiquan"></text>
  134. </view>
  135. <view class="texts">
  136. <view class="line1">[赠品]{{ item.coupon_title }}</view>
  137. </view>
  138. </view>
  139. </view>
  140. <view
  141. class="item acea-row row-between-wrapper"
  142. v-if="giveData.give_integral > 0"
  143. >
  144. <view class="picTxt acea-row row-middle">
  145. <view class="pictrue acea-row row-center-wrapper">
  146. <text class="iconfont icon-pc-jifen"></text>
  147. </view>
  148. <view class="texts">
  149. <view class="line1"
  150. >[赠品]{{ giveData.give_integral }}积分</view
  151. >
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="detail-section">
  158. <view class="item acea-row row-between">
  159. <view>订单编号</view>
  160. <view class="conter acea-row row-middle row-right">
  161. {{ orderInfo.order_id }}
  162. <span class="copy copy-data" @click="copyNum(orderInfo.order_id)"
  163. >复制</span
  164. >
  165. </view>
  166. </view>
  167. <view class="item acea-row row-between">
  168. <view>支付方式</view>
  169. <view class="conter">{{ payType }}</view>
  170. </view>
  171. <view class="item acea-row row-between">
  172. <view>支付时间</view>
  173. <view class="conter">{{ orderInfo._pay_time }}</view>
  174. </view>
  175. <view class="item acea-row row-between">
  176. <view>下单时间</view>
  177. <view class="conter">{{ orderInfo._add_time }}</view>
  178. </view>
  179. <view class="item acea-row row-between" v-if="orderInfo._status">
  180. <view>配送方式</view>
  181. <view class="conter">{{ orderInfo._status._deliveryType }}</view>
  182. </view>
  183. <view class="item acea-row row-between">
  184. <view>买家留言</view>
  185. <view class="conter">{{ orderInfo.mark }}</view>
  186. </view>
  187. </view>
  188. <customForm :customForm="orderInfo.custom_form"></customForm>
  189. <view class="wrapper topnone">
  190. <view class="item acea-row row-between">
  191. <view>商品总价:</view>
  192. <view class="conter"
  193. >¥{{
  194. (
  195. parseFloat(orderInfo.total_price) +
  196. parseFloat(orderInfo.vip_true_price)
  197. ).toFixed(2)
  198. }}</view
  199. >
  200. </view>
  201. <view
  202. class="item acea-row row-between"
  203. v-if="orderInfo.coupon_price > 0"
  204. >
  205. <view>优惠券抵扣:</view>
  206. <view class="conter">-¥{{ orderInfo.coupon_price }}</view>
  207. </view>
  208. <view
  209. v-if="orderInfo.pay_postage > 0"
  210. class="item acea-row row-between"
  211. >
  212. <view>运费:</view>
  213. <view class="conter">¥{{ orderInfo.pay_postage }}</view>
  214. </view>
  215. <view
  216. class="item acea-row row-between"
  217. v-if="orderInfo.deduction_price > 0"
  218. >
  219. <view>积分抵扣金额:</view>
  220. <view class="conter">-¥{{ orderInfo.deduction_price }}</view>
  221. </view>
  222. <view
  223. class="item acea-row row-between"
  224. v-if="orderInfo.vip_true_price > 0"
  225. >
  226. <view>会员商品优惠:</view>
  227. <view class="conter">-¥{{ orderInfo.vip_true_price }}</view>
  228. </view>
  229. <view
  230. class="item acea-row row-between"
  231. v-for="(item, index) in orderInfo.promotions_detail"
  232. :key="index"
  233. v-if="parseFloat(item.promotions_price)"
  234. >
  235. <view>{{ item.title }}:</view>
  236. <view class="conter"
  237. >-¥{{ parseFloat(item.promotions_price).toFixed(2) }}</view
  238. >
  239. </view>
  240. <view class="actualPay acea-row row-right">
  241. 实付款:
  242. <!-- <span class="money">¥{{ orderInfo.pay_price }}</span> -->
  243. <baseMoney
  244. :money="orderInfo.pay_price"
  245. symbolSize="24"
  246. integerSize="40"
  247. decimalSize="24"
  248. color="#FF7E00"
  249. ></baseMoney>
  250. </view>
  251. </view>
  252. <view class="height-add"></view>
  253. </view>
  254. </view>
  255. </template>
  256. <script>
  257. import customForm from "../../components/customForm";
  258. // #ifdef MP || APP
  259. import NavBar from "@/components/NavBar.vue";
  260. // #endif
  261. import { OrderDetail } from "@/api/admin";
  262. import { isMoney } from "@/utils/validate.js";
  263. export default {
  264. name: "orderDetail",
  265. components: {
  266. customForm,
  267. // #ifdef MP || APP
  268. NavBar,
  269. // #endif
  270. },
  271. props: {},
  272. data: function () {
  273. return {
  274. giveData: {
  275. give_integral: 0,
  276. give_coupon: [],
  277. },
  278. giveCartInfo: [],
  279. order: false,
  280. change: false,
  281. order_id: "",
  282. orderInfo: "",
  283. status: "",
  284. title: "",
  285. payType: "",
  286. types: "",
  287. clickNum: 1,
  288. goname: "",
  289. system_store: "",
  290. sum: 0,
  291. // #ifdef MP || APP
  292. iconColor: "#FFFFFF",
  293. isScrolling: false,
  294. // #endif
  295. };
  296. },
  297. watch: {
  298. "$route.params.oid": function (newVal) {
  299. let that = this;
  300. if (newVal != undefined) {
  301. that.order_id = newVal;
  302. that.getIndex();
  303. }
  304. },
  305. },
  306. onLoad: function (option) {
  307. let self = this;
  308. this.order_id = option.id;
  309. this.goname = option.goname;
  310. this.getIndex();
  311. },
  312. onPageScroll(e) {
  313. // #ifdef MP
  314. if (e.scrollTop > 50) {
  315. this.isScrolling = true;
  316. this.iconColor = "#333333";
  317. } else if (e.scrollTop < 50) {
  318. this.isScrolling = false;
  319. this.iconColor = "#FFFFFF";
  320. }
  321. // #endif
  322. },
  323. methods: {
  324. more: function () {
  325. this.order = !this.order;
  326. },
  327. modify: function (status) {
  328. this.change = true;
  329. this.status = status;
  330. },
  331. changeclose: function (msg) {
  332. this.change = msg;
  333. },
  334. getIndex: function () {
  335. let that = this;
  336. OrderDetail(that.order_id).then(
  337. (res) => {
  338. that.sum = (
  339. parseFloat(res.data.total_price) +
  340. parseFloat(res.data.vip_true_price)
  341. ).toFixed(2);
  342. that.types = res.data._status._type;
  343. that.title = res.data._status._title;
  344. that.payType = res.data._status._payType;
  345. this.system_store = res.data.store;
  346. that.giveData.give_coupon = res.data.give_coupon;
  347. that.giveData.give_integral = res.data.give_integral;
  348. let cartObj = [],
  349. giftObj = [];
  350. res.data.cartInfo.forEach((item, index) => {
  351. if (item.is_gift == 1) {
  352. giftObj.push(item);
  353. } else {
  354. cartObj.push(item);
  355. }
  356. });
  357. res.data.cartInfo = cartObj;
  358. that.$set(that, "giveCartInfo", giftObj);
  359. let arr = [];
  360. for (let i = 0; i < res.data.user_address.length; i++) {
  361. if (res.data.user_address[i] != " ") {
  362. arr.push(res.data.user_address[i]);
  363. }
  364. }
  365. res.data.user_address = arr.join("");
  366. that.orderInfo = res.data;
  367. },
  368. (err) => {
  369. // that.$util.Tips({
  370. // title: err
  371. // }, {
  372. // tab: 3,
  373. // url: 1
  374. // });
  375. },
  376. );
  377. },
  378. //打开地图
  379. showMaoLocation: function (latitude, longitude, name, detailed_address) {
  380. if (!latitude || !longitude)
  381. return this.$util.Tips({
  382. title: "缺少经纬度信息无法查看地图!",
  383. });
  384. uni.openLocation({
  385. latitude: parseFloat(latitude),
  386. longitude: parseFloat(longitude),
  387. scale: 8,
  388. name: name,
  389. address: detailed_address,
  390. success: function () {},
  391. });
  392. },
  393. //拨打电话
  394. makePhone: function (phone) {
  395. uni.makePhoneCall({
  396. phoneNumber: phone,
  397. });
  398. },
  399. copyNum(id) {
  400. uni.setClipboardData({
  401. data: id,
  402. });
  403. },
  404. // #ifdef H5
  405. webCopy(item, index) {
  406. let items = item;
  407. let indexs = index;
  408. let self = this;
  409. if (self.clickNum == 1) {
  410. self.clickNum += 1;
  411. self.webCopy(items, indexs);
  412. }
  413. },
  414. // #endif
  415. },
  416. };
  417. </script>
  418. <style lang="scss" scoped>
  419. .headerBg {
  420. position: absolute;
  421. top: 0;
  422. left: 0;
  423. width: 100%;
  424. height: 506rpx;
  425. background:
  426. linear-gradient(360deg, #f5f5f5 0%, rgba(245, 245, 245, 0) 100%),
  427. linear-gradient(-90deg, $gradient-primary-admin 0%, $primary-admin 100%);
  428. background-position:
  429. left bottom,
  430. left top;
  431. background-repeat: no-repeat;
  432. background-size:
  433. 100% 120rpx,
  434. 100% 100%;
  435. }
  436. .order-details {
  437. position: relative;
  438. padding: 32rpx 20rpx;
  439. .address {
  440. position: relative;
  441. padding: 32rpx 24rpx 28rpx 32rpx;
  442. border-radius: 24rpx;
  443. background: #ffffff;
  444. overflow: hidden;
  445. .text-box {
  446. flex: 1;
  447. font-size: 24rpx;
  448. line-height: 34rpx;
  449. color: #999999;
  450. }
  451. .text {
  452. margin-bottom: 12rpx;
  453. font-weight: 500;
  454. font-size: 30rpx;
  455. line-height: 42rpx;
  456. color: #333333;
  457. .iconfont {
  458. font-size: 32rpx;
  459. margin-right: 20rpx;
  460. }
  461. }
  462. .btn {
  463. width: 56rpx;
  464. height: 56rpx;
  465. border-radius: 50%;
  466. margin-left: 24rpx;
  467. background: rgba(42, 126, 251, 0.1);
  468. text-align: center;
  469. line-height: 56rpx;
  470. .iconfont {
  471. font-size: 28rpx;
  472. color: #2a7efb;
  473. }
  474. }
  475. .line {
  476. position: absolute;
  477. bottom: 0;
  478. left: 0;
  479. width: 100%;
  480. }
  481. }
  482. .goods-section {
  483. padding: 32rpx 24rpx;
  484. border-radius: 24rpx;
  485. margin-top: 20rpx;
  486. background: #ffffff;
  487. .goods {
  488. margin-top: 32rpx;
  489. &:first-child {
  490. margin-top: 0;
  491. }
  492. }
  493. .picTxt {
  494. flex: 1;
  495. min-width: 0;
  496. }
  497. .pictrue {
  498. width: 136rpx;
  499. height: 136rpx;
  500. border-radius: 16rpx;
  501. }
  502. .text {
  503. flex: 1;
  504. min-width: 0;
  505. padding: 0 20rpx;
  506. }
  507. .info {
  508. font-size: 28rpx;
  509. line-height: 40rpx;
  510. color: #333333;
  511. }
  512. .attr {
  513. margin-top: 8rpx;
  514. font-size: 24rpx;
  515. line-height: 34rpx;
  516. color: #999999;
  517. }
  518. .label {
  519. display: inline-flex;
  520. align-items: center;
  521. height: 26rpx;
  522. padding: 0 6rpx;
  523. border: 1rpx solid #ff7e00;
  524. border-radius: 4rpx;
  525. margin-top: 12rpx;
  526. font-size: 18rpx;
  527. line-height: 26rpx;
  528. color: #ff7e00;
  529. }
  530. .money {
  531. text-align: right;
  532. }
  533. .num {
  534. margin-top: 10rpx;
  535. font-size: 24rpx;
  536. line-height: 34rpx;
  537. color: #999999;
  538. }
  539. }
  540. .detail-section {
  541. padding: 32rpx 24rpx;
  542. border-radius: 24rpx;
  543. margin-top: 20rpx;
  544. background: #ffffff;
  545. .item {
  546. margin-top: 24rpx;
  547. font-size: 28rpx;
  548. line-height: 40rpx;
  549. color: #333333;
  550. &:first-child {
  551. margin-top: 0;
  552. }
  553. }
  554. }
  555. }
  556. .mt28 {
  557. margin-top: 28rpx;
  558. }
  559. .height-add {
  560. height: 120upx;
  561. }
  562. .giveGoods {
  563. .item {
  564. padding: 14rpx 0;
  565. border-top: 1px solid #eee;
  566. .picTxt {
  567. .pictrue {
  568. width: 76rpx;
  569. height: 76rpx;
  570. border-radius: 6rpx;
  571. background-color: #f5f5f5;
  572. color: $primary-admin;
  573. .iconfont {
  574. font-size: 34rpx;
  575. }
  576. image {
  577. width: 100%;
  578. height: 100%;
  579. border-radius: 6rpx;
  580. }
  581. margin-right: 16rpx;
  582. }
  583. .texts {
  584. width: 360rpx;
  585. color: #999999;
  586. font-size: 20rpx;
  587. .name {
  588. color: #333;
  589. }
  590. .limit {
  591. font-size: 20rpx;
  592. margin-top: 4rpx;
  593. }
  594. }
  595. }
  596. .num {
  597. color: #999999;
  598. font-size: 20rpx;
  599. }
  600. }
  601. }
  602. .order-details .line {
  603. width: 100%;
  604. height: 3upx;
  605. }
  606. .order-details .line image {
  607. width: 100%;
  608. height: 100%;
  609. display: block;
  610. }
  611. .order-details .wrapper {
  612. background: #ffffff;
  613. }
  614. .order-details .topnone {
  615. padding: 32rpx 24rpx;
  616. border-radius: 24rpx;
  617. margin-top: 20rpx;
  618. }
  619. .order-details .wrapper .title {
  620. height: 100upx;
  621. display: flex;
  622. justify-content: space-between;
  623. align-items: center;
  624. border-bottom: 1upx solid #eeeeee;
  625. margin-bottom: 34upx;
  626. }
  627. .order-details .wrapper .title .font {
  628. font-size: 32upx;
  629. font-weight: 600;
  630. color: #282828;
  631. }
  632. .order-details .wrapper .title .mapbtn {
  633. width: 176upx;
  634. height: 56upx;
  635. border: 1upx solid #1890ff;
  636. border-radius: 28upx;
  637. text-align: center;
  638. line-height: 50upx;
  639. color: #1890ff;
  640. font-size: 26upx;
  641. }
  642. .order-details .wrapper .item {
  643. font-size: 28upx;
  644. color: #282828;
  645. }
  646. .order-details .wrapper .item ~ .item {
  647. margin-top: 26rpx;
  648. }
  649. .order-details .wrapper .item .conter {
  650. color: #868686;
  651. /* width: 500upx; */
  652. text-align: right;
  653. }
  654. .order-details .wrapper .item .conter .copy {
  655. font-size: 20rpx;
  656. color: #333;
  657. border-radius: 3rpx;
  658. border: 1px solid #666;
  659. padding: 0rpx 15rpx;
  660. margin-left: 10rpx;
  661. height: 40rpx;
  662. line-height: 38upx;
  663. }
  664. .order-details .wrapper .actualPay {
  665. // border-top: 1upx solid #eee;
  666. margin-top: 26rpx;
  667. // padding-top: 30upx;
  668. }
  669. .order-details .wrapper .actualPay .money {
  670. font-weight: bold;
  671. font-size: 30upx;
  672. color: #ff7e00;
  673. }
  674. .copy-data {
  675. width: 68rpx;
  676. height: 36rpx;
  677. border-radius: 18rpx;
  678. margin-left: 8rpx;
  679. background: #f5f5f5;
  680. text-align: center;
  681. font-size: 22rpx;
  682. line-height: 36rpx;
  683. color: #333333;
  684. }
  685. </style>