Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

sso
cxt 5 years ago
commit d6dc81692a

@ -51,12 +51,12 @@ class AccountsController < ApplicationController
# todo user_extension # todo user_extension
UserExtension.create!(user_id: @user.id) UserExtension.create!(user_id: @user.id)
# 注册完成手机号或邮箱想可以奖励500金币 # 注册完成手机号或邮箱想可以奖励500金币
RewardGradeService.call( # RewardGradeService.call(
@user, # @user,
container_id: @user.id, # container_id: @user.id,
container_type: pre == 'p' ? 'Phone' : 'Mail', # container_type: pre == 'p' ? 'Phone' : 'Mail',
score: 500 # score: 500
) # )
# 注册时,记录是否是引流用户 # 注册时,记录是否是引流用户
ip = request.remote_ip ip = request.remote_ip
ua = UserAgent.find_by_ip(ip) ua = UserAgent.find_by_ip(ip)

@ -50,7 +50,7 @@ class Users::UpdateAccountService < ApplicationService
end end
if first_full_reward if first_full_reward
RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500) # RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500)
if user.user_extension.teacher? if user.user_extension.teacher?
join_course(user.id,1309, 2) join_course(user.id,1309, 2)
# sms_notify_admin(user.lastname) # sms_notify_admin(user.lastname)

@ -55,13 +55,17 @@ class VideoIndex extends Component{
componentDidMount=()=>{ componentDidMount=()=>{
const { search } = this.props.location; const { search } = this.props.location;
const { page } = this.state; const { page } = this.state;
if(search && search === "?open=live"){ if(search && search === "?open=live"){
this.setState({ this.setState({
type:"live" type:"live"
}) })
this.checkType("live",page); this.checkType("live",page);
}else{ }else{
if(search === "?open=new"){
this.setState({
upload:true
})
}
this.checkType("video",page); this.checkType("video",page);
} }
} }
@ -138,10 +142,13 @@ class VideoIndex extends Component{
} }
uploadVideo=(upload)=>{ uploadVideo=(upload)=>{
this.setState({ this.setState({
upload upload,
isSpining:true
}) })
const { page } = this.state; const { page } = this.state;
this.getList(page); setTimeout(()=>{
this.getList(page);
},500)
} }
toUpload =()=> { toUpload =()=> {

@ -0,0 +1,49 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './authenmodels.css'
//立即申请试用
class AuthenModel extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.authenmodels===undefined?false:this.props.authenmodels}
width="442px"
>
<div className="educouddiv">
{
this.props.authenmodelsinde&&this.props.authenmodelsinde===1?
<div className={"tabeltext-alignleft mt10"}><p className="titiles">选择该项后所有学员必须经过平台实名审核才能加入课堂您确定吗</p></div>
:
this.props.authenmodelsinde&&this.props.authenmodelsinde===2?
<div className={"tabeltext-alignleft mt10"}><p className="titiles">选择该项后所有学员必须经过平台职业审核才能加入课堂您确定吗</p></div>
:""
}
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.setmodalsTypedel(false,this.props.authenmodelsinde)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setmodalsTypedel(true,this.props.authenmodelsinde)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default AuthenModel;

File diff suppressed because it is too large Load Diff

@ -6,6 +6,7 @@ import "../css/Courses.css";
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment'; import moment from 'moment';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import AuthenModel from '../coursmodel/AuthenModel'
import {WordsBtn, ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn} from 'educoder';
@ -49,7 +50,9 @@ class CoursesNew extends Component {
addonAfteronelentwo:0, addonAfteronelentwo:0,
bordebool:false, bordebool:false,
smallspinning:false, smallspinning:false,
bottonloading:false bottonloading:false,
authenmodels:false,
authenmodelsinde:1,
} }
} }
componentDidMount() { componentDidMount() {
@ -388,15 +391,35 @@ class CoursesNew extends Component {
}); });
} }
onchanges =(e)=>{ onchanges =(e)=>{
this.setState({ //实名认证
Realnamecertification:e.target.checked,
}) if(e.target.checked===true){
this.setState({
authenmodels:true,
authenmodelsinde:1
})
}else{
this.setState({
Realnamecertification:e.target.checked,
})
}
// console.log(e.target.checked); // console.log(e.target.checked);
} }
onchangess=(e)=>{ onchangess=(e)=>{
this.setState({ //职业认证
Professionalcertification:e.target.checked, if(e.target.checked===true){
}) this.setState({
authenmodels:true,
authenmodelsinde:2
})
}else{
this.setState({
Professionalcertification:e.target.checked,
})
}
// console.log(e.target.checked); // console.log(e.target.checked);
} }
Searchvalue=(value)=>{ Searchvalue=(value)=>{
@ -552,6 +575,27 @@ class CoursesNew extends Component {
showApplyForAddOrgModal = () => { showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
} }
setmodalsTypedel=(bool,i)=>{
if(i===1){
if(bool===true){
this.setState({
Realnamecertification:true,
})
}
}else if(i===2){
if(bool===true){
this.setState({
Professionalcertification:true,
})
}
}
this.setState({
authenmodels:false
})
}
render() { render() {
let {datatime,school,searchlistscholl,bordebool,dataname} = this.state; let {datatime,school,searchlistscholl,bordebool,dataname} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
@ -604,6 +648,26 @@ class CoursesNew extends Component {
</style> </style>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school} <ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...propsWithoutForm}></ApplyForAddOrgModal> {...propsWithoutForm}></ApplyForAddOrgModal>
{
this.state.authenmodels&&this.state.authenmodels===true?
<style>
{
`
body{
position: relative;
width: calc(100% - 0px) !important ;
}
`
}
</style>
:""
}
{
this.state.authenmodels&&this.state.authenmodels===true?
<AuthenModel {...this.state} {...this.props} authenmodelsinde={this.state.authenmodelsinde} setmodalsTypedel={(bool,i)=>this.setmodalsTypedel(bool,i)}></AuthenModel>
:""
}
{/*提示*/} {/*提示*/}
<Modals <Modals
modalsType={this.state.Modalstype} modalsType={this.state.Modalstype}

@ -176,6 +176,15 @@ class MessagePrivate extends Component{
<span className="color-grey-c mr20">[{item.message_count}{"条"}]</span> <span className="color-grey-c mr20">[{item.message_count}{"条"}]</span>
<span className="color-grey-c">{moment(item.send_time).fromNow()}</span> <span className="color-grey-c">{moment(item.send_time).fromNow()}</span>
</p> </p>
<style>
{
`
.markdown-body p img{
width:200px;
}
`
}
</style>
<div className="color-grey-6 break_word_firefox markdown-body mt10" dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></div> <div className="color-grey-6 break_word_firefox markdown-body mt10" dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></div>
</div> </div>

@ -187,14 +187,14 @@ const App = (props) => {
defaultSortOrder: 'descend', defaultSortOrder: 'descend',
sorter: (a, b) => a.passed_games_count - b.passed_games_count sorter: (a, b) => a.passed_games_count - b.passed_games_count
}, },
{ // {
title: '代码行', // title: '代码行',
dataIndex: 'code_line_count', // dataIndex: 'code_line_count',
align: 'center', // align: 'center',
with: 130, // with: 130,
render: (val) => val + '', // render: (val) => val + '',
sorter: (a, b) => a.code_line_count - b.code_line_count // sorter: (a, b) => a.code_line_count - b.code_line_count
}, // },
{ {
title: '评测次数', title: '评测次数',
dataIndex: 'evaluate_count', dataIndex: 'evaluate_count',

@ -5,17 +5,16 @@ import axios from 'axios'
import okIcon from './images/ok_border.png' import okIcon from './images/ok_border.png'
function VideoProtocol (props) { function VideoProtocol (props) {
const theme = useContext(ThemeContext);
const username = props.match.params.username const username = props.match.params.username
const { history } = props; const { search } = props.history.location;
const courseId = search && search.split("=")[1];
return ( return (
<div className={`educontent videoProtocol`}> <div className={`educontent videoProtocol`}>
<CBreadcrumb <CBreadcrumb
className="mb26 mt16" className="mb26 mt16"
separator=" > " separator=" > "
items={[ items={[
{ to: `/users/${username}/videos/upload`, name: '视频上传'}, { to: `${courseId?`/courses/${courseId}/course_videos?open=new`:`/users/${username}/videos/upload`}`, name: '视频上传'},
{ name: '内容上传协议'} { name: '内容上传协议'}
]} ]}
></CBreadcrumb> ></CBreadcrumb>

@ -258,9 +258,14 @@ function VideoUploadList (props) {
dispatch({type: 'updateTitle', title, index}) dispatch({type: 'updateTitle', title, index})
} }
// login // login
const protocolLine = <div>上传视频即表示您已同意 const { flag , CourseId } = props;
<Link to={`/users/${username}/videos/protocol`} style={{color: theme.foreground_select}}>上传内容协议</Link></div> const urls =
const { flag } = props; flag ?
<Link to={`/users/${username}/videos/protocol?course=${CourseId}`} target="_blank" style={{color: theme.foreground_select}}>上传内容协议</Link>
:
<Link to={`/users/${username}/videos/protocol`} style={{color: theme.foreground_select}}>上传内容协议</Link>
const protocolLine = <div>上传视频即表示您已同意{urls}不得上传未经他人授权的作品</div>
return ( return (
<div className={flag?"edu-back-white pb100 videoUploadList":"educontent videoUploadList"} style={{ marginBottom: `${flag?"0px":"200px"}` }}> <div className={flag?"edu-back-white pb100 videoUploadList":"educontent videoUploadList"} style={{ marginBottom: `${flag?"0px":"200px"}` }}>
<Prompt <Prompt

Loading…
Cancel
Save