index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  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. name: "微信支付",
  523. icon: "icon-weixinzhifu",
  524. value: 'weixin',
  525. title: '微信快捷支付'
  526. },
  527. // #ifdef H5 || APP-PLUS
  528. {
  529. name: '支付宝支付',
  530. icon: 'icon-zhifubao',
  531. value: 'alipay',
  532. title: '支付宝支付',
  533. payStatus: true
  534. },
  535. // #endif
  536. {
  537. name: "余额支付",
  538. icon: "icon-yuezhifu",
  539. value: 'yue',
  540. title: '可用余额:',
  541. number: 0
  542. },
  543. ],
  544. pay_close: false,
  545. pay_order_id: '',
  546. totalPrice: '0',
  547. isAuto: false, //没有授权的不会自动授权
  548. isShowAuth: false //是否隐藏授权
  549. };
  550. },
  551. computed: mapGetters(['isLogin']),
  552. onLoad: function(options) {
  553. if (options.order_id) {
  554. this.$set(this, 'order_id', options.order_id);
  555. }
  556. },
  557. onShow() {
  558. uni.removeStorageSync('form_type_cart');
  559. if (this.isLogin) {
  560. this.getOrderInfo();
  561. this.getUserInfo();
  562. } else {
  563. toLogin();
  564. }
  565. },
  566. onHide: function() {
  567. this.isClose = true;
  568. },
  569. onReady: function() {
  570. // #ifdef H5
  571. this.$nextTick(function() {
  572. const clipboard = new ClipboardJS(".copy-data");
  573. clipboard.on("success", () => {
  574. this.$util.Tips({
  575. title: '复制成功'
  576. });
  577. });
  578. });
  579. // #endif
  580. },
  581. methods: {
  582. // 授权关闭
  583. authColse: function(e) {
  584. this.isShowAuth = e
  585. },
  586. goGoodCall() {
  587. let self = this
  588. uni.navigateTo({
  589. url: `/pages/extension/customer_list/chat?orderId=${self.order_id}`
  590. })
  591. },
  592. openSubcribe: function(e) {
  593. let page = e;
  594. uni.showLoading({
  595. title: '正在加载',
  596. })
  597. openOrderRefundSubscribe().then(res => {
  598. uni.hideLoading();
  599. uni.navigateTo({
  600. url: page,
  601. });
  602. }).catch(() => {
  603. uni.hideLoading();
  604. });
  605. },
  606. /**
  607. * 事件回调
  608. *
  609. */
  610. onChangeFun: function(e) {
  611. let opt = e;
  612. let action = opt.action || null;
  613. let value = opt.value != undefined ? opt.value : null;
  614. (action && this[action]) && this[action](value);
  615. },
  616. /**
  617. * 拨打电话
  618. */
  619. makePhone: function() {
  620. uni.makePhoneCall({
  621. phoneNumber: this.system_store.phone
  622. })
  623. },
  624. /**
  625. * 打开地图
  626. *
  627. */
  628. showMaoLocation: function() {
  629. if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
  630. title: '缺少经纬度信息无法查看地图!'
  631. });
  632. uni.openLocation({
  633. latitude: parseFloat(this.system_store.latitude),
  634. longitude: parseFloat(this.system_store.longitude),
  635. scale: 8,
  636. name: this.system_store.name,
  637. address: this.system_store.address + this.system_store.detailed_address,
  638. success: function() {
  639. },
  640. });
  641. },
  642. /**
  643. * 关闭支付组件
  644. *
  645. */
  646. payClose: function() {
  647. this.pay_close = false;
  648. },
  649. /**
  650. * 打开支付组件
  651. *
  652. */
  653. pay_open: function() {
  654. this.pay_close = true;
  655. this.pay_order_id = this.orderInfo.order_id;
  656. this.totalPrice = this.orderInfo.pay_price;
  657. },
  658. /**
  659. * 支付成功回调
  660. *
  661. */
  662. pay_complete: function() {
  663. this.pay_close = false;
  664. this.pay_order_id = '';
  665. this.getOrderInfo();
  666. },
  667. /**
  668. * 支付失败回调
  669. *
  670. */
  671. pay_fail: function() {
  672. this.pay_close = false;
  673. this.pay_order_id = '';
  674. },
  675. /**
  676. * 登录授权回调
  677. *
  678. */
  679. onLoadFun: function() {
  680. this.getOrderInfo();
  681. this.getUserInfo();
  682. this.isShowAuth = false;
  683. },
  684. /**
  685. * 获取用户信息
  686. *
  687. */
  688. getUserInfo: function() {
  689. let that = this;
  690. getUserInfo().then(res => {
  691. that.payMode[1].number = res.data.now_money;
  692. that.$set(that, 'payMode', that.payMode);
  693. })
  694. },
  695. /**
  696. * 获取订单详细信息
  697. *
  698. */
  699. getOrderInfo: function() {
  700. let that = this;
  701. uni.showLoading({
  702. title: "正在加载中"
  703. });
  704. orderInvoiceDetail(this.order_id).then(res => {
  705. let _type = res.data._status._type;
  706. uni.hideLoading();
  707. that.$set(that, 'orderInfo', res.data);
  708. that.$set(that, 'cartInfo', res.data.cartInfo);
  709. that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
  710. that.$set(that, 'system_store', res.data.system_store);
  711. if (this.orderInfo.refund_status != 0) {
  712. this.isGoodsReturn = true;
  713. }
  714. that.getOrderStatus();
  715. }).catch(err => {
  716. uni.hideLoading();
  717. that.$util.Tips({
  718. title: err
  719. });
  720. });
  721. },
  722. /**
  723. *
  724. * 剪切订单号
  725. */
  726. // #ifndef H5
  727. copy: function() {
  728. let that = this;
  729. uni.setClipboardData({
  730. data: this.orderInfo.order_id
  731. });
  732. },
  733. // #endif
  734. /**
  735. * 打电话
  736. */
  737. goTel: function() {
  738. uni.makePhoneCall({
  739. phoneNumber: this.orderInfo.delivery_id
  740. })
  741. },
  742. /**
  743. * 设置底部按钮
  744. *
  745. */
  746. getOrderStatus: function() {
  747. let orderInfo = this.orderInfo || {},
  748. _status = orderInfo._status || {
  749. _type: 0
  750. },
  751. status = {};
  752. let type = parseInt(_status._type),
  753. delivery_type = orderInfo.delivery_type,
  754. seckill_id = orderInfo.seckill_id ? parseInt(orderInfo.seckill_id) : 0,
  755. bargain_id = orderInfo.bargain_id ? parseInt(orderInfo.bargain_id) : 0,
  756. combination_id = orderInfo.combination_id ? parseInt(orderInfo.combination_id) : 0;
  757. status = {
  758. type: type == 9 ? -9 : type,
  759. class_status: 0
  760. };
  761. if (type == 1 && combination_id > 0) status.class_status = 1; //查看拼团
  762. if (type == 2 && delivery_type == 'express') status.class_status = 2; //查看物流
  763. if (type == 2) status.class_status = 3; //确认收货
  764. if (type == 4 || type == 0) status.class_status = 4; //删除订单
  765. if (!seckill_id && !bargain_id && !combination_id && (type == 3 || type == 4)) status.class_status = 5; //再次购买
  766. this.$set(this, 'status', status);
  767. },
  768. /**
  769. * 去拼团详情
  770. *
  771. */
  772. goJoinPink: function() {
  773. uni.navigateTo({
  774. url: '/pages/activity/goods_combination_status/index?id=' + this.orderInfo.pink_id,
  775. });
  776. },
  777. /**
  778. * 再此购买
  779. *
  780. */
  781. goOrderConfirm: function() {
  782. let that = this;
  783. orderAgain(that.orderInfo.order_id).then(res => {
  784. return uni.navigateTo({
  785. url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cateId
  786. });
  787. });
  788. },
  789. confirmOrder: function() {
  790. let that = this;
  791. uni.showModal({
  792. title: '确认收货',
  793. content: '为保障权益,请收到货确认无误后,再确认收货',
  794. success: function(res) {
  795. if (res.confirm) {
  796. orderTake(that.order_id).then(res => {
  797. return that.$util.Tips({
  798. title: '操作成功',
  799. icon: 'success'
  800. }, function() {
  801. that.getOrderInfo();
  802. });
  803. }).catch(err => {
  804. return that.$util.Tips({
  805. title: err
  806. });
  807. })
  808. }
  809. }
  810. })
  811. },
  812. /**
  813. *
  814. * 删除订单
  815. */
  816. delOrder: function() {
  817. let that = this;
  818. orderDel(this.order_id).then(res => {
  819. return that.$util.Tips({
  820. title: '删除成功',
  821. icon: 'success'
  822. }, {
  823. tab: 3,
  824. url: 1
  825. });
  826. }).catch(err => {
  827. return that.$util.Tips({
  828. title: err
  829. });
  830. });
  831. },
  832. cancelOrder() {
  833. let self = this
  834. uni.showModal({
  835. title: '提示',
  836. content: '确认取消该订单?',
  837. success: function(res) {
  838. if (res.confirm) {
  839. orderCancel(self.orderInfo.order_id)
  840. .then((data) => {
  841. self.$util.Tips({
  842. title: data.msg
  843. }, {
  844. tab: 3
  845. })
  846. })
  847. .catch(() => {
  848. self.getDetail();
  849. });
  850. } else if (res.cancel) {
  851. console.log('用户点击取消');
  852. }
  853. }
  854. });
  855. },
  856. }
  857. }
  858. </script>
  859. <style>
  860. .qs-btn {
  861. width: auto;
  862. height: 60rpx;
  863. text-align: center;
  864. line-height: 60rpx;
  865. border-radius: 50rpx;
  866. color: #fff;
  867. font-size: 27rpx;
  868. padding: 0 3%;
  869. color: #aaa;
  870. border: 1px solid #ddd;
  871. margin-right: 20rpx;
  872. }
  873. </style>