C端小程序
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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