|
|
@@ -58,6 +58,8 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
const [showTimePicker, setShowTimePicker] = useState(false);
|
|
|
const [showMutiPicker, setShowMutiPicker] = useState(false);
|
|
|
const [mutiEvent, setMutiEvent] = useState('start_fast');
|
|
|
+ const [logEvent,setLogEvent] = useState('LOG_ONCE');
|
|
|
+ const [logEventTimestamp,setLogEventTimestamp] = useState(0)
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
|
@@ -90,10 +92,13 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
}
|
|
|
nativePushListener = NativeAppEventEmitter.addListener('notificationReceive', (data) => {
|
|
|
console.log('notification receive action', data)
|
|
|
- const { category_id, action_id, id } = data
|
|
|
+ const { category_id, action_id, id,timestamp } = data
|
|
|
uploadLocalPushInfo({
|
|
|
messageId: id
|
|
|
})
|
|
|
+ global.set_time = timestamp;
|
|
|
+ setLogEvent('NOTIFY_ONE_TAP');
|
|
|
+ setLogEvent(timestamp)
|
|
|
switch (action_id) {
|
|
|
case 'START_TIMER_NOW':
|
|
|
{
|
|
|
@@ -103,8 +108,9 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
else {
|
|
|
operateType = 'startSleep'
|
|
|
}
|
|
|
- global.set_time = new Date().getTime()
|
|
|
- pickerConfirm(new Date().getTime())
|
|
|
+ global.set_time = timestamp//new Date().getTime()
|
|
|
+ pickerConfirm(timestamp)
|
|
|
+ // pickerConfirm(new Date().getTime())
|
|
|
}
|
|
|
break;
|
|
|
case 'PICK_EARLIER_START':
|
|
|
@@ -156,8 +162,9 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
else {
|
|
|
operateType = 'endSleep'
|
|
|
}
|
|
|
- global.set_time = new Date().getTime()
|
|
|
- pickerConfirm(new Date().getTime())
|
|
|
+ global.set_time = timestamp//new Date().getTime()
|
|
|
+ pickerConfirm(timestamp)
|
|
|
+ // pickerConfirm(new Date().getTime())
|
|
|
}
|
|
|
break;
|
|
|
case 'PICK_EARLIER_END':
|
|
|
@@ -202,11 +209,14 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
return
|
|
|
}
|
|
|
+ if (e){
|
|
|
+ setLogEvent('LOG_ONCE')
|
|
|
+ }
|
|
|
operateType = 'startFast'
|
|
|
global.pauseIndexTimer = true
|
|
|
- global.set_time = new Date().getTime()
|
|
|
+ global.set_time = e?new Date().getTime():logEventTimestamp
|
|
|
|
|
|
- defaultTimestamp = new Date().getTime()
|
|
|
+ defaultTimestamp = e?new Date().getTime():logEventTimestamp
|
|
|
min = defaultTimestamp - 1 * 24 * 3600 * 1000
|
|
|
max = defaultTimestamp
|
|
|
isTimeout = false
|
|
|
@@ -223,6 +233,9 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
jumpPage('/pages/account/ChooseAuth', 'ChooseAuth')
|
|
|
return
|
|
|
}
|
|
|
+ if (e){
|
|
|
+ setLogEvent('LOG_ONCE')
|
|
|
+ }
|
|
|
if (status != 'ONGOING1' && props.record.scenario.name == 'FAST_SLEEP') {
|
|
|
// if (status == 'WAIT_FOR_START') {
|
|
|
// Taro.showToast({
|
|
|
@@ -238,12 +251,12 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
}
|
|
|
operateType = 'startSleep'
|
|
|
global.pauseIndexTimer = true
|
|
|
- global.set_time = new Date().getTime()
|
|
|
+ global.set_time = e?new Date().getTime():logEventTimestamp
|
|
|
|
|
|
|
|
|
isTimeout = false
|
|
|
if (props.record.scenario.name == 'SLEEP') {
|
|
|
- defaultTimestamp = new Date().getTime()
|
|
|
+ defaultTimestamp = e?new Date().getTime():logEventTimestamp
|
|
|
min = defaultTimestamp - 6 * dayMilliSeconds
|
|
|
max = defaultTimestamp
|
|
|
}
|
|
|
@@ -282,6 +295,9 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
jumpPage('/pages/account/ChooseAuth', 'ChooseAuth')
|
|
|
return
|
|
|
}
|
|
|
+ if (e){
|
|
|
+ setLogEvent('LOG_ONCE')
|
|
|
+ }
|
|
|
if (status != 'ONGOING2' && status != 'ONGOING') {
|
|
|
|
|
|
// Taro.showToast({
|
|
|
@@ -296,7 +312,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
}
|
|
|
operateType = 'endSleep'
|
|
|
global.pauseIndexTimer = true
|
|
|
- global.set_time = new Date().getTime()
|
|
|
+ global.set_time = e?new Date().getTime():logEventTimestamp
|
|
|
|
|
|
var real_start_time = props.record.current_record.sleep.real_start_time
|
|
|
var last_check_time = props.record.current_record.last_real_check_time
|
|
|
@@ -313,7 +329,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
}
|
|
|
else {
|
|
|
isTimeout = false
|
|
|
- defaultTimestamp = now
|
|
|
+ defaultTimestamp = e?new Date().getTime():logEventTimestamp
|
|
|
min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
|
|
|
max = defaultTimestamp
|
|
|
}
|
|
|
@@ -336,6 +352,9 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
jumpPage('/pages/account/ChooseAuth', 'ChooseAuth')
|
|
|
return
|
|
|
}
|
|
|
+ if (e){
|
|
|
+ setLogEvent('LOG_ONCE')
|
|
|
+ }
|
|
|
if (status == 'WAIT_FOR_START') {
|
|
|
// Taro.showToast({
|
|
|
// title: t('feature.track_time_duration.console.lock_fast_tip'),
|
|
|
@@ -384,17 +403,17 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- tapEndFastOperate()
|
|
|
+ tapEndFastOperate(e)
|
|
|
}
|
|
|
|
|
|
- function tapEndFastOperate() {
|
|
|
+ function tapEndFastOperate(e) {
|
|
|
operateType = 'endFast'
|
|
|
global.pauseIndexTimer = true
|
|
|
- global.set_time = new Date().getTime()
|
|
|
+ global.set_time = e?new Date().getTime():logEventTimestamp
|
|
|
|
|
|
var real_start_time = props.record.current_record.fast.real_start_time
|
|
|
var last_check_time = props.record.current_record.last_real_check_time
|
|
|
- var now = new Date().getTime()
|
|
|
+ var now = e?new Date().getTime():logEventTimestamp
|
|
|
if (now - real_start_time >= dayMilliSeconds) {
|
|
|
//严重超时
|
|
|
isTimeout = true
|
|
|
@@ -577,7 +596,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
|
|
|
switch (operateType) {
|
|
|
case 'startFast':
|
|
|
- startFast(t1, fastDuration).then(res => {
|
|
|
+ startFast(t1, fastDuration,logEvent).then(res => {
|
|
|
global.indexPageRefresh()
|
|
|
setFirstEnter(false)
|
|
|
hidePicker()
|
|
|
@@ -650,7 +669,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
})
|
|
|
break
|
|
|
case 'startSleep':
|
|
|
- startSleep(t1, sleepDuration).then(res => {
|
|
|
+ startSleep(t1, sleepDuration,logEvent).then(res => {
|
|
|
global.indexPageRefresh()
|
|
|
setFirstEnter(false)
|
|
|
hidePicker()
|
|
|
@@ -725,7 +744,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
})
|
|
|
break
|
|
|
case 'endSleep':
|
|
|
- endSleep(t1).then(res => {
|
|
|
+ endSleep(t1,logEvent).then(res => {
|
|
|
getLocalPush()
|
|
|
setBtnDisable(false)
|
|
|
global.indexPageRefresh()
|
|
|
@@ -748,7 +767,7 @@ export default function IndexConsole(props: { record: any, count: number, access
|
|
|
})
|
|
|
break
|
|
|
case 'endFast':
|
|
|
- endFast(t1).then(res => {
|
|
|
+ endFast(t1,logEvent).then(res => {
|
|
|
getLocalPush()
|
|
|
setBtnDisable(false)
|
|
|
global.indexPageRefresh()
|