董佳音

修改管理员登录判断,修改列表时间

... ... @@ -647,6 +647,7 @@ body{
width:100%;
display: inline-block;
margin:40px 0;
float: left;
display: none;
}
.classManagementLeft{
... ... @@ -664,20 +665,12 @@ body{
font-size: 14px;
height: 55px;
line-height: 55px;
color:#666666;
}
.recordLiText{
padding-left:15px;
color:#666666;
}
.recordLiText + label {
color:#666666;
}
.recordLiText:checked + label {
color:#666666;
}
/*.recordLi:hover{
color: #3498db;
}*/
.recordLiTextCheck{
color: #3498db;
}
... ... @@ -707,6 +700,9 @@ body{
.liveInfoLeftLi:hover{
border-bottom:1px solid #3498db;
}
.liveInfoLeftLiCheck{
border-bottom:1px solid #3498db;
}
.liveInfoRight{
float: right;
width:200px;
... ... @@ -1202,6 +1198,8 @@ body{
width:42px;
height:42px;
display: inline-block;
font-size: 36px;
text-align: center;
}
.openidOauthTit{
width: 42px;
... ...
... ... @@ -13,18 +13,18 @@
<div class="header_img">
<img src="images/logo.png" alt="">
</div>
<ul class="header_list">
<ul class="header_list" id="header_list">
<li class="header_listMsg header_listTeacherMsg header_listMsgCheck" id="defaultBtn">首页</li>
<li class="header_listMsg" id="liveBtn" data="最新直播课程">直播课堂</li>
<li class="header_listMsg header_listTeacherMsg" id="lanclassBtn" data="最新互动课程">互动课堂</li>
<li class="header_listMsg header_listTeacherMsg" id="teacherBtn" data="推荐老师">老师</li>
</ul>
<div class="header_seek">
<div class="header_seek" id="header_seek">
<input type="text" class="header_seekInput">
<button class="header_seekBtn iconfont">&#xe642;</button>
</div>
<ul class="DownloadLoginBox">
<li class="androidDownload">
<li class="androidDownload" id="androidDownload">
移动端下载
</li>
<li class="userNews iconfont">&#xe6a5;</li>
... ...
... ... @@ -27,7 +27,8 @@ class CreateClassApe extends Ape {
$('#collectYes').hide();
$('#createClassBtn').on('click',this._createClassBtnHandler.bind(this));
$('.recordLi').on('click',this._recordLiHandler.bind(this));
$('.recordLi').on('click',this._recordLiHandler.bind(this));//课堂分类
$('.liveInfoLeftLi').on('click',this._liveInfoLeftLiHandler.bind(this));//直播信息
$('#createClassA').on('click',this._closeClassHandler.bind(this));
$('.main_closeBtn').on('click',this._closeClassHandler.bind(this));
... ... @@ -50,7 +51,10 @@ class CreateClassApe extends Ape {
$('#classifyListContent').find('.classifyList').eq(i==3).addClass('classifyListR');
}
_recordLiHandler(evt){
$(evt.target).addClass('recordLiTextCheck').siblings().removeClass('recordLiTextCheck');
$(evt.currentTarget).addClass('recordLiTextCheck').siblings().removeClass('recordLiTextCheck');
}
_liveInfoLeftLiHandler(evt){
$(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck');
}
_createClassBtnHandler(evt){
$('#createClassBox').show();
... ...
... ... @@ -89,12 +89,13 @@ class HomeApe extends Ape {
for(let i = 0;i<_dataList.length;i++){
if(i<8){
let j = (i%4)==3;
let _getTime = this.getTime(_dataList[i].beginTime,_dataList[i].endTime)
let _classifyList = this._format(classifyList,{
_classifyListR : j?'classifyListR':'',
_id : _dataList[i].id,
_msgImg :'../images/u373.png',
_classroomTitle : _dataList[i].meetingName,
_schoolTime : '11',
_schoolTime : _getTime,
_subscribeNum : _dataList[i].reservationNumber+'人已预约'
})
liveList.append(_classifyList);
... ... @@ -103,6 +104,26 @@ class HomeApe extends Ape {
}
}
}
getTime(start,end){
let newStart = new Date(start)
let newEnd = new Date(end)
let day =1000*3600*24;
let timer = parseInt((newEnd.getTime() - newStart.getTime()) / parseInt(day));
let newEndHours = newEnd.getHours()<10?'0'+newEnd.getHours():newEnd.getHours();
let newStartHours = newStart.getHours()<10?'0'+newStart.getHours():newStart.getHours();
let newStartDate = newStart.getDate()<10?'0'+newStart.getDate():newStart.getDate();
let newStartDay = newStart.getDay()<10?'0'+newStart.getDay():newStart.getDay();
if(timer == 0){
return '今天 ' + ' '+newStartHours + ':00' + ' - ' + newEndHours+':00';
}else{
return newStartDate+1 + '月' + newStartDay +'日 ' + ' '+newStartHours + ':00' + ' - ' + newEndHours+':00';
}
}
//工具类
_format(str, obj) {
return str.replace(/\{(\w+)\}/g, function (match, group, index) {
... ...
... ... @@ -14,6 +14,8 @@ let loger = Loger.getLoger('PC-LoginOrRegister');
class LoginOrRegister extends Ape {
constructor() {
super();
this.localStorage = window.localStorage;
this.isLocalStorage();
this.addEvent();
this.init();
}
... ... @@ -35,6 +37,12 @@ class LoginOrRegister extends Ape {
$('#homeUserLoginBtn').on('click',this._homeUserLoginBtnHandler.bind(this));//首页用户登录
}
isLocalStorage(){
if(window.localStorage.getItem('loginName') && window.localStorage.getItem('password')){
this._showAdministratorInfo();
}
}
addEvent() {
... ... @@ -210,13 +218,16 @@ class LoginOrRegister extends Ape {
"password": _passWord.value, //登录密码
"code":"quwerdf"
}
let that = this;
$.ajax({
type: "POST",
url: 'http://192.168.31.8:3000/users/login',
data: signInfo,
success:function(_data){
console.log(_data,'成功')
that.successLogin(_data);
window.localStorage.setItem("loginName",_name.value);
window.localStorage.setItem("password", _passWord.value);
window.localStorage.setItem("token",_data.returnData.data.token);
},
error:function(error){
debugger;
... ... @@ -232,8 +243,25 @@ class LoginOrRegister extends Ape {
successLogin(_data){
if(_data.code == 200){
this._userLoginAHandler();
//判断状态1 是管理员
this._administratorInfo(_data);
//状态2 是老师
//状态8 是学生
//状态32 是兼课
}
}
_showAdministratorInfo(){
$('#slideshow').hide();
$('#defaultBox').hide();
$('#header_list').hide();
$('#header_seek').hide();
$('#androidDownload').hide();
$('#classManagementBox').show();
}
_administratorInfo(_data){
//显示相应的数据
this._showAdministratorInfo();
}
}
export default LoginOrRegister;
\ No newline at end of file
... ...