|
@@ -1,36 +1,97 @@
|
|
|
import React from 'react';
|
|
|
-import { Button, StyleSheet, View } from 'react-native';
|
|
|
+import {
|
|
|
+ Button,
|
|
|
+ Linking,
|
|
|
+ Platform,
|
|
|
+ ScrollView,
|
|
|
+ StyleSheet,
|
|
|
+ Text,
|
|
|
+ View,
|
|
|
+} from 'react-native';
|
|
|
import { StackScreenProps } from '@react-navigation/stack';
|
|
|
import { MainParamList } from '@app/routes/MainParamList';
|
|
|
import { Apps, NavigationPushByName } from '@common/NavigationHelper.ts';
|
|
|
import { showMessage } from '@common/ToastHelper.ts';
|
|
|
+import Alert from '@common/components/Alert.tsx';
|
|
|
+import { version_common } from '@common/common.ts';
|
|
|
|
|
|
type Props = StackScreenProps<MainParamList, 'MainView'>;
|
|
|
|
|
|
export default function WebViewScreen(props: Props) {
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
- <View style={{ height: 100 }} />
|
|
|
- <Button
|
|
|
- title={'进入互联网医院'}
|
|
|
- onPress={() => {
|
|
|
- NavigationPushByName(Apps.Hospital, {});
|
|
|
- }}
|
|
|
- />
|
|
|
- <View style={{ height: 15 }} />
|
|
|
- <Button
|
|
|
- title={'进入医网签'}
|
|
|
- onPress={() => {
|
|
|
- NavigationPushByName(Apps.Ywq, {});
|
|
|
- }}
|
|
|
- />
|
|
|
- <View style={{ height: 15 }} />
|
|
|
- <Button
|
|
|
- title={'Toast'}
|
|
|
- onPress={() => {
|
|
|
- showMessage('APP页面弹出toast');
|
|
|
- }}
|
|
|
- />
|
|
|
+ <ScrollView>
|
|
|
+ <>
|
|
|
+ <Text style={{ fontSize: 20, marginVertical: 15 }}>
|
|
|
+ 小程序跳转以及公共组件
|
|
|
+ </Text>
|
|
|
+ <Button
|
|
|
+ title={'进入互联网医院'}
|
|
|
+ onPress={() => {
|
|
|
+ NavigationPushByName(Apps.Hospital, {});
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <View style={{ height: 15 }} />
|
|
|
+ <Button
|
|
|
+ title={'进入医网签'}
|
|
|
+ onPress={() => {
|
|
|
+ NavigationPushByName(Apps.Ywq, {});
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <View style={{ height: 15 }} />
|
|
|
+ <Button
|
|
|
+ title={'Toast'}
|
|
|
+ onPress={() => {
|
|
|
+ showMessage('APP页面弹出toast');
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <View style={{ height: 45 }} />
|
|
|
+ <Button
|
|
|
+ title={'应用更新模拟'}
|
|
|
+ onPress={() => {
|
|
|
+ Alert.show(
|
|
|
+ '提示',
|
|
|
+ <Text style={styles.alertText}>
|
|
|
+ 有新版本可以更新,确定更新吗?
|
|
|
+ </Text>,
|
|
|
+ {
|
|
|
+ action: () => {
|
|
|
+ if (Platform.OS === 'ios') {
|
|
|
+ Linking.openURL(
|
|
|
+ 'https://apps.apple.com/cn/app/%E5%8C%BB%E7%BD%91%E4%BF%A1/id1074200788',
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Linking.openURL('https://www.51trust.com/download.html/');
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: () => {},
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <View style={{ height: 45 }} />
|
|
|
+ <Text>基础包版本号{version_common}</Text>
|
|
|
+ <Button
|
|
|
+ title={'基础包前台更新'}
|
|
|
+ onPress={() => {
|
|
|
+ Alert.show(
|
|
|
+ '提示',
|
|
|
+ <Text style={styles.alertText}>
|
|
|
+ 有新版本可以更新,确定更新吗?
|
|
|
+ </Text>,
|
|
|
+ {
|
|
|
+ action: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: () => {},
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ </ScrollView>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
@@ -39,4 +100,9 @@ const styles = StyleSheet.create({
|
|
|
container: {
|
|
|
flex: 1,
|
|
|
},
|
|
|
+ alertText: {
|
|
|
+ textAlign: 'center',
|
|
|
+ color: '#999999',
|
|
|
+ fontSize: 12,
|
|
|
+ },
|
|
|
});
|