C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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