Leon 2 yıl önce
ebeveyn
işleme
5984f6b400

+ 10 - 1
src/app.config.ts

@@ -21,7 +21,8 @@ const appConfig = defineAppConfig({
     'pages/workout/Workout',
     'pages/workout/WorkoutDetail',
     'pages/workout/Working',
-    'pages/workout/History'
+    'pages/workout/History',
+    'pages/account/Member'
   ],
   subPackages: [
     {
@@ -34,6 +35,14 @@ const appConfig = defineAppConfig({
   usingComponents: {
     'mysvg': './components/basic/svg'
   },
+  "requiredPrivateInfos": [
+    "chooseLocation"
+  ],
+  "permission": {
+    "scope.userLocation": {
+      "desc": "获取您选择的位置...."
+    }
+  },
   // tabBar: {
   //   custom: true,
   //   list:[

+ 1 - 1
src/app.tsx

@@ -24,7 +24,7 @@ if (process.env.TARO_ENV == 'rn') {
 const App: React.FC<PropsWithChildren> = ({ children }) => {
   console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
   if (process.env.TARO_ENV=='rn'){
-    alert(Intl.DateTimeFormat().resolvedOptions().timeZone)
+    // alert(Intl.DateTimeFormat().resolvedOptions().timeZone)
   }
   if (process.env.TARO_ENV == 'weapp') {
     global.isDebug = Taro.getStorageSync('isDebug')

+ 2 - 0
src/context/themes/color.tsx

@@ -6,4 +6,6 @@ export enum ColorType {
     food = '#FF7A4E',
     workout = 'yellow',
     alert = '#ea6c6c',
+    night = '#1446B9',
+    day = '#C9DAFF',
 }

+ 0 - 0
src/features/trackSomething/components/Discovery.scss


+ 93 - 0
src/features/trackSomething/components/Discovery.tsx

@@ -0,0 +1,93 @@
+import { View, Text, Image } from "@tarojs/components";
+import { getBgRing, getCommon, getDot, getReal, getSchedule, getTarget } from "@/features/trackTimeDuration/hooks/RingData";
+import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
+import { ColorType } from "@/context/themes/color";
+import { useSelector } from "react-redux";
+import Rings from "@/features/trackTimeDuration/components/Rings";
+
+export default function Discovery() {
+    const user = useSelector((state: any) => state.user);
+    function bigRing() {
+        var common = getCommon(null, true)
+        common.radius = 42;
+        common.lineWidth = 9;
+        var bgRing = getBgRing()
+        const realRingBig: RealRing = {
+            color: ColorType.day,
+            startArc: 0,
+            durationArc: 2
+        }
+        var sunRise = 24 * 60 + (user.test_user ? 7 * 60 : 6 * 60)
+        var sunSet = user.test_user ? 19 * 60 : 18 * 60
+        var duration = sunRise - sunSet
+        realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
+        realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
+        return <Rings common={common} bgRing={bgRing} realRing={realRingBig} canvasId={'me_big'} />
+    }
+    function smallRing() {
+        var common = getCommon(null, false)
+        common.radius = 28;
+        common.lineWidth = 9;
+        var bgRing = getBgRing()
+        const realRingBig: RealRing = {
+            color: ColorType.day,
+            startArc: 0,
+            durationArc: 2
+        }
+        var sunRise = 24 * 60 + (user.test_user ? 7 * 60 : 6 * 60)
+        var sunSet = user.test_user ? 19 * 60 : 18 * 60
+        var duration = sunRise - sunSet
+        realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
+        realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
+        return <Rings common={common} bgRing={bgRing} realRing={realRingBig} canvasId={'me_small'} />
+    }
+    function dayRing() {
+        var common = getCommon(null, true)
+        common.radius = 56;
+        common.lineWidth = 9;
+        var bgRing = getBgRing()
+
+        const realRingBig: RealRing = {
+            color: ColorType.day,
+            startArc: 0,
+            durationArc: 2
+        }
+        var sunRise = 24 * 60 + (user.test_user ? 7 * 60 : 6 * 60)
+        var sunSet = user.test_user ? 19 * 60 : 18 * 60
+        var duration = sunRise - sunSet
+        realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
+        realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
+        return <Rings common={common} bgRing={bgRing} realRing={realRingBig} canvasId={'me_day'} />
+    }
+
+    function rings() {
+        return <View style={{ position: 'relative', zIndex: 1 }}>
+            {
+                bigRing()
+            }
+            {
+                <View style={{ display: 'flex', position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, alignItems: 'center', justifyContent: 'center' }}>
+                    {
+                        smallRing()
+                    }
+                </View>
+            }
+            {
+                <View style={{ display: 'flex', position: 'absolute', left: -14, top: -14, right: -14, bottom: -14 }}>
+                    {
+                        dayRing()
+                    }
+                </View>
+            }
+
+        </View>
+    }
+    return <View >
+        <View style={{display:'flex',flexDirection:'row'}}>
+        {
+            rings()
+        }
+        </View>
+        
+    </View>
+}

+ 56 - 0
src/features/trackTimeDuration/components/DayLight.scss

@@ -0,0 +1,56 @@
+.daylight_row {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    box-sizing: border-box;
+    margin-left: 46px;
+    margin-right: 46px;
+}
+
+.daylight_note {
+    display: flex;
+    flex-direction: column;
+    color: #fff;
+    opacity: 0.4;
+    margin-top: 10px;
+    margin-left: 46px;
+    margin-right: 46px;
+    font-size: 24px;
+}
+
+.become_vip {
+    margin-left: 46px;
+    margin-right: 46px;
+    background: linear-gradient(90deg, #2F66E5 0%, #8961F5 100%);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 42px;
+    height: 84px;
+    margin-top: 40px;
+}
+
+.daylight_item {
+    display: flex;
+    flex-direction: row;
+    margin-left: 46px;
+    margin-right: 46px;
+    box-sizing: border-box;
+    align-items: center;
+}
+
+.daylight_arrow {
+    width: 60px;
+    height: 60px;
+}
+
+.address {
+    display: -webkit-box;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 1;
+    white-space: normal;
+    width: 240px;
+}

+ 184 - 0
src/features/trackTimeDuration/components/DayLight.tsx

@@ -0,0 +1,184 @@
+import { useEffect, useState } from 'react'
+import './DayLight.scss'
+import { View, Text, Switch, Image } from '@tarojs/components'
+import Taro from '@tarojs/taro'
+import { useSelector } from 'react-redux'
+export default function DayLight() {
+    const [showRing, setShowRing] = useState(false)
+    const [isTomorrow, setIsTomorrow] = useState(false)
+    const [isMember, setIsMember] = useState(false)
+    const [isNight, setIsNight] = useState(false)
+    const [authInfo, setAuthInfo] = useState(null)
+    const [sunriseTime, setSunriseTime] = useState('06:00')
+    const [sunsetTime, setSunsetTime] = useState('18:00')
+
+    const user = useSelector((state: any) => state.user);
+
+    useEffect(() => { getContent() }, [])
+
+    useEffect(() => {
+        setIsMember(user.test_user)
+        if (user.test_user) {
+            setSunriseTime('07:00')
+            setSunsetTime('19:00')
+        }
+        else {
+            setSunriseTime('06:00')
+            setSunsetTime('18:00')
+        }
+    }, [user.test_user])
+
+    async function getStorage(key: string) {
+        try {
+            const res = await Taro.getStorage({ key });
+            return res.data;
+        } catch {
+            return '';
+        }
+    }
+
+    async function getContent() {
+        const isShow = await getStorage('showLightRing') || false
+        setShowRing(isShow)
+
+        global.showNightRing = isShow
+        global.refreshIndex()
+
+        const gpsInfo = await getStorage('gps') || null
+        if (gpsInfo) {
+            setAuthInfo(JSON.parse(gpsInfo))
+        }
+        else {
+            setAuthInfo(null)
+        }
+
+
+        checkData()
+    }
+
+
+    function checkData() {
+        var date = new Date()
+        var minutes = date.getHours() * 60 + date.getMinutes()
+        var riseMinutes = parseInt(sunriseTime.split(':')[0]) * 60 + parseInt(sunriseTime.split(':')[1])
+        var setMinutes = parseInt(sunsetTime.split(':')[0]) * 60 + parseInt(sunsetTime.split(':')[1])
+        if (minutes >= riseMinutes && minutes < setMinutes) {
+            setIsNight(false)
+        }
+        else {
+            setIsNight(true)
+        }
+        if (minutes >= setMinutes) {
+            setIsTomorrow(true)
+        }
+        else {
+            setIsTomorrow(false)
+        }
+    }
+
+    function buy() {
+        Taro.navigateTo({
+            url: '/pages/account/Member'
+        })
+    }
+
+    function auth() {
+        Taro.chooseLocation({
+            success: function (res) {
+                console.log(res)
+                setAuthInfo(res as any)
+                Taro.setStorage({
+                    key: 'gps',
+                    data: JSON.stringify(res as any)
+                })
+            },
+            fail(res) {
+                Taro.showToast({
+                    title: '位置修改失败!\n请重新选择就近位置',
+                    icon: 'none'
+                })
+            },
+        })
+
+    }
+
+    var split = new Date().toString().split(' ');
+    var timezone = split[split.length - 2];
+
+
+
+    return <View>
+        <View className='daylight_row'>
+            <Text>{isNight ? 'Night ring' : 'Day ring'}</Text>
+            <Switch checked={showRing}
+                onChange={(e) => {
+                    setShowRing(e.detail.value)
+                    global.showNightRing = e.detail.value
+                    global.refreshIndex()
+                    Taro.setStorage({
+                        key: 'showLightRing',
+                        data: e.detail.value
+                    })
+                }}
+            />
+        </View>
+        {
+            showRing && <View>
+                <View className="daylight_row">
+                    <Text>Sunset today</Text>
+                    <Text>{sunsetTime}</Text>
+                </View>
+                <View className="daylight_row">
+                    <Text>{isTomorrow ? 'Sunrise tomororow' : 'Sunrise today'}</Text>
+                    <Text>{sunriseTime}</Text>
+                </View>
+                <Text className='daylight_note'>{isMember ? 'Calculated based on your location.' : 'Sunset and sunrise times are global average. For actual times at your location, join our Pro program.'}</Text>
+                {
+                    isMember ? <View>
+                        <View className='daylight_item' onClick={auth}>
+                            <Text style={{ flex: 1 }}>Location</Text>
+                            {
+                                authInfo ? <Text className='address'>{(authInfo as any).address}</Text> :
+                                    <Text>Enter</Text>
+                            }
+                            <Image className="daylight_arrow" src={require('@/assets/images/arrow3.png')} />
+                        </View>
+
+                        {
+                            authInfo && <View className='daylight_item' >
+                                <Text style={{ flex: 1 }}>Latitude</Text>
+
+                                <Text>{(authInfo as any).latitude}</Text>
+
+
+                            </View>
+                        }
+                        {
+                            authInfo && <View className='daylight_item'>
+                                <Text style={{ flex: 1 }}>Longitude</Text>
+
+                                <Text>{(authInfo as any).longitude}</Text>
+
+                            </View>
+                        }
+                        {
+                            authInfo && <View className='daylight_item'>
+                                <Text style={{ flex: 1 }}>Time zone</Text>
+
+                                <Text>{timezone}</Text>
+
+                            </View>
+                        }
+
+                    </View> :
+                        <View className='become_vip' onClick={buy}>
+                            <Text style={{ color: '#000' }}>Become Pro</Text>
+                        </View>
+                }
+
+            </View>
+        }
+
+    </View>
+
+}

+ 53 - 6
src/features/trackTimeDuration/components/IndexItem.tsx

@@ -18,7 +18,8 @@ export default function Component(props: { type: string, data: any, time: any })
     const { t } = useTranslation()
     const record = props.data.current_record;
     const user = useSelector((state: any) => state.user);
-    const [stageList, setStageList] = useState([true,false,false])
+    const [stageList, setStageList] = useState([true, false, false])
+    const [isStageMode, setIsStageMode] = useState(false)
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
@@ -29,6 +30,10 @@ export default function Component(props: { type: string, data: any, time: any })
             global.updateMixItem = (data) => {
                 setStageList(data)
             }
+
+            global.changeMixIndex = (index) => {
+                setIsStageMode(index == 1)
+            }
         }
     }, [])
 
@@ -114,7 +119,11 @@ export default function Component(props: { type: string, data: any, time: any })
                         list.push(realRingBig)
                     }
                 }
-                return <Rings common={common} bgRing={bgRing} stageList={list} realRing={realRing1} canvasId={props.type + props.time + 'big'} />
+
+                if (!isStageMode) {
+                    list = []
+                }
+                return <Rings common={common} bgRing={bgRing} currentDot={isStageMode ? null : currentDot1} stageList={list} realRing={realRing1} canvasId={props.type + props.time + 'big'} />
             }
             var realRing1 = getReal(record, true, false)
             return <Rings common={common} bgRing={bgRing} realRing={realRing1} currentDot={currentDot1} targetRing={targetBigRing1} canvasId={props.type + props.time + 'big'} />
@@ -132,23 +141,27 @@ export default function Component(props: { type: string, data: any, time: any })
                 if (record.sleep.status == 'WAIT_FOR_END') {
                     var targetBigRing1 = getTarget(record, false)
                     targetBigRing1.color = ColorType.sleep + '66'
+                    var currentDot = getDot(record, false)
                     realRing.durationArc = durationArc(record.sleep.target_start_time, (new Date()).getTime())
-                    return <Rings common={common} bgRing={bgRing} canvasId={props.type + props.time + 'small'} targetRing={targetBigRing1} realRing={realRing} />
+                    return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + props.time + 'small'} targetRing={targetBigRing1} realRing={realRing} />
                 }
                 else if (record.status == 'WAIT_FOR_START' || record.status == 'ONGOING1') {
                     realRing = getSchedule(record, false, true)
-                    return <Rings common={common} bgRing={bgRing} realRing={realRing} canvasId={props.type + props.time + 'small'} />
+                    var currentDot = getDot(record, false)
+                    return <Rings common={common} bgRing={bgRing} currentDot={isStageMode ? null : currentDot} realRing={realRing} canvasId={props.type + props.time + 'small'} />
                 }
                 else if (record.sleep.status == 'NOT_COMPLETED') {
                     realRing.durationArc = 0.01
-                    return <Rings common={common} bgRing={bgRing} canvasId={props.type + props.time + 'small'} realRing={realRing} />
+                    var currentDot = getDot(record, false)
+                    return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + props.time + 'small'} realRing={realRing} />
                 }
                 else if (record.sleep.status == 'COMPLETED') {
                     realRing = getReal(record, false, true)
                     return <Rings common={common} bgRing={bgRing} canvasId={props.type + props.time + 'small'} realRing={realRing} />
                 }
                 else if (record.sleep.status == 'ONGOING2') {
-                    return <Rings common={common} bgRing={bgRing} canvasId={props.type + props.time + 'small'} />
+                    var currentDot = getDot(record, false)
+                    return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId={props.type + props.time + 'small'} />
                 }
                 return <Rings common={common} bgRing={bgRing} canvasId={props.type + props.time + 'small'} />
             }
@@ -170,6 +183,25 @@ export default function Component(props: { type: string, data: any, time: any })
         return null
     }
 
+    function dayRing() {
+        var common = getCommon(null, true)
+        common.radius = 56;
+        common.lineWidth = 9;
+        var bgRing = getBgRing()
+
+        const realRingBig: RealRing = {
+            color: ColorType.night + '66',
+            startArc: 0,
+            durationArc: 2
+        }
+        var sunRise = 24 * 60 + (user.test_user ? 7 * 60 : 6 * 60)
+        var sunSet = user.test_user ? 19 * 60 : 18 * 60
+        var duration = sunRise - sunSet
+        realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
+        realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
+        return <Rings common={common} bgRing={bgRing} realRing={realRingBig} canvasId={props.type + props.time + 'day'} />
+    }
+
     function rings() {
         return <View style={{ position: 'relative', zIndex: 1 }}>
             {
@@ -182,6 +214,13 @@ export default function Component(props: { type: string, data: any, time: any })
                     }
                 </View>
             }
+            {
+                props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true && <View style={{ display: 'flex', position: 'absolute', left: -14, top: -14, right: -14, bottom: -14 }}>
+                    {
+                        dayRing()
+                    }
+                </View>
+            }
 
         </View>
     }
@@ -245,6 +284,14 @@ export default function Component(props: { type: string, data: any, time: any })
                 rings()
             }
             <View className="duration_bg">
+                {
+                    props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true &&
+                    <Text className="duration_title">夜长</Text>
+                }
+                {
+                    props.type == 'FAST_SLEEP' && user.isLogin && global.showNightRing === true &&
+                    <Text className="duration_value" style={{color:ColorType.night}}>12小时</Text>
+                }
                 {
                     (props.type == 'FAST' || props.type == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
                 }

+ 8 - 0
src/pages/account/Member.tsx

@@ -0,0 +1,8 @@
+import { rpxToPx } from "@/utils/tools";
+import { View,Text } from "@tarojs/components";
+
+export default function Page(){
+    return <View>
+        <Text style={{marginTop:100,width:rpxToPx(750),textAlign:'center',fontSize:30,color:'#fff'}}>Become Member</Text>
+    </View>
+}

+ 3 - 0
src/pages/account/Profile.tsx

@@ -15,6 +15,7 @@ import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import Tabbar from "@/components/navigation/TabBar";
 import { getInfoSuccess } from "@/store/user";
 import TitleView from "@/features/trackTimeDuration/components/TitleView";
+import Discovery from "@/features/trackSomething/components/Discovery";
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
@@ -158,6 +159,8 @@ export default function Page() {
                 </View>
             </Box>
 
+            <Discovery />
+
             <Box>
                 <View className="balance" onClick={tapBalance}>
                     <Text className="title">{t('page.more.stone')}</Text>

+ 58 - 8
src/pages/clock/Index.tsx

@@ -4,10 +4,10 @@ import IndexItem from '@/features/trackTimeDuration/components/IndexItem';
 import Rings from "@/features/trackTimeDuration/components/Rings";
 import './Index.scss'
 import { useDispatch, useSelector } from "react-redux";
-import { useReady } from "@tarojs/taro";
+import { useDidShow, useReady } from "@tarojs/taro";
 import Taro from "@tarojs/taro";
 import { getInfoSuccess } from "@/store/user";
-import { clockHome, getClocks } from "@/services/trackTimeDuration";
+import { clockHome, getClockRecords, getClocks } from "@/services/trackTimeDuration";
 import { updateScenario } from "@/store/time";
 import { setConfigs } from "@/store/common";
 import { setScenario } from "@/store/scenario";
@@ -19,10 +19,14 @@ import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Ri
 import IndexConsole from "@/features/trackTimeDuration/components/IndexConsole";
 import Modal from '@/components/layout/Modal'
 import { rpxToPx } from "@/utils/tools";
+import RecordFastSleep from "@/features/trackTimeDuration/components/RecordFastSleep";
+import DayLight from "@/features/trackTimeDuration/components/DayLight";
+import { getInfo } from "@/services/user";
 
 export default function Page() {
     const dispatch = useDispatch();
     global.dispatch = dispatch;
+    
     const user = useSelector((state: any) => state.user);
     const time = useSelector((state: any) => state.time);
     const [showErrorPage, setErrorPage] = useState(false)
@@ -41,6 +45,7 @@ export default function Page() {
     const [debugInfo, setDebugInfo] = useState(null)
 
     const [isMulti, setIsMulti] = useState(false)
+    const [records, setRecords] = useState([])
 
 
     const [multiData, setMultiData] = useState([
@@ -59,6 +64,7 @@ export default function Page() {
     ])
 
     useEffect(() => {
+        global.showNightRing = false;
         setInterval(() => {
             setCount((prevCounter) => prevCounter + 1)
         }, 1000)
@@ -79,11 +85,31 @@ export default function Page() {
             //     getCheckData()
 
             // }, 200)
+            getHistory()
+
+
 
         }
 
     })
 
+    useDidShow(() => {
+        if (user.isLogin)
+            refresh()
+    })
+
+    global.refreshIndex = () => {
+        setCount((prevCounter) => prevCounter + 1)
+    }
+
+    function refresh() {
+        getInfo().then(res => {
+            dispatch(getInfoSuccess(res))
+        }).catch(e => {
+
+        })
+    }
+
     function getCheckData() {
         // getClocks().then(res => {
         //     // setErrorPage(false)
@@ -101,6 +127,19 @@ export default function Page() {
         clockHome().then(res => {
             setHomeData(res as any)
         })
+
+        getHistory()
+    }
+
+    function getHistory() {
+        if (user.isLogin)
+            getClockRecords({
+                page: 1,
+                limit: 1,
+                part_completed: false
+            }).then(res => {
+                setRecords((res as any).data)
+            })
     }
 
     const startArc = (time: number) => {
@@ -291,6 +330,10 @@ export default function Page() {
                 indicator-offset={[0, -30]}
                 indicator-height={30}
                 indicatorDots={(homeData as any).fast_sleep.current_record.status == 'WAIT_FOR_START'}
+                onChange={(e) => {
+                    var pageIndex = e.detail.current
+                    global.changeMixIndex(pageIndex)
+                }}
             >
                 <SwiperItem className='swiperItem'>
                     <IndexConsole record={(homeData as any).fast_sleep} />
@@ -304,7 +347,7 @@ export default function Page() {
                             {
                                 isMulti ? <View>
                                     {
-                                        multiData.map((item,index) => {
+                                        multiData.map((item, index) => {
                                             return <View className={item.checked ? "single_check_sel" : "single_check_nor"} onClick={() => {
                                                 item.checked = !item.checked
                                                 global.updateMixItem([multiData[0].checked, multiData[1].checked, multiData[2].checked])
@@ -321,19 +364,19 @@ export default function Page() {
                                     }
                                 </View> : <View>
 
-                                    <View className={selIndex == 0 ? "single_check_sel" : "single_check_nor"} onClick={() => {setSelIndex(0);global.updateMixItem([true, false, false]);setCount((prevCounter) => prevCounter + 1)}}>
+                                    <View className={selIndex == 0 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(0); global.updateMixItem([true, false, false]); setCount((prevCounter) => prevCounter + 1) }}>
                                         <Text className={selIndex == 0 ? "single_check_text_sel" : "single_check_text_nor"}>睡前断食</Text>
                                         {
                                             selIndex == 0 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
                                         }
                                     </View>
-                                    <View className={selIndex == 1 ? "single_check_sel" : "single_check_nor"} onClick={() => {setSelIndex(1);global.updateMixItem([false, true, false]);setCount((prevCounter) => prevCounter + 1)}}>
+                                    <View className={selIndex == 1 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(1); global.updateMixItem([false, true, false]); setCount((prevCounter) => prevCounter + 1) }}>
                                         <Text className={selIndex == 1 ? "single_check_text_sel" : "single_check_text_nor"}>睡眠中断食</Text>
                                         {
                                             selIndex == 1 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
                                         }
                                     </View>
-                                    <View className={selIndex == 2 ? "single_check_sel" : "single_check_nor"} onClick={() => {setSelIndex(2);global.updateMixItem([false, false, true]);setCount((prevCounter) => prevCounter + 1)}}>
+                                    <View className={selIndex == 2 ? "single_check_sel" : "single_check_nor"} onClick={() => { setSelIndex(2); global.updateMixItem([false, false, true]); setCount((prevCounter) => prevCounter + 1) }}>
                                         <Text className={selIndex == 2 ? "single_check_text_sel" : "single_check_text_nor"}>起床后断食</Text>
                                         {
                                             selIndex == 2 && <Image src={require('@assets/images/check_black.png')} className="single_checked" />
@@ -360,8 +403,15 @@ export default function Page() {
                 }
 
             </Swiper>
-
-
+            {
+                user.isLogin && <DayLight />
+            }
+            <Text className="discovery">最近</Text>
+            {
+                records.length > 0 && <View className="fast_sleep_item_bg">
+                    <RecordFastSleep data={records[0]} type='record' delSuccess={() => { }} />
+                </View>
+            }
 
 
             {/* 

+ 1 - 1
src/utils/utils.tsx

@@ -18,4 +18,4 @@ export default function pushPage(url: string) {
             url: url
         })
     }
-}
+}