leon 1 год назад
Родитель
Сommit
21036cf578

+ 1 - 1
ios/AppDelegate.mm

@@ -130,7 +130,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 {
 {
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
-#if DEBUGaaa
+#if DEBUG
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
 #else
 #else
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

+ 35 - 35
src/features/trackTimeDuration/components/ConsolePicker.tsx

@@ -23,7 +23,7 @@ const Component = forwardRef((props: {
     endTimestamp?: number,
     endTimestamp?: number,
     isTimeout?: boolean,
     isTimeout?: boolean,
     isLoading?: boolean,
     isLoading?: boolean,
-    hidenEndTime?:boolean
+    hidenEndTime?: boolean
 }, ref) => {
 }, ref) => {
     const today = new Date();
     const today = new Date();
     const [loaded, setLoaded] = useState(false)
     const [loaded, setLoaded] = useState(false)
@@ -209,43 +209,43 @@ const Component = forwardRef((props: {
     function pickerDetail() {
     function pickerDetail() {
         return <View style={{ display: 'flex', flexDirection: 'column', opacity: loaded ? 1 : 0 }}>
         return <View style={{ display: 'flex', flexDirection: 'column', opacity: loaded ? 1 : 0 }}>
             <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
             <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
-            <View style={{ backgroundColor: 'transparent', position: 'relative' }}>
-                <PickerView
-                    itemStyle={{ color: '#fff', margin: 0, padding: 0 }}
-                    value={values}
-                    className="picker"
-                    maskClass="picker-mask"
-                    style={{ color: '#fff' }}
-                    onChange={onPickerChange}
-                    immediateChange={true}
-                    indicatorStyle='height: 50px;color:red;'>
-                    <PickerViewColumn style='flex:0 0 45%'>
-                        {days.map((item,i) => {
-                            return (
-                                <View key={i} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff',height:50 }}>{item}</View>
-                            );
-                        })}
-                    </PickerViewColumn>
-                    <PickerViewColumn>
-                        {hours.map((item,j) => {
-                            return (
-                                <View key={j*1000} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff',height:50 }}>{item < 10 ? `0${item}` : item}</View>
-                            );
-                        })}
-                    </PickerViewColumn>
-                    <PickerViewColumn>
-                        {minutes.map((item,k) => {
-                            return (
-                                <View key={k*10000} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff',height:50 }}>{item < 10 ? `0${item}` : item}</View>
-                            );
-                        })}
-                    </PickerViewColumn>
-                </PickerView>
-            </View>
+
+            <PickerView
+                itemStyle={{ color: '#fff', margin: 0, padding: 0 }}
+                value={values}
+                className="picker"
+                maskClass="picker-mask"
+                style={{ color: '#fff' }}
+                onChange={onPickerChange}
+                immediateChange={true}
+                indicatorStyle='height: 50px;color:red;'>
+                <PickerViewColumn style='flex:0 0 45%'>
+                    {days.map((item, i) => {
+                        return (
+                            <View key={i} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', height: 50 }}>{item}</View>
+                        );
+                    })}
+                </PickerViewColumn>
+                <PickerViewColumn>
+                    {hours.map((item, j) => {
+                        return (
+                            <View key={j * 1000} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', height: 50 }}>{item < 10 ? `0${item}` : item}</View>
+                        );
+                    })}
+                </PickerViewColumn>
+                <PickerViewColumn>
+                    {minutes.map((item, k) => {
+                        return (
+                            <View key={k * 10000} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', height: 50 }}>{item < 10 ? `0${item}` : item}</View>
+                        );
+                    })}
+                </PickerViewColumn>
+            </PickerView>
+
             {
             {
                 !props.hidenEndTime && <Text className="pickerEndTime" style={{ color: props.isTimeout ? 'red' : '#ffffff' }}>{pickerTimeText()}</Text>
                 !props.hidenEndTime && <Text className="pickerEndTime" style={{ color: props.isTimeout ? 'red' : '#ffffff' }}>{pickerTimeText()}</Text>
             }
             }
-            
+
             <View className='modal_operate'>
             <View className='modal_operate'>
                 <View className='modal_btn' style={{ backgroundColor: color + alpha }} onClick={cancel}>
                 <View className='modal_btn' style={{ backgroundColor: color + alpha }} onClick={cancel}>
                     <Text className='modal_cancel_text' style={{ color: color, fontWeight: 'bold' }}>{t('feature.common.picker_cancel_btn')}</Text>
                     <Text className='modal_cancel_text' style={{ color: color, fontWeight: 'bold' }}>{t('feature.common.picker_cancel_btn')}</Text>

+ 7 - 5
src/features/trackTimeDuration/components/IndexConsoleMuti.tsx

@@ -1,4 +1,4 @@
-import { View, Text, Image } from "@tarojs/components";
+import { View, Text, Image, PickerView, PickerViewColumn } from "@tarojs/components";
 import { useTranslation } from "react-i18next";
 import { useTranslation } from "react-i18next";
 import { AtActivityIndicator } from "taro-ui";
 import { AtActivityIndicator } from "taro-ui";
 import { alphaToHex, rpxToPx } from "@/utils/tools";
 import { alphaToHex, rpxToPx } from "@/utils/tools";
@@ -25,7 +25,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
     const [sleepEnd, setSleepEnd] = useState<any>(0)
     const [sleepEnd, setSleepEnd] = useState<any>(0)
     const [showPicker, setShowPicker] = useState(false)
     const [showPicker, setShowPicker] = useState(false)
     const [operateType, setOperateType] = useState('startFast')
     const [operateType, setOperateType] = useState('startFast')
-    const limitPickerRef = useRef(null)
+    const pickerRef = useRef(null)
 
 
 
 
     function cancel() {
     function cancel() {
@@ -159,7 +159,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         defaultTimestamp = new Date().getTime()
         defaultTimestamp = new Date().getTime()
         min = defaultTimestamp - 1 * 24 * 3600 * 1000
         min = defaultTimestamp - 1 * 24 * 3600 * 1000
         max = defaultTimestamp
         max = defaultTimestamp
-
+        global.pauseIndexTimer = true
         var title = t('feature.track_time_duration.common.start_fast')
         var title = t('feature.track_time_duration.common.start_fast')
         if (operateType == 'endFast') {
         if (operateType == 'endFast') {
             title = t('feature.track_time_duration.common.end_fast')
             title = t('feature.track_time_duration.common.end_fast')
@@ -179,7 +179,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         //     endTimestamp = currentRecord.sleep.target_end_time
         //     endTimestamp = currentRecord.sleep.target_end_time
         // }
         // }
 
 
-        var duration = 0
+        var duration = 20000
         // if (operateType == 'startFast' && currentRecord.fast) {
         // if (operateType == 'startFast' && currentRecord.fast) {
         //     duration = currentRecord.fast.target_end_time - currentRecord.fast.target_start_time
         //     duration = currentRecord.fast.target_end_time - currentRecord.fast.target_start_time
         // }
         // }
@@ -188,11 +188,13 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         // }
         // }
 
 
         return <View className="modal_content">
         return <View className="modal_content">
-            <ConsolePicker ref={limitPickerRef}
+
+            <ConsolePicker ref={pickerRef}
                 themeColor={color}
                 themeColor={color}
                 title={title}
                 title={title}
                 onCancel={() => {
                 onCancel={() => {
                     setShowPicker(false)
                     setShowPicker(false)
+                    global.pauseIndexTimer = false
                 }}
                 }}
                 min={min}
                 min={min}
                 max={max}
                 max={max}