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

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