Leon 1 jaar geleden
bovenliggende
commit
e45ea99682
5 gewijzigde bestanden met toevoegingen van 21 en 19 verwijderingen
  1. 1 1
      ios/AppDelegate.mm
  2. 0 0
      ios/main.jsbundle
  3. 7 9
      src/app.tsx
  4. 6 4
      src/pages/clock/Clock.tsx
  5. 7 5
      src/utils/tools.ts

+ 1 - 1
ios/AppDelegate.mm

@@ -119,7 +119,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"];

File diff suppressed because it is too large
+ 0 - 0
ios/main.jsbundle


+ 7 - 9
src/app.tsx

@@ -129,21 +129,19 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
       global.token = JSON.parse(userData).token
       // dispatch(getInfoSuccess(JSON.parse(userData)));
     }
+    
+
+    
   }
 
   async function loadRNCache() {
-    // var showDayRing = await getStorage('showDayRing') || false;
-    // var showNightRing = await getStorage('showNightRing') || false;
-    // dispatch(showDay(showDayRing))
-    // dispatch(showNight(showNightRing))
-    // var gps = await getStorage('gps')
-    // if (gps) {
-    //   global.locationDetail = JSON.parse(gps)
-    // }
     var userData = await getStorage('userData')
     if (userData) {
       global.token = JSON.parse(userData).token
-      // dispatch(getInfoSuccess(JSON.parse(userData)));
+    }
+    else {
+      //测试直接登录
+      global.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhY2NvdW50Iiwic3ViIjoiMTE0Nzg0NGE5NDIyODk1MmE5Zjc2OTdjYWJjYmU3Y2UiLCJpc3MiOiJmYXN0Iiwibmlja25hbWUiOiJGYXN0ZXIiLCJ0eXAiOiJCZWFyZXIiLCJzZXNzaW9uX3N0YXRlIjoiZWQxMGY5Yzk1YjcxMjdhZThlZjU5ZDI4MTFlNWI1MWUiLCJleHAiOjE3NDY2NzIyMDYsImlhdCI6MTcxNTEzNjIwNn0.fbVPua1K9eDteWqrDBjaB8l8MrchwCp_JiuwQ222wU0'
     }
   }
 

+ 6 - 4
src/pages/clock/Clock.tsx

@@ -130,10 +130,6 @@ export default function Page() {
         //         content: new Date().toString()
         //     })
         // }
-        if (process.env.TARO_ENV == 'rn') {
-            const test = require('@/utils/push').default
-            test()
-        }
         dispatch(staticResources() as any);
         timer = setInterval(() => {
             var now = new Date()
@@ -522,9 +518,15 @@ export default function Page() {
             global.locationDetail = JSON.parse(gps)
         }
         var userData = await getStorage('userData')
+        console.log(userData)
         if (userData) {
             dispatch(getInfoSuccess(JSON.parse(userData)));
         }
+        //测试直接登录
+        else {
+            userData = '{"metrics_times":0,"ongoing":false,"id":"fe6641e66a0e411937a52511e19851cd","mobile_bind":false,"mobile":"","avatar":"https://api.fast.dev.liveplus.fun/api/avatars/fast_441b5a21.svg","nickname":"fast_441b5a21","type":"GENERAL","lv":1,"invite_code":"LVQ5","input_invite_code":true,"reg_time":1712838856000,"login_bind":{"wx":false,"wx_mp":false,"wx_pub":false,"qq":false,"weibo":false},"test_user":true,"manager_user":false,"web_user":false,"rjv_balance":0,"day_level":1,"scenario_select_count":77,"push_enabled":false,"is_new_user":true,"lang":"en","timezone":{},"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhY2NvdW50Iiwic3ViIjoiZmU2NjQxZTY2YTBlNDExOTM3YTUyNTExZTE5ODUxY2QiLCJpc3MiOiJmYXN0Iiwibmlja25hbWUiOiJmYXN0XzQ0MWI1YTIxIiwidHlwIjoiQmVhcmVyIiwic2Vzc2lvbl9zdGF0ZSI6IjA0NTcxOGYzN2Y5NTYzYjcxMTNkMWZhODI5NmE2MjQ2IiwiZXhwIjoxNzQ2Njg4NTYxLCJpYXQiOjE3MTUxNTI1NjF9.x1CguOILCTjT8lKcEdSEeuS9ACc5QK2G4Rxmcz9OMLQ","need_improve":false}'
+            dispatch(getInfoSuccess(JSON.parse(userData)));
+        }
     }
 
 

+ 7 - 5
src/utils/tools.ts

@@ -103,7 +103,7 @@ export function getTimezone() {
     return timeZoneFormatted;
 }
 
-export function getTimezoneName(){
+export function getTimezoneName() {
     var split = new Date().toString().split('(');
     if (split.length < 2) {
         return '';
@@ -111,7 +111,7 @@ export function getTimezoneName(){
     return split[1].split(')')[0];
 }
 
-export  function getTimezoneId(){
+export function getTimezoneId() {
     if (process.env.TARO_ENV == 'weapp') {
         if (Taro.getSystemInfoSync().platform == 'ios') {
             return dayjs.tz.guess()
@@ -119,8 +119,10 @@ export  function getTimezoneId(){
         return '';
     }
     else {
-        return 'Asia/Shanghai'
-        // var getTimeZone = require('react-native-localize').getTimeZone
-        // return getTimeZone()
+        if (Taro.getSystemInfoSync().platform == 'ios') {
+            return dayjs.tz.guess()
+        }
+        var getTimeZone = require('react-native-localize').getTimeZone
+        return getTimeZone()
     }
 }

Some files were not shown because too many files changed in this diff