leon 1 سال پیش
والد
کامیت
b5fddddce5

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
android/app/src/main/assets/index.android.bundle


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
android/app/src/main/assets/index.android.map


+ 52 - 0
android/app/src/main/java/com/hola/AlarmReceiver.java

@@ -1,5 +1,7 @@
 package com.hola;
 
+import static android.app.Notification.EXTRA_NOTIFICATION_ID;
+
 import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
@@ -19,6 +21,8 @@ public class AlarmReceiver extends BroadcastReceiver {
         String title = intent.getStringExtra("title");
         String message = intent.getStringExtra("message");
         String channel = intent.getStringExtra("channel");
+        String categoryId = intent.getStringExtra("categoryId");
+        String strId = intent.getStringExtra("id");
 
         Intent intent2 = new Intent(context, MainActivity.class);
         PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent2, PendingIntent.FLAG_IMMUTABLE);
@@ -30,6 +34,54 @@ public class AlarmReceiver extends BroadcastReceiver {
                 .setPriority(NotificationCompat.PRIORITY_DEFAULT)
                 .setContentIntent(pendingIntent);
 
+        assert categoryId != null;
+        if (categoryId.equals("REMINDER_FS_START_FAST")||
+            categoryId.equals("REMINDER_FS_START_SLEEP")
+        ){
+            Intent openAppIntent = new Intent(context, MainActivity.class);
+            openAppIntent.setAction("START_TIMER_NOW");
+            openAppIntent.putExtra("id",strId);
+            openAppIntent.putExtra("category_id",categoryId);
+            PendingIntent openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_IMMUTABLE);
+            builder.addAction(0, "Start timer now with 1-tap", openAppPendingIntent);
+
+            Intent openAppIntent2 = new Intent(context, MainActivity.class);
+            openAppIntent2.setAction("PICK_EARLIER_START");
+            openAppIntent2.putExtra("id",strId);
+            openAppIntent2.putExtra("category_id",categoryId);
+            PendingIntent openAppPendingIntent2 = PendingIntent.getActivity(context, 0, openAppIntent2, PendingIntent.FLAG_IMMUTABLE);
+            builder.addAction(0, "Pick an earlier start", openAppPendingIntent2);
+        }
+
+        if (categoryId.equals("REMINDER_FS_END_FAST")||
+                categoryId.equals("REMINDER_FS_END_SLEEP")
+        ){
+            Intent openAppIntent = new Intent(context, MainActivity.class);
+            openAppIntent.setAction("END_TIMER_NOW");
+            openAppIntent.putExtra("id",strId);
+            openAppIntent.putExtra("category_id",categoryId);
+            PendingIntent openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_IMMUTABLE);
+            builder.addAction(0, "End timer now with 1-tap", openAppPendingIntent);
+
+            Intent openAppIntent2 = new Intent(context, MainActivity.class);
+            openAppIntent2.setAction("PICK_EARLIER_END");
+            openAppIntent2.putExtra("id",strId);
+            openAppIntent2.putExtra("category_id",categoryId);
+            PendingIntent openAppPendingIntent2 = PendingIntent.getActivity(context, 0, openAppIntent2, PendingIntent.FLAG_IMMUTABLE);
+            builder.addAction(0, "Pick an earlier end", openAppPendingIntent2);
+        }
+
+//        // 添加自定义按钮
+//        Intent openAppIntent = new Intent(context, MainActivity.class);
+//        openAppIntent.setAction("OPEN_APP");
+//        PendingIntent openAppPendingIntent = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_IMMUTABLE);
+//        builder.addAction(0, "Start timer now with 1-tap", openAppPendingIntent);
+//
+//        Intent openAppIntent2 = new Intent(context, MainActivity.class);
+//        openAppIntent2.setAction("OPEN_APP");
+//        PendingIntent openAppPendingIntent2 = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_IMMUTABLE);
+//        builder.addAction(0, "Pick an earlier start", openAppPendingIntent2);
+
         // 显示通知
         NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
         notificationManager.notify(0, builder.build());

+ 70 - 9
android/app/src/main/java/com/hola/HolaModule.java

@@ -22,8 +22,15 @@ import com.facebook.react.bridge.Callback;
 import com.facebook.react.bridge.ReactApplicationContext;
 import com.facebook.react.bridge.ReactContextBaseJavaModule;
 import com.facebook.react.bridge.ReactMethod;
+import com.facebook.react.bridge.ReadableArray;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Arrays;
 import java.util.Calendar;
+import java.util.List;
 
 public class HolaModule extends ReactContextBaseJavaModule {
     private static final String CHANNEL_ID = "local_notification_channel";
@@ -67,14 +74,68 @@ public class HolaModule extends ReactContextBaseJavaModule {
     }
 
     @ReactMethod
-    public void addLocalPush(String title,String content,String time){
+    public void addLocalPush(String jsonData){
+        if (getCurrentActivity()==null){
+            return;
+        }
+        try {
+            JSONArray jsonArray = new JSONArray(jsonData);
+            for (int i = 0; i < jsonArray.length(); i++) {
+                JSONObject jsonObject = jsonArray.getJSONObject(i);
+                String mode = jsonObject.getString("mode");
+                String title = jsonObject.getString("title");
+                String body = jsonObject.getString("body");
+                String strId = jsonObject.getString("id");
+                String categoryId = jsonObject.getString("category_id");
+
+                createNotificationChannel(getCurrentActivity(),strId);
+                Intent intent = new Intent(getCurrentActivity(), AlarmReceiver.class);
+                intent.putExtra("title", title);
+                intent.putExtra("message", body);
+                intent.putExtra("channel", CHANNEL_ID);
+                intent.putExtra("id",strId);
+                intent.putExtra("categoryId",categoryId);
+
+                PendingIntent pendingIntent = PendingIntent.getBroadcast(
+                        getCurrentActivity(), 0, intent, android.app.PendingIntent.FLAG_IMMUTABLE);
+
+                AlarmManager alarmManager = (AlarmManager) getCurrentActivity().getSystemService(Context.ALARM_SERVICE);
+                if (mode.equals("ONCE")){
+                    alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+10*1000,pendingIntent);
+                }
+                else {
+                    JSONObject recurring = jsonObject.getJSONObject("recurring");
+                    String time = recurring.getString("time");
+                    String[] parts = time.split(":");
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTimeInMillis(System.currentTimeMillis());
+                    calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parts[0]));
+                    calendar.set(Calendar.MINUTE, Integer.parseInt(parts[1]));
+                    calendar.set(Calendar.SECOND,Integer.parseInt(parts[2]));
+
+                    // 如果当前时间已经超过 设定时间,则设置为明天
+                    if (calendar.getTimeInMillis() <= System.currentTimeMillis()) {
+                        calendar.add(Calendar.DAY_OF_YEAR, 1);
+                    }
+                    alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
+                        AlarmManager.INTERVAL_DAY, pendingIntent);
+
+                }
+
+            }
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @ReactMethod
+    public void addLocalPush2(String title,String content,String time){
         if (getCurrentActivity()==null){
             return;
         }
         String[] parts = time.split(":");
-        Log.e("Hello","world");
-        System.out.println("Hello, " + title + "!");
-        createNotificationChannel(getCurrentActivity());
+
+        createNotificationChannel(getCurrentActivity(),"111");
         Intent intent = new Intent(getCurrentActivity(), AlarmReceiver.class);
         intent.putExtra("title", title);
         intent.putExtra("message", content);
@@ -97,14 +158,14 @@ public class HolaModule extends ReactContextBaseJavaModule {
 
         // 4. 使用 AlarmManager 调度通知
         AlarmManager alarmManager = (AlarmManager) getCurrentActivity().getSystemService(Context.ALARM_SERVICE);
-//        alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+10*1000,pendingIntent);
-        alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
-                AlarmManager.INTERVAL_DAY, pendingIntent);
+        alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+10*1000,pendingIntent);
+//        alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
+//                AlarmManager.INTERVAL_DAY, pendingIntent);
     }
 
-    private void createNotificationChannel(Context context) {
+    private void createNotificationChannel(Context context,String channelId) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-            NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
+            NotificationChannel channel = new NotificationChannel(channelId, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
             channel.setDescription(CHANNEL_DESCRIPTION);
 
             NotificationManager notificationManager = context.getSystemService(NotificationManager.class);

+ 31 - 0
android/app/src/main/java/com/hola/MainActivity.java

@@ -7,7 +7,9 @@ import android.content.Context;
 import android.content.Intent;
 import android.graphics.Color;
 import android.os.Build;
+import android.os.Bundle;
 import android.os.SystemClock;
+import android.util.Log;
 
 import androidx.core.app.NotificationCompat;
 
@@ -16,6 +18,9 @@ import expo.modules.ReactActivityDelegateWrapper;
 import com.facebook.react.ReactActivity;
 import com.facebook.react.ReactActivityDelegate;
 import com.facebook.react.ReactRootView;
+import com.facebook.react.bridge.Arguments;
+import com.facebook.react.bridge.WritableMap;
+import com.facebook.react.modules.core.DeviceEventManagerModule;
 
 import java.util.Calendar;
 
@@ -40,6 +45,32 @@ public class MainActivity extends ReactActivity {
    * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
    * (Paper).
    */
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState){
+    super.onCreate(null);
+  }
+
+  @Override
+  public void onNewIntent(Intent intent) {
+    super.onNewIntent(intent);
+    if ("START_TIMER_NOW".equals(intent.getAction())||
+            "PICK_EARLIER_START".equals(intent.getAction())||
+            "END_TIMER_NOW".equals(intent.getAction())||
+            "PICK_EARLIER_END".equals(intent.getAction())
+    ) {
+      WritableMap payload = Arguments.createMap();
+      payload.putString("category_id",intent.getStringExtra("category_id"));
+      payload.putString("action_id",intent.getAction());
+      payload.putString("id",intent.getStringExtra("id"));
+      //category_id, action_id,id
+      getReactInstanceManager().
+              getCurrentReactContext().
+              getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).
+              emit("notificationReceive",payload);
+    }
+  }
+
   @Override
   protected ReactActivityDelegate createReactActivityDelegate() {
     return new ReactActivityDelegateWrapper(this, new MainActivityDelegate(this, getMainComponentName()));

BIN
android/app/src/main/res/drawable-mdpi/src_assets_images_day_three_ring.png


BIN
android/app/src/main/res/drawable-mdpi/src_assets_images_night_three_ring.png


+ 1 - 1
config/env.ts

@@ -1,3 +1,3 @@
 
-export const APP_VERSION = '1.0.1'
+export const APP_VERSION = '1.0.0'
 export const WX_VERSION = '1.4.3'

+ 1 - 1
ios/AppDelegate.mm

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

+ 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 = 38;
+				CURRENT_PROJECT_VERSION = 68;
 				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 = 38;
+				CURRENT_PROJECT_VERSION = 68;
 				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",

+ 4 - 4
ios/hola/Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.1</string>
+	<string>1.0.0</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>68</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>
@@ -63,13 +63,13 @@
 	<key>NSMicrophoneUsageDescription</key>
 	<string>Allow $(PRODUCT_NAME) to access your microphone</string>
 	<key>NSMotionUsageDescription</key>
-	<string>Allow $(PRODUCT_NAME) to access your device&apos;s accelerometer</string>
+	<string>Allow $(PRODUCT_NAME) to access your device's accelerometer</string>
 	<key>NSPhotoLibraryAddUsageDescription</key>
 	<string>So you can add or update your profile picture, which helps you stand out on the upcoming Community Leaderboard.</string>
 	<key>NSPhotoLibraryUsageDescription</key>
 	<string>So you can add or update your profile picture, which helps you stand out on the upcoming Community Leaderboard.</string>
 	<key>NSUserNotificationsUsageDescription</key>
-	<string>You&apos;ll get reminders at scheduled times.</string>
+	<string>You'll get reminders at scheduled times.</string>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>
 	<key>UIRequiredDeviceCapabilities</key>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
ios/main.jsbundle


+ 2 - 1
src/components/input/Inputs.tsx

@@ -59,7 +59,8 @@ export default function Component({
                     onChangeText={(e)=>{
                         onChange(e)
                     }}
-                    placeholderStyle='color:#ffffff66'
+                    placeholderTextColor="#ffffff99"
+                    placeholderStyle='color:#ffffffCC'
                     focus={autoFocus}
                     confirmType="done"
                     selectionColor={global.fastColor ? global.fastColor : ColorType.fast}

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

@@ -366,11 +366,12 @@ export default {
                 input_username_placeholder: 'Username',
                 input_email_placeholder: 'Email',
                 footer_desc: 'Already have an account?',
-                footer_login: 'Go to login',
-                btn_next: 'Next'
+                footer_login: 'Log in',
+                btn_next: 'Next',
+                login:'Log in'
             },
             login: {
-                input_account_placeholder: 'Username or email',
+                input_account_placeholder: 'Username',
                 input_password_placeholder: 'Password',
                 footer_desc: 'Don\'t have an account?',
                 footer_sign_up: 'Sign up',

+ 2 - 1
src/context/locales/zh.js

@@ -372,7 +372,8 @@ export default {
                 input_email_placeholder: '邮箱',
                 footer_desc: '已有账号?',
                 footer_login: '去登录',
-                btn_next: '下一步'
+                btn_next: '下一步',
+                login:'登录'
             },
             login: {
                 input_account_placeholder: '用户名或邮箱',

+ 1 - 1
src/features/auth/components/CreateAccount.tsx

@@ -252,7 +252,7 @@ export default function Component(props: { login: () => void }) {
     <View style={{ flex: 1 }} />
     <View className="footer">
       <Text className="have_account">{t('feature.auth.create_account.footer_desc')}</Text>
-      <Text className="login2" onClick={() => props.login()}>{t('feature.auth.create_account.footer_login')}</Text>
+      <Text className="login2" onClick={() => props.login()}> {t('feature.auth.create_account.footer_login')}</Text>
     </View>
   </View>
 }

+ 2 - 2
src/features/auth/components/login.tsx

@@ -162,7 +162,7 @@ export default function Login(props: { register: () => void }) {
         }
         <Buttons
             onClick={LoginF}
-            title={t('feature.auth.create_account.btn_next')}
+            title={t('feature.auth.create_account.login')}
             btnStyle={{ marginLeft: 23, marginRight: 23, marginTop: 20, marginBottom: 20, height: 44, borderRadius: 22, backgroundColor: ColorType.fast }}
             disabled={isLoginButtonDisabled || !checked}></Buttons>
 
@@ -181,7 +181,7 @@ export default function Login(props: { register: () => void }) {
         <View style={{ flex: 1 }} />
         <View className="footer">
             <Text className="have_account">{t('feature.auth.login.footer_desc')}</Text>
-            <Text className="login2" onClick={() => props.register()}>{t('feature.auth.login.footer_sign_up')}</Text>
+            <Text className="login2" onClick={() => props.register()}> {t('feature.auth.login.footer_sign_up')}</Text>
         </View>
     </View>
 

+ 43 - 30
src/features/trackTimeDuration/actions/TrackTimeActions.tsx

@@ -15,7 +15,7 @@ if (process.env.TARO_ENV == 'rn') {
 }
 
 export const startFast = (start_time: number, duration: number) => {
-    return new Promise((resolve,reject) => {
+    return new Promise((resolve, reject) => {
         // duration = duration < 3600 * 1000 ? 3600 * 1000 : duration;
         const extra = {
             set_time: global.set_time,
@@ -30,7 +30,7 @@ export const startFast = (start_time: number, duration: number) => {
             resolve(res)
             trackTimeService.send({ type: 'START_FAST' });
             // getLocalPush()
-        }).catch(e=>{
+        }).catch(e => {
             reject(e)
         });
     });
@@ -98,7 +98,7 @@ export const endSleep = (start_time: number) => {
             reject(e)
         });
     });
-} 
+}
 
 export const uploadLocalPushInfo = (params) => {
     request({
@@ -111,12 +111,14 @@ export const uploadLocalPushInfo = (params) => {
 
 export const getLocalPush = () => {
     if (process.env.TARO_ENV == 'rn') {
-        PushNotification.checkPermissions((res)=>{
+        console.log('leon aaaaa')
+        PushNotification.checkPermissions((res) => {
             //允许授权
-            if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)){
+            if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)) {
                 request({
                     url: API_LOCAL_PUSHES, method: 'GET', data: {}
                 }).then(res => {
+                    console.log('leon aaaaavvv', res)
                     const { messages } = res as any;
                     if (messages.length == 0) {
                         return;
@@ -125,30 +127,35 @@ export const getLocalPush = () => {
                         onRegister: function (token) {
                             console.log('TOKEN:', token);
                         },
-        
+
                         onNotification: function (notification) {
                             console.log('NOTIFICATION:', notification);
                             // notification.finish(PushNotificationIOS.FetchResult.NoData);
                         },
-        
+
                         permissions: {
                             alert: true,
                             badge: true,
                             sound: true,
                         },
-        
+
                         popInitialNotification: true,
                         requestPermissions: true,
                     });
                     PushNotification.cancelAllLocalNotifications()
-        
+
                     if (kIsIOS) {
                         var Jto = require('react-native').NativeModules.NativeBridge;
                         Jto.addLocalPush(messages)
                         return;
                     }
-        
-        
+                    else {
+                        const { HolaModule } = NativeModules
+                        HolaModule.addLocalPush(JSON.stringify(messages))
+                        return;
+                    }
+
+
                     messages.map((item, index) => {
                         if (kIsIOS) {
                             setTimeout(() => {
@@ -167,27 +174,33 @@ export const getLocalPush = () => {
                                 vibrate: true, // (optional) default: true. Creates the default vibration pattern if true.
                             }, (created) => {
                                 if (item.mode == 'ONCE') {
-                                    PushNotification.localNotificationSchedule({
-                                        //... You can use all the options from localNotifications
-                                        channelId: item.id,
-                                        title: item.title,
-                                        message: item.body + '\nPress for actions >>', // (required)
-                                        // date:new Date(new Date().getTime()+10*1000),
-                                        date: new Date(item.once), // in 60 secs
-                                        allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
-                                        messageId: item.id,
-                                        // repeatType:'minute',
-                                        /* Android Only Properties */
-        
-                                    })
+                                    console.log('leon 9528')
+                                    if (new Date().getTime() <= item.once) {
+                                        console.log('leon 9529')
+                                        PushNotification.localNotificationSchedule({
+                                            //... You can use all the options from localNotifications
+                                            channelId: item.id,
+                                            title: item.title,
+                                            message: item.body,// + '\nPress for actions >>', // (required)
+                                            date: new Date(new Date().getTime() + 10 * 1000),
+                                            // date: new Date(item.once), // in 60 secs
+                                            allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
+                                            messageId: item.id,
+                                            // repeatType:'minute',
+                                            /* Android Only Properties */
+
+                                        })
+                                    }
+
                                 }
                                 else if (item.mode == 'RECURRING') {
+                                    console.log('leon 9527')
                                     const { time, repeat_type } = item.recurring;
                                     const date = dayjs().format('YYYY-MM-DD')
                                     const { HolaModule } = NativeModules
-                                    HolaModule.addLocalPush(item.title, item.body+ '\nPress for actions >>', time)
+                                    HolaModule.addLocalPush(item.title, item.body + '\nPress for actions >>', time)
                                     return;
-        
+
                                     PushNotification.localNotificationSchedule({
                                         //... You can use all the options from localNotifications
                                         channelId: item.id,
@@ -199,19 +212,19 @@ export const getLocalPush = () => {
                                         repeatType: repeat_type,
                                         // repeatType:'minute',
                                         /* Android Only Properties */
-        
+
                                     })
                                 }
                             })
                         }
-        
+
                     })
-        
+
                     console.log('notificatin push set', messages)
                 })
             }
         });
-        
+
     }
 
 }

+ 56 - 56
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -76,69 +76,69 @@ export default function IndexConsole(props: { record: any, count: number }) {
     useEffect(() => {
         if (process.env.TARO_ENV == 'rn') {
             // console.error('current status',status)
+            var NativeAppEventEmitter = require('react-native').NativeAppEventEmitter;
+            if (nativePushListener){
+                (nativePushListener as any).remove()
+            }
             if (kIsIOS) {
                 var Jto = require('react-native').NativeModules.NativeBridge;
-                var NativeAppEventEmitter = require('react-native').NativeAppEventEmitter;
                 Jto.getNotificationAuthStatus()
-                if (nativePushListener){
-                    (nativePushListener as any).remove()
-                }
-                nativePushListener = NativeAppEventEmitter.addListener('notificationReceive', (data) => {
-                    console.log('notification receive action', data)
-                    const { category_id, action_id,id } = data
-                    uploadLocalPushInfo({
-                        messageId:id
-                    })
-                    switch (action_id) {
-                        case 'START_TIMER_NOW':
-                            {
-                                if (category_id == 'REMINDER_FS_START_FAST'){
-                                    operateType = 'startFast'
-                                }
-                                else {
-                                    operateType = 'startSleep'
-                                }
-                                global.set_time = new Date().getTime()
-                                pickerConfirm(new Date().getTime())
+            }
+            nativePushListener = NativeAppEventEmitter.addListener('notificationReceive', (data) => {
+                console.log('notification receive action', data)
+                const { category_id, action_id,id } = data
+                uploadLocalPushInfo({
+                    messageId:id
+                })
+                switch (action_id) {
+                    case 'START_TIMER_NOW':
+                        {
+                            if (category_id == 'REMINDER_FS_START_FAST'){
+                                operateType = 'startFast'
                             }
-                            break;
-                        case 'PICK_EARLIER_START':
-                            {
-                                if (category_id == 'REMINDER_FS_START_FAST'){
-                                    tapStartFast(null)
-                                }
-                                else {
-                                    tapStartSleep(null)
-                                }
+                            else {
+                                operateType = 'startSleep'
                             }
-                            break;
-                        case 'END_TIMER_NOW':
-                            {
-                                if (category_id == 'REMINDER_FS_END_FAST'){
-                                    operateType = 'endFast'
-                                }
-                                else {
-                                    operateType = 'endSleep'
-                                }
-                                global.set_time = new Date().getTime()
-                                pickerConfirm(new Date().getTime())
+                            global.set_time = new Date().getTime()
+                            pickerConfirm(new Date().getTime())
+                        }
+                        break;
+                    case 'PICK_EARLIER_START':
+                        {
+                            if (category_id == 'REMINDER_FS_START_FAST'){
+                                tapStartFast(null)
                             }
-                            break;
-                        case 'PICK_EARLIER_END':
-                            {
-                                if (category_id == 'REMINDER_FS_END_FAST'){
-                                    tapEndFast(null)
-                                }
-                                else {
-                                    tapEndSleep(null)
-                                }
+                            else {
+                                tapStartSleep(null)
                             }
-                            break;
-                        case 'SKIP':
-                            break;
-                    }
-                })
-            }
+                        }
+                        break;
+                    case 'END_TIMER_NOW':
+                        {
+                            if (category_id == 'REMINDER_FS_END_FAST'){
+                                operateType = 'endFast'
+                            }
+                            else {
+                                operateType = 'endSleep'
+                            }
+                            global.set_time = new Date().getTime()
+                            pickerConfirm(new Date().getTime())
+                        }
+                        break;
+                    case 'PICK_EARLIER_END':
+                        {
+                            if (category_id == 'REMINDER_FS_END_FAST'){
+                                tapEndFast(null)
+                            }
+                            else {
+                                tapEndSleep(null)
+                            }
+                        }
+                        break;
+                    case 'SKIP':
+                        break;
+                }
+            })
         }
     }, [props.record])
 

+ 4 - 1
src/features/trackTimeDuration/components/WeekCalendar.scss

@@ -45,7 +45,10 @@
     color: #fff;
     font-weight: bold;
     font-size: 20px;
-    line-height: 32px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    // line-height: 32px;
     margin-left: 46px;
     letter-spacing: 0;
 }

+ 19 - 0
src/pages/account/Auth.tsx

@@ -2,8 +2,14 @@ import Taro, { useRouter } from "@tarojs/taro";
 import Auth1 from "@features/auth/components/Auth";
 import CreatePassword from "@features/auth/components/CreatePassword";
 import { View } from "@tarojs/components";
+import { useEffect } from "react";
 
 
+let useNavigation;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
 export default function Page(props) {
     const router = useRouter();
 
@@ -11,6 +17,19 @@ export default function Page(props) {
     if (props.route && props.route.params){
         type = props.route.params.type
     }
+
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+    useEffect(()=>{
+        if (navigation) {
+            navigation.setOptions({
+                headerTitle: '',
+            });
+        }
+    },[])
     
     return <View>{
         type === 'createPassword' ? <CreatePassword /> : <Auth1/>

+ 6 - 0
src/pages/account/ChooseAuth.tsx

@@ -19,6 +19,7 @@ if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
 }
 
+
 export default function Page() {
     const [btnDisable, setBtnDisable] = useState(false)
     const [code, setCode] = useState('')
@@ -32,6 +33,11 @@ export default function Page() {
     }
 
     useEffect(() => {
+        if (navigation) {
+            navigation.setOptions({
+                headerTitle: '',
+            });
+        }
         if (user.isLogin) {
             if (user.is_new_user) {
                 console.log('new user')

+ 6 - 0
src/pages/clock/ClockMain.tsx

@@ -302,9 +302,15 @@ export default function Page() {
     }
 
     useDidShow(() => {
+
         if (process.env.TARO_ENV == 'weapp') {
             checkTimeZone()
         }
+        else {
+            if (!kIsIOS){
+                updateNotificationStatus()
+            }
+        }
 
         setCount(pre => pre + 1)
         //resume timer

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

@@ -1,4 +1,4 @@
-const online = process.env.TARO_ENV == 'rn' ? false : false;
+const online = process.env.TARO_ENV == 'weapp' ? false : false;
 
 import { WX_VERSION as _WX_VERSION, APP_VERSION as _APP_VERSION } from "../../../config/env";
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است