...
|
...
|
@@ -14,9 +14,27 @@ Page({ |
|
|
interval: 2000, //间隔时间
|
|
|
duration: 500, //滑动时间
|
|
|
this_week_test_info: {},
|
|
|
past_test_info: {},
|
|
|
past_test_info: [],
|
|
|
is_buy: false,
|
|
|
student_id: '',
|
|
|
page_number:1,
|
|
|
has_more:true,
|
|
|
},
|
|
|
//获取购买背景图
|
|
|
getBuyCard() {
|
|
|
let url = '/portal/Index/buy';
|
|
|
let header = {
|
|
|
"XX-token": wx.getStorageSync('token')
|
|
|
};
|
|
|
app.post(url, {}, {}).then((res) => {
|
|
|
console.log('获取购买背景图',res);
|
|
|
this.setData({buy_card: res.info})
|
|
|
// if (res.is_binding) {
|
|
|
// this.setData({is_bingding: true})
|
|
|
// } else {
|
|
|
// this.setData({is_bingding: false})
|
|
|
// }
|
|
|
})
|
|
|
},
|
|
|
//判断手机号是否绑定
|
|
|
checkMobile() {
|
...
|
...
|
@@ -97,13 +115,19 @@ Page({ |
|
|
},
|
|
|
//获取往期实验
|
|
|
getPastWeekTest() {
|
|
|
if(!this.data.has_more) return;
|
|
|
this.setData({has_more: false});
|
|
|
let url = '/portal/Index/history';
|
|
|
let params = {
|
|
|
page: 1,
|
|
|
page: this.data.page_number,
|
|
|
}
|
|
|
app.post(url, params,{}).then((res) => {
|
|
|
// console.log(res);
|
|
|
this.setData({past_test_info: res})
|
|
|
console.log('获取往期实验',res);
|
|
|
if(res.this_page < res.total_page) {
|
|
|
this.setData({has_more: true});
|
|
|
}
|
|
|
// console.log('list', list);
|
|
|
this.setData({past_test_info: this.data.past_test_info.concat(res.list)});
|
|
|
// console.log(this.data.this_week_test_info);
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -189,6 +213,7 @@ Page({ |
|
|
// self.checkMobile();
|
|
|
self.getTheWeekTest();
|
|
|
self.getPastWeekTest();
|
|
|
self.getBuyCard();
|
|
|
//获取当前城市
|
|
|
wx.getLocation({
|
|
|
type: 'wgs84',
|
...
|
...
|
@@ -224,4 +249,17 @@ Page({ |
|
|
onShow() {
|
|
|
console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding));
|
|
|
},
|
|
|
onReachBottom: function () {
|
|
|
const self = this;
|
|
|
if(self.data.has_more) {
|
|
|
self.data.page_number ++;
|
|
|
self.getPastWeekTest();
|
|
|
}else {
|
|
|
wx.showToast({
|
|
|
title: '没有更多数据了~',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
console.log('上拉加载');
|
|
|
},
|
|
|
}); |
...
|
...
|
|