|
|
@@ -12,6 +12,7 @@ import { TimeFormatter } from '@/utils/time_format'
|
|
|
import { useSelector } from 'react-redux'
|
|
|
import { RealRing } from '@/features/trackTimeDuration/components/Rings'
|
|
|
import DayNightRing from './DayNightRing'
|
|
|
+import '@/utils/ring_card.scss';
|
|
|
// import GradientText from '@/components/basic/GradientText'
|
|
|
|
|
|
let GradientText
|
|
|
@@ -24,6 +25,7 @@ export default function AllRings(props: { data?: any, time?: any }) {
|
|
|
const [record, setRecord] = useState(props.data.current_record);
|
|
|
const user = useSelector((state: any) => state.user);
|
|
|
const nightStore = useSelector((state: any) => state.night);
|
|
|
+ const [isDay,setIsDay] = useState(false)
|
|
|
const [authInfo, setAuthInfo] = useState(global.locationDetail ? global.locationDetail : null)
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
@@ -39,6 +41,11 @@ export default function AllRings(props: { data?: any, time?: any }) {
|
|
|
setShowRing(true)
|
|
|
}
|
|
|
|
|
|
+ global.tapShowThirdRing = (isDayMode:boolean)=>{
|
|
|
+ setIsDay(isDayMode)
|
|
|
+ setShowRing(true)
|
|
|
+ }
|
|
|
+
|
|
|
function durationArc(start_time: number, end_time: number) {
|
|
|
var duration = (end_time - start_time) / 1000;
|
|
|
return duration / (24 * 3600) * 2 * Math.PI;
|
|
|
@@ -206,7 +213,7 @@ export default function AllRings(props: { data?: any, time?: any }) {
|
|
|
|
|
|
function dayRing() {
|
|
|
return <DayNightRing
|
|
|
- isNight={true}
|
|
|
+ isNight={!isDay}
|
|
|
isThirdRing={true}
|
|
|
canvasId={'day_night_card_big_night_ring111'}
|
|
|
authInfo={authInfo}
|
|
|
@@ -252,6 +259,10 @@ export default function AllRings(props: { data?: any, time?: any }) {
|
|
|
return global.sunsetDuration
|
|
|
}
|
|
|
|
|
|
+ function dayDuration(){
|
|
|
+ return global.sunriseDuration
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
function popDetail() {
|
|
|
return <Box>
|
|
|
@@ -263,8 +274,8 @@ export default function AllRings(props: { data?: any, time?: any }) {
|
|
|
}
|
|
|
<View className="duration_bg2" style={{ marginLeft: rpxToPx(68), height: bigRingRadius * 2, overflow: 'visible' }}>
|
|
|
|
|
|
- <Text className="duration_title2" style={{ color: '#fff', opacity: 0.4 }}>{t('feature.common.overnight')}</Text>
|
|
|
- <Text className="duration_value2" style={{ color: ColorType.night }}>{nightDuration()}</Text>
|
|
|
+ <Text className="duration_title2" style={{ color: '#fff', opacity: 0.4 }}>{isDay?t('feature.common.day'):t('feature.common.overnight')}</Text>
|
|
|
+ <Text className="duration_value2" style={{ color: isDay?ColorType.day:ColorType.night }}>{isDay?dayDuration():nightDuration()}</Text>
|
|
|
{
|
|
|
(props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title2" style={{ color: '#fff', opacity: 0.4 }}>{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
|
|
|
}
|