罗广聪

评论接上了 细节页面还没调整好

@@ -20,57 +20,57 @@ export default class InsuranceCircle extends Component { @@ -20,57 +20,57 @@ export default class InsuranceCircle extends Component {
20 super(props); 20 super(props);
21 this.state = { 21 this.state = {
22 ListData: [ 22 ListData: [
23 - { 23 + // {
24 - title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…", 24 + // title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…",
25 - content: 25 + // content:
26 - "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", 26 + // "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
27 - name: "嘿嘿嘿", 27 + // name: "嘿嘿嘿",
28 - identity: "保险代理人", 28 + // identity: "保险代理人",
29 - image: require("../../assets/Mine/iconpic1.png"), 29 + // image: require("../../assets/Mine/iconpic1.png"),
30 - num: "30", 30 + // num: "30",
31 - time: "2017-8-15", 31 + // time: "2017-8-15",
32 - comments: [{ 32 + // comments: [{
33 - replyer: "噢噢噢", 33 + // replyer: "噢噢噢",
34 - replayicon: require("../../assets/Mine/iconpic1.png"), 34 + // replayicon: require("../../assets/Mine/iconpic1.png"),
35 - beenreplyer: "嘿嘿嘿", 35 + // beenreplyer: "嘿嘿嘿",
36 - content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现", 36 + // content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
37 - time: "两小时前", 37 + // time: "两小时前",
38 - },{ 38 + // },{
39 - replyer: "哦哦哦", 39 + // replyer: "哦哦哦",
40 - replayicon: require("../../assets/Mine/iconpic1.png"), 40 + // replayicon: require("../../assets/Mine/iconpic1.png"),
41 - beenreplyer: "哈哈哈", 41 + // beenreplyer: "哈哈哈",
42 - content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现", 42 + // content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
43 - time: "两小时前", 43 + // time: "两小时前",
44 - },{ 44 + // },{
45 - replyer: "洛洛洛", 45 + // replyer: "洛洛洛",
46 - replayicon: require("../../assets/Mine/iconpic1.png"), 46 + // replayicon: require("../../assets/Mine/iconpic1.png"),
47 - beenreplyer: "额额额", 47 + // beenreplyer: "额额额",
48 - content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现", 48 + // content: "生活就是如此矛是如此此生活就是如此矛盾现实生活就是如此矛盾现",
49 - time: "两小时前", 49 + // time: "两小时前",
50 - }], 50 + // }],
51 - }, 51 + // },
52 - { 52 + // {
53 - title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…", 53 + // title: "家庭经济越差越应该买保险,因为你病不起,输不起,也折腾不起…",
54 - content: 54 + // content:
55 - "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", 55 + // "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
56 - name: "嘿嘿嘿", 56 + // name: "嘿嘿嘿",
57 - identity: "保险代理人", 57 + // identity: "保险代理人",
58 - image: require("../../assets/circle/newspic.png"), 58 + // image: require("../../assets/circle/newspic.png"),
59 - num: "29", 59 + // num: "29",
60 - time: "2017-8-15", 60 + // time: "2017-8-15",
61 - comments: [] 61 + // comments: []
62 - }, 62 + // },
63 - { 63 + // {
64 - title: "因为你病不起,输不起,也折腾不起…", 64 + // title: "因为你病不起,输不起,也折腾不起…",
65 - content: 65 + // content:
66 - "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…", 66 + // "现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活,就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实生活就是如此矛盾现实矛是如此此…",
67 - name: "luosf", 67 + // name: "luosf",
68 - identity: "保险代理人", 68 + // identity: "保险代理人",
69 - image: require("../../assets/circle/newspic.png"), 69 + // image: require("../../assets/circle/newspic.png"),
70 - num: "10", 70 + // num: "10",
71 - time: "2017-8-15", 71 + // time: "2017-8-15",
72 - comments: [] 72 + // comments: []
73 - } 73 + // }
74 ], 74 ],
75 testData: null, 75 testData: null,
76 }; 76 };
@@ -78,7 +78,7 @@ export default class InsuranceCircle extends Component { @@ -78,7 +78,7 @@ export default class InsuranceCircle extends Component {
78 78
79 componentDidMount() { 79 componentDidMount() {
80 var that = this; 80 var that = this;
81 - return fetch(`https://mpay.brae.co/test/insurance/article`,{ 81 + return fetch(`https://devpay.brae.co/test/insurance/article`,{
82 method: "POST", 82 method: "POST",
83 headers: { 83 headers: {
84 'Accept': 'application/json', 84 'Accept': 'application/json',
@@ -100,9 +100,9 @@ export default class InsuranceCircle extends Component { @@ -100,9 +100,9 @@ export default class InsuranceCircle extends Component {
100 alert(respJson.cnmsg); 100 alert(respJson.cnmsg);
101 } else { 101 } else {
102 that.setState({ 102 that.setState({
103 - testData: respJson.data 103 + ListData: respJson.data.data
104 }); 104 });
105 - console.log('state.testData',that.state.testData); 105 + console.log('state.testData',this.state.ListData);
106 } 106 }
107 }) 107 })
108 .catch((err) => console.error(err)) 108 .catch((err) => console.error(err))
@@ -132,7 +132,7 @@ export default class InsuranceCircle extends Component { @@ -132,7 +132,7 @@ export default class InsuranceCircle extends Component {
132 <View style={styles.itemInfoWrapper}> 132 <View style={styles.itemInfoWrapper}>
133 <View style={styles.itemInfoLeft}> 133 <View style={styles.itemInfoLeft}>
134 <Image 134 <Image
135 - source={item.image} 135 + source={require("../../assets/Mine/iconpic1.png")}
136 style={[styles.itemInfoIcon, { width: 26, height: 26 }]} 136 style={[styles.itemInfoIcon, { width: 26, height: 26 }]}
137 /> 137 />
138 <Text style={styles.itemInfoName}>{item.name}</Text> 138 <Text style={styles.itemInfoName}>{item.name}</Text>
@@ -171,10 +171,11 @@ const styles = StyleSheet.create({ @@ -171,10 +171,11 @@ const styles = StyleSheet.create({
171 itemContainer: { 171 itemContainer: {
172 backgroundColor: "#fff", 172 backgroundColor: "#fff",
173 marginBottom: 10, 173 marginBottom: 10,
174 - height: 180, 174 + // height: 180,
175 paddingLeft: 13, 175 paddingLeft: 13,
176 paddingRight: 13, 176 paddingRight: 13,
177 - paddingTop: 19 177 + paddingTop: 19,
  178 + paddingBottom: 12,
178 }, 179 },
179 itemTitle: { 180 itemTitle: {
180 fontSize: 17, 181 fontSize: 17,
@@ -110,7 +110,7 @@ export default class Login extends Component { @@ -110,7 +110,7 @@ export default class Login extends Component {
110 <TouchableOpacity 110 <TouchableOpacity
111 style={styles.confirmBtnLogin} 111 style={styles.confirmBtnLogin}
112 onPress={() => { 112 onPress={() => {
113 - this.loginRequest() 113 + this.loginRequest();
114 }} 114 }}
115 > 115 >
116 <Text style={styles.confirmText}>登录</Text> 116 <Text style={styles.confirmText}>登录</Text>
@@ -135,7 +135,7 @@ export default class Login extends Component { @@ -135,7 +135,7 @@ export default class Login extends Component {
135 isRegister: !this.state.isRegister, 135 isRegister: !this.state.isRegister,
136 phone: "", 136 phone: "",
137 password: "", 137 password: "",
138 - nickname: "", 138 + nickname: ""
139 })} 139 })}
140 > 140 >
141 <Text style={styles.register}>注册账号</Text> 141 <Text style={styles.register}>注册账号</Text>
@@ -148,7 +148,7 @@ export default class Login extends Component { @@ -148,7 +148,7 @@ export default class Login extends Component {
148 isRegister: !this.state.isRegister, 148 isRegister: !this.state.isRegister,
149 phone: "", 149 phone: "",
150 password: "", 150 password: "",
151 - nickname: "", 151 + nickname: ""
152 })} 152 })}
153 > 153 >
154 <Text style={styles.register}>登录</Text> 154 <Text style={styles.register}>登录</Text>
@@ -195,15 +195,18 @@ export default class Login extends Component { @@ -195,15 +195,18 @@ export default class Login extends Component {
195 if (respJson.enmsg != "ok") { 195 if (respJson.enmsg != "ok") {
196 alert(respJson.cnmsg); 196 alert(respJson.cnmsg);
197 } else { 197 } else {
198 - that.setState({ 198 + that.setState(
  199 + {
199 // testData: respJson.data 200 // testData: respJson.data
200 - }); 201 + }
  202 + );
201 AsyncStorage.setItem("IS_LOGIN", "yes", function(err) { 203 AsyncStorage.setItem("IS_LOGIN", "yes", function(err) {
202 if (err) { 204 if (err) {
203 console.log("存储出错", err); 205 console.log("存储出错", err);
204 return false; 206 return false;
205 } 207 }
206 - that.props.navigation.navigate("Mine"); 208 + // that.props.navigation.navigate("Mine");
  209 + that.props.navigation.goBack();
207 }); 210 });
208 } 211 }
209 }) 212 })
@@ -243,10 +246,10 @@ export default class Login extends Component { @@ -243,10 +246,10 @@ export default class Login extends Component {
243 if (respJson.enmsg != "ok") { 246 if (respJson.enmsg != "ok") {
244 alert(respJson.cnmsg); 247 alert(respJson.cnmsg);
245 } else { 248 } else {
246 - console.log("注册按钮返回的数据",respJson.data); 249 + console.log("注册按钮返回的数据", respJson.data);
247 that.setState({ 250 that.setState({
248 isRegister: !that.state.isRegister, 251 isRegister: !that.state.isRegister,
249 - id: respJson.data.id, 252 + id: respJson.data.id
250 }); 253 });
251 alert("注册成功!"); 254 alert("注册成功!");
252 } 255 }
@@ -8,9 +8,9 @@ import { @@ -8,9 +8,9 @@ import {
8 Image, 8 Image,
9 AlertIOS, 9 AlertIOS,
10 AsyncStorage, 10 AsyncStorage,
11 - Button, 11 + Button
12 } from "react-native"; 12 } from "react-native";
13 -import { StackNavigator, TabNavigator } from 'react-navigation'; 13 +import { StackNavigator, TabNavigator } from "react-navigation";
14 14
15 export default class Mine extends Component { 15 export default class Mine extends Component {
16 // static navigationOptions = { 16 // static navigationOptions = {
@@ -21,50 +21,50 @@ export default class Mine extends Component { @@ -21,50 +21,50 @@ export default class Mine extends Component {
21 this.state = { 21 this.state = {
22 IS_LOGIN: "no", 22 IS_LOGIN: "no",
23 name: "哈哈哈", 23 name: "哈哈哈",
24 - identity: "职业代理人", 24 + identity: "职业代理人"
25 }; 25 };
26 this.saveResponse1 = this.saveResponse1.bind(this); 26 this.saveResponse1 = this.saveResponse1.bind(this);
27 this.saveResponse2 = this.saveResponse2.bind(this); 27 this.saveResponse2 = this.saveResponse2.bind(this);
28 } 28 }
29 componentWillMount() { 29 componentWillMount() {
30 var _that = this; 30 var _that = this;
31 - console.log("this",this) 31 + console.log("this", this);
32 - AsyncStorage.getItem("IS_LOGIN",(err, result) => { 32 + AsyncStorage.getItem("IS_LOGIN", (err, result) => {
33 if (err) { 33 if (err) {
34 console.error(err); 34 console.error(err);
35 } 35 }
36 _that.setState({ 36 _that.setState({
37 IS_LOGIN: result 37 IS_LOGIN: result
38 - }) 38 + });
39 - console.log("我的页面的IS_LOGIN",this.state.IS_LOGIN); 39 + console.log("我的页面的IS_LOGIN", this.state.IS_LOGIN);
40 - }) 40 + });
41 } 41 }
42 componentDidMount() { 42 componentDidMount() {
43 // console.log("hello,AsyncStorage"); 43 // console.log("hello,AsyncStorage");
44 } 44 }
45 signIn() { 45 signIn() {
46 - var _that = this 46 + var _that = this;
47 - AsyncStorage.setItem("IS_LOGIN","yes",function (err) { 47 + AsyncStorage.setItem("IS_LOGIN", "yes", function(err) {
48 if (err) { 48 if (err) {
49 - console.log("存储出错",err); 49 + console.log("存储出错", err);
50 return false; 50 return false;
51 } 51 }
52 - }) 52 + });
53 _that.setState({ 53 _that.setState({
54 IS_LOGIN: "yes" 54 IS_LOGIN: "yes"
55 - }) 55 + });
56 } 56 }
57 signOut() { 57 signOut() {
58 - var _that = this 58 + var _that = this;
59 - AsyncStorage.setItem("IS_LOGIN","no",function (err) { 59 + AsyncStorage.setItem("IS_LOGIN", "no", function(err) {
60 if (err) { 60 if (err) {
61 - console.log("存储出错",err); 61 + console.log("存储出错", err);
62 return false; 62 return false;
63 } 63 }
64 - }) 64 + });
65 _that.setState({ 65 _that.setState({
66 IS_LOGIN: "no" 66 IS_LOGIN: "no"
67 - }) 67 + });
68 } 68 }
69 saveResponse1(d) { 69 saveResponse1(d) {
70 if (this.state.IS_LOGIN == "yes") { 70 if (this.state.IS_LOGIN == "yes") {
@@ -100,11 +100,13 @@ export default class Mine extends Component { @@ -100,11 +100,13 @@ export default class Mine extends Component {
100 style={styles.leftIcon} 100 style={styles.leftIcon}
101 source={require("../../assets/tabbar/ic_circle_s.png")} 101 source={require("../../assets/tabbar/ic_circle_s.png")}
102 /> 102 />
103 - <Text style={styles.leftTitle}>昵称</Text> 103 + <Text style={styles.leftTitle}>设置昵称</Text>
104 {/* {this.state.IS_LOGIN ? <Text style={styles.leftTitle}>昵称</Text> : null} */} 104 {/* {this.state.IS_LOGIN ? <Text style={styles.leftTitle}>昵称</Text> : null} */}
105 </View> 105 </View>
106 <View style={styles.itemRight}> 106 <View style={styles.itemRight}>
107 - { this.state.IS_LOGIN === "yes" ? <Text style={styles.itemRightContent}>{this.state.name}</Text> : null} 107 + {this.state.IS_LOGIN === "yes" ? (
  108 + <Text style={styles.itemRightContent}>{this.state.name}</Text>
  109 + ) : null}
108 {/* <Text style={styles.itemRightContent}>{this.state.name}</Text> */} 110 {/* <Text style={styles.itemRightContent}>{this.state.name}</Text> */}
109 <Image 111 <Image
110 style={styles.itemRightImg} 112 style={styles.itemRightImg}
@@ -124,11 +126,15 @@ export default class Mine extends Component { @@ -124,11 +126,15 @@ export default class Mine extends Component {
124 style={styles.leftIcon} 126 style={styles.leftIcon}
125 source={require("../../assets/tabbar/ic_circle_s.png")} 127 source={require("../../assets/tabbar/ic_circle_s.png")}
126 /> 128 />
127 - <Text style={styles.leftTitle}>职业</Text> 129 + <Text style={styles.leftTitle}>设置职业</Text>
128 </View> 130 </View>
129 <View style={styles.itemRight}> 131 <View style={styles.itemRight}>
130 {/* <Text style={styles.itemRightContent}>{this.state.identity}</Text> */} 132 {/* <Text style={styles.itemRightContent}>{this.state.identity}</Text> */}
131 - { this.state.IS_LOGIN === "yes"? <Text style={styles.itemRightContent}>{this.state.identity}</Text> : null} 133 + {this.state.IS_LOGIN === "yes" ? (
  134 + <Text style={styles.itemRightContent}>
  135 + {this.state.identity}
  136 + </Text>
  137 + ) : null}
132 <Image 138 <Image
133 style={styles.itemRightImg} 139 style={styles.itemRightImg}
134 source={require("../../assets/Mine/rightArrow_gray.png")} 140 source={require("../../assets/Mine/rightArrow_gray.png")}
@@ -142,18 +148,15 @@ export default class Mine extends Component { @@ -142,18 +148,15 @@ export default class Mine extends Component {
142 style={styles.loginOut} 148 style={styles.loginOut}
143 onLogin={this.props.onLogin} 149 onLogin={this.props.onLogin}
144 onPress={() => { 150 onPress={() => {
145 - {/* this.signOut(); */} 151 + this.state.IS_LOGIN == "yes"
146 - navigate("Login",{IS_LOGIN: this.state.IS_LOGIN}); 152 + ? this.signOut()
  153 + : navigate("Login", { IS_LOGIN: this.state.IS_LOGIN });
147 }} 154 }}
148 > 155 >
149 - <Text style={styles.loginOutText}>{this.state.IS_LOGIN ? "登录" : "退出登录"}</Text> 156 + <Text style={styles.loginOutText}>
  157 + {this.state.IS_LOGIN == "yes" ? "退出登录" : "登录"}
  158 + </Text>
150 </TouchableOpacity> 159 </TouchableOpacity>
151 - {/* <Button  
152 - title="登出"  
153 - onPress={() => {  
154 - this.signOut();  
155 - }}  
156 - /> */}  
157 </View> 160 </View>
158 ); 161 );
159 } 162 }
@@ -164,7 +167,7 @@ const styles = StyleSheet.create({ @@ -164,7 +167,7 @@ const styles = StyleSheet.create({
164 flex: 1, 167 flex: 1,
165 justifyContent: "flex-start", 168 justifyContent: "flex-start",
166 alignItems: "stretch", 169 alignItems: "stretch",
167 - backgroundColor: "#EFEFEF", 170 + backgroundColor: "#EFEFEF"
168 }, 171 },
169 header: { 172 header: {
170 backgroundColor: "#1B9341", 173 backgroundColor: "#1B9341",
@@ -176,7 +179,7 @@ const styles = StyleSheet.create({ @@ -176,7 +179,7 @@ const styles = StyleSheet.create({
176 }, 179 },
177 mineIcon: { 180 mineIcon: {
178 width: 86, 181 width: 86,
179 - height: 86, 182 + height: 86
180 }, 183 },
181 mineName: { 184 mineName: {
182 fontSize: 16, 185 fontSize: 16,
@@ -235,5 +238,8 @@ const styles = StyleSheet.create({ @@ -235,5 +238,8 @@ const styles = StyleSheet.create({
235 loginOutText: { 238 loginOutText: {
236 textAlign: "center", 239 textAlign: "center",
237 fontSize: 15 240 fontSize: 15
  241 + },
  242 + button: {
  243 + // fontSize: 14
238 } 244 }
239 }); 245 });