From 2de7a09759ced6666150d9b61b895d7ad9da488f Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 18 Mar 2020 16:57:57 +0800 Subject: [PATCH] dialogbox --- public/react/src/components/dialog/index.jsx | 13 + public/react/src/components/dialog/index.less | 21 ++ public/react/src/modules/login/LoginDialog.js | 276 ++++++++---------- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- 4 files changed, 161 insertions(+), 151 deletions(-) create mode 100644 public/react/src/components/dialog/index.jsx create mode 100644 public/react/src/components/dialog/index.less diff --git a/public/react/src/components/dialog/index.jsx b/public/react/src/components/dialog/index.jsx new file mode 100644 index 000000000..ba8ff6d15 --- /dev/null +++ b/public/react/src/components/dialog/index.jsx @@ -0,0 +1,13 @@ +import React from 'react' +import './index.less' + +export default ({ children, style = {} }) => { + + return ( +
+
+ {children} +
+
+ ) +} \ No newline at end of file diff --git a/public/react/src/components/dialog/index.less b/public/react/src/components/dialog/index.less new file mode 100644 index 000000000..2bccf6aa7 --- /dev/null +++ b/public/react/src/components/dialog/index.less @@ -0,0 +1,21 @@ +.dialog-container-wrapper { + display: flex; + position: fixed; + bottom: 0; + right: 0; + top: 0; + left: 0; + z-index: 300; + background: rgba(0, 0, 0, .7); + + flex-flow: column nowrap; + justify-content: center; + align-items: center; +} + +.dialog-body { + width: 405px; + height: auto; + background: #fff; + position: relative; +} \ No newline at end of file diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 9821f0483..2308fe20c 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -1,10 +1,11 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import { notification } from 'antd'; import axios from 'axios'; import './LoginDialog.css'; import { Modal } from 'antd' +import Dialog from '../../components/dialog' import { broadcastChannelPostMessage } from 'educoder' import Notcompletedysl from "../user/Notcompletedysl"; @@ -457,9 +458,7 @@ class LoginDialog extends Component { this.setState({ qqlogin: true }) - //window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` window.location.href = `https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` - // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` } openphoneqqlogin = () => { @@ -485,172 +484,149 @@ class LoginDialog extends Component { isRender = false } return ( - this.handleDialogClose()} - footer={null} - > - { this.setNotcompleteds() }} - /> - - - {isRender === true ? -
-
{ this.handleDialogClose() }}> - -
- -
- {weixinlogin === true ? "" :
    -
  • { this.enter(0) }}>登录
  • -
} - - -
- {weixinlogin === true ? "" :
- -
- - -
- - - this.inputOnBlur(e, 1)} - onPressEnter={disabled === false ? - this.loginEDU : () => { - } - // console.log(1) - } - value={this.state.loginValue} - name="username" - placeholder="请输入有效的手机号/邮箱号" > - -

{Phonenumberisnotco}

- -
- + { + isRender ? + + < Notcompletedysl + modalsType={this.state.MyEduCoderModals} + setNotcompleteds={() => { this.setNotcompleteds() } + } + /> + < div className={dialogBox} > + +
{ this.handleDialogClose() }}> + +
+ +
+ {weixinlogin === true ? "" :
    +
  • { this.enter(0) }}>登录
  • +
} + + +
+ {weixinlogin === true ? "" : + +
+ + +
+ + + this.inputOnBlur(e, 1)} onPressEnter={disabled === false ? - this.loginEDU : () => { - } - // console.log(1) + this.loginEDU : () => { } } - placeholder="密码" > - -
-

- 请输入密码 + value={this.state.loginValue} + name="username" + placeholder="请输入有效的手机号/邮箱号" > + +

{Phonenumberisnotco}

+ +
+ { + } + // console.log(1) + } + placeholder="密码" > + +
+

+ 请输入密码

+
-
- - - {/**/} - -
{ } - // console.log(1) - } - > - 登录 -
- -

- - - - - - - - this.getloginurl("/changepassword")} - className="mr3 color-grey-9">找回密码 - this.getloginurl("/register")} className="color-grey-9">注册 - - -

- - {this.props.user && this.props.user.main_site === true ? this.state.isphone === true ?

- - ———————— 快速登录 ———————— -

-

:

+ +

{ } + } + > 登录
+ +

+ + + + + + + + this.getloginurl("/changepassword")} + className="mr3 color-grey-9">找回密码 + this.getloginurl("/register")} className="color-grey-9">注册 + + +

+ + {this.props.user && this.props.user.main_site === true ? this.state.isphone === true ?

———————— 快速登录 ————————

-

: ""} +

:

+ ———————— 快速登录 ———————— +

+

: ""} - } - {weixinlogin === true ? : ""} + } + {weixinlogin === true ? : ""} - {weixinlogin === true ?

- this.hideweixinlogin()}>返回账号登录 -

: ""} -
- {/*快捷登录*/} + {weixinlogin === true ?

+ this.hideweixinlogin()}>返回账号登录 +

: ""} +
+ + {/*快捷登录*/} + +
+ +
+ : null + } + -
-
- : ""} -
); } diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 6eb1aaeab..83cc28fed 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -49,7 +49,7 @@ export default function TPMIndexHOC(WrappedComponent) { Footerdown: undefined, coursedata: {}, - isRender: true, + isRender: false, AccountProfiletype: false, AccountPhoneemailtype: false, globalLoading: false,