charginfo.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. import * as echarts from '../../ec-canvas/echarts';
  2. import * as lf from '../../ec-canvas/echarts-liquidfill';
  3. let log = require('../../utils/log.js');
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. brandName:'',
  10. name:'',
  11. address:'',
  12. offlineServicecall:'',
  13. stationTagList:[],
  14. chargprice: '',
  15. serviceprice: '',
  16. chargid: '',
  17. sumprice: '',
  18. fastFree:0,
  19. slowFree:0,
  20. fastSum:0,
  21. slowSum:0,
  22. pagesize:10,
  23. pagenum:1,
  24. ele_pagenum:1,
  25. total:-1,
  26. ele_total:-1,
  27. loadTotal: 0,
  28. dataLoading: false,
  29. ele_dataLoading: false,
  30. finishedLoadTap: 0,
  31. ele_finishedLoadTap: 0,
  32. finishedLoadShowTimes: 0,
  33. ele_finishedLoadShowTimes: 0,
  34. chargList: [],
  35. ele_chargList: [],
  36. seeInfoChargPile:{},
  37. userInfo:{},
  38. chargfeatureList:[],
  39. isLogin: false,
  40. resultTable: [],
  41. // 是否减免停车费
  42. carParkingRate: false,
  43. // 停车时间
  44. parkTime: 0,
  45. activeTab: '0',
  46. scrollTop:0
  47. occupyFee:{},
  48. showOccupyFee:false
  49. },
  50. execParking(that,stationId){
  51. wx.request({
  52. url: getApp().globalData.postHeadAgreement + '/restapi/wechat/carParkingRate?stationId=' + stationId,
  53. // data: {
  54. // loginName: userInfo.loginName
  55. // },
  56. method: 'POST',
  57. success: function (res) {
  58. // 是否减免停车费
  59. // carParkingRate: false,
  60. // parkTime: 0,
  61. console.info(res)
  62. let reduceTime = res.data?.reduceTime;
  63. if(!reduceTime){
  64. that.setData({
  65. carParkingRate:false
  66. })
  67. return;
  68. }
  69. that.setData({
  70. carParkingRate:true
  71. })
  72. try{
  73. that.setData({
  74. parkTime: parseFloat((reduceTime/ 3600).toFixed(2))
  75. })
  76. }catch(e){
  77. that.setData({
  78. carParkingRate:false
  79. })
  80. }
  81. },
  82. fail(e) {
  83. console.log("用户数据同步失败");
  84. log.info('[扫码]', '[同步用户数据]', '[fail]', e);
  85. }
  86. });
  87. },
  88. /**
  89. * 生命周期函数--监听页面加载
  90. */
  91. onLoad: function(e) {
  92. let that = this;
  93. let stationTagList = [];
  94. let offlineServicecall ="";
  95. wx.getStorage({
  96. key: 'index_seeInfo_chargpile',
  97. success: function (res) {
  98. console.info(res)
  99. var seeInfoChargPile = res.data;
  100. stationTagList = seeInfoChargPile.stationTagList
  101. offlineServicecall = seeInfoChargPile.offlineServicecall
  102. that.setData({
  103. stationTagList,
  104. offlineServicecall,
  105. })
  106. console.info(stationTagList)
  107. // 异步更新
  108. console.info(seeInfoChargPile.chargStationId)
  109. that.execParking(that,seeInfoChargPile.chargStationId)
  110. let resultTable = seeInfoChargPile.resultList
  111. that.setData({
  112. resultTable
  113. })
  114. that.setData({
  115. resultTable
  116. })
  117. let chargfeatureList;
  118. if(seeInfoChargPile.chargfeatures){
  119. chargfeatureList = seeInfoChargPile.chargfeatures.split(',')
  120. }else{
  121. chargfeatureList = [];
  122. }
  123. seeInfoChargPile.sharpTotalPrice = parseFloat((seeInfoChargPile.sharpChargPrice==null || seeInfoChargPile.sharpServicePrice==null || seeInfoChargPile.sharpChargPrice=='暂无费用' || seeInfoChargPile.sharpServicePrice=='暂无费用')? null:(seeInfoChargPile.sharpChargPrice + seeInfoChargPile.sharpServicePrice).toFixed(6));
  124. seeInfoChargPile.peakTotalPrice = parseFloat((seeInfoChargPile.peakChargPrice==null || seeInfoChargPile.peakServicePrice==null || seeInfoChargPile.peakChargPrice=='暂无费用' || seeInfoChargPile.peakServicePrice=='暂无费用' )? null:(seeInfoChargPile.peakChargPrice + seeInfoChargPile.peakServicePrice).toFixed(6));
  125. seeInfoChargPile.flatTotalPrice = parseFloat((seeInfoChargPile.flatChargPrice==null || seeInfoChargPile.flatServicePrice==null || seeInfoChargPile.flatChargPrice=='暂无费用' || seeInfoChargPile.flatServicePrice=='暂无费用' )? null:(seeInfoChargPile.flatChargPrice + seeInfoChargPile.flatServicePrice).toFixed(6));
  126. seeInfoChargPile.valleyTotalPrice = parseFloat((seeInfoChargPile.valleyChargPrice==null || seeInfoChargPile.valleyServicePrice==null || seeInfoChargPile.valleyChargPrice=='暂无费用' || seeInfoChargPile.valleyServicePrice=='暂无费用' )? null:(seeInfoChargPile.valleyChargPrice + seeInfoChargPile.valleyServicePrice).toFixed(6));
  127. seeInfoChargPile.totalprice = parseFloat((seeInfoChargPile.chargprice==null || seeInfoChargPile.serviceprice==null || seeInfoChargPile.chargprice=='暂无费用' || seeInfoChargPile.serviceprice=='暂无费用')? null:(seeInfoChargPile.chargprice + seeInfoChargPile.serviceprice).toFixed(6));
  128. that.setData({
  129. seeInfoChargPile,
  130. chargfeatureList
  131. });
  132. console.info(seeInfoChargPile)
  133. console.info(chargfeatureList)
  134. wx.removeStorage({
  135. key: 'index_seeInfo_chargpile',
  136. success(res) {
  137. }
  138. });
  139. }
  140. });
  141. let { name, address, chargprice, serviceprice, chargid,brandName } = e;
  142. name = name=='null'?null:name;
  143. brandName = brandName=='null'?null:brandName;
  144. address = address=='null'?null:address;
  145. // stationTagList = !stationTagList?null:stationTagList;
  146. chargprice = chargprice=='null'?null:chargprice;
  147. serviceprice = serviceprice=='null'?null:serviceprice;
  148. chargid = chargid=='null'?null:chargid;
  149. // let sumprice = (chargprice==null || serviceprice==null)? null:chargprice+serviceprice;
  150. let sumprice = (chargprice==null || serviceprice==null)? null:chargprice+serviceprice;
  151. this.setData({
  152. brandName,
  153. name,
  154. address,
  155. // stationTagList,
  156. chargprice,
  157. serviceprice,
  158. chargid,
  159. sumprice
  160. });
  161. this.fastAndSlow()
  162. this.ori_getPage();
  163. this.ele_getPage();
  164. this.getOccupyFee();
  165. },
  166. fastAndSlow(e){
  167. let that = this;
  168. wx.request({
  169. url: getApp().globalData.postHeadAgreement +'/restapi/wechat/fastAndSlow',
  170. data: {
  171. id: that.data.chargid,
  172. ivType: 3,//统计桩和电池
  173. },
  174. method: 'POST',
  175. success(res) {
  176. that.setData({
  177. fastFree : res.data.fastFree,
  178. slowFree : res.data.slowFree,
  179. fastSum : res.data.fastSum,
  180. slowSum : res.data.slowSum
  181. });
  182. }
  183. });
  184. },
  185. previewImage(e){
  186. var that = this,
  187. //获取当前图片的下表
  188. index = e.currentTarget.dataset.index,
  189. //数据源
  190. pictures = this.data.chargfeatureList;
  191. wx.previewImage({
  192. //当前显示下表
  193. current: pictures[index],
  194. //数据源
  195. urls: pictures
  196. })
  197. },
  198. getPage(){
  199. let that = this;
  200. if(that.__data__.activeTab=='0'){
  201. that.ori_getPage();
  202. }else{
  203. that.ele_getPage();
  204. }
  205. },
  206. getOccupyFee(){
  207. // test对象对接后端服务传递过来的数据
  208. var test = {
  209. cost_cycle:2,
  210. max_fee_time:120,
  211. cost_time_period:'00:00-08:00,12:00-14:00,18:00-21:00,22:00-23:00,22:00-23:00',
  212. free_time:10
  213. }
  214. if (Object.keys(test).length > 0) { // 判断对象数据是否为空
  215. this.setData({
  216. occupyFee:test,
  217. showOccupyFee:true
  218. })
  219. }
  220. console.log("occupyFee",Object.keys(this.data.occupyFee).length > 0);
  221. },
  222. ori_getPage(){
  223. // ivType
  224. // 是否为无人车充电站(0否;1是)
  225. // 0:桩
  226. // 1:电池
  227. if(this.data.chargList.length == this.data.total){
  228. this.setData({
  229. finishedLoadTap:this.data.finishedLoadTap+1
  230. })
  231. if(this.data.finishedLoadTap>0 && this.data.finishedLoadShowTimes==0){
  232. this.setData({
  233. finishedLoadShowTimes:this.data.finishedLoadShowTimes+1
  234. })
  235. wx.showToast({
  236. title: '全部加载完毕',
  237. icon: 'success',
  238. duration: 2000
  239. })
  240. }
  241. return
  242. }
  243. if(this.data.dataLoading){
  244. return
  245. }
  246. this.setData({
  247. dataLoading: true
  248. })
  249. wx.showLoading({
  250. title: '数据加载中....',
  251. })
  252. let that = this;
  253. // 充电桩
  254. wx.request({
  255. url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
  256. data: {
  257. id: that.data.chargid,
  258. pagenum: this.data.pagenum++,
  259. ivType: 0,
  260. pagesize: 10,
  261. },
  262. method: 'POST',
  263. success(res) {
  264. console.log(res);
  265. let chargList = res.data.chargList.rows;
  266. chargList.forEach(key => {
  267. let chargstatusname = '';
  268. let chargstatusclass = '';
  269. if(key.chargstatus == 2){
  270. chargstatusname='空闲中'
  271. chargstatusclass = 'chargstatus_kxz'
  272. }else if(key.chargstatus == 11){
  273. chargstatusname='已插枪'
  274. chargstatusclass = 'chargstatus_ycq'
  275. }else if(key.chargstatus == 3 || key.chargstatus == 10){
  276. chargstatusname='充电中'
  277. chargstatusclass = 'chargstatus_cdz'
  278. }else if(key.chargstatus == 0){
  279. chargstatusname='离线'
  280. chargstatusclass = 'chargstatus_lx'
  281. }else{
  282. chargstatusname='故障'
  283. chargstatusclass = 'chargstatus_gz'
  284. }
  285. key.chargstatusname = chargstatusname;
  286. key.chargstatusclass = chargstatusclass;
  287. })
  288. console.log(chargList);
  289. // that.rechargeTimeOrder(chargemoneylogs);
  290. wx.hideLoading()
  291. that.setData({
  292. chargList: that.data.chargList.concat(chargList),
  293. total: res.data.total,
  294. dataLoading: false,
  295. fastFree : res.data.fastFree,
  296. slowFree : res.data.slowFree,
  297. fastSum : res.data.fastSum,
  298. slowSum : res.data.slowSum
  299. });
  300. console.log("that.data:",that.data);
  301. }
  302. });
  303. },
  304. ele_getPage(){
  305. // ivType
  306. // 是否为无人车充电站(0否;1是)
  307. // 0:桩
  308. // 1:电池
  309. if(this.data.ele_chargList.length == this.data.ele_total){
  310. this.setData({
  311. ele_finishedLoadTap:this.data.ele_finishedLoadTap+1
  312. })
  313. if(this.data.ele_finishedLoadTap>0 && this.data.ele_finishedLoadShowTimes==0){
  314. this.setData({
  315. ele_finishedLoadShowTimes:this.data.ele_finishedLoadShowTimes+1
  316. })
  317. wx.showToast({
  318. title: '全部加载完毕',
  319. icon: 'success',
  320. duration: 2000
  321. })
  322. }
  323. return
  324. }
  325. if(this.data.ele_dataLoading){
  326. return
  327. }
  328. this.setData({
  329. ele_dataLoading: true
  330. })
  331. wx.showLoading({
  332. title: '数据加载中....',
  333. })
  334. let that = this;
  335. // that.setData({
  336. // pagenum:1
  337. // });
  338. // 充电桩
  339. wx.request({
  340. url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
  341. data: {
  342. id: that.data.chargid,
  343. pagenum: this.data.ele_pagenum++,
  344. ivType: 1,
  345. pagesize: 10,
  346. },
  347. method: 'POST',
  348. success(res) {
  349. console.log(res);
  350. let chargList = res.data.chargList.rows;
  351. chargList.forEach(key => {
  352. let chargstatusname = '';
  353. let chargstatusclass = '';
  354. if(key.chargstatus == 2){
  355. chargstatusname='空闲中'
  356. chargstatusclass = 'chargstatus_kxz'
  357. }else if(key.chargstatus == 11){
  358. chargstatusname='已插枪'
  359. chargstatusclass = 'chargstatus_ycq'
  360. }else if(key.chargstatus == 3 || key.chargstatus == 10){
  361. chargstatusname='充电中'
  362. chargstatusclass = 'chargstatus_cdz'
  363. }else if(key.chargstatus == 0){
  364. chargstatusname='离线'
  365. chargstatusclass = 'chargstatus_lx'
  366. }else{
  367. chargstatusname='故障'
  368. chargstatusclass = 'chargstatus_gz'
  369. }
  370. key.chargstatusname = chargstatusname;
  371. key.chargstatusclass = chargstatusclass;
  372. })
  373. console.log(chargList);
  374. // that.rechargeTimeOrder(chargemoneylogs);
  375. wx.hideLoading()
  376. that.setData({
  377. ele_chargList: that.data.ele_chargList.concat(chargList),
  378. ele_total: res.data.chargList.total,
  379. ele_dataLoading: false,
  380. ele_fastFree : res.data.fastFree,
  381. ele_slowFree : res.data.slowFree,
  382. ele_fastSum : res.data.fastSum,
  383. ele_slowSum : res.data.slowSum
  384. });
  385. console.log("that.setData:",that.data);
  386. }
  387. });
  388. },
  389. refreshPage: function(e) {
  390. wx.showLoading({
  391. title: '数据加载中....',
  392. })
  393. let that = this;
  394. that.setData({
  395. pagenum:1,
  396. });
  397. // 清空数据 重新进行刷新
  398. this.data.ele_chargList = []
  399. this.data.ele_total = -1
  400. this.data.chargList=[]
  401. this.data.total = -1
  402. this.ori_getPage();
  403. this.ele_getPage();
  404. that.fastAndSlow()
  405. that.setData({
  406. scrollTop: 0
  407. });
  408. wx.hideLoading()
  409. },
  410. goEleCarMap(e){
  411. console.info("呼叫充电车");
  412. let that = this;
  413. wx.setStorageSync('eleCarMapPage', {
  414. chargid: that.data.chargid
  415. })
  416. let url = '/pages/charginfo/eleCarMap';
  417. wx.navigateTo({
  418. url
  419. });
  420. },
  421. goScanResult(e){
  422. // scan_result
  423. console.info('xxxxxxxxxxxxxx')
  424. let {
  425. keywords
  426. } = e.currentTarget.dataset;
  427. let userInfo = wx.getStorageSync('userInfo');
  428. let isLogin = wx.getStorageSync('isLogin');
  429. let chargid = keywords.chargPileId;
  430. let that = this;
  431. if(isLogin && userInfo.bindingPhone==0){
  432. console.info('xxxxxxxxxxxxxx1')
  433. wx.showModal({
  434. title: '提示',
  435. content: '当前账户未绑定手机号,请您进行手机号绑定操作',
  436. showCancel:false,
  437. confirmText: '去绑定',
  438. confirmColor:'#00AADD',
  439. success: function (res1) {
  440. let url = `/pages/bindPhone/bindPhone`;
  441. wx.navigateTo({
  442. url
  443. });
  444. }
  445. });
  446. return;
  447. }
  448. wx.showLoading({
  449. title: '努力加载中...',
  450. })
  451. if (!isLogin) {
  452. console.info('xxxxxxxxxxxxxx2')
  453. log.info('[首页]', '[未登陆跳转登录界面]');
  454. let url = `/pages/login/phone_login/phone_login`;
  455. wx.hideLoading();
  456. wx.navigateTo({
  457. url
  458. });
  459. // return;
  460. } else {
  461. log.info('[首页]', '[获取用户是否有未支付订单]', '[请求]', { userId: userInfo.userId });
  462. wx.request({
  463. url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatsettlement',
  464. data: {
  465. userId: userInfo.userId
  466. },
  467. method: 'POST',
  468. success(res) {
  469. let {
  470. data
  471. } = res;
  472. let {
  473. result: order
  474. } = data;
  475. log.info('[首页]', '[获取用户是否有未支付订单]', '[响应]', data);
  476. if (data && order && data.code == 200) {
  477. wx.hideLoading();
  478. log.info('[首页]', '[用户有未支付订单跳转订单支付界面]');
  479. wx.showModal({
  480. showCancel: false,
  481. content: '你有未支付的订单,请先支付',
  482. confirmColor:'#00AADD',
  483. success: function (res) {
  484. //console.log(res);
  485. if (!res.cancel) {
  486. //点击确定
  487. let url = `/pages/order/order?orderid=${order.orderid}&userId=${order.userId}&chargPileId=${order.chargPileId}`;
  488. wx.navigateTo({
  489. url
  490. });
  491. }
  492. }
  493. });
  494. //console.log(that.data.result);
  495. } else {
  496. //console.log('无订单');
  497. log.info('[首页]', '[用户无未支付订单]');
  498. wx.request({
  499. url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
  500. // data: scanResult,
  501. data: {
  502. chargPileId: chargid,
  503. userId: userInfo.userId
  504. },
  505. method: 'POST',
  506. success(res) {
  507. console.log(chargid);
  508. log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
  509. if (!res.data || res.data.code == 500) {
  510. that.scanFlag = false;
  511. wx.hideLoading();
  512. //没有该充电桩信息
  513. wx.showModal({
  514. showCancel: false,
  515. confirmColor:'#00AADD',
  516. content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号'
  517. });
  518. } else {
  519. res.data = res.data.result
  520. //充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
  521. if (!res.data.chargstatus || res.data.chargstatus == 0 || res.data.chargstatus == 1 || res.data.chargstatus == 4 || res.data.chargstatus == 5 || res.data.chargstatus == 6 || res.data.chargstatus == 9) {
  522. //充电桩故障
  523. wx.showModal({
  524. showCancel: false,
  525. content: '终端故障,维修中',
  526. confirmColor:'#00AADD',
  527. });
  528. } else if (res.data.chargstatus == 3 || res.data.chargstatus == 8 || res.data.chargstatus == 10) {
  529. wx.showModal({
  530. showCancel: false,
  531. content: '正在充电中',
  532. confirmColor:'#00AADD',
  533. });
  534. } else if (res.data.chargstatus == 2 || res.data.chargstatus == 11) {
  535. wx.setStorage({
  536. key: "scan_chargpile",
  537. data: res.data
  538. });
  539. log.info('[首页]', '[扫一扫充电桩空闲跳转去充电界面]');
  540. let url = `/pages/scan_result/scan_result`;
  541. wx.hideLoading();
  542. wx.navigateTo({
  543. url
  544. });
  545. }
  546. wx.hideLoading();
  547. }
  548. },
  549. fail(e) {
  550. getApp().showNetworkError();
  551. }
  552. });
  553. }
  554. },
  555. fail(e) {
  556. that.scanFlag = false;
  557. wx.hideLoading();
  558. getApp().showNetworkError();
  559. }
  560. });
  561. }
  562. },
  563. seeReservation: function(e){
  564. let userInfo = wx.getStorageSync('userInfo');
  565. let isLogin = wx.getStorageSync('isLogin');
  566. let that = this;
  567. if(isLogin && userInfo.bindingPhone==0){
  568. console.info('xxxxxxxxxxxxxx1')
  569. wx.showModal({
  570. title: '提示',
  571. content: '当前账户未绑定手机号,请您进行手机号绑定操作',
  572. showCancel:false,
  573. confirmText: '去绑定',
  574. confirmColor:'#00AADD',
  575. success: function (res1) {
  576. let url = `/pages/bindPhone/bindPhone`;
  577. wx.navigateTo({
  578. url
  579. });
  580. }
  581. });
  582. return;
  583. }
  584. if (!isLogin) {
  585. console.info('xxxxxxxxxxxxxx2')
  586. log.info('[首页]', '[未登陆跳转登录界面]');
  587. let url = `/pages/login/phone_login/phone_login`;
  588. wx.hideLoading();
  589. wx.navigateTo({
  590. url
  591. });
  592. return;
  593. }
  594. let idx = e.currentTarget.dataset.idx;
  595. console.info(idx)
  596. let {
  597. chargStationId,
  598. chargPileName,
  599. chargPileId,
  600. chargStationName,
  601. id
  602. } = idx;
  603. let brandName = that.data.brandName
  604. let userId = userInfo.userId;
  605. let url = `/pages/reservation/reservation?chargStationId=` + chargStationId + `&chargPileName=` + chargPileName + `&chargPileId=` + chargPileId + `&chargPileIdId=` + id + "&chargStationName=" + chargStationName + "&userId=" + userId+ "&brandName=" + brandName;
  606. wx.navigateTo({
  607. url
  608. });
  609. },
  610. /**
  611. * 生命周期函数--监听页面初次渲染完成
  612. */
  613. onReady: function() {
  614. },
  615. /**
  616. * 生命周期函数--监听页面显示
  617. */
  618. onShow: function(e) {
  619. let userInfo = wx.getStorageSync('userInfo');
  620. let isLogin = wx.getStorageSync('isLogin');
  621. //console.log(userInfo);
  622. // 页面显示
  623. if (userInfo && isLogin) {
  624. //userInfo.flag = true;
  625. this.setData({
  626. userInfo: userInfo,
  627. isLogin: isLogin
  628. });
  629. } else {
  630. //未登录信息
  631. this.setData({
  632. userInfo: {}
  633. });
  634. }
  635. },
  636. chargingLog(e){
  637. let idx = e.currentTarget.dataset.idx;
  638. let chargPileId = idx.chargPileId;
  639. console.info(chargPileId);
  640. let url = '/pages/ucenter/charginglog/opsCharginglog?chargPileId=' + chargPileId
  641. wx.navigateTo({
  642. url
  643. });
  644. return;
  645. },
  646. callphone(){
  647. let that = this
  648. let phonenum = that.data.offlineServicecall;
  649. wx.makePhoneCall({
  650. phoneNumber: that.data.offlineServicecall, //此号码并非真实电话号码,仅用于测试
  651. success:function(){
  652. console.log("拨打电话成功!" + phonenum)
  653. },
  654. fail:function(){
  655. console.log("拨打电话失败!" + phonenum)
  656. }
  657. })
  658. },
  659. toggleTabs(e){
  660. let idx = e.currentTarget.dataset.idx;
  661. this.setData({
  662. activeTab: idx
  663. })
  664. },
  665. /**
  666. * 生命周期函数--监听页面隐藏
  667. */
  668. onHide: function() {
  669. },
  670. /**
  671. * 生命周期函数--监听页面卸载
  672. */
  673. onUnload: function() {
  674. },
  675. bindScrollTolowerEvent: function(){
  676. this.getPage();
  677. console.log("触发滚动");
  678. },
  679. /**
  680. * 页面相关事件处理函数--监听用户下拉动作
  681. */
  682. onPullDownRefresh: function() {
  683. },
  684. /**
  685. * 页面上拉触底事件的处理函数
  686. */
  687. onReachBottom: function() {
  688. },
  689. /**
  690. * 用户点击右上角分享
  691. */
  692. onShareAppMessage: function() {
  693. }
  694. })