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.

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