// subpages/securityCheck/securityCheck.js import {securityCheckk} from "../../../utils/api"; Page({ data: { pageNo: 1, pageSize:10, id: 0, waitingCheckStyle: "color: #1974ec;border-bottom: 2px solid blue;", qualifiedStyle: "", marsi:[ // ], flag0Array:[], flag1Array:[], checkResultFlag:0 }, onLoad(options) { this.getList() }, handleTap() { console.log('Movable view clicked'); wx.navigateTo({ url: '/subpages/InspectionReport/pages/InspectionReport/InspectionReport' }) }, getList() { securityCheckk({ pageNo: this.data.pageNo, pageSize: this.data.pageSize, checkResultFlag:this.data.checkResultFlag }).then(({data}) => { console.log(data) this.setData({ marsi: data.list, total: data.total }) this.memem(); // console.log("asdsa",this.data.marsi) }); }, memem() { this.setData({ flag0Array: this.data.marsi.filter(item => item.checkResultFlag === 0 || item.checkResultFlag == null), flag1Array: this.data.marsi.filter(item => item.checkResultFlag === 1) }); }, handelTab(e){ console.log(e); this.setData({ setlectVal :e.currentTarget.dataset.value }) }, toggleColor(e) { console.log(123); let value = e.currentTarget.dataset.value; // 获取点击选项的值 if (value === "1") { this.setData({ waitingCheckStyle: "color: blue;border-bottom: 2px solid blue;", qualifiedStyle: "" }); this.data.checkResultFlag = 0 this.getList() } else if (value === "2") { this.setData({ waitingCheckStyle: "", qualifiedStyle: "color: blue; border-bottom: 2px solid blue;" }); this.data.checkResultFlag = 1 this.getList() } }, qualifed(){ wx.navigateTo({ url: '../../subpages/qualified/qualified' }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, toAddEnterprise(){ wx.navigateTo({ url: '../../../subpages/InspectionReport/pages/InspectionReport/InspectionReport', }) }, toDetails(e){ console.log(e) wx.navigateTo({ url: `../../../subpages/safetyinspection/pages/safetyinspection/safetyinspection?resiId=${e.currentTarget.dataset.resiid}`, }) } })