index.vue 22 KB

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