const _my = require("../../../__antmove/api/index.js")(my); const wx = _my; const { disinfectList, disinfectRemind } = require("../../../utils/api/xiaosha"); Page({ /** * 页面的初始数据 */ data: { list: [], userInfo: wx.getStorageSync("userInfo"), disinfectAreaName: "", //搜索区域名称 checkAuth: false }, // 获取搜索框 getVaule(e) { this.setData({ disinfectAreaName: e.detail.value }); }, // 获取数据 getList() { let { userInfo, disinfectAreaName } = this.data; let data = { adminId: userInfo.orgId, disinfectAreaName, userId: userInfo.userId }; disinfectList(data).then(res => { this.setData({ list: res.data }); }); }, // 提醒消杀 remindFun(event) { let { userInfo, list } = this.data; console.log(list[event.target.dataset.index].disinfectAreaId); let data = { adminId: userInfo.orgId, disinfectAreaId: list[event.target.dataset.index].disinfectAreaId, userId: userInfo.userId }; disinfectRemind(data).then(res => { if (res.code == 200) { my.alert({ title: "提示", content: res.data }); } else { wx.showToast({ title: res.msg, icon: "none" }); } }); }, // 跳转详情页/编辑页 gotoFun(e) { let item = e.currentTarget.dataset.item; let type = e.currentTarget.dataset.type; wx.navigateTo({ url: `/pages/wx_airport/Xiaosha_record/${type}/inidex?item=${JSON.stringify(item)}` }); }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { console.log(options); if (options) { this.setData({ checkAuth: JSON.parse(options.checkAuth) }); } }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() {}, /** * 生命周期函数--监听页面显示 */ onShow() { this.getList(); }, /** * 生命周期函数--监听页面隐藏 */ onHide() {}, /** * 生命周期函数--监听页面卸载 */ onUnload() {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() {}, /** * 页面上拉触底事件的处理函数 */ onReachBottom() {}, /** * 用户点击右上角分享 */ onShareAppMessage() {}, antmoveAction: function () { //执行时动态赋值,请勿删除 } });