parkingFeeDetail.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. import moment from 'moment';
  2. import { mapState } from 'vuex';
  3. import log from '@/utils/log.js';
  4. import { compare } from '@/utils/location.js';
  5. import uni from '@/utils/uniHooks';
  6. import { initWxJsSdkConfig } from '@/utils/login';
  7. import { getAppIdByGroupIdAndMallId, getIsWxh5, getPlatform, isAlipay } from '@/utils';
  8. import { Dialog, Toast } from 'vant';
  9. import { ordersAndPrepay } from '@/api/parking';
  10. // import checkOutResponse from '@/api/mockData/checkout.hz.response'
  11. export default {
  12. name: 'parkingFeeDetail',
  13. data() {
  14. return {
  15. hasDiscount: false,
  16. parkFee: {},
  17. refreshTime: 180, // 停车场重置费用倒计时3分钟
  18. // 微服务接口字段
  19. isShowDescription: true, // 缴费说明true:显示全部 false:显示部分
  20. btnLoading: false,
  21. isPay: false,
  22. popup: false,
  23. msData: {},
  24. };
  25. },
  26. beforeRouteLeave(to, from, next) {
  27. // 设置下一个路由的 meta
  28. if (/index|home/.test(to.name)) {
  29. // 不在缓存列表中,从cachedViews缓存列表中移除
  30. this.$store.commit('cachedViews/DEL_CACHED_VIEW', from);
  31. }
  32. next();
  33. },
  34. created() {
  35. setTimeout(() => {
  36. uni.setNavigationBarTitle({
  37. title: '停车支付',
  38. });
  39. }, 300);
  40. setTimeout(() => {
  41. window?.toWXSendMsg({
  42. type: 'uni_func',
  43. funcName: 'setNavigationBarColor',
  44. options: {
  45. frontColor: '#000000',
  46. backgroundColor: '#FBFCFF',
  47. },
  48. });
  49. }, 500)
  50. setTimeout(() => {
  51. this.pageInit();
  52. }, 300)
  53. },
  54. computed: {
  55. ...mapState({
  56. orderDetail: (state) => state.order.orderDetail,
  57. discountDesc: (state) => state.order.discountDesc,
  58. enableNewMemberPoints: (state) => state.order.enableNewMemberPoints,
  59. enablePoints: (state) => state.order.enablePoints,
  60. integralDesc: (state) => state.order.integralDesc,
  61. enableCoupon: (state) => state.order.enableCoupon,
  62. maxOneDayCoupons: (state) => state.order.maxOneDayCoupons,
  63. coupons: (state) => state.order.coupons,
  64. couponDesc: (state) => state.order.couponDesc,
  65. enablePaperCoupons: (state) => state.order.enablePaperCoupons,
  66. custTypeId: (state) => state.custTypeId,
  67. usingTotalDiscount: (state) => state.order.usingTotalDiscount,
  68. actualPayFee: (state) => state.order.actualPayFee,
  69. available: (state) => state.order.available,
  70. member: (state) => state.member,
  71. maxPointsTime: (state) => state.order.maxPointsTime,
  72. pointsTime: (state) => state.order.pointsTime,
  73. pointsPerHour: (state) => state.order.pointsPerHour,
  74. usePoints: (state) => state.order.usePoints,
  75. usePointsTime: (state) => state.order.usePointsTime,
  76. enableConsume: (state) => state.order.enableConsume,
  77. memberLevelDiscount: (state) => state.order.memberLevelDiscount,
  78. unitAmount: (state) => state.order.unitAmount,
  79. unlicensedInfo: state => state.unlicensedInfo,
  80. endlessLoop: (state) => state.endlessLoop,
  81. appId: state => state.appId,
  82. source: state => state.source,
  83. parkMallCode: (state) => state.order.parkMallCode,
  84. }),
  85. isNoLogin() {
  86. return JSON.stringify(this.member) === '{}' || !this.member
  87. },
  88. // 支付按钮状态
  89. payBtnDisabled() {
  90. // 当存在待支付金额 或者 用户登陆
  91. return !this.orderDetail?.parkingRecord?.totalFeeInYuan || (JSON.stringify(this.member) !== '{}' && !this.orderDetail.parkInfo);
  92. },
  93. // integralDesc() {
  94. // if (this.pointsTime > 0) {
  95. // // 深圳特殊处理(单位:金额)
  96. // if (this.orderDetail.parkInfo.parkMallCode === 5 || this.orderDetail.parkInfo.parkMallCode === 999) {
  97. // return `已选择兑换${this.pointsTime}元`;
  98. // }
  99. // return `已选择兑换${this.pointsTime}小时`;
  100. // }
  101. // if (this.bonusCopy < this.integral) {
  102. // return `${this.integral}积分可停车1小时`;
  103. // }
  104. // if (this.orderDetail.parkInfo.parkMallCode === 3 && app.globalData.member?.currnentintegral >= this.integral && !this.bonus) {
  105. // return `今日已达上限`;
  106. // }
  107. // return `${this.available}积分可减免`;
  108. // },
  109. },
  110. filters: {
  111. parkingTime(val) {
  112. const days = parseInt(val / 60 / 24)
  113. const hours = parseInt((val / 60) % 24)
  114. const minutes = parseInt(val % 60)
  115. if (days > 0) {
  116. return `${days}天 ${hours}小时 ${minutes}分钟`
  117. }
  118. if (hours > 0) {
  119. return `${hours}小时 ${minutes}分钟`
  120. }
  121. return `${minutes}分钟`
  122. },
  123. },
  124. methods: {
  125. // 前往支付
  126. async toPay() {
  127. if (this.btnLoading) return
  128. this.btnLoading = true
  129. setTimeout(() => {
  130. if ( this.btnLoading && !this.isPay ) {
  131. const toast1 = Toast({
  132. message: '网络连接失败,请重试',
  133. duration: 3000,
  134. onClose: () => {
  135. this.$router.replace({
  136. // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
  137. path: 'home',
  138. });
  139. }
  140. });
  141. this.btnLoading = false
  142. }
  143. }, 10000)
  144. const { parkingRecord, discountInfo = {}, parkingRule = {}} = this.orderDetail;
  145. const { coupons, points, memberGrade = [], paperCoupons = [], consume = [] } = discountInfo
  146. const { hourPrice } = parkingRule
  147. try {
  148. const params = {
  149. // vehicleNo: '', // 车牌号
  150. // points
  151. parkingRecord: {
  152. ...parkingRecord,
  153. vehicleNo: parkingRecord.vehicleNo,
  154. enterTime: parkingRecord.enterTime,
  155. serviceMin: parkingRecord.serviceMin,
  156. totalFee: parkingRecord.totalFeeInYuan, //应缴
  157. actualPayFee: this.actualPayFee, //应付金额
  158. },
  159. discountInfo: {
  160. usingTotalDiscount: discountInfo?.usingTotalDiscount || 0, //优惠金额"
  161. actualUsedDiscount: discountInfo?.usingTotalDiscount || 0, //实际优惠金额
  162. },
  163. };
  164. // 会员等级减免
  165. if ( memberGrade?.length && memberGrade[0].discountFee > 0 && memberGrade[0].hasOwnProperty('selected')? memberGrade[0]?.selected : memberGrade[0]?.defaultSelected) {
  166. const selected = memberGrade[0].hasOwnProperty('selected') ? memberGrade[0].selected : memberGrade[0].defaultSelected;
  167. let discountTime = 0
  168. let discountFee = 0
  169. if(selected) {
  170. discountTime = memberGrade[0].hasOwnProperty('discountTime') ? memberGrade[0].discountTime : memberGrade[0].defaultDiscountTime;
  171. discountFee = memberGrade[0].hasOwnProperty('discountFee') ? memberGrade[0].discountFee : discountTime * hourPrice;
  172. }
  173. params.discountInfo.memberLevel = {
  174. "discountTime": discountTime * 60, // 小时转成分钟
  175. "discountFee": discountFee,
  176. "memberGrade": memberGrade[0].memberGrade
  177. }
  178. }
  179. // 消费减免
  180. if ( consume?.length && consume[0].discountFee > 0 && consume[0].hasOwnProperty('selected')? consume[0]?.selected : consume[0]?.defaultSelected) {
  181. const { redeemSalesAmount, defaultDiscountTime} = consume[0]
  182. const selected = consume[0].hasOwnProperty('selected') ? consume[0].selected : consume[0].defaultSelected;
  183. let discountTime = 0
  184. let discountFee = 0
  185. if(selected) {
  186. discountFee = consume[0].hasOwnProperty('discountFee') ? consume[0].discountFee : memberGrade[0].defaultDiscountTime * hourPrice;
  187. discountTime = discountFee / hourPrice * 60;
  188. }
  189. params.discountInfo.consume = {
  190. ...consume[0],
  191. "defaultSelected": selected,
  192. "discountTime": discountTime,
  193. "discountFee": discountFee,
  194. "redeemSalesAmount": (this.parkMallCode === 4 || this.parkMallCode === 6) ? (redeemSalesAmount / defaultDiscountTime) * ( discountFee / hourPrice) : redeemSalesAmount
  195. }
  196. }
  197. // 积分
  198. if (points?.length && points[0].discountFee > 0) {
  199. // 15 兑换 5元
  200. const { pointsPerUnit, unitAmount, discountFee, available } = points[0]
  201. params.discountInfo.points = {
  202. "discountTime": discountFee / hourPrice * 60,
  203. "discountFee": discountFee,
  204. "discountPoints": discountFee / hourPrice * pointsPerUnit
  205. }
  206. }
  207. // 优惠券
  208. if (coupons?.length) {
  209. const selectedCoupons = coupons.filter(elm => {
  210. const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
  211. return selected
  212. }).map(elm => {
  213. elm.discountTime = elm.discountFee / hourPrice * 60
  214. return elm
  215. })
  216. if (selectedCoupons.length) {
  217. params.discountInfo.coupons = selectedCoupons
  218. }
  219. }
  220. // 纸质优惠券
  221. if ( paperCoupons?.length ) {
  222. params.discountInfo.paperCoupons = paperCoupons.filter(elm => {
  223. if ( !elm.discountFee ) {
  224. return false
  225. }
  226. return {
  227. ...elm,
  228. "discountFee": elm.discountFee,
  229. // discountTime: elm.discountFee / hourPrice * 60
  230. }
  231. })
  232. }
  233. console.log('下单时的参数', params);
  234. const res = await ordersAndPrepay(params);
  235. // console.log('orderDetail', res);
  236. if (res?.paymentType === 'NO_FEE_PAY') {
  237. this.btnLoading = false;
  238. this.isPay = false
  239. this.$router.replace({
  240. path: this.getPagePath(),
  241. });
  242. // 支付成功
  243. return
  244. }
  245. this.kerryPayment(res.sessionId);
  246. } catch (err) {
  247. if(err ==='ERR_NETWORK') {
  248. setTimeout(() => {
  249. this.$router.replace({
  250. // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
  251. path: 'home',
  252. });
  253. }, 2900)
  254. } else {
  255. this.btnLoading = false
  256. this.isPay = false
  257. }
  258. console.log(err);
  259. }
  260. },
  261. kerryPayment(session = '011cad54-735f-4e92-8f1b-f22bdfe073cd', payParams) {
  262. const platform = getPlatform();
  263. console.log('platform:::', platform)
  264. let appId = uni.getStorageSync('appid');
  265. let openId = uni.getStorageSync('openid') || this.openid;
  266. if (platform === 'miniprogram') {
  267. // appId = 'wx92c3e55fbef6b2af';
  268. // appId = 'wxd830fe4d1e04988e';
  269. appId = this.appId;
  270. }
  271. console.log('支付宝::', isAlipay())
  272. const params = {
  273. region: 'cn',
  274. payChannel: isAlipay() ? 'MINI_PROGRAM' : 'OFFICIAL_ACCOUNT',
  275. // payChannel: 'MOBILE_WEB',
  276. payOption: isAlipay() ? 'ALIPAY' : 'WECHATPAY',
  277. appId: appId,
  278. // openId: 'oudWQ5SCDElfn-IQH6eBR5JesOz4', // 下的appid: wxd830fe4d1e04988e
  279. openId,
  280. };
  281. // console.log(1854, params);
  282. this.$md(params);
  283. // let path = `/profileApi/payment/v1/services/session/${session}/transactions`;
  284. let path = `${window.profileApi}/payment/v1/services/session/${session}/transactions`;
  285. this.$request({
  286. url: path,
  287. data: params,
  288. method: 'POST',
  289. header: JSON.parse(uni.getStorageSync('handleUser')),
  290. })
  291. .then(async (res) => {
  292. // this.Toastloading.clear();
  293. // console.log(1795, res);
  294. if (res.data?.code == '000000') {
  295. const prepayJson = res.data.data.params;
  296. console.log('prepayJson::', res.data)
  297. const platform = getPlatform();
  298. this.isPay = true
  299. // TODO: h5环境判断
  300. if (platform === 'micromessenger') {
  301. const weixinH5PayRes = await this.weixinH5Pay(prepayJson);
  302. // 微信支付完成,判断结果
  303. console.log(1784, weixinH5PayRes);
  304. // errMsg: 'requestPayment:ok'
  305. if (weixinH5PayRes?.errMsg === 'requestPayment:ok') {
  306. this.btnLoading = false
  307. this.isPay = false
  308. this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
  309. name: 'parkingFeeDetail'
  310. });
  311. this.$router.replace({
  312. // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
  313. path: this.getPagePath(),
  314. });
  315. } else {
  316. this.reCreateParkOrder();
  317. }
  318. } else {
  319. let options = {}
  320. if (isAlipay()) {
  321. options = {
  322. provider: 'alipay',
  323. orderInfo: prepayJson.trade_no,
  324. }
  325. } else {
  326. options = {
  327. provider: 'wxpay',
  328. timeStamp: prepayJson.timeStamp,
  329. nonceStr: prepayJson.nonceStr,
  330. package: prepayJson.package,
  331. signType: prepayJson.signType,
  332. paySign: prepayJson.paySign,
  333. }
  334. }
  335. window.toWXSendMsg({
  336. type: 'openWxPay',
  337. options: options,
  338. });
  339. window.subscribe('wxPayOver', (options) => {
  340. // this.Toastloading.clear();
  341. // console.log('微信支付结束之后的返回参数', options);
  342. // T-ODO: 在 qa 新发版前,只提示支付成功的信息(已处理成功信息)
  343. if (options?.wxPayOver === 'fail') {
  344. console.log('支付失败');
  345. this.reCreateParkOrder();
  346. } else {
  347. this.btnLoading = false;
  348. this.isPay = false
  349. this.$router.replace({
  350. // path: 'parkingFeeSuccess?vehicleNo=' + this.$route.query.vehicleNo,
  351. path: this.getPagePath(),
  352. });
  353. }
  354. });
  355. }
  356. } else {
  357. this.reCreateParkOrder();
  358. }
  359. })
  360. .catch((err) => {
  361. if(err.code === "ERR_NETWORK") {
  362. this.btnLoading = true;
  363. uni.showToast({ title: '网络连接失败,请重试', duration: 3000, icon: 'fail' });
  364. setTimeout(() => {
  365. this.$router.replace({
  366. // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
  367. path: 'home',
  368. });
  369. }, 2900)
  370. return
  371. }
  372. this.reCreateParkOrder();
  373. });
  374. },
  375. // 支付失败后返还优惠券
  376. failedParkOrder() {
  377. // this.Toastloading.clear();
  378. const param = {
  379. orderno: this.parkInfo.orderno,
  380. };
  381. this.$md(param);
  382. uni
  383. .request({
  384. url: this.$baseURL + 'api/1.0/park/failedParkOrder',
  385. data: param,
  386. method: 'POST',
  387. header: JSON.parse(uni.getStorageSync('handleUser')),
  388. })
  389. .then((res) => {
  390. this.reCreateParkOrder();
  391. })
  392. .catch((err) => {
  393. this.reCreateParkOrder();
  394. });
  395. },
  396. // 支付失败弹框 重新创建订单
  397. reCreateParkOrder() {
  398. // console.log('支付失败弹框 重新创建订单');
  399. Dialog.alert({
  400. title: '提示',
  401. message: '支付失败',
  402. confirmButtonColor: '#333',
  403. }).then(() => {
  404. this.$refs.countDown.reset(); // 停车场重置费用倒计时3分钟
  405. this.$store.dispatch('order/orderInit', {
  406. gateId: this.$route.query?.gateId,
  407. vehicleNo: this.$route.query?.vehicleNo,
  408. endlessLoop: this.endlessLoop
  409. })
  410. this.btnLoading = false;
  411. this.isPay = false
  412. // this.createParkOrder();
  413. });
  414. // uni.showModal({
  415. // showCancel: false,
  416. // title: '提示',
  417. // content: '支付失败',
  418. // complete: (r) => {
  419. // this.createParkOrder();
  420. // },
  421. // });
  422. },
  423. // 初始化
  424. async pageInit() {
  425. // console.log(247, checkOutResponse);
  426. // this.msData.detail = checkOutResponse
  427. // 停车优惠
  428. // this.discounts(this.msData.detail)
  429. // 积分减免
  430. // 优惠券
  431. // 纸质优惠券
  432. // 优惠金额
  433. // 应付金额
  434. // this.$store.commit('order/SET_ORDER_DETAIL', checkOutResponse);
  435. try {
  436. console.log('无牌车扫码出场', this.unlicensedInfo, this.endlessLoop);
  437. this.btnLoading = false
  438. this.isPay = false
  439. // return
  440. this.$store.dispatch('order/orderInit', {
  441. vehicleNo: this.$route.query.vehicleNo,
  442. gateId: this.$route.query?.gateId,
  443. endlessLoop: this.endlessLoop,
  444. callback: (res) => {
  445. setTimeout(() => {
  446. this.$store.dispatch('clearUnlicensed');
  447. }, 700);
  448. // 如果 无牌车扫码出场扫码 无需缴费,直接展示无需缴费页面
  449. if(/unlicensedOut/.test(res.code) && res?.unlicensed) {
  450. this.$router.replace({
  451. path: 'parkingFeeMsg?type=pay',
  452. });
  453. return
  454. }
  455. // 如果是无需缴费的话,提示用户无需缴费
  456. if (res?.orderDetail?.parkingRecord?.totalFee <= 0) {
  457. this.$store.dispatch('order/orderInitRule', res.orderDetail);
  458. setTimeout(() => {
  459. Dialog.alert({
  460. message: '当前无需缴费',
  461. confirmButtonColor: '#333',
  462. }).then(() => {
  463. this.$router.back()
  464. });
  465. }, 1000)
  466. return
  467. }
  468. if ( /CAR_NOT_FOUND|INOUT_FAILED/.test(res.code) ) {
  469. setTimeout(() => {
  470. this.$router.replace({
  471. path: 'parkingFeeMsg',
  472. query: {
  473. type: 'outFail'
  474. }
  475. })
  476. }, 300)
  477. return;
  478. }
  479. if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {
  480. // 当前车辆没有查到账单
  481. this.$router.replace({
  482. path: 'parkingFeePayment',
  483. query: {
  484. msg: res.langMessage,
  485. vehicleNo: this.$route.query.vehicleNo,
  486. },
  487. });
  488. return
  489. }
  490. if (/LOCAL_PARK_ERROR|INTERNAL_SERVER_ERROR|VALIDATION_FAILED|PLEASE_SCAN_QRCODE/g.test(res.code)) {
  491. setTimeout(() => {
  492. this.$router.back()
  493. }, 3000)
  494. }
  495. }
  496. });
  497. setTimeout(() => {
  498. this.$store.dispatch('clearUnlicensed');
  499. }, 1200);
  500. } catch (err) {
  501. console.log('查询车辆是否在场的报错信息?', err, err.code === "INTERNAL_SERVER_ERROR");
  502. // 如果网络异常(这里是因为订单页面存在空白场景,才需要单独处理报错交互)
  503. if (err.code === "INTERNAL_SERVER_ERROR") {
  504. this.$router.back()
  505. }
  506. }
  507. },
  508. // 停车优惠
  509. discounts() {
  510. // totalFee 为零的时候不做跳转
  511. if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
  512. if (!this.enableConsume && !this.memberLevelDiscount && this.orderDetail.parkInfo.parkMallCode !== 2) {
  513. return Toast({
  514. message: '暂无可用优惠',
  515. });
  516. }
  517. if( this.discountDesc !== '暂无可用优惠') {
  518. this.$router.push({
  519. path: 'parkingFeeDiscounts',
  520. });
  521. }
  522. },
  523. setColor() {
  524. window?.toWXSendMsg({
  525. type: 'uni_func',
  526. funcName: 'setNavigationBarColor',
  527. options: {
  528. frontColor: '#000000',
  529. backgroundColor: '#2151C5',
  530. },
  531. });
  532. // uni.setNavigationBarColor({
  533. // frontColor: '#000000',
  534. // backgroundColor: '#FAFBFF',
  535. // });
  536. },
  537. // 是否展示优惠信息
  538. // isShowDiscounts(params) {
  539. // console.log(277, params?.parkingRule?.enableCoupon);
  540. // return params?.parkingRule?.enableCoupon
  541. // },
  542. //
  543. // 计算优惠信息
  544. discountssss(params) {
  545. // console.log(275, params);
  546. // console.log(275, params.discountInfo);
  547. // console.log(275, params.discountInfo.consume);
  548. return 1;
  549. },
  550. coupon() {
  551. // totalFee 为零的时候不做跳转
  552. if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
  553. // 如果没有电子券的话,提示用户
  554. if (this.coupons.length === 0 && this.source !== 'KIP') {
  555. uni.showToast({
  556. title: '暂无可使用的优惠券,请前往积分商城兑换优惠券'
  557. })
  558. return
  559. }
  560. this.$router.push({
  561. path: 'parkingFeeCoupon',
  562. });
  563. },
  564. paperCoupon() {
  565. // totalFee 为零的时候不做跳转
  566. if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
  567. this.$router.push({
  568. path: 'parkingFeePaperCoupon',
  569. query:{
  570. vehicleNo: this.$route.query.vehicleNo
  571. }
  572. });
  573. },
  574. duration() { },
  575. couponCount() { },
  576. // 重置倒计时
  577. resetCountDown() {
  578. this.$refs?.countDown?.reset();
  579. this.btnLoading = false;
  580. this.isPay = false
  581. this.$store.dispatch('order/orderInit', {
  582. gateId: this.$route.query?.gateId,
  583. vehicleNo: this.$route.query?.vehicleNo,
  584. endlessLoop: this.endlessLoop
  585. })
  586. // 重新创建订单
  587. // this.createParkOrder();
  588. },
  589. //缴费说明隐藏显示
  590. togglePayinstruction() {
  591. this.isShowDescription = !this.isShowDescription;
  592. },
  593. // 积分修改框
  594. showPointsMathPopup() {
  595. // totalFee 为零的时候不做跳转
  596. if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
  597. if(this.integralDesc === '暂无可用积分'){
  598. return
  599. }
  600. this.popup = true;
  601. },
  602. cancelPointsMathPopup() {
  603. this.$store.dispatch('order/cancelPointsMath', () => {
  604. this.popup = false;
  605. });
  606. },
  607. savePointsMathPopup() {
  608. this.$store.dispatch('order/savePointsMath', () => {
  609. this.popup = false;
  610. });
  611. },
  612. // 获取成功缴费之后前往的页面
  613. getPagePath() {
  614. let pagePath = 'parkingFeeSuccess?vehicleNo=' + this.$route.query.vehicleNo
  615. console.log('临时车流程', this.endlessLoop);
  616. if (this.$route.query.vehicleNo.indexOf('临') > -1 && this.endlessLoop || this.$route.query.gateId) {
  617. pagePath = 'parkingFeeMsg?type=pay'
  618. }
  619. return pagePath
  620. },
  621. pointsMathCallback({type, message}) {
  622. // console.log(465, type);
  623. Toast({
  624. message: message,
  625. icon: 'none',
  626. });
  627. },
  628. //
  629. setDescription() {
  630. if ( this?.orderDetail?.parkInfo?.description.length > 0 ) {
  631. let reg = /[;;]/g;
  632. return this.orderDetail.parkInfo.description.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
  633. }
  634. return ''
  635. }
  636. },
  637. };