锶源昆仑会员+体验官
This commit is contained in:
88
pages/index/feeling/index.js
Normal file
88
pages/index/feeling/index.js
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userData : '', //用户信息
|
||||
surveyArr : [], //反馈列表
|
||||
page : {}, //分页信息
|
||||
lodingStats : false, //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取反馈列表
|
||||
this.surveysInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 反馈列表
|
||||
*/
|
||||
surveysInfo(page) {
|
||||
wx.$api.index.surveys({
|
||||
page : page
|
||||
}).then(res => {
|
||||
let listArr = this.data.surveyArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.data)
|
||||
this.setData({
|
||||
surveyArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
openImg(e){
|
||||
let imgs = [],
|
||||
index = e.currentTarget.dataset.index
|
||||
for (let img of e.currentTarget.dataset.imgs){
|
||||
imgs.push(img)
|
||||
}
|
||||
wx.previewImage({
|
||||
urls : imgs,
|
||||
current : imgs[index]
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
// 获取反馈列表
|
||||
this.surveysInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 获取反馈列表
|
||||
this.surveysInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user