董佳音

修改进入个人中心显示对应身份显示

... ... @@ -45,7 +45,7 @@ class ErrorApe extends Ape {
}
}
//显示warn提示框 倒计时结束自动关闭盒子
showWarnError(_msg,_time=3){
showWarnError(_msg,_time=2){
clearTimeout(this._isTime);
$('#warnHintBox').show();
$('#warnHintContent').html(_msg);
... ...
... ... @@ -336,7 +336,7 @@ class LoginOrRegister extends Ape {
}
updateChangeUser(_data){
loger.log('登录成功后更改用户名',_data)
// loger.log('登录成功后更改用户名',_data)
let _dataList = _data.returnData.data;
let oneselfInfoLoginName = $('#oneselfInfoLoginName');//登录名
let oneselfInfoUserName = $('#oneselfInfoUserName');//用户名
... ...
... ... @@ -317,13 +317,23 @@ class MyCenterApe extends Ape {
}
}
_showStatus(){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
$('#teacherMyCenterStatus').text('老师');
$('#teacherMyCerter').show();
$('#studentMyCerter').hide();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
$('#teacherMyCenterStatus').text('同学');
$('#teacherMyCerter').hide();
$('#studentMyCerter').show();
}
}
isLocalStorage(){
let newDate = new Date();
let newHours = newDate.getHours();
let text = newHours>12?'下午好,':'上午好,'
$('#teacherMyCenterTime').text(text);
this._showStatus();
this.detailpage();
loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1)
... ... @@ -448,7 +458,7 @@ class MyCenterApe extends Ape {
let pageno = _data.pageno;
let pagenum = Math.ceil(count / pageno);
let _dataList = _data.meetingInfo;
loger.log('老师端信息想显示',_data)
// loger.log('老师端信息想显示',_data)
this.pageNo = pagenum;
$('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录');
teacherMyCenterContentList.append(adminListTit)
... ... @@ -1154,6 +1164,8 @@ class MyCenterApe extends Ape {
this._showInputBox(this.data);
}
_myCenterBoxHandler(){
this._showStatus();
this.detailpage();
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_2){
return;
}
... ...
... ... @@ -52,8 +52,8 @@ const teacherInfoRight = `</div> <div class="teacherCorrelatedInfoBtn" data="{_t
const teacherDetail = `<span class="teacherDetailCurriculumList">《{_detailList}》</span>`
let loger = Loger.getLoger('PC-MyCenterApe');
class MyCenterApe extends Ape {
let loger = Loger.getLoger('PC-MyCenterStudentApe');
class MyCenterStudentApe extends Ape {
constructor() {
super();
this.isLocalStorage();
... ... @@ -74,9 +74,7 @@ class MyCenterApe extends Ape {
$('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//首页 老师 直播分类 正在直播 未开始 已结束
$('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏
$('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏
$('#teacherLiveList li').on('click',this._teacherLiveListHandler.bind(this));//我的课程 老师 正在直播 未开始 已结束
$('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师
$('#updateInputYes').on('click',this._updateInputYesHandler.bind(this));//确定时把输入的信息存入数据中
... ... @@ -180,39 +178,6 @@ class MyCenterApe extends Ape {
}
}
}
//老师端数据请求
_teacherCurriculumInfo(data,num,ind,callback){
let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting';
let that = this;
$.ajax({
type: "POST",
url: _url,
timeout:5000,
data : data,
headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind,
'token':ClassDataProxy.token},
success:function(_data){
//获取我的课程数据
if(_data && _data.code == 200){
if(callback){
callback(_data);
}
}else{
if(callback){
callback(null);
}
}
},
error:function(error){
//alert('直播数据获取失败')
if(callback){
callback(null);
}
loger.log(error,'直播数据获取失败')
}
})
}
_studentCurriculumInfo(num,callback){
let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id;
let that = this;
... ... @@ -283,20 +248,9 @@ class MyCenterApe extends Ape {
// this.detailpage();
loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1)
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
//首页默认数据
// this.detailPageTeacher();
$('#teacherMyCenterName').text(ClassDataProxy.loginName);
$('#teacherMyCenterStatus').text('老师');
$('#teacherUI .recordLi').eq(2).hide();
$('#teacherMyCerter').show();
$('#studentMyCerter').hide();
$('#myCenterBox').show();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
//首页默认数据
// this.detailPageStudent();
this.detailPageStudent();
$('#myCenterBox').show();
$('#teacherMyCenterName').text(ClassDataProxy.loginName);
$('#teacherMyCenterStatus').text('同学');
... ... @@ -666,9 +620,7 @@ class MyCenterApe extends Ape {
}
//我的预约
myBookingsMessage(){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
this.studentBookings();
}
}
... ... @@ -748,59 +700,12 @@ class MyCenterApe extends Ape {
}
//我的课程
myCoursesMessage(){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
this.teacherCourses();
$('#courseInfoList').hide();
$('#teacherLiveList').show();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
this.studentCourses();
$('#courseInfoList').show();
$('#teacherLiveList').hide();
}
}
teacherCourses(){
let _index = $('#teacherLiveList .liveInfoLeftLiCheck').attr('data');
let courseMinuteList = $('#courseMinuteList');
switch (parseInt(_index)){
case 0:
//正在直播
loger.log('直播首页信息')
this.teacherNowLiveModule(1);
break;
case 1:
//未开始
this.teacherNoneLiveModule(1);
loger.log('直播首页信息1')
break;
case 2:
//已结束
break;
default:
return;
}
}
teacherNowLiveModule(ind){
let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1};
let that = this;
this._teacherCurriculumInfo(data,12,ind,function(_data){
//首页直播信息渲染
if(_data){
// loger.log('首页直播信息渲染',_data)
that._teacherCourse(_data.returnData.data);
}
})
}
teacherNoneLiveModule(ind){
let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName};
let that = this;
this._teacherCurriculumInfo(data,12,ind,function(_data){
//首页直播信息渲染
if(_data){
that._teacherCourse(_data.returnData.data);
}
})
}
//老师端课程数据
_teacherCourseRender(_data){
let courseMinuteList = $('#courseMinuteList');
... ... @@ -1112,10 +1017,7 @@ class MyCenterApe extends Ape {
this._showInputBox(this.data);
}
_myCenterBoxHandler(){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_2){
return;
}
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
this.detailPageStudent();
$('#slideshow').hide();
$('#defaultBox').hide();
$('#classifyListBox').hide();
... ... @@ -1124,9 +1026,7 @@ class MyCenterApe extends Ape {
$('#lanclassAllBox').hide();
$('#teacherIntroAllBox').hide();
$('#teacherDetailBox').hide();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
}
$('#myCenterBox').show();
}
... ... @@ -1294,15 +1194,6 @@ class MyCenterApe extends Ape {
this.commonality(evt);
this.studentCourses();
}
//老师端 我的课程
_teacherLiveListHandler(evt){
this.commonality(evt);
this.teacherCourses();
}
_subscribeListHandler(evt){
this.commonality(evt);
this.studentBookings();
}
//工具类
_format(str, obj) {
return str.replace(/\{(\w+)\}/g, function (match, group, index) {
... ... @@ -1310,4 +1201,4 @@ class MyCenterApe extends Ape {
});
};
}
export default MyCenterApe;
\ No newline at end of file
export default MyCenterStudentApe;
\ No newline at end of file
... ...
... ... @@ -95,8 +95,8 @@ const teacherInfoRight = `</div> <div class="teacherCorrelatedInfoBtn" data="{_t
const teacherDetail = `<span class="teacherDetailCurriculumList">《{_detailList}》</span>`
let loger = Loger.getLoger('PC-MyCenterApe');
class MyCenterApe extends Ape {
let loger = Loger.getLoger('PC-MyCenterTeacherApe');
class MyCenterTeacherApe extends Ape {
constructor() {
super();
this.isLocalStorage();
... ... @@ -111,6 +111,7 @@ class MyCenterApe extends Ape {
}
init() {
$('#personageInfo').on('click',this._myCenterBoxHandler.bind(this));//个人中心
$('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类
$('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//首页 老师 直播分类 正在直播 未开始 已结束
... ... @@ -326,27 +327,16 @@ class MyCenterApe extends Ape {
// this.detailpage();
loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1)
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
//首页默认数据
// this.detailPageTeacher();
this.detailPageTeacher();
$('#teacherMyCenterName').text(ClassDataProxy.loginName);
$('#teacherMyCenterStatus').text('老师');
$('#teacherUI .recordLi').eq(2).hide();
$('#teacherMyCerter').show();
$('#studentMyCerter').hide();
$('#myCenterBox').show();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
//首页默认数据
// this.detailPageStudent();
$('#myCenterBox').show();
$('#teacherMyCenterName').text(ClassDataProxy.loginName);
$('#teacherMyCenterStatus').text('同学');
$('#teacherMyCerter').hide();
$('#studentMyCerter').show();
$('#teacherUI .recordLi').eq(2).show();
}
$('#lanclassBox').hide();
$('#oneselfInfoLoginName').val( ClassDataProxy.loginName);//登录名
... ... @@ -1153,6 +1143,12 @@ class MyCenterApe extends Ape {
this.data = 2;
this._showInputBox(this.data);
}
_myCenterBoxHandler(){
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
alert(1111)
}
this.detailPageTeacher();
}
_updateInputYesHandler(evt){
let updateInput = $('#updateInput').val();
switch (parseInt(this.data)){
... ... @@ -1333,4 +1329,4 @@ class MyCenterApe extends Ape {
});
};
}
export default MyCenterApe;
\ No newline at end of file
export default MyCenterTeacherApe;
\ No newline at end of file
... ...
... ... @@ -147,7 +147,7 @@ class Main {
_loginOrRegister = new LoginOrRegister();
_loginOrRegister.on(MessageTypes.LOGIN_OUT,this.loginOut.bind(this));
_loginOrRegister.on(MessageTypes.LOGIN_IN,this.loginIn.bind(this));
_loginOrRegister.on(MessageTypes.LOGIN_MYCENTER,this.loginMycenter.bind(this));
// _loginOrRegister.on(MessageTypes.LOGIN_MYCENTER,this.loginMycenter.bind(this));
//互动课堂
_lanclassApe = new LanclassApe();
... ... @@ -182,10 +182,7 @@ class Main {
//个人中心
_myCenterApe = new MyCenterApe();
//个人中心学生
_myCenterStudentApe = new MyCenterStudentApe();
//个人中心老师
_myCenterTeacherApe = new MyCenterTeacherApe();
//预约管理
_subscribeApe = new SubscribeApe();
... ... @@ -208,6 +205,7 @@ class Main {
if(_data.userType == ClassDataProxy.USER_TYPE_1){
this._teacherHome();
_teacherDetailApe.detailPage();
_myCenterApe.isLocalStorage();
}else if(_data.userType == ClassDataProxy.USER_TYPE_2){
this._showAdministratorInfo();
_managementHomePageApe.detailPage();
... ... @@ -231,11 +229,15 @@ class Main {
loginMycenter(){
loger.log('个人中心')
if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){
// _myCenterTeacherApe
loger.log('个人中心老师')
//个人中心老师
_myCenterTeacherApe = new MyCenterTeacherApe();
}else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){
// _myCenterStudentApe
loger.log('个人中心学生')
//个人中心学生
_myCenterStudentApe = new MyCenterStudentApe();
}
}
switchClass(_data){
... ...