【发布时间】:2019-05-29 16:27:07
【问题描述】:
componentDidMount(){
fetch('https://boboboi.online/c_api_sales/get_dest',{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
port_code: 'CP-002',
api_key: 'ae9a6ce9a7479038d998060ef6d65ca9f86a13ed962a5366b3b0662cc52dde1b',
token: 'a959190d43520f8017ed2ca09ffc61bb'
}),
})
.then((response) => response.json())
.then((responseJson) => {
this.setState({
isLoading: false,
dataSource: responseJson
}, function() {
// In this block you can do something with new state.
});
})
.catch((error) => {
console.error(error);
});
}
GetPickerSelectedItemValue=()=>{
Alert.alert(this.state.PickerValueHolder);
}
【问题讨论】:
-
嗨,欢迎 :) 需要记住的几件事,请不要将您的代码作为屏幕截图发布,其次,请提供您的问题和所问内容的完整详细信息。你写问题的方式,没有人能帮助你 - 见这里stackoverflow.com/help/how-to-ask