123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // 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=> {
- console.log(res.data);
- 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)
- })
- // console.log(this.data.zzyCurrDayWorker);
- // console.log("222",this.data.detailList);
- }else{
- wx.showToast({
- title: res.errmsg,
- 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,
- })
- }
- })
|