|
@@ -10,7 +10,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
import { getInfoSuccess, logoutSuccess } from '@/store/user';
|
|
import { getInfoSuccess, logoutSuccess } from '@/store/user';
|
|
|
import { wxPubFollow } from '@/services/permission';
|
|
import { wxPubFollow } from '@/services/permission';
|
|
|
import { gobalConfigs, staticResources, uploadSessionKey } from '@/services/common';
|
|
import { gobalConfigs, staticResources, uploadSessionKey } from '@/services/common';
|
|
|
-import { use } from 'i18next';
|
|
|
|
|
import Clocks from '@/features/trackTimeDuration/components/Clock';
|
|
import Clocks from '@/features/trackTimeDuration/components/Clock';
|
|
|
import Console from '@/features/trackTimeDuration/components/Console';
|
|
import Console from '@/features/trackTimeDuration/components/Console';
|
|
|
import More from '@/features/trackTimeDuration/components/More';
|
|
import More from '@/features/trackTimeDuration/components/More';
|
|
@@ -28,7 +27,7 @@ import { setConfigs } from '@/store/common'
|
|
|
import RecordFastSleep from '@/features/trackTimeDuration/components/RecordFastSleep'
|
|
import RecordFastSleep from '@/features/trackTimeDuration/components/RecordFastSleep'
|
|
|
import Box from '@/components/layout/Box'
|
|
import Box from '@/components/layout/Box'
|
|
|
import Layout from '@/components/layout/layout'
|
|
import Layout from '@/components/layout/layout'
|
|
|
-import { NaviBarTitleShowType, TemplateType } from '@/utils/types'
|
|
|
|
|
|
|
+import { CheckBoxType, NaviBarTitleShowType, TemplateType } from '@/utils/types'
|
|
|
import { updateScenario } from '@/store/time'
|
|
import { updateScenario } from '@/store/time'
|
|
|
import { showModal } from '@/store/modal'
|
|
import { showModal } from '@/store/modal'
|
|
|
// import TabBar from '../../components/Tabbar';
|
|
// import TabBar from '../../components/Tabbar';
|
|
@@ -38,7 +37,6 @@ export default function IndexPage() {
|
|
|
const [checkData, setCheckData] = useState(null)
|
|
const [checkData, setCheckData] = useState(null)
|
|
|
const user = useSelector((state: any) => state.user);
|
|
const user = useSelector((state: any) => state.user);
|
|
|
const time = useSelector((state: any) => state.time);
|
|
const time = useSelector((state: any) => state.time);
|
|
|
- const permission = useSelector((state: any) => state.permission);
|
|
|
|
|
const common = useSelector((state: any) => state.common);
|
|
const common = useSelector((state: any) => state.common);
|
|
|
const [counter, setCounter] = useState(0)
|
|
const [counter, setCounter] = useState(0)
|
|
|
const [timerId, setTimerId] = useState(null)
|
|
const [timerId, setTimerId] = useState(null)
|
|
@@ -52,6 +50,7 @@ export default function IndexPage() {
|
|
|
|
|
|
|
|
const [showModal2, setShowModal2] = useState(false)
|
|
const [showModal2, setShowModal2] = useState(false)
|
|
|
const [modalDetail2, setModalDetail2] = useState<any>({})
|
|
const [modalDetail2, setModalDetail2] = useState<any>({})
|
|
|
|
|
+ const [showSingleFastEnd, setShowSingleFastEnd] = useState(false)
|
|
|
|
|
|
|
|
global.dispatch = dispatch;
|
|
global.dispatch = dispatch;
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -131,7 +130,7 @@ export default function IndexPage() {
|
|
|
setCounter((prevCounter) => prevCounter + 1);
|
|
setCounter((prevCounter) => prevCounter + 1);
|
|
|
//每天0点刷新一下打卡数据
|
|
//每天0点刷新一下打卡数据
|
|
|
var now = new Date()
|
|
var now = new Date()
|
|
|
- if (now.getHours()==0 && now.getMinutes()==0){
|
|
|
|
|
|
|
+ if (now.getHours() == 0 && now.getMinutes() == 0) {
|
|
|
getCheckData()
|
|
getCheckData()
|
|
|
}
|
|
}
|
|
|
}, 1000);
|
|
}, 1000);
|
|
@@ -164,7 +163,6 @@ export default function IndexPage() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
usePageScroll((e) => {
|
|
usePageScroll((e) => {
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
useDidShow(() => {
|
|
useDidShow(() => {
|
|
@@ -194,8 +192,13 @@ export default function IndexPage() {
|
|
|
setCheckData(res as any)
|
|
setCheckData(res as any)
|
|
|
|
|
|
|
|
if ((res as any).current_record.status == 'ONGOING1') {
|
|
if ((res as any).current_record.status == 'ONGOING1') {
|
|
|
- setSwiperIndex(1)
|
|
|
|
|
- setAutoPlay(true)
|
|
|
|
|
|
|
+ setShowSingleFastEnd(true)
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ setShowSingleFastEnd(false)
|
|
|
|
|
+ setSwiperIndex(1)
|
|
|
|
|
+ setAutoPlay(true)
|
|
|
|
|
+ }, 2000)
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
setSwiperIndex(0)
|
|
setSwiperIndex(0)
|
|
@@ -232,6 +235,9 @@ export default function IndexPage() {
|
|
|
(time.status == 'WAIT_FOR_START' ||
|
|
(time.status == 'WAIT_FOR_START' ||
|
|
|
time.status == 'ONGOING1' ||
|
|
time.status == 'ONGOING1' ||
|
|
|
time.status == 'ONGOING2')
|
|
time.status == 'ONGOING2')
|
|
|
|
|
+ if (showSingleFastEnd) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
return isNeed
|
|
return isNeed
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -258,7 +264,6 @@ export default function IndexPage() {
|
|
|
<View className='clock_bg'>
|
|
<View className='clock_bg'>
|
|
|
<Clocks />
|
|
<Clocks />
|
|
|
</View>
|
|
</View>
|
|
|
-
|
|
|
|
|
</Box>
|
|
</Box>
|
|
|
|
|
|
|
|
{
|
|
{
|
|
@@ -283,7 +288,7 @@ export default function IndexPage() {
|
|
|
<Console isNextStep={true} />
|
|
<Console isNextStep={true} />
|
|
|
</SwiperItem>
|
|
</SwiperItem>
|
|
|
</Swiper> :
|
|
</Swiper> :
|
|
|
- <Console />
|
|
|
|
|
|
|
+ <Console isNextStep={showSingleFastEnd} />
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -293,17 +298,19 @@ export default function IndexPage() {
|
|
|
checkData && schedule()
|
|
checkData && schedule()
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
- checkData && (checkData as any).latest_record &&
|
|
|
|
|
|
|
+ checkData && (checkData as any).latest_record &&
|
|
|
<RecordFastSleep type='latest' data={(checkData as any).latest_record} delSuccess={getCheckData} />
|
|
<RecordFastSleep type='latest' data={(checkData as any).latest_record} delSuccess={getCheckData} />
|
|
|
}
|
|
}
|
|
|
<View style={{ height: 100 }} />
|
|
<View style={{ height: 100 }} />
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
showModal && modalDetail
|
|
showModal && modalDetail
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
showModal2 && modalDetail2
|
|
showModal2 && modalDetail2
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
</Layout>
|
|
</Layout>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|