index.vue 22 KB

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