|
|
|
@ -72,16 +72,19 @@ class CompetitionCommon extends Component{
|
|
|
|
|
}
|
|
|
|
|
//获取头部信息
|
|
|
|
|
getbannerdata=()=>{
|
|
|
|
|
let menuid=this.props.location.search.replace('?menu=', '');
|
|
|
|
|
// let menuid=this.props.location.search.replace('?menu=', '');
|
|
|
|
|
let query=this.props.location&&this.props.location.search;
|
|
|
|
|
const types = query.split('&')
|
|
|
|
|
const menuid = types[0].split('?menu=')
|
|
|
|
|
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
this.setState({
|
|
|
|
|
data: response.data,
|
|
|
|
|
thiskeys: menuid === undefined || menuid === "" ? response.data.competition_modules[0].id : menuid,
|
|
|
|
|
thiskeys: menuid[1] === undefined || menuid[1] === "" ? response.data.competition_modules[0].id : menuid[1],
|
|
|
|
|
mode: response.data.mode
|
|
|
|
|
})
|
|
|
|
|
if(menuid===undefined||menuid===""){
|
|
|
|
|
if(menuid[1]===undefined||menuid[1]===""){
|
|
|
|
|
this.getrightdata(
|
|
|
|
|
response.data.competition_modules[0].id,
|
|
|
|
|
response.data.competition_modules[0].module_type,
|
|
|
|
@ -91,7 +94,7 @@ class CompetitionCommon extends Component{
|
|
|
|
|
}else{
|
|
|
|
|
let newlist=response.data.competition_modules;
|
|
|
|
|
newlist.map((item,key)=>{
|
|
|
|
|
if(`${item.id}`===`${menuid}`){
|
|
|
|
|
if(`${item.id}`===`${menuid[1]}`){
|
|
|
|
|
this.getrightdata(
|
|
|
|
|
item.id,
|
|
|
|
|
item.module_type,
|
|
|
|
|