Leon 2 lat temu
rodzic
commit
5d284b907b

+ 8 - 0
ios/AppDelegate.mm

@@ -35,6 +35,14 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 //  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenNotificationSettingsURLString]];
 //  NSString *url = UIApplicationOpenNotificationSettingsURLString;
   // APNS
+  NSDate *date = [NSDate date];
+  //zone为当前时区信息  在我的程序中打印的是@"Asia/Shanghai"
+  NSTimeZone *zone = [NSTimeZone systemTimeZone];
+  //所在地区时间与协调世界时差距
+  NSInteger interval = [zone secondsFromGMTForDate: date];
+  //加上时差,得到本地时间
+  NSDate *localeDate = [date dateByAddingTimeInterval: interval];
+
     JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
     if (@available(iOS 12.0, *)) {
       entity.types = JPAuthorizationOptionNone; //JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSou//nd|JPAuthorizationOptionProvidesAppNotificationSettings;

+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -550,7 +550,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 8;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -583,7 +583,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 8;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

Plik diff jest za duży
+ 0 - 0
ios/main.jsbundle


+ 7 - 4
src/components/basic/Buttons.scss

@@ -58,6 +58,12 @@
     background-clip: text;
     color: transparent;
 }
+
+.textClass {
+    height: '100%';
+    line-height: '100%';
+}
+
 /* #endif */
 
 /* #ifdef rn */
@@ -77,10 +83,7 @@
     flex-direction: row;
 }
 
-.textClass {
-    height: '100%';
-    line-height: '100%';
-}
+
 
 .outlined{
     box-sizing: border-box;

+ 18 - 10
src/components/basic/GradientText.tsx

@@ -2,18 +2,26 @@ import React from "react";
 import { Text } from "react-native";
 import MaskedView from "@react-native-masked-view/masked-view";
 import LinearGradient from "react-native-linear-gradient";
-    
+import { ColorType } from "@/context/themes/color";
+import { View } from "@tarojs/components";
+
 const GradientText = (props) => {
   return (
-    <MaskedView maskElement={<Text {...props} />}>
-      <LinearGradient
-        colors={["red", "blue"]}
-        start={{ x: 0, y: 0 }}
-        end={{ x: 0.3, y: 0 }}
-      >
-        <Text {...props} style={[props.style, { opacity: 0 }]} />
-      </LinearGradient>
-    </MaskedView>
+    <View onClick={()=>{
+      if (props.onClick){
+        props.onClick()
+      }
+    }}>
+      <MaskedView maskElement={<Text {...props} />}>
+        <LinearGradient
+          colors={[props.start ? props.start : ColorType.fast, props.end ? props.end : ColorType.sleep]}
+          start={{ x: 0, y: 0 }}
+          end={{ x: 1, y: 0 }}
+        >
+          <Text {...props} style={[props.style, { opacity: 0 }]} />
+        </LinearGradient>
+      </MaskedView>
+    </View>
   );
 };
 

+ 15 - 1
src/components/layout/Header.tsx

@@ -3,13 +3,27 @@ import './Header.scss'
 import { useTranslation } from "react-i18next";
 import { getThemeColor } from "@/features/trackTimeDuration/hooks/Common";
 import { useSelector } from "react-redux";
+// import GradientText from "../basic/GradientText";
+import { rpxToPx } from "@/utils/tools";
+
+let GradientText
+if (process.env.TARO_ENV=='rn'){
+    GradientText = require('../basic/GradientText').default
+}
 
 export default function Component(props: { title: string, action?: Function }) {
     const time = useSelector((state: any) => state.time);
     const {t} = useTranslation()
     return <View className="header">
         <Text className="header_title">{props.title}</Text>
-        <Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
+        {
+            process.env.TARO_ENV=='weapp' && <Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
+        }
+        {
+            process.env.TARO_ENV=='rn' && <GradientText  onClick={() => { props.action!() }} style={{fontSize:rpxToPx(32),fontWeight:'bold'}}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</GradientText>
+            //<Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
+        }
+        
         {/* {
             time.scenario=='FAST_SLEEP'?<Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>:
             <Text className="header_action" style={{color:getThemeColor(time)}} onClick={() => { props.action!(); }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>

+ 20 - 5
src/components/layout/layout.tsx

@@ -6,7 +6,9 @@ import Taro, { usePageScroll } from "@tarojs/taro";
 import { rpxToPx } from "@/utils/tools";
 
 let useNavigation;
+let GradientText
 if (process.env.TARO_ENV == 'rn') {
+    GradientText = require('@/components/basic/GradientText').default
     useNavigation = require("@react-navigation/native").useNavigation
 }
 
@@ -69,16 +71,29 @@ export default function Layout(props: {
         }
     })
 
+    function fastSleepTitle() {
+        if (process.env.TARO_ENV == 'rn') {
+            return <GradientText style={{
+                fontSize: props.secondPage ? rpxToPx(56) : rpxToPx(72),
+                fontWeight:'bold',
+                marginLeft:rpxToPx(46),
+                marginTop:rpxToPx(24),
+                marginBottom:rpxToPx(24)
+            }}>{props.title}</GradientText>
+        }
+        return <Text className='layout_title fast_sleep_text'
+            style={{
+                fontSize: props.secondPage ? rpxToPx(56) : rpxToPx(72)
+            }}
+        >{props.title}</Text>
+    }
+
     function pageDetail() {
         return <View>
             {
                 props.title && <View className="layout_title_view" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
                     {
-                        props.isFastSleepTheme ? <Text className='layout_title fast_sleep_text'
-                            style={{
-                                fontSize: props.secondPage ? rpxToPx(56) : rpxToPx(72)
-                            }}
-                        >{props.title}</Text> :
+                        props.isFastSleepTheme ? fastSleepTitle() :
                             <Text className='layout_title'
                                 style={{
                                     color: props.titleColor ? props.titleColor : '#fff',

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

@@ -5,4 +5,5 @@ export enum ColorType {
     ring = '#1c1c1c',
     food = '#FF7A4E',
     workout = 'yellow',
+    alert = '#ea6c6c',
 }

+ 11 - 1
src/features/trackTimeDuration/components/Clock.tsx

@@ -8,6 +8,11 @@ import './Clock.scss'
 import { ColorType } from "@/context/themes/color";
 import { useSelector } from "react-redux";
 import { jumpPage } from "../hooks/Common";
+
+let GradientText
+if (process.env.TARO_ENV=='rn'){
+    GradientText = require('@/components/basic/GradientText').default
+}
 export default function Component(props: { showCoverView: boolean }) {
     const [checkData, setCheckData] = useState(null)
     const time = useSelector((state: any) => state.time);
@@ -166,9 +171,14 @@ export default function Component(props: { showCoverView: boolean }) {
                         !checkData && <Text className="clock_text" style={{ fontSize: 24, color: ColorType.fast }}>{TimeFormatter.getCurrentHourAndMinute()}</Text>
                     }
                     {
-                        checkData && time.status == 'WAIT_FOR_START' && time.scenario == 'FAST_SLEEP' &&
+                        checkData && process.env.TARO_ENV=='weapp' && time.status == 'WAIT_FOR_START' && time.scenario == 'FAST_SLEEP' &&
                         <Text className="clock_text fast_sleep_text" style={{ fontSize: 24 }}>{TimeFormatter.getCurrentHourAndMinute()}</Text>
                     }
+                    {
+                        checkData && process.env.TARO_ENV=='rn' && time.status == 'WAIT_FOR_START' && time.scenario == 'FAST_SLEEP' &&
+                        <GradientText style={{fontSize:24}}>{TimeFormatter.getCurrentHourAndMinute()}</GradientText>
+                        // <Text className="clock_text fast_sleep_text" style={{ fontSize: 24 }}>{TimeFormatter.getCurrentHourAndMinute()}</Text>
+                    }
                     {
                         checkData && time.status == 'WAIT_FOR_START' && time.scenario != 'FAST_SLEEP' &&
                         <Text className="clock_text" style={{ color: time.scenario == 'FAST' ? ColorType.fast : ColorType.sleep, fontSize: 24 }}>{TimeFormatter.getCurrentHourAndMinute()}</Text>

+ 39 - 20
src/features/trackTimeDuration/components/Console.tsx

@@ -22,7 +22,9 @@ import { setFoodTabBadge } from "@/store/common";
 import { rpxToPx } from "@/utils/tools";
 
 let useNavigation;
+let GradientText
 if (process.env.TARO_ENV == 'rn') {
+    GradientText = require('@/components/basic/GradientText').default
     useNavigation = require("@react-navigation/native").useNavigation
 }
 
@@ -223,13 +225,13 @@ export default function Component(props: { isNextStep?: boolean }) {
         </View>
     }
 
-    function showFoodGuide(){
+    function showFoodGuide() {
         dispatch(setFoodTabBadge(true))
         Taro.showModal({
-            title:'断食已结束',
-            content:'推荐使用『饮食日记』感知模式,记录你的餐前饥饿感',
-            showCancel:false,
-            confirmText:'我知道了'
+            title: '断食已结束',
+            content: '推荐使用『饮食日记』感知模式,记录你的餐前饥饿感',
+            showCancel: false,
+            confirmText: '我知道了'
         })
     }
 
@@ -381,7 +383,6 @@ export default function Component(props: { isNextStep?: boolean }) {
     function durationPickerContent() {
         var color = getColor(time)
         var title = getDurationTitle(time, t)
-        console.log('duration', fastPickerValue)
         return <View style={{ color: '#fff', backgroundColor: 'transparent' }}>
             <PickerViews ref={durationPickerRef}
                 onChange={durationChange}
@@ -471,6 +472,19 @@ export default function Component(props: { isNextStep?: boolean }) {
         return false;
     }
 
+    function consoleTimeText(time) {
+        if (process.env.TARO_ENV == 'rn' && textNextStepAlpha(time) == 1) {
+            return <GradientText style={{ fontSize: rpxToPx(64), fontWeight: 'bold' }} end={ColorType.alert}>{TimeFormatter.countdown(time.fast.target_end_time)}</GradientText>
+        }
+        return <Text className={textNextStepAlpha(time) == 1 ?
+            'console_time_value  timeout_fast_linear_color' :
+            'console_time_value normal_fast_color'}
+            style={{
+                opacity: textNextStepAlpha(time) == 1 ? 1 : 0.8
+            }}>
+            {TimeFormatter.countdown(time.fast.target_end_time)}</Text>
+    }
+
     var textColor = getColor(time)
     if (time.status != 'ONGOING1' && time.status != 'WAIT_FOR_START') {
         if (textAlpha(time) == 1) {
@@ -486,7 +500,7 @@ export default function Component(props: { isNextStep?: boolean }) {
     }
 
     if (props.isNextStep) {
-        return <Box style={{marginBottom:0}}>
+        return <Box style={{ marginBottom: 0 }}>
             <View style={{
                 display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0,
                 opacity: time.status == 'WAIT_FOR_START' ? 0.4 : 1,
@@ -501,13 +515,7 @@ export default function Component(props: { isNextStep?: boolean }) {
                 {
                     (time.status == 'ONGOING1' || time.status == 'ONGOING2') &&
                     <View className="console_time_bg">
-                        <Text className={textNextStepAlpha(time) == 1 ?
-                            'console_time_value  timeout_fast_linear_color' :
-                            'console_time_value normal_fast_color'}
-                            style={{
-                                opacity: textNextStepAlpha(time) == 1 ? 1 : 0.8
-                            }}>
-                            {TimeFormatter.countdown(time.fast.target_end_time)}</Text>
+                        {consoleTimeText(time)}
                         <Text className="console_time_duration" style={{ color: global.fastColor ? global.fastColor : ColorType.fast, opacity: 0.4 }}>{
                             TimeFormatter.calculateTimeDifference(time.fast.target_start_time,
                                 time.fast.target_end_time, true)}</Text>
@@ -546,24 +554,35 @@ export default function Component(props: { isNextStep?: boolean }) {
         }
     }
 
+    function onGoingText(isFastData) {
+        var className = getClassName(isFastData)
+        if (process.env.TARO_ENV=='rn' && className.indexOf('linear')!=-1){
+            return <GradientText style={{ fontSize: rpxToPx(64), fontWeight: 'bold' }} start={isFastData?ColorType.fast:ColorType.sleep} end={ColorType.alert}>{isFastData ?
+                TimeFormatter.countdown(time.fast.target_end_time) :
+                TimeFormatter.countdown(time.sleep.target_end_time)}</GradientText>
+        }
+        return <Text className={className} style={{ opacity: textAlpha(time) == 1 ? 1 : 0.8 }}>{isFastData ?
+            TimeFormatter.countdown(time.fast.target_end_time) :
+            TimeFormatter.countdown(time.sleep.target_end_time)}</Text>
+    }
+
     function ongoing() {
         if (time.status == 'ONGOING' || time.status == 'ONGOING2' || time.status == 'ONGOING3') {
             var isFastData = time.scenario == 'FAST' || time.status == 'ONGOING3'
             var duration = TimeFormatter.calculateTimeDifference(isFastData ? time.fast.target_start_time : time.sleep.target_start_time,
                 isFast ? time.fast.target_end_time : time.sleep.target_end_time, true);
             return <View className="console_time_bg">
-
-                <Text className={getClassName(isFastData)} style={{ opacity: textAlpha(time) == 1 ? 1 : 0.8 }}>{isFastData ?
-                    TimeFormatter.countdown(time.fast.target_end_time) :
-                    TimeFormatter.countdown(time.sleep.target_end_time)}</Text>
+                {
+                    onGoingText(isFastData)
+                }
                 <Text className="console_time_duration" style={{ color: isFastData ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep, opacity: 0.4 }}>{duration}</Text>
             </View>
         }
         return <View />
     }
     return (
-        <Box style={{marginBottom:0}}>
-            <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0,}}>
+        <Box style={{ marginBottom: 0 }}>
+            <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0, }}>
                 {
                     isLoaded && ongoing()
                 }

+ 14 - 47
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -26,14 +26,6 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
     const { t } = useTranslation()
     const canvasId = props.data.id
     const record = props.data;
-    function header() {
-        if (props.type == 'latest') {
-            return <Header title={t('feature.track_time_duration.record_fast_sleep.header.latest_record')} action={() => {
-                jumpPage('/pages/common/RecordsHistory?type=time&title=time')
-            }} />
-        }
-        return null
-    }
     function del() {
         var id = props.data.id
         delRecord(id
@@ -48,45 +40,13 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
     }
 
     function schedules() {
+        var timestamp = props.data.first_real_check_time
+        if (props.data.first_time_zone){
+            timestamp = TimeFormatter.transferTimestamp(timestamp,props.data.first_time_zone)
+        }
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
-{/* 
-            <Text className="modalTitle1" style={{
-                marginBottom: 10,
-                color: '#fff', fontWeight: 'bold',
-            }}>{TimeFormatter.getDateAndWeek(props.data.first_real_check_time)}</Text> */}
             <TimelineStage data={props.data} title={t('feature.track_time_duration.record_fast_sleep.pop_title')} 
-            subTitle={TimeFormatter.getDateAndWeek(props.data.first_real_check_time)} first_real_check_time={props.data.first_real_check_time}/>
-
-            {/* {
-                props.data.scenario == 'FAST_SLEEP' &&
-                <View style={{ marginBottom: 0 }}>
-                    <Segment titles={['断食睡眠时间', '断食阶段']} changed={(e) => {
-                        setSegmentIndex(e);
-                        global.segmentIndex = e
-                    }} />
-                </View>
-            }
-            <View className="segment_detail" style={{
-                marginTop: 10,
-                display: 'flex', alignItems: 'center',
-                flexDirection: 'column', justifyContent: 'center'
-            }}>
-                <View style={{ position: 'relative',width:'100%',display: 'flex', alignItems: 'center',
-                flexDirection: 'column', justifyContent: 'center' }}>
-                    <View style={{ opacity: segmentIndex == 0 ? 1 : 0 }}>
-                        <TimelineFastSleep data={props.data} />
-                    </View>
-                    {
-                        props.data.scenario == 'FAST_SLEEP' && <View style={{
-                            position: 'absolute', left: 0, top: 0, right: 0, bottom: 0,
-                            opacity: segmentIndex == 1 ? 1 : 0
-                        }}>
-                            <Stage data={props.data} />
-                        </View>
-                    }
-
-                </View>
-            </View> */}
+            subTitle={TimeFormatter.getDateAndWeek(timestamp)} first_real_check_time={timestamp}/>
         </View>
     }
 
@@ -211,6 +171,14 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
         </View>
     }
 
+    function recordTime(){
+        var timestamp = props.data.first_real_check_time
+        if (props.data.first_time_zone){
+            timestamp = TimeFormatter.transferTimestamp(timestamp,props.data.first_time_zone)
+        }
+        return TimeFormatter.dateDescription(timestamp, true)
+    }
+
     function recordDetail() {
         var fastDuration = ''
         var sleepDuration = ''
@@ -261,7 +229,7 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
             {/* <Image className="arrow1" src={require('@/assets/images/arrow.png')} /> */}
             <View className="record_arrow_bg" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
                 <View style={{flex:1}}/>
-                <Text className='recordTime'>{TimeFormatter.dateDescription(props.data.first_real_check_time, true)}</Text>
+                <Text className='recordTime'>{recordTime()}</Text>
                 <Image className="arrow2" src={require('@/assets/images/arrow3.png')} />
             </View>
 
@@ -269,7 +237,6 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
     }
 
     return <View>
-        {/* {header()} */}
         <View className="time_operate_item">
             <RecordItem canDel={record.status == 'COMPLETED'} delete={del}
                 onClick={showDetail}

+ 12 - 3
src/features/trackTimeDuration/components/Rings.rn.tsx

@@ -1,3 +1,4 @@
+import { TimeFormatter } from "@/utils/time_format";
 import { View } from "@tarojs/components";
 import Taro from "@tarojs/taro";
 import { useRef } from "react";
@@ -50,13 +51,21 @@ export default function Component(props: {
     const dpr = Taro.getSystemInfoSync().pixelRatio; // 获取设备的像素比
     const radius = r; // 圆形进度条的半径
     const lineWidth = strokeWidth; // 圆形进度条的线宽
-    const time = useSelector((state: any) => state.time);
+    const timeObj = useSelector((state: any) => state.time);
     const user = useSelector((state: any) => state.user);
 
     const center = radius + lineWidth / 2 + 3; // 圆心坐标
 
     function drawContent() {
         var time = new Date();
+        if (timeObj.status != 'WAIT_FOR_START' && timeObj && (timeObj.fast || timeObj.sleep)) {
+            var timestamp = time.getTime()
+            //判断逻辑
+            if (timeObj.fast.real_start_time_zone || timeObj.sleep.real_start_time_zone) {
+                timestamp = TimeFormatter.transferTimestamp(timestamp, timeObj.fast.real_start_time_zone ? timeObj.fast.real_start_time_zone : timeObj.sleep.real_start_time_zone)
+                time = new Date(timestamp)
+            }
+        }
         var seconds = time.getHours() * 3600 + time.getMinutes() * 60 + time.getSeconds();
         var arc = seconds / 86400 * 2 * Math.PI - Math.PI / 2.0;
 
@@ -89,7 +98,7 @@ export default function Component(props: {
                     fillOpacity={0}
                     stroke={props.targetRing!.color}
                     transform={`rotate(${props.targetRing!.startArc / (2 * Math.PI) * 360} ${center} ${center})`}
-                    strokeDasharray={`${props.targetRing!.durationArc*radius},1000`}
+                    strokeDasharray={`${props.targetRing!.durationArc * radius},1000`}
                     strokeWidth={lineWidth}
                     strokeLinecap="round"
                 />
@@ -113,7 +122,7 @@ export default function Component(props: {
                     fillOpacity={0}
                     stroke={props.realRing!.color}
                     transform={`rotate(${props.realRing!.startArc / (2 * Math.PI) * 360} ${center} ${center})`}
-                    strokeDasharray={`${props.realRing!.durationArc*radius},1000`}
+                    strokeDasharray={`${props.realRing!.durationArc * radius},1000`}
                     strokeWidth={lineWidth}
                     strokeLinecap="round"
                 />

+ 156 - 0
src/features/trackTimeDuration/components/Stage.rn.tsx

@@ -0,0 +1,156 @@
+import { View, Text, Icon } from "@tarojs/components";
+import './Stage.scss'
+import { TimeFormatter } from "@/utils/time_format";
+import { ColorType } from "@/context/themes/color";
+import { IconRadio, IconRadioCheck, IconRadioCross } from "@/components/basic/Icons";
+import { useTranslation } from "react-i18next";
+import { rpxToPx } from "@/utils/tools";
+
+export default function Component(props: { data: any }) {
+    const { t } = useTranslation()
+    function getTime(t1: number, t2: number) {
+        return TimeFormatter.formateTimeDifference(t1, t2)
+    }
+
+    function getDuration(t1: number, t2: number) {
+        return TimeFormatter.calculateTimeDifference(t1, t2, true)
+    }
+
+    function getStepATime(obj) {
+        if (obj.status == 'COMPLETED' && obj.sleep.status == 'NOT_STARTED') {
+            return t('feature.track_time_duration.stage.not_completed')
+        }
+
+        return obj.status == 'ONGOING1' ?
+            getTime(obj.fast.real_start_time, (new Date()).getTime()) :
+            obj.sleep.real_start_time ? getDuration(obj.sleep.real_start_time, obj.fast.real_start_time ? obj.fast.real_start_time : obj.fast.target_start_time) :
+                getDuration(obj.sleep.target_start_time, obj.fast.real_start_time ? obj.fast.real_start_time : obj.fast.target_start_time)
+    }
+
+    function getStepBTime(obj) {
+        if (obj.status == 'ONGOING1') return t('feature.track_time_duration.stage.wait_for_start')
+        if (obj.status == 'ONGOING2') return getTime(obj.sleep.real_start_time, (new Date()).getTime())
+        if (obj.status == 'WAIT_FOR_START') return getDuration(obj.sleep.target_end_time, obj.sleep.target_start_time)
+        if (obj.sleep.status == 'NOT_STARTED') return t('feature.track_time_duration.stage.not_started')
+        if (obj.sleep.status == 'NOT_COMPLETED') return t('feature.track_time_duration.stage.not_completed')
+        return getDuration(obj.sleep.real_end_time, obj.sleep.real_start_time)
+
+    }
+
+    function getStepCTime(obj) {
+        if (obj.status == 'ONGOING1') return t('feature.track_time_duration.stage.wait_for_start')
+        if (obj.status == 'ONGOING2') return t('feature.track_time_duration.stage.wait_for_start')
+        if (obj.status == 'ONGOING3') return getTime(obj.sleep.real_end_time, (new Date()).getTime())
+        if (obj.status == 'WAIT_FOR_START') return getDuration(obj.fast.target_end_time, obj.sleep.target_end_time)
+        if (obj.sleep.status == 'NOT_COMPLETED' || obj.sleep.status == 'NOT_STARTED') return t('feature.track_time_duration.stage.not_started')
+        return getDuration(obj.fast.real_end_time, obj.sleep.real_end_time)
+    }
+    function getStepAIcon(obj) {
+        if (obj.status == 'COMPLETED' && obj.sleep.status == 'NOT_STARTED') {
+            return <IconRadioCross width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />;
+        }
+        return (obj.status == 'ONGOING1' || obj.status == 'WAIT_FOR_START') ?
+            <IconRadio width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+            : <IconRadioCheck width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+    }
+
+    function getStepBIcon(obj) {
+        var sleepColor = global.sleepColor ? global.sleepColor : ColorType.sleep
+        if (obj.status == 'ONGOING1') return <IconRadio width={16} color={sleepColor} />
+        if (obj.status == 'ONGOING2') return <IconRadio width={16} color={sleepColor} />
+        if (obj.status == 'WAIT_FOR_START') return <IconRadio width={16} color={sleepColor} />
+        if (obj.sleep.status == 'NOT_STARTED') return <IconRadioCross width={16} color={sleepColor} />
+        if (obj.sleep.status == 'NOT_COMPLETED') return <IconRadioCross width={16} color={sleepColor} />
+        return <IconRadioCheck width={16} color={sleepColor} />
+    }
+
+    function getStepCIcon(obj) {
+        if (obj.status == 'ONGOING1') return <IconRadio width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+        if (obj.status == 'ONGOING2') return <IconRadio width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+        if (obj.status == 'ONGOING3') return <IconRadio width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+        if (obj.status == 'WAIT_FOR_START') return <IconRadio width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+        if (obj.sleep.status == 'NOT_COMPLETED' || obj.sleep.status == 'NOT_STARTED') return <IconRadioCross width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+        return <IconRadioCheck width={16} color={global.fastColor ? global.fastColor : ColorType.fast} />
+    }
+
+    return <View className="stage">
+
+        <View className='timelineItem'>
+            <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    <Icon type='circle' size='16' color='#ffffff00' />//<CheckBox type={CheckBoxType.empty} opacity={0.4} />
+                }
+                <View className='timelineContentDetail'>
+                    <View className="timeline-time" >{'  '}</View>
+                </View>
+            </View>
+            <View className="timeline-detail" style={{ color: ColorType.fast, opacity: 1,marginTop:rpxToPx(0) }}>
+
+                <Text className="scenario_name" style={{color: ColorType.fast, opacity: 1}}>{t('feature.track_time_duration.stage.a')}</Text>
+                <View className="timeline-date2" style={{ color: ColorType.fast, opacity: 1 }}>{getStepATime(props.data)}</View>
+
+            </View>
+            <View className='timeline_line1 line2_bottom_space' style={{ backgroundColor: props.data.status == 'ONGOING1' ? ColorType.fast : 'rgba(255,255,255,0.1)' }} />
+            <View className='timeline-line-bg' style={{ width: 16, background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    getStepAIcon(props.data)
+                }
+                <View className='timeline-line1'
+                    style={{ opacity:0 }}
+                />
+            </View>
+
+        </View>
+        <View className='timelineItem'>
+            <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    <Icon type='circle' size='16' color='#ffffff00' />//<CheckBox type={CheckBoxType.empty} opacity={0.4} />
+                }
+                <View className='timelineContentDetail'>
+                    <View className="timeline-time" >{'  '}</View>
+                </View>
+            </View>
+            <View className="timeline-detail" style={{ color: ColorType.sleep, opacity: 1,marginTop:rpxToPx(0) }}>
+
+                <Text className="scenario_name" style={{color: ColorType.sleep, opacity: 1}}>{t('feature.track_time_duration.stage.b')}</Text>
+                <View className="timeline-date2" style={{ color: ColorType.sleep, opacity: 1 }}>{getStepBTime(props.data)}</View>
+
+            </View>
+            <View className='timeline_line1 line1_bottom_space' style={{ backgroundColor: props.data.status == 'ONGOING2' ? ColorType.sleep : 'rgba(255,255,255,0.1)' }} />
+            <View className='timeline-line-bg' style={{ width: 16, background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    getStepBIcon(props.data)
+                }
+                <View className='timeline-line1'
+                    style={{ opacity:0 }}
+                />
+            </View>
+
+        </View>
+        <View className='timelineItem'>
+            <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    <Icon type='circle' size='16' color='#ffffff00' />//<CheckBox type={CheckBoxType.empty} opacity={0.4} />
+                }
+                <View className='timelineContentDetail'>
+                    <View className="timeline-time" >{'  '}</View>
+                </View>
+            </View>
+            <View className="timeline-detail" style={{ color: ColorType.fast, opacity: 1,marginTop:rpxToPx(0) }}>
+                <Text className="scenario_name" style={{color: ColorType.fast, opacity: 1}}>{t('feature.track_time_duration.stage.c')}</Text>
+                <View className="timeline-date2" style={{ color: ColorType.fast, opacity: 1 }}>{getStepCTime(props.data)}</View>
+
+            </View>
+            <View className={'timeline_line1 line1_bottom_zero'} style={{ backgroundColor: props.data.status == 'ONGOING3' ? ColorType.fast : 'rgba(255,255,255,0.1)' }} />
+            <View className='timeline-line-bg' style={{ width: 16, background: global.isDebug ? 'red' : 'transparent' }}>
+                {
+                    getStepCIcon(props.data)
+                }
+                <View className='timeline-line1'
+                    style={{ opacity:0 }}
+                />
+            </View>
+        </View>
+
+    </View>
+}

+ 12 - 1
src/features/trackTimeDuration/components/Stage.scss

@@ -1,4 +1,5 @@
 @import '@/utils/common.scss';
+@import '@/components/view/Timeline.scss';
 .stage {
     display: flex;
     flex-direction: column;
@@ -88,4 +89,14 @@
     display: flex;
     flex-direction: row;
     justify-content: flex-end;
-}
+}
+
+.scenario_name{
+    font-weight: bold;
+    font-size: 32px;
+    line-height: 32px;
+}
+
+.line2_bottom_space {
+    margin-bottom: 0px;
+  }

+ 0 - 0
src/features/trackTimeDuration/components/Stage.tsx → src/features/trackTimeDuration/components/Stage.weapp.tsx


+ 44 - 19
src/features/trackTimeDuration/components/TimelineFastSleep.tsx

@@ -5,11 +5,15 @@ import getStatus from "../hooks/Record";
 import { ColorType } from "@/context/themes/color";
 import { useTranslation } from "react-i18next";
 
-export default function TimelineFastSleep(props: { data: any, title?: string,first_real_check_time?:number }) {
-    const {t} = useTranslation()
+export default function TimelineFastSleep(props: { data: any, title?: string, first_real_check_time?: number }) {
+    const { t } = useTranslation()
     function formateTime(obj: any, isEnd: boolean) {
         if (isEnd) {
             if (obj.real_end_time) {
+                if (obj.real_end_time_zone){
+                    var newTimestamp = TimeFormatter.transferTimestamp(obj.real_end_time, obj.real_end_time_zone)
+                    return TimeFormatter.timelineFormatTime(newTimestamp)
+                }
                 return TimeFormatter.timelineFormatTime(obj.real_end_time)
             }
             else {
@@ -18,7 +22,12 @@ export default function TimelineFastSleep(props: { data: any, title?: string,fir
         }
         else {
             if (obj.real_start_time) {
-                return TimeFormatter.timelineFormatTime(obj.real_start_time)
+                if (obj.real_end_time_zone){
+                    var newTimestamp = TimeFormatter.transferTimestamp(obj.real_start_time, obj.real_start_time_zone)
+                    return TimeFormatter.timelineFormatTime(newTimestamp)
+                }
+
+                return TimeFormatter.timelineFormatTime(obj.real_start_time, obj.real_start_time_zone)
             }
             else {
                 return TimeFormatter.timelineFormatTime(obj.target_start_time)
@@ -27,7 +36,7 @@ export default function TimelineFastSleep(props: { data: any, title?: string,fir
 
     }
 
-    function showDate(obj: any, isEnd: boolean){
+    function showDate(obj: any, isEnd: boolean) {
         var dt = 0
         if (isEnd) {
             if (obj.real_end_time) {
@@ -46,12 +55,12 @@ export default function TimelineFastSleep(props: { data: any, title?: string,fir
             }
         }
         // debugger
-        var dt2 = props.first_real_check_time?props.first_real_check_time:0
+        var dt2 = props.first_real_check_time ? props.first_real_check_time : 0
         var date1 = new Date(dt)
         var date2 = new Date(dt2)
         if (date1.getFullYear() == date2.getFullYear() &&
-        date1.getMonth()==date2.getMonth() &&
-        date1.getDate()==date2.getDate()){
+            date1.getMonth() == date2.getMonth() &&
+            date1.getDate() == date2.getDate()) {
             return false
         }
         return true
@@ -79,46 +88,62 @@ export default function TimelineFastSleep(props: { data: any, title?: string,fir
 
     var timelineItems: any = [];
     if (props.data.fast) {
+        var timeZone = ''
+        if (props.data.fast.real_start_time_zone) {
+            timeZone = ' '+props.data.fast.real_start_time_zone
+        }
         timelineItems.push(
             {
                 status: getStatus(true, true, props.data),
                 title: t('feature.track_time_duration.common.start_fast'),
-                content: formateTime(props.data.fast, false),
-                date: showDate(props.data.fast, false)?formateDate(props.data.fast, false):'',
-                color:global.fastColor?global.fastColor:ColorType.fast
+                content: formateTime(props.data.fast, false) + timeZone,
+                date: showDate(props.data.fast, false) ? formateDate(props.data.fast, false) : '',
+                color: global.fastColor ? global.fastColor : ColorType.fast
             }
         )
     }
     if (props.data.sleep) {
+        var timeZone = ''
+        if (props.data.sleep.real_start_time_zone) {
+            timeZone = ' '+props.data.sleep.real_start_time_zone
+        }
         timelineItems.push(
             {
                 status: getStatus(false, true, props.data),
                 title: t('feature.track_time_duration.common.start_sleep'),
-                content: formateTime(props.data.sleep, false),
-                date: showDate(props.data.sleep, false)?formateDate(props.data.sleep, false):'',
-                color:global.sleepColor?global.sleepColor:ColorType.sleep
+                content: formateTime(props.data.sleep, false) + timeZone,
+                date: showDate(props.data.sleep, false) ? formateDate(props.data.sleep, false) : '',
+                color: global.sleepColor ? global.sleepColor : ColorType.sleep
             }
         )
     }
     if (props.data.sleep) {
+        var timeZone = ''
+        if (props.data.sleep.real_end_time_zone) {
+            timeZone = ' '+props.data.sleep.real_end_time_zone
+        }
         timelineItems.push(
             {
                 status: getStatus(false, false, props.data),
                 title: t('feature.track_time_duration.common.end_sleep'),
-                content: formateTime(props.data.sleep, true),
-                date: showDate(props.data.sleep, true)?formateDate(props.data.sleep, true):'',
-                color:global.sleepColor?global.sleepColor:ColorType.sleep
+                content: formateTime(props.data.sleep, true) + timeZone,
+                date: showDate(props.data.sleep, true) ? formateDate(props.data.sleep, true) : '',
+                color: global.sleepColor ? global.sleepColor : ColorType.sleep
             }
         )
     }
     if (props.data.fast) {
+        var timeZone = ''
+        if (props.data.fast.real_end_time_zone) {
+            timeZone = ' '+props.data.fast.real_end_time_zone
+        }
         timelineItems.push(
             {
                 status: getStatus(true, false, props.data),
                 title: t('feature.track_time_duration.common.end_fast'),
-                content: formateTime(props.data.fast, true),
-                date: showDate(props.data.fast, true)?formateDate(props.data.fast, true):'',
-                color:global.fastColor?global.fastColor:ColorType.fast
+                content: formateTime(props.data.fast, true) + timeZone,
+                date: showDate(props.data.fast, true) ? formateDate(props.data.fast, true) : '',
+                color: global.fastColor ? global.fastColor : ColorType.fast
             }
         )
     }

+ 0 - 4
src/features/trackTimeDuration/components/TimelineStage.weapp.tsx

@@ -18,11 +18,7 @@ export default function Component(props: { data: any, title?: string, subTitle?:
     const [segmentIndex, setSegmentIndex] = useState(0)
     const permission = useSelector((state: any) => state.permission);
     const common = useSelector((state: any) => state.common);
-    const [pushEnable, setPushEnable] = useState(true)
 
-    const handleAppStateChange = (nextAppState) => {
-        checkPushStatus()
-    };
 
 
 

+ 40 - 10
src/features/trackTimeDuration/hooks/RingData.tsx

@@ -1,5 +1,6 @@
 import { CurrentDot, RealRing, RingCommon, TargetRing } from "@/components/view/Rings"
 import { ColorType } from "@/context/themes/color";
+import { TimeFormatter } from "@/utils/time_format";
 
 
 
@@ -66,14 +67,14 @@ export const getDot = (data: any, isBigRing: boolean) => {
     }
 
     const currentDotSmall: CurrentDot = {
-        color: global.sleepColor?global.sleepColor:ColorType.sleep,
+        color: global.sleepColor ? global.sleepColor : ColorType.sleep,
         lineWidth: 8,
         borderColor: 'black'
     }
 
     if (isBigRing) {
         if (data && data.scenario == 'SLEEP') {
-            currentDotBig.color = global.sleepColor?global.sleepColor:ColorType.sleep
+            currentDotBig.color = global.sleepColor ? global.sleepColor : ColorType.sleep
         }
         return currentDotBig
     }
@@ -97,18 +98,26 @@ export const getTarget = (data: any, isBigRing: boolean) => {
 
     if (isBigRing) {
         if (data.scenario == 'SLEEP') {
-            targetRingBig.color = global.sleepColor?global.sleepColor:ColorType.sleep
+            targetRingBig.color = global.sleepColor ? global.sleepColor : ColorType.sleep
             targetRingBig.startArc = startArc(data.sleep.target_start_time)
             targetRingBig.durationArc = durationArc(data.sleep.target_start_time, data.sleep.target_end_time)
         }
         else {
-            targetRingBig.startArc = startArc(data.fast.target_start_time)
+            var timestamp = data.fast.target_start_time
+            if (data.fast.real_start_time_zone) {
+                timestamp = TimeFormatter.transferTimestamp(timestamp, data.fast.real_start_time_zone)
+            }
+            targetRingBig.startArc = startArc(timestamp)
             targetRingBig.durationArc = durationArc(data.fast.target_start_time, data.fast.target_end_time)
         }
         return targetRingBig
     }
     else {
-        targetRingSmall.startArc = startArc(data.sleep.target_start_time)
+        var timestamp = data.sleep.target_start_time
+        if (data.sleep.real_start_time_zone) {
+            timestamp = TimeFormatter.transferTimestamp(timestamp, data.sleep.real_start_time_zone)
+        }
+        targetRingSmall.startArc = startArc(timestamp)
         targetRingSmall.durationArc = durationArc(data.sleep.target_start_time, data.sleep.target_end_time)
         return targetRingSmall
     }
@@ -122,25 +131,46 @@ export const getReal = (data: any, isBigRing: boolean, isRecord: boolean) => {
     }
 
     const realRingSmall: RealRing = {
-        color: global.sleepColor?global.sleepColor:ColorType.sleep,
+        color: global.sleepColor ? global.sleepColor : ColorType.sleep,
         startArc: 0,
         durationArc: 0
     }
 
     if (isBigRing) {
         if (data.scenario == 'SLEEP') {
-            realRingBig.color = global.sleepColor?global.sleepColor:ColorType.sleep
-            realRingBig.startArc = startArc(data.sleep.real_start_time)
+            realRingBig.color = global.sleepColor ? global.sleepColor : ColorType.sleep
+            if (data.sleep.real_start_time_zone) {
+                var timestamp = TimeFormatter.transferTimestamp(data.sleep.real_start_time, data.sleep.real_start_time_zone)
+                realRingBig.startArc = startArc(timestamp)
+            }
+            else {
+                realRingBig.startArc = startArc(data.sleep.real_start_time)
+            }
+
             realRingBig.durationArc = durationArc(data.sleep.real_start_time, isRecord ? (data.sleep.real_end_time ? data.sleep.real_end_time : new Date().getTime()) : new Date().getTime())
         }
         else {
-            realRingBig.startArc = startArc(data.fast.real_start_time)
+            if (data.fast.real_start_time_zone) {
+                var timestamp = TimeFormatter.transferTimestamp(data.fast.real_start_time, data.fast.real_start_time_zone)
+                realRingBig.startArc = startArc(timestamp)
+            }
+            else {
+                realRingBig.startArc = startArc(data.fast.real_start_time)
+            }
+            // realRingBig.startArc = startArc(data.fast.real_start_time)
             realRingBig.durationArc = durationArc(data.fast.real_start_time, isRecord ? (data.fast.real_end_time ? data.fast.real_end_time : new Date().getTime()) : new Date().getTime())
         }
         return realRingBig
     }
     else {
-        realRingSmall.startArc = startArc(data.sleep.real_start_time)
+        if (data.sleep.real_start_time_zone) {
+            var timestamp = TimeFormatter.transferTimestamp(data.sleep.real_start_time, data.sleep.real_start_time_zone)
+            realRingSmall.startArc = startArc(timestamp)
+        }
+        else {
+            realRingSmall.startArc = startArc(data.sleep.real_start_time)
+        }
+        // realRingSmall.startArc = startArc(data.sleep.real_start_time)
         realRingSmall.durationArc = durationArc(data.sleep.real_start_time, isRecord ? (data.sleep.real_end_time ? data.sleep.real_end_time : new Date().getTime()) : new Date().getTime())
         // if (isRecord && !isBigRing){
         //     debugger

+ 16 - 12
src/pages/account/ProfileSetting.tsx

@@ -50,15 +50,17 @@ export default function Page() {
 
     }
 
-    function choose(){
-        if (process.env.TARO_ENV=='rn'){
+    function choose() {
+        if (process.env.TARO_ENV == 'rn') {
             Taro.chooseImage({
                 count: 1, // 默认9
                 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
                 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有,在H5浏览器端支持使用 `user` 和 `environment`分别指定为前后摄像头
                 success: function (res) {
-                  // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
-                  var tempFilePaths = res.tempFilePaths
+                    // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
+                    var tempFilePaths = res.tempFilePaths
+                    console.log(tempFilePaths)
+                    operate(tempFilePaths[0])
                 }
             })
         }
@@ -66,6 +68,10 @@ export default function Page() {
 
     function chooseAvatar(e) {
         const { avatarUrl } = e.detail
+        operate(avatarUrl)
+    }
+
+    function operate(avatarUrl) {
         var dot = avatarUrl.lastIndexOf('.')
         var fileExt = dot > 0 ? avatarUrl.substring(dot) : ''
         // console.log(avatarUrl)
@@ -110,7 +116,7 @@ export default function Page() {
         })
     }
 
-    return <View className="container" style={{flex:1}}>
+    return <View className="container" style={{ flex: 1 }}>
         <View className="avatar_row">
             <View className="avatar_bg">
 
@@ -123,21 +129,19 @@ export default function Page() {
                     <Image className="camera" src={require('@assets/images/camera.png')} />
                 </View>
                 <Button className="btn" openType="chooseAvatar" onChooseAvatar={chooseAvatar} ></Button>
-            
+                {
+                    process.env.TARO_ENV=='rn' && <View style={{opacity:0,position:'absolute',left:0,top:0,right:0,bottom:0}} onClick={choose}/>
+                }
             </View>
         </View>
 
 
-
-        <Text style={{color:'red'}} onClick={choose}>rn 选择头像测试</Text>
-
-
         <View onClick={editNickname}>
             <TableCell onClick={editNickname} title={t('page.user_profile.nickname')} showArrow={true} showMarginBottom={true}>
                 <Text style={{ opacity: 0.8 }}>{router.params.newuser == '1' ? (user.nickname == name ? '取个名字' : user.nickname) : user.nickname}</Text>
             </TableCell>
         </View>
-        <View style={{flex:1}}/>
+        <View style={{ flex: 1 }} />
 
         <Footer>
             <ChooseScenarioBtn disable={router.params.newuser == '1' && (user.avatar == header || user.nickname == name)} title='确定' onClick={() => {
@@ -149,7 +153,7 @@ export default function Page() {
                 }
             }} background={ColorType.fast} />
         </Footer>
-        <View style={{height:40}}/>
+        <View style={{ height: 40 }} />
 
 
     </View>

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

@@ -139,14 +139,12 @@ export default function Page() {
             setTriggered(true)
         
         if (router.params.type == 'time') {
-            console.log('9527')
             getClockRecords({
                 page: page,
                 limit: pageSize,
                 // completed: true,
                 part_completed: true
             }).then(res => {
-                console.log('time  list',res)
                 Taro.stopPullDownRefresh()
                 setTriggered(false)
                 setLoaded(true)

+ 35 - 1
src/utils/time_format.ts

@@ -1,5 +1,35 @@
 export class TimeFormatter {
   static nowDuration = 30
+
+  static convertGMTtoOffset(gmtString) {
+    // 提取符号、小时和分钟
+    var sign = gmtString.substring(3, 4); // 提取符号 "+" 或 "-"
+    var hours = parseInt(gmtString.substring(4, 6)); // 提取小时部分
+    var minutes = parseInt(gmtString.substring(6, 8)); // 提取分钟部分
+
+    // 计算偏移量(以分钟为单位)
+    var offset = (hours * 60 + minutes) * (sign === '+' ? 1 : -1);
+
+    return offset;
+  }
+
+  //把本地时间戳更改为指定时区的时间戳
+  static transferTimestamp(timestamp:number,timeZone:string){
+    var date = new Date(timestamp)
+
+    if (timeZone) {
+      var localOffset = date.getTimezoneOffset()
+      var targetOffset = localOffset + TimeFormatter.convertGMTtoOffset(timeZone)
+      // 计算目标时间值(毫秒数加上偏移量的毫秒数)
+      var targetTime = date.getTime() + (targetOffset * 60 * 1000);
+
+      // 创建目标时区的 Date 对象
+      var targetDate = new Date(targetTime);
+      return targetDate.getTime()
+    }
+    return timestamp
+  }
+
   //格式化时间
   static formatTimestamp(timestamp: number): string {
     const currentDate = new Date();
@@ -80,6 +110,7 @@ export class TimeFormatter {
       return '  '
     }
     var date = new Date(timestamp)
+
     // 返回 HH:mm
     var str = `${TimeFormatter.formatNumber(date.getHours())}:${TimeFormatter.formatNumber(date.getMinutes())}`;
     if (isTestUser) {
@@ -230,7 +261,7 @@ export class TimeFormatter {
 
 
   //计算时间间隔
-  static calculateTimeDifference(startTimestamp: number, endTimestamp: number, ingoreSeconds?: boolean): string {
+  static calculateTimeDifference(startTimestamp: number, endTimestamp: number,ingoreSeconds?:boolean): string {
     const diff = Math.abs(endTimestamp - startTimestamp);
     // 计算小时、分钟和秒数
     const hours = Math.floor(diff / (1000 * 60 * 60));
@@ -403,6 +434,9 @@ export class TimeFormatter {
   //获取当前时间(hh:mm)
   static getCurrentHourAndMinute = () => {
     var now = new Date()
+    // var localOffset = now.getTimezoneOffset()
+    // console.log(localOffset)
+    // debugger
     return `${TimeFormatter.padZero(now.getHours())}:${TimeFormatter.padZero(now.getMinutes())}`;
   }
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików