dev_unstable
hjm 6 years ago
parent c10ef72b2e
commit 35a071722f

@ -314,6 +314,7 @@ export function TPMIndexHOC(WrappedComponent) {
})
}
showProfileCompleteDialog = () => {
this.dialogObj = {}
this.setState({
AccountProfiletype: true
})
@ -321,6 +322,20 @@ export function TPMIndexHOC(WrappedComponent) {
checkIfProfileCompleted = () => {
return this.state.current_user && this.state.current_user.profile_completed
}
showProfessionalCertificationDialog = () => {
this.dialogObj = {
content: '您需要去完成您的职业认证,才能使用此功能',
okText: '立即完成',
okHref: '/account/certification'
}
this.setState({
AccountProfiletype: true,
})
}
checkIfProfessionalCertification = () => {
return this.state.current_user && this.state.current_user.professional_certification
}
ShowOnlinePdf = (url) => {
return axios({
@ -358,10 +373,14 @@ export function TPMIndexHOC(WrappedComponent) {
isNotMember: this.isNotMember,
isUserid:this.state.coursedata&&this.state.coursedata.userid,
fetchUser: this.fetchUser,
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
showProfileCompleteDialog: this.showProfileCompleteDialog,
checkIfProfileCompleted: this.checkIfProfileCompleted,
checkIfProfessionalCertification: this.checkIfProfessionalCertification,
showProfessionalCertificationDialog: this.showProfessionalCertificationDialog,
ShowOnlinePdf:(url)=>this.ShowOnlinePdf(url),
DownloadFileA:(title,url)=>this.DownloadFileA(title,url),
}
@ -372,10 +391,12 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.props}
{...this.state}
/> : ""}
{/* AccountProfile 也用作职业认证 */}
{AccountProfiletype===true ? <AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
{...this.dialogObj}
/>:""}
<SiderBar Headertop={Headertop}/>
{/* 注释掉了1440 影响到了手机屏幕的展示 */}

@ -46,8 +46,13 @@ class AccountProfile extends Component {
}
/**
content: '您需要去完成您的职业认证,才能使用此功能',
okText: '立即完成',
okHref: '/account/certification'
*/
render() {
const { content, okText, okHref } = this.props;
return(
<Modal
keyboard={false}
@ -60,10 +65,10 @@ render() {
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">您需要去完善您的个人资料才能使用此功能</p>
<p className="task-popup-text-center font-16"> {content || '您需要去完善您的个人资料,才能使用此功能'}</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.gotoback()}>取消</a>
<a className="task-btn task-btn-orange" href={"/account/profile/edit"}>立即完善</a>
<a className="task-btn task-btn-orange" href={ okHref || "/account/profile/edit" }> {okText || '立即完善'}</a>
</div>
</div>
</Modal>

@ -69,7 +69,12 @@ function InfoVideo (props) {
const username = props.match.params.username
function toUpload() {
history.push(`/users/${username}/videoes/upload`)
if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) {
history.push(`/users/${username}/videoes/upload`)
} else {
props.showProfessionalCertificationDialog()
}
}
function fetchVideoes() {
const fetchUrl = `/users/${username}/videos.json`

Loading…
Cancel
Save