新增查看入场订单信息入口
This commit is contained in:
116
pages/myEnterList/index.js
Normal file
116
pages/myEnterList/index.js
Normal file
@@ -0,0 +1,116 @@
|
||||
// pages/myBookingsList/index.js
|
||||
const app = getApp();
|
||||
let page = 1;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [],
|
||||
isShowNewplot: false,
|
||||
gohome: true
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
page = 1;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
page = 1;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
page++;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
return {
|
||||
title: '智慧云馆'
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
getData() {
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
})
|
||||
app.$api.memberEnterList({
|
||||
page: page,
|
||||
pageSize: 10
|
||||
}).then(res => {
|
||||
let list = [];
|
||||
if (page == 1) {
|
||||
this.setData({
|
||||
list: []
|
||||
})
|
||||
} else {
|
||||
list = this.data.list;
|
||||
}
|
||||
for (let i = 0; i < res.page.data.length; i++) {
|
||||
let currentDate = new Date().getTime();
|
||||
res.page.data[i].isEnd = currentDate < res.page.data[i].startTime;
|
||||
list.push(res.page.data[i]);
|
||||
}
|
||||
this.setData({
|
||||
list: list,
|
||||
isShowNewplot: true
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}, err => {
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
// 点击CEll
|
||||
clickCell(e) {
|
||||
let id = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/myEnters/index?id=${id}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user