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

@ -50,7 +50,7 @@ class Users::UpdateAccountService < ApplicationService
end
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?
join_course(user.id,1309, 2)
# sms_notify_admin(user.lastname)

@ -55,13 +55,17 @@ class VideoIndex extends Component{
componentDidMount=()=>{
const { search } = this.props.location;
const { page } = this.state;
if(search && search === "?open=live"){
this.setState({
type:"live"
})
this.checkType("live",page);
}else{
if(search === "?open=new"){
this.setState({
upload:true
})
}
this.checkType("video",page);
}
}
@ -138,10 +142,13 @@ class VideoIndex extends Component{
}
uploadVideo=(upload)=>{
this.setState({
upload
upload,
isSpining:true
})
const { page } = this.state;
this.getList(page);
setTimeout(()=>{
this.getList(page);
},500)
}
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 moment from 'moment';
import Modals from '../../modals/Modals';
import AuthenModel from '../coursmodel/AuthenModel'
import {WordsBtn, ActionBtn} from 'educoder';
@ -49,7 +50,9 @@ class CoursesNew extends Component {
addonAfteronelentwo:0,
bordebool:false,
smallspinning:false,
bottonloading:false
bottonloading:false,
authenmodels:false,
authenmodelsinde:1,
}
}
componentDidMount() {
@ -388,15 +391,35 @@ class CoursesNew extends Component {
});
}
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);
}
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);
}
Searchvalue=(value)=>{
@ -552,6 +575,27 @@ class CoursesNew extends Component {
showApplyForAddOrgModal = () => {
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() {
let {datatime,school,searchlistscholl,bordebool,dataname} = this.state;
const {getFieldDecorator} = this.props.form;
@ -604,6 +648,26 @@ class CoursesNew extends Component {
</style>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...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
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">{moment(item.send_time).fromNow()}</span>
</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>
@ -208,4 +217,4 @@ class MessagePrivate extends Component{
)
}
}
export default MessagePrivate;
export default MessagePrivate;

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

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

@ -258,9 +258,14 @@ function VideoUploadList (props) {
dispatch({type: 'updateTitle', title, index})
}
// login
const protocolLine = <div>上传视频即表示您已同意
<Link to={`/users/${username}/videos/protocol`} style={{color: theme.foreground_select}}>上传内容协议</Link></div>
const { flag } = props;
const { flag , CourseId } = props;
const urls =
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 (
<div className={flag?"edu-back-white pb100 videoUploadList":"educontent videoUploadList"} style={{ marginBottom: `${flag?"0px":"200px"}` }}>
<Prompt

Loading…
Cancel
Save