// 提交表单按钮
handleSubmit () {
this.setState({
address: this.state.address,
})
setTimeout(() => {
this.props.history.push('/order/QueryOrder/') //我想得到服务器生成order的id,用做这个路进跳转进订单的详情页。
},1000)
var date = new Date()
let order = {
customerId:this.state.customerId,
address: this.state.customrName,
deliveryTime: date,
items: this.state.items,
}
AddOrderMutation.commit(environment, order); //向服务器发送创建新的order
return order
}
完全不明白这个回调函数怎么写,数据是 graphql 。