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

dev_aliyun_beta
caicai8 5 years ago
commit 2158a64a0c

@ -2,89 +2,90 @@ import React, { Component } from 'react';
const $ = window.jQuery
const jQuery = $;
if (!$.drag) {
(function($){
$.fn.dragValidator = function(options){
var x, drag = this, isMove = false, defaults = {
};
var options = $.extend(defaults, options);
//添加背景,文字,滑块
var html = '<div class="drag_bg"></div>'+
'<div class="drag_text" onselectstart="return false;" unselectable="on">拖动滑块验证</div>'+
'<div class="handler handler_bg"></div>';
this.append(html);
var handler = drag.find('.handler');
var drag_bg = drag.find('.drag_bg');
var text = drag.find('.drag_text');
var maxWidth = text.width() - handler.width(); //能滑动的最大间距
//鼠标按下时候的x轴的位置
handler.mousedown(function(e){
isMove = true;
x = e.pageX - parseInt(handler.css('left'), 10);
});
//鼠标指针在上下文移动时移动距离大于0小于最大间距滑块x轴位置等于鼠标移动距离
$(document).mousemove(function(e){
var _x = e.pageX - x;
var handler_offset = handler.offset();
var lastX = e.clientX -x;
lastX = Math.max(0,Math.min(maxWidth,lastX));
if(isMove){
if(_x > 0 && _x <= maxWidth){
handler.css({'left': lastX});
drag_bg.css({'width': lastX});
}
else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件
dragOk();
}
}
});
handler.mouseup(function(e){
isMove = false;
var _x = e.pageX - x;
if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
handler.animate({'left': 0});
drag_bg.animate({'width': 0});
}
});
//清空事件
function dragOk(){
options.dragOkCallback && options.dragOkCallback()
var kuaiwidth=drag.width() - handler.width() - 2;
handler.removeClass('handler_bg').addClass('handler_ok_bg');
handler.css({'left':kuaiwidth+'px'})
text.css({'width':kuaiwidth+'px'});
text.text('验证通过');
drag.css({'color': '#fff'});
drag_bg.css({'width':kuaiwidth+'px'})
handler.unbind('mousedown');
$(document).unbind('mousemove');
$(document).unbind('mouseup');
$("#user_verification_notice").html("");
$('#user_verification_notice').parent().hide();
}
};
})(jQuery);
}
// if () {
// !$.drag
// (function($){
// $.fn.dragValidator = function(options){
// var x, drag = this, isMove = false, defaults = {
// };
// var options = $.extend(defaults, options);
// //添加背景,文字,滑块
// var html = '<div class="drag_bg"></div>'+
// '<div class="drag_text" onselectstart="return false;" unselectable="on">拖动滑块验证</div>'+
// '<div class="handler handler_bg"></div>';
// this.append(html);
//
// var handler = drag.find('.handler');
// var drag_bg = drag.find('.drag_bg');
// var text = drag.find('.drag_text');
// var maxWidth = text.width() - handler.width(); //能滑动的最大间距
// //鼠标按下时候的x轴的位置
// handler.mousedown(function(e){
// isMove = true;
// x = e.pageX - parseInt(handler.css('left'), 10);
// });
//
// //鼠标指针在上下文移动时移动距离大于0小于最大间距滑块x轴位置等于鼠标移动距离
// $(document).mousemove(function(e){
// var _x = e.pageX - x;
// var handler_offset = handler.offset();
// var lastX = e.clientX -x;
// lastX = Math.max(0,Math.min(maxWidth,lastX));
// if(isMove){
// if(_x > 0 && _x <= maxWidth){
// handler.css({'left': lastX});
// drag_bg.css({'width': lastX});
// }
// else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件
// dragOk();
//
// }
// }
// });
// handler.mouseup(function(e){
// isMove = false;
// var _x = e.pageX - x;
// if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
// handler.animate({'left': 0});
// drag_bg.animate({'width': 0});
// }
// });
//
// //清空事件
// function dragOk(){
// options.dragOkCallback && options.dragOkCallback()
// var kuaiwidth=drag.width() - handler.width() - 2;
// handler.removeClass('handler_bg').addClass('handler_ok_bg');
// handler.css({'left':kuaiwidth+'px'})
// text.css({'width':kuaiwidth+'px'});
// text.text('验证通过');
// drag.css({'color': '#fff'});
// drag_bg.css({'width':kuaiwidth+'px'})
// handler.unbind('mousedown');
// $(document).unbind('mousemove');
// $(document).unbind('mouseup');
// $("#user_verification_notice").html("");
// $('#user_verification_notice').parent().hide();
// }
// };
// })(jQuery);
// }
class DragValidator extends Component {
componentDidMount () {
// if($("#reg-drag").length>0 && IsPC()){
$("#reg-drag").dragValidator({
height: this.props.height,
dragOkCallback: () => {
this.props.dragOkCallback && this.props.dragOkCallback()
}
});
// $("#reg-drag").dragValidator({
// height: this.props.height,
// dragOkCallback: () => {
// this.props.dragOkCallback && this.props.dragOkCallback()
// }
// });
// }else{
// $("#reg-drag").empty();
// }
}
empty() {
$("#reg-drag").empty();
// $("#reg-drag").empty();
}
render() {
const height = this.props.height || 45;

@ -42,7 +42,7 @@ export { SetAppModel } from './components/SetAppModel'
export { default as LinkAfterLogin } from './components/LinkAfterLogin'
export { default as Cropper } from './components/Cropper'
export { default as ConditionToolTip } from './components/ConditionToolTip'
export { default as DragValidator } from './components/DragValidator'
// export { default as DragValidator } from './components/DragValidator'
export { default as PopInstruction } from './components/instruction/PopInstruction'

@ -6,6 +6,7 @@ import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js";
import Jointheclass from '../../modals/Jointheclass';
import LoginDialog from "../../login/LoginDialog";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
//在线学习
class Elearning extends Component{
@ -377,14 +378,8 @@ class Elearning extends Component{
<div className=" clearfix" style={{marginTop:"20px"}}>
{
stages===undefined||stages===JSON.stringify("[]")||stages.length===0?
<div>
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
</div>:
<NoneData></NoneData>
:
<div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}></YslDetailCards>

@ -5,6 +5,8 @@ import './myysleduinforms.css'
import axios from 'axios';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import Bullsubdirectory from "./Bullsubdirectory";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
import moment from "../new/CoursesNew";
import Fileslistitem from "../Resource/Fileslistitem";
// 公告栏
@ -399,11 +401,7 @@ class Eduinforms extends Component{
{
informs === null || informs=== undefined ||informs.length === 0 ?
this.state.yslbool===false?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
<NoneData></NoneData>
:""
:

Loading…
Cancel
Save