Sfoglia il codice sorgente

Create "Guest Link" to lead to webapp_lite
https://dev.wormwood.com.sg/zentao/task-view-608.html

vbea 1 anno fa
parent
commit
e7fa727384
1 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  1. 11 1
      Strides-APP/app/pages/sign/Login.js

+ 11 - 1
Strides-APP/app/pages/sign/Login.js

@@ -13,6 +13,8 @@ import Dialog from '../../components/Dialog';
 import { PageList } from '../Router';
 import CheckBoxText from '../../components/CheckBoxText';
 import TextView from '../../components/TextView';
+import { Linking } from 'react-native';
+import app from "../../../app.json";
 
 export const AutoLogin = async (back) => {
   const data = await getStorageJsonSync('loginData')
@@ -118,7 +120,7 @@ export default class Login extends React.Component {
   }
 
   getBackTopPosition() {
-    return isIOS ? statusHeight : 4;
+    return statusHeight;
   }
 
   togglePassword() {
@@ -127,6 +129,10 @@ export default class Login extends React.Component {
     })
   }
 
+  startWebApp() {
+    Linking.openURL(app.product ? "​https://webapp.chargeco.global/" : "https://uat.chargeco.global/webapp")
+  }
+
   render() {
     return (
       <View style={ui.flex1}>
@@ -240,6 +246,10 @@ export default class Login extends React.Component {
           {/* <Text 
             style={styles.linksText}
             onPress={() => startPage(PageList.register, {isFleetUser: true})}>{$t('sign.registerDriverUser')}</Text> */}
+          <TextView style={{color: textPrimary, paddingTop: 12}}>Or</TextView>
+          <TextView 
+            style={styles.linksText}
+            onPress={() => this.startWebApp()}>Continue As Guest</TextView>
         </View>
       </ScrollView>
       </View>