index.vue 22 KB

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