罗广聪

修bug

... ... @@ -81,7 +81,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
... ...
... ... @@ -40,7 +40,12 @@ export default class ArticleTemplate extends Component {
model: this.props.navigation.state.params.model,
type: this.props.navigation.state.params.type,
articleData: {
paragraph: []
paragraph: [],
NICKNAME: "",
IS_LOGIN: "",
USER_ID: "",
COMPANY: "",
PHONE: ""
}
};
}
... ... @@ -100,16 +105,22 @@ export default class ArticleTemplate extends Component {
getAsyncStorage() {
const that = this;
AsyncStorage.multiGet(["IS_LOGIN", "USER_ID"], (err, result) => {
AsyncStorage.multiGet(
["IS_LOGIN", "USER_ID", "NICKNAME", "COMPANY", "PHONE"],
(err, result) => {
if (err) {
console.error(err);
}
that.setState({
IS_LOGIN: result[0][1],
USER_ID: result[1][1] != null ? result[1][1] : ""
});
USER_ID: result[1][1] != null ? result[1][1] : "",
NICKNAME: result[2][1] != null ? result[2][1] : "",
COMPANY: result[3][1] != null ? result[3][1] : "",
PHONE: result[4][1] != null ? result[4][1] : ""
});
}
);
}
getArticles() {
let that = this,
id = this.state.id,
... ... @@ -149,9 +160,28 @@ export default class ArticleTemplate extends Component {
<Text style={styles.headerTitle}>{articleData.title}</Text>
<View style={styles.infoWrapper}>
<Text style={styles.time}>{articleData.time}</Text>
{this.state.IS_LOGIN == "yes" ? (
<Text style={styles.author}>{this.state.NICKNAME}</Text>
) : null}
<Text style={styles.author}>{articleData.author}</Text>
</View>
</View>
{this.state.IS_LOGIN == "yes" ? (
<View style={styles.businerrCardContaier}>
<Image
style={styles.BCLeftImg}
source={require("../assets/Mine/1.png")}
/>
<View style={styles.BCRightContaier}>
<Text style={styles.BCText}>{this.state.NICKNAME}</Text>
{this.state.COMPANY ? (
<Text style={styles.BCText}>{this.state.COMPANY}</Text>
) : null}
<Text style={styles.BCText}>{this.state.PHONE}</Text>
</View>
</View>
) : null}
<View style={styles.contentConatiner}>
{articleData.paragraph.map((item, index) => {
return (
... ... @@ -212,6 +242,30 @@ const styles = StyleSheet.create({
fontSize: 15,
color: "#999999"
},
businerrCardContaier: {
flexDirection: "row",
alignItems: "center",
marginHorizontal: 20,
marginVertical: 10,
backgroundColor: "#D7D7D7",
borderRadius: 5,
paddingHorizontal: 20,
paddingVertical: 10
},
BCLeftImg: {
width: 50,
height: 50
},
BCRightContaier: {
marginLeft: 20,
flex: 1,
justifyContent: "center",
},
BCText: {
fontSize: 13,
lineHeight: 22,
color: "white"
},
contentConatiner: {
marginTop: 20,
marginLeft: 15,
... ...
... ... @@ -438,7 +438,7 @@ export default class Mine extends Component {
}}
>
<View style={styles.itemLeft}>
<Text style={styles.leftTitle}>发现</Text>
<Text style={styles.leftTitle}>每日一文</Text>
</View>
<View style={styles.itemRight}>
<Image
... ...