Commit 75dc43f3 by chenwq

bug修复

1 parent 14902140
// packageOutput/pages/summary/summary.js
import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData'
import { getNowMonth } from '~/utils/format'
Page({
/**
......@@ -138,22 +139,41 @@ Page({
})
},
initTime() {
let date = new Date()
let today = date.getDate()
let month = getNowMonth()
const todayTime = {
startTime: `${month}-${today} 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const monthTime = {
startTime: `${month}-01 00:00:00`,
endTime: `${month}-${today} 23:59:59`
}
const defaultTime = {
startTime: '',
endTime: `${month}-${today} 23:59:59`
}
this.setData({
dataObj: {
todayTime,
monthTime,
defaultTime
}
})
},
dealSearchTime() {
var params = {}
switch (this.data.searchForm['scene' + this.data.sceneActive + 'Idx']) {
// 本月
case 1:
params = {
startTime: new Date(new Date().setDate(1)).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00',
endTime: new Date().toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params = this.data.dataObj.monthTime
break
// 本日
case 2:
params = {
startTime: new Date().toLocaleDateString().replace(/\//g, '-') + ' 00:00:00',
endTime: new Date().toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params = this.data.dataObj.todayTime
break
}
return params
......@@ -302,7 +322,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.initTime()
wx.$router.getData(obj => {
var scene = {}
Object.keys(this.data.sceneObj).forEach(item => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!