|
|
|
@ -1,14 +1,10 @@
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
|
|
|
|
|
import {Redirect} from 'react-router';
|
|
|
|
|
|
|
|
|
|
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import {Rating, Progress} from "@icedesign/base";
|
|
|
|
|
|
|
|
|
|
import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Rate} from 'antd';
|
|
|
|
|
import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Button,Popover} from 'antd';
|
|
|
|
|
|
|
|
|
|
import AccountProfile from "../user/AccountProfile";
|
|
|
|
|
|
|
|
|
@ -298,7 +294,10 @@ class TPMBanner extends Component {
|
|
|
|
|
|
|
|
|
|
ModalCancel = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype: false
|
|
|
|
|
Modalstype: false,
|
|
|
|
|
Modalstopval: "",
|
|
|
|
|
modalsMidval:undefined,
|
|
|
|
|
ModalsBottomval:"",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
ModalSave = () => {
|
|
|
|
@ -316,12 +315,48 @@ class TPMBanner extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype: true,
|
|
|
|
|
Modalstopval: "是否确认撤销发布?",
|
|
|
|
|
modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关",
|
|
|
|
|
ModalsBottomval:"卡,学员需要重新体验课程",
|
|
|
|
|
ModalCancel: this.ModalCancel,
|
|
|
|
|
ModalSave: this.ModalSave,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openpublic=()=>{
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = `/shixuns/${id}/apply_public.json`;
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
window.location.reload()
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModalhidenpublicSave=()=>{
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = `/shixuns/${id}/cancel_apply_public.json`;
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
window.location.reload()
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hidenpublic=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype: true,
|
|
|
|
|
Modalstopval: "是否确认撤销公开?",
|
|
|
|
|
modalsMidval:" ",
|
|
|
|
|
ModalsBottomval:" ",
|
|
|
|
|
ModalCancel: this.ModalCancel,
|
|
|
|
|
ModalSave: this.ModalhidenpublicSave,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* 申请发布按钮
|
|
|
|
|
* */
|
|
|
|
@ -335,12 +370,17 @@ class TPMBanner extends Component {
|
|
|
|
|
} else {
|
|
|
|
|
evaluation_set_position = response.data.evaluation_set_position
|
|
|
|
|
}
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
window.location.reload()
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
Issuevisible: true,
|
|
|
|
|
tag_position: response.data.tag_position,
|
|
|
|
|
evaluation_set_position: evaluation_set_position,
|
|
|
|
|
publishboxstatus: response.data.status,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
@ -449,7 +489,7 @@ class TPMBanner extends Component {
|
|
|
|
|
})
|
|
|
|
|
// this.shixunexec(response.data.message+".json")
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
|
|
|
|
|
} else if (response.data.status === -3) {
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsmessage: response.data.message,
|
|
|
|
@ -521,7 +561,7 @@ class TPMBanner extends Component {
|
|
|
|
|
})
|
|
|
|
|
// this.shixunexec(response.data.message+".json")
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
|
|
|
|
|
} else if (response.data.status === -3) {
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsmessage: response.data.message,
|
|
|
|
@ -700,6 +740,7 @@ class TPMBanner extends Component {
|
|
|
|
|
modalCancel={this.state.ModalCancel}
|
|
|
|
|
modalSave={this.state.ModalSave}
|
|
|
|
|
modalsBottomval={this.state.ModalsBottomval}
|
|
|
|
|
modalsMidval={this.state.modalsMidval}
|
|
|
|
|
loadtype={this.state.Loadtype}
|
|
|
|
|
/> : ""}
|
|
|
|
|
|
|
|
|
@ -908,8 +949,22 @@ class TPMBanner extends Component {
|
|
|
|
|
{/*}*/}
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 0 && this.props.identity < 5 ?
|
|
|
|
|
<Popover
|
|
|
|
|
content={
|
|
|
|
|
<pre>
|
|
|
|
|
<div>您编辑完成后,可以马上使用到自</div>
|
|
|
|
|
<div>己的课堂和实训课程哦</div>
|
|
|
|
|
<a onClick={this.hide}>Close</a>
|
|
|
|
|
</pre>
|
|
|
|
|
}
|
|
|
|
|
trigger="click"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
visible={false}
|
|
|
|
|
onVisibleChange={this.handleVisibleChange}
|
|
|
|
|
>
|
|
|
|
|
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
|
|
|
|
|
id="challenge_begin">发布</a> : ""
|
|
|
|
|
id="challenge_begin">发布</a>
|
|
|
|
|
</Popover>: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
@ -972,6 +1027,18 @@ class TPMBanner extends Component {
|
|
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
|
|
|
|
|
<Button type="primary" ghost id="challenge_begin" onClick={this.openpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39">
|
|
|
|
|
申请公开
|
|
|
|
|
</Button>: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ?
|
|
|
|
|
<Button type="primary" ghost id="challenge_begin" onClick={this.hidenpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39">
|
|
|
|
|
撤销公开
|
|
|
|
|
</Button>: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
|
|
|
|
|
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
|
|
|
|
|
id="challenge_begin">撤销发布</a> : ""
|
|
|
|
|