罗广聪

基础navigation,属性和跳转传值还没处理

... ... @@ -6,9 +6,22 @@
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";
import Main from "./src/pages/main";
import { StackNavigator, TabNavigator } from "react-navigation";
export default class ProtectGod extends Component {
import Home from "./src/pages/Home/index";
import InsuranceCircle from "./src/pages/InsuranceCircle/index";
import InsuranceChurch from "./src/pages/InsuranceChurch/index";
import Mine from "./src/pages/Mine/index";
import Login from "./src/pages/Login";
const MainTabBar = TabNavigator({
Home: { screen: Home, navigationOptions: { title: "首页"} },
InsuranceCircle: { screen: InsuranceCircle },
InsuranceChurch: { screen: InsuranceChurch },
Mine: { screen: Mine }
});
class Main extends Component {
constructor(props) {
super(props);
this.state = {
... ... @@ -16,71 +29,91 @@ export default class ProtectGod extends Component {
isLogin: true
};
}
componentWillMount() {
// console.log("componentWillMount生命周期");
// var that = this;
// return fetch(`https://devpay.brae.co/test/insurance/login`,{
// method: "POST",
// headers: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// },
// })
// .then((resp) => {
// console.log("测试接口",resp);
// // return false;
// if (resp.status === 200) {
// return resp.json();
// } else {
// console.error("something went wrong!");
// }
// })
// .then((respJson) => {
// if (respJson.enmsg != 'ok') {
// console.error(err);
// alert(respJson.cnmsg);
// } else {
// that.setState({
// testData: respJson.data
// });
// console.log('state.testData',that.state.testData);
// }
// })
// .catch((err) => console.error(err))
}
render() {
console.log("看看这个登录state", this.state.isLogin);
return this.state.isLoading ? null : (
<Main
loginSuccess={this.state.isLogin}
selectedItem={this.state.selectedItem}
onLogin={isLogin => {
this.setState({
isLogin: isLogin
});
}}
const { isLogin } = this.state;
return isLogin ? (
<MainTabBar />
) : (
<Login
loginSuccess={this.props.loginSuccess}
onLogin={this.props.onLogin}
/>
);
}
}
const ProtectGod = StackNavigator({
Main: { screen: Main },
Home: { screen: Home, navigationOptions: { headerTitle: "首页"} },
InsuranceCircle: { screen: InsuranceCircle },
InsuranceChurch: { screen: InsuranceChurch },
Mine: { screen: Mine },
Login: { screen: Login }
});
// export default class ProtectGod extends Component {
// constructor(props) {
// super(props);
// this.state = {
// isLoading: false,
// isLogin: true
// };
// }
// componentWillMount() {
// // console.log("componentWillMount生命周期");
// // var that = this;
// // return fetch(`https://devpay.brae.co/test/insurance/login`,{
// // method: "POST",
// // headers: {
// // 'Accept': 'application/json',
// // 'Content-Type': 'application/json',
// // },
// // })
// // .then((resp) => {
// // console.log("测试接口",resp);
// // // return false;
// // if (resp.status === 200) {
// // return resp.json();
// // } else {
// // console.error("something went wrong!");
// // }
// // })
// // .then((respJson) => {
// // if (respJson.enmsg != 'ok') {
// // console.error(err);
// // alert(respJson.cnmsg);
// // } else {
// // that.setState({
// // testData: respJson.data
// // });
// // console.log('state.testData',that.state.testData);
// // }
// // })
// // .catch((err) => console.error(err))
// }
// render() {
// console.log("看看这个登录state", this.state.isLogin);
// return this.state.isLoading ? null : (
// <Main
// loginSuccess={this.state.isLogin}
// selectedItem={this.state.selectedItem}
// onLogin={isLogin => {
// this.setState({
// isLogin: isLogin
// });
// }}
// />
// );
// }
// }
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
},
welcome: {
fontSize: 20,
textAlign: "center",
margin: 10
},
instructions: {
textAlign: "center",
color: "#333333",
marginBottom: 5
}
});
... ...
... ... @@ -9,7 +9,8 @@
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.48.1",
"react-native-swiper": "^1.5.11"
"react-native-swiper": "^1.5.11",
"react-navigation": "^1.0.0-beta.11"
},
"devDependencies": {
"babel-jest": "20.0.3",
... ...
... ... @@ -8,12 +8,15 @@ import {
TouchableOpacity,
ScrollView
} from "react-native";
import { StackNavigator, TabNavigator } from 'react-navigation';
import Swiper from "react-native-swiper";
import Carousel from "../../Components/Carousel";
import AllProduct from "./allProduct";
import CommonWebView from "../../Components/CommonWebView";
export default class Home extends Component {
static navigationOptions = {
title: '首页',
};
constructor(props) {
super(props);
this._renderMap = this._renderMap.bind(this);
... ... @@ -149,8 +152,8 @@ export default class Home extends Component {
</View>
);
}
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
{/* <Carousel /> */}
... ... @@ -189,7 +192,7 @@ export default class Home extends Component {
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 64,
// paddingTop: 64,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF"
... ... @@ -237,7 +240,7 @@ const styles = StyleSheet.create({
// height: 150
flex: 1,
// paddingBottom: 64,
marginBottom: 49
// marginBottom: 49
},
itemContainer: {
height: 90,
... ... @@ -276,6 +279,6 @@ const styles = StyleSheet.create({
fontSize: 13,
marginTop: 10,
textAlign: "center",
marginBottom: 10
// marginBottom: 10
}
});
... ...
... ... @@ -8,9 +8,13 @@ import {
TouchableOpacity,
Image
} from "react-native";
import { StackNavigator, TabNavigator } from 'react-navigation';
import CommonWebView from "../../Components/CommonWebView";
export default class InsuranceChurch extends Component {
static navigationOptions = {
title: '保堂',
};
constructor(props) {
super(props);
// this._renderMap = this._renderMap.bind(this);
... ... @@ -88,7 +92,6 @@ const styles = StyleSheet.create({
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 64
},
scrollViewContainer: {
// height: 300
... ...
... ... @@ -8,10 +8,14 @@ import {
TouchableOpacity,
Image
} from "react-native";
import { StackNavigator, TabNavigator } from 'react-navigation';
import CommonWebView from "../../Components/CommonWebView";
import Details from "./details";
export default class InsuranceCircle extends Component {
static navigationOptions = {
title: '保圈',
};
constructor(props) {
super(props);
this.state = {
... ... @@ -157,12 +161,11 @@ const styles = StyleSheet.create({
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 64
},
scrollViewContainer: {
// height: 300
flex: 1,
marginBottom: 49,
// marginBottom: 49,
},
scrollViewText: {
color: "#7A7A7A",
... ...
import React, { Component } from "react";
import {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
TouchableOpacity,
Image
} from "react-native";
export default class MsgNotification extends Component {
constructor(props) {
super(props);
this.state = {
ListData: [{
icon: require("../../assets/Mine/iconpic1.png"),
title: "评论回复",
time: "10小时前",
tips: "XXX回复了你的评论,点击查看",
},{
icon: require("../../assets/Mine/iconpic1.png"),
title: "评论回复",
time: "10小时前",
tips: "XXX回复了你的评论,点击查看",
},{
icon: require("../../assets/Mine/iconpic1.png"),
title: "评论回复",
time: "10小时前",
tips: "XXX回复了你的评论,点击查看",
},{
icon: require("../../assets/Mine/iconpic1.png"),
title: "评论回复",
time: "10小时前",
tips: "XXX回复了你的评论,点击查看",
}],
};
}
render() {
return (
<View style={styles.container}>
{this.state.ListData.map((item, index) => {
return (
<TouchableOpacity style={styles.itemContainer} key={index}>
<Image style={styles.itemIcon} source={item.icon} />
<View style={styles.itemLeft}>
<View style={styles.itemLeftTop}>
<Text style={styles.itemTitle}>{item.title}</Text>
<Text style={styles.itemTime}>{item.time}</Text>
</View>
<Text style={styles.itemTips}>{item.tips}</Text>
</View>
</TouchableOpacity>
)
})}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 74
},
itemContainer: {
flexDirection: "row",
alignItems: "center",
height: 72,
padding: 13,
backgroundColor: "white",
marginBottom: 1,
},
itemIcon: {
width: 46,
height: 46,
marginRight: 13,
},
itemLeft: {
flex: 1
},
itemLeftTop: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
},
itemTitle: {
fontSize: 16,
color: "#030303"
},
itemTime: {
fontSize: 13,
color: "#999999"
},
itemTips: {
marginTop: 3,
fontSize: 13,
color: "#7A7A7A"
},
});
import React, { Component } from "react";
import {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
TextInput,
TouchableOpacity,
TouchableHighlight,
Image,
Modal
} from "react-native";
export default class PersonalInfo extends Component {
constructor(props) {
super(props);
this.state = {
modalVisible: false,
title: "更改昵称",
type: "name",
text: "",
name: this.props.name,
identity: this.props.identity,
};
}
setModalVisible(visible,type) {
this.setState({ modalVisible: visible });
this.setState({
type: type,
title: type == "name" ? "更改昵称" : "更改职业"
})
}
confirmChange() {
console.log("看看拿到方法没",this);
if (this.state.type == "name") {
this.setState({name: this.state.text})
} else {
this.setState({identity: this.state.text})
}
this.setState({
modalVisible: false,
});
// 修改mine组件的属性值,该方法是从mine组件传过来的
this.props.changeInfo(this.state.type,this.state.text);
}
render() {
const { name, identity } = this.state;
return (
<View style={styles.container}>
<TouchableOpacity
style={styles.itemContainer}
onPress={() => {
this.setModalVisible(true,"name");
}}
>
<Text style={styles.itemLeft}>昵称</Text>
<View style={styles.itemRight}>
<Text style={styles.itemContent}>{name}</Text>
<Image
style={styles.itemArrow}
source={require("../../assets/Mine/rightArrow_gray.png")}
/>
</View>
</TouchableOpacity>
<TouchableOpacity
style={styles.itemContainer}
onPress={() => {
this.setModalVisible(true,"identity");
}}
>
<Text style={styles.itemLeft}>职业</Text>
<View style={styles.itemRight}>
<Text style={styles.itemContent}>{identity}</Text>
<Image
style={styles.itemArrow}
source={require("../../assets/Mine/rightArrow_gray.png")}
/>
</View>
</TouchableOpacity>
{/* 弹出框 */}
<Modal
animationType={"slide"}
transparent={true}
visible={this.state.modalVisible}
>
<View style={styles.modalConatier}>
<View style={styles.modalWrapper}>
<Text style={styles.title}>{this.state.title}</Text>
<TextInput
style={styles.textInput}
autoFocus={true}
value={this.state.text}
onChangeText={ text => this.setState({ text })}
selectionColor="#0076FF"
clearTextOnFocus={true}
numberOfLines={1}
clearButtonMode="always"
keyboardType="default"
/>
<View style={styles.btns}>
<TouchableOpacity
style={styles.btn}
onPress={() => {
this.setModalVisible(!this.state.modalVisible);
}}
>
<Text style={styles.btnText}>取消</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.btn}
onPress={() => {
this.confirmChange()
}}
>
<Text style={styles.btnText}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 74
},
itemContainer: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
paddingLeft: 16,
paddingRight: 16,
paddingTop: 13,
paddingBottom: 13,
marginBottom: 1,
backgroundColor: "white"
},
itemLeft: {
fontSize: 15,
color: "#242424"
},
itemRight: {
flexDirection: "row",
alignItems: "center"
},
itemContent: {
fontSize: 15,
color: "#7A7A7A",
marginRight: 6
},
itemArrow: {
width: 14,
height: 14
},
modalConatier: {
alignItems: "center",
justifyContent: "center",
flex: 1,
backgroundColor: "rgba(0, 0, 0, 0.5)"
},
modalWrapper: {
width: 270,
height: 180,
borderRadius: 10,
backgroundColor: "white",
// paddingLeft: 20,
// paddingRight: 20,
paddingBottom: 10,
justifyContent: "center",
alignItems: "center",
},
title: {
fontSize: 17,
color: "#030303",
marginLeft: 20,
position: "absolute",
top: 38,
left: 20
},
textInput: {
marginTop: 20,
marginLeft: 20,
marginRight: 20,
width: 150,
borderStyle: "solid",
borderColor: "#ccc",
borderBottomWidth: 0.5,
},
btns: {
position: "absolute",
bottom: 0,
height: 44,
flexDirection: "row",
borderStyle: "solid",
borderColor: "#ccc",
borderTopWidth: 0.5,
},
btn: {
width: 135,
height: 44,
justifyContent: "center",
alignItems: "center",
borderStyle: "solid",
borderColor: "#ccc",
borderLeftWidth: 0.5,
},
btnText: {
color: "#0076FF",
fontSize: 17,
}
});
... ... @@ -8,8 +8,12 @@ import {
Image,
AlertIOS
} from "react-native";
import { StackNavigator, TabNavigator } from 'react-navigation';
export default class Mine extends Component {
static navigationOptions = {
title: '我的',
};
constructor(props) {
super(props);
this.state = {
... ... @@ -104,7 +108,6 @@ const styles = StyleSheet.create({
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 64
},
header: {
backgroundColor: "#1B9341",
... ...
import React, { Component } from "react";
import {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
TouchableOpacity,
Image
} from "react-native";
export default class MyQuestion extends Component {
constructor(props) {
super(props);
this.state = {
ListData: [
{
title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…",
content:
"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
name: "嘿嘿嘿",
identity: "保险代理人",
image: require("../../assets/Mine/iconpic1.png"),
num: "30",
time: "2017-8-15",
comments: [{
replyer: "噢噢噢",
replayicon: require("../../assets/Mine/iconpic1.png"),
beenreplyer: "嘿嘿嘿",
content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
time: "两小时前",
},{
replyer: "哦哦哦",
replayicon: require("../../assets/Mine/iconpic1.png"),
beenreplyer: "哈哈哈",
content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
time: "两小时前",
},{
replyer: "洛洛洛",
replayicon: require("../../assets/Mine/iconpic1.png"),
beenreplyer: "额额额",
content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
time: "两小时前",
}],
},
{
title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…",
content:
"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
name: "嘿嘿嘿",
identity: "保险代理人",
image: require("../../assets/circle/newspic.png"),
num: "29",
time: "2017-8-15",
comments: []
},
{
title: "因为你病不起,输不起,也折腾不起…",
content:
"现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
name: "luosf",
identity: "保险代理人",
image: require("../../assets/circle/newspic.png"),
num: "10",
time: "2017-8-15",
comments: []
}
],
testData: [],
};
}
// componentWillMount() {
// var that = this;
// return fetch(`https://mpay.brae.co/test/insurance/article`,{
// method: "POST",
// headers: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// },
// })
// .then((resp) => {
// console.log("测试接口",resp);
// // return false;
// if (resp.status === 200) {
// return resp.json();
// } else {
// console.error("something went wrong!");
// }
// })
// .then((respJson) => {
// if (respJson.enmsg != 'ok') {
// console.error(err);
// alert(respJson.cnmsg);
// } else {
// that.setState({
// testData: respJson.data
// });
// console.log('state.testData',that.state.testData);
// }
// })
// .catch((err) => console.error(err))
// }
render() {
return (
<View style={styles.container}>
<ScrollView
style={styles.scrollViewContainer}
automaticallyAdjustContentInsets={false}
>
{this.state.ListData.map((item, index) => {
return (
<TouchableOpacity
style={styles.itemContainer}
key={index}
>
<Text style={styles.itemTitle} numberOfLines={2}>
{item.title}
</Text>
<Text style={styles.itemContent} numberOfLines={3}>
{item.content}
</Text>
<View style={styles.itemInfoWrapper}>
<View style={styles.itemInfoLeft}>
{/* <Image
source={item.image}
style={[styles.itemInfoIcon, { width: 26, height: 26 }]}
/>
<Text style={styles.itemInfoName}>{item.name}</Text> */}
</View>
<Text style={styles.itemInfoRight}>{item.num} 评论</Text>
</View>
</TouchableOpacity>
);
})}
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF",
paddingTop: 74
},
scrollViewContainer: {
// height: 300
},
scrollViewText: {
color: "#7A7A7A",
fontSize: 13,
marginTop: 10,
textAlign: "center"
},
itemContainer: {
backgroundColor: "#fff",
marginBottom: 10,
height: 180,
paddingLeft: 13,
paddingRight: 13,
paddingTop: 19
},
itemTitle: {
fontSize: 17,
color: "#242424",
lineHeight: 24
},
itemContent: {
marginTop: 5,
fontSize: 14,
color: "#7A7A7A",
lineHeight: 20
},
itemInfoWrapper: {
flexDirection: "row",
justifyContent: "flex-end",
alignItems: "center",
marginTop: 11
},
itemInfoLeft: {
flexDirection: "row",
justifyContent: "flex-start",
alignItems: "center"
},
itemInfoIcon: {
marginRight: 10
},
itemInfoName: {
fontSize: 13,
color: "#242424",
lineHeight: 18
},
itemInfoRight: {
fontSize: 13,
color: "#999999",
lineHeight: 18
}
});
... ... @@ -8,6 +8,7 @@ import {
NavigatorIOS,
Dimensions
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
import Home from "./Home/index";
import InsuranceCircle from "./InsuranceCircle/index";
... ... @@ -17,7 +18,7 @@ import Login from "./Login";
var scale = Dimensions.get("window").scale;
export default class Main extends Component {
class Main extends Component {
constructor(props) {
super(props);
this.state = {
... ... @@ -31,85 +32,87 @@ export default class Main extends Component {
render() {
const { loginSuccess } = this.props;
return loginSuccess ? (
<TabBarIOS tintColor="#08CC6A" barTintColor="white">
<TabBarIOS.Item
title="首页"
icon={require("../assets/tabbar/ic_home_n.png")}
selected={this.state.selectedItem == "home"}
onPress={() => {
this.setState({
selectedItem: "home"
});
}}
>
<NavigatorIOS
style={{ flex: 1 }}
initialRoute={{
component: Home,
title: "首页",
}}
/>
</TabBarIOS.Item>
<TabBarIOS.Item
title="保圈"
icon={require("../assets/tabbar/ic_circle_n.png")}
selected={this.state.selectedItem == "insuranceCircle"}
onPress={() => {
this.setState({
selectedItem: "insuranceCircle"
});
}}
>
<NavigatorIOS
style={{ flex: 1 }}
initialRoute={{
component: InsuranceCircle,
title: "保圈",
}}
/>
</TabBarIOS.Item>
<TabBarIOS.Item
title="保堂"
icon={require("../assets/tabbar/ic_umbrella_n.png")}
selected={this.state.selectedItem == "insuranceChurch"}
onPress={() => {
this.setState({
selectedItem: "insuranceChurch"
});
}}
>
<NavigatorIOS
style={{ flex: 1 }}
initialRoute={{
component: InsuranceChurch,
title: "保堂"
}}
/>
</TabBarIOS.Item>
<TabBarIOS.Item
title="我的"
icon={require("../assets/tabbar/ic_mine_n.png")}
selected={this.state.selectedItem == "mine"}
onPress={() => {
this.setState({
selectedItem: "mine"
});
}}
>
<NavigatorIOS
style={{ flex: 1 }}
initialRoute={{
component: Mine,
title: "我的",
passProps: {
onLogin: this.props.onLogin
}
}}
/>
</TabBarIOS.Item>
</TabBarIOS>
) : (
return loginSuccess ? <MainTabBar navigation={this.props.navigation} />
// (
// <TabBarIOS tintColor="#08CC6A" barTintColor="white">
// <TabBarIOS.Item
// title="首页"
// icon={require("../assets/tabbar/ic_home_n.png")}
// selected={this.state.selectedItem == "home"}
// onPress={() => {
// this.setState({
// selectedItem: "home"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: Home,
// title: "首页",
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="保圈"
// icon={require("../assets/tabbar/ic_circle_n.png")}
// selected={this.state.selectedItem == "insuranceCircle"}
// onPress={() => {
// this.setState({
// selectedItem: "insuranceCircle"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: InsuranceCircle,
// title: "保圈",
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="保堂"
// icon={require("../assets/tabbar/ic_umbrella_n.png")}
// selected={this.state.selectedItem == "insuranceChurch"}
// onPress={() => {
// this.setState({
// selectedItem: "insuranceChurch"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: InsuranceChurch,
// title: "保堂"
// }}
// />
// </TabBarIOS.Item>
// <TabBarIOS.Item
// title="我的"
// icon={require("../assets/tabbar/ic_mine_n.png")}
// selected={this.state.selectedItem == "mine"}
// onPress={() => {
// this.setState({
// selectedItem: "mine"
// });
// }}
// >
// <NavigatorIOS
// style={{ flex: 1 }}
// initialRoute={{
// component: Mine,
// title: "我的",
// passProps: {
// onLogin: this.props.onLogin
// }
// }}
// />
// </TabBarIOS.Item>
// </TabBarIOS>
// )
: (
<Login
loginSuccess={this.props.loginSuccess}
onLogin={this.props.onLogin}
... ...
... ... @@ -1026,6 +1026,10 @@ ci-info@^1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/ci-info/download/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534"
clamp@^1.0.1:
version "1.0.1"
resolved "http://registry.npm.taobao.org/clamp/download/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "http://registry.npm.taobao.org/cli-cursor/download/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
... ... @@ -1521,7 +1525,7 @@ fbjs-scripts@^0.7.0:
semver "^5.1.0"
through2 "^2.0.0"
fbjs@0.8.12, fbjs@^0.8.9:
fbjs@0.8.12, fbjs@^0.8.12, fbjs@^0.8.9:
version "0.8.12"
resolved "http://registry.npm.taobao.org/fbjs/download/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
... ... @@ -1821,6 +1825,10 @@ hoek@2.x.x:
version "2.16.3"
resolved "http://registry.npm.taobao.org/hoek/download/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "http://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
home-or-tmp@^2.0.0:
version "2.0.0"
resolved "http://registry.npm.taobao.org/home-or-tmp/download/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
... ... @@ -3059,6 +3067,12 @@ path-parse@^1.0.5:
version "1.0.5"
resolved "http://registry.npm.taobao.org/path-parse/download/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "http://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
isarray "0.0.1"
path-type@^1.0.0:
version "1.1.0"
resolved "http://registry.npm.taobao.org/path-type/download/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
... ... @@ -3221,12 +3235,34 @@ react-devtools-core@^2.5.0:
shell-quote "^1.6.1"
ws "^2.0.3"
react-native-dismiss-keyboard@1.0.0:
version "1.0.0"
resolved "http://registry.npm.taobao.org/react-native-dismiss-keyboard/download/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"
react-native-drawer-layout-polyfill@^1.3.0:
version "1.3.2"
resolved "http://registry.npm.taobao.org/react-native-drawer-layout-polyfill/download/react-native-drawer-layout-polyfill-1.3.2.tgz#192c84d7a5a6b8a6d2be2c7daa5e4164518d0cc7"
dependencies:
react-native-drawer-layout "1.3.2"
react-native-drawer-layout@1.3.2:
version "1.3.2"
resolved "http://registry.npm.taobao.org/react-native-drawer-layout/download/react-native-drawer-layout-1.3.2.tgz#b9740d7663a1dc4f88a61b9c6d93d2d948ea426e"
dependencies:
react-native-dismiss-keyboard "1.0.0"
react-native-swiper@^1.5.11:
version "1.5.11"
resolved "http://registry.npm.taobao.org/react-native-swiper/download/react-native-swiper-1.5.11.tgz#2d46ded43f383dbde4540d513cb4eaaa60eaed61"
dependencies:
prop-types "^15.5.10"
react-native-tab-view@^0.0.65:
version "0.0.65"
resolved "http://registry.npm.taobao.org/react-native-tab-view/download/react-native-tab-view-0.0.65.tgz#b685ea3081ff7c96486cd997361026c407302c59"
dependencies:
prop-types "^15.5.8"
react-native@0.48.1:
version "0.48.1"
resolved "http://registry.npm.taobao.org/react-native/download/react-native-0.48.1.tgz#052ba5a86d3bdb748c288124248727d02b1c0939"
... ... @@ -3315,6 +3351,18 @@ react-native@0.48.1:
xtend ">=4.0.0 <4.1.0-0"
yargs "^6.4.0"
react-navigation@^1.0.0-beta.11:
version "1.0.0-beta.11"
resolved "http://registry.npm.taobao.org/react-navigation/download/react-navigation-1.0.0-beta.11.tgz#4271edb23cdbcc6eb88602f7fde0a77f0ef7a160"
dependencies:
clamp "^1.0.1"
fbjs "^0.8.12"
hoist-non-react-statics "^1.2.0"
path-to-regexp "^1.7.0"
prop-types "^15.5.10"
react-native-drawer-layout-polyfill "^1.3.0"
react-native-tab-view "^0.0.65"
react-proxy@^1.1.7:
version "1.1.8"
resolved "http://registry.npm.taobao.org/react-proxy/download/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
... ...
... ... @@ -65,4 +65,35 @@ POST https://devpay.brae.co
"user": "yyy",
"content": "哈哈~"
}
}
\ No newline at end of file
}
var that = this;
return fetch(`https://devpay.brae.co/test/insurance/login`,{
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
})
.then((resp) => {
console.log("测试接口",resp);
// return false;
if (resp.status === 200) {
return resp.json();
} else {
console.error("something went wrong!");
}
})
.then((respJson) => {
if (respJson.enmsg != 'ok') {
console.error(err);
alert(respJson.cnmsg);
} else {
that.setState({
testData: respJson.data
});
console.log('state.testData',that.state.testData);
}
})
.catch((err) => console.error(err))
\ No newline at end of file
... ...