Showing
3 changed files
with
65 additions
and
11 deletions
| @@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
| 81 | </AdditionalOptions> | 81 | </AdditionalOptions> |
| 82 | </TestAction> | 82 | </TestAction> |
| 83 | <LaunchAction | 83 | <LaunchAction |
| 84 | - buildConfiguration = "Debug" | 84 | + buildConfiguration = "Release" |
| 85 | selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | 85 | selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
| 86 | selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | 86 | selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
| 87 | language = "" | 87 | language = "" |
| @@ -40,7 +40,12 @@ export default class ArticleTemplate extends Component { | @@ -40,7 +40,12 @@ export default class ArticleTemplate extends Component { | ||
| 40 | model: this.props.navigation.state.params.model, | 40 | model: this.props.navigation.state.params.model, |
| 41 | type: this.props.navigation.state.params.type, | 41 | type: this.props.navigation.state.params.type, |
| 42 | articleData: { | 42 | articleData: { |
| 43 | - paragraph: [] | 43 | + paragraph: [], |
| 44 | + NICKNAME: "", | ||
| 45 | + IS_LOGIN: "", | ||
| 46 | + USER_ID: "", | ||
| 47 | + COMPANY: "", | ||
| 48 | + PHONE: "" | ||
| 44 | } | 49 | } |
| 45 | }; | 50 | }; |
| 46 | } | 51 | } |
| @@ -100,15 +105,21 @@ export default class ArticleTemplate extends Component { | @@ -100,15 +105,21 @@ export default class ArticleTemplate extends Component { | ||
| 100 | 105 | ||
| 101 | getAsyncStorage() { | 106 | getAsyncStorage() { |
| 102 | const that = this; | 107 | const that = this; |
| 103 | - AsyncStorage.multiGet(["IS_LOGIN", "USER_ID"], (err, result) => { | 108 | + AsyncStorage.multiGet( |
| 104 | - if (err) { | 109 | + ["IS_LOGIN", "USER_ID", "NICKNAME", "COMPANY", "PHONE"], |
| 105 | - console.error(err); | 110 | + (err, result) => { |
| 111 | + if (err) { | ||
| 112 | + console.error(err); | ||
| 113 | + } | ||
| 114 | + that.setState({ | ||
| 115 | + IS_LOGIN: result[0][1], | ||
| 116 | + USER_ID: result[1][1] != null ? result[1][1] : "", | ||
| 117 | + NICKNAME: result[2][1] != null ? result[2][1] : "", | ||
| 118 | + COMPANY: result[3][1] != null ? result[3][1] : "", | ||
| 119 | + PHONE: result[4][1] != null ? result[4][1] : "" | ||
| 120 | + }); | ||
| 106 | } | 121 | } |
| 107 | - that.setState({ | 122 | + ); |
| 108 | - IS_LOGIN: result[0][1], | ||
| 109 | - USER_ID: result[1][1] != null ? result[1][1] : "" | ||
| 110 | - }); | ||
| 111 | - }); | ||
| 112 | } | 123 | } |
| 113 | getArticles() { | 124 | getArticles() { |
| 114 | let that = this, | 125 | let that = this, |
| @@ -149,9 +160,28 @@ export default class ArticleTemplate extends Component { | @@ -149,9 +160,28 @@ export default class ArticleTemplate extends Component { | ||
| 149 | <Text style={styles.headerTitle}>{articleData.title}</Text> | 160 | <Text style={styles.headerTitle}>{articleData.title}</Text> |
| 150 | <View style={styles.infoWrapper}> | 161 | <View style={styles.infoWrapper}> |
| 151 | <Text style={styles.time}>{articleData.time}</Text> | 162 | <Text style={styles.time}>{articleData.time}</Text> |
| 163 | + {this.state.IS_LOGIN == "yes" ? ( | ||
| 164 | + <Text style={styles.author}>{this.state.NICKNAME}</Text> | ||
| 165 | + ) : null} | ||
| 152 | <Text style={styles.author}>{articleData.author}</Text> | 166 | <Text style={styles.author}>{articleData.author}</Text> |
| 153 | </View> | 167 | </View> |
| 154 | </View> | 168 | </View> |
| 169 | + {this.state.IS_LOGIN == "yes" ? ( | ||
| 170 | + <View style={styles.businerrCardContaier}> | ||
| 171 | + <Image | ||
| 172 | + style={styles.BCLeftImg} | ||
| 173 | + source={require("../assets/Mine/1.png")} | ||
| 174 | + /> | ||
| 175 | + <View style={styles.BCRightContaier}> | ||
| 176 | + <Text style={styles.BCText}>{this.state.NICKNAME}</Text> | ||
| 177 | + {this.state.COMPANY ? ( | ||
| 178 | + <Text style={styles.BCText}>{this.state.COMPANY}</Text> | ||
| 179 | + ) : null} | ||
| 180 | + <Text style={styles.BCText}>{this.state.PHONE}</Text> | ||
| 181 | + </View> | ||
| 182 | + </View> | ||
| 183 | + ) : null} | ||
| 184 | + | ||
| 155 | <View style={styles.contentConatiner}> | 185 | <View style={styles.contentConatiner}> |
| 156 | {articleData.paragraph.map((item, index) => { | 186 | {articleData.paragraph.map((item, index) => { |
| 157 | return ( | 187 | return ( |
| @@ -212,6 +242,30 @@ const styles = StyleSheet.create({ | @@ -212,6 +242,30 @@ const styles = StyleSheet.create({ | ||
| 212 | fontSize: 15, | 242 | fontSize: 15, |
| 213 | color: "#999999" | 243 | color: "#999999" |
| 214 | }, | 244 | }, |
| 245 | + businerrCardContaier: { | ||
| 246 | + flexDirection: "row", | ||
| 247 | + alignItems: "center", | ||
| 248 | + marginHorizontal: 20, | ||
| 249 | + marginVertical: 10, | ||
| 250 | + backgroundColor: "#D7D7D7", | ||
| 251 | + borderRadius: 5, | ||
| 252 | + paddingHorizontal: 20, | ||
| 253 | + paddingVertical: 10 | ||
| 254 | + }, | ||
| 255 | + BCLeftImg: { | ||
| 256 | + width: 50, | ||
| 257 | + height: 50 | ||
| 258 | + }, | ||
| 259 | + BCRightContaier: { | ||
| 260 | + marginLeft: 20, | ||
| 261 | + flex: 1, | ||
| 262 | + justifyContent: "center", | ||
| 263 | + }, | ||
| 264 | + BCText: { | ||
| 265 | + fontSize: 13, | ||
| 266 | + lineHeight: 22, | ||
| 267 | + color: "white" | ||
| 268 | + }, | ||
| 215 | contentConatiner: { | 269 | contentConatiner: { |
| 216 | marginTop: 20, | 270 | marginTop: 20, |
| 217 | marginLeft: 15, | 271 | marginLeft: 15, |
| @@ -438,7 +438,7 @@ export default class Mine extends Component { | @@ -438,7 +438,7 @@ export default class Mine extends Component { | ||
| 438 | }} | 438 | }} |
| 439 | > | 439 | > |
| 440 | <View style={styles.itemLeft}> | 440 | <View style={styles.itemLeft}> |
| 441 | - <Text style={styles.leftTitle}>发现</Text> | 441 | + <Text style={styles.leftTitle}>每日一文</Text> |
| 442 | </View> | 442 | </View> |
| 443 | <View style={styles.itemRight}> | 443 | <View style={styles.itemRight}> |
| 444 | <Image | 444 | <Image |
-
Please register or login to post a comment