|
|
@@ -1,5 +1,5 @@
|
|
|
import { View, Text, Image, PageContainer } from "@tarojs/components";
|
|
|
-import { dotIsOuterRange, getBgRing, getCommon, getDot, getReal, getSchedule, getTarget, timeTotimestamp } from "../hooks/RingData";
|
|
|
+import { bigRingRadius, dotIsOuterRange, getBgRing, getCommon, getDot, getReal, getSchedule, getTarget, ringWidth, smallRingRadius, thirdRingRadius, timeTotimestamp } from "../hooks/RingData";
|
|
|
import { RealRing, CurrentDot } from "@/features/trackTimeDuration/components/Rings";
|
|
|
import Rings from "./Rings";
|
|
|
import './IndexItem.scss'
|
|
|
@@ -14,6 +14,7 @@ import Modal from "@/components/layout/Modal.weapp";
|
|
|
import { ModalType } from "@/utils/types";
|
|
|
import TimelineStage from "./TimelineStage";
|
|
|
import CircadianDetailPopup from "@/features/trackTimeDuration/components/CircadianDetailPopup";
|
|
|
+import { rpxToPx } from "@/utils/tools";
|
|
|
|
|
|
let useNavigation;
|
|
|
if (process.env.TARO_ENV == 'rn') {
|
|
|
@@ -64,8 +65,8 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
|
|
|
function bigRing() {
|
|
|
var common = getCommon(null, true)
|
|
|
- common.radius = 42;
|
|
|
- common.lineWidth = 9;
|
|
|
+ common.radius = bigRingRadius;
|
|
|
+ common.lineWidth = ringWidth;
|
|
|
var bgRing = getBgRing()
|
|
|
|
|
|
var currentDot1 = getDot(record, true)
|
|
|
@@ -135,8 +136,8 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
function smallRing() {
|
|
|
|
|
|
var common = getCommon(null, false)
|
|
|
- common.radius = 28;
|
|
|
- common.lineWidth = 9;
|
|
|
+ common.radius = smallRingRadius;
|
|
|
+ common.lineWidth = ringWidth;
|
|
|
var bgRing = getBgRing()
|
|
|
var realRing = getReal(record, false, false)
|
|
|
if (props.type == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') {
|
|
|
@@ -152,6 +153,7 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
}
|
|
|
else if (record.status == 'WAIT_FOR_START' || record.status == 'ONGOING1') {
|
|
|
realRing = getSchedule(props.data.scenario, false, true, true)//getSchedule(record, false, true)
|
|
|
+
|
|
|
realRing.color = ColorType.sleep + '66'
|
|
|
|
|
|
var currentDot = getDot(record, false)
|
|
|
@@ -196,8 +198,8 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
|
|
|
function dayRing() {
|
|
|
var common = getCommon(null, true)
|
|
|
- common.radius = 56;
|
|
|
- common.lineWidth = 9;
|
|
|
+ common.radius = thirdRingRadius;
|
|
|
+ common.lineWidth = ringWidth;
|
|
|
var bgRing = getBgRing()
|
|
|
|
|
|
const realRingBig: RealRing = {
|
|
|
@@ -241,7 +243,10 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
}
|
|
|
|
|
|
function rings() {
|
|
|
- return <View style={{ position: 'relative', zIndex: 1 }}>
|
|
|
+ return <View style={{
|
|
|
+ position: 'relative', zIndex: 1,
|
|
|
+ marginLeft: !props.showStage && global.showNightRing === true ? -6 : 0,
|
|
|
+ }}>
|
|
|
{
|
|
|
bigRing()
|
|
|
}
|
|
|
@@ -417,44 +422,56 @@ export default function Component(props: { type: string, data: any, time: any, s
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return <View className="time_operate_item1" onClick={goDetail}>
|
|
|
- <View className="fast_sleep_item">
|
|
|
- {
|
|
|
- rings()
|
|
|
- }
|
|
|
- <View className="duration_bg">
|
|
|
- {
|
|
|
- !props.showStage && global.showNightRing === true &&
|
|
|
- <Text className="duration_title">{t('feature.common.overnight')}</Text>
|
|
|
- }
|
|
|
- {
|
|
|
- !props.showStage && global.showNightRing === true &&
|
|
|
- <Text className="duration_value" style={{ color: ColorType.night }}>{nightDuration()}</Text>
|
|
|
- }
|
|
|
- {
|
|
|
- (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
|
|
|
- }
|
|
|
- {
|
|
|
- (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
|
|
|
- }
|
|
|
- {
|
|
|
- (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title" >{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
|
|
|
- }
|
|
|
+ return <View style={{
|
|
|
+ marginLeft: rpxToPx(-40),
|
|
|
+ marginRight: rpxToPx(-40),
|
|
|
+ marginTop: rpxToPx(-40),
|
|
|
+ padding: rpxToPx(48),
|
|
|
+ // backgroundColor:'pink'
|
|
|
+ }}>
|
|
|
+ <View className="time_operate_item1" onClick={goDetail}>
|
|
|
+ <View className="fast_sleep_item" style={{ marginTop: !props.showStage && global.showNightRing === true ? -6 : 0,
|
|
|
+ marginBottom: !props.showStage && global.showNightRing === true ? -6 : 0,
|
|
|
+ padding:!props.showStage && global.showNightRing === true ? 14 : 0,
|
|
|
+ paddingRight:0
|
|
|
+ }}>
|
|
|
{
|
|
|
- (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep }}>{sleepDuration()}</Text>
|
|
|
+ rings()
|
|
|
}
|
|
|
- </View>
|
|
|
- <Image className="arrow2" src={require('@/assets/images/arrow3.png')} />
|
|
|
- {/* {
|
|
|
+ <View className="duration_bg" style={{ marginLeft: !props.showStage && global.showNightRing === true ? rpxToPx(68) : rpxToPx(52),height: bigRingRadius*2,overflow:'visible'}}>
|
|
|
+ {
|
|
|
+ !props.showStage && global.showNightRing === true &&
|
|
|
+ <Text className="duration_title">{t('feature.common.overnight')}</Text>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ !props.showStage && global.showNightRing === true &&
|
|
|
+ <Text className="duration_value" style={{ color: ColorType.night }}>{nightDuration()}</Text>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title" >{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep, marginBottom: 0 }}>{sleepDuration()}</Text>
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ <Image className="arrow2" src={require('@/assets/images/arrow3.png')} />
|
|
|
+ {/* {
|
|
|
!props.showStage && <View className="record_arrow_bg" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
|
|
|
<View style={{ flex: 1 }} />
|
|
|
|
|
|
</View>} */}
|
|
|
|
|
|
|
|
|
+ </View>
|
|
|
+ {
|
|
|
+ showDetailModal && modalContent()
|
|
|
+ }
|
|
|
</View>
|
|
|
- {
|
|
|
- showDetailModal && modalContent()
|
|
|
- }
|
|
|
</View>
|
|
|
}
|