index.vue 22 KB

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