onLoad(e) {
this.getlist()
},
onReachBottom() {
this.getmore();
},
methods: {
getmore() {
var that = this;
that.page = that.page + 1;
uni.showNavigationBarLoading();
that.more = 'loading';
let data = {
page: this.page,
city: this.start,
address: this.address
};
this.$minApi
.bus_near(data)
.then(res => {
uni.hideNavigationBarLoading();
console.log(res);
that.more = 'more';
if (res.code == 1) {
var data = res.data;
if (!data || data.length == 0) {
that.more = 'noMore';
}
for (var i = 0; i < data.length; i++) {
that.list.push(data[i]);
}
} else {
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
});
}
})
.catch(err => {
console.log(err);
});
},
getlist() {
let data = {
page: this.page,
city: this.start,
address: this.address
};
var that = this;
uni.showNavigationBarLoading();
this.$minApi.bus_near(data).then(res => {
uni.hideNavigationBarLoading();
console.log(res);
if (res.code == 1) {
this.list = res.data
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
});
},
}