|
|
@@ -17,7 +17,7 @@ import { ColorType } from "@/context/themes/color";
|
|
|
import { bigRingRadius, getBgRing, getCommon, getDot, getSchedule, ringWidth, smallRingRadius } from "@/features/trackTimeDuration/hooks/RingData";
|
|
|
import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
|
|
|
import IndexConsole from "@/features/trackTimeDuration/components/IndexConsole";
|
|
|
-import Modal from '@/components/layout/Modal'
|
|
|
+import Modal from '@/components/layout/Modal.weapp'
|
|
|
import { compareVersion, getTimezone, getTimezoneId, getTimezoneName, kIsIOS, rpxToPx } from "@/utils/tools";
|
|
|
import RecordFastSleep from "@/features/trackTimeDuration/components/RecordFastSleep";
|
|
|
import WeekCalendar from "@/features/trackTimeDuration/components/WeekCalendar";
|
|
|
@@ -112,7 +112,7 @@ export default function Page() {
|
|
|
const [needShowAddTip, setNeedShowAddTip] = useState(false)
|
|
|
const [showTip, setShowTip] = useState(false)
|
|
|
const [records, setRecords] = useState([])
|
|
|
-
|
|
|
+ const [showEatCalendar, setShowEatCalendar] = useState(false)
|
|
|
const [schedules, setSchedules] = useState<any>(null)
|
|
|
|
|
|
const permission = useSelector((state: any) => state.permission);
|
|
|
@@ -137,14 +137,14 @@ export default function Page() {
|
|
|
pauseTimer = false;
|
|
|
mainTimer()
|
|
|
|
|
|
- if (process.env.TARO_ENV=='rn'){
|
|
|
+ if (process.env.TARO_ENV == 'rn') {
|
|
|
NativeAppEventEmitter.addListener('openNotificationSetting', (data) => {
|
|
|
console.log('aaaa')
|
|
|
debugger
|
|
|
jumpPage('/pages/account/ChooseAuth', 'NotificationSetting', navigation)
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}, [])
|
|
|
|
|
|
function mainTimer() {
|
|
|
@@ -316,7 +316,7 @@ export default function Page() {
|
|
|
checkTimeZone()
|
|
|
}
|
|
|
else {
|
|
|
- if (!kIsIOS){
|
|
|
+ if (!kIsIOS) {
|
|
|
updateNotificationStatus()
|
|
|
}
|
|
|
}
|
|
|
@@ -810,19 +810,31 @@ export default function Page() {
|
|
|
|
|
|
var timestamp = new Date().getTime()
|
|
|
|
|
|
- function goSetting(){
|
|
|
- if (process.env.TARO_ENV=='weapp'){
|
|
|
+ function goSetting() {
|
|
|
+ if (process.env.TARO_ENV == 'weapp') {
|
|
|
Taro.navigateTo({
|
|
|
- url:'/pages/notification/setting'
|
|
|
+ url: '/pages/notification/setting'
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
jumpPage('/pages/account/ChooseAuth', 'NotificationSetting', navigation)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function eatCalendarContent() {
|
|
|
+ return <View style={{ display: 'flex', flexDirection: 'column' }}>
|
|
|
+ <View className="index_section">
|
|
|
+ <Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
|
|
|
+ </View>
|
|
|
+ <WeekCalendar isFastSleep={false}/>
|
|
|
+ <View className="vip_calendar" style={{marginBottom:40}} onClick={() => setShowEatCalendar(false)}>
|
|
|
+ <Text style={{ color: '#fff' }}>关闭</Text>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
function render() {
|
|
|
var smallTitle = ''
|
|
|
@@ -859,7 +871,7 @@ export default function Page() {
|
|
|
|
|
|
</View>
|
|
|
</Box>
|
|
|
-{/*
|
|
|
+ {/*
|
|
|
<Text style={{color:'#fff',fontSize:30}} onClick={goSetting}>notification setting</Text> */}
|
|
|
{
|
|
|
user.isLogin && records && records.length > 0 && <View className="index_section" style={{ marginTop: -rpxToPx(25 - 12), marginBottom: -rpxToPx(20) }}>
|
|
|
@@ -869,7 +881,7 @@ export default function Page() {
|
|
|
}
|
|
|
{
|
|
|
process.env.TARO_ENV == 'rn' && <View onClick={more}>
|
|
|
- <GradientText style={{ fontSize: rpxToPx(32), fontWeight: 'bold',color:'black' }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</GradientText>
|
|
|
+ <GradientText style={{ fontSize: rpxToPx(32), fontWeight: 'bold', color: 'black' }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</GradientText>
|
|
|
</View>
|
|
|
}
|
|
|
</View>
|
|
|
@@ -901,9 +913,24 @@ export default function Page() {
|
|
|
<View className="index_section">
|
|
|
<Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
|
|
|
</View>
|
|
|
- <WeekCalendar />
|
|
|
+ <WeekCalendar isFastSleep={true}/>
|
|
|
+ <View className="vip_calendar" onClick={() => setShowEatCalendar(true)}>
|
|
|
+ <Text style={{ color: '#fff' }}>Show eating and wake windows</Text>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
}
|
|
|
+ {
|
|
|
+ showEatCalendar && <Modal
|
|
|
+ testInfo={null}
|
|
|
+ dismiss={() => {
|
|
|
+ setShowEatCalendar(false)
|
|
|
+ }}
|
|
|
+ confirm={() => { }}>
|
|
|
+ {
|
|
|
+ eatCalendarContent()
|
|
|
+ }
|
|
|
+ </Modal>
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -919,7 +946,7 @@ export default function Page() {
|
|
|
<Text className="index_section_title">{t('feature.day_night.group_title')}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
user.isLogin && !showErrorPage && <DayNightSwiper count={count} schedule={schedules} homeData={homeData} />
|
|
|
}
|