|
|
@@ -2,7 +2,7 @@ import { Component, PropsWithChildren, useEffect, useRef, useState } from 'react
|
|
|
import { View, Text, Button, Input, Picker, Swiper, SwiperItem } from '@tarojs/components'
|
|
|
import '../index/index.scss'
|
|
|
import './Clock.scss'
|
|
|
-import Taro, { useDidShow, useReady, useRouter } from '@tarojs/taro'
|
|
|
+import Taro, { useDidShow, usePageScroll, useReady, useRouter } from '@tarojs/taro'
|
|
|
// import ComponentA from './component'
|
|
|
import Rings from '@components/view/Rings';
|
|
|
|
|
|
@@ -27,6 +27,8 @@ import RequestType, { thirdPartRequest } from '@/services/thirdPartRequest'
|
|
|
import { setConfigs } from '@/store/common'
|
|
|
import RecordFastSleep from '@/features/trackTimeDuration/components/RecordFastSleep'
|
|
|
import Box from '@/components/layout/Box'
|
|
|
+import Layout from '@/components/layout/layout'
|
|
|
+import { NaviBarTitleShowType, TemplateType } from '@/utils/types'
|
|
|
// import TabBar from '../../components/Tabbar';
|
|
|
|
|
|
export default function IndexPage() {
|
|
|
@@ -152,8 +154,12 @@ export default function IndexPage() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ usePageScroll((e) => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
useDidShow(() => {
|
|
|
- global.tabBar.update(0)
|
|
|
+ global.updateTab(0)
|
|
|
if (user.isLogin) {
|
|
|
checkWXPubFollow()
|
|
|
getCheckData();
|
|
|
@@ -287,21 +293,22 @@ export default function IndexPage() {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <View style={{ flex: 1, flexDirection: 'column', display: 'flex', backgroundColor: '#000', color: '#fff' }}>
|
|
|
- {
|
|
|
- needShowAddTip && <Tooltip title="添加到我的小程序" closeTip={() => { setNeedShowAddTip(false) }} />
|
|
|
- }
|
|
|
+ <Layout type={TemplateType.flex} title='时钟' titleShowStyle={NaviBarTitleShowType.scrollToShow}>
|
|
|
+ <View style={{ flex: 1, flexDirection: 'column', display: 'flex', backgroundColor: '#000', color: '#fff' }}>
|
|
|
+ {
|
|
|
+ needShowAddTip && <Tooltip title="添加到我的小程序" closeTip={() => { setNeedShowAddTip(false) }} />
|
|
|
+ }
|
|
|
|
|
|
- <TitleBar />
|
|
|
- <Box>
|
|
|
- <View className='clock_bg'>
|
|
|
- <Clocks />
|
|
|
- </View>
|
|
|
+ <TitleBar />
|
|
|
+ <Box>
|
|
|
+ <View className='clock_bg'>
|
|
|
+ <Clocks />
|
|
|
+ </View>
|
|
|
|
|
|
- </Box>
|
|
|
+ </Box>
|
|
|
|
|
|
- {
|
|
|
- needSwiper() ? <Swiper style={{ flexShrink: 0, display: 'flex', height: 173 }} indicatorColor='#999'
|
|
|
+ {/* {
|
|
|
+ needSwiper() ? <Swiper className='swiper' style={{ flexShrink: 0, display: 'flex', height: 173 }} indicatorColor='#999'
|
|
|
indicatorActiveColor='#333'
|
|
|
indicatorDots>
|
|
|
<SwiperItem className='swiperItem'>
|
|
|
@@ -315,28 +322,27 @@ export default function IndexPage() {
|
|
|
</Swiper> :
|
|
|
<Console />
|
|
|
|
|
|
- }
|
|
|
+ } */}
|
|
|
+
|
|
|
+ <Console />
|
|
|
|
|
|
|
|
|
- <More ref={global.moreRef} />
|
|
|
- {/* {
|
|
|
+ <More ref={global.moreRef} />
|
|
|
+ {/* {
|
|
|
!permission.wxPubFollow && user.isLogin && <Text style={{ textAlign: 'center', width: '100%' }} onClick={() => followWxPub()}>去关注公众号</Text>
|
|
|
} */}
|
|
|
|
|
|
- {
|
|
|
- checkData && schedule()
|
|
|
- }
|
|
|
+ {
|
|
|
+ checkData && schedule()
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- {
|
|
|
- checkData && (checkData as any).latest_record && <RecordFastSleep type='latest' data={(checkData as any).latest_record} delSuccess={getCheckData} />
|
|
|
- // <Schedule type='latest' delSuccess={getCheckData} />
|
|
|
- }
|
|
|
- {/* <Picker mode="time" start="07:00" end="20:00">
|
|
|
- <Text style="color: #fff;">test picker</Text>
|
|
|
- </Picker> */}
|
|
|
- <View style={{ height: 100 }} />
|
|
|
- {/* <View className='popDemo' catchMove/> */}
|
|
|
- </View>
|
|
|
+ {
|
|
|
+ checkData && (checkData as any).latest_record && <RecordFastSleep type='latest' data={(checkData as any).latest_record} delSuccess={getCheckData} />
|
|
|
+ // <Schedule type='latest' delSuccess={getCheckData} />
|
|
|
+ }
|
|
|
+ <View style={{ height: 100 }} />
|
|
|
+ </View>
|
|
|
+ </Layout>
|
|
|
)
|
|
|
}
|