From b8275eb7fc1025a149a607b8a06b51eb9dd53eea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 19 Dec 2019 20:58:23 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/tpm/TPMBanner.js | 56 ++++++++++++-------
.../tpm/TPMsettings/Shixuninformation.js | 11 +++-
.../tpm/shixunchild/Challenges/Challenges.js | 2 +-
3 files changed, 45 insertions(+), 24 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js
index 77b82c6c6..da48a5b19 100644
--- a/public/react/src/modules/tpm/TPMBanner.js
+++ b/public/react/src/modules/tpm/TPMBanner.js
@@ -109,29 +109,45 @@ class TPMBanner extends Component {
if (prevProps != this.props) {
let shixunopenprocess=window.localStorage.shixunopenprocess;
let openopenpublictype=window.localStorage.openopenpublictype;
- if(this.props.shixunsDetails&&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.status===0&&this.props.openknows===false){
+
+ if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 0 && this.props.identity < 5){
+ if(shixunopenprocess===undefined||shixunopenprocess===false){
+ this.setState({
+ openknow:true
+ })
+ }else{
+ this.setState({
+ openknow:false
+ })
+ }
}
+ }else{
+ this.setState({
+ openknow:false
+ })
}
- if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails&&this.props.shixunsDetails.public===0 && this.props.identity < 5){
- if(openopenpublictype===undefined||openopenpublictype===false){
- this.setState({
- openshowpublictype:true
- })
- }else{
- this.setState({
- openshowpublictype:false
- })
+
+
+ if(this.props.public===0&&this.props.status>1&&this.props.openknows===false){
+ if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails&&this.props.shixunsDetails.public===0 && this.props.identity < 5){
+ if(openopenpublictype===undefined||openopenpublictype===false){
+ this.setState({
+ openshowpublictype:true
+ })
+ }else{
+ this.setState({
+ openshowpublictype:false
+ })
+ }
}
+ }else{
+ this.setState({
+ openshowpublictype:false
+ })
}
+
}
}
@@ -779,8 +795,8 @@ class TPMBanner extends Component {
};
//
// console.log(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter)
- console.log(this.props)
- console.log(this.state)
+ // console.log(this.props)
+ // console.log(this.state)
return (
shixunsDetails === undefined ? "" :
diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js
index 75ed88852..66e1da8dd 100644
--- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js
+++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js
@@ -50,10 +50,15 @@ class Shixuninformation extends Component {
}
componentDidMount() {
- let anchorElement = document.getElementById("newcourseContentMD");
- if(anchorElement){
- this.scrollToAnchor("newcourseContentMD");
+ let query=this.props.location.search
+ const types = query.split('?edit=')
+ if(types[1]==="1"){
+ let anchorElement = document.getElementById("newcourseContentMD");
+ if(anchorElement){
+ this.scrollToAnchor("newcourseContentMD");
+ }
}
+
}
componentDidUpdate(prevProps, prevState) {
diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js
index 8890efbd2..548e7224a 100644
--- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js
+++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js
@@ -407,7 +407,7 @@ class Challenges extends Component {
简介
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ?
-
+
{/*
*/}
编辑
:""}