实训审核开发 小程序解绑开发

competitions
杨树明 5 years ago
parent 95d8d7d90b
commit 3f8ccccdfe

@ -8,9 +8,9 @@
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000">
<meta http-equiv="cache-control" content="no-cache,no-store, must-revalidate" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<!--<meta http-equiv="cache-control" content="no-cache,no-store, must-revalidate" />-->
<!--<meta http-equiv="pragma" content="no-cache" />-->
<!--<meta http-equiv="Expires" content="0" />-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom'
const map={"blue":"colorblue","white":"colorwhite","grey":"colorgrey", 'orange': "color-orange"}
const map={"blue":"colorblue","white":"colorwhite","grey":"colorgrey", 'orange': "color-orange",'colorgrey9':'color-grey-9'}
class WordsBtn extends Component {
constructor(props) {
super(props);

@ -10,6 +10,7 @@ class Otherloginstart extends Component {
let query=this.props.location.search;
const type = query.split('?code=');
const types = type[1].split('&state=');
console.log(types)
let codeurl = `/auth/wechat/callback.json`
axios.get(codeurl,{params:{
code:types[0]
@ -20,7 +21,12 @@ class Otherloginstart extends Component {
window.location.href="/otherlogin"
}else{
// this.getinfo()
window.location.href="/"
if(types[1]==="account"){
window.location.href="/account/binding"
}else{
window.location.href="/"
}
}
}
}

@ -0,0 +1,163 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { List,Typography,Tag,Modal,Radio} from 'antd';
import TPMRightSection from './component/TPMRightSection';
import TPMNav from './component/TPMNav';
import axios from 'axios';
class Audit_situationComponent extends Component {
constructor(props) {
super(props)
this.state = {
}
}
showModal = () => {
this.setState({
visible: true,
});
};
handleOk = e => {
console.log(e);
this.setState({
visible: false,
});
};
handleCancel = e => {
console.log(e);
this.setState({
visible: false,
});
};
onChange = e => {
console.log('radio checked', e.target.value);
this.setState({
value: e.target.value,
});
};
render() {
const { tpmLoading, shixun, user, match } = this.props;
return (
<React.Fragment>
{this.state.visible===true?<Modal
title="审核情况更改"
visible={this.state.visible}
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
>
<div>
<style>
{
`
body{
width: 100% !important;
}
.ant-modal-body{
text-align: center;
}
`
}
</style>
<Radio.Group onChange={this.onChange} value={this.state.value}>
<Radio value={1}>已完成</Radio>
<Radio value={2}>未完成</Radio>
</Radio.Group>
<div className={"mt30"}>
<a className="pop_close task-btn mr20 margin-tp26" onClick={()=>this.handleCancel()}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" onClick={()=>this.handleOk()}>确定</a>
</div>
</div>
</Modal>:""}
<style>
{
`
.Itemtitle{
float: left;
padding-top: 2px;
margin-right: 10px;
}
`
}
</style>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<div className="tpmComment educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white commentsDelegateParent" >
<TPMNav
match={match}
user={user}
shixun={shixun}
{...this.props}
></TPMNav>
<div className="padding20 edu-back-white mt20" style={{minHeight: '640px'}}>
<List
dataSource={[
{
name: '内容审核情况',
id:1,
type:"未审核"
},
{
name: '性能审核情况',
id:2,
type:"未审核"
},
]}
bordered
renderItem={(item,key) => (
<List.Item
key={item.id}
actions={[
<a onClick={()=>this.showModal(item.id)} key={key}>
<i className="iconfont icon-bianjidaibeijing font-22 color-green"></i>
</a>,
]}
>
<List.Item.Meta
title={<div className={"font-16"}>
<div className={"Itemtitle"}>{item.name}</div>
<Tag color="#FF6800">已完成</Tag>
<Tag color="#bcbcbc">已完成</Tag>
</div>}
description={
<div>
<span>审核时间: 2019-10-17 10:42</span>
<span className={"ml30"}>审核人 XXX</span>
</div>
}
/>
</List.Item>
)}
/>
</div>
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection>
</div>
</div>
}
</React.Fragment>
);
}
}
export default Audit_situationComponent;

@ -22,10 +22,11 @@ import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits'
import TPMsettings from './TPMsettings/TPMsettings';
import TPMChallengeComponent from './TPMChallengeContainer'
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent'
import TPMRanking_listComponent from './TPMRanking_listContainer'
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer'
import TPMChallengeComponent from './TPMChallengeContainer';
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent';
import TPMRanking_listComponent from './TPMRanking_listContainer';
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer';
import Audit_situationComponent from './Audit_situationComponent';
import '../page/tpiPage.css'
@ -347,6 +348,11 @@ class TPMIndex extends Component {
/>)
}></Route>
<Route exact path="/shixuns/:shixunId/audit_situation" render={
(props) => (<Audit_situationComponent {...this.props} {...this.state} {...props}
/>)
}></Route>
<Route exact path="/shixuns/:shixunId/fork_list" render={
(props) => (<TPMFork_listComponent {...this.props} {...props}
/>)

@ -42,8 +42,11 @@ class TPMNav extends Component {
className={`${match.url.indexOf('shixun_discuss') != -1 ? 'active' : ''} fl mr40`}>评论</Link>
<Link to={`/shixuns/${shixunId}/ranking_list`}
className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl`}>排行榜</Link>
{/* target="_blank"*/}
className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl mr40`}>排行榜</Link>
<Link to={`/shixuns/${shixunId}/audit_situation`}
className={`${match.url.indexOf('audit_situation') != -1 ? 'active' : ''} fl`}>审核情况</Link>
<a
href={`/shixuns/${shixunId}/settings`} className="edu-default-btn edu-blueline-btn ml20 fr"
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}

@ -25,11 +25,16 @@ const AccountCertification= Loadable({
loader: () => import('./account/AccountCertification'),
loading: Loading,
})
const AccountSecure= Loadable({
loader: () => import('./account/AccountSecure'),
loading: Loading,
})
const AccountBinding= Loadable({
loader: () => import('./account/AccountBinding'),
loading: Loading,
})
class AccountPage extends Component {
constructor (props) {
super(props)
@ -93,40 +98,48 @@ class AccountPage extends Component {
padding-bottom: 30px;
margin-bottom:30px;
margin-right:20px;
height:418px;
// height:418px;
}
`}</style>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">
<Switch {...this.props}>
<Route exact path="/account/profile"
<Route path="/account/profile"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/profile/edit"
<Route path="/account/profile/edit"
render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/certification"
<Route path="/account/certification"
render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/secure"
<Route path="/account/secure"
render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account"
<Route path="/account/binding"
render={
(props) => (<AccountBinding {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>
</div>

@ -0,0 +1,214 @@
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, WordsBtn } from 'educoder';
import { Form, Button, Input ,Modal } from 'antd'
import Modals from "../../modals/Modals";
import '../../courses/css/Courses.css'
import './common.css'
import axios from 'axios'
class AccountSecure extends Component {
constructor (props) {
super(props)
this.state = {
Modalstype:false,
}
}
showModal=()=>{
this.setState({
visible: true,
});
};
handleOk=(e)=> {
this.setState({
visible: false,
});
};
handleCancel=()=>{
this.setState({
visible: false,
});
};
Cancelundologins=()=>{
this.setState({
Modalstype:false,
ModalCancel:this.Cancelundologin,
ModalSave:this.Saveundologin,
})
}
Saveundologin=(id)=>{
let {basicInfo}=this.props;
let url=`/users/accounts/${basicInfo.id}/open_users/${id}.json`;
axios.delete(url).then((result)=>{
if(result.data.status===0){
this.props.showNotification('解绑成功');
this.props.history.push(`/account/binding`)
}
}).catch((error)=>{
console.log(error)
})
}
undologin=(type,id)=>{
this.setState({
Modalstype:true,
Modalstopval:type==="wechat"?"是否确定解绑微信账号?":"是否确定解绑QQ账号",
ModalCancel:this.Cancelundologins,
ModalSave:()=>this.Saveundologin(id),
})
}
render() {
let {basicInfo}=this.props;
return (
<div>
<div className="basicForm settingForm">
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
loadtype={this.state.loadtype}
/>
<style>{`
// .flexRow {
// padding: 15px 0;
// }
.flexRow .name {
margin-left: 20px;
color: #999999;
text-align: center;
flex: 0 0 100px;
}
.flexRow .description {
flex: 1;
color: #CDCDCD;
}
.description span {
color: #05101A;
}
.flexRow .status {
width: 100px;
color: #28AC7F;
text-align: right;
}
// .flexTable .flexTable {
// border-bottom: 1px solid #EBEBEB;
// }
.settingForm label{
color: #999999;
font-size: 14px !important ;
margin-left: 120px;
}
.settingForm input {
width: 340px;
}
.settingForm input.validateInput {
width: 220px;
}
.settingForm .formItemInline button {
width: 110px;
margin-left: 10px;
}
.settingForm .ant-form-item-label {
width: 204px;
}
.formItemInline .ant-form-explain{
position:absolute;
bottom:-17px;
left:0px;
width:100%;
}
.weixinlogo{
font-size: 40px !important;
color: #4eaf2b;
}
.lineheight60{
line-height: 60px;
}
.pt19{
padding-top: 19px;
}
`}</style>
<div className="title">绑定登陆账号</div>
<Form>
<div className="flexTable">
<div className="flexTable">
</div>
<div className="flexTable">
<div className="flexRow">
<div className="name">
<i className={"iconfont icon-weixin2 weixinlogo mr10"}></i>
<span className={"color-ooo"}>微信</span>
</div>
<div className="description lineheight60">
{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":<span className={"color-grey-9"}>{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}</span>}
</div>
<div className="status pt19">
<WordsBtn style={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"blue":"colorgrey9"} className={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"borderBottom":""}
onClick={
basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?() => this.showModal("wechat"):() => this.undologin("wechat",basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].id)
}
>{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?"立即绑定":"解绑"}</WordsBtn>
</div>
</div>
</div>
<style>
{
`
.ml70{
margin-left: 70px;
}
`
}
</style>
<Modal
closable={false}
footer={null}
visible={this.state.visible}
onOk={this.handleOk}
onCancel={this.handleCancel}
>
<div>
<iframe
className={"weixinheight390 ml70"}
frameBorder="0"
sandbox="allow-scripts allow-same-origin allow-top-navigation"
scrolling="no"
src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login&state=account#wechat_redirect`}></iframe>
<p className="clearfix pagemancenter">
<a className={"startlogin color-blue"} onClick={()=>this.handleCancel()}>取消</a>
</p>
</div>
</Modal>
</div>
</Form>
</div>
<div style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</div>
</div>
);
}
}
const WrappedAccountSecure = Form.create({ name: 'AccountSecure' })(AccountSecure);
export default WrappedAccountSecure;

@ -12,6 +12,9 @@ class AccountNav extends Component {
toSecure = () => {
this.props.history.push(`/account/secure`)
}
isBinding = () => {
this.props.history.push(`/account/binding`)
}
render() {
let { basicInfo, current_user } = this.props
// console.log(this.props);
@ -19,6 +22,7 @@ class AccountNav extends Component {
const isBasic = path.indexOf('profile') != -1 || path == "/account"
const isCertification = path.indexOf('certification') != -1
const isSecure = path.indexOf('secure') != -1
const isBinding = path.indexOf('binding') != -1
return (
<div className="accountNav fl">
<style>{`
@ -105,8 +109,8 @@ class AccountNav extends Component {
<li className={`navItem ${isSecure ? 'active' : ''}`} onClick={this.toSecure}>
<i className="iconfont icon-anquanshezhi color-grey-9 font-16"></i>
</li>
<li className={`navItem ${isSecure ? 'active' : ''}`} onClick={this.toSecure}>
<i className="iconfont icon-anquanshezhi color-grey-9 font-16"></i>
<li className={`navItem ${isBinding ? 'active' : ''}`} onClick={this.isBinding}>
<i className="iconfont icon-lianjie color-grey-9 font-16"></i>
</li>
</ul>
</div>

Loading…
Cancel
Save