罗广聪

AI

... ... @@ -153,13 +153,35 @@ export default class Home extends Component {
});
}
submit() {
const that = this;
let Temp = this.state.QuesList.map(item => item.answers[item.selected]);
console.log(Temp)
Temp.splice(3,1,that.format(that.state.date));
that.setState({
answerList: Temp
})
}
format(date) {
const Year = date.getFullYear();
const Month = date.getMonth();
const Day = date.getDate();
return `${Year}-${Month}-${Day}`;
}
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<ScrollView>
{this._renderQuestion()}
<TouchableOpacity style={styles.confirmBtn}>
<TouchableOpacity
onPress={() => {
this.submit();
}}
style={styles.confirmBtn}
>
<Text style={styles.confirmBtnText}>生成智能方案</Text>
</TouchableOpacity>
</ScrollView>
... ... @@ -225,6 +247,6 @@ const styles = StyleSheet.create({
color: "white"
},
dateWrapper: {
width: 300,
},
width: 300
}
});
... ...
... ... @@ -71,10 +71,12 @@ export default class Home extends Component {
<TouchableOpacity
onPress={() => {
{/* alert(this.state.date); */}
{
/* alert(this.state.date); */
}
this.setState({
showDate: !this.state.showDate
})
});
}}
>
<Text>打印时间</Text>
... ...