Leon 1 jaar geleden
bovenliggende
commit
2ba6316c84

+ 2 - 0
src/features/trackSomething/components/DayNightCard.scss

@@ -9,6 +9,7 @@
     font-size: 32px;
     line-height: 32px;
     font-weight: bold;
+    
 }
 
 .free {
@@ -39,6 +40,7 @@
     font-size: 36px;
     font-weight: bold;
     left: 0;
+    letter-spacing: -2px;
 }
 
 .day_night_desc{

+ 8 - 10
src/features/trackSomething/components/DayNightCard.tsx

@@ -54,6 +54,7 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             latestLocation({
                 date_start: strYesterday, date_end: strTomorrow
             }).then(data => {
+                debugger
                 setAuthInfo(data as any)
                 updateDate(data)
                 locationDetail = data
@@ -73,16 +74,14 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
                 var detail: any = locationDetail
                 var now = new Date()
                 if (now.getHours() == 0 && now.getMinutes() == 0 && now.getSeconds() == 0) {
-                    console.log('9527')
                     detail.daylights.splice(0, 1)
                 }
                 locationDetail = detail
-                
+
                 // setLocationDetail(detail)
                 updateDate(detail)
             }
             else {
-                console.log('apple')
             }
         }, 1000)
     }, [])
@@ -92,7 +91,7 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
     // })
 
     function updateDate(data) {
-        
+
         var today = new Date()
         // var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
         var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000)
@@ -131,7 +130,6 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             }
             //今天白天(今天出日后-日落前)
             else if (todaySunriseDate.getTime() < today.getTime() && today.getTime() < todaySunsetDate.getTime()) {
-                console.log('2')
                 setNightDate(today)
                 setDayDate(today)
                 if (props.isNight) {
@@ -155,7 +153,6 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             }
             //今天夜晚
             else if (today.getTime() > todaySunsetDate.getTime() && today.getTime() < tomorrowSunriseDate.getTime()) {
-                console.log('3')
                 setNightDate(today)
                 setDayDate(tomorrow)
                 if (props.isNight) {
@@ -234,11 +231,11 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
         return <View className='day_night_card_footer'>
             <Text style={{ color: '#9E9E9E', fontSize: rpxToPx(20) }}>{
                 // !isMember ? t('feature.track_time_duration.third_ring.member_desc') :
-                authInfo ? t('feature.track_time_duration.third_ring.base_location_desc') :
+                authInfo && (authInfo as any).lat ? t('feature.track_time_duration.third_ring.base_location_desc') :
                     t('feature.track_time_duration.third_ring.enter_location_desc')
             }</Text>
             {
-                authInfo && <Text style={{ color: '#9E9E9E', fontSize: rpxToPx(20) }} onClick={(e) => {
+                authInfo && (authInfo as any).lat && <Text style={{ color: '#9E9E9E', fontSize: rpxToPx(20) }} onClick={(e) => {
                     e.stopPropagation()
                     auth()
                 }}>Edit Location</Text>
@@ -281,11 +278,12 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             success: function (res) {
                 console.log(res)
                 var today = new Date()
+                var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
                 var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 3)
-                var strToday = `${today.getFullYear()}-${TimeFormatter.padZero(today.getMonth() + 1)}-${TimeFormatter.padZero(today.getDate())}`
+                var strYesterday = `${yesterday.getFullYear()}-${TimeFormatter.padZero(yesterday.getMonth() + 1)}-${TimeFormatter.padZero(yesterday.getDate())}`
                 var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
 
-                systemLocation({ lat: res.latitude, lng: res.longitude, date_start: strToday, date_end: strTomorrow }).then(data => {
+                systemLocation({ lat: res.latitude, lng: res.longitude, date_start: strYesterday, date_end: strTomorrow }).then(data => {
                     console.log(data);
                     updateDate(data);
                     locationDetail = data;

+ 0 - 2
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -44,8 +44,6 @@ export default function IndexConsole(props: { record: any }) {
             var sleepCount = currentRecord.sleep.target_end_time - currentRecord.sleep.target_start_time
             setSleepDuration(sleepCount)
         }
-
-        debugger
         if (props.record.current_record.status=='WAIT_FOR_START'){
             setExpand(false)
         }

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

@@ -41,7 +41,6 @@ export default function Component(props: { type: string, data: any, time: any, s
 
     useEffect(() => {
         setCount((pre) => pre + 1)
-        debugger
     }, [dayNight.nightRingSunrise, dayNight.nightRingSunset])
 
     useEffect(() => {
@@ -244,6 +243,10 @@ export default function Component(props: { type: string, data: any, time: any, s
             durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
         }
 
+        if (new Date().getDate()){
+
+        }
+
 
         return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 > duration ? null : realRing} currentDot={currentDot} canvasId={props.type + props.time + 'day'} />
     }
@@ -298,8 +301,8 @@ export default function Component(props: { type: string, data: any, time: any, s
             return ''
         }
         if (record.fast.status == 'WAIT_FOR_END') {
-
-            return TimeFormatter.formateTimeDifference(record.fast.real_start_time, new Date().getTime(), false)
+            return TimeFormatter.countdown(record.fast.real_start_time)
+            // return TimeFormatter.formateTimeDifference(record.fast.real_start_time, new Date().getTime(), false)
         }
         if (isStageMode && record.scenario == 'FAST_SLEEP') {
             if (stageList[0]) {

+ 3 - 2
src/pages/clock/Index.tsx

@@ -94,8 +94,8 @@ export default function Page() {
             if (isPause) {
                 return
             }
-            if (user.isLogin)
-                setCount((prevCounter) => prevCounter + 1)
+            setCount((prevCounter) => prevCounter + 1)
+                
         }, 1000)
     }, [])
 
@@ -105,6 +105,7 @@ export default function Page() {
 
     useReady(async () => {
         const userData = await getStorage('userData');
+        debugger
         if (userData) {
             dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
             // setTimeout(() => {

+ 0 - 1
src/pages/common/RecordsHistory.tsx

@@ -126,7 +126,6 @@ export default function Page() {
     })
 
     usePullDownRefresh(() => {
-        console.log('aaa')
         refresh()
     })