|
|
|
@ -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";
|
|
|
|
|
|
|
|
|
@ -57,6 +53,8 @@ class TPMBanner extends Component {
|
|
|
|
|
isSpin: false,
|
|
|
|
|
Senttothevcaluetype: false,
|
|
|
|
|
jupyterbool: false,
|
|
|
|
|
openknow:false,
|
|
|
|
|
openshowpublictype:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -99,7 +97,54 @@ class TPMBanner extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openknow=()=>{
|
|
|
|
|
let storage=window.localStorage;
|
|
|
|
|
this.setState({
|
|
|
|
|
openknow:false
|
|
|
|
|
})
|
|
|
|
|
storage.setItem("shixunopenprocess",true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openshowpublic=()=>{
|
|
|
|
|
let storage=window.localStorage;
|
|
|
|
|
this.setState({
|
|
|
|
|
openshowpublictype:false
|
|
|
|
|
})
|
|
|
|
|
storage.setItem("openopenpublictype",true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
if (prevProps != this.props) {
|
|
|
|
|
let shixunopenprocess=window.localStorage.shixunopenprocess;
|
|
|
|
|
let openopenpublictype=window.localStorage.openopenpublictype;
|
|
|
|
|
if(this.props.shixunsDetails.shixun_status === 0 && this.props.identity < 5){
|
|
|
|
|
if(shixunopenprocess===undefined||shixunopenprocess===false){
|
|
|
|
|
this.setState({
|
|
|
|
|
openknow:true
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
openknow:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails.public===0 && this.props.identity < 5){
|
|
|
|
|
if(openopenpublictype===undefined||openopenpublictype===false){
|
|
|
|
|
this.setState({
|
|
|
|
|
openshowpublictype:true
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
openshowpublictype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
let thiisie = this.IEVersion();
|
|
|
|
|
if (thiisie != -1) {
|
|
|
|
|
this.setState({
|
|
|
|
@ -298,7 +343,10 @@ class TPMBanner extends Component {
|
|
|
|
|
|
|
|
|
|
ModalCancel = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype: false
|
|
|
|
|
Modalstype: false,
|
|
|
|
|
Modalstopval: "",
|
|
|
|
|
modalsMidval:undefined,
|
|
|
|
|
ModalsBottomval:"",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
ModalSave = () => {
|
|
|
|
@ -311,16 +359,53 @@ class TPMBanner extends Component {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancel_publish = () => {
|
|
|
|
|
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,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* 申请发布按钮
|
|
|
|
|
* */
|
|
|
|
@ -334,12 +419,17 @@ class TPMBanner extends Component {
|
|
|
|
|
} else {
|
|
|
|
|
evaluation_set_position = response.data.evaluation_set_position
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
Issuevisible: true,
|
|
|
|
|
tag_position: response.data.tag_position,
|
|
|
|
|
evaluation_set_position: evaluation_set_position,
|
|
|
|
|
publishboxstatus: response.data.status,
|
|
|
|
|
})
|
|
|
|
|
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)
|
|
|
|
|
});
|
|
|
|
@ -448,7 +538,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,
|
|
|
|
@ -520,7 +610,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,
|
|
|
|
@ -699,6 +789,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}
|
|
|
|
|
/> : ""}
|
|
|
|
|
|
|
|
|
@ -907,8 +998,21 @@ class TPMBanner extends Component {
|
|
|
|
|
{/*}*/}
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 0 && this.props.identity < 5 ?
|
|
|
|
|
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
|
|
|
|
|
id="challenge_begin">申请发布</a> : ""
|
|
|
|
|
<Popover
|
|
|
|
|
content={
|
|
|
|
|
<pre className={"bannerpd201"}>
|
|
|
|
|
<div>您编辑完成后,可以马上使用到自</div>
|
|
|
|
|
<div className={"wechatcenter mt10"}>己的课堂和实训课程哦</div>
|
|
|
|
|
<div className={"wechatcenter mt15"}><Button type="primary" onClick={this.openknow} >我知道了</Button></div>
|
|
|
|
|
</pre>
|
|
|
|
|
}
|
|
|
|
|
trigger="click"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
visible={this.state.openknow}
|
|
|
|
|
>
|
|
|
|
|
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
|
|
|
|
|
id="challenge_begin">发布</a>
|
|
|
|
|
</Popover>: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
@ -971,7 +1075,32 @@ class TPMBanner extends Component {
|
|
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
{shixunsDetails.shixun_status === 1 && this.props.identity < 5 ?
|
|
|
|
|
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
|
|
|
|
|
<Popover
|
|
|
|
|
content={
|
|
|
|
|
<pre className={"bannerpd201"}>
|
|
|
|
|
<div>申请公开成功后,您的实训将会展示实训列表</div>
|
|
|
|
|
<div className={"wechatcenter mt10"}>平台审核通过,您将获得<span className={"FF6802"}> 1000 </span>金币~</div>
|
|
|
|
|
<div className={"wechatcenter mt15"}><Button type="primary" onClick={this.openshowpublic} >我知道了</Button></div>
|
|
|
|
|
</pre>
|
|
|
|
|
}
|
|
|
|
|
trigger="click"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
visible={this.state.openshowpublictype}
|
|
|
|
|
>
|
|
|
|
|
<Button type="primary" ghost id="challenge_begin" onClick={this.openpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39">
|
|
|
|
|
申请公开
|
|
|
|
|
</Button>
|
|
|
|
|
</Popover>: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{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> : ""
|
|
|
|
|
}
|
|
|
|
|