You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
1.7 KiB
99 lines
1.7 KiB
2 years ago
|
// page/record/record.js
|
||
|
var app = getApp();
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
test_id:null,
|
||
|
page:1,
|
||
|
num:10,
|
||
|
list:[],
|
||
|
total:0
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad(options) {
|
||
|
this.setData({test_id:options.res_test_id});
|
||
|
this.getdata()
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
*/
|
||
|
onReady() {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面显示
|
||
|
*/
|
||
|
onShow() {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面隐藏
|
||
|
*/
|
||
|
onHide() {
|
||
|
this.data.page = 1;//隐藏设置分页1
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面卸载
|
||
|
*/
|
||
|
onUnload() {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
*/
|
||
|
onPullDownRefresh() {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面上拉触底事件的处理函数
|
||
|
*/
|
||
|
onReachBottom() {
|
||
|
console.log("到底了")
|
||
|
var pagenum = this.data.page + 1; //获取当前页数并+1
|
||
|
this.setData({
|
||
|
page: pagenum, //更新当前页数
|
||
|
})
|
||
|
this.getdata();
|
||
|
},
|
||
|
getdata(){
|
||
|
wx.request({
|
||
|
url: 'https://mini.nanjingchuangyou.com/api/mini/viewList',
|
||
|
method:'POST',
|
||
|
header: {
|
||
|
'content-type': 'application/x-www-form-urlencoded',
|
||
|
},
|
||
|
data:{
|
||
|
num:this.data.num,
|
||
|
test_id:this.data.test_id,
|
||
|
page:this.data.page
|
||
|
},
|
||
|
success:(res)=>{
|
||
|
console.log(res.data.data.lists,"0-00")
|
||
|
let list = []
|
||
|
list.push(...(res.data.data.lists))
|
||
|
this.setData({
|
||
|
list:list,
|
||
|
total:res.data.total
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
/**
|
||
|
* 用户点击右上角分享
|
||
|
*/
|
||
|
onShareAppMessage() {
|
||
|
|
||
|
}
|
||
|
})
|