Merge branch 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
commit
8e44dcb907
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -0,0 +1,64 @@
|
||||
import React, { Component } from 'react';
|
||||
import axios from 'axios'
|
||||
|
||||
import PollDetailTabThirdInfo from '../../../courses/poll/PollDetailTabThirdInfo'
|
||||
|
||||
class PollBanksContent extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
pollDetail:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount = () =>{
|
||||
let bankId=this.props.match.params.bankId;
|
||||
let url = `/exercise_banks/${bankId}.json`
|
||||
axios.get(url).then((result)=>{
|
||||
if(result){
|
||||
let pollDetail = {
|
||||
poll:{
|
||||
id: result.data.poll && result.data.poll.id ,
|
||||
polls_description: result.data.poll && result.data.poll.description,
|
||||
polls_name: result.data.poll && result.data.poll.name,
|
||||
is_public:result.data.poll && result.data.poll.is_public
|
||||
},
|
||||
question_types:result.data.question_types,
|
||||
questions:result.data.questions,
|
||||
}
|
||||
const crumbData={
|
||||
title:result.data.poll && result.data.poll.name,
|
||||
is_public:result.data.poll && result.data.poll.is_public,
|
||||
crumbArray:[
|
||||
{content:'详情'},
|
||||
]
|
||||
}
|
||||
const menuData={
|
||||
tab:'0',//tab选中的index
|
||||
menuArray:[//tab以及tab路由
|
||||
{to:`/banks/poll/${bankId}`,content:'内容详情'}
|
||||
],
|
||||
category:'poll',//毕设选题
|
||||
id:bankId
|
||||
}
|
||||
this.props.initPublic(crumbData,menuData);
|
||||
this.setState({
|
||||
pollDetail
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
render(){
|
||||
let { pollDetail } = this.state
|
||||
|
||||
return(
|
||||
<div>
|
||||
<PollDetailTabThirdInfo {...this.props} {...this.state} pollDetail = {pollDetail}></PollDetailTabThirdInfo>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default PollBanksContent
|
Loading…
Reference in new issue