Leon преди 2 години
родител
ревизия
de6f81924c

+ 1 - 1
config/index.ts

@@ -77,7 +77,7 @@ const config = {
     }
   },
   rn: {
-    appName: 'hola',
+    appName: 'taroDemo',
     alias: {
       '@': path.resolve(__dirname, '..', 'src'), // 这样配置后 @ 可以指向 src 目录
       '@components': path.resolve(__dirname, '../src/components'),

+ 1 - 1
ios/hola/AppDelegate.mm

@@ -44,7 +44,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 #endif
 
   NSDictionary *initProps = [self prepareInitialProps];
-  UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"hola" initialProperties:initProps];
+  UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"taroDemo" initialProperties:initProps];
 
   if (@available(iOS 13.0, *)) {
     rootView.backgroundColor = [UIColor systemBackgroundColor];

+ 1 - 0
src/components/Inputs.tsx

@@ -31,6 +31,7 @@ export default function Component({
                 value={inputValue}
                 type={isSecure ? 'password' : 'text'}
                 onInput={handleInputChange}
+                selectionColor='#AAFF00'
                 disabled={disabled?disabled:false}
                 onFocus={() => {
                     setIsFocus(true)

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

@@ -52,7 +52,7 @@ export default function Component(props:{login:()=>void}) {
   }
 
 
-  return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100vw', height: '100vh' }}>
+  return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100%', height: '100%' }}>
     <Texts text={t('feature.auth.create_account.title')} type={TextType.primary}></Texts>
     <Texts text={t('feature.auth.create_account.sub_title')} type={TextType.secondary}></Texts>
     <Box child={signupComponent()}></Box>

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

@@ -62,7 +62,7 @@ export default function Login(props: { register: () => void }) {
         dispatch(login(name, password) as any);
     }
 
-    return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100vw', height: '100vh' }}>
+    return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100%', height: '100%' }}>
         <Texts text={'App Name'} type={TextType.primary}></Texts>
         {/* <Texts text={t('feature.auth.create_account.sub_title')} type={TextType.secondary}></Texts> */}
         <Box child={loginComponent()}></Box>

+ 7 - 5
src/pages/ChooseAuth.tsx

@@ -32,11 +32,13 @@ export default function Page() {
     }, [user.isLogin])
 
     useReady(() => {
-        Taro.login().then(res => {
-            code = res.code;
-            // dispatch(wxLogin({code:res.code}) as any);
-
-        })
+        if (process.env.TARO_ENV === 'weapp'){
+            Taro.login().then(res => {
+                code = res.code;
+    
+            })
+        }
+        
     })
 
     async function login() {