// pages/master/shareDetails/shaerDetails.js const util = require("../../../utils/util"); const api = require('../../../api/api.js'); Page({ /** * 页面的初始数据 */ data: { detailList: [], showType: 0, zzyAllWorker: [], zzyCurrDayWorker: [], zzyMonthWorker: [], zzyCount: {} }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { util.request(api.zzyDetail, {}, 'GET').then(res => { if (res.errno === 0) { this.setData({ zzyAllWorker: util.forMatTime(res.data.zzyAllWorker), zzyCurrDayWorker: util.forMatTime(res.data.zzyCurrDayWorker), zzyMonthWorker: util.forMatTime(res.data.zzyMonthWorker), zzyCount: res.data.zzyCount, detailList: util.forMatTime(res.data.zzyAllWorker) }) } else { wx.showToast({ title: res.data, icon: 'none' }) } }); }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, onTabChange(e) { this.setData({ showType: e.currentTarget.dataset.tab }) if (e.currentTarget.dataset.tab == 0) { this.setData({ detailList: this.data.zzyAllWorker }) } else if (e.currentTarget.dataset.tab == 1) { this.setData({ detailList: this.data.zzyMonthWorker }) } else if (e.currentTarget.dataset.tab == 2) { this.setData({ detailList: this.data.zzyCurrDayWorker }) } }, goPoster() { wx.navigateTo({ url: '/pages/master/poster/poster?rid=' + this.data.rid, }) } })