|
|
@ -25,16 +25,61 @@ class Eduinforms extends Component{
|
|
|
|
eduintits:"",
|
|
|
|
eduintits:"",
|
|
|
|
informs:[],
|
|
|
|
informs:[],
|
|
|
|
yslbool:false,
|
|
|
|
yslbool:false,
|
|
|
|
|
|
|
|
dataquerys:{},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
console.log("Eduinformss");
|
|
|
|
console.log("获取到数据");
|
|
|
|
console.log("获取到数据");
|
|
|
|
console.log(this.props);
|
|
|
|
// console.log(this.props);
|
|
|
|
|
|
|
|
const query = this.props.location.search;
|
|
|
|
this.getinputdata();
|
|
|
|
// const type = query.split('?chinaoocTimestamp=');
|
|
|
|
|
|
|
|
// console.log("Eduinforms12345");
|
|
|
|
|
|
|
|
// console.log(this.foo(query));
|
|
|
|
|
|
|
|
// console.log(JSON.stringify(this.foo(query)));
|
|
|
|
|
|
|
|
var dataqueryss={}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var foqus=this.foo(query);
|
|
|
|
|
|
|
|
if(JSON.stringify(foqus) ==="{}"){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
dataquerys:{},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
dataquerys:foqus,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
dataqueryss=foqus;
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
dataquerys:{},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.getinputdatas(dataqueryss);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foo=(url)=> {
|
|
|
|
|
|
|
|
var json = {};
|
|
|
|
|
|
|
|
var regExp = /[\?\&](\w+)(=?)(\w*)/g;
|
|
|
|
|
|
|
|
var arr;
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
arr = regExp.exec(url);
|
|
|
|
|
|
|
|
// console.log(arr); // arr = [完整的字符串, key, 等号或'', value或'']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (arr) {
|
|
|
|
|
|
|
|
var key = arr[1];
|
|
|
|
|
|
|
|
var value = arr[3];
|
|
|
|
|
|
|
|
// arr[2] === ''时, value = undefined
|
|
|
|
|
|
|
|
if (!arr[2])
|
|
|
|
|
|
|
|
value = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
json[key] = value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} while (arr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return json;
|
|
|
|
|
|
|
|
}
|
|
|
|
getyslbooltrue(){
|
|
|
|
getyslbooltrue(){
|
|
|
|
console.log("调用了getyslbooltrue");
|
|
|
|
console.log("调用了getyslbooltrue");
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -54,7 +99,47 @@ class Eduinforms extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let url = `/courses/${this.props.match.params.coursesId}/informs.json`;
|
|
|
|
let url = `/courses/${this.props.match.params.coursesId}/informs.json`;
|
|
|
|
//
|
|
|
|
//
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
axios.get(url,
|
|
|
|
|
|
|
|
{params:this.state.dataquerys}
|
|
|
|
|
|
|
|
).then((response) => {
|
|
|
|
|
|
|
|
if(response){
|
|
|
|
|
|
|
|
if(response.data){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
informs:response.data.informs,
|
|
|
|
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
informs:[],
|
|
|
|
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
informs:[],
|
|
|
|
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
informs:[],
|
|
|
|
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getinputdatas=(dataquerys)=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isSpin:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let url = `/courses/${this.props.match.params.coursesId}/informs.json`;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
axios.get(url,
|
|
|
|
|
|
|
|
{params:dataquerys}
|
|
|
|
|
|
|
|
).then((response) => {
|
|
|
|
if(response){
|
|
|
|
if(response){
|
|
|
|
if(response.data){
|
|
|
|
if(response.data){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|