diff --git a/public/react/src/modules/login/Trialapplicationysl.js b/public/react/src/modules/login/Trialapplicationysl.js
new file mode 100644
index 000000000..ec7bebcda
--- /dev/null
+++ b/public/react/src/modules/login/Trialapplicationysl.js
@@ -0,0 +1,722 @@
+import React, {Component} from 'react';
+import {Redirect} from 'react-router';
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogTitle,
+} from 'material-ui/Dialog';
+import axios from 'axios';
+
+import {broadcastChannelPostMessage} from 'educoder'
+import {Tabs, Input, Checkbox, Button, notification, Menu} from 'antd';
+
+
+//试用申请
+class Trialapplicationysl extends Component {
+ // isRender控制弹出窗口显示
+ constructor(props) {
+ super(props)
+ this.state = {
+ props: props,
+ login: "",
+ Phonenumberisnotcocodes: undefined,
+ codes: "",
+ reason: "",
+ Phonenumberisnotcoreason: undefined,
+ isRenders: false,
+ seconds: 60,
+ getverificationcodes: true,
+ Phonenumberisnotco: undefined,
+ Phonenumberisnotcobool: false,
+ readonlyInput: true,
+ user_phone_binded: props.user_phone_binded,
+ showTrial: false,
+ user: undefined,
+ borredss:"bor-reds",
+ borredssz:"bor-reds fl mr5",
+ }
+ //user_phone_binded 判断是否手机号验证
+ // console.log("Trialapplication");
+ // console.log(props);
+ }
+
+ Cancel = () => {
+ this.props.Cancel()
+ }
+
+ componentWillReceiveProps(nextProps) {
+ // console.log("46");
+ // console.log(nextProps);
+ // console.log(this.props);
+ if (nextProps.user != this.props.user) {
+ // console.log("50");
+ // console.log(nextProps.user);
+ if (nextProps.user !== undefined) {
+ // console.log("53");
+ // console.log(nextProps.user);
+ this.setState({
+ user_phone_binded: nextProps.user.user_phone_binded,
+ })
+ }
+
+
+ }
+
+
+ }
+
+
+ //初始化数据
+ componentDidMount() {
+ // console.log("53");
+ //
+ // console.log(this.props.isRenders);
+
+ if (this.props.isRenders != undefined) {
+ this.setState({
+ isRenders: this.props.isRenders
+ })
+ }
+ if (this.props.showTrial != undefined) {
+ // 判断是否返回主页的参数
+ this.setState({
+ showTrial: this.props.showTrial
+ })
+
+ }
+ axios.interceptors.response.use((response) => {
+ if (response != undefined)
+ if (response && response.data.status === 407) {
+ this.setState({
+ isRenders: true
+ })
+ }
+ return response;
+ }, (error) => {
+ //TODO 这里如果样式变了会出现css不加载的情况
+
+ });
+
+ }
+
+ //获取登入
+ loginInputonChange = (e) => {
+ // console.log(e.target.value);
+ this.setState({
+ login: e.target.value,
+ })
+
+
+ }
+ //获取申请理由
+ loginInputonChanges = (e) => {
+ // console.log(e.target.value);
+ this.setState({
+ reason: e.target.value,
+ Phonenumberisnotcoreason: undefined,
+ })
+
+
+ }
+ //获取code
+ codesonChange = (e) => {
+ this.setState({
+ codes: e.target.value,
+ Phonenumberisnotcocodes: undefined,
+ })
+ }
+
+ openNotification = (messge) => {
+ notification.open({
+ message: "提示",
+ description:
+ messge,
+ onClick: () => {
+ console.log('Notification Clicked!');
+ },
+ });
+ };
+ //倒计时
+ getverificationcode = () => {
+ if (this.state.Phonenumberisnotcobool === false) {
+ if (this.state.login.length === 0) {
+ this.setState({
+ Phonenumberisnotco: "请输入正确的手机号或邮箱",
+ })
+ return
+ } else {
+ this.setState({
+ Phonenumberisnotco: "请输入正确的手机号或邮箱",
+ })
+ }
+ return;
+ }
+ if (this.state.getverificationcodes === true) {
+ this.setState({
+ getverificationcodes: undefined,
+ })
+ let timer = setInterval(() => {
+ this.setState((preState) => ({
+ seconds: preState.seconds - 1,
+ }), () => {
+ if (this.state.seconds == 0) {
+ clearInterval(timer);
+ this.setState({
+ getverificationcodes: false,
+ seconds: 60,
+ })
+ }
+ });
+ }, 1000)
+ this.SMSverification();
+ } else {
+ this.setState({
+ getverificationcodes: undefined,
+ })
+ let timer = setInterval(() => {
+ this.setState((preState) => ({
+ seconds: preState.seconds - 1,
+ }), () => {
+ if (this.state.seconds == 0) {
+ clearInterval(timer);
+ this.setState({
+ getverificationcodes: false,
+ seconds: 60,
+
+ })
+ }
+ });
+ }, 1000)
+ this.SMSverification();
+ }
+ }
+
+ //短信验证
+ SMSverification = () => {
+ var url = `/accounts/get_verification_code.json`;
+ axios.get((url), {
+ params: {
+ login: this.state.login,
+ type: 3,
+ }
+ }).then((result) => {
+ //验证有问题{"status":1,"message":"success"}
+ // console.log(result);
+
+
+ }).catch((error) => {
+ console.log(error);
+
+ })
+ }
+
+ handleDialogClose() {
+ if (this.state.showTrial === false) {
+ this.setState({
+ isRenders: false
+ })
+ this.Cancel();
+ window.location.href = "/";
+ } else {
+ this.setState({
+ isRenders: false
+ })
+ this.Cancel();
+ }
+
+ }
+
+ postregistered = () => {
+ //提交按钮
+ if (this.state.user_phone_binded === false) {
+
+ if (this.state.Phonenumberisnotcobool === false) {
+ var iphones = "";
+ if (this.state.Phonenumberisnotco === undefined || this.state.Phonenumberisnotco === null || this.state.Phonenumberisnotco === "") {
+ iphones = "请输入手机号";
+ } else {
+ iphones = this.state.Phonenumberisnotco;
+ }
+
+ this.setState({
+ Phonenumberisnotco: iphones,
+ })
+
+ return;
+ }
+ if (this.state.codes.length === 0) {
+ this.setState({
+ Phonenumberisnotcocodes: "请输入验证码",
+ })
+ return;
+ }
+
+ }
+
+ if (this.state.reason.length === 0) {
+ this.setState({
+ Phonenumberisnotcoreason: "请输入推荐人信息或申请理由",
+ })
+ return;
+ }
+
+ var thiss = this;
+ var url = "/users/trial_apply.json";
+ axios.post(url, {
+ phone: this.state.login,
+ code: this.state.codes,
+ reason: this.state.reason,
+ }).then((result) => {
+ // console.log(result);
+ // this.onTabChange("1");
+ if(result !== undefined){
+ this.props.showNotification(`试用申请已提交,我们将尽快完成审核`);
+ // if (this.state.showTrial === false) {
+ window.location.href = "/";
+ this.setState({
+ isRenders: false
+ })
+ this.Cancel();
+ // } else {
+ // this.setState({
+ // isRenders: false
+ // })
+ // this.Cancel();
+ //
+ // }
+ }
+ }).catch((error) => {
+
+ })
+
+
+ }
+ inputOnBlur = (e) => {
+ this.isCorrectname(e.target.value);
+ // this.Emailphonenumberverification(e.target.value, id);
+ }
+ isCorrectname = (value) => {
+ console.log(value.length);
+ if (value.length === 0) {
+ this.setState({
+ Phonenumberisnotco: undefined,
+ Phonenumberisnotcobool: false,
+ })
+ return;
+ }
+ // var telephone = $("#telephoneAdd.tianjia_phone").val();
+ var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
+ // var email = $("#add_email.tianjia_email").val();
+ var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
+
+ // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
+ var stringdata = undefined;
+ if (!regph.test(value)) {
+ stringdata = "手机号格式不正确";
+ this.setState({
+ Phonenumberisnotco: stringdata,
+ Phonenumberisnotcobool: false,
+ })
+ } else {
+ this.setState({
+ Phonenumberisnotco: undefined,
+ Phonenumberisnotcobool: true,
+ })
+ return
+ }
+
+ if (!regemail.test(value)) {
+ if ((value.indexOf("@") != -1) === true) {
+ stringdata = "邮箱格式不正确";
+ } else {
+ stringdata = "手机号格式不正确";
+
+ }
+ this.setState({
+ Phonenumberisnotco: stringdata,
+ Phonenumberisnotcobool: false,
+ })
+
+ // this.Emailphonenumberverification(value)
+ return
+ } else {
+ this.setState({
+ Phonenumberisnotco: undefined,
+ Phonenumberisnotcobool: true,
+ })
+ return
+ }
+ }
+ //邮箱手机号验证
+ Emailphonenumberverification = (value) => {
+ var url = `/accounts/valid_email_and_phone.json`;
+ axios.get((url), {
+ params: {
+ login: value,
+ type: 2,
+ }
+ }).then((result) => {
+ //验证有问题{"status":1,"message":"success"}
+ // console.log(result);
+
+
+ }).catch((error) => {
+ console.log(error);
+ // this.setState({
+ // login:"",
+ // logins:"",
+ // })
+ })
+ }
+
+ //执行view
+ render() {
+ let {login, codes, reason, isRenders, user_phone_binded,borredss,borredssz, Phonenumberisnotco, getverificationcodes, Phonenumberisnotcocodes, Phonenumberisnotcoreason, seconds} = this.state;
+ // console.log("Trialapplication22222222");
+ // console.log(this.props);
+
+ return (
+
+ {
+ isRenders === false ? "" :
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+ )
+
+
+ }
+
+
+}
+
+export default Trialapplicationysl;
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index c672caa84..a4790ea6d 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -18,7 +18,7 @@ import Addcourses from '../courses/coursesPublic/Addcourses';
import LoginDialog from '../login/LoginDialog';
-import Trialapplication from '../login/Trialapplication'
+import Trialapplicationysl from '../login/Trialapplicationysl'
import 'antd/lib/modal/style/index.css';
@@ -629,7 +629,7 @@ submittojoinclass=(value)=>{
{/* />*/}
{/* :""*/}
{/*}*/}
-
this.cancelModulationModels()} >
+
this.cancelModulationModels()} >
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js
new file mode 100644
index 000000000..cc7a78e13
--- /dev/null
+++ b/public/react/src/modules/user/Notcompletedysl.js
@@ -0,0 +1,70 @@
+import React, { Component } from 'react';
+import { Modal} from 'antd';
+import axios from 'axios';
+import '../../modules/user/common.css';
+//完善个人资料
+class Notcompletedysl extends Component {
+
+ constructor(props) {
+ super(props)
+ this.state ={
+ modalsType:false,
+ }
+
+ }
+ componentDidMount() {
+ // console.log("Notcompletedysl");
+ // console.log("开发了402了");
+
+ axios.interceptors.response.use((response) => {
+ // console.log(response);
+ if (response != undefined)
+ if (response && response.data.status === 402) {
+ this.setState({
+ modalsType: true
+ })
+ }
+ return response;
+ }, (error) => {
+ //TODO 这里如果样式变了会出现css不加载的情况
+
+ });
+
+ }
+
+ modalCancel=()=>{
+ window.location.href = "/";
+ }
+
+ setDownload=()=>{
+ window.location.href ='/account/profile';
+ }
+
+
+ render() {
+ console.log(this.props)
+ return(
+
+
+
+ )
+ }
+}
+
+export default Notcompletedysl;
\ No newline at end of file
From 85ac1dfdf07d9a01c86bdb9464642c4ff35560bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 20 Jul 2019 14:54:38 +0800
Subject: [PATCH 09/16] =?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/user/LoginRegisterComponent.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js
index efd04db70..6a1ef1288 100644
--- a/public/react/src/modules/user/LoginRegisterComponent.js
+++ b/public/react/src/modules/user/LoginRegisterComponent.js
@@ -128,14 +128,17 @@ class LoginRegisterComponent extends Component {
console.log("11111111111111111111111111");
this.state = {
tab:["0"],
- pciphone:pcipns,
+
}
} else if (this.props.match.url === "/register") {
this.state = {
tab:["1"],
- pciphone:pcipns,
+
}
}
+ this.setState({
+ pciphone:pcipns,
+ })
}
From fc8614a33ad1d0a90cbfc2e4c1457eb645a93f68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 20 Jul 2019 14:57:38 +0800
Subject: [PATCH 10/16] =?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/user/ReadPassword.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/ReadPassword.js b/public/react/src/modules/user/ReadPassword.js
index 68072657a..6beab8e62 100644
--- a/public/react/src/modules/user/ReadPassword.js
+++ b/public/react/src/modules/user/ReadPassword.js
@@ -14,7 +14,7 @@ class ReadPassword extends Component {
setDownload=()=>{
//立即联系
- this.props.StudyMakeMoney()
+ window.location.href = "/login"
}
From 724da87ba2dc1690ffc15e75539018d9d802c3ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 20 Jul 2019 15:10:12 +0800
Subject: [PATCH 11/16] =?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/AppConfig.js | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 078c3132c..63c318f19 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -10,26 +10,25 @@ broadcastChannelOnmessage('refreshPage', () => {
})
function locationurl(list){
- if (window.location.port === "3007") {
+ if (window.location.port === "3007") {
- } else {
+ } else {
- if(list===402){
- SetAppModel(402)
- }else if(list===407){
+ if(list===402){
+ SetAppModel(402)
+ }else if(list===407){
- }else{
- window.location.replace(list)
- }
+ }else{
+ window.location.replace(list)
+ }
- }
+ }
}
// TODO 开发期多个身份切换
-const debugType =""
-// window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
-// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
-// window._debugType = debugType;
+const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
+ window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
+window._debugType = debugType;
export function initAxiosInterceptors(props) {
From c2962c961231478f1842d429b603b4e624a9a68f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 20 Jul 2019 15:31:37 +0800
Subject: [PATCH 12/16] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/AppConfig.js | 8 +++----
.../courses/coursesPublic/ShixunModal.js | 22 ++++++++++---------
.../src/modules/courses/new/CoursesNew.js | 8 ++++++-
public/react/src/modules/home/shixunsHome.js | 16 +++++++-------
public/react/src/modules/tpm/TPMBanner.js | 19 ++++++++++++----
5 files changed, 46 insertions(+), 27 deletions(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 3f34ee7a6..b8e98fd8e 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -26,10 +26,9 @@ function locationurl(list){
}
// TODO 开发期多个身份切换
-const debugType =""
-// window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
-// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
-// window._debugType = debugType;
+const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
+ window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
+window._debugType = debugType;
export function initAxiosInterceptors(props) {
@@ -44,6 +43,7 @@ export function initAxiosInterceptors(props) {
proxy="http://47.96.87.25:48080"
+
// 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求;
// 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};
diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js
index f0caef87b..1fc218908 100644
--- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js
+++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js
@@ -146,12 +146,22 @@ class ShixunModal extends Component{
}
savecouseShixunModal=()=>{
+
this.setState({
hometypepvisible:true
})
let {coursesId,patheditarry,datas}=this.props;
- let{category_id}=this.state;
+ if(patheditarry.length===0){
+ this.setState({
+ shixunmodelchke:true,
+ chekicmessage:"请先选择实训",
+ hometypepvisible:false
+ })
+
+ return
+ }
+
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
this.setState({
@@ -159,15 +169,7 @@ class ShixunModal extends Component{
})
return;
}
- if(patheditarry.length===0){
- this.setState({
- shixunmodelchke:true,
- chekicmessage:"请先选择实训",
- hometypepvisible:false
- })
- return
- }
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
@@ -378,7 +380,7 @@ class ShixunModal extends Component{
-
取消
确定
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index e052ed1e3..eb1627e83 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -257,7 +257,13 @@ class CoursesNew extends Component {
}
goback = () => {
- window.history.go(-1)
+
+ if(this.props.match.params.coursesId===undefined){
+ this.props.history.push("/courses");
+ }else{
+ this.props.history.push(`/courses/${this.props.match.params.coursesId}`);
+ }
+ // window.history.go(-1)
}
onCheckAllChange = (e) => {
diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js
index 780691e6c..5400368ec 100644
--- a/public/react/src/modules/home/shixunsHome.js
+++ b/public/react/src/modules/home/shixunsHome.js
@@ -361,7 +361,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -375,7 +375,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -389,7 +389,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -405,7 +405,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -437,7 +437,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -451,7 +451,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -465,7 +465,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
@@ -481,7 +481,7 @@ class ShixunsHome extends Component {
- {item.name}
+ {item.username}
)
diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js
index c9404a792..68113f133 100644
--- a/public/react/src/modules/tpm/TPMBanner.js
+++ b/public/react/src/modules/tpm/TPMBanner.js
@@ -39,7 +39,7 @@ class TPMBanner extends Component {
this.state={
Forkvisible: false,
Senttothetype:false,
- Senttothevcalue:1,
+ Senttothevcalue:undefined,
courses_count:1,
course_list:[],
pagenum:1,
@@ -62,6 +62,7 @@ class TPMBanner extends Component {
isIE:false,
Forkvisibletype: false,
isSpin:false,
+ Senttothevcaluetype:false
}
}
@@ -233,12 +234,21 @@ class TPMBanner extends Component {
});
}
sendeSenttothevcalue=()=>{
+
let {Senttothevcalue}=this.state;
+
+ if(Senttothevcalue===undefined){
+ this.setState({
+ Senttothevcaluetype:true
+ })
+ return
+ }
let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/send_to_course.json";
axios.post(url,{
course_id:Senttothevcalue
}).then((response) => {
+
this.props.showSnackbar(response.data.message);
this.setState({
Senttothetype:false,
@@ -466,6 +476,7 @@ class TPMBanner extends Component {
shixunsreplace,
hidestartshixunsreplacevalue,
Forkvisibletype,
+ Senttothevcaluetype,
isIE} = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = '';
@@ -839,7 +850,7 @@ class TPMBanner extends Component {
/>
-