C端小程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

941 linhas
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. wx.showLoading({
  448. title: '使用中...',
  449. })
  450. var that = this;
  451. /**
  452. * etcp
  453. */
  454. var postCouponData = {
  455. etcpToken: app.globalData.etcpToken,
  456. carNumber: that.data.listCardNum,
  457. couponOrderId: quanid
  458. };
  459. if (app.globalData.parkVendor == 2) {
  460. // 停简单
  461. postCouponData = {
  462. carNumber: that.data.listCardNum
  463. }
  464. }
  465. if (app.globalData.parkVendor == 4){
  466. // 尚安
  467. postCouponData = {
  468. carNumber: that.data.listCardNum,
  469. couponOrderId: quanid
  470. }
  471. }
  472. if (app.globalData.parkVendor == 5) {
  473. // 泊链
  474. postCouponData = {
  475. carNumber: that.data.listCardNum,
  476. orderId: that.data.bolinkOrderId,
  477. couponOrderId: quanid
  478. }
  479. }
  480. if (app.globalData.parkVendor>=6){
  481. console.log(123456789)
  482. postCouponData = {
  483. carNumber: that.data.listCardNum,
  484. // orderId: that.data.bolinkOrderId,
  485. couponOrderId: quanid,
  486. parkOrderId: that.data.stopFees.orderId
  487. }
  488. }
  489. Http.post({
  490. url: config.api.getCarCoupon,
  491. data: postCouponData
  492. })
  493. .then(res => {
  494. wx.hideLoading()
  495. // if(res.data){
  496. that.getStopFee(that.data.listCardNum);
  497. that.initUsrCarList();
  498. that.setData({
  499. quantitle: quantitle,//接口条用成功后在赋值
  500. })
  501. // }else{
  502. // wx.showToast({
  503. // title: res.message,
  504. // icon: 'none',
  505. // duration: 3000,
  506. // mask: false
  507. // });
  508. // }
  509. })
  510. .catch(err => {
  511. wx.hideLoading()
  512. if (err.message!=undefined) {
  513. wx.showToast({
  514. title: err.message,
  515. icon: 'none',
  516. duration: 3000,
  517. mask: false
  518. });
  519. }
  520. })
  521. },
  522. /**
  523. * 选择优惠券
  524. */
  525. // gotoquan: function () {
  526. // let that = this;
  527. // if (that.data.quanid) {
  528. // wx.navigateTo({
  529. // url: `/pages/passCar/choicecoupon/choicecoupon?quanid=${that.data.quanid}`,
  530. // })
  531. // } else {
  532. // wx.navigateTo({
  533. // url: '/pages/passCar/choicecoupon/choicecoupon',
  534. // })
  535. // }
  536. // },
  537. closeTicketModal: function () {
  538. this.setData({
  539. showTicketModal: false
  540. })
  541. },
  542. /**
  543. * 停车券 弹框
  544. */
  545. openTicketModal: function () {
  546. this.setData({
  547. showTicketModal: true,
  548. allow_load: true,
  549. ticketList: [],
  550. curPageNum: 1,
  551. })
  552. this.getTicketList(0, 1);
  553. /* if (!this.data.ticketList.length){
  554. this.getTicketList(0, 1);
  555. } */
  556. },
  557. //获取名下停车券列表
  558. getList() {
  559. var that = this;
  560. Http.get({
  561. url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
  562. data: {
  563. pageNum: 1,
  564. pageSize: 15,
  565. couponOrderStatus: 0
  566. }
  567. }).then(res => {
  568. that.setData({
  569. couponList: res.data.list
  570. });
  571. })
  572. .catch(err => {
  573. console.log(err)
  574. })
  575. },
  576. /**
  577. * 共同登录
  578. */
  579. init: function (carNumber) {
  580. var that = this;
  581. app.parkInitCallback = token => {
  582. that.initPark();
  583. that.getParkStatus();
  584. if (!app.globalData.carLogin) {
  585. /**
  586. * 判断是否授权手机号
  587. */
  588. Http.get({
  589. url: config.api.checkPhoneStatus,
  590. data: {}
  591. })
  592. .then(res => {
  593. Http.post({
  594. url: config.api.carInit,
  595. data: {
  596. phone: app.globalData.phone
  597. }
  598. }).then(res => {
  599. app.globalData.carLogin = true;
  600. app.globalData.parkVendor = res.data.vendor;
  601. if (res.data.token) {
  602. app.globalData.etcpToken = res.data.token;
  603. }
  604. /**
  605. * 获得停车费用
  606. */
  607. that.initUsrCarList("flags");
  608. });
  609. })
  610. .catch(err => {
  611. if (err.code == 11005) {
  612. // 用户手机未授权
  613. /**
  614. * 将值传到用户手机号授权的页面
  615. *
  616. */
  617. wx.redirectTo({
  618. url: "/pages/getphoneInfo/index"
  619. });
  620. } else if (err.code == 11006) {
  621. // 用户手机已加密
  622. wx.redirectTo({
  623. url: "/pages/phoneinput/phoneinput"
  624. });
  625. } else {
  626. wx.showToast({
  627. title: err.errMsg,
  628. icon: 'none',
  629. duration: 2000,
  630. mask: false
  631. });
  632. }
  633. })
  634. }
  635. };
  636. if (app.globalData.token && app.globalData.token != null) {
  637. app.parkInitCallback(app.globalData.token);
  638. }
  639. },
  640. bindCar: function (carNum) {
  641. var that = this;
  642. // ETCP
  643. var etcpData = {
  644. etcpToken: app.globalData.etcpToken,
  645. carNumber: carNum
  646. };
  647. var otherData = {
  648. carNumber: carNum
  649. };
  650. var postData = app.globalData.parkVendor == 1 ? etcpData : otherData;
  651. Http.post({
  652. url: config.api.bindCar,
  653. data: postData
  654. })
  655. .then(res => {
  656. that.setData({
  657. addCar: null
  658. });
  659. that.initUsrCarList();
  660. wx.showModal({
  661. title: "提示",
  662. showCancel: false,
  663. content: "绑车牌成功!",
  664. success: function () { }
  665. });
  666. })
  667. .catch(error => {
  668. wx.showModal({
  669. title: "提示",
  670. showCancel: false,
  671. content: error.data.message,
  672. success: function () { }
  673. });
  674. });
  675. },
  676. /**
  677. * 车场信息获取
  678. */
  679. initPark: function () {
  680. var that = this;
  681. Http.get({
  682. url: config.api.getParkInfo,
  683. data: {}
  684. })
  685. .then(res => {
  686. that.setData({
  687. park: res.data
  688. })
  689. if (res.data){
  690. app.globalData.parkVendor = res.data.vendorType;
  691. if (app.globalData.parkVendor == 1) {
  692. console.log("payPath: " + extConfig.attr.car.etcp.payPath)
  693. // etcp
  694. that.setData({
  695. parkVendor: app.globalData.parkVendor,
  696. etcpAppId: extConfig.attr.car.etcp.etcpAppId,
  697. carMiniVersion: extConfig.attr.car.version,
  698. etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl,
  699. payPath: extConfig.attr.car.etcp.payPath
  700. })
  701. } else if (app.globalData.parkVendor == 2) {
  702. // TJD
  703. var vendorObj = JSON.parse(res.data.vendorParams)
  704. that.setData({
  705. parkVendor: app.globalData.parkVendor,
  706. tjdAppId: extConfig.attr.car.tjd.tjdAppId,
  707. carMiniVersion: extConfig.attr.car.version,
  708. payPath: extConfig.attr.car.tjd.payPath
  709. })
  710. } else if (app.globalData.parkVendor == 5) {
  711. // 泊链
  712. var vendorObj = JSON.parse(res.data.vendorParams)
  713. console.log("payPath: " + extConfig.attr.car.bolink.payPath)
  714. that.setData({
  715. parkVendor: app.globalData.parkVendor,
  716. bolinkAppId: extConfig.attr.car.bolink.bolinkAppId,
  717. carMiniVersion: extConfig.attr.car.version,
  718. payPath: extConfig.attr.car.bolink.payPath,
  719. bolinkComId: vendorObj.comid,
  720. bolinkUnionId: vendorObj.union_id
  721. })
  722. }
  723. }
  724. })
  725. .catch(err => {
  726. console.log(err);
  727. // wx.showToast({
  728. // title: err.message,
  729. // icon: 'none',
  730. // duration: 2000,
  731. // mask: false
  732. // });
  733. })
  734. },
  735. /**
  736. * 车场状态获取
  737. */
  738. getParkStatus: function () {
  739. var that = this;
  740. Http.get({
  741. url: config.api.getParkStatus,
  742. })
  743. .then(res => {
  744. console.log(res)
  745. })
  746. .catch(err => {
  747. console.log(err)
  748. // wx.showToast({
  749. // title: err.message,
  750. // icon:"none"
  751. // })
  752. })
  753. },
  754. /**
  755. * 绑定车获取
  756. */
  757. initUsrCarList: function (flag) {
  758. var that = this;
  759. Http.get({
  760. url: config.api.getUserCarList,
  761. data: {}
  762. }).then(res => {
  763. that.setData({
  764. carList: res.data
  765. });
  766. /**
  767. * flag ==flags
  768. * 表示从首页onShow进来的
  769. */
  770. if (flag == "flags" && res.data.length > 0) {
  771. var listCardNum = res.data[0].carNumber;
  772. that.setData({
  773. listCardNum: listCardNum
  774. })
  775. /**
  776. * 获得停车费用
  777. */
  778. that.getStopFee(listCardNum);
  779. }
  780. })
  781. .catch(err => {
  782. wx.showToast({
  783. title: err.message,
  784. icon: 'none',
  785. duration: 2000,
  786. mask: false
  787. });
  788. })
  789. },
  790. /**
  791. * 获得停车费用修改
  792. */
  793. getStopFee: function (carNumber) {
  794. let that = this;
  795. let postData =
  796. app.globalData.parkVendor == 1 ? {
  797. etcpToken: app.globalData.etcpToken,
  798. carNumber: carNumber
  799. } : {
  800. carNumber: carNumber
  801. };
  802. Http.post({
  803. url: config.api.getCarStopFee,
  804. data: postData
  805. })
  806. .then(res => {
  807. console.log(res)
  808. if(app.globalData.parkVendor == 1){ // ETCP
  809. var extraDataStr = {
  810. params: {
  811. token: app.globalData.etcpToken,
  812. syncId: res.data.orderId,
  813. payType: 6, // 小程序支付
  814. CarNumber: carNumber,
  815. returnUrl: that.data.etcpCallbackUrl,
  816. source: "FUMAO-001",
  817. actionId: "1" //操作ID,1:小程序支付
  818. }
  819. }
  820. that.setData({
  821. parkVendor: app.globalData.parkVendor,
  822. extraData: extraDataStr,
  823. stopFees: res.data,
  824. timecha: Util.timecha(res.data.exitTime, res.data.entranceTime)
  825. });
  826. } else if (app.globalData.parkVendor == 2) { // TJD // TODO
  827. var extraDataStr = {
  828. prePayType: that.data.prePayType,
  829. channel: res.data.channel,
  830. isShowDetail: true,
  831. orderId: res.data.orderId
  832. }
  833. that.setData({
  834. parkVendor: app.globalData.parkVendor,
  835. extraData: extraDataStr,
  836. stopFees: {
  837. orderId: res.data.orderId,
  838. entranceTime: res.data.start_time,
  839. remainingFee: res.data.money
  840. },
  841. timecha: res.data.duration
  842. });
  843. } else if (app.globalData.parkVendor == 5) { // BoLink
  844. var extraDataStr = {
  845. union_id: that.data.bolinkUnionId,
  846. order_id: res.data.order_id,
  847. park_id: that.data.bolinkComId,
  848. plate_number: res.data.plate_number,
  849. money: res.data.money,
  850. park_name: res.data.park_name
  851. }
  852. that.setData({
  853. parkVendor: app.globalData.parkVendor,
  854. bolinkOrderId: res.data.order_id,
  855. extraData: extraDataStr,
  856. stopFees: {
  857. orderId: res.data.order_id,
  858. entranceTime: res.data.start_time,
  859. remainingFee: res.data.money
  860. },
  861. timecha: res.data.duration
  862. });
  863. }else{
  864. // var extraDataStr = {
  865. // params: {
  866. // token: app.globalData.etcpToken,
  867. // syncId: res.data.orderId,
  868. // payType: 6, // 小程序支付
  869. // CarNumber: carNumber,
  870. // returnUrl: that.data.etcpCallbackUrl,
  871. // source: "FUMAO-001",
  872. // actionId: "1",//操作ID,1:小程序支付
  873. // },
  874. // }
  875. that.setData({
  876. parkVendor: app.globalData.parkVendor,
  877. // extraData: extraDataStr,
  878. stopFees: res.data,
  879. timecha: Util.timecha(res.data.exitTime, res.data.entranceTime),
  880. remark: res.data.remark,
  881. generalAppId:res.data.appId,
  882. generalPayPath: res.data.payPath,
  883. generalExtraData: res.data.extraData,
  884. extraDataFlag: JSON.stringify(res.data.extraData),
  885. });
  886. console.log( that.data.extraDataFlag,"123456789")
  887. }
  888. that.setData({
  889. scroll: true
  890. })
  891. })
  892. .catch(error => {
  893. that.setData({
  894. stopFees: {},
  895. scroll: true
  896. })
  897. });
  898. },
  899. /**
  900. * 下拉刷新
  901. */
  902. onPullDownRefresh: function (e) {
  903. let that = this;
  904. that.initUsrCarList("flags");
  905. that.setData({
  906. current:0
  907. })
  908. wx.stopPullDownRefresh();
  909. }
  910. });