leon преди 1 година
родител
ревизия
a9bf97525b

+ 2 - 0
ios/AppDelegate.mm

@@ -5,6 +5,7 @@
 #import <React/RCTRootView.h>
 
 #import <React/RCTAppSetupUtils.h>
+#import <CoreLocation/CoreLocation.h>
 //#import <RCTJPushModule.h>
 
 #if RCT_NEW_ARCH_ENABLED
@@ -36,6 +37,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 //  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenNotificationSettingsURLString]];
 //  NSString *url = UIApplicationOpenNotificationSettingsURLString;
   // APNS
+//  BOOL isLocation = [CLLocationManager locationServicesEnabled];
   self.rnLoaded = NO;
   NSDate *date = [NSDate date];
   //zone为当前时区信息  在我的程序中打印的是@"Asia/Shanghai"

+ 52 - 1
ios/NativeBridge.m

@@ -8,6 +8,7 @@
 #import <Foundation/Foundation.h>
 #import "NativeBridge.h"
 #import "AppDelegate.h"
+#import <CoreLocation/CoreLocation.h>
 
 
 @interface NativeBridge()
@@ -44,10 +45,60 @@ RCT_EXPORT_METHOD(rnPageLoaded){
   });
 }
 
+RCT_EXPORT_METHOD(getLocationAuthStatus:(RCTResponseSenderBlock)callback){
+  dispatch_async(dispatch_get_main_queue(), ^{
+    BOOL isLocation = [CLLocationManager locationServicesEnabled];
+    CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
+    switch (status) {
+      case kCLAuthorizationStatusNotDetermined:
+        callback(@[
+          @{
+            @"location_services_enabled":isLocation?@"true":@"false",
+            @"authorization_status":@"not_determined"
+          }
+        ]);
+        break;
+      case kCLAuthorizationStatusDenied:
+        callback(@[
+          @{
+            @"location_services_enabled":isLocation?@"true":@"false",
+            @"authorization_status":@"denied"
+          }
+        ]);
+        break;
+      case kCLAuthorizationStatusAuthorizedAlways:
+        callback(@[
+          @{
+            @"location_services_enabled":isLocation?@"true":@"false",
+            @"authorization_status":@"always"
+          }
+        ]);
+        break;
+      case kCLAuthorizationStatusAuthorizedWhenInUse:
+        callback(@[
+          @{
+            @"location_services_enabled":isLocation?@"true":@"false",
+            @"authorization_status":@"when_in_use"
+          }
+        ]);
+        break;
+      default:
+        callback(@[
+          @{
+            @"location_services_enabled":isLocation?@"true":@"false",
+            @"authorization_status":@"other"
+          }
+        ]);
+        break;
+    }
+  });
+}
+
 RCT_EXPORT_METHOD(getNotificationAuthStatus){
   dispatch_async(dispatch_get_main_queue(), ^{
     UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
     [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
+      
       UNAuthorizationStatus status = settings.authorizationStatus;
       
       switch (status) {
@@ -231,7 +282,7 @@ RCT_EXPORT_METHOD(addLocalPush:(id)array){
         // 计算当前时间与给定时间戳之间的时间差(秒)
         NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
         
-        UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:10 repeats:NO];
+        UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timeInterval repeats:NO];
         NSString * identifier = message_id;
         UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
         [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {

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

@@ -572,7 +572,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 25;
+				CURRENT_PROJECT_VERSION = 45;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -580,7 +580,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.0.1;
+				MARKETING_VERSION = 1.0.0;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -605,14 +605,14 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 25;
+				CURRENT_PROJECT_VERSION = 45;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.0.1;
+				MARKETING_VERSION = 1.0.0;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
ios/main.jsbundle


+ 10 - 4
src/components/basic/ActionSheet.tsx

@@ -19,16 +19,22 @@ export default function showActionSheet(props: any) {
         const { showActionSheetWithOptions } = props.showActionSheetWithOptions;//useActionSheet();
         var list = JSON.parse(JSON.stringify(props.itemList));
         list.push('Cancel');
-        const options = {
+        let options = {
             options: list,
             cancelButtonIndex: list.length - 1,
-            // destructiveButtonIndex: list.length - 1,
+            // destructiveButtonIndex: 0,
             title: props.title,
             message: props.message,
         };
-        showActionSheetWithOptions(options,(selectedIndex:number)=>{
+        var destructiveButtonIndex = -1;
+        list.map((item, index) => {
+            if (item == 'Delete' || item == '删除')
+                destructiveButtonIndex = index
+        });
+        (options as any).destructiveButtonIndex = destructiveButtonIndex
+        showActionSheetWithOptions(options, (selectedIndex: number) => {
             if (selectedIndex < list.length - 1)
-            props.success(selectedIndex)
+                props.success(selectedIndex)
         });
     }
 }

+ 3 - 1
src/components/layout/layout.tsx

@@ -41,6 +41,8 @@ export default function Layout(props: {
         navigation = useNavigation()
     }
 
+
+
     useEffect(() => {
         Taro.setNavigationBarTitle({
             title: showTitle ? props.title ? props.title : '' : ''
@@ -59,7 +61,7 @@ export default function Layout(props: {
         //     }
 
         // }, 8000)
-    }, [showTitle])
+    }, [showTitle,props.title])
 
     function onRefresh() {
         if (props.refresh) {

+ 1 - 1
src/components/navigation/TabBar.tsx

@@ -49,7 +49,7 @@ export default function Component(props: { index: number }) {
 
     return <View className='tabbar'>
         <View className={selIndex == 0 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(0)}>
-            <Text>生物钟</Text>
+            <Text>首页</Text>
         </View>
         {/* <View className={selIndex == 4 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(4)}>
             <View style={{ position: 'relative' }}>

+ 27 - 4
src/context/locales/en.js

@@ -14,7 +14,7 @@ export default {
     },
     page: {
         clock: {
-            title: 'Circadian',
+            title: 'Today',
         },
         activity: {
             title: 'Activity',
@@ -23,10 +23,10 @@ export default {
             title: 'Metrics',
         },
         food: {
-            title: 'Food',
+            title: 'Breakfast Journal',
         },
         workout: {
-            title: 'Workouts'
+            title: 'Workouts Journal'
         },
         explore: {
             title: 'Explore',
@@ -105,6 +105,10 @@ export default {
         }
     },
     feature: {
+        pro:{
+            for_pro:'For Pro',
+            tag:'Limit-Time Offer'
+        },
         auth_sys: {
             location_title: 'Unable to use location',
             location_desc: 'Go to the app\'s settings, tap Location and choose "While Using the App."\nIf untappable, return to settings, tap Privacy -> Location Services and turn on "Location Services" first.',
@@ -233,6 +237,23 @@ export default {
                 pick_earlier_end: 'Pick an earlier end',
             }
         },
+        location:{
+            no_location:'No location info yet.',
+            clear_info:'Clear location info',
+            clear_alert_title:'Alert',
+            clear_alert_content:'Your local sunrise & sunset info will be removed once you clear your location info. Are you sure you want to clear your info?',
+            clear_alert_cancel:'Cancel',
+            clear_alert_confirm:'Clear info'
+        },
+        heads_up:{
+            alert_title:'Heads-up',
+            ongoing1_content:'You haven\'t logged your sleep.you end fasting now, If you will lose your premium access to \'Fasting with Sleep.\'',
+            ongoing1_cancel:'Log my sleep first',
+            ongoing1_confirm:'End fasting',
+            ongoing2_content:'You haven\'t finished your sleep log. If you end fasting now, you will lose your premium access to \'Fasting with Sleep.\'',
+            ongoing2_cancel:'Finish my sleep log',
+            ongoing2_confirm:'End fasting',
+        },
         common: {
             prompt: 'Prompt',
             action_sheet_cancel: 'Cancel',
@@ -253,7 +274,7 @@ export default {
             multi_tz_desc: 'Multiple time zones were involved in these events.',
             diff_tz_desc: 'These events occured in {{location}} time which differs from your current time zone.',
             become_pro: 'Become Pro',
-            overnight: 'Overnight',
+            overnight: 'Night',
             day: 'Day',
             eat: 'Eat',
             move: 'Move',
@@ -418,6 +439,8 @@ export default {
             sunset: 'Sunset',
             location_updated: 'Location updated.',
             location_failed: 'Location failed to update.',
+            group_title:'Day-Night Cycle',
+            sync:'Sync up'
         },
         track_time_duration: {
             common: {

+ 30 - 6
src/context/locales/zh.js

@@ -14,7 +14,7 @@ export default {
     },
     page: {
         clock: {
-            title: '生物钟',
+            title: '今天',
         },
         activity: {
             title: '运动',
@@ -23,13 +23,13 @@ export default {
             title: '指标',
         },
         food: {
-            title: '食物日记',
+            title: '早餐日记',
         },
         workout: {
-            title: '运动训练'
+            title: '训练日记'
         },
         explore: {
-            title: '发现',
+            title: '发现更多',
             share_title: '我的发现',
             journal:'日记'
         },
@@ -108,6 +108,10 @@ export default {
 
     },
     feature: {
+        pro:{
+            for_pro:'Pro 会员',
+            tag:'限免'
+        },
         auth_sys: {
             location_title: '无法获取你的位置信息',
             location_desc: '请在「位置」中, 允许【hola】在“使用 App期间”访问位置信息。\n如无法操作, 请在「设置-隐私-定位服务」中, 打开“定位服务”。',
@@ -226,6 +230,7 @@ export default {
                 // not_satisfied_after_delete:'since you no longer have a fasting streak that satisfy the base requirement',
             }
         },
+        
         notification: {
             action_title: {
                 start_timer_now: '一键立即开始计时',
@@ -235,6 +240,23 @@ export default {
                 pick_earlier_end: '选择更早结束',
             }
         },
+        location:{
+            no_location:'暂无位置信息',
+            clear_info:'清除位置信息',
+            clear_alert_title:'提示',
+            clear_alert_content:'清除位置信息后, 您将无法继续查看当地日出日落时间。确定要清除位置信息吗',
+            clear_alert_cancel:'取消',
+            clear_alert_confirm:'清除'
+        },
+        heads_up:{
+            alert_title:'提示',
+            ongoing1_content:'您还未睡眠打卡。此时结束断食, 您将失去\'断食与睡眠\'的高级体验资格。',
+            ongoing1_cancel:'睡眠打卡',
+            ongoing1_confirm:'结束断食',
+            ongoing2_content:'您还未完成睡眠打卡。此时结束断食, 您将失去\'断食与睡眠\'的高级体验资格。',
+            ongoing2_cancel:'睡眠打卡',
+            ongoing2_confirm:'结束断食',
+        },
         common: {
             prompt: '提示',
             action_sheet_cancel: '取消',
@@ -422,6 +444,8 @@ export default {
             sunset: '日落',
             location_updated: '位置更新成功',
             location_failed: '位置更新失败',
+            group_title:'昼夜节律',
+            sync:'同步'
         },
         track_time_duration: {
             common: {
@@ -681,7 +705,7 @@ export default {
             picker_end_title: '结束时间',
             camera: '拍摄食物',
             album: '从相册选择',
-            share_title: '我的食物日记',
+            share_title: '我的早餐日记',
             prompt: '提示',
             prompt_detail: '日记列表顺序发生变化, 点击刷新',
             sence_desc: '拍摄食物, 记录餐前饥饿感\n记录餐后饱足感',
@@ -699,7 +723,7 @@ export default {
             disable_switch_modal_btn: '我知道了'
         },
         workout: {
-            share_title: '我的运动训练',
+            share_title: '我的训练日记',
             finish_title: '{{name}}计时训练中',
             finish_current: '请先结束训练',
             add_more: '添加更多',

+ 1 - 1
src/features/daynight/DayNightCard.tsx

@@ -1016,7 +1016,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
                     }
                 }}
                 style={{ backgroundColor: props.isNight ? ColorType.night : ColorType.day }}>
-                <Text style={{ color: props.isNight ? ColorType.white : ColorType.black, fontWeight: 'bold' }}>白天/夜晚</Text>
+                <Text style={{ color: props.isNight ? ColorType.white : ColorType.black, fontWeight: 'bold' }}>{t('feature.day_night.sync')}</Text>
             </View>
         </View>
     }

+ 21 - 23
src/features/daynight/DayNightSwiperPopup.tsx

@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'
 import Taro from '@tarojs/taro'
 import { systemLocation } from '@/services/common'
 import showAlert from '@/components/basic/Alert'
-import { getTimezone } from '@/utils/tools'
+import { getTimezone, rpxToPx } from '@/utils/tools'
 import { clearLocation } from '@/services/user'
 import { TimeFormatter } from '@/utils/time_format'
 
@@ -98,7 +98,7 @@ export default function DayNightSwiperPopup(props: { authInfo: any }) {
         var timezone = getTimezone()
         if (!authInfo || !(authInfo as any).lat) {
             return <View style={{ height: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', width: rpxToPx(750) }}>
-                <Text>暂无位置信息</Text>
+                <Text>{t('feature.location.no_location')}</Text>
             </View>
         }
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
@@ -147,25 +147,23 @@ export default function DayNightSwiperPopup(props: { authInfo: any }) {
             <Text onClick={() => {
                 clearData()
                 setShowDetailModal(false)
-            }} style={{ width: '100%', textAlign: 'center', marginBottom: 50, color: '#fff', marginTop: 20 }}>清除位置</Text>
+            }} style={{ width: '100%', textAlign: 'center', marginBottom: 50, color: '#fff', marginTop: 20 }}>{t('feature.location.clear_info')}</Text>
         </View>
     }
 
     function clearData() {
-        Taro.showModal({
-            title: '提示',
-            content: '确认清除位置数据?',
-            success: function (res) {
-                if (res.confirm) {
-                    clearLocation().then(res => {
-                        // getLatestLocation()
-                        global.swiperDayNightRefresh()
-                        global.refreshNight()
-                        global.refreshDay()
-                    })
-                } else if (res.cancel) {
-                    console.log('用户点击取消')
-                }
+        showAlert({
+            title:t('feature.location.clear_alert_title'),
+            content:t('feature.location.clear_alert_content'),
+            cancelText:t('feature.location.clear_alert_cancel'),
+            confirmText:t('feature.location.clear_alert_confirm'),
+            showCancel:true,
+            confirm:()=>{
+                clearLocation().then(res => {
+                    global.swiperDayNightRefresh()
+                    global.refreshNight()
+                    global.refreshDay()
+                })
             }
         })
     }
@@ -207,9 +205,9 @@ export default function DayNightSwiperPopup(props: { authInfo: any }) {
                         }
                         else {
                             showAlert({
-                                title:'Success',
-                                content:t('feature.day_night.location_updated'),
-                                showCancel:false
+                                title: 'Success',
+                                content: t('feature.day_night.location_updated'),
+                                showCancel: false
                             })
                             // Taro.showToast({
                             //     title: t('feature.day_night.location_updated'),
@@ -239,9 +237,9 @@ export default function DayNightSwiperPopup(props: { authInfo: any }) {
                         }
                         else {
                             showAlert({
-                                title:'Error',
-                                content:t('feature.day_night.location_updated'),
-                                showCancel:false
+                                title: 'Error',
+                                content: t('feature.day_night.location_updated'),
+                                showCancel: false
                             })
                             // Taro.showToast({
                             //     title: t('feature.day_night.location_failed'),

+ 4 - 2
src/features/trackTimeDuration/components/CircadianDetailPopup.tsx

@@ -17,6 +17,7 @@ import PickerViews from '@/components/input/PickerViews';
 import Taro from '@tarojs/taro';
 import { IconInfo, IconMinus, IconPlus } from '@/components/basic/Icons';
 import showAlert from '@/components/basic/Alert';
+import { getLocalPush } from '../actions/TrackTimeActions';
 
 
 let LinearGradient
@@ -846,11 +847,12 @@ export default function CircadianDetailPopup(props: { record: any, schedule?: an
                     }
                 }
             }
-            console.log('bbbbbbbbbbbbbbbbbbbbbbb')
             updateRecord({
                 ...params
             }, props.record.id).then(res => {
-                console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
+                //刷新本地推送schedule
+                getLocalPush()
+                //刷新首页数据
                 global.indexPageRefresh()
             }).catch(e => {
 

+ 2 - 2
src/features/trackTimeDuration/components/Discovery.tsx

@@ -523,13 +523,13 @@ export default function Discovery() {
                                 <Text className="duration_value2" style={{ color: ColorType.day }}>{dayDuration()}</Text>
                             }
                             {
-                                ring.current_record && ring.current_record.scenario != 'SLEEP' && <Text className="duration_title2">进食</Text>
+                                ring.current_record && ring.current_record.scenario != 'SLEEP' && <Text className="duration_title2">{t('feature.common.eat')}</Text>
                             }
                             {
                                 ring.current_record && ring.current_record.scenario != 'SLEEP' && <Text className="duration_value2" style={{ color: ColorType.food }}>{eatDuration()}</Text>
                             }
                             {
-                                ring.current_record && ring.current_record.scenario != 'FAST' && <Text className="duration_title2">活动</Text>
+                                ring.current_record && ring.current_record.scenario != 'FAST' && <Text className="duration_title2">{t('feature.common.move')}</Text>
                             }
                             {
                                 ring.current_record && ring.current_record.scenario != 'FAST' && <Text className="duration_value2" style={{ color: ColorType.activity, marginBottom: 0 }}>{activityDuration()}</Text>

+ 38 - 9
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -296,7 +296,6 @@ export default function IndexConsole(props: { record: any, count: number }) {
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth')
             return
         }
-        debugger
         if (status == 'WAIT_FOR_START') {
             Taro.showToast({
                 title: t('feature.track_time_duration.console.lock_fast_tip'),
@@ -305,6 +304,44 @@ export default function IndexConsole(props: { record: any, count: number }) {
             vibrate()
             return;
         }
+
+        if (status == 'ONGOING1'){
+            showAlert({
+                title:t('feature.heads_up.alert_title'),
+                content:t('feature.heads_up.ongoing1_content'),
+                cancelText:t('feature.heads_up.ongoing1_cancel'),
+                confirmText:t('feature.heads_up.ongoing1_confirm'),
+                showCancel:true,
+                cancel:()=>{
+                    
+                },
+                confirm:()=>{
+                    tapEndFastOperate()
+                }
+            })
+            return
+        }
+        else if (status == 'ONGOING2'){
+            showAlert({
+                title:t('feature.heads_up.alert_title'),
+                content:t('feature.heads_up.ongoing2_content'),
+                cancelText:t('feature.heads_up.ongoing2_cancel'),
+                confirmText:t('feature.heads_up.ongoing2_confirm'),
+                showCancel:true,
+                cancel:()=>{
+                    
+                },
+                confirm:()=>{
+                    tapEndFastOperate()
+                }
+            })
+            return
+        }
+        
+        tapEndFastOperate()
+    }
+
+    function tapEndFastOperate(){
         operateType = 'endFast'
         global.pauseIndexTimer = true
         global.set_time = new Date().getTime()
@@ -331,13 +368,6 @@ export default function IndexConsole(props: { record: any, count: number }) {
         }
 
         setShowTimePicker(true)
-
-        // if (last_check_time + 24 * 3600 * 1000 <= new Date().getTime() ||
-        //     props.record.current_record.fast.real_check_time + 24 * 3600 * 1000 <= new Date().getTime()) {
-        //     setShowTimePicker(true)
-        //     return
-        // }
-        // showPicker()
     }
 
     function layoutContent() {
@@ -701,7 +731,6 @@ export default function IndexConsole(props: { record: any, count: number }) {
                     else {
                         console.log('apple')
                     }
-                    debugger
                     global.checkAccess((res as any).access)
                     // checkAccessProvisional((res as any).access,showFastAlert)
                 }).catch((e) => {

+ 0 - 29
src/features/trackTimeDuration/components/Streaks.tsx

@@ -88,35 +88,6 @@ export default function Streaks(props: { count: number }) {
             <StreakItem isFast={true} data={fastStreaks} />
             <StreakItem isFast={false} data={sleepStreaks} />
         </View>
-        {
-            (fastStreaks.current.reset_ts || sleepStreaks.current.reset_ts) &&
-            <View className='streaks_countdown_bg'>
-                <View className='streak_countdown_item'>
-                    {/* {
-                        process.env.TARO_ENV == 'weapp' ? <Text className='streak_countdown_title'>{t('feature.track_time_duration.streaks.countdown_title', { name: (fastStreaks.current.reset_ts && sleepStreaks.current.reset_ts) ? 'streaks' : 'streak' })}</Text> :
-                            <GradientText style={{ fontSize: rpxToPx(18), fontWeight: 'bold' }}>{t('feature.track_time_duration.streaks.countdown_title', { name: (fastStreaks.current.reset_ts && sleepStreaks.current.reset_ts) ? 'streaks' : 'streak' })}</GradientText>
-
-                    } */}
-                    {/* {
-                        process.env.TARO_ENV == 'weapp' ? <Text className='streak_countdown_title'>{(fastStreaks.current.reset_ts && sleepStreaks.current.reset_ts)?t('feature.track_time_duration.streaks.countdown_titles'):t('feature.track_time_duration.streaks.countdown_title')}</Text> :
-                            <GradientText style={{ fontSize: rpxToPx(18), fontWeight: 'bold' }}>{(fastStreaks.current.reset_ts && sleepStreaks.current.reset_ts)?t('feature.track_time_duration.streaks.countdown_titles'):t('feature.track_time_duration.streaks.countdown_title')}</GradientText>
-
-                    } */}
-                </View>
-                {/* {
-                    fastStreaks.current.reset_ts && <View className='streak_countdown_item'>
-                        <View className='streak_point' />
-                        <Text className='streak_countdown_value'>{t('feature.track_time_duration.streaks.countdown_fast', { time: TimeFormatter.countdown(fastStreaks.current.reset_ts) })}</Text>
-                    </View>
-                }
-                {
-                    sleepStreaks.current.reset_ts && <View className='streak_countdown_item'>
-                        <View className='streak_point' />
-                        <Text className='streak_countdown_value'>{t('feature.track_time_duration.streaks.countdown_sleep', { time: TimeFormatter.countdown(sleepStreaks.current.reset_ts) })}</Text>
-                    </View>
-                } */}
-            </View>
-        }
 
     </View>
 }

+ 1 - 1
src/features/trackTimeDuration/components/TitleView.scss

@@ -18,7 +18,7 @@
     color: #fff;
     font-size: 72px;
     line-height: 72px;
-    font-weight: 500;
+    font-weight: bold;
 
 }
 

+ 7 - 0
src/pages/clock/Clock.scss

@@ -62,6 +62,13 @@
     // background-color: pink;
 }
 
+.index_main_title{
+    color: #fff;
+    font-size: 72px;
+    line-height: 72px;
+    font-weight: bold;
+}
+
 .index_section_title {
     color: #fff;
     opacity: 0.6;

+ 49 - 64
src/pages/clock/ClockMain.tsx

@@ -52,6 +52,7 @@ import { setWXFollow } from "@/store/permission";
 import Discovery from "@/features/trackTimeDuration/components/Discovery";
 import NoData from "@/components/view/NoData";
 import { getLocalPush } from "@/features/trackTimeDuration/actions/TrackTimeActions";
+import { TimeFormatter } from "@/utils/time_format";
 
 const utc = require('dayjs/plugin/utc')
 const timezone = require('dayjs/plugin/timezone')
@@ -146,7 +147,6 @@ export default function Page() {
                 }
             }
             if (global.pauseIndexTimer || pauseTimer) {
-                console.log('pause')
                 return
             }
             setCount((prevCounter) => prevCounter + 1)
@@ -176,9 +176,7 @@ export default function Page() {
     }, [])
 
     useEffect(() => {
-        console.log(user.isLogin)
         getCheckData()
-        // global.pauseIndexTimer = !user.isLogin
 
 
 
@@ -343,9 +341,11 @@ export default function Page() {
         if (nextAppState != 'active') {
             return
         }
-        if (nextAppState == 'active')
+        if (nextAppState == 'active') {
             checkTimeZone()
-        updateNotificationStatus()
+            updateNotificationStatus()
+        }
+
     };
 
     function updateNotificationStatus() {
@@ -439,7 +439,8 @@ export default function Page() {
             timeZoneId = getTimezoneId()
             timeZoneName = getTimezoneName()
         }
-        clientInfo({
+
+        var clientInfoParams = {
             client: {
                 client_type: process.env.TARO_ENV == 'weapp' ? 'MP' : 'APP',
                 client_version: process.env.TARO_ENV == 'weapp' ? WX_VERSION : APP_VERSION,//Taro.getAccountInfoSync().miniProgram.version : '1.0',//'1.0'
@@ -459,12 +460,18 @@ export default function Page() {
                 platform: systemInfo.platform,
                 system: systemInfo.system
             },
-            perm: {
-                wifi_enabled: systemInfo.wifiEnabled,
-                location_authorized: systemInfo.locationAuthorized,
-                location_enabled: systemInfo.locationEnabled
+        }
+
+        if (process.env.TARO_ENV == 'weapp') {
+            (clientInfoParams as any).perm = {
+                wxmp: {
+                    wifi_enabled: systemInfo.wifiEnabled,
+                    location_authorized: systemInfo.locationAuthorized,
+                    location_enabled: systemInfo.locationEnabled
+                }
             }
-        })
+        }
+        clientInfo(clientInfoParams)
     }
 
     function getCheckData() {
@@ -626,14 +633,6 @@ export default function Page() {
     global.popScheduleAlert = (scenario, startTime) => {
         if (process.env.TARO_ENV == 'weapp') {
             if (permission.wxPubFollow) {
-                // showAlert({
-                //     title: t('feature.track_time_duration.reminders.schedule_title'),
-                //     content: scenario.name == 'FAST' ?
-                //         t('feature.track_time_duration.reminders.enable_schedule_fast_content', { time: startTime }) :
-                //         t('feature.track_time_duration.reminders.enable_schedule_sleep_content', { time: startTime }),
-                //     showCancel: false,
-                //     confirmText: t('feature.track_time_duration.reminders.ok')
-                // })
             }
             else {
                 showAlert({
@@ -654,14 +653,6 @@ export default function Page() {
             PushNotification.checkPermissions((res) => {
                 //允许授权
                 if (res.authorizationStatus == 2) {
-                    // showAlert({
-                    //     title: t('feature.track_time_duration.reminders.schedule_title'),
-                    //     content: scenario.name == 'FAST' ?
-                    //         t('feature.track_time_duration.reminders.enable_schedule_fast_content', { time: startTime }) :
-                    //         t('feature.track_time_duration.reminders.enable_schedule_sleep_content', { time: startTime }),
-                    //     showCancel: false,
-                    //     confirmText: t('feature.track_time_duration.reminders.ok')
-                    // })
                 }
                 else {
                     showAlert({
@@ -686,12 +677,6 @@ export default function Page() {
     global.popMixScheduleAlert = (time1, time2) => {
         if (process.env.TARO_ENV == 'weapp') {
             if (permission.wxPubFollow) {
-                // showAlert({
-                //     title: t('feature.track_time_duration.reminders.schedule_title'),
-                //     content: t('feature.track_time_duration.reminders.enable_schedule_mix_content', { time1: time1, time2: time2 }),
-                //     showCancel: false,
-                //     confirmText: t('feature.track_time_duration.reminders.ok')
-                // })
             }
             else {
                 showAlert({
@@ -713,12 +698,6 @@ export default function Page() {
             PushNotification.checkPermissions((res) => {
                 //允许授权
                 if (res.authorizationStatus == 2) {
-                    // showAlert({
-                    //     title: t('feature.track_time_duration.reminders.schedule_title'),
-                    //     content: t('feature.track_time_duration.reminders.enable_schedule_mix_content', { time1: time1, time2: time2 }),
-                    //     showCancel: false,
-                    //     confirmText: t('feature.track_time_duration.reminders.ok')
-                    // })
                 }
                 else {
                     showAlert({
@@ -801,8 +780,14 @@ export default function Page() {
     var timestamp = new Date().getTime()
 
     function render() {
+        var smallTitle = ''
+        const weekday = TimeFormatter.getDayOfWeek(new Date().getDay(), true);
+        const date = global.language == 'en' ? dayjs().format('MMMM DD') : dayjs().format('M月D日 ')
+        smallTitle = global.language == 'en' ? (weekday + ', ' + date) : (date + weekday);
+
+
         if (!loaded) {
-            return <Layout type={TemplateType.customHeader} header={headerView()} title={t('page.clock.title')} titleShowStyle={NaviBarTitleShowType.scrollToShow}>
+            return <Layout type={TemplateType.customHeader} header={headerView()} title={smallTitle} titleShowStyle={NaviBarTitleShowType.scrollToShow}>
                 <View style={{ width: rpxToPx(750), height: rpxToPx(900), display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
                     <AtActivityIndicator size={40} color="#fff" />
                     {
@@ -811,7 +796,7 @@ export default function Page() {
                 </View>
             </Layout>
         }
-        return <Layout type={TemplateType.customHeader} header={headerView()} title={t('page.clock.title')} titleShowStyle={NaviBarTitleShowType.scrollToShow}>
+        return <Layout type={TemplateType.customHeader} header={headerView()} title={smallTitle} titleShowStyle={NaviBarTitleShowType.scrollToShow}>
 
             <View className="index_container">
                 {
@@ -872,38 +857,33 @@ export default function Page() {
                     user.isLogin && <Streaks count={count} />
                 }
 
+
                 {
-                    user.isLogin && user.test_user && homeData && (homeData as any).access && <View style={{ display: 'flex', flexDirection: 'column' }}>
-                        <Text style={{ color: '#fff', fontSize: 15 }}>current status:{(homeData as any).access.current.qualification.status}</Text>
-                        <Text style={{ color: '#fff', fontSize: 15 }}>previous status:{(homeData as any).access.previous.qualification.status}</Text>
-                        <Text style={{ color: '#fff', fontSize: 15 }}>trigger event:{(homeData as any).access.current.qualification.trigger_event}</Text>
-                        <Text style={{ color: '#fff', fontSize: 15 }}>lost_access_total:{(homeData as any).access.current.qualification.condition.lost_access_total}</Text>
-                        <Text style={{ color: '#fff', fontSize: 15 }}>streak_fast_min_required:{(homeData as any).access.current.qualification.condition.streak_fast_min_required}</Text>
+                    user.isLogin && !showErrorPage && <View className="index_section" style={{height:rpxToPx(120)}}>
+                        <Text className="index_main_title">{t('feature.pro.for_pro')}</Text>
                     </View>
                 }
 
                 {
-                    !showErrorPage && <View className="index_section">
-                        <Text className="index_section_title">昼夜节律</Text>
+                    user.isLogin && !showErrorPage && <View className="index_section">
+                        <Text className="index_section_title">{t('feature.day_night.group_title')}</Text>
                     </View>
                 }
                 {
-                    !showErrorPage && <DayNightSwiper count={count} schedule={schedules} homeData={homeData} />
+                    user.isLogin && !showErrorPage && <DayNightSwiper count={count} schedule={schedules} homeData={homeData} />
                 }
 
                 {
-                    (process.env.TARO_ENV == 'weapp'||user.test_user) && <View className="index_section">
-                        <Text className="index_section_title">{t('page.explore.journal')}</Text>
+                    user.isLogin && (process.env.TARO_ENV == 'weapp'||true) && <View className="index_section">
+                        <Text className="index_section_title">{t('page.explore.title')}</Text>
                     </View>
                 }
 
                 {
-                    (process.env.TARO_ENV == 'weapp'||user.test_user) && <Discovery />
+                    user.isLogin && (process.env.TARO_ENV == 'weapp'||true) && <Discovery />
                 }
 
-                {
-                    process.env.TARO_ENV == 'weapp' && <View style={{ height: 100 }} />
-                }
+                
                 {
                     modalContent()
                 }
@@ -914,17 +894,22 @@ export default function Page() {
                 {
                     homeData && <DurationPicker record={(homeData as any).current_record} />
                 }
+
+                {
+                    user.isLogin && user.test_user && homeData && (homeData as any).access && <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <Text style={{ color: '#fff', fontSize: 15 }}>current status:{(homeData as any).access.current.qualification.status}</Text>
+                        <Text style={{ color: '#fff', fontSize: 15 }}>previous status:{(homeData as any).access.previous.qualification.status}</Text>
+                        <Text style={{ color: '#fff', fontSize: 15 }}>trigger event:{(homeData as any).access.current.qualification.trigger_event}</Text>
+                        <Text style={{ color: '#fff', fontSize: 15 }}>lost_access_total:{(homeData as any).access.current.qualification.condition.lost_access_total}</Text>
+                        <Text style={{ color: '#fff', fontSize: 15 }}>streak_fast_min_required:{(homeData as any).access.current.qualification.condition.streak_fast_min_required}</Text>
+                    </View>
+                }
+                {
+                    process.env.TARO_ENV == 'weapp' && <View style={{ height: 100 }} />
+                }
                 <Tabbar index={0} />
             </View>
         </Layout>
     }
-
-    // if (process.env.TARO_ENV == 'rn') {
-    //     return <ScrollView>
-    //         {
-    //             render()
-    //         }
-    //     </ScrollView>
-    // }
     return render()
 }

+ 1 - 1
src/pages/rn/RNMain.tsx

@@ -88,7 +88,7 @@ export default function RNMain() {
           tabBarActiveTintColor: 'white', // 活动标签的颜色
           tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
         })}>
-        <Tab.Screen name="Circadian" component={ClockPage} options={{
+        <Tab.Screen name="Home" component={ClockPage} options={{
           tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image

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

@@ -3,7 +3,7 @@ const online = process.env.TARO_ENV == 'rn' ? false : false;
 import { WX_VERSION as _WX_VERSION, APP_VERSION as _APP_VERSION } from "../../../config/env";
 
 // export const baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
-export const baseUrl = online ? 'https://api.pre.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
+export const baseUrl = online ? process.env.TARO_ENV == 'rn' ? 'https://api.app.fast.liveplus.fun' : 'https://api.pre.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 
 export const APP_VERSION = _APP_VERSION
 export const WX_VERSION = _WX_VERSION

+ 8 - 5
src/utils/check_authorized.tsx

@@ -11,7 +11,7 @@ if (process.env.TARO_ENV == 'rn') {
     // useNavigation = require("@react-navigation/native").useNavigation
 }
 export function checkAuthorized() {
-    
+
 
     if (process.env.TARO_ENV == 'weapp') {
         const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
@@ -24,11 +24,14 @@ export function checkAuthorized() {
                 }
                 clientInfo({
                     perm: {
-                        album: appAuthorizeSetting.albumAuthorized == 'authorized',
-                        camera: appAuthorizeSetting.cameraAuthorized == 'authorized',
-                        health: {
-                            wx_steps: allowWerun
+                        wxmp: {
+                            album: appAuthorizeSetting.albumAuthorized == 'authorized',
+                            camera: appAuthorizeSetting.cameraAuthorized == 'authorized',
+                            health: {
+                                wx_steps: allowWerun
+                            }
                         }
+
                     }
                 })
             }

+ 21 - 37
src/utils/native_permission_check.tsx

@@ -60,9 +60,14 @@ export const uploadPermissions = () => {
 
                 clientInfo({
                     perm: {
-                        camera: statuses[PERMISSIONS.ANDROID.CAMERA],
-                        location: statuses[PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION],
-                        notification: global.notification
+                        android: {
+                            camera: statuses[PERMISSIONS.ANDROID.CAMERA],
+                            location: {
+                                location: statuses[PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION]
+                            },
+                            notification: global.notification
+                        }
+
                     }
                 })
             })
@@ -73,46 +78,25 @@ export const uploadPermissions = () => {
     PERMISSIONS.IOS.PHOTO_LIBRARY,
     PERMISSIONS.IOS.LOCATION_WHEN_IN_USE,
     PERMISSIONS.IOS.LOCATION_ALWAYS]).then(statuses => {
-        if (global.notification == 'not_determined') {
+        //         getLocalPush()
+
+        var Jto = require('react-native').NativeModules.NativeBridge;
+        Jto.getLocationAuthStatus((res)=>{
             clientInfo({
                 perm: {
-                    album: statuses[PERMISSIONS.IOS.PHOTO_LIBRARY],
-                    camera: statuses[PERMISSIONS.IOS.CAMERA],
-                    location_always: statuses[PERMISSIONS.IOS.LOCATION_ALWAYS],
-                    location_when_in_use: statuses[PERMISSIONS.IOS.LOCATION_WHEN_IN_USE],
-                    notification: 'not_determined'
-                }
-            })
-        }
-        else {
-            PushNotification.checkPermissions((res)=>{
-                //允许授权
-                if (res.authorizationStatus == 2){
-                    getLocalPush()
-                    clientInfo({
-                        perm: {
-                            album: statuses[PERMISSIONS.IOS.PHOTO_LIBRARY],
-                            camera: statuses[PERMISSIONS.IOS.CAMERA],
-                            location_always: statuses[PERMISSIONS.IOS.LOCATION_ALWAYS],
-                            location_when_in_use: statuses[PERMISSIONS.IOS.LOCATION_WHEN_IN_USE],
-                            notification: 'authorized'
+                    ios: {
+                        album: statuses[PERMISSIONS.IOS.PHOTO_LIBRARY],
+                        camera: statuses[PERMISSIONS.IOS.CAMERA],
+                        location: res,
+                        notification: {
+                            authorization_status:global.notification
                         }
-                    })
-                }
-                else {
-                    clientInfo({
-                        perm: {
-                            album: statuses[PERMISSIONS.IOS.PHOTO_LIBRARY],
-                            camera: statuses[PERMISSIONS.IOS.CAMERA],
-                            location_always: statuses[PERMISSIONS.IOS.LOCATION_ALWAYS],
-                            location_when_in_use: statuses[PERMISSIONS.IOS.LOCATION_WHEN_IN_USE],
-                            notification: 'denied'
-                        }
-                    })
+                    }
                 }
             })
-        }
+        })
 
+        
     })
 }
 

+ 17 - 2
src/utils/time_format.ts

@@ -747,16 +747,31 @@ export class TimeFormatter {
 
   static tzNameToGMT = (timeZone: string) => {
     var minutes = 0
-    if (!timeZone || timeZone.length==0){
+    if (!timeZone || timeZone.length == 0) {
       minutes = dayjs().utcOffset()
     }
-    if (process.env.TARO_ENV=='weapp' || kIsIOS){
+    if (process.env.TARO_ENV == 'weapp' || kIsIOS) {
       minutes = dayjs().tz(timeZone).utcOffset()
     }
     else {
       var moment = require('moment-timezone');
       minutes = moment().tz(timeZone).utcOffset()
     }
+
+    const offsetHours = Math.abs(Math.floor(minutes / 60));
+    const offsetMinutesRemaining = Math.abs(minutes % 60);
+
+    // 构建 GMT 格式的字符串
+    let gmt = 'GMT';
+    if (minutes < 0) {
+      gmt += '+';
+    } else {
+      gmt += '-';
+    }
+
+    gmt += `${offsetHours.toString().padStart(2, '0')}:${offsetMinutesRemaining.toString().padStart(2, '0')}`;
+
+    return gmt;
   }
 
   static tzLocalTime = (timestamp: number, timeZone: string) => {

Някои файлове не бяха показани, защото твърде много файлове са промени