daofu-applet/pages/risk-pool/index.js

157 lines
2.6 KiB
JavaScript
Raw Normal View History

2024-06-06 17:11:58 +08:00
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
list: [],
startTime: '',
endTime: '',
page: 1,
pageSize: 10,
userInfo:{},
condition:'',
},
/**
* 上拉刷新
*/
refresh: function () {
this.data.page = 1;
this.data.list = [];
this.setData(this.data);
this.getList();
},
/**
* 下拉加载
*/
dropDown: function (params) {
this.data.page = this.data.page+1;
this.setData(this.data);
this.getList();
},
/**
* 输入内容
*/
inputContent: function (e) {
const name = e.currentTarget.dataset.name;
this.data[name] = e.detail.value;
this.refresh();
},
/**
* 上报困难诉求
*/
push: function (params) {
wx.navigateTo({
url: `/pages/risk-pool/add-pool/index`,
})
},
addpush: function (params) {
let poolId = params.currentTarget.dataset.item.poolId
wx.navigateTo({
url: `/pages/risk-pool/add-pool/index?id=${poolId}`,
})
},
/**
* 获取工困难诉求列表
*/
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,
condition:this.data.condition
};
app.axios("GET", "app", `/risk/riskPoolPage`, params).then(res => {
if (res.code == 1) {
this.data.freshIng = false;
this.data.list = [...this.data.list,...res.data.list];
this.setData(this.data);
}
})
},
/**
* 查看详情
*/
// toDetail: function (params) {
// wx.navigateTo({
// url: `/pages/emergency/s-b/escalation/index?emerEventId=${params.currentTarget.dataset.item.emerEventId}`,
// })
// },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.freshIng = true;
this.data.userInfo = app.globalData.userInfo;
this.setData(this.data);
this.getList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom(data) {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})