123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- let Util = require("../../../utils/util");
- Page({
-
- data: {
- charginglogs: [],
- pagesize:10,
- pagenum:1,
- total:-1,
- loadTotal: 0,
- finishedLoadTap: 0,
- finishedLoadShowTimes: 0,
- chargPileId: ''
- },
-
- onLoad: function(options) {
- let userInfo = wx.getStorageSync('userInfo');
- let isLogin = wx.getStorageSync('isLogin');
- let that = this;
- let {
- chargPileId
- } = options;
- console.info(chargPileId)
- this.setData({
- chargPileId
- })
-
- this.getPage();
- },
- getPage(){
- wx.showLoading({
- title: '数据加载中....',
- })
- let that = this;
- wx.request({
- url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatchargpilelog',
- data: {
- chargPileId:that.data.chargPileId
- },
- method: 'POST',
- success(res) {
- console.log(res);
- if (res.data.result) {
- that.formatCharginglogs(res.data.result);
- wx.hideLoading()
- that.setData({
- charginglogs: res.data.result,
- });
- }
- }
- });
- },
- formatCharginglogs(charginglogs) {
- charginglogs.forEach((item, index) => {
- try {
- item.platenumber = item.platenumber?item.platenumber:'';
- item.userPlateNumber = item.userPlateNumber?item.userPlateNumber:'';
- item.vinno = item.vinno?item.vinno:'';
-
- item.vinno = /^[0-9a-zA-Z]*$/.test(item.vinno)?item.vinno:'';
- item.socstart = item.socstart?item.socstart:'';
- item.socend = item.socend?item.socend:'';
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- } catch (err) {
-
- }
- });
- },
- startTimeOrder(charginglogs) {
- if (charginglogs && 0 != charginglogs.length) {
- charginglogs.sort(function(ma, mb) {
- return mb.chargstarttime.localeCompare(ma.chargstarttime);
- });
- }
- },
-
- onReady: function() {
- },
-
- onShow: function() {
- },
-
- onHide: function() {
- },
-
- onUnload: function() {
- },
-
- onPullDownRefresh: function() {
- },
-
- onReachBottom: function() {
- },
- bindScrollTolowerEvent: function(){
- this.getPage();
- },
-
- onShareAppMessage: function() {
- }
- })
|