// package/bindTroubleshooting/index.js import { getPatrolRecordIssueHandle } from "../../utils/getApiUrl"; import { Request } from "../../common"; Page({ /** * 页面的初始数据 */ data: { // hidden: true, currentTab: '0', // 筛选选择 structList: ['a', 'b', 'c'], structResult: ['a', 'b'], pointList: ['a', 'b', 'c'], pointResult: ['a', 'b'], // 时间筛选 startTime: '', endTime: '' }, // 顶部tab切换 clickTab (e) { this.setData({ currentTab: e.currentTarget.dataset.current }) if (e.currentTarget.dataset.current == '0') { } else if (e.currentTarget.dataset.current == '1') { } this.setData({ page: 0, dataList: [] }, () => { this.getData({ type: e.currentTarget.dataset.current == '0' ? 'backlog' : 'haveDone' }); }) }, getData (params) { Request.get(getPatrolRecordIssueHandle, {}).then(res => { console.log(res); }) }, // 筛选选择 onStructChange (event) { this.setData({ structResult: event.detail, }); }, structToggle (event) { const { index } = event.currentTarget.dataset; const checkbox = this.selectComponent(`.checkboxes-struct-${index}`); checkbox.toggle(); }, onPointChange (event) { this.setData({ pointResult: event.detail, }); }, pointToggle (event) { const { index } = event.currentTarget.dataset; const checkbox = this.selectComponent(`.checkboxes-point-${index}`); checkbox.toggle(); }, noop () { }, // 时间选择 onStartTimeChange (event) { this.setData({ startTime: event.detail, }); }, onEndTimeChange (event) { this.setData({ endTime: event.detail, }); }, search () { console.log(this.data); }, // 页面跳转 toShootingForm (e) { console.log(e); const { shootingid } = e.currentTarget.dataset wx.navigateTo({ url: '/package/troubleshooting/shootingForm/index?shootingid=' + shootingid, }) }, /** * 生命周期函数--监听页面加载 */ onLoad (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady () { }, /** * 生命周期函数--监听页面显示 */ onShow () { }, /** * 生命周期函数--监听页面隐藏 */ onHide () { }, /** * 生命周期函数--监听页面卸载 */ onUnload () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom () { }, /** * 用户点击右上角分享 */ onShareAppMessage () { } })