daofu-applet/pages/emergency/s-b/index/index.js

163 lines
2.6 KiB
JavaScript
Raw Permalink Normal View History

2024-01-30 16:35:55 +08:00
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
2024-06-04 14:45:44 +08:00
list: [],
startTime: '',
endTime: '',
page: 1,
pageSize: 10,
userInfo:{}
2024-01-30 16:35:55 +08:00
},
/**
2024-06-04 14:45:44 +08:00
* 开始时间
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
startTimeChange: function (e) {
this.data.startTime = e.detail.value;
this.data.page = 1;
this.data.list = [];
this.setData(this.data);
this.getList();
2024-01-30 16:35:55 +08:00
},
/**
2024-06-04 14:45:44 +08:00
* 开始时间
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
endTimeChange: function (e) {
this.data.endTime = e.detail.value;
this.data.page = 1;
this.data.list = [];
this.setData(this.data);
this.getList();
2024-01-30 16:35:55 +08:00
},
/**
2024-06-04 14:45:44 +08:00
* 上拉刷新
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
refresh: function () {
this.data.page = 1;
this.data.list = [];
this.setData(this.data);
this.getList();
2024-01-30 16:35:55 +08:00
},
2024-06-04 14:45:44 +08:00
2024-01-30 16:35:55 +08:00
/**
2024-06-04 14:45:44 +08:00
* 下拉加载
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
dropDown: function (params) {
this.data.page = this.data.page+1;
this.setData(this.data);
this.getList();
2024-01-30 16:35:55 +08:00
},
/**
2024-06-04 14:45:44 +08:00
* 上报困难诉求
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
push: function (params) {
wx.navigateTo({
url: `/pages/emergency/s-b/escalation/index`,
2024-01-30 16:35:55 +08:00
})
},
/**
2024-06-04 14:45:44 +08:00
* 获取工困难诉求列表
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
getList: function () {
let params = {
limit:this.data.pageSize,
page:this.data.page,
endTime:this.data.endTime,
startTime:this.data.startTime,
userId:this.data.userInfo.userId,
};
app.axios("GET", "app", `/emerEvent/userEmerEventPage`, params).then(res => {
console.log(res);
2024-01-30 16:35:55 +08:00
if (res.code == 1) {
2024-06-04 14:45:44 +08:00
this.data.freshIng = false;
this.data.list = [...this.data.list,...res.data.list];
this.setData(this.data);
2024-01-30 16:35:55 +08:00
}
})
},
/**
2024-06-04 14:45:44 +08:00
* 查看详情
2024-01-30 16:35:55 +08:00
*/
2024-06-04 14:45:44 +08:00
toDetail: function (params) {
wx.navigateTo({
url: `/pages/emergency/s-b/escalation/index?emerEventId=${params.currentTarget.dataset.item.emerEventId}`,
2024-01-30 16:35:55 +08:00
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
2024-06-04 14:45:44 +08:00
this.data.freshIng = true;
this.data.userInfo = app.globalData.userInfo;
this.setData(this.data);
this.getList();
2024-01-30 16:35:55 +08:00
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
2024-06-04 14:45:44 +08:00
onReachBottom(data) {
2024-01-30 16:35:55 +08:00
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
2024-06-04 14:45:44 +08:00
})