|
|
|
@ -146,14 +146,60 @@ class PathDetailIndex extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount(){
|
|
|
|
|
this.getdatasindex()
|
|
|
|
|
const query = this.props.location.search;
|
|
|
|
|
// 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.getdatasindexs(undefined,dataqueryss)
|
|
|
|
|
}
|
|
|
|
|
//截取url 数据的
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
getdatasindex=(key)=>{
|
|
|
|
|
json[key] = value;
|
|
|
|
|
}
|
|
|
|
|
} while (arr);
|
|
|
|
|
|
|
|
|
|
return json;
|
|
|
|
|
}
|
|
|
|
|
getdatasindexs=(key,yslwebobject)=>{
|
|
|
|
|
// yslwebobject 后端需要的接口
|
|
|
|
|
let pathid=this.props.match.params.pathId;
|
|
|
|
|
let url="/paths/"+pathid+".json";
|
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
|
|
axios.get(url,
|
|
|
|
|
{params:yslwebobject}
|
|
|
|
|
).then((result)=>{
|
|
|
|
|
if (result.data.status === 407 || result.data.status === 401) {
|
|
|
|
|
debugger
|
|
|
|
|
return;
|
|
|
|
@ -180,6 +226,63 @@ class PathDetailIndex extends Component{
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let righturl="/paths/"+pathid+"/right_banner.json";
|
|
|
|
|
axios.get(righturl).then((result)=>{
|
|
|
|
|
if (result.data.status === 407 || result.data.status === 401) {
|
|
|
|
|
debugger
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.data.status === 403) {
|
|
|
|
|
debugger
|
|
|
|
|
// window.location.href = "/403";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
// detailInfoList:result.data,
|
|
|
|
|
tags:result.data.tags,
|
|
|
|
|
progress:result.data.progress,
|
|
|
|
|
members:result.data.members,
|
|
|
|
|
items: getItems(result.data.members.length),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getdatasindex=(key,yslwebobject)=>{
|
|
|
|
|
// yslwebobject 后端需要的接口
|
|
|
|
|
let pathid=this.props.match.params.pathId;
|
|
|
|
|
let url="/paths/"+pathid+".json";
|
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
|
|
if (result.data.status === 407 || result.data.status === 401) {
|
|
|
|
|
debugger
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.data.status === 403) {
|
|
|
|
|
debugger
|
|
|
|
|
// window.location.href = "/403";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
configShareForCustom(result.data.name, result.data.description)
|
|
|
|
|
|
|
|
|
|
if(result.data.allow_visit===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
detailInfoList:result.data,
|
|
|
|
|
courses:result.data.courses,
|
|
|
|
|
pathtopskey:key===undefined?1:key,
|
|
|
|
|
// items: getItems(result.data.members.length),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let righturl="/paths/"+pathid+"/right_banner.json";
|
|
|
|
|
axios.get(righturl).then((result)=>{
|
|
|
|
|
if (result.data.status === 407 || result.data.status === 401) {
|
|
|
|
|