leon 1 рік тому
батько
коміт
9de048b033

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
ios/main.jsbundle


+ 51 - 50
src/features/trackTimeDuration/components/DayNightCard.tsx

@@ -389,6 +389,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
                         date_end: strTomorrow,
                         // coordinate_system_standard: 'GCJ-02'
                     }).then(data => {
+                        console.log('get Location',data)
                         updateDate(data);
                         locationDetail = data;
                         global.locationDetail = locationDetail
@@ -947,55 +948,55 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
 
     }
 
-    return <View>
-        {
-            !user.isLogin && <View style={{ color: '#fff' }} onClick={tapShow}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
-        }
-        {
-            user.isLogin && !dayStore.showDayRing && <View style={{ color: '#fff' }} onClick={auth}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
-        }
-        {
-            user.isLogin && dayStore.showDayRing && <View style={{ display: 'flex', flexDirection: 'column' }} onClick={showLocationAlert} onLongPress={longClick}>
-                <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? nightDuration() : dayDuration()}</Text>
-                <Text className='day_night_desc'>{props.isNight ? nightDurationDesc1() : dayDurationDesc1()}</Text>
-
-                <View className='daynightsummary'>
-                    <View style={{ display: 'flex', flexDirection: 'column' }}>
-                        <Image className='sunicon' src={props.isNight ? require('@assets/images/sunset.png') :
-                            require('@assets/images/sunrise.png')} />
-                        <Image className='sunicon' src={props.isNight ? require('@assets/images/sunrise.png') :
-                            require('@assets/images/sunset.png')} />
-                    </View>
-                    <View style={{ display: 'flex', flexDirection: 'column' }}>
-                        <Text className='duration_title2'>{props.isNight ? '日落' : '日出'}</Text>
-                        <Text style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? getSunsetTime() : getSunriseTime()}</Text>
-                        <Text className='duration_title2'>{!props.isNight ? '日落' : '日出'}</Text>
-                        <Text style={{ color: !props.isNight ? ColorType.night : ColorType.day }}>{!props.isNight ? getSunsetTime() : getSunriseTime()}</Text>
-                    </View>
-                </View>
-                {
-                    authInfo && authInfo.lat ?
-                        <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
-                            <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'}>{getLocation()}</View>
-                        </View>
-                        :
-                        <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
-                            <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'} >
-                                {props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')}
-                            </View>
-                        </View>
-                }
-            </View>
-        }
-        {
-            showDetailPopup && modalContent()
-        }
-        {
-            showDetailModal && modalContent2()
-        }
-    </View>
-
-    /*
+    // return <View>
+    //     {
+    //         !user.isLogin && <View style={{ color: '#fff' }} onClick={tapShow}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
+    //     }
+    //     {
+    //         user.isLogin && !dayStore.showDayRing && <View style={{ color: '#fff' }} onClick={auth}>{props.isNight ? '显示当地夜晚时间' : '显示当地白天时间'}</View>
+    //     }
+    //     {
+    //         user.isLogin && dayStore.showDayRing && <View style={{ display: 'flex', flexDirection: 'column' }} onClick={showLocationAlert} onLongPress={longClick}>
+    //             <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? nightDuration() : dayDuration()}</Text>
+    //             <Text className='day_night_desc'>{props.isNight ? nightDurationDesc1() : dayDurationDesc1()}</Text>
+
+    //             <View className='daynightsummary'>
+    //                 <View style={{ display: 'flex', flexDirection: 'column' }}>
+    //                     <Image className='sunicon' src={props.isNight ? require('@assets/images/sunset.png') :
+    //                         require('@assets/images/sunrise.png')} />
+    //                     <Image className='sunicon' src={props.isNight ? require('@assets/images/sunrise.png') :
+    //                         require('@assets/images/sunset.png')} />
+    //                 </View>
+    //                 <View style={{ display: 'flex', flexDirection: 'column' }}>
+    //                     <Text className='duration_title2'>{props.isNight ? '日落' : '日出'}</Text>
+    //                     <Text style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? getSunsetTime() : getSunriseTime()}</Text>
+    //                     <Text className='duration_title2'>{!props.isNight ? '日落' : '日出'}</Text>
+    //                     <Text style={{ color: !props.isNight ? ColorType.night : ColorType.day }}>{!props.isNight ? getSunsetTime() : getSunriseTime()}</Text>
+    //                 </View>
+    //             </View>
+    //             {
+    //                 authInfo && authInfo.lat ?
+    //                     <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
+    //                         <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'}>{getLocation()}</View>
+    //                     </View>
+    //                     :
+    //                     <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(18) }} onClick={operate}>
+    //                         <View className={props.isNight ? 'night_location_btn' : 'day_location_btn'} >
+    //                             {props.isNight ? t('feature.day_night.get_local_time') : t('feature.day_night.get_local_time_sunrise')}
+    //                         </View>
+    //                     </View>
+    //             }
+    //         </View>
+    //     }
+    //     {
+    //         showDetailPopup && modalContent()
+    //     }
+    //     {
+    //         showDetailModal && modalContent2()
+    //     }
+    // </View>
+
+    
 
     return <View style={{ color: '#fff' }} onLongPress={longClick}>
         <Box onClick={tapCard}>
@@ -1097,5 +1098,5 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
         {
             showDetailModal && modalContent2()
         }
-    </View >*/
+    </View >
 }

+ 43 - 32
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -23,7 +23,7 @@ if (process.env.TARO_ENV == 'rn') {
 let operateType = ''
 let min = 0
 let max = 0
-let current = 0
+let defaultTimestamp = 0
 let isTimeout = false
 export default function IndexConsole(props: { record: any }) {
     const user = useSelector((state: any) => state.user);
@@ -37,7 +37,7 @@ export default function IndexConsole(props: { record: any }) {
     const common = useSelector((state: any) => state.common);
     const [firstEnter, setFirstEnter] = useState(true);
     const [showTimePicker, setShowTimePicker] = useState(false);
-    const dayMillionSeconds = 24 * 3600 * 1000;
+    const dayMilliSeconds = 24 * 3600 * 1000;
     const [btnDisable, setBtnDisable] = useState(false)
     const dispatch = useDispatch();
 
@@ -47,6 +47,7 @@ export default function IndexConsole(props: { record: any }) {
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
+        var date = new Date()
     }
 
     useDidShow(() => {
@@ -84,9 +85,9 @@ export default function IndexConsole(props: { record: any }) {
         global.pauseIndexTimer = true
         global.set_time = new Date().getTime()
 
-        current = new Date().getTime()
-        min = current - 6 * 24 * 3600 * 1000
-        max = current
+        defaultTimestamp = new Date().getTime()
+        min = defaultTimestamp - 6 * 24 * 3600 * 1000
+        max = defaultTimestamp
         isTimeout = false
 
         setShowTimePicker(true)
@@ -119,25 +120,28 @@ export default function IndexConsole(props: { record: any }) {
 
         isTimeout = false
         if (props.record.scenario.name == 'SLEEP') {
-            current = new Date().getTime()
-            min = current - 6 * dayMillionSeconds
-            max = current
+            defaultTimestamp = new Date().getTime()
+            min = defaultTimestamp - 6 * dayMilliSeconds
+            max = defaultTimestamp
         }
         else {
             //todolist
             var now = new Date().getTime()
             var last_check_time = props.record.current_record.last_real_check_time
-            if (now - last_check_time >= dayMillionSeconds) {
+            if (now - last_check_time >= dayMilliSeconds) {
                 //ongoing1 严重超时单独处理
-                var schedule_start_time = props.record.current_record.sleep.target_start_time
-                current = Math.min(now, schedule_start_time)
-                min = Math.max(last_check_time, schedule_start_time - 3 * dayMillionSeconds)
-                max = Math.min(now, schedule_start_time + 3 * dayMillionSeconds)
+                // var schedule_start_time = props.record.current_record.sleep.target_start_time
+                // defaultTimestamp = Math.min(now, schedule_start_time)
+                // min = Math.max(last_check_time, schedule_start_time - 3 * dayMillionSeconds)
+                // max = Math.min(now, schedule_start_time + 3 * dayMillionSeconds)
+                defaultTimestamp = now
+                min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+                max = defaultTimestamp
             }
             else {
-                current = now
-                min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
-                max = current
+                defaultTimestamp = now
+                min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+                max = defaultTimestamp
             }
 
         }
@@ -172,18 +176,21 @@ export default function IndexConsole(props: { record: any }) {
         var real_start_time = props.record.current_record.sleep.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
         var now = new Date().getTime()
-        if (now - real_start_time >= dayMillionSeconds) {
+        if (now - real_start_time >= dayMilliSeconds) {
             //严重超时
             isTimeout = true
-            current = props.record.current_record.sleep.target_end_time
-            min = Math.max(last_check_time, current - 3 * dayMillionSeconds)
-            max = Math.min(now, current + 3 * dayMillionSeconds)
+            // defaultTimestamp = Math.min(props.record.current_record.sleep.target_end_time, now)
+            // min = Math.max(last_check_time, defaultTimestamp - 3 * dayMillionSeconds)
+            // max = Math.min(now, defaultTimestamp + 3 * dayMillionSeconds)
+            defaultTimestamp = now
+            min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+            max = defaultTimestamp
         }
         else {
             isTimeout = false
-            current = now
-            min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
-            max = current
+            defaultTimestamp = now
+            min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+            max = defaultTimestamp
         }
 
         setShowTimePicker(true)
@@ -219,18 +226,22 @@ export default function IndexConsole(props: { record: any }) {
         var real_start_time = props.record.current_record.fast.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
         var now = new Date().getTime()
-        if (now - real_start_time >= dayMillionSeconds) {
+        if (now - real_start_time >= dayMilliSeconds) {
             //严重超时
             isTimeout = true
-            current = props.record.current_record.fast.target_end_time
-            min = Math.max(last_check_time, current - 3 * dayMillionSeconds)
-            max = Math.min(now, current + 3 * dayMillionSeconds)
+            // defaultTimestamp = Math.min(props.record.current_record.fast.target_end_time, now)
+            // min = Math.max(last_check_time, defaultTimestamp - 3 * dayMillionSeconds)
+            // max = Math.min(now, defaultTimestamp + 3 * dayMillionSeconds)
+            // debugger
+            defaultTimestamp = now
+            min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+            max = defaultTimestamp
         }
         else {
             isTimeout = false
-            current = now
-            min = Math.max(last_check_time, current - 6 * dayMillionSeconds)
-            max = current
+            defaultTimestamp = now
+            min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
+            max = defaultTimestamp
         }
 
         setShowTimePicker(true)
@@ -323,7 +334,7 @@ export default function IndexConsole(props: { record: any }) {
                 onCancel={hidePicker}
                 min={min}
                 max={max}
-                current={current}
+                current={defaultTimestamp}
                 duration={duration}
                 endTimestamp={endTimestamp}
                 isFast={operateType == 'startFast' || operateType == 'endFast'}
@@ -448,7 +459,7 @@ export default function IndexConsole(props: { record: any }) {
                     setFirstEnter(false)
                     hidePicker()
                     setBtnDisable(false)
-                    
+
                     if (permission.wxPubFollow) {
                         Taro.showModal({
                             title: t('feature.track_time_duration.reminders.wake_title'),

+ 1 - 1
src/features/trackTimeDuration/components/Rings.rn.tsx

@@ -155,7 +155,7 @@ export default function Component(props: {
                     stroke={props.currentDot!.borderColor}
                     transform={`rotate(${arc / (2 * Math.PI) * 360} ${center} ${center})`}
                     strokeDasharray={`0,1000`}
-                    strokeWidth={lineWidth + 6}
+                    strokeWidth={lineWidth + 4}
                     strokeLinecap="round"
                 />
             }

+ 1 - 1
src/pages/account/Setting.tsx

@@ -65,7 +65,7 @@ export default function Page() {
 
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column', flex: 1 }}>
         <View style={{ height: 20 }} />
-        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>{process.env.TARO_ENV == 'weapp'?'1.3.6':'1.3.3'}</Text></TableCell>
+        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>{process.env.TARO_ENV == 'weapp'?'1.3.7':'1.3.3'}</Text></TableCell>
         {/* <Text style={{color:'#9E9E9E',textAlign:'center',fontSize:14}}>v1.2.2</Text> */}
         {
             process.env.TARO_ENV == 'rn' && <View style={{ flex: 1 }} />

+ 1 - 1
src/pages/clock/Clock.tsx

@@ -270,7 +270,7 @@ export default function Page() {
         clientInfo({
             client: {
                 client_type: process.env.TARO_ENV == 'weapp' ? 'MP' : 'APP',
-                client_version: process.env.TARO_ENV == 'weapp' ? '1.3.6' : '1.0',//Taro.getAccountInfoSync().miniProgram.version : '1.0',//'1.0'
+                client_version: process.env.TARO_ENV == 'weapp' ? '1.3.7' : '1.0',//Taro.getAccountInfoSync().miniProgram.version : '1.0',//'1.0'
                 wx_version: process.env.TARO_ENV == 'weapp' ? systemInfo.version : '_'
             },
             meta: {

+ 31 - 18
src/pages/rn/RNMain.tsx

@@ -18,8 +18,9 @@ import EditPage from '@/pages/account/EditPage'
 import Food from '@/pages/food/Food'
 import Working from '@/pages/workout/Working'
 import WorkoutDetail from '@/pages/workout/WorkoutDetail'
+import Explore from '../explore/Index';
 import DemoA from '../clock/demoA';
-import {Image} from 'react-native';
+import { Image } from 'react-native';
 // import { View,Image } from '@tarojs/components';
 
 // 创建底部 Tab 导航器
@@ -63,11 +64,12 @@ const App: React.FC = () => {
 
 export default function RNMain() {
   const ClockPage = () => <Clock />
+  const ExplorePage = () => <Explore />
   const MetricPage = () => <Metric />
-  const WorkoutPage = () => <Workout />
+  // const WorkoutPage = () => <Workout />
   const ProfilePage = () => <Profile />
   const DemoAPage = () => <DemoA />
-  const FoodPage = ()=><Food/>
+  // const FoodPage = ()=><Food/>
 
   function tabNavigator() {
     return (
@@ -82,18 +84,29 @@ export default function RNMain() {
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
       })}>
         <Tab.Screen name="Circadian Clock" component={ClockPage} options={{
-          tabBarIcon: ({size,focused,color}) => {
+          tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
-              resizeMode='contain'
+                resizeMode='contain'
                 style={{ width: size, height: size }}
                 source={require('@assets/images/test.png')}
               />
             );
           },
-        }}/>
+        }} />
+        <Tab.Screen name="Explore" component={ExplorePage} options={{
+          tabBarIcon: ({ size, focused, color }) => {
+            return (
+              <Image
+                resizeMode='contain'
+                style={{ width: size, height: size }}
+                source={require('@assets/images/camera.png')}
+              />
+            );
+          },
+        }} />
         {/* <Tab.Screen name='DemoA' component={DemoAPage} /> */}
-        <Tab.Screen name="Food" component={FoodPage} options={{
+        {/* <Tab.Screen name="Food" component={FoodPage} options={{
           tabBarIcon: ({size,focused,color}) => {
             return (
               <Image
@@ -103,20 +116,20 @@ export default function RNMain() {
               />
             );
           },
-        }}/>
+        }}/> */}
         <Tab.Screen name="Metrics" component={MetricPage} options={{
-          tabBarIcon: ({size,focused,color}) => {
+          tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
-              resizeMode='contain'
+                resizeMode='contain'
                 style={{ width: size, height: size }}
                 source={require('@assets/images/camera.png')}
               />
             );
           },
-        }}/>
-        
-        <Tab.Screen name="Workouts" component={WorkoutPage} options={{
+        }} />
+
+        {/* <Tab.Screen name="Workouts" component={WorkoutPage} options={{
           tabBarIcon: ({size,focused,color}) => {
             return (
               <Image
@@ -126,18 +139,18 @@ export default function RNMain() {
               />
             );
           },
-        }}/>
+        }}/> */}
         <Tab.Screen name="More" component={ProfilePage} options={{
-          tabBarIcon: ({size,focused,color}) => {
+          tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
-              resizeMode='contain'
+                resizeMode='contain'
                 style={{ width: size, height: size }}
                 source={require('@assets/images/camera.png')}
               />
             );
           },
-        }}/>
+        }} />
       </Tab.Navigator>
     )
   }
@@ -172,7 +185,7 @@ export default function RNMain() {
         <Stack.Screen name='ChooseScenario' component={ChooseScenario} />
         <Stack.Screen name='RecordsHistory' component={RecordsHistory} options={{
           // headerBackTitle:'hello world'
-        }}/>
+        }} />
         <Stack.Screen name='SetSchedule' component={SetSchedule} />
         <Stack.Screen name='ProfileSetting' component={ProfileSetting} />
         <Stack.Screen name='EditPage' component={EditPage} />

+ 1 - 1
src/services/http/api.js

@@ -1,4 +1,4 @@
-let online = process.env.TARO_ENV == 'rn' ? false : false;
+let online = process.env.TARO_ENV == 'rn' ? false : true;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'

Деякі файли не було показано, через те що забагато файлів було змінено