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.

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