|
|
|
@ -18,24 +18,29 @@ class Trialapplication extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
props:props,
|
|
|
|
|
props: props,
|
|
|
|
|
login: "",
|
|
|
|
|
Phonenumberisnotcocodes:undefined,
|
|
|
|
|
Phonenumberisnotcocodes: undefined,
|
|
|
|
|
codes: "",
|
|
|
|
|
reason: "",
|
|
|
|
|
Phonenumberisnotcoreason:undefined,
|
|
|
|
|
isRenders:false,
|
|
|
|
|
Phonenumberisnotcoreason: undefined,
|
|
|
|
|
isRenders: false,
|
|
|
|
|
seconds: 60,
|
|
|
|
|
getverificationcodes: true,
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
readonlyInput: true,
|
|
|
|
|
user_phone_binded: false,
|
|
|
|
|
showTrial: false,
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
//user_phone_binded 判断是否手机号验证
|
|
|
|
|
console.log("Trialapplication");
|
|
|
|
|
console.log(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Cancel = () => {
|
|
|
|
|
this.props.Cancel()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
|
|
|
|
|
@ -45,46 +50,50 @@ class Trialapplication extends Component {
|
|
|
|
|
// console.log("componentWillReceiveProps");
|
|
|
|
|
// console.log(nextProps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//初始化数据
|
|
|
|
|
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) {
|
|
|
|
|
if (response != undefined)
|
|
|
|
|
if (response && response.data.status === 407) {
|
|
|
|
|
this.setState({
|
|
|
|
|
isRenders: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return response;
|
|
|
|
|
}, (error) => {
|
|
|
|
|
// // if (error.response && error.response.data.error === '401 Unauthorized') {
|
|
|
|
|
// // this.back_url = window.location.href;
|
|
|
|
|
// // this.setState({
|
|
|
|
|
// // isRender: true
|
|
|
|
|
// // })
|
|
|
|
|
// // // TODO 这里如果样式变了会出现css不加载的情况
|
|
|
|
|
// // const $ = window.$;
|
|
|
|
|
// // const isCssLoaded = window.getComputedStyle($('.log_nav li.active')[0], null)
|
|
|
|
|
// // .getPropertyValue('border-bottom')
|
|
|
|
|
// // == "2px solid rgb(69, 155, 229)"
|
|
|
|
|
// // if (!isCssLoaded) {
|
|
|
|
|
// // const isPort3007 = window.location.port == 3007;
|
|
|
|
|
// // let _url_origin = isPort3007 ? 'http://localhost:3000' : ''
|
|
|
|
|
// //
|
|
|
|
|
// // $('head').append( $('<link rel="stylesheet" type="text/css" />')
|
|
|
|
|
// // .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css`) );
|
|
|
|
|
// // $('head').append( $('<link rel="stylesheet" type="text/css" />')
|
|
|
|
|
// // .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css`) );
|
|
|
|
|
// // }
|
|
|
|
|
// // }
|
|
|
|
|
// // return Promise.reject(error);
|
|
|
|
|
});
|
|
|
|
|
// console.log("89");
|
|
|
|
|
try {
|
|
|
|
|
// console.log(this.state.props.user && this.state.props.user.user_phone_binded);
|
|
|
|
|
if (this.state.props.user !== undefined) {
|
|
|
|
|
this.setState({
|
|
|
|
|
user_phone_binded: this.state.props.user.user_phone_binded,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取登入
|
|
|
|
@ -101,7 +110,7 @@ class Trialapplication extends Component {
|
|
|
|
|
// console.log(e.target.value);
|
|
|
|
|
this.setState({
|
|
|
|
|
reason: e.target.value,
|
|
|
|
|
Phonenumberisnotcoreason:undefined,
|
|
|
|
|
Phonenumberisnotcoreason: undefined,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -110,7 +119,7 @@ class Trialapplication extends Component {
|
|
|
|
|
codesonChange = (e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
codes: e.target.value,
|
|
|
|
|
Phonenumberisnotcocodes:undefined,
|
|
|
|
|
Phonenumberisnotcocodes: undefined,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -199,47 +208,57 @@ class Trialapplication extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleDialogClose() {
|
|
|
|
|
if (this.state.showTrial === false) {
|
|
|
|
|
this.setState({
|
|
|
|
|
isRenders: false
|
|
|
|
|
})
|
|
|
|
|
this.Cancel();
|
|
|
|
|
window.location.href = "/";
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
isRenders: false
|
|
|
|
|
})
|
|
|
|
|
this.Cancel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postregistered = () => {
|
|
|
|
|
//提交按钮
|
|
|
|
|
debugger
|
|
|
|
|
if (this.state.user_phone_binded === false) {
|
|
|
|
|
|
|
|
|
|
if (this.state.Phonenumberisnotcobool === false) {
|
|
|
|
|
// if (this.state.login.length === 0) {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Phonenumberisnotco: "请输入手机号或邮箱",
|
|
|
|
|
// })
|
|
|
|
|
// console.log("postregistered");
|
|
|
|
|
// console.log("123456");
|
|
|
|
|
//
|
|
|
|
|
// return
|
|
|
|
|
// } else {
|
|
|
|
|
var iphones = "";
|
|
|
|
|
if (this.state.Phonenumberisnotco === undefined || this.state.Phonenumberisnotco === null || this.state.Phonenumberisnotco === "") {
|
|
|
|
|
iphones = "请输入手机号";
|
|
|
|
|
} else {
|
|
|
|
|
iphones = this.state.Phonenumberisnotco;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: this.state.Phonenumberisnotco,
|
|
|
|
|
Phonenumberisnotco: iphones,
|
|
|
|
|
})
|
|
|
|
|
// console.log("postregistered");
|
|
|
|
|
// console.log("1234567");
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.state.codes.length===0){
|
|
|
|
|
if (this.state.codes.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotcocodes: "请输入验证码",
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.state.reason.length === 0){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
@ -249,7 +268,21 @@ class Trialapplication extends Component {
|
|
|
|
|
// console.log(result);
|
|
|
|
|
try {
|
|
|
|
|
// this.onTabChange("1");
|
|
|
|
|
thiss.props.showNotification(`试用申请已提交,我们将尽快完成审核`);
|
|
|
|
|
if (thiss.state.showTrial === false) {
|
|
|
|
|
window.location.href = "/";
|
|
|
|
|
thiss.setState({
|
|
|
|
|
isRenders: false
|
|
|
|
|
})
|
|
|
|
|
thiss.Cancel();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
thiss.setState({
|
|
|
|
|
isRenders: false
|
|
|
|
|
})
|
|
|
|
|
thiss.Cancel();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -339,13 +372,14 @@ class Trialapplication extends Component {
|
|
|
|
|
|
|
|
|
|
//执行view
|
|
|
|
|
render() {
|
|
|
|
|
let {login, codes, reason, isRenders, Phonenumberisnotco, getverificationcodes,Phonenumberisnotcocodes,Phonenumberisnotcoreason, seconds} = this.state;
|
|
|
|
|
let {login, codes, reason, isRenders, user_phone_binded, Phonenumberisnotco, getverificationcodes, Phonenumberisnotcocodes, Phonenumberisnotcoreason, seconds} = this.state;
|
|
|
|
|
// console.log("Trialapplication22222222");
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
isRenders === false?"":
|
|
|
|
|
isRenders === false ? "" :
|
|
|
|
|
|
|
|
|
|
<div style={{"border-radius": "15px"}}>
|
|
|
|
|
<style>
|
|
|
|
@ -515,8 +549,22 @@ class Trialapplication extends Component {
|
|
|
|
|
}}>
|
|
|
|
|
<i className="iconfont icon-shanchudiao"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"login_register_content"} style={{"border-radius": "15px","width": "560px"}}>
|
|
|
|
|
<div className={"login_register_content"} style={{
|
|
|
|
|
<div className={"login_register_content"} style={{"border-radius": "15px", "width": "560px"}}>
|
|
|
|
|
|
|
|
|
|
<div className={"login_register_content"} style={
|
|
|
|
|
user_phone_binded === true ?
|
|
|
|
|
{
|
|
|
|
|
"width": "560px", "height": "304px",
|
|
|
|
|
"border-radius": "15px",
|
|
|
|
|
"background": " #FFFFff",
|
|
|
|
|
"text-align": "center",
|
|
|
|
|
// "position": "absolute",
|
|
|
|
|
"left": " 0px",
|
|
|
|
|
"box-sizing": "border-box",
|
|
|
|
|
"padding": "10px",
|
|
|
|
|
}
|
|
|
|
|
:
|
|
|
|
|
{
|
|
|
|
|
"width": "560px", "height": "390px",
|
|
|
|
|
"border-radius": "15px",
|
|
|
|
|
"background": " #FFFFff",
|
|
|
|
@ -524,8 +572,10 @@ class Trialapplication extends Component {
|
|
|
|
|
// "position": "absolute",
|
|
|
|
|
"left": " 0px",
|
|
|
|
|
"box-sizing": "border-box",
|
|
|
|
|
"padding":"10px",
|
|
|
|
|
}}>
|
|
|
|
|
"padding": "10px",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<ul>
|
|
|
|
|
<span style={{
|
|
|
|
|
"padding": "20px",
|
|
|
|
@ -544,6 +594,9 @@ class Trialapplication extends Component {
|
|
|
|
|
<div>
|
|
|
|
|
<span style={{"color": "#4D4D4D"}}>管理员审核批准后,即可继续访问网站</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
user_phone_binded === true ? "" :
|
|
|
|
|
<div style={{
|
|
|
|
|
"margin-top": "15px", "padding-left": "50px",
|
|
|
|
|
"padding-right": "50px"
|
|
|
|
@ -562,11 +615,15 @@ class Trialapplication extends Component {
|
|
|
|
|
: <div className="mt5 mb5" style={{height: "20px"}}></div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
user_phone_binded === true ? "" :
|
|
|
|
|
<div style={{"display": "flex", "justify-content": "center"}}>
|
|
|
|
|
|
|
|
|
|
<Input className="fl mr5" name="codes" type="text" autoComplete="off" readonly
|
|
|
|
|
<Input className="fl mr5" name="codes" type="text" autoComplete="off"
|
|
|
|
|
readonly
|
|
|
|
|
onfocus="this.removeAttribute('readonly')" style={{
|
|
|
|
|
"width": "316px",
|
|
|
|
|
"height": "38px",
|
|
|
|
@ -591,17 +648,22 @@ class Trialapplication extends Component {
|
|
|
|
|
"text-align": "center",
|
|
|
|
|
"height": "38px",
|
|
|
|
|
}} type="primary"
|
|
|
|
|
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button>
|
|
|
|
|
onClick={() => this.getverificationcode()}
|
|
|
|
|
size={"large"}>验证码</Button>
|
|
|
|
|
:
|
|
|
|
|
<Button className="fl ml5 " style={{
|
|
|
|
|
"background": "#4cacff!important",
|
|
|
|
|
"width": "120px",
|
|
|
|
|
"text-align": "center",
|
|
|
|
|
"height": "38px",
|
|
|
|
|
}}type="primary"
|
|
|
|
|
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
|
|
|
|
|
}} type="primary"
|
|
|
|
|
onClick={() => this.getverificationcode()}
|
|
|
|
|
size={"large"}>重新发送</Button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
Phonenumberisnotcocodes && Phonenumberisnotcocodes != "" ?
|
|
|
|
|
<p className="color-red mt2 mb2" style={{width: " 100%", height: "23px"}}>
|
|
|
|
@ -637,6 +699,8 @@ class Trialapplication extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</Dialog>
|
|
|
|
@ -646,7 +710,6 @@ class Trialapplication extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|