Commit b9230dce by leiyongsheng

添加用户信息模块

parent d36685e1
android @ e108a7d9
Subproject commit 1b110e079ac8e510cbb513b122c95ed9c1328958
Subproject commit e108a7d998fec6596b0dfdc572b478779f3f3f73
......@@ -11,6 +11,7 @@ import { IC_LAUNCHER, IC_WARN } from '../assets/images'
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { BMCInfo, BMCUI } from './ui.js'
function LogoTitle(props) {
return (
......@@ -91,6 +92,9 @@ function TabHome() {
}
class HomeScreen extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.navigation.setParams({
itemId: 87,
......@@ -101,6 +105,30 @@ class HomeScreen extends React.Component {
componentWillUnmount() {
console.log('HomeScreen componentWillUnmount:' + JSON.stringify(this.props.route.params));
}
showAppInfo() {
BMCInfo.getUserInfo((result) => {
console.log("获取用户信息,结果为:" + result);
BMCUI.showConfirmDialog(result, '确定', (result) => {
console.log("你点击了取确定按钮,结果为:" + result);
})
})
}
showLoginInfo() {
BMCInfo.getLoginInfo((result) => {
console.log("获取登录信息,结果为:" + result);
BMCUI.showConfirmDialog(result, '确定', (result) => {
console.log("你点击了取确定按钮,结果为:" + result);
})
})
}
showDevicesInfo() {
BMCInfo.getDeviceInfo((result) => {
console.log("获取设备信息,结果为:" + result);
BMCUI.showConfirmDialog(result, '确定', (result) => {
console.log("你点击了取确定按钮,结果为:" + result);
})
})
}
render() {
console.log('HomeScreen path:' + this.props.path);
const { itemId } = this.props.route.params;
......@@ -135,6 +163,18 @@ class HomeScreen extends React.Component {
onPress={() => this.props.navigation.setOptions({ title: 'Updated!' })}
/>
<Text style={{ margin: 10 }}>result data: {this.props.route.params?.post}</Text>
<Button
title="show app info"
onPress={this.showAppInfo}
/>
<Button
title="show login info"
onPress={this.showLoginInfo}
/>
<Button
title="show devices info"
onPress={this.showDevicesInfo}
/>
</View>
);
}
......
......@@ -11,4 +11,5 @@ import { NativeModules, requireNativeComponent } from 'react-native';
//export default NativeModules.BMCUI;
//不使用export default时,对应的import语句需要使用大括号
export var BMCUI = NativeModules.BMCUI;
export var ImagePicker = NativeModules.ImagePicker;
\ No newline at end of file
export var ImagePicker = NativeModules.ImagePicker;
export var BMCInfo = NativeModules.BMCInfo;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment