index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='order-details'>
  4. <view v-if="orderInfo && orderInfo.invoice" class='header bg-color acea-row row-middle'>
  5. <view class='iconfont icon-fapiao1'></view>
  6. <view class='data'>
  7. <view class='state'>{{orderInfo.invoice.is_invoice ? '已开票' : '未开票'}}</view>
  8. <view>{{orderInfo.invoice.add_time}}</view>
  9. </view>
  10. </view>
  11. <view v-if="orderInfo && orderInfo.invoice" class="wrapper">
  12. <view class="item acea-row row-between-wrapper">
  13. <view>发票类型</view>
  14. <view class="conter">{{orderInfo.invoice.type === 1 ? '增值税电子普通发票' : '增值税电子专用发票'}}</view>
  15. </view>
  16. <view class="item acea-row row-between-wrapper">
  17. <view>发票抬头</view>
  18. <view class="conter">{{orderInfo.invoice.name}}</view>
  19. </view>
  20. <view v-if="orderInfo.invoice.duty_number" class="item acea-row row-between-wrapper">
  21. <view>税号</view>
  22. <view class="conter">{{orderInfo.invoice.duty_number}}</view>
  23. </view>
  24. <view class="item acea-row row-between-wrapper">
  25. <view>手机号</view>
  26. <view class="conter">{{orderInfo.invoice.drawer_phone}}</view>
  27. </view>
  28. <view class="item acea-row row-between-wrapper">
  29. <view>邮箱</view>
  30. <view class="conter">{{orderInfo.invoice.email}}</view>
  31. </view>
  32. <template v-if="orderInfo.invoice.type === 2">
  33. <view class="item acea-row row-between-wrapper">
  34. <view>开户银行</view>
  35. <view class="conter">{{orderInfo.invoice.bank}}</view>
  36. </view>
  37. <view class="item acea-row row-between-wrapper">
  38. <view>银行账号</view>
  39. <view class="conter">{{orderInfo.invoice.card_number}}</view>
  40. </view>
  41. <view class="item acea-row row-between-wrapper">
  42. <view>企业地址</view>
  43. <view class="conter">{{orderInfo.invoice.address}}</view>
  44. </view>
  45. <view class="item acea-row row-between-wrapper">
  46. <view>企业电话</view>
  47. <view class="conter">{{orderInfo.invoice.tell}}</view>
  48. </view>
  49. </template>
  50. <view class="item acea-row row-between-wrapper" v-if='orderInfo.invoice.invoice_number'>
  51. <view>发票编号</view>
  52. <view class="conter">{{orderInfo.invoice.invoice_number}}</view>
  53. </view>
  54. <view class="item acea-row row-between-wrapper" v-if='orderInfo.invoice.remark'>
  55. <view>发票备注</view>
  56. <view class="conter">{{orderInfo.invoice.remark}}</view>
  57. </view>
  58. </view>
  59. <orderGoods :evaluate='evaluate' :orderId="order_id" :cartInfo="cartInfo" :jump="true"></orderGoods>
  60. <view class='wrapper'>
  61. <view class='item acea-row row-between'>
  62. <view>订单编号:</view>
  63. <view class='conter acea-row row-middle row-right'>{{orderInfo.order_id}}
  64. <!-- #ifndef H5 -->
  65. <text class='copy' @tap='copy'>复制</text>
  66. <!-- #endif -->
  67. <!-- #ifdef H5 -->
  68. <text class='copy copy-data' :data-clipboard-text="orderInfo.order_id">复制</text>
  69. <!-- #endif -->
  70. </view>
  71. </view>
  72. <view class='item acea-row row-between'>
  73. <view>下单时间:</view>
  74. <view class='conter'>{{(orderInfo.add_time_y || '') +' '+(orderInfo.add_time_h || 0)}}</view>
  75. </view>
  76. <view class='item acea-row row-between'>
  77. <view>支付状态:</view>
  78. <view class='conter' v-if="orderInfo.paid">已支付</view>
  79. <view class='conter' v-else>未支付</view>
  80. </view>
  81. <view class='item acea-row row-between'>
  82. <view>支付方式:</view>
  83. <view class='conter'>{{orderInfo._status._payType}}</view>
  84. </view>
  85. <view class='item acea-row row-between' v-if="orderInfo.mark">
  86. <view>买家留言:</view>
  87. <view class='conter'>{{orderInfo.mark}}</view>
  88. </view>
  89. <view class='item acea-row row-between' v-if="orderInfo.fictitious_content">
  90. <view>备注:</view>
  91. <view class='conter'>{{orderInfo.fictitious_content}}</view>
  92. </view>
  93. </view>
  94. <!-- 退款订单详情 -->
  95. <view class='wrapper' v-if="isGoodsReturn">
  96. <view class='item acea-row row-between'>
  97. <view>收货人:</view>
  98. <view class='conter'>{{orderInfo.real_name}}</view>
  99. </view>
  100. <view class='item acea-row row-between'>
  101. <view>联系电话:</view>
  102. <view class='conter'>{{orderInfo.user_phone}}</view>
  103. </view>
  104. <view class='item acea-row row-between'>
  105. <view>收货地址:</view>
  106. <view class='conter'>{{orderInfo.user_address}}</view>
  107. </view>
  108. </view>
  109. <view v-if="orderInfo.status!=0">
  110. <view class='wrapper' v-if='orderInfo.delivery_type=="express"'>
  111. <view class='item acea-row row-between'>
  112. <view>配送方式:</view>
  113. <view class='conter'>发货</view>
  114. </view>
  115. <view class='item acea-row row-between'>
  116. <view>快递公司:</view>
  117. <view class='conter'>{{orderInfo.delivery_name || ''}}</view>
  118. </view>
  119. <view class='item acea-row row-between'>
  120. <view>快递号:</view>
  121. <view class='conter'>{{orderInfo.delivery_id || ''}}</view>
  122. </view>
  123. </view>
  124. <view class='wrapper' v-else-if='orderInfo.delivery_type=="send"'>
  125. <view class='item acea-row row-between'>
  126. <view>配送方式:</view>
  127. <view class='conter'>送货</view>
  128. </view>
  129. <view class='item acea-row row-between'>
  130. <view>配送人姓名:</view>
  131. <view class='conter'>{{orderInfo.delivery_name || ''}}</view>
  132. </view>
  133. <view class='item acea-row row-between'>
  134. <view>联系电话:</view>
  135. <view class='conter acea-row row-middle row-right'>{{orderInfo.delivery_id || ''}}<text class='copy' @tap='goTel'>拨打</text></view>
  136. </view>
  137. </view>
  138. <view class='wrapper' v-else-if='orderInfo.delivery_type=="fictitious"'>
  139. <view class='item acea-row row-between'>
  140. <view>虚拟发货:</view>
  141. <view class='conter'>已发货,请注意查收</view>
  142. </view>
  143. </view>
  144. </view>
  145. <view class='wrapper'>
  146. <view class='item acea-row row-between'>
  147. <view>支付金额:</view>
  148. <view class='conter'>¥{{orderInfo.pay_price}}</view>
  149. </view>
  150. <view class='item acea-row row-between' v-if='orderInfo.coupon_id'>
  151. <view>优惠券抵扣:</view>
  152. <view class='conter'>-¥{{orderInfo.coupon_price}}</view>
  153. </view>
  154. <view class='item acea-row row-between' v-if="orderInfo.use_integral > 0">
  155. <view>积分抵扣:</view>
  156. <view class='conter'>-¥{{orderInfo.deduction_price}}</view>
  157. </view>
  158. <view class='item acea-row row-between' v-if="orderInfo.pay_postage > 0">
  159. <view>运费:</view>
  160. <view class='conter'>¥{{orderInfo.pay_postage}}</view>
  161. </view>
  162. </view>
  163. </view>
  164. <home v-if="navigation"></home>
  165. </view>
  166. </template>
  167. <style scoped lang="scss">
  168. .goodCall {
  169. color: #e93323;
  170. text-align: center;
  171. width: 100%;
  172. height: 86rpx;
  173. padding: 0 30rpx;
  174. border-bottom: 1rpx solid #eee;
  175. font-size: 30rpx;
  176. line-height: 86rpx;
  177. background: #fff;
  178. .icon-kefu {
  179. font-size: 36rpx;
  180. margin-right: 15rpx;
  181. }
  182. /* #ifdef MP */
  183. button {
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. height: 86rpx;
  188. font-size: 30rpx;
  189. color: #e93323;
  190. }
  191. /* #endif */
  192. }
  193. .order-details .header {
  194. padding: 0 30rpx;
  195. height: 150rpx;
  196. }
  197. .order-details .header.on {
  198. background-color: #666 !important;
  199. }
  200. .order-details .header .iconfont {
  201. font-size: 70rpx;
  202. color: #fff;
  203. }
  204. .order-details .header .data {
  205. color: rgba(255, 255, 255, 0.8);
  206. font-size: 24rpx;
  207. margin-left: 27rpx;
  208. }
  209. .order-details .header .data.on {
  210. margin-left: 0;
  211. }
  212. .order-details .header .data .state {
  213. font-size: 30rpx;
  214. font-weight: bold;
  215. color: #fff;
  216. margin-bottom: 7rpx;
  217. }
  218. .order-details .header .data .time {
  219. margin-left: 20rpx;
  220. }
  221. .order-details .nav {
  222. background-color: #fff;
  223. font-size: 26rpx;
  224. color: #282828;
  225. padding: 25rpx 0;
  226. }
  227. .order-details .nav .navCon {
  228. padding: 0 40rpx;
  229. }
  230. .order-details .nav .on {
  231. color: #e93323;
  232. }
  233. .order-details .nav .progress {
  234. padding: 0 65rpx;
  235. margin-top: 10rpx;
  236. }
  237. .order-details .nav .progress .line {
  238. width: 100rpx;
  239. height: 2rpx;
  240. background-color: #939390;
  241. }
  242. .order-details .nav .progress .iconfont {
  243. font-size: 25rpx;
  244. color: #939390;
  245. margin-top: -2rpx;
  246. }
  247. .order-details .address {
  248. font-size: 26rpx;
  249. color: #868686;
  250. background-color: #fff;
  251. margin-top: 13rpx;
  252. padding: 35rpx 30rpx;
  253. }
  254. .order-details .address .name {
  255. font-size: 30rpx;
  256. color: #282828;
  257. margin-bottom: 15rpx;
  258. }
  259. .order-details .address .name .phone {
  260. margin-left: 40rpx;
  261. }
  262. .order-details .line {
  263. width: 100%;
  264. height: 3rpx;
  265. }
  266. .order-details .line image {
  267. width: 100%;
  268. height: 100%;
  269. display: block;
  270. }
  271. .order-details .wrapper {
  272. background-color: #fff;
  273. margin-top: 12rpx;
  274. padding: 30rpx;
  275. }
  276. .order-details .wrapper .item {
  277. font-size: 28rpx;
  278. color: #282828;
  279. }
  280. .order-details .wrapper .item~.item {
  281. margin-top: 20rpx;
  282. }
  283. .order-details .wrapper .item .conter {
  284. color: #868686;
  285. width: 460rpx;
  286. text-align: right;
  287. }
  288. .order-details .wrapper .item .conter .copy {
  289. font-size: 20rpx;
  290. color: #333;
  291. border-radius: 3rpx;
  292. border: 1rpx solid #666;
  293. padding: 3rpx 15rpx;
  294. margin-left: 24rpx;
  295. }
  296. .order-details .wrapper .actualPay {
  297. border-top: 1rpx solid #eee;
  298. margin-top: 30rpx;
  299. padding-top: 30rpx;
  300. }
  301. .order-details .wrapper .actualPay .money {
  302. font-weight: bold;
  303. font-size: 30rpx;
  304. }
  305. .order-details .footer {
  306. width: 100%;
  307. height: 100rpx;
  308. position: fixed;
  309. bottom: 0;
  310. left: 0;
  311. background-color: #fff;
  312. padding: 0 30rpx;
  313. box-sizing: border-box;
  314. }
  315. .order-details .footer .bnt {
  316. width: 176rpx;
  317. height: 60rpx;
  318. text-align: center;
  319. line-height: 60rpx;
  320. border-radius: 50rpx;
  321. color: #fff;
  322. font-size: 27rpx;
  323. }
  324. .order-details .footer .bnt.cancel {
  325. color: #aaa;
  326. border: 1rpx solid #ddd;
  327. }
  328. .order-details .footer .bnt~.bnt {
  329. margin-left: 18rpx;
  330. }
  331. .order-details .writeOff {
  332. background-color: #fff;
  333. margin-top: 13rpx;
  334. padding-bottom: 30rpx;
  335. }
  336. .order-details .writeOff .title {
  337. font-size: 30rpx;
  338. color: #282828;
  339. height: 87rpx;
  340. border-bottom: 1px solid #f0f0f0;
  341. padding: 0 30rpx;
  342. line-height: 87rpx;
  343. }
  344. .order-details .writeOff .grayBg {
  345. background-color: #f2f5f7;
  346. width: 590rpx;
  347. height: 384rpx;
  348. border-radius: 20rpx 20rpx 0 0;
  349. margin: 50rpx auto 0 auto;
  350. padding-top: 55rpx;
  351. position: relative;
  352. }
  353. .order-details .writeOff .grayBg .written {
  354. position: absolute;
  355. top: 0;
  356. right: 0;
  357. width: 60rpx;
  358. height: 60rpx;
  359. }
  360. .order-details .writeOff .grayBg .written image {
  361. width: 100%;
  362. height: 100%;
  363. }
  364. .order-details .writeOff .grayBg .pictrue {
  365. width: 290rpx;
  366. height: 290rpx;
  367. margin: 0 auto;
  368. }
  369. .order-details .writeOff .grayBg .pictrue image {
  370. width: 100%;
  371. height: 100%;
  372. display: block;
  373. }
  374. .order-details .writeOff .gear {
  375. width: 590rpx;
  376. height: 30rpx;
  377. margin: 0 auto;
  378. }
  379. .order-details .writeOff .gear image {
  380. width: 100%;
  381. height: 100%;
  382. display: block;
  383. }
  384. .order-details .writeOff .num {
  385. background-color: #f0c34c;
  386. width: 590rpx;
  387. height: 84rpx;
  388. color: #282828;
  389. font-size: 48rpx;
  390. margin: 0 auto;
  391. border-radius: 0 0 20rpx 20rpx;
  392. text-align: center;
  393. padding-top: 4rpx;
  394. }
  395. .order-details .writeOff .rules {
  396. margin: 46rpx 30rpx 0 30rpx;
  397. border-top: 1px solid #f0f0f0;
  398. padding-top: 10rpx;
  399. }
  400. .order-details .writeOff .rules .item {
  401. margin-top: 20rpx;
  402. }
  403. .order-details .writeOff .rules .item .rulesTitle {
  404. font-size: 28rpx;
  405. color: #282828;
  406. }
  407. .order-details .writeOff .rules .item .rulesTitle .iconfont {
  408. font-size: 30rpx;
  409. color: #333;
  410. margin-right: 8rpx;
  411. margin-top: 5rpx;
  412. }
  413. .order-details .writeOff .rules .item .info {
  414. font-size: 28rpx;
  415. color: #999;
  416. margin-top: 7rpx;
  417. }
  418. .order-details .writeOff .rules .item .info .time {
  419. margin-left: 20rpx;
  420. }
  421. .order-details .map {
  422. height: 86rpx;
  423. font-size: 30rpx;
  424. color: #282828;
  425. line-height: 86rpx;
  426. border-bottom: 1px solid #f0f0f0;
  427. margin-top: 13rpx;
  428. background-color: #fff;
  429. padding: 0 30rpx;
  430. }
  431. .order-details .map .place {
  432. font-size: 26rpx;
  433. width: 176rpx;
  434. height: 50rpx;
  435. border-radius: 25rpx;
  436. line-height: 50rpx;
  437. text-align: center;
  438. }
  439. .order-details .map .place .iconfont {
  440. font-size: 27rpx;
  441. height: 27rpx;
  442. line-height: 27rpx;
  443. margin: 2rpx 3rpx 0 0;
  444. }
  445. .order-details .address .name .iconfont {
  446. font-size: 34rpx;
  447. margin-left: 10rpx;
  448. }
  449. .refund {
  450. padding: 0 30rpx 30rpx;
  451. margin-top: 24rpx;
  452. background-color: #fff;
  453. .title {
  454. display: flex;
  455. align-items: center;
  456. font-size: 30rpx;
  457. color: #333;
  458. height: 86rpx;
  459. border-bottom: 1px solid #f5f5f5;
  460. image {
  461. width: 32rpx;
  462. height: 32rpx;
  463. margin-right: 10rpx;
  464. }
  465. }
  466. .con {
  467. padding-top: 25rpx;
  468. font-size: 28rpx;
  469. color: #868686;
  470. }
  471. }
  472. </style>
  473. <script>
  474. import {
  475. orderInvoiceDetail,
  476. orderAgain,
  477. orderTake,
  478. orderDel,
  479. orderCancel
  480. } from '@/api/order.js';
  481. import {
  482. openOrderRefundSubscribe
  483. } from '@/utils/SubscribeMessage.js';
  484. import {
  485. getUserInfo
  486. } from '@/api/user.js';
  487. import home from '@/components/home';
  488. import payment from '@/components/payment';
  489. import orderGoods from "@/components/orderGoods";
  490. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  491. import {
  492. toLogin
  493. } from '@/libs/login.js';
  494. import {
  495. mapGetters
  496. } from "vuex";
  497. import colors from "@/mixins/color";
  498. export default {
  499. components: {
  500. payment,
  501. home,
  502. orderGoods
  503. },
  504. mixins: [colors],
  505. data() {
  506. return {
  507. order_id: '',
  508. evaluate: 0,
  509. cartInfo: [], //购物车产品
  510. orderInfo: {
  511. system_store: {},
  512. _status: {}
  513. }, //订单详情
  514. system_store: {},
  515. isGoodsReturn: false, //是否为退款订单
  516. status: {}, //订单底部按钮状态
  517. isClose: false,
  518. payMode: [{
  519. name: "微信支付",
  520. icon: "icon-weixinzhifu",
  521. value: 'weixin',
  522. title: '微信快捷支付'
  523. },
  524. // #ifdef H5 || APP-PLUS
  525. {
  526. name: '支付宝支付',
  527. icon: 'icon-zhifubao',
  528. value: 'alipay',
  529. title: '支付宝支付',
  530. payStatus: true
  531. },
  532. // #endif
  533. {
  534. name: "余额支付",
  535. icon: "icon-yuezhifu",
  536. value: 'yue',
  537. title: '可用余额:',
  538. number: 0
  539. },
  540. ],
  541. pay_close: false,
  542. pay_order_id: '',
  543. totalPrice: '0',
  544. isAuto: false, //没有授权的不会自动授权
  545. isShowAuth: false //是否隐藏授权
  546. };
  547. },
  548. computed: mapGetters(['isLogin']),
  549. onLoad: function(options) {
  550. if (options.order_id) {
  551. this.$set(this, 'order_id', options.order_id);
  552. }
  553. },
  554. onShow() {
  555. uni.removeStorageSync('form_type_cart');
  556. if (this.isLogin) {
  557. this.getOrderInfo();
  558. this.getUserInfo();
  559. } else {
  560. toLogin();
  561. }
  562. },
  563. onHide: function() {
  564. this.isClose = true;
  565. },
  566. onReady: function() {
  567. // #ifdef H5
  568. this.$nextTick(function() {
  569. const clipboard = new ClipboardJS(".copy-data");
  570. clipboard.on("success", () => {
  571. this.$util.Tips({
  572. title: '复制成功'
  573. });
  574. });
  575. });
  576. // #endif
  577. },
  578. methods: {
  579. goGoodCall() {
  580. let self = this
  581. uni.navigateTo({
  582. url: `/pages/extension/customer_list/chat?orderId=${self.order_id}`
  583. })
  584. },
  585. openSubcribe: function(e) {
  586. let page = e;
  587. uni.showLoading({
  588. title: '正在加载',
  589. })
  590. openOrderRefundSubscribe().then(res => {
  591. uni.hideLoading();
  592. uni.navigateTo({
  593. url: page,
  594. });
  595. }).catch(() => {
  596. uni.hideLoading();
  597. });
  598. },
  599. /**
  600. * 事件回调
  601. *
  602. */
  603. onChangeFun: function(e) {
  604. let opt = e;
  605. let action = opt.action || null;
  606. let value = opt.value != undefined ? opt.value : null;
  607. (action && this[action]) && this[action](value);
  608. },
  609. /**
  610. * 拨打电话
  611. */
  612. makePhone: function() {
  613. uni.makePhoneCall({
  614. phoneNumber: this.system_store.phone
  615. })
  616. },
  617. /**
  618. * 打开地图
  619. *
  620. */
  621. showMaoLocation: function() {
  622. if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
  623. title: '缺少经纬度信息无法查看地图!'
  624. });
  625. uni.openLocation({
  626. latitude: parseFloat(this.system_store.latitude),
  627. longitude: parseFloat(this.system_store.longitude),
  628. scale: 8,
  629. name: this.system_store.name,
  630. address: this.system_store.address + this.system_store.detailed_address,
  631. success: function() {
  632. },
  633. });
  634. },
  635. /**
  636. * 关闭支付组件
  637. *
  638. */
  639. payClose: function() {
  640. this.pay_close = false;
  641. },
  642. /**
  643. * 打开支付组件
  644. *
  645. */
  646. pay_open: function() {
  647. this.pay_close = true;
  648. this.pay_order_id = this.orderInfo.order_id;
  649. this.totalPrice = this.orderInfo.pay_price;
  650. },
  651. /**
  652. * 支付成功回调
  653. *
  654. */
  655. pay_complete: function() {
  656. this.pay_close = false;
  657. this.pay_order_id = '';
  658. this.getOrderInfo();
  659. },
  660. /**
  661. * 支付失败回调
  662. *
  663. */
  664. pay_fail: function() {
  665. this.pay_close = false;
  666. this.pay_order_id = '';
  667. },
  668. /**
  669. * 登录授权回调
  670. *
  671. */
  672. onLoadFun: function() {
  673. this.getOrderInfo();
  674. this.getUserInfo();
  675. },
  676. /**
  677. * 获取用户信息
  678. *
  679. */
  680. getUserInfo: function() {
  681. let that = this;
  682. getUserInfo().then(res => {
  683. that.payMode[1].number = res.data.now_money;
  684. that.$set(that, 'payMode', that.payMode);
  685. })
  686. },
  687. /**
  688. * 获取订单详细信息
  689. *
  690. */
  691. getOrderInfo: function() {
  692. let that = this;
  693. uni.showLoading({
  694. title: "正在加载中"
  695. });
  696. orderInvoiceDetail(this.order_id).then(res => {
  697. let _type = res.data._status._type;
  698. uni.hideLoading();
  699. that.$set(that, 'orderInfo', res.data);
  700. that.$set(that, 'cartInfo', res.data.cartInfo);
  701. that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
  702. that.$set(that, 'system_store', res.data.system_store);
  703. if (this.orderInfo.refund_status != 0) {
  704. this.isGoodsReturn = true;
  705. }
  706. that.getOrderStatus();
  707. }).catch(err => {
  708. uni.hideLoading();
  709. that.$util.Tips({
  710. title: err
  711. });
  712. });
  713. },
  714. /**
  715. *
  716. * 剪切订单号
  717. */
  718. // #ifndef H5
  719. copy: function() {
  720. let that = this;
  721. uni.setClipboardData({
  722. data: this.orderInfo.order_id
  723. });
  724. },
  725. // #endif
  726. /**
  727. * 打电话
  728. */
  729. goTel: function() {
  730. uni.makePhoneCall({
  731. phoneNumber: this.orderInfo.delivery_id
  732. })
  733. },
  734. /**
  735. * 设置底部按钮
  736. *
  737. */
  738. getOrderStatus: function() {
  739. let orderInfo = this.orderInfo || {},
  740. _status = orderInfo._status || {
  741. _type: 0
  742. },
  743. status = {};
  744. let type = parseInt(_status._type),
  745. delivery_type = orderInfo.delivery_type,
  746. seckill_id = orderInfo.seckill_id ? parseInt(orderInfo.seckill_id) : 0,
  747. bargain_id = orderInfo.bargain_id ? parseInt(orderInfo.bargain_id) : 0,
  748. combination_id = orderInfo.combination_id ? parseInt(orderInfo.combination_id) : 0;
  749. status = {
  750. type: type == 9 ? -9 : type,
  751. class_status: 0
  752. };
  753. if (type == 1 && combination_id > 0) status.class_status = 1; //查看拼团
  754. if (type == 2 && delivery_type == 'express') status.class_status = 2; //查看物流
  755. if (type == 2) status.class_status = 3; //确认收货
  756. if (type == 4 || type == 0) status.class_status = 4; //删除订单
  757. if (!seckill_id && !bargain_id && !combination_id && (type == 3 || type == 4)) status.class_status = 5; //再次购买
  758. this.$set(this, 'status', status);
  759. },
  760. /**
  761. * 去拼团详情
  762. *
  763. */
  764. goJoinPink: function() {
  765. uni.navigateTo({
  766. url: '/pages/activity/goods_combination_status/index?id=' + this.orderInfo.pink_id,
  767. });
  768. },
  769. /**
  770. * 再此购买
  771. *
  772. */
  773. goOrderConfirm: function() {
  774. let that = this;
  775. orderAgain(that.orderInfo.order_id).then(res => {
  776. return uni.navigateTo({
  777. url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cateId
  778. });
  779. });
  780. },
  781. confirmOrder: function() {
  782. let that = this;
  783. uni.showModal({
  784. title: '确认收货',
  785. content: '为保障权益,请收到货确认无误后,再确认收货',
  786. success: function(res) {
  787. if (res.confirm) {
  788. orderTake(that.order_id).then(res => {
  789. return that.$util.Tips({
  790. title: '操作成功',
  791. icon: 'success'
  792. }, function() {
  793. that.getOrderInfo();
  794. });
  795. }).catch(err => {
  796. return that.$util.Tips({
  797. title: err
  798. });
  799. })
  800. }
  801. }
  802. })
  803. },
  804. /**
  805. *
  806. * 删除订单
  807. */
  808. delOrder: function() {
  809. let that = this;
  810. orderDel(this.order_id).then(res => {
  811. return that.$util.Tips({
  812. title: '删除成功',
  813. icon: 'success'
  814. }, {
  815. tab: 3,
  816. url: 1
  817. });
  818. }).catch(err => {
  819. return that.$util.Tips({
  820. title: err
  821. });
  822. });
  823. },
  824. cancelOrder() {
  825. let self = this
  826. uni.showModal({
  827. title: '提示',
  828. content: '确认取消该订单?',
  829. success: function(res) {
  830. if (res.confirm) {
  831. orderCancel(self.orderInfo.order_id)
  832. .then((data) => {
  833. self.$util.Tips({
  834. title: data.msg
  835. }, {
  836. tab: 3
  837. })
  838. })
  839. .catch(() => {
  840. self.getDetail();
  841. });
  842. } else if (res.cancel) {
  843. console.log('用户点击取消');
  844. }
  845. }
  846. });
  847. },
  848. }
  849. }
  850. </script>
  851. <style>
  852. .qs-btn {
  853. width: auto;
  854. height: 60rpx;
  855. text-align: center;
  856. line-height: 60rpx;
  857. border-radius: 50rpx;
  858. color: #fff;
  859. font-size: 27rpx;
  860. padding: 0 3%;
  861. color: #aaa;
  862. border: 1px solid #ddd;
  863. margin-right: 20rpx;
  864. }
  865. </style>