|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
-import { View, Text, PickerView,ScrollView } from "@tarojs/components";
|
|
|
+import { View, Text, PickerView, ScrollView } from "@tarojs/components";
|
|
|
import { useEffect, useRef, useState } from "react";
|
|
|
import { TimeFormatter } from "@/utils/time_format";
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
@@ -36,7 +36,7 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
const [fastPickerValue, setFastPickerValue] = useState([0, 0])
|
|
|
const [sleepPickerValue, setSleepPickerValue] = useState([0, 0])
|
|
|
const [isLoaded, setIsLoaded] = useState(false)
|
|
|
- const [showPageContainer,setShowPageContainer] = useState(false)
|
|
|
+ const [showPageContainer, setShowPageContainer] = useState(false)
|
|
|
const limitPickerRef = useRef(null)
|
|
|
const durationPickerRef = useRef(null)
|
|
|
const { t } = useTranslation()
|
|
|
@@ -104,7 +104,7 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function pageContainerDetail(){
|
|
|
+ function pageContainerDetail() {
|
|
|
return layoutContent()
|
|
|
}
|
|
|
|
|
|
@@ -120,12 +120,12 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
// }} />);
|
|
|
// global.showClockModal(true, node);
|
|
|
var node = layoutContent()
|
|
|
- global.showClockModal(true, node,testLayout());
|
|
|
+ global.showClockModal(true, node, testLayout());
|
|
|
}
|
|
|
|
|
|
function hidePicker() {
|
|
|
var node = layoutContent()
|
|
|
- global.showClockModal(false, node,null);
|
|
|
+ global.showClockModal(false, node, null);
|
|
|
if (global.testInfotimer) {
|
|
|
clearInterval(global.testInfotimer)
|
|
|
global.testInfotimer = null
|
|
|
@@ -173,18 +173,18 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
}
|
|
|
|
|
|
return <ScrollView scrollY>
|
|
|
- <View style={{ color: '#fff', paddingLeft: 30, display: 'flex', flexDirection: 'column' }}>
|
|
|
- <Text>check scenario:{isFast ? 'fast' : 'sleep'}</Text>
|
|
|
- <Text>check type:{isStart ? 'start' : 'end'}</Text>
|
|
|
- <Text style={{ marginTop: 10 }}>picker restriction</Text>
|
|
|
- <Text style={{ marginLeft: 50 }}>min:{TimeFormatter.formatTimestamp(global.limit)}</Text>
|
|
|
- <Text style={{ marginLeft: 50 }}>pick:{TimeFormatter.formatTimestamp(global.picker_time)}</Text>
|
|
|
- <Text style={{ marginLeft: 50 }}>max{TimeFormatter.formatTimestamp(global.set_time)}</Text>
|
|
|
- <Text style={{ marginTop: 10 }}>now:{TimeFormatter.formatTimestamp(new Date().getTime())}</Text>
|
|
|
- <Text>elapsed:{TimeFormatter.calculateTimeDifference(global.picker_time, new Date().getTime())}</Text>
|
|
|
- <Text style={{ marginTop: 10 }}>real start:{isStart ? '-' : TimeFormatter.formatTimestamp(isFast ? time.fast.real_start_time : time.sleep.real_start_time)}</Text>
|
|
|
- <Text>real duration:{isStart ? '-' : TimeFormatter.calculateTimeDifference(isFast ? time.fast.real_start_time : time.sleep.real_start_time, new Date().getTime())}</Text>
|
|
|
- </View>
|
|
|
+ <View style={{ color: '#fff', paddingLeft: 30, display: 'flex', flexDirection: 'column' }}>
|
|
|
+ <Text>check scenario:{isFast ? 'fast' : 'sleep'}</Text>
|
|
|
+ <Text>check type:{isStart ? 'start' : 'end'}</Text>
|
|
|
+ <Text style={{ marginTop: 10 }}>picker restriction</Text>
|
|
|
+ <Text style={{ marginLeft: 50 }}>min:{TimeFormatter.formatTimestamp(global.limit)}</Text>
|
|
|
+ <Text style={{ marginLeft: 50 }}>pick:{TimeFormatter.formatTimestamp(global.picker_time)}</Text>
|
|
|
+ <Text style={{ marginLeft: 50 }}>max{TimeFormatter.formatTimestamp(global.set_time)}</Text>
|
|
|
+ <Text style={{ marginTop: 10 }}>now:{TimeFormatter.formatTimestamp(new Date().getTime())}</Text>
|
|
|
+ <Text>elapsed:{TimeFormatter.calculateTimeDifference(global.picker_time, new Date().getTime())}</Text>
|
|
|
+ <Text style={{ marginTop: 10 }}>real start:{isStart ? '-' : TimeFormatter.formatTimestamp(isFast ? time.fast.real_start_time : time.sleep.real_start_time)}</Text>
|
|
|
+ <Text>real duration:{isStart ? '-' : TimeFormatter.calculateTimeDifference(isFast ? time.fast.real_start_time : time.sleep.real_start_time, new Date().getTime())}</Text>
|
|
|
+ </View>
|
|
|
</ScrollView>
|
|
|
}
|
|
|
|
|
|
@@ -197,7 +197,7 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
limit = time.last_real_check_time
|
|
|
global.limit = limit
|
|
|
//当set_time秒数<=latest_record_time秒数时,最小限制时间戳需+1分钟
|
|
|
- if (new Date(global.set_time).getSeconds() <= new Date(time.last_real_check_time).getSeconds() && global.set_time-time.last_real_check_time>60000) {
|
|
|
+ if (new Date(global.set_time).getSeconds() <= new Date(time.last_real_check_time).getSeconds() && global.set_time - time.last_real_check_time > 60000) {
|
|
|
debugger
|
|
|
limit = limit + 60 * 1000
|
|
|
}
|
|
|
@@ -213,12 +213,12 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
|
|
|
return <View className="modal_content">
|
|
|
<LimitPickers ref={limitPickerRef} limit={limit} limitDay={8}
|
|
|
- themeColor={color}
|
|
|
- title={title}
|
|
|
- onCancel={hidePicker} onChange={(e) => {
|
|
|
- pickerConfirm(e)
|
|
|
- hidePicker()
|
|
|
- }} />
|
|
|
+ themeColor={color}
|
|
|
+ title={title}
|
|
|
+ onCancel={hidePicker} onChange={(e) => {
|
|
|
+ pickerConfirm(e)
|
|
|
+ hidePicker()
|
|
|
+ }} />
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
@@ -374,7 +374,10 @@ export default function Component(props: { isNextStep?: boolean }) {
|
|
|
value={isFast ? fastPickerValue : sleepPickerValue}
|
|
|
themeColor={color}
|
|
|
title={title}
|
|
|
- showBtns={true} onCancel={() => { global.showClockModal2(false, durationPickerContent()); }} />
|
|
|
+ showBtns={true}
|
|
|
+ onCancel={() => {
|
|
|
+ global.showClockModal2(false, durationPickerContent());
|
|
|
+ }} />
|
|
|
</View>
|
|
|
}
|
|
|
|