C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

966 lines
24 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  2. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  3. let app = getApp();
  4. const format = require("../utils/util.js");
  5. let config = require("../config/config.js");
  6. let Http = require("../utils/HttpBasics");
  7. let Util = require("../utils/util");
  8. const imgurl = require("../utils/imgurl");
  9. Page({
  10. data: {
  11. navigationBarHeight,
  12. jianUrl: imgurl.jian.url,
  13. jiaofeiwm: imgurl.jiaofeiwm.url,
  14. parkUrl: imgurl.park.url,
  15. guanliHr: imgurl.guanliHr.url,
  16. qidaiUrl: imgurl.qidai.url,
  17. addUrl: imgurl.add.url,
  18. tingcheHr: imgurl.tingcheHr.url,
  19. cheUrl: imgurl.che.url,
  20. jiaofei: imgurl.jiaofei.url,
  21. wentiHr: imgurl.wentiHr.url,
  22. stopThat: imgurl.stopThat.url,
  23. park: null,
  24. carList: [],
  25. payList: [],
  26. addCar: null,
  27. tcq: 2,
  28. flag: "",
  29. extraData: {},
  30. desc: '',
  31. title: '',
  32. indicatorDots: true,
  33. autoplay: false,
  34. interval: 5000,
  35. duration: 1000,
  36. current: 0,
  37. stopFees: {},
  38. scroll: true,
  39. ifHaveCarModular: "",
  40. canIUse: wx.canIUse("navigator"),
  41. showTicketModal: false,
  42. ticketList: [],
  43. noCoupon: imgurl.noCoupon.url,
  44. loadingUrl: imgurl.loading.url,
  45. allow_load: true,
  46. curPageNum: 1,
  47. curPageSize: 15,
  48. curTotalpageNum: 0,
  49. quantitle: '',
  50. quanid: '',
  51. gouHr: imgurl.gouHr.url,
  52. totalTicketNum: 0,
  53. remark: '',
  54. generalPayPath: '',
  55. generalExtraData: {},
  56. goHomeUrl: "",
  57. },
  58. getMoreList(e) {
  59. let totalNum = this.data.ticketList.length;
  60. if (this.data.curPageNum < this.data.curTotalpageNum) {
  61. this.setData({
  62. curPageNum: this.data.curPageNum + 1
  63. })
  64. this.getTicketList(0, this.data.curPageNum);
  65. }
  66. },
  67. /**
  68. * 选择使用的优惠券
  69. */
  70. choicecoupon: function (e) {
  71. var that = this;
  72. wx.showModal({
  73. title: '确定是否使用停车券',
  74. content: '使用后无法撤销',
  75. success(res) {
  76. if (res.confirm) {
  77. var quantitle = e.currentTarget.dataset.title;
  78. var quanid = e.currentTarget.dataset.id;
  79. that.setData({
  80. quanid: quanid,
  81. showTicketModal: false,
  82. });
  83. that.bindCoupon(that.data.quanid, quantitle);
  84. } else if (res.cancel) {
  85. console.log('用户点击取消')
  86. }
  87. }
  88. })
  89. },
  90. /*
  91. */
  92. getTicketList(key, pageNum) {
  93. var that = this;
  94. if (that.data.allow_load) {
  95. wx.showLoading({
  96. title: "加载中"
  97. });
  98. Http.get({
  99. url: config.api.couponOrderCarList,
  100. data: {
  101. pageNum: pageNum,
  102. pageSize: 15,
  103. couponOrderStatus: key
  104. }
  105. }).then(res => {
  106. that.setData({
  107. curTotalpageNum: res.data.pages,
  108. curPageNum: res.data.pageNum,
  109. totalTicketNum: res.data.total
  110. })
  111. res.data.list.map(file => {
  112. file.expiredTime = format.formatTime(
  113. file.expiredTime,
  114. "yyyy-MM-dd hh:mm:ss"
  115. );
  116. });
  117. setTimeout(function () {
  118. wx.hideLoading();
  119. }, 1200);
  120. if (pageNum >= res.data.pages) {
  121. that.setData({
  122. allow_load: false
  123. });
  124. }
  125. /**
  126. * 先赋值后渲染页面
  127. * concat 不会改变原数组值
  128. * push 会改变原数组值,但不会一条一条插入,而是整个数组插入
  129. */
  130. if (pageNum == 1) {
  131. that.setData({
  132. ticketList: res.data.list,
  133. curPageNum: pageNum
  134. });
  135. } else {
  136. that.setData({
  137. ticketList: that.data.ticketList.concat(res.data.list)
  138. });
  139. }
  140. // that.data.ticketList = that.data.ticketList.concat(res.data.list);
  141. wx.hideLoading();
  142. })
  143. .catch(err => {
  144. setTimeout(function () {
  145. wx.hideLoading();
  146. }, 1200);
  147. wx.showToast({
  148. title: err.errMsg,
  149. icon: 'none',
  150. duration: 2000,
  151. mask: false
  152. });
  153. })
  154. } else { }
  155. },
  156. //点击跳转到券详情页面
  157. gotouse: function (e) {
  158. wx.navigateTo({
  159. url: `/pages/passCar/couponDetail/couponDetail?quancode=${e.currentTarget.dataset.quancode
  160. }`,
  161. success: function (res) {
  162. // success
  163. },
  164. fail: function () {
  165. // fail
  166. },
  167. complete: function () {
  168. // complete
  169. }
  170. });
  171. },
  172. /**
  173. * 车牌轮播滑动
  174. */
  175. onSlideChangeEnd: function (e) {
  176. var that = this;
  177. /**
  178. * 获得当前的车牌号码
  179. */
  180. var listCardNum = (that.data.carList)[e.detail.current].carNumber;
  181. that.setData({
  182. listCardNum: listCardNum
  183. });
  184. /**
  185. * 获得停车费用
  186. */
  187. if (that.data.scroll) {
  188. that.getStopFee(listCardNum);
  189. }
  190. },
  191. //停车费用为0
  192. paySuccess: function () {
  193. wx.showModal({
  194. title: '支付成功',
  195. content: '请15分钟内离场',
  196. showCancel: false
  197. })
  198. },
  199. gotomange: function () {
  200. wx.navigateTo({
  201. url: '/pages/managelicenseplate/managelicenseplate',
  202. })
  203. },
  204. bindfail: function (res) {
  205. console.log(123)
  206. console.log(res)
  207. },
  208. gotoCarMini: function (e) {
  209. console.log(478)
  210. var that = this
  211. // etcp parkVendor1
  212. // 泊链停车 parkVendor5
  213. if (e.target.dataset.flag == 'parkVendor1') {
  214. wx.navigateToMiniProgram({
  215. appId: that.data.etcpAppId,
  216. extraData: that.data.extraData,
  217. envVersion: that.data.carMiniVersion,
  218. path: that.data.payPath
  219. })
  220. } else if (e.target.dataset.flag == 'parkVendor5') {
  221. wx.navigateToMiniProgram({
  222. appId: that.data.bolinkAppId,
  223. extraData: that.data.extraData,
  224. envVersion: that.data.carMiniVersion,
  225. path: that.data.payPath
  226. })
  227. }
  228. },
  229. showquan: function () {
  230. wx.navigateTo({
  231. url: '/pages/passCar/couponList/couponList',
  232. })
  233. },
  234. gotodetail: function (e) {
  235. wx.showModal({
  236. title: '缴费规则',
  237. content: e.target.dataset.rule,
  238. showCancel: false,
  239. })
  240. },
  241. onShow: function (options) {
  242. this.setData({
  243. goHomeUrl: app.globalData.goHomeUrl
  244. })
  245. if (typeof this.getTabBar === 'function' &&
  246. this.getTabBar()) {
  247. this.getTabBar().setData({
  248. selected: 2
  249. })
  250. }
  251. var that = this;
  252. that.setData({
  253. etcpAppId: extConfig.attr.car.etcp.etcpAppId,
  254. carMiniVersion: extConfig.attr.car.version,
  255. etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl,
  256. payPath: extConfig.attr.car.etcp.payPath,
  257. ifHaveCarModular: extConfig.attr.ifHaveCarModular
  258. })
  259. console.log(this.data.ifHaveCarModular, 'ifHaveCarModular');
  260. if (app.globalData.token) {
  261. that.getList();
  262. that.init();
  263. } else {
  264. that.init();
  265. }
  266. /**
  267. * 只有用户选择了优惠券
  268. * 才会进行券和车牌的绑定
  269. */
  270. /* if (wx.getStorageSync("chosed") && that.data.quanid) {
  271. that.getStopFee(that.data.listCardNum);
  272. that.bindCoupon(that.data.quanid);
  273. wx.setStorage({
  274. key: 'chosed',
  275. data: '',
  276. })
  277. }; */
  278. if (app.globalData.token) {
  279. // that.initUsrCarList();
  280. that.initUsrCarList("flags");
  281. that.setData({
  282. current: 0
  283. })
  284. }
  285. if (that.data.addCar) {
  286. // 绑车牌
  287. if (app.globalData.carLogin) {
  288. that.bindCar(that.data.addCar);
  289. } else {
  290. that.bindCar(that.data.addCar);
  291. }
  292. that.setData({
  293. addCar: null
  294. });
  295. }
  296. this.getTicketList(0, 1);
  297. },
  298. cancelMove: function () {
  299. console.log(111)
  300. return false;
  301. },
  302. onHide: function () {
  303. this.setData({
  304. allow_load: true,
  305. showTicketModal: false,
  306. curPageNum: 1,
  307. ticketList: []
  308. })
  309. },
  310. onLoad: function (options) {
  311. var that = this;
  312. /**
  313. * 获得分享小程序的
  314. * title
  315. * desc
  316. */
  317. Http.get({
  318. url: config.api.getWeapNote,
  319. data: {
  320. appId: config.weapp.AppId,
  321. }
  322. })
  323. .then(res => {
  324. let weapNote = JSON.parse(res.data.weapNote);
  325. that.setData({
  326. desc: weapNote.carpage.desc,
  327. title: weapNote.carpage.title
  328. })
  329. })
  330. .catch(err => {
  331. console.log(err);
  332. })
  333. // 登录
  334. var scene = decodeURIComponent(options.scene);
  335. that.setData({
  336. scene: scene
  337. });
  338. if (app.globalData.token) { } else {
  339. // app.getLocation();
  340. that.userLogin()
  341. }
  342. },
  343. /**
  344. * 用户登录
  345. */
  346. userLogin: function () {
  347. var that = this;
  348. // 登录
  349. wx.login({
  350. success: ({
  351. code
  352. }) => {
  353. wx.getSystemInfo({
  354. success: function (res) {
  355. that.setData({
  356. systemInfo: JSON.stringify(res)
  357. })
  358. }
  359. })
  360. var usrdata = {
  361. appId: config.weapp.AppId,
  362. code: code,
  363. sceneAddress: app.globalData.sceneAddress,
  364. scene: that.data.scene,
  365. systemInfo: that.data.systemInfo
  366. };
  367. if (app.globalData.locationInfo) {
  368. usrdata = {
  369. appId: config.weapp.AppId,
  370. code: code,
  371. sceneAddress: app.globalData.sceneAddress,
  372. latitude: "" + app.globalData.locationInfo.latitude,
  373. longitude: "" + app.globalData.locationInfo.longitude,
  374. scene: that.data.scene,
  375. systemInfo: that.data.systemInfo
  376. };
  377. }
  378. Http.post({
  379. url: config.api.login,
  380. data: usrdata
  381. })
  382. .then(res => {
  383. app.globalData.token = res.data.token;
  384. Http.setToken(res.data.token);
  385. that.checkUserCarStatus();
  386. that.getList();
  387. that.init();
  388. that.initUsrCarList();
  389. return Http.get({
  390. url: config.api.checkUserStatus,
  391. data: {}
  392. });
  393. })
  394. .then(res => { })
  395. .catch(err => {
  396. if (err.code == 11004) {
  397. // 用户昵称未授权
  398. wx.redirectTo({
  399. url: "/pages/getuserinfo/index"
  400. });
  401. } else {
  402. wx.showModal({
  403. title: '提示',
  404. content: err.errMsg,
  405. showCancel: false
  406. })
  407. }
  408. });
  409. }
  410. });
  411. },
  412. /**
  413. * 检查用户是否有车
  414. */
  415. checkUserCarStatus: function () {
  416. var that = this;
  417. Http.get({
  418. url: config.api.userCarCount,
  419. data: {}
  420. }).then(res => {
  421. if (res.data > 0) {
  422. // 用户名下有车
  423. app.globalData.phone = res.data.phone;
  424. app.globalData.supportCar = true;
  425. // 共同登录
  426. that.userCarLogin();
  427. }
  428. })
  429. .catch(err => { })
  430. },
  431. jumpToAdd: function () {
  432. wx.navigateTo({
  433. url: `/pages/addPark/addPark?flags=managepalte`
  434. });
  435. },
  436. passc: function () {
  437. wx.navigateTo({
  438. url: '/pages/ques/ques',
  439. })
  440. },
  441. goExplain: function () {
  442. wx.navigateTo({
  443. url: '/pages/tcExplain/tcExplain',
  444. })
  445. },
  446. /**
  447. * 券绑定车牌
  448. */
  449. bindCoupon: function (quanid, quantitle) {
  450. wx.showLoading({
  451. title: '使用中...',
  452. })
  453. var that = this;
  454. /**
  455. * etcp
  456. */
  457. var postCouponData = {
  458. etcpToken: app.globalData.etcpToken,
  459. carNumber: that.data.listCardNum,
  460. couponOrderId: quanid
  461. };
  462. if (app.globalData.parkVendor == 2) {
  463. // 停简单
  464. postCouponData = {
  465. carNumber: that.data.listCardNum
  466. }
  467. }
  468. if (app.globalData.parkVendor == 4) {
  469. // 尚安
  470. postCouponData = {
  471. carNumber: that.data.listCardNum,
  472. couponOrderId: quanid
  473. }
  474. }
  475. if (app.globalData.parkVendor == 5) {
  476. // 泊链
  477. postCouponData = {
  478. carNumber: that.data.listCardNum,
  479. orderId: that.data.bolinkOrderId,
  480. couponOrderId: quanid
  481. }
  482. }
  483. if (app.globalData.parkVendor >= 6) {
  484. console.log(123456789)
  485. postCouponData = {
  486. carNumber: that.data.listCardNum,
  487. // orderId: that.data.bolinkOrderId,
  488. couponOrderId: quanid,
  489. parkOrderId: that.data.stopFees.orderId
  490. }
  491. }
  492. Http.post({
  493. url: config.api.getCarCoupon,
  494. data: postCouponData
  495. })
  496. .then(res => {
  497. wx.hideLoading()
  498. // if(res.data){
  499. that.getStopFee(that.data.listCardNum);
  500. that.initUsrCarList();
  501. that.setData({
  502. quantitle: quantitle, //接口条用成功后在赋值
  503. })
  504. // }else{
  505. // wx.showToast({
  506. // title: res.message,
  507. // icon: 'none',
  508. // duration: 3000,
  509. // mask: false
  510. // });
  511. // }
  512. })
  513. .catch(err => {
  514. wx.hideLoading()
  515. if (err.message != undefined) {
  516. wx.showToast({
  517. title: err.message,
  518. icon: 'none',
  519. duration: 3000,
  520. mask: false
  521. });
  522. }
  523. })
  524. },
  525. /**
  526. * 选择优惠券
  527. */
  528. // gotoquan: function () {
  529. // let that = this;
  530. // if (that.data.quanid) {
  531. // wx.navigateTo({
  532. // url: `/pages/passCar/choicecoupon/choicecoupon?quanid=${that.data.quanid}`,
  533. // })
  534. // } else {
  535. // wx.navigateTo({
  536. // url: '/pages/passCar/choicecoupon/choicecoupon',
  537. // })
  538. // }
  539. // },
  540. closeTicketModal: function () {
  541. this.setData({
  542. showTicketModal: false
  543. })
  544. },
  545. /**
  546. * 停车券 弹框
  547. */
  548. openTicketModal: function () {
  549. this.setData({
  550. showTicketModal: true,
  551. allow_load: true,
  552. ticketList: [],
  553. curPageNum: 1,
  554. })
  555. this.getTicketList(0, 1);
  556. /* if (!this.data.ticketList.length){
  557. this.getTicketList(0, 1);
  558. } */
  559. },
  560. //获取名下停车券列表
  561. getList() {
  562. var that = this;
  563. Http.get({
  564. url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
  565. data: {
  566. pageNum: 1,
  567. pageSize: 15,
  568. couponOrderStatus: 0
  569. }
  570. }).then(res => {
  571. that.setData({
  572. couponList: res.data.list
  573. });
  574. })
  575. .catch(err => {
  576. console.log(err)
  577. })
  578. },
  579. /**
  580. * 共同登录
  581. */
  582. init: function (carNumber) {
  583. var that = this;
  584. app.parkInitCallback = token => {
  585. that.initPark();
  586. that.getParkStatus();
  587. if (!app.globalData.carLogin) {
  588. Http.get({
  589. url: config.api.checkUserStatus,
  590. data: {}
  591. }).then(res => {
  592. app.globalData.type = 'pc'
  593. /**
  594. * 判断是否授权手机号
  595. */
  596. Http.get({
  597. url: config.api.checkPhoneStatus,
  598. data: {}
  599. })
  600. .then(res => {
  601. Http.post({
  602. url: config.api.carInit,
  603. data: {
  604. phone: app.globalData.phone
  605. }
  606. }).then(res => {
  607. app.globalData.carLogin = true;
  608. app.globalData.parkVendor = res.data.vendor;
  609. if (res.data.token) {
  610. app.globalData.etcpToken = res.data.token;
  611. }
  612. /**
  613. * 获得停车费用
  614. */
  615. that.initUsrCarList("flags");
  616. });
  617. })
  618. .catch(err => {
  619. if (err.code == 11005) {
  620. // 用户手机未授权
  621. /**
  622. * 将值传到用户手机号授权的页面
  623. *
  624. */
  625. wx.redirectTo({
  626. url: "/pages/getphoneInfo/index"
  627. });
  628. } else if (err.code == 11006) {
  629. // 用户手机已加密
  630. wx.redirectTo({
  631. url: "/pages/phoneinput/phoneinput"
  632. });
  633. } else {
  634. wx.showToast({
  635. title: err.errMsg,
  636. icon: 'none',
  637. duration: 2000,
  638. mask: false
  639. });
  640. }
  641. })
  642. }).catch(err => {
  643. app.globalData.type = 'pc'
  644. if (err.code == 11004) {
  645. // 用户昵称未授权
  646. wx.redirectTo({
  647. url: "/pages/getuserinfo/index"
  648. });
  649. } else {
  650. wx.showModal({
  651. title: '提示',
  652. content: err.errMsg,
  653. showCancel: false
  654. })
  655. }
  656. });
  657. }
  658. };
  659. if (app.globalData.token && app.globalData.token != null) {
  660. app.parkInitCallback(app.globalData.token);
  661. }
  662. },
  663. bindCar: function (carNum) {
  664. var that = this;
  665. // ETCP
  666. var etcpData = {
  667. etcpToken: app.globalData.etcpToken,
  668. carNumber: carNum
  669. };
  670. var otherData = {
  671. carNumber: carNum
  672. };
  673. var postData = app.globalData.parkVendor == 1 ? etcpData : otherData;
  674. Http.post({
  675. url: config.api.bindCar,
  676. data: postData
  677. })
  678. .then(res => {
  679. that.setData({
  680. addCar: null
  681. });
  682. that.initUsrCarList();
  683. wx.showModal({
  684. title: "提示",
  685. showCancel: false,
  686. content: "绑车牌成功!",
  687. success: function () { }
  688. });
  689. })
  690. .catch(error => {
  691. wx.showModal({
  692. title: "提示",
  693. showCancel: false,
  694. content: error.data.message,
  695. success: function () { }
  696. });
  697. });
  698. },
  699. /**
  700. * 车场信息获取
  701. */
  702. initPark: function () {
  703. var that = this;
  704. Http.get({
  705. url: config.api.getParkInfo,
  706. data: {}
  707. })
  708. .then(res => {
  709. that.setData({
  710. park: res.data
  711. })
  712. if (res.data) {
  713. app.globalData.parkVendor = res.data.vendorType;
  714. if (app.globalData.parkVendor == 1) {
  715. console.log("payPath: " + extConfig.attr.car.etcp.payPath)
  716. // etcp
  717. that.setData({
  718. parkVendor: app.globalData.parkVendor,
  719. etcpAppId: extConfig.attr.car.etcp.etcpAppId,
  720. carMiniVersion: extConfig.attr.car.version,
  721. etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl,
  722. payPath: extConfig.attr.car.etcp.payPath
  723. })
  724. } else if (app.globalData.parkVendor == 2) {
  725. // TJD
  726. var vendorObj = JSON.parse(res.data.vendorParams)
  727. that.setData({
  728. parkVendor: app.globalData.parkVendor,
  729. tjdAppId: extConfig.attr.car.tjd.tjdAppId,
  730. carMiniVersion: extConfig.attr.car.version,
  731. payPath: extConfig.attr.car.tjd.payPath
  732. })
  733. } else if (app.globalData.parkVendor == 5) {
  734. // 泊链
  735. var vendorObj = JSON.parse(res.data.vendorParams)
  736. console.log("payPath: " + extConfig.attr.car.bolink.payPath)
  737. that.setData({
  738. parkVendor: app.globalData.parkVendor,
  739. bolinkAppId: extConfig.attr.car.bolink.bolinkAppId,
  740. carMiniVersion: extConfig.attr.car.version,
  741. payPath: extConfig.attr.car.bolink.payPath,
  742. bolinkComId: vendorObj.comid,
  743. bolinkUnionId: vendorObj.union_id
  744. })
  745. }
  746. }
  747. })
  748. .catch(err => {
  749. console.log(err);
  750. // wx.showToast({
  751. // title: err.message,
  752. // icon: 'none',
  753. // duration: 2000,
  754. // mask: false
  755. // });
  756. })
  757. },
  758. /**
  759. * 车场状态获取
  760. */
  761. getParkStatus: function () {
  762. var that = this;
  763. Http.get({
  764. url: config.api.getParkStatus,
  765. })
  766. .then(res => {
  767. console.log(res)
  768. })
  769. .catch(err => {
  770. console.log(err)
  771. // wx.showToast({
  772. // title: err.message,
  773. // icon:"none"
  774. // })
  775. })
  776. },
  777. /**
  778. * 绑定车获取
  779. */
  780. initUsrCarList: function (flag) {
  781. var that = this;
  782. Http.get({
  783. url: config.api.getUserCarList,
  784. data: {}
  785. }).then(res => {
  786. that.setData({
  787. carList: res.data
  788. });
  789. /**
  790. * flag ==flags
  791. * 表示从首页onShow进来的
  792. */
  793. if (flag == "flags" && res.data.length > 0) {
  794. var listCardNum = res.data[0].carNumber;
  795. that.setData({
  796. listCardNum: listCardNum
  797. })
  798. /**
  799. * 获得停车费用
  800. */
  801. that.getStopFee(listCardNum);
  802. }
  803. })
  804. .catch(err => {
  805. wx.showToast({
  806. title: err.message,
  807. icon: 'none',
  808. duration: 2000,
  809. mask: false
  810. });
  811. })
  812. },
  813. /**
  814. * 获得停车费用修改
  815. */
  816. getStopFee: function (carNumber) {
  817. let that = this;
  818. let postData =
  819. app.globalData.parkVendor == 1 ? {
  820. etcpToken: app.globalData.etcpToken,
  821. carNumber: carNumber
  822. } : {
  823. carNumber: carNumber
  824. };
  825. Http.post({
  826. url: config.api.getCarStopFee,
  827. data: postData
  828. })
  829. .then(res => {
  830. console.log(res)
  831. if (app.globalData.parkVendor == 1) { // ETCP
  832. var extraDataStr = {
  833. params: {
  834. token: app.globalData.etcpToken,
  835. syncId: res.data.orderId,
  836. payType: 6, // 小程序支付
  837. CarNumber: carNumber,
  838. returnUrl: that.data.etcpCallbackUrl,
  839. source: "FUMAO-001",
  840. actionId: "1" //操作ID,1:小程序支付
  841. }
  842. }
  843. that.setData({
  844. parkVendor: app.globalData.parkVendor,
  845. extraData: extraDataStr,
  846. stopFees: res.data,
  847. timecha: Util.timecha(res.data.exitTime, res.data.entranceTime)
  848. });
  849. } else if (app.globalData.parkVendor == 2) { // TJD // TODO
  850. var extraDataStr = {
  851. prePayType: that.data.prePayType,
  852. channel: res.data.channel,
  853. isShowDetail: true,
  854. orderId: res.data.orderId
  855. }
  856. that.setData({
  857. parkVendor: app.globalData.parkVendor,
  858. extraData: extraDataStr,
  859. stopFees: {
  860. orderId: res.data.orderId,
  861. entranceTime: res.data.start_time,
  862. remainingFee: res.data.money
  863. },
  864. timecha: res.data.duration
  865. });
  866. } else if (app.globalData.parkVendor == 5) { // BoLink
  867. var extraDataStr = {
  868. union_id: that.data.bolinkUnionId,
  869. order_id: res.data.order_id,
  870. park_id: that.data.bolinkComId,
  871. plate_number: res.data.plate_number,
  872. money: res.data.money,
  873. park_name: res.data.park_name
  874. }
  875. that.setData({
  876. parkVendor: app.globalData.parkVendor,
  877. bolinkOrderId: res.data.order_id,
  878. extraData: extraDataStr,
  879. stopFees: {
  880. orderId: res.data.order_id,
  881. entranceTime: res.data.start_time,
  882. remainingFee: res.data.money
  883. },
  884. timecha: res.data.duration
  885. });
  886. } else {
  887. // var extraDataStr = {
  888. // params: {
  889. // token: app.globalData.etcpToken,
  890. // syncId: res.data.orderId,
  891. // payType: 6, // 小程序支付
  892. // CarNumber: carNumber,
  893. // returnUrl: that.data.etcpCallbackUrl,
  894. // source: "FUMAO-001",
  895. // actionId: "1",//操作ID,1:小程序支付
  896. // },
  897. // }
  898. that.setData({
  899. parkVendor: app.globalData.parkVendor,
  900. // extraData: extraDataStr,
  901. stopFees: res.data,
  902. timecha: Util.timecha(res.data.exitTime, res.data.entranceTime),
  903. remark: res.data.remark,
  904. generalAppId: res.data.appId,
  905. generalPayPath: res.data.payPath,
  906. generalExtraData: res.data.extraData,
  907. extraDataFlag: JSON.stringify(res.data.extraData),
  908. });
  909. console.log(that.data.extraDataFlag, "123456789")
  910. }
  911. that.setData({
  912. scroll: true
  913. })
  914. })
  915. .catch(error => {
  916. that.setData({
  917. stopFees: {},
  918. scroll: true
  919. })
  920. });
  921. },
  922. /**
  923. * 下拉刷新
  924. */
  925. onPullDownRefresh: function (e) {
  926. let that = this;
  927. that.initUsrCarList("flags");
  928. that.setData({
  929. current: 0
  930. })
  931. wx.stopPullDownRefresh();
  932. }
  933. });