罗广聪

调整发现入口

... ... @@ -9,7 +9,8 @@ import {
ScrollView,
Dimensions,
TextInput,
Alert
Alert,
AsyncStorage
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
import post from "../../utils/fetch";
... ... @@ -32,18 +33,38 @@ export default class Home extends Component {
super(props);
this.state = {
content: "",
IS_LOGIN: "",
USER_ID: "",
};
}
componentWillMount() {}
componentWillMount() {
this.getAsyncStorage();
}
componentDidMount() {
this.props.navigation.setParams({
submit: this.submit.bind(this)
});
}
//
getAsyncStorage() {
const that = this;
AsyncStorage.multiGet(
["IS_LOGIN", "USER_ID"],
(err, result) => {
if (err) {
console.error(err);
}
that.setState({
IS_LOGIN: result[0][1],
USER_ID: result[1][1] != null ? result[1][1] : "",
});
}
);
}
submit() {
const { navigate,goBack } = this.props.navigation;
const { goBack } = this.props.navigation;
if(!this.state.content){
Alert.alert("请填写评论内容");
} else {
... ...
... ... @@ -354,6 +354,26 @@ export default class Mine extends Component {
</TouchableOpacity>
</View>
{/* 发现 */}
<View style={styles.midContainer}>
<TouchableOpacity
style={styles.itemContainer}
onPress={() => {
navigate("Discover");
}}
>
<View style={styles.itemLeft}>
<Text style={styles.leftTitle}>发现</Text>
</View>
<View style={styles.itemRight}>
<Image
style={styles.itemRightImg}
source={require("../../assets/Mine/rightArrow_gray.png")}
/>
</View>
</TouchableOpacity>
</View>
{/* 当前版本 */}
<View style={styles.midContainer}>
<TouchableOpacity style={styles.itemContainer}>
... ...