1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- var app = getApp()
- Page({
- data: {
- lineRecord:[],
- page:1,
- bike_id:'',
- },
- onLoad: function (options) {
- this.setData({
- bike_id: options.id
- })
- var data = {
- bike_id:options.id
- }
- app.request('bike/bikeOnLineLog',data,'POST').then(res=>{
- console.log(res)
- this.setData({
- lineRecord:res.data.data
- })
- })
- },
- onReady: function () {
- },
- onShow: function () {
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- 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'
- })
- }
- }
- })
- },
- onShareAppMessage: function () {
- }
- })
|