123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- var app = getApp()
- Page({
- data: {
- lineRecord:[],
- page:1,
- bike_id:'',
- },
- onLoad: function (options) {
- wx.showLoading({
- title: '加载中...',
- })
- this.setData({
- bike_id: options.id
- })
- var data = {
- bike_id:options.id
- }
- app.request('bike/bikeOnLineLog',data,'POST').then(res=>{
- wx.hideLoading();
- console.log(res)
- this.setData({
- lineRecord:res.data.data
- })
- })
- },
- onReachBottom: function () {
- wx.showLoading({
- title: '加载中',
- })
- var that = this;
- var page = that.data.page + 1;
- var data = {
- bike_id: that.data.bike_id,
- page: page
- }
- app.request('bike/bikeOnLineLog', data, 'POST').then(res => {
- console.log(res)
- wx.hideLoading()
- if (res.statusCode == 200) {
- if (res.data.data.length > 0) {
- this.setData({ lineRecord: that.data.lineRecord.concat(res.data.data) ,page})
- } else {
- wx.showToast({
- title: '没有更多了~',
- icon: 'none'
- })
- }
- }
- })
- },
- })
|