daofu-applet/pages/emergency/z-s/index/index.js
2024-06-19 15:42:55 +08:00

115 lines
2.1 KiB
JavaScript

// pages/emergency/z-s/index/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
page: 1,
pageSize: 10,
list: []
},
/**
* 刷新
*/
refresh: function (params) {
this.data.page = 1;
this.getList();
},
/**
* 获取列表
*/
getList: function () {
console.log(this.data.curTab,parseInt(this.data.curTab) + 1,'=====>');
app.axios("GET", "app", "/Othteam/dutyList", {
page: this.data.page,
limit: this.data.pageSize,
startTime: this.data.startTime || '',
endTime: this.data.endTime || '',
condition: this.data.condition || '',
state: parseInt(this.data.curTab) + 1,
userId: app.globalData.userInfo.userId
}, false).then(res => {
console.log(res,'resresres==>');
this.data.freshIng = false;
if (res.code == 1) {
let page = Number.parseInt(res.data.pageNum);
if (this.data.page == 1) {
this.data.list = res.data.list;
} else {
var list = this.data.list;
if (this.data.page == page) this.data.list = [...list, ...res.data.list]
}
if (res.data.list?.length > 0) this.data.page = page + 1
}
this.setData(this.data)
})
},
// 拨打电话
call:function(data){
wx.makePhoneCall({
phoneNumber: data.currentTarget.dataset.mobile,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})