正在显示
23 个修改的文件
包含
2911 行增加
和
179 行删除
| @@ -386,6 +386,7 @@ body{ | @@ -386,6 +386,7 @@ body{ | ||
| 386 | height: 280px; | 386 | height: 280px; |
| 387 | float: left; | 387 | float: left; |
| 388 | background: #fff; | 388 | background: #fff; |
| 389 | + border-radius: 3px; | ||
| 389 | margin-right: 25px; | 390 | margin-right: 25px; |
| 390 | cursor: pointer; | 391 | cursor: pointer; |
| 391 | margin-top:25px; | 392 | margin-top:25px; |
| @@ -1543,6 +1544,7 @@ body{ | @@ -1543,6 +1544,7 @@ body{ | ||
| 1543 | float: left; | 1544 | float: left; |
| 1544 | width: 100%; | 1545 | width: 100%; |
| 1545 | padding-top:5px; | 1546 | padding-top:5px; |
| 1547 | + padding-bottom:6px; | ||
| 1546 | } | 1548 | } |
| 1547 | .teacherMyCenter2{ | 1549 | .teacherMyCenter2{ |
| 1548 | float: left; | 1550 | float: left; |
| @@ -1401,7 +1401,8 @@ | @@ -1401,7 +1401,8 @@ | ||
| 1401 | <img class="teacherMyCenterImg" src="images/u373.png" alt=""> | 1401 | <img class="teacherMyCenterImg" src="images/u373.png" alt=""> |
| 1402 | <p class="teacherMyCenterInfoBox"> | 1402 | <p class="teacherMyCenterInfoBox"> |
| 1403 | <span class="teacherMyCenterInfo" id="teacherMyCenterTime">上午好,</span> | 1403 | <span class="teacherMyCenterInfo" id="teacherMyCenterTime">上午好,</span> |
| 1404 | - <span class="teacherMyCenterInfo" id="teacherMyCenterName">小明同学</span> | 1404 | + <span id="teacherMyCenterName">小明同学</span> |
| 1405 | + <span id="teacherMyCenterStatus">小明同学</span> | ||
| 1405 | </p> | 1406 | </p> |
| 1406 | </div> | 1407 | </div> |
| 1407 | <div class="teacherMyCenter2"> | 1408 | <div class="teacherMyCenter2"> |
| @@ -1423,11 +1424,6 @@ | @@ -1423,11 +1424,6 @@ | ||
| 1423 | <label class="myCenterTopRightTit">今日课程</label> | 1424 | <label class="myCenterTopRightTit">今日课程</label> |
| 1424 | <ul id="myCurriculumInfo"> | 1425 | <ul id="myCurriculumInfo"> |
| 1425 | <div class="myCenterTopRightContent">暂无课程!</div> | 1426 | <div class="myCenterTopRightContent">暂无课程!</div> |
| 1426 | - <li class="teacherTodayCourseList"> | ||
| 1427 | - <span class="courseDetailInfo">《初中英语(上)》</span> | ||
| 1428 | - <span class="courseDetailInfo1">距开始还有:<i class="teacherStartContent">02:09:10</i></span> | ||
| 1429 | - <button class="teacherEnterClass btnHover" data="1560071471">立即进入</button> | ||
| 1430 | - </li> | ||
| 1431 | </ul> | 1427 | </ul> |
| 1432 | </div> | 1428 | </div> |
| 1433 | <div class="teacherMyCerter" id="teacherMyCerter"> | 1429 | <div class="teacherMyCerter" id="teacherMyCerter"> |
| @@ -1504,6 +1500,11 @@ | @@ -1504,6 +1500,11 @@ | ||
| 1504 | <li class="liveInfoLeftLi" data="1">已学完</li> | 1500 | <li class="liveInfoLeftLi" data="1">已学完</li> |
| 1505 | <li class="liveInfoLeftLi" data="2">收藏</li> | 1501 | <li class="liveInfoLeftLi" data="2">收藏</li> |
| 1506 | </ul> | 1502 | </ul> |
| 1503 | + <ul class="liveInfoLeft" id="teacherLiveList"> | ||
| 1504 | + <li class="liveInfoLeftLi liveInfoLeftLiCheck" data="0">正在直播</li> | ||
| 1505 | + <li class="liveInfoLeftLi" data="1">未开始</li> | ||
| 1506 | + <li class="liveInfoLeftLi" data="4">已结束</li> | ||
| 1507 | + </ul> | ||
| 1507 | </div> | 1508 | </div> |
| 1508 | <div class="courseMinuteList" id="courseMinuteList"> | 1509 | <div class="courseMinuteList" id="courseMinuteList"> |
| 1509 | <div class="courseMinuteListTimeTit"> | 1510 | <div class="courseMinuteListTimeTit"> |
| @@ -26,5 +26,8 @@ MessageTypes.ADD_CLASS= "add_class"; //创建课堂 | @@ -26,5 +26,8 @@ MessageTypes.ADD_CLASS= "add_class"; //创建课堂 | ||
| 26 | 26 | ||
| 27 | //预约成功 | 27 | //预约成功 |
| 28 | MessageTypes.ORDER_FINISH= "order_finish"; //预约成功 | 28 | MessageTypes.ORDER_FINISH= "order_finish"; //预约成功 |
| 29 | + | ||
| 30 | +//个人中心 | ||
| 31 | +MessageTypes.LOGIN_MYCENTER= "login_mycenter"; //预约成功 | ||
| 29 | export default MessageTypes; | 32 | export default MessageTypes; |
| 30 | 33 |
| @@ -151,7 +151,7 @@ class AboutClassApe extends Ape { | @@ -151,7 +151,7 @@ class AboutClassApe extends Ape { | ||
| 151 | headers: {siteId:ClassDataProxy.siteId, | 151 | headers: {siteId:ClassDataProxy.siteId, |
| 152 | pageno:7, | 152 | pageno:7, |
| 153 | 'page':ind, | 153 | 'page':ind, |
| 154 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 154 | + 'token':ClassDataProxy.token}, |
| 155 | success:function(_data){ | 155 | success:function(_data){ |
| 156 | //获取课堂数据 | 156 | //获取课堂数据 |
| 157 | if(_data && _data.code == 200){ | 157 | if(_data && _data.code == 200){ |
| @@ -70,7 +70,7 @@ class CollectApe extends Ape { | @@ -70,7 +70,7 @@ class CollectApe extends Ape { | ||
| 70 | timeout:5000, | 70 | timeout:5000, |
| 71 | data : data, | 71 | data : data, |
| 72 | headers: {siteId:ClassDataProxy.siteId, | 72 | headers: {siteId:ClassDataProxy.siteId, |
| 73 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 73 | + 'token':ClassDataProxy.token}, |
| 74 | success:function(_data){ | 74 | success:function(_data){ |
| 75 | //获取我的课程数据 | 75 | //获取我的课程数据 |
| 76 | if(_data && _data.code == 200){ | 76 | if(_data && _data.code == 200){ |
| @@ -91,7 +91,7 @@ class CreateClassApe extends Ape { | @@ -91,7 +91,7 @@ class CreateClassApe extends Ape { | ||
| 91 | data:dataInfo, | 91 | data:dataInfo, |
| 92 | headers: {siteId:ClassDataProxy.siteId, | 92 | headers: {siteId:ClassDataProxy.siteId, |
| 93 | pageno:7, | 93 | pageno:7, |
| 94 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 94 | + 'token':ClassDataProxy.token}, |
| 95 | success:function(_data){ | 95 | success:function(_data){ |
| 96 | //获取课堂数据 | 96 | //获取课堂数据 |
| 97 | if(_data && _data.code == 200){ | 97 | if(_data && _data.code == 200){ |
| @@ -268,7 +268,7 @@ class CreateClassApe extends Ape { | @@ -268,7 +268,7 @@ class CreateClassApe extends Ape { | ||
| 268 | url : _url, | 268 | url : _url, |
| 269 | data : dateList, | 269 | data : dateList, |
| 270 | timeout:5000, | 270 | timeout:5000, |
| 271 | - headers: {'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 271 | + headers: {'token':ClassDataProxy.token}, |
| 272 | success:function(_data){ | 272 | success:function(_data){ |
| 273 | loger.log('创建课堂成功',_data) | 273 | loger.log('创建课堂成功',_data) |
| 274 | //获取课堂数据 | 274 | //获取课堂数据 |
| @@ -125,7 +125,7 @@ class CreateGradeApe extends Ape { | @@ -125,7 +125,7 @@ class CreateGradeApe extends Ape { | ||
| 125 | headers: {siteId:ClassDataProxy.siteId, | 125 | headers: {siteId:ClassDataProxy.siteId, |
| 126 | pageno:7, | 126 | pageno:7, |
| 127 | 'page':ind, | 127 | 'page':ind, |
| 128 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 128 | + 'token':ClassDataProxy.token}, |
| 129 | success:function(_data){ | 129 | success:function(_data){ |
| 130 | //获取课堂数据 | 130 | //获取课堂数据 |
| 131 | if(_data && _data.code == 200){ | 131 | if(_data && _data.code == 200){ |
| @@ -192,7 +192,7 @@ class CreateGradeApe extends Ape { | @@ -192,7 +192,7 @@ class CreateGradeApe extends Ape { | ||
| 192 | type: "PUT", | 192 | type: "PUT", |
| 193 | url: _url, | 193 | url: _url, |
| 194 | headers: {siteId:ClassDataProxy.siteId, | 194 | headers: {siteId:ClassDataProxy.siteId, |
| 195 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 195 | + 'token':ClassDataProxy.token}, |
| 196 | success:function(_data){ | 196 | success:function(_data){ |
| 197 | loger.log('删除成功',_data) | 197 | loger.log('删除成功',_data) |
| 198 | if(_data && _data.code == 200){ | 198 | if(_data && _data.code == 200){ |
| @@ -136,7 +136,7 @@ class CreateUserApe extends Ape { | @@ -136,7 +136,7 @@ class CreateUserApe extends Ape { | ||
| 136 | headers: {siteId:ClassDataProxy.siteId, | 136 | headers: {siteId:ClassDataProxy.siteId, |
| 137 | pageno:7, | 137 | pageno:7, |
| 138 | 'page':ind, | 138 | 'page':ind, |
| 139 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 139 | + 'token':ClassDataProxy.token}, |
| 140 | success:function(_data){ | 140 | success:function(_data){ |
| 141 | //获取课堂数据 | 141 | //获取课堂数据 |
| 142 | if(_data && _data.code == 200){ | 142 | if(_data && _data.code == 200){ |
| @@ -288,7 +288,7 @@ class CreateUserApe extends Ape { | @@ -288,7 +288,7 @@ class CreateUserApe extends Ape { | ||
| 288 | type: "PUT", | 288 | type: "PUT", |
| 289 | url: _url, | 289 | url: _url, |
| 290 | headers: {siteId:ClassDataProxy.siteId, | 290 | headers: {siteId:ClassDataProxy.siteId, |
| 291 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 291 | + 'token':ClassDataProxy.token}, |
| 292 | success:function(_data){ | 292 | success:function(_data){ |
| 293 | loger.log('删除成功',_data) | 293 | loger.log('删除成功',_data) |
| 294 | if(_data && _data.code == 200){ | 294 | if(_data && _data.code == 200){ |
| @@ -133,7 +133,7 @@ class HomeApe extends Ape { | @@ -133,7 +133,7 @@ class HomeApe extends Ape { | ||
| 133 | timeout:5000, | 133 | timeout:5000, |
| 134 | data : data, | 134 | data : data, |
| 135 | headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, | 135 | headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, |
| 136 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 136 | + 'token':ClassDataProxy.token}, |
| 137 | success:function(_data){ | 137 | success:function(_data){ |
| 138 | 138 | ||
| 139 | //获取我的课程数据 | 139 | //获取我的课程数据 |
| @@ -65,7 +65,7 @@ class LanclassApe extends Ape { | @@ -65,7 +65,7 @@ class LanclassApe extends Ape { | ||
| 65 | timeout:5000, | 65 | timeout:5000, |
| 66 | headers: {'page':_ele.text(), | 66 | headers: {'page':_ele.text(), |
| 67 | siteId:ClassDataProxy.siteId, | 67 | siteId:ClassDataProxy.siteId, |
| 68 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo', | 68 | + 'token':ClassDataProxy.token |
| 69 | }, | 69 | }, |
| 70 | data:{siteId:ClassDataProxy.siteId}, | 70 | data:{siteId:ClassDataProxy.siteId}, |
| 71 | success:function(_data){ | 71 | success:function(_data){ |
| @@ -92,7 +92,7 @@ class LanclassApe extends Ape { | @@ -92,7 +92,7 @@ class LanclassApe extends Ape { | ||
| 92 | timeout:5000, | 92 | timeout:5000, |
| 93 | data:{siteId:ClassDataProxy.siteId,meetingStatus:1}, | 93 | data:{siteId:ClassDataProxy.siteId,meetingStatus:1}, |
| 94 | headers: {siteId:ClassDataProxy.siteId, | 94 | headers: {siteId:ClassDataProxy.siteId, |
| 95 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 95 | + 'token':ClassDataProxy.token}, |
| 96 | success:function(_data){ | 96 | success:function(_data){ |
| 97 | //获取课堂数据 | 97 | //获取课堂数据 |
| 98 | if(_data && _data.code == 200){ | 98 | if(_data && _data.code == 200){ |
| @@ -93,7 +93,7 @@ class ListDetailsApe extends Ape { | @@ -93,7 +93,7 @@ class ListDetailsApe extends Ape { | ||
| 93 | timeout:5000, | 93 | timeout:5000, |
| 94 | data : data, | 94 | data : data, |
| 95 | headers: {siteId:ClassDataProxy.siteId, | 95 | headers: {siteId:ClassDataProxy.siteId, |
| 96 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 96 | + 'token':ClassDataProxy.token}, |
| 97 | success:function(_data){ | 97 | success:function(_data){ |
| 98 | //获取我的课程数据 | 98 | //获取我的课程数据 |
| 99 | if(_data && _data.code == 200){ | 99 | if(_data && _data.code == 200){ |
| @@ -174,7 +174,7 @@ class ListDetailsApe extends Ape { | @@ -174,7 +174,7 @@ class ListDetailsApe extends Ape { | ||
| 174 | $('#lanclassContentInfoPortrait').text();//老师授课老师头像 | 174 | $('#lanclassContentInfoPortrait').text();//老师授课老师头像 |
| 175 | $('#lanclassContentInfoName').text(_dataList.create_user);//老师授课老师名字 | 175 | $('#lanclassContentInfoName').text(_dataList.create_user);//老师授课老师名字 |
| 176 | $('#teacherInfoName').text(_dataList.create_user);//老师授课老师名字 | 176 | $('#teacherInfoName').text(_dataList.create_user);//老师授课老师名字 |
| 177 | - $('#lanclassContentInfoTimeStart').text(_dataList.createTime);//老师授课开始时间 | 177 | + $('#lanclassContentInfoTimeStart').text(_dataList.beginTime);//老师授课开始时间 |
| 178 | $('#lanclassContentInfoTimeEnd').text(_dataList.endTime);//老师授课结束时间 | 178 | $('#lanclassContentInfoTimeEnd').text(_dataList.endTime);//老师授课结束时间 |
| 179 | $('#collectYes');//老师授课是否收藏 | 179 | $('#collectYes');//老师授课是否收藏 |
| 180 | $('#collectNo');//老师授课是否收藏 | 180 | $('#collectNo');//老师授课是否收藏 |
| @@ -65,7 +65,7 @@ class LiveClassApe extends Ape { | @@ -65,7 +65,7 @@ class LiveClassApe extends Ape { | ||
| 65 | timeout:5000, | 65 | timeout:5000, |
| 66 | headers: {'page':_ele.text(), | 66 | headers: {'page':_ele.text(), |
| 67 | siteId:ClassDataProxy.siteId, | 67 | siteId:ClassDataProxy.siteId, |
| 68 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo', | 68 | + 'token':ClassDataProxy.token |
| 69 | }, | 69 | }, |
| 70 | data:{siteId:ClassDataProxy.siteId}, | 70 | data:{siteId:ClassDataProxy.siteId}, |
| 71 | success:function(_data){ | 71 | success:function(_data){ |
| @@ -93,7 +93,7 @@ class LiveClassApe extends Ape { | @@ -93,7 +93,7 @@ class LiveClassApe extends Ape { | ||
| 93 | timeout:5000, | 93 | timeout:5000, |
| 94 | data:{siteId:ClassDataProxy.siteId,meetingStatus:2}, | 94 | data:{siteId:ClassDataProxy.siteId,meetingStatus:2}, |
| 95 | headers: {siteId:ClassDataProxy.siteId, | 95 | headers: {siteId:ClassDataProxy.siteId, |
| 96 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 96 | + 'token':ClassDataProxy.token}, |
| 97 | success:function(_data){ | 97 | success:function(_data){ |
| 98 | //获取课堂数据 | 98 | //获取课堂数据 |
| 99 | if(_data && _data.code ==200){ | 99 | if(_data && _data.code ==200){ |
| @@ -332,6 +332,7 @@ class LoginOrRegister extends Ape { | @@ -332,6 +332,7 @@ class LoginOrRegister extends Ape { | ||
| 332 | $('#teacherMyCenterName').text( ClassDataProxy.loginName); | 332 | $('#teacherMyCenterName').text( ClassDataProxy.loginName); |
| 333 | this._userLoginAHandler(); | 333 | this._userLoginAHandler(); |
| 334 | this._emit(MessageTypes.LOGIN_IN,{userType: ClassDataProxy.userType}); | 334 | this._emit(MessageTypes.LOGIN_IN,{userType: ClassDataProxy.userType}); |
| 335 | + this._emit(MessageTypes.LOGIN_MYCENTER); | ||
| 335 | } | 336 | } |
| 336 | updateChangeUser(_data){ | 337 | updateChangeUser(_data){ |
| 337 | 338 |
| @@ -126,7 +126,7 @@ class ManagementHomePageApe extends Ape { | @@ -126,7 +126,7 @@ class ManagementHomePageApe extends Ape { | ||
| 126 | headers: { | 126 | headers: { |
| 127 | page:ind, | 127 | page:ind, |
| 128 | pageno:8, | 128 | pageno:8, |
| 129 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo', | 129 | + 'token':ClassDataProxy.token |
| 130 | }, | 130 | }, |
| 131 | success:function(_data){ | 131 | success:function(_data){ |
| 132 | if(_data && _data.code == 200){ | 132 | if(_data && _data.code == 200){ |
| @@ -75,7 +75,7 @@ const adminList = `<tr align="center" bgcolor="#FFFFFF" height="44" bordercolor= | @@ -75,7 +75,7 @@ const adminList = `<tr align="center" bgcolor="#FFFFFF" height="44" bordercolor= | ||
| 75 | `; | 75 | `; |
| 76 | const adminListEnd = `</tbody></table>`; | 76 | const adminListEnd = `</tbody></table>`; |
| 77 | 77 | ||
| 78 | -//学生端显示老师信息 _teacherName | 78 | +//学生端显示老师信息 |
| 79 | const teacherInfoLeft = ` | 79 | const teacherInfoLeft = ` |
| 80 | <div class="teacherCorrelatedInfoBox"> | 80 | <div class="teacherCorrelatedInfoBox"> |
| 81 | <div class="teacherCorrelatedInfoLeft"> | 81 | <div class="teacherCorrelatedInfoLeft"> |
| @@ -104,6 +104,7 @@ class MyCenterApe extends Ape { | @@ -104,6 +104,7 @@ class MyCenterApe extends Ape { | ||
| 104 | this.dataList = {}; | 104 | this.dataList = {}; |
| 105 | this.teacherList = {}; | 105 | this.teacherList = {}; |
| 106 | this.messageDetails = []; | 106 | this.messageDetails = []; |
| 107 | + this.presentInd = 1;//点击翻页默认为第一页 | ||
| 107 | this._judgeListPlace(); | 108 | this._judgeListPlace(); |
| 108 | this.addEvent(); | 109 | this.addEvent(); |
| 109 | this.init(); | 110 | this.init(); |
| @@ -113,9 +114,10 @@ class MyCenterApe extends Ape { | @@ -113,9 +114,10 @@ class MyCenterApe extends Ape { | ||
| 113 | $('#personageInfo').on('click',this._myCenterBoxHandler.bind(this));//个人中心 | 114 | $('#personageInfo').on('click',this._myCenterBoxHandler.bind(this));//个人中心 |
| 114 | 115 | ||
| 115 | $('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类 | 116 | $('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类 |
| 116 | - $('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//直播分类 正在直播 未开始 已结束 | 117 | + $('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//首页 老师 直播分类 正在直播 未开始 已结束 |
| 117 | $('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏 | 118 | $('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏 |
| 118 | $('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏 | 119 | $('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏 |
| 120 | + $('#teacherLiveList li').on('click',this._teacherLiveListHandler.bind(this));//我的课程 老师 正在直播 未开始 已结束 | ||
| 119 | 121 | ||
| 120 | $('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师 | 122 | $('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师 |
| 121 | 123 | ||
| @@ -161,7 +163,6 @@ class MyCenterApe extends Ape { | @@ -161,7 +163,6 @@ class MyCenterApe extends Ape { | ||
| 161 | $('#teacherMyCerterEndPage').on('click',this._endPageHandler.bind(this));//尾页 | 163 | $('#teacherMyCerterEndPage').on('click',this._endPageHandler.bind(this));//尾页 |
| 162 | $('#teacherMyCerterSpecificPage').on('click',this._assignPageHandler.bind(this));//指定页 | 164 | $('#teacherMyCerterSpecificPage').on('click',this._assignPageHandler.bind(this));//指定页 |
| 163 | 165 | ||
| 164 | - | ||
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | addEvent() { | 168 | addEvent() { |
| @@ -185,6 +186,7 @@ class MyCenterApe extends Ape { | @@ -185,6 +186,7 @@ class MyCenterApe extends Ape { | ||
| 185 | } | 186 | } |
| 186 | //下页 | 187 | //下页 |
| 187 | _downPageHandler(){ | 188 | _downPageHandler(){ |
| 189 | + loger.log('点击下一页') | ||
| 188 | if(this.presentInd < this.pageNo){ | 190 | if(this.presentInd < this.pageNo){ |
| 189 | this.presentInd++; | 191 | this.presentInd++; |
| 190 | this._teacherLiveModule(this.presentInd); | 192 | this._teacherLiveModule(this.presentInd); |
| @@ -231,7 +233,7 @@ class MyCenterApe extends Ape { | @@ -231,7 +233,7 @@ class MyCenterApe extends Ape { | ||
| 231 | timeout:5000, | 233 | timeout:5000, |
| 232 | data : data, | 234 | data : data, |
| 233 | headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, | 235 | headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, |
| 234 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 236 | + 'token':ClassDataProxy.token}, |
| 235 | success:function(_data){ | 237 | success:function(_data){ |
| 236 | 238 | ||
| 237 | //获取我的课程数据 | 239 | //获取我的课程数据 |
| @@ -254,16 +256,15 @@ class MyCenterApe extends Ape { | @@ -254,16 +256,15 @@ class MyCenterApe extends Ape { | ||
| 254 | } | 256 | } |
| 255 | }) | 257 | }) |
| 256 | } | 258 | } |
| 257 | - _studentCurriculumInfo(data,num,callback){ | 259 | + _studentCurriculumInfo(num,callback){ |
| 258 | let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id; | 260 | let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id; |
| 259 | let that = this; | 261 | let that = this; |
| 260 | $.ajax({ | 262 | $.ajax({ |
| 261 | type: "GET", | 263 | type: "GET", |
| 262 | url: _url, | 264 | url: _url, |
| 263 | timeout:5000, | 265 | timeout:5000, |
| 264 | - data:data, | ||
| 265 | - headers: {siteId:ClassDataProxy.siteId,pageno:num,id:ClassDataProxy.id, | ||
| 266 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 266 | + headers: {siteId:ClassDataProxy.siteId,pageno:num,id:ClassDataProxy.id, |
| 267 | + 'token':ClassDataProxy.token}, | ||
| 267 | success:function(_data){ | 268 | success:function(_data){ |
| 268 | 269 | ||
| 269 | //获取我的课程数据 | 270 | //获取我的课程数据 |
| @@ -294,6 +295,7 @@ class MyCenterApe extends Ape { | @@ -294,6 +295,7 @@ class MyCenterApe extends Ape { | ||
| 294 | this._teacherLiveModule(1); | 295 | this._teacherLiveModule(1); |
| 295 | } | 296 | } |
| 296 | detailPageStudent(){ | 297 | detailPageStudent(){ |
| 298 | + this._studentCourseModule(); | ||
| 297 | //首页课程 | 299 | //首页课程 |
| 298 | let ind = $('#studentInfoList .liveInfoLeftLiCheck').attr('data'); | 300 | let ind = $('#studentInfoList .liveInfoLeftLiCheck').attr('data'); |
| 299 | let studentMyCenterContentList = $('#studentMyCenterContentList'); | 301 | let studentMyCenterContentList = $('#studentMyCenterContentList'); |
| @@ -324,17 +326,22 @@ class MyCenterApe extends Ape { | @@ -324,17 +326,22 @@ class MyCenterApe extends Ape { | ||
| 324 | 326 | ||
| 325 | 327 | ||
| 326 | this.detailpage(); | 328 | this.detailpage(); |
| 329 | + loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1) | ||
| 327 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | 330 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ |
| 328 | //首页默认数据 | 331 | //首页默认数据 |
| 329 | - this.detailPageTeacher(); | ||
| 330 | - $('#teacherMyCenterName').text(ClassDataProxy.loginName+'老师'); | 332 | + // this.detailPageTeacher(); |
| 333 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 334 | + $('#teacherMyCenterStatus').text('老师'); | ||
| 331 | $('#teacherUI .recordLi').eq(2).hide(); | 335 | $('#teacherUI .recordLi').eq(2).hide(); |
| 332 | $('#teacherMyCerter').show(); | 336 | $('#teacherMyCerter').show(); |
| 333 | $('#studentMyCerter').hide(); | 337 | $('#studentMyCerter').hide(); |
| 338 | + $('#myCenterBox').show(); | ||
| 334 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | 339 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ |
| 335 | //首页默认数据 | 340 | //首页默认数据 |
| 336 | - this.detailPageStudent(); | ||
| 337 | - $('#teacherMyCenterName').text(ClassDataProxy.loginName+'同学'); | 341 | + // this.detailPageStudent(); |
| 342 | + $('#myCenterBox').show(); | ||
| 343 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 344 | + $('#teacherMyCenterStatus').text('同学'); | ||
| 338 | $('#teacherMyCerter').hide(); | 345 | $('#teacherMyCerter').hide(); |
| 339 | $('#studentMyCerter').show(); | 346 | $('#studentMyCerter').show(); |
| 340 | $('#teacherUI .recordLi').eq(2).show(); | 347 | $('#teacherUI .recordLi').eq(2).show(); |
| @@ -385,27 +392,7 @@ class MyCenterApe extends Ape { | @@ -385,27 +392,7 @@ class MyCenterApe extends Ape { | ||
| 385 | this.detailPageStudent(); | 392 | this.detailPageStudent(); |
| 386 | } | 393 | } |
| 387 | } | 394 | } |
| 388 | - //切换类的公用样式 | ||
| 389 | - commonality(evt){ | ||
| 390 | - $(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck'); | ||
| 391 | - } | ||
| 392 | - _teacherInfoListHandler(evt){ | ||
| 393 | - this.commonality(evt); | ||
| 394 | - } | ||
| 395 | - //学生端 首页 | ||
| 396 | - _studentInfoListHandler(evt){ | ||
| 397 | - this.commonality(evt); | ||
| 398 | - this.detailPageStudent(); | ||
| 399 | - } | ||
| 400 | - //学生端 我的课程 | ||
| 401 | - _courseInfoListHandler(evt){ | ||
| 402 | - this.commonality(evt); | ||
| 403 | - this.studentCourses(); | ||
| 404 | - } | ||
| 405 | - _subscribeListHandler(evt){ | ||
| 406 | - this.commonality(evt); | ||
| 407 | - this.studentBookings(); | ||
| 408 | - } | 395 | + |
| 409 | /*-------------------老师-------------------*/ | 396 | /*-------------------老师-------------------*/ |
| 410 | //老师端首页课程显示 | 397 | //老师端首页课程显示 |
| 411 | _teacherCourseModule(){ | 398 | _teacherCourseModule(){ |
| @@ -413,7 +400,9 @@ class MyCenterApe extends Ape { | @@ -413,7 +400,9 @@ class MyCenterApe extends Ape { | ||
| 413 | let that = this; | 400 | let that = this; |
| 414 | this._teacherCurriculumInfo(data,3,1,function(_data){ | 401 | this._teacherCurriculumInfo(data,3,1,function(_data){ |
| 415 | //首页今日课程渲染 | 402 | //首页今日课程渲染 |
| 416 | - that._teacherCourseCourse(_data.returnData.data.meetingInfo); | 403 | + if(_data){ |
| 404 | + that._teacherCourseCourse(_data.returnData.data.meetingInfo); | ||
| 405 | + } | ||
| 417 | }) | 406 | }) |
| 418 | } | 407 | } |
| 419 | //老师端首页课程数据渲染 | 408 | //老师端首页课程数据渲染 |
| @@ -441,38 +430,29 @@ class MyCenterApe extends Ape { | @@ -441,38 +430,29 @@ class MyCenterApe extends Ape { | ||
| 441 | } | 430 | } |
| 442 | //老师端首页直播数据 | 431 | //老师端首页直播数据 |
| 443 | _teacherLiveModule(ind){ | 432 | _teacherLiveModule(ind){ |
| 444 | - let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | 433 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; |
| 445 | let that = this; | 434 | let that = this; |
| 446 | this._teacherCurriculumInfo(data,4,ind,function(_data){ | 435 | this._teacherCurriculumInfo(data,4,ind,function(_data){ |
| 447 | //首页直播信息渲染 | 436 | //首页直播信息渲染 |
| 448 | - that._teacherLiveCourse(_data.returnData.data); | 437 | + if(_data){ |
| 438 | + that._teacherLiveCourse(_data.returnData.data); | ||
| 439 | + } | ||
| 449 | }) | 440 | }) |
| 450 | } | 441 | } |
| 451 | _teacherLiveCourse(_data){ | 442 | _teacherLiveCourse(_data){ |
| 452 | let teacherMyCenterContentList = $('#teacherMyCenterContentList'); | 443 | let teacherMyCenterContentList = $('#teacherMyCenterContentList'); |
| 453 | teacherMyCenterContentList.empty(); | 444 | teacherMyCenterContentList.empty(); |
| 445 | + | ||
| 454 | let count = _data.count; | 446 | let count = _data.count; |
| 455 | let page = _data.page; | 447 | let page = _data.page; |
| 456 | let pageno = _data.pageno; | 448 | let pageno = _data.pageno; |
| 457 | let pagenum = Math.ceil(count / pageno); | 449 | let pagenum = Math.ceil(count / pageno); |
| 458 | let _dataList = _data.meetingInfo; | 450 | let _dataList = _data.meetingInfo; |
| 459 | - loger.log('老师端首页数据显示',_dataList) | 451 | + loger.log('老师端信息想显示',_data) |
| 460 | this.pageNo = pagenum; | 452 | this.pageNo = pagenum; |
| 461 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | 453 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); |
| 462 | teacherMyCenterContentList.append(adminListTit) | 454 | teacherMyCenterContentList.append(adminListTit) |
| 463 | for(let i = 0;i<_dataList.length;i++){ | 455 | for(let i = 0;i<_dataList.length;i++){ |
| 464 | - let str = ''; | ||
| 465 | - switch (parseInt(_dataList[i].meetingStatus)){ | ||
| 466 | - case 1: | ||
| 467 | - case 2: | ||
| 468 | - str = '正在直播'; | ||
| 469 | - break; | ||
| 470 | - case 4: | ||
| 471 | - str = '已结束'; | ||
| 472 | - break; | ||
| 473 | - default: | ||
| 474 | - return; | ||
| 475 | - } | ||
| 476 | if(count <= 8){ | 456 | if(count <= 8){ |
| 477 | $('#teacherMyCerterPageBox').hide(); | 457 | $('#teacherMyCerterPageBox').hide(); |
| 478 | } | 458 | } |
| @@ -480,7 +460,7 @@ class MyCenterApe extends Ape { | @@ -480,7 +460,7 @@ class MyCenterApe extends Ape { | ||
| 480 | _meetingName : _dataList[i].meetingName, | 460 | _meetingName : _dataList[i].meetingName, |
| 481 | _meetingNumber : _dataList[i].meetingNumber, | 461 | _meetingNumber : _dataList[i].meetingNumber, |
| 482 | _create_user : _dataList[i].create_user, | 462 | _create_user : _dataList[i].create_user, |
| 483 | - _state : str, | 463 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), |
| 484 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | 464 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, |
| 485 | _num : '0' | 465 | _num : '0' |
| 486 | }) | 466 | }) |
| @@ -496,23 +476,10 @@ class MyCenterApe extends Ape { | @@ -496,23 +476,10 @@ class MyCenterApe extends Ape { | ||
| 496 | let pageno = _data.pageno; | 476 | let pageno = _data.pageno; |
| 497 | let pagenum = Math.ceil(count / pageno); | 477 | let pagenum = Math.ceil(count / pageno); |
| 498 | let _dataList = _data.meetingInfo; | 478 | let _dataList = _data.meetingInfo; |
| 499 | - loger.log('老师端首页数据显示',_dataList) | ||
| 500 | this.pageNo = pagenum; | 479 | this.pageNo = pagenum; |
| 501 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | 480 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); |
| 502 | courseMinuteList.append(adminListTit) | 481 | courseMinuteList.append(adminListTit) |
| 503 | for(let i = 0;i<_dataList.length;i++){ | 482 | for(let i = 0;i<_dataList.length;i++){ |
| 504 | - let str = ''; | ||
| 505 | - switch (parseInt(_dataList[i].meetingStatus)){ | ||
| 506 | - case 1: | ||
| 507 | - case 2: | ||
| 508 | - str = '正在直播'; | ||
| 509 | - break; | ||
| 510 | - case 4: | ||
| 511 | - str = '已结束'; | ||
| 512 | - break; | ||
| 513 | - default: | ||
| 514 | - return; | ||
| 515 | - } | ||
| 516 | if(count <= 8){ | 483 | if(count <= 8){ |
| 517 | $('#teacherMyCerterPageBox').hide(); | 484 | $('#teacherMyCerterPageBox').hide(); |
| 518 | } | 485 | } |
| @@ -520,7 +487,7 @@ class MyCenterApe extends Ape { | @@ -520,7 +487,7 @@ class MyCenterApe extends Ape { | ||
| 520 | _meetingName : _dataList[i].meetingName, | 487 | _meetingName : _dataList[i].meetingName, |
| 521 | _meetingNumber : _dataList[i].meetingNumber, | 488 | _meetingNumber : _dataList[i].meetingNumber, |
| 522 | _create_user : _dataList[i].create_user, | 489 | _create_user : _dataList[i].create_user, |
| 523 | - _state : str, | 490 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), |
| 524 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | 491 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, |
| 525 | _num : '0' | 492 | _num : '0' |
| 526 | }) | 493 | }) |
| @@ -530,21 +497,24 @@ class MyCenterApe extends Ape { | @@ -530,21 +497,24 @@ class MyCenterApe extends Ape { | ||
| 530 | } | 497 | } |
| 531 | 498 | ||
| 532 | /*---------------------------学生-----------------------*/ | 499 | /*---------------------------学生-----------------------*/ |
| 500 | + //学生端首页課程显示 | ||
| 533 | _studentCourseModule(){ | 501 | _studentCourseModule(){ |
| 534 | let that = this; | 502 | let that = this; |
| 535 | - this._studentCurriculumInfo({},3,function(_data){ | 503 | + this._studentCurriculumInfo(3,function(_data){ |
| 536 | that.studentCourseList(_data.returnData.data); | 504 | that.studentCourseList(_data.returnData.data); |
| 537 | }) | 505 | }) |
| 538 | } | 506 | } |
| 539 | studentCourseList(_data){ | 507 | studentCourseList(_data){ |
| 540 | if(_data){ | 508 | if(_data){ |
| 509 | + loger.log('学生端首页课程信息',_data) | ||
| 541 | let myCurriculumInfo = $('#myCurriculumInfo'); | 510 | let myCurriculumInfo = $('#myCurriculumInfo'); |
| 542 | myCurriculumInfo.empty(); | 511 | myCurriculumInfo.empty(); |
| 543 | let that = this; | 512 | let that = this; |
| 544 | if(_data) { | 513 | if(_data) { |
| 545 | for (let i = 0; i < _data.length; i++) { | 514 | for (let i = 0; i < _data.length; i++) { |
| 546 | let item = _data[i]; | 515 | let item = _data[i]; |
| 547 | - let timer = ClassDataProxy.getTimeCountDown(item.meetingBeginTime) | 516 | + let timer = ClassDataProxy.getTimeCountDown(item.meetingBeginTime,item.meetingEndTime) |
| 517 | + loger.log('newTimenewTimenewTimenewTime',timer) | ||
| 548 | if (item) { | 518 | if (item) { |
| 549 | let curInfo = this._format(curriculumList, { | 519 | let curInfo = this._format(curriculumList, { |
| 550 | _infoTit: item.meeting_name, | 520 | _infoTit: item.meeting_name, |
| @@ -561,10 +531,10 @@ class MyCenterApe extends Ape { | @@ -561,10 +531,10 @@ class MyCenterApe extends Ape { | ||
| 561 | } | 531 | } |
| 562 | } | 532 | } |
| 563 | } | 533 | } |
| 564 | - | 534 | + //学生端首页学习数据 |
| 565 | _studentStudyModule(studentMyCenterContentList){ | 535 | _studentStudyModule(studentMyCenterContentList){ |
| 566 | let that = this; | 536 | let that = this; |
| 567 | - this._studentCurriculumInfo({},4,function(_data){ | 537 | + this._studentCurriculumInfo(4,function(_data){ |
| 568 | if(_data){ | 538 | if(_data){ |
| 569 | that.studentStudyList(studentMyCenterContentList,_data.returnData.data); | 539 | that.studentStudyList(studentMyCenterContentList,_data.returnData.data); |
| 570 | } | 540 | } |
| @@ -597,7 +567,7 @@ class MyCenterApe extends Ape { | @@ -597,7 +567,7 @@ class MyCenterApe extends Ape { | ||
| 597 | //已学完 | 567 | //已学完 |
| 598 | _studentStudyOverModule(studentMyCenterContentList){ | 568 | _studentStudyOverModule(studentMyCenterContentList){ |
| 599 | let that = this; | 569 | let that = this; |
| 600 | - this._studentCurriculumInfo({},4,function(_data){ | 570 | + this._studentCurriculumInfo(4,function(_data){ |
| 601 | that.studentStudyOverList(studentMyCenterContentList,_data.returnData.data); | 571 | that.studentStudyOverList(studentMyCenterContentList,_data.returnData.data); |
| 602 | }) | 572 | }) |
| 603 | } | 573 | } |
| @@ -627,7 +597,7 @@ class MyCenterApe extends Ape { | @@ -627,7 +597,7 @@ class MyCenterApe extends Ape { | ||
| 627 | } | 597 | } |
| 628 | _studenTcollectModule(studentMyCenterContentList){ | 598 | _studenTcollectModule(studentMyCenterContentList){ |
| 629 | let that = this; | 599 | let that = this; |
| 630 | - this._studentCurriculumInfo({},4,function(_data){ | 600 | + this._studentCurriculumInfo(4,function(_data){ |
| 631 | that.studentTcollectList(studentMyCenterContentList,_data.returnData.data); | 601 | that.studentTcollectList(studentMyCenterContentList,_data.returnData.data); |
| 632 | }) | 602 | }) |
| 633 | } | 603 | } |
| @@ -694,10 +664,9 @@ class MyCenterApe extends Ape { | @@ -694,10 +664,9 @@ class MyCenterApe extends Ape { | ||
| 694 | url: _url, | 664 | url: _url, |
| 695 | timeout:5000, | 665 | timeout:5000, |
| 696 | headers: {siteId:ClassDataProxy.siteId, | 666 | headers: {siteId:ClassDataProxy.siteId, |
| 697 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 667 | + 'token':ClassDataProxy.token}, |
| 698 | data:signInfo, | 668 | data:signInfo, |
| 699 | success:function(_data){ | 669 | success:function(_data){ |
| 700 | - loger.log('修改信息',_data) | ||
| 701 | //获取个人信息数据 | 670 | //获取个人信息数据 |
| 702 | if(_data && _data.code == 200){ | 671 | if(_data && _data.code == 200){ |
| 703 | loger.log('修改信息成功',_data) | 672 | loger.log('修改信息成功',_data) |
| @@ -719,7 +688,6 @@ class MyCenterApe extends Ape { | @@ -719,7 +688,6 @@ class MyCenterApe extends Ape { | ||
| 719 | } | 688 | } |
| 720 | }, | 689 | }, |
| 721 | error:function(error){ | 690 | error:function(error){ |
| 722 | - // alert('老师界面获取数据失败') | ||
| 723 | loger.log(error,'修改信息失败') | 691 | loger.log(error,'修改信息失败') |
| 724 | } | 692 | } |
| 725 | }) | 693 | }) |
| @@ -741,18 +709,15 @@ class MyCenterApe extends Ape { | @@ -741,18 +709,15 @@ class MyCenterApe extends Ape { | ||
| 741 | //我的预约 | 709 | //我的预约 |
| 742 | myBookingsMessage(){ | 710 | myBookingsMessage(){ |
| 743 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | 711 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ |
| 744 | - this.teacherBookings(); | 712 | + |
| 745 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | 713 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ |
| 746 | this.studentBookings(); | 714 | this.studentBookings(); |
| 747 | } | 715 | } |
| 748 | } | 716 | } |
| 749 | - teacherBookings(){ | ||
| 750 | - | ||
| 751 | - } | ||
| 752 | studentBookings(){ | 717 | studentBookings(){ |
| 753 | let that = this; | 718 | let that = this; |
| 754 | let data = $('#subscribeList').find('.liveInfoLeftLiCheck').attr('data'); | 719 | let data = $('#subscribeList').find('.liveInfoLeftLiCheck').attr('data'); |
| 755 | - this._studentCurriculumInfo({},12,function(_data){ | 720 | + this._studentCurriculumInfo(12,function(_data){ |
| 756 | if(_data){ | 721 | if(_data){ |
| 757 | if(data == '1'){ | 722 | if(data == '1'){ |
| 758 | that._studentSubscribeTeacher(_data.returnData.data) | 723 | that._studentSubscribeTeacher(_data.returnData.data) |
| @@ -826,19 +791,104 @@ class MyCenterApe extends Ape { | @@ -826,19 +791,104 @@ class MyCenterApe extends Ape { | ||
| 826 | //我的课程 | 791 | //我的课程 |
| 827 | myCoursesMessage(){ | 792 | myCoursesMessage(){ |
| 828 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | 793 | if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ |
| 829 | - this.teacherCourses(1); | 794 | + this.teacherCourses(); |
| 795 | + $('#courseInfoList').hide(); | ||
| 796 | + $('#teacherLiveList').show(); | ||
| 830 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | 797 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ |
| 831 | this.studentCourses(); | 798 | this.studentCourses(); |
| 799 | + $('#courseInfoList').show(); | ||
| 800 | + $('#teacherLiveList').hide(); | ||
| 801 | + } | ||
| 802 | + } | ||
| 803 | + teacherCourses(){ | ||
| 804 | + let _index = $('#teacherLiveList .liveInfoLeftLiCheck').attr('data'); | ||
| 805 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 806 | + switch (parseInt(_index)){ | ||
| 807 | + case 0: | ||
| 808 | + //正在直播 | ||
| 809 | + loger.log('直播首页信息') | ||
| 810 | + this.teacherNowLiveModule(1); | ||
| 811 | + break; | ||
| 812 | + case 1: | ||
| 813 | + //未开始 | ||
| 814 | + this.teacherNoneLiveModule(1); | ||
| 815 | + loger.log('直播首页信息1') | ||
| 816 | + break; | ||
| 817 | + case 2: | ||
| 818 | + //已结束 | ||
| 819 | + break; | ||
| 820 | + default: | ||
| 821 | + return; | ||
| 832 | } | 822 | } |
| 823 | + | ||
| 833 | } | 824 | } |
| 834 | - teacherCourses(ind){ | 825 | + teacherNowLiveModule(ind){ |
| 826 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; | ||
| 827 | + let that = this; | ||
| 828 | + this._teacherCurriculumInfo(data,12,ind,function(_data){ | ||
| 829 | + //首页直播信息渲染 | ||
| 830 | + if(_data){ | ||
| 831 | + // loger.log('首页直播信息渲染',_data) | ||
| 832 | + that._teacherCourse(_data.returnData.data); | ||
| 833 | + } | ||
| 834 | + }) | ||
| 835 | + } | ||
| 836 | + teacherNoneLiveModule(ind){ | ||
| 835 | let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | 837 | let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; |
| 836 | let that = this; | 838 | let that = this; |
| 837 | this._teacherCurriculumInfo(data,12,ind,function(_data){ | 839 | this._teacherCurriculumInfo(data,12,ind,function(_data){ |
| 838 | //首页直播信息渲染 | 840 | //首页直播信息渲染 |
| 839 | - that._teacherCourse(_data.returnData.data); | 841 | + if(_data){ |
| 842 | + that._teacherCourse(_data.returnData.data); | ||
| 843 | + } | ||
| 840 | }) | 844 | }) |
| 841 | } | 845 | } |
| 846 | + //老师端课程数据 | ||
| 847 | + _teacherCourseRender(_data){ | ||
| 848 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 849 | + courseMinuteList.empty(); | ||
| 850 | + let count = _data.count; | ||
| 851 | + let page = _data.page; | ||
| 852 | + let pageno = _data.pageno; | ||
| 853 | + let pagenum = Math.ceil(count / pageno); | ||
| 854 | + let _dataList = _data.meetingInfo; | ||
| 855 | + this.pageNo = pagenum; | ||
| 856 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 857 | + | ||
| 858 | + if(count <= 12){ | ||
| 859 | + $('#courseMinutePageBox').hide(); | ||
| 860 | + } | ||
| 861 | + //存储数据按日期分类 | ||
| 862 | + this.dataList={}; | ||
| 863 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 864 | + let item=_dataList[i]; | ||
| 865 | + if(item){ | ||
| 866 | + let temp = item.beginTime.split(' ')[0] | ||
| 867 | + if(!this.dataList[temp]) { | ||
| 868 | + this.dataList[temp] = []; | ||
| 869 | + } | ||
| 870 | + this.dataList[temp].push(item) | ||
| 871 | + } | ||
| 872 | + } | ||
| 873 | + for(let key in this.dataList){ | ||
| 874 | + let j = (key%4)==3; | ||
| 875 | + let arrList = this.dataList[key]; | ||
| 876 | + if(arrList){ | ||
| 877 | + for(let n = 0;n<arrList.length;n++){ | ||
| 878 | + let _classifyList = this._format(classifyList,{ | ||
| 879 | + _classifyListR : j?'classifyListR':'', | ||
| 880 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 881 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 882 | + _msgImg : '../images/u373.png', | ||
| 883 | + _meetingName : arrList[n].meetingName, | ||
| 884 | + _create_user : arrList[n].create_user, | ||
| 885 | + _liveTimer : key | ||
| 886 | + }) | ||
| 887 | + courseMinuteList.append(_classifyList) | ||
| 888 | + } | ||
| 889 | + } | ||
| 890 | + } | ||
| 891 | + } | ||
| 842 | //学生端 我的课程 切换 | 892 | //学生端 我的课程 切换 |
| 843 | studentCourses(){ | 893 | studentCourses(){ |
| 844 | let ind = $('#courseInfoList .liveInfoLeftLiCheck').attr('data'); | 894 | let ind = $('#courseInfoList .liveInfoLeftLiCheck').attr('data'); |
| @@ -864,7 +914,7 @@ class MyCenterApe extends Ape { | @@ -864,7 +914,7 @@ class MyCenterApe extends Ape { | ||
| 864 | //学生端 我的课程 待学习 | 914 | //学生端 我的课程 待学习 |
| 865 | studentFutureModule(courseMinuteList){ | 915 | studentFutureModule(courseMinuteList){ |
| 866 | let that = this; | 916 | let that = this; |
| 867 | - this._studentCurriculumInfo({},12,function(_data){ | 917 | + this._studentCurriculumInfo(12,function(_data){ |
| 868 | if(_data){ | 918 | if(_data){ |
| 869 | that._studentCourseRender(courseMinuteList,_data.returnData.data) | 919 | that._studentCourseRender(courseMinuteList,_data.returnData.data) |
| 870 | } | 920 | } |
| @@ -923,7 +973,7 @@ class MyCenterApe extends Ape { | @@ -923,7 +973,7 @@ class MyCenterApe extends Ape { | ||
| 923 | //学生端 我的课程 已学完 | 973 | //学生端 我的课程 已学完 |
| 924 | studentFormerlyModule(courseMinuteList){ | 974 | studentFormerlyModule(courseMinuteList){ |
| 925 | let that = this; | 975 | let that = this; |
| 926 | - this._studentCurriculumInfo({},12,function(_data){ | 976 | + this._studentCurriculumInfo(12,function(_data){ |
| 927 | if(_data){ | 977 | if(_data){ |
| 928 | that._studentFormerlyRender(courseMinuteList,_data.returnData.data) | 978 | that._studentFormerlyRender(courseMinuteList,_data.returnData.data) |
| 929 | } | 979 | } |
| @@ -980,8 +1030,7 @@ class MyCenterApe extends Ape { | @@ -980,8 +1030,7 @@ class MyCenterApe extends Ape { | ||
| 980 | //学生端 我的课程 收藏 | 1030 | //学生端 我的课程 收藏 |
| 981 | studentCollectModule(courseMinuteList){ | 1031 | studentCollectModule(courseMinuteList){ |
| 982 | let that = this; | 1032 | let that = this; |
| 983 | - let data = {} | ||
| 984 | - this._studentCurriculumInfo(data,12,function(_data){ | 1033 | + this._studentCurriculumInfo(12,function(_data){ |
| 985 | if(_data){ | 1034 | if(_data){ |
| 986 | loger.log('显示收藏数据',_data) | 1035 | loger.log('显示收藏数据',_data) |
| 987 | that._studentCollectRender(courseMinuteList,_data.returnData.data) | 1036 | that._studentCollectRender(courseMinuteList,_data.returnData.data) |
| @@ -1070,19 +1119,8 @@ class MyCenterApe extends Ape { | @@ -1070,19 +1119,8 @@ class MyCenterApe extends Ape { | ||
| 1070 | this.pageNo = pagenum; | 1119 | this.pageNo = pagenum; |
| 1071 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | 1120 | $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); |
| 1072 | teacherMyCenterContentList.append(adminListTit) | 1121 | teacherMyCenterContentList.append(adminListTit) |
| 1122 | + | ||
| 1073 | for(let i = 0;i<_dataList.length;i++){ | 1123 | for(let i = 0;i<_dataList.length;i++){ |
| 1074 | - let str = ''; | ||
| 1075 | - switch (parseInt(_dataList[i].meetingStatus)){ | ||
| 1076 | - case 1: | ||
| 1077 | - case 2: | ||
| 1078 | - str = '正在直播'; | ||
| 1079 | - break; | ||
| 1080 | - case 4: | ||
| 1081 | - str = '已结束'; | ||
| 1082 | - break; | ||
| 1083 | - default: | ||
| 1084 | - return; | ||
| 1085 | - } | ||
| 1086 | if(count <= 8){ | 1124 | if(count <= 8){ |
| 1087 | $('#teacherMyCerterPageBox').hide(); | 1125 | $('#teacherMyCerterPageBox').hide(); |
| 1088 | } | 1126 | } |
| @@ -1090,7 +1128,7 @@ class MyCenterApe extends Ape { | @@ -1090,7 +1128,7 @@ class MyCenterApe extends Ape { | ||
| 1090 | _meetingName : _dataList[i].meetingName, | 1128 | _meetingName : _dataList[i].meetingName, |
| 1091 | _meetingNumber : _dataList[i].meetingNumber, | 1129 | _meetingNumber : _dataList[i].meetingNumber, |
| 1092 | _create_user : _dataList[i].create_user, | 1130 | _create_user : _dataList[i].create_user, |
| 1093 | - _state : str, | 1131 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), |
| 1094 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | 1132 | _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, |
| 1095 | _num : '0' | 1133 | _num : '0' |
| 1096 | }) | 1134 | }) |
| @@ -1098,52 +1136,7 @@ class MyCenterApe extends Ape { | @@ -1098,52 +1136,7 @@ class MyCenterApe extends Ape { | ||
| 1098 | } | 1136 | } |
| 1099 | teacherMyCenterContentList.append(adminListEnd) | 1137 | teacherMyCenterContentList.append(adminListEnd) |
| 1100 | } | 1138 | } |
| 1101 | - //老师端课程数据 | ||
| 1102 | - _teacherCourseRender(_data){ | ||
| 1103 | - let courseMinuteList = $('#courseMinuteList'); | ||
| 1104 | - courseMinuteList.empty(); | ||
| 1105 | - let count = _data.count; | ||
| 1106 | - let page = _data.page; | ||
| 1107 | - let pageno = _data.pageno; | ||
| 1108 | - let pagenum = Math.ceil(count / pageno); | ||
| 1109 | - let _dataList = _data.meetingInfo; | ||
| 1110 | - this.pageNo = pagenum; | ||
| 1111 | - $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 1112 | 1139 | ||
| 1113 | - if(count <= 12){ | ||
| 1114 | - $('#courseMinutePageBox').hide(); | ||
| 1115 | - } | ||
| 1116 | - //存储数据按日期分类 | ||
| 1117 | - this.dataList={}; | ||
| 1118 | - for(let i = 0;i<_dataList.length;i++){ | ||
| 1119 | - let item=_dataList[i]; | ||
| 1120 | - if(item){ | ||
| 1121 | - let temp = item.beginTime.split(' ')[0] | ||
| 1122 | - if(!this.dataList[temp]) { | ||
| 1123 | - this.dataList[temp] = []; | ||
| 1124 | - } | ||
| 1125 | - this.dataList[temp].push(item) | ||
| 1126 | - } | ||
| 1127 | - } | ||
| 1128 | - for(let key in this.dataList){ | ||
| 1129 | - let j = (key%4)==3; | ||
| 1130 | - let arrList = this.dataList[key]; | ||
| 1131 | - if(arrList){ | ||
| 1132 | - for(let n = 0;n<arrList.length;n++){ | ||
| 1133 | - let _classifyList = this._format(classifyList,{ | ||
| 1134 | - _classifyListR : j?'classifyListR':'', | ||
| 1135 | - _isShowTitle : n == 0 ?'block':'none', | ||
| 1136 | - _meetingNumber : arrList[n].meetingNumber, | ||
| 1137 | - _msgImg : '../images/u373.png', | ||
| 1138 | - _meetingName : arrList[n].meetingName, | ||
| 1139 | - _create_user : arrList[n].create_user, | ||
| 1140 | - _liveTimer : key | ||
| 1141 | - }) | ||
| 1142 | - courseMinuteList.append(_classifyList) | ||
| 1143 | - } | ||
| 1144 | - } | ||
| 1145 | - } | ||
| 1146 | - } | ||
| 1147 | 1140 | ||
| 1148 | //修改密码 | 1141 | //修改密码 |
| 1149 | _accountPassWordBtnHandler(){ | 1142 | _accountPassWordBtnHandler(){ |
| @@ -1169,12 +1162,15 @@ class MyCenterApe extends Ape { | @@ -1169,12 +1162,15 @@ class MyCenterApe extends Ape { | ||
| 1169 | $('#defaultBox').hide(); | 1162 | $('#defaultBox').hide(); |
| 1170 | $('#classifyListBox').hide(); | 1163 | $('#classifyListBox').hide(); |
| 1171 | $('#lanclassBox').hide(); | 1164 | $('#lanclassBox').hide(); |
| 1172 | - | 1165 | + $('#liveContentAllBox').hide(); |
| 1166 | + $('#lanclassAllBox').hide(); | ||
| 1167 | + $('#teacherIntroAllBox').hide(); | ||
| 1173 | $('#teacherDetailBox').hide(); | 1168 | $('#teacherDetailBox').hide(); |
| 1174 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | 1169 | }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ |
| 1175 | 1170 | ||
| 1176 | } | 1171 | } |
| 1177 | $('#myCenterBox').show(); | 1172 | $('#myCenterBox').show(); |
| 1173 | + | ||
| 1178 | } | 1174 | } |
| 1179 | _updateInputYesHandler(evt){ | 1175 | _updateInputYesHandler(evt){ |
| 1180 | let updateInput = $('#updateInput').val(); | 1176 | let updateInput = $('#updateInput').val(); |
| @@ -1285,7 +1281,7 @@ class MyCenterApe extends Ape { | @@ -1285,7 +1281,7 @@ class MyCenterApe extends Ape { | ||
| 1285 | timeout:5000, | 1281 | timeout:5000, |
| 1286 | headers: { | 1282 | headers: { |
| 1287 | siteId:ClassDataProxy.siteId, | 1283 | siteId:ClassDataProxy.siteId, |
| 1288 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo' | 1284 | + 'token':ClassDataProxy.token |
| 1289 | }, | 1285 | }, |
| 1290 | data:{status:'5'}, | 1286 | data:{status:'5'}, |
| 1291 | success:function(_data){ | 1287 | success:function(_data){ |
| @@ -1323,6 +1319,32 @@ class MyCenterApe extends Ape { | @@ -1323,6 +1319,32 @@ class MyCenterApe extends Ape { | ||
| 1323 | } | 1319 | } |
| 1324 | } | 1320 | } |
| 1325 | } | 1321 | } |
| 1322 | + //切换类的公用样式 | ||
| 1323 | + commonality(evt){ | ||
| 1324 | + $(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck'); | ||
| 1325 | + } | ||
| 1326 | + _teacherInfoListHandler(evt){ | ||
| 1327 | + this.commonality(evt); | ||
| 1328 | + } | ||
| 1329 | + //学生端 首页 | ||
| 1330 | + _studentInfoListHandler(evt){ | ||
| 1331 | + this.commonality(evt); | ||
| 1332 | + this.detailPageStudent(); | ||
| 1333 | + } | ||
| 1334 | + //学生端 我的课程 | ||
| 1335 | + _courseInfoListHandler(evt){ | ||
| 1336 | + this.commonality(evt); | ||
| 1337 | + this.studentCourses(); | ||
| 1338 | + } | ||
| 1339 | + //老师端 我的课程 | ||
| 1340 | + _teacherLiveListHandler(evt){ | ||
| 1341 | + this.commonality(evt); | ||
| 1342 | + this.teacherCourses(); | ||
| 1343 | + } | ||
| 1344 | + _subscribeListHandler(evt){ | ||
| 1345 | + this.commonality(evt); | ||
| 1346 | + this.studentBookings(); | ||
| 1347 | + } | ||
| 1326 | //工具类 | 1348 | //工具类 |
| 1327 | _format(str, obj) { | 1349 | _format(str, obj) { |
| 1328 | return str.replace(/\{(\w+)\}/g, function (match, group, index) { | 1350 | return str.replace(/\{(\w+)\}/g, function (match, group, index) { |
src/ape/MyCenterStudentApe.js
0 → 100644
| 1 | +//* | ||
| 2 | +// 首页模块 | ||
| 3 | +// */ | ||
| 4 | + | ||
| 5 | +import Loger from "../Loger"; | ||
| 6 | +import Ape from "./Ape"; | ||
| 7 | +import $ from "jquery"; | ||
| 8 | +import ClassDataProxy from "proxy/ClassDataProxy"; | ||
| 9 | +import ErrorApe from "./ErrorApe"; | ||
| 10 | +import MessageTypes from "../MessageTypes"; | ||
| 11 | + | ||
| 12 | +const classifyList = `<div class="courseMinuteListTimeTit" style="display: {_isShowTitle}"> | ||
| 13 | + <span class="courseMinuteListTime">{_liveTimer}</span> | ||
| 14 | + <span class="courseMinuteListWire"></span> | ||
| 15 | + </div> | ||
| 16 | + <div class="classifyListMyCenter {_classifyListR}"> | ||
| 17 | + <div class="myCenterContentMask accessLearningBtn"> | ||
| 18 | + <button class="myCenterContentMaskBtn btnHover" data="{_meetingNumber}">进入学习</button> | ||
| 19 | + </div> | ||
| 20 | + <div class="myCenterContentMask cancelReservation"> | ||
| 21 | + <button class="myCenterContentMaskBtn btnHover" data="{_studentMeetingId}">取消预约</button> | ||
| 22 | + </div> | ||
| 23 | + <img class="myCenterContentListImg" src="{_msgImg}" alt=""> | ||
| 24 | + <p class="myCenterContentListTit">{_meetingName}</p> | ||
| 25 | + <p class="myCenterContentListTit1">主讲人:{_create_user}</p> | ||
| 26 | + <p class="myCenterContentMin">45min</p> | ||
| 27 | + <span class="myCenterContentTimer">{_liveTimer}</span> | ||
| 28 | + </div>`; | ||
| 29 | +const curriculumList = `<li class="teacherTodayCourseList"> | ||
| 30 | + <span class="courseDetailInfo">{_infoTit}</span> | ||
| 31 | + <span class="courseDetailInfo1">距开始还有:<i class="teacherStartContent">{_countDown}</i></span> | ||
| 32 | + <button class="teacherEnterClass btnHover" data="{_meetingNumber}" style="display: {_isShow}">立即进入</button> | ||
| 33 | + </li>`; | ||
| 34 | + | ||
| 35 | +//学生端显示老师信息 | ||
| 36 | +const teacherInfoLeft = ` | ||
| 37 | + <div class="teacherCorrelatedInfoBox"> | ||
| 38 | + <div class="teacherCorrelatedInfoLeft"> | ||
| 39 | + <img class="teacherCorrelatedInfoImg" id="teacherCorrelatedInfoImg" src="images/u293.png" alt=""> | ||
| 40 | + <div class="teacherCorrelatedInfo"> | ||
| 41 | + <b class="teacherCorrelatedInfoName" id="teacherCorrelatedInfoName">{_teacherName}</b> | ||
| 42 | + <b class="teacherCorrelatedInfoMajor">北京市|少儿英语</b> | ||
| 43 | + <b class="teacherCorrelatedInfoCourse">课程:50</b> | ||
| 44 | + <span class="teacherCorrelatedInfoMajorMsg">毕业于外国语学院,专业8级</span> | ||
| 45 | + <p class="cancelReservationBtn"">取消预约</p> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="teacherCorrelatedInfoCenter">`; | ||
| 49 | +const teacherInfoCenter= `<img class="teachercourseImg" data="{_id}" src="{_imgSrc}" alt="">`; | ||
| 50 | +const teacherInfoRight = `</div> <div class="teacherCorrelatedInfoBtn" data="{_teacherName}">更多课程</div> | ||
| 51 | + </div></div>`; | ||
| 52 | + | ||
| 53 | +const teacherDetail = `<span class="teacherDetailCurriculumList">《{_detailList}》</span>` | ||
| 54 | + | ||
| 55 | +let loger = Loger.getLoger('PC-MyCenterApe'); | ||
| 56 | +class MyCenterApe extends Ape { | ||
| 57 | + constructor() { | ||
| 58 | + super(); | ||
| 59 | + this.isLocalStorage(); | ||
| 60 | + this.data = 0; | ||
| 61 | + this.dataList = {}; | ||
| 62 | + this.teacherList = {}; | ||
| 63 | + this.messageDetails = []; | ||
| 64 | + this.presentInd = 1;//点击翻页默认为第一页 | ||
| 65 | + this._judgeListPlace(); | ||
| 66 | + this.addEvent(); | ||
| 67 | + // this.init(); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + init() { | ||
| 71 | + $('#personageInfo').on('click',this._myCenterBoxHandler.bind(this));//个人中心 | ||
| 72 | + | ||
| 73 | + $('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类 | ||
| 74 | + $('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//首页 老师 直播分类 正在直播 未开始 已结束 | ||
| 75 | + $('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏 | ||
| 76 | + $('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏 | ||
| 77 | + $('#teacherLiveList li').on('click',this._teacherLiveListHandler.bind(this));//我的课程 老师 正在直播 未开始 已结束 | ||
| 78 | + | ||
| 79 | + $('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师 | ||
| 80 | + | ||
| 81 | + $('#updateInputYes').on('click',this._updateInputYesHandler.bind(this));//确定时把输入的信息存入数据中 | ||
| 82 | + | ||
| 83 | + $('#accountInfoSaveBtn').on('click',this._accountInfoSaveBtnHandler.bind(this));//更新用户信息按钮 | ||
| 84 | + | ||
| 85 | + $('#updateInputBoxA').on('click',this._hideInputBox.bind(this));//关闭弹框 | ||
| 86 | + $('#updateInputNo').on('click',this._hideInputBox.bind(this));//关闭弹框 | ||
| 87 | + //修改账户信息 | ||
| 88 | + $('#accountPassWordBtn').on('click',this._accountPassWordBtnHandler.bind(this));//密码 | ||
| 89 | + $('#accountEmailBtn').on('click',this._accountEmailBtnHandler.bind(this));//邮箱 | ||
| 90 | + $('#accountMobilelBtn').on('click',this._accountMobilelBtnHandler.bind(this));//手机号 | ||
| 91 | + | ||
| 92 | + $('#studentMyCenterContentList').on('mouseenter','.classifyListMyCenter',this._mouseenter.bind(this));//个人中心移入进入课堂 | ||
| 93 | + $('#studentMyCenterContentList').on('mouseleave','.classifyListMyCenter',this._mouseleave.bind(this));//个人中心移出进入课堂 | ||
| 94 | + | ||
| 95 | + $('#courseMinuteList').on('mouseenter','.classifyListMyCenter',this._mouseenter.bind(this));//课程移入进入课堂 | ||
| 96 | + $('#courseMinuteList').on('mouseleave','.classifyListMyCenter',this._mouseleave.bind(this));//课程移出进入课堂 | ||
| 97 | + | ||
| 98 | + $('#teacherCorrelatedInfo').on('mouseenter','.classifyListMyCenter',this._cancelMouseenter.bind(this));//我的预约 课程移入显示取消预约 | ||
| 99 | + $('#teacherCorrelatedInfo').on('mouseleave','.classifyListMyCenter',this._cancelMouseleave.bind(this));//我的预约 课程移出隐藏取消预约 | ||
| 100 | + | ||
| 101 | + $('#studentMyCenterContentList').on('click','.accessLearningBtn',this._enterClassRoomHandler.bind(this));//我的预约进入课堂 | ||
| 102 | + $('#courseMinuteList').on('click','.accessLearningBtn',this._enterClassRoomHandler.bind(this));//我的预约进入课堂 | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + | ||
| 106 | + $('#myCurriculumInfo').on('click','.teacherEnterClass',this._enterClassRoomHandler.bind(this));//我的课程进入课堂 | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + $('#teacherCorrelatedInfo').on('click','.teacherCorrelatedInfoBtn',this._teacherSubscribeMoveHandler.bind(this));//点击预约查看当前点击的更多信息 | ||
| 110 | + | ||
| 111 | + $('#teacherCorrelatedInfo').on('click','.cancelReservation',this._cancelSubscribeHandler.bind(this));//取消预约 | ||
| 112 | + | ||
| 113 | + $('#teacherCorrelatedInfo').on('click','.teachercourseImg',this._teacherClassDetails.bind(this));//点击进入老师课堂详情页 | ||
| 114 | + | ||
| 115 | + | ||
| 116 | + | ||
| 117 | + $('#teacherMyCerterHomePage').on('click',this._homePageHandler.bind(this));//首页 | ||
| 118 | + $('#teacherMyCerterUpPage').on('click',this._upPageHandler.bind(this));//上页 | ||
| 119 | + $('#teacherMyCerterDownPage').on('click',this._downPageHandler.bind(this));//下页 | ||
| 120 | + $('#teacherMyCerterEndPage').on('click',this._endPageHandler.bind(this));//尾页 | ||
| 121 | + $('#teacherMyCerterSpecificPage').on('click',this._assignPageHandler.bind(this));//指定页 | ||
| 122 | + | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + addEvent() { | ||
| 126 | + | ||
| 127 | + } | ||
| 128 | + //首页 | ||
| 129 | + _createClassHomePage(){ | ||
| 130 | + this._teacherLiveModule(1); | ||
| 131 | + } | ||
| 132 | + //首页 | ||
| 133 | + _homePageHandler(){ | ||
| 134 | + this.presentInd = 1; | ||
| 135 | + this._teacherLiveModule(this.presentInd); | ||
| 136 | + } | ||
| 137 | + //上页 | ||
| 138 | + _upPageHandler(){ | ||
| 139 | + if(this.presentInd > 1){ | ||
| 140 | + this.presentInd--; | ||
| 141 | + this._teacherLiveModule(this.presentInd); | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + //下页 | ||
| 145 | + _downPageHandler(){ | ||
| 146 | + loger.log('点击下一页') | ||
| 147 | + if(this.presentInd < this.pageNo){ | ||
| 148 | + this.presentInd++; | ||
| 149 | + this._teacherLiveModule(this.presentInd); | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + //尾页 | ||
| 153 | + _endPageHandler(){ | ||
| 154 | + this.presentInd = this.pageNo; | ||
| 155 | + this._teacherLiveModule(this.presentInd); | ||
| 156 | + } | ||
| 157 | + //指定页 | ||
| 158 | + _assignPageHandler(){ | ||
| 159 | + let inputVal = $('#teacherMyCerterPageInfoInput').val(); | ||
| 160 | + if(parseInt(inputVal) <= this.pageNo || parseInt(inputVal) >= 1 ){ | ||
| 161 | + this._teacherLiveModule(parseInt(inputVal)); | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + loadMeeting(meeting){ | ||
| 165 | + let status = meeting["meetingStatus"]; | ||
| 166 | + if(status != ''){ | ||
| 167 | + if (status == "1" || status == "2") { | ||
| 168 | + return '已开始'; | ||
| 169 | + }else{ | ||
| 170 | + if (status == "2") { | ||
| 171 | + // alert("会议已经开始!"); | ||
| 172 | + return '已开始'; | ||
| 173 | + } else if (status == "3") { | ||
| 174 | + return '未开始'; | ||
| 175 | + // alert("未到开始时间!"); | ||
| 176 | + } else if (status == "4") { | ||
| 177 | + // alert("会议已经结束!"); | ||
| 178 | + return '已结束'; | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + //老师端数据请求 | ||
| 184 | + _teacherCurriculumInfo(data,num,ind,callback){ | ||
| 185 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting'; | ||
| 186 | + let that = this; | ||
| 187 | + $.ajax({ | ||
| 188 | + type: "POST", | ||
| 189 | + url: _url, | ||
| 190 | + timeout:5000, | ||
| 191 | + data : data, | ||
| 192 | + headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, | ||
| 193 | + 'token':ClassDataProxy.token}, | ||
| 194 | + success:function(_data){ | ||
| 195 | + | ||
| 196 | + //获取我的课程数据 | ||
| 197 | + if(_data && _data.code == 200){ | ||
| 198 | + if(callback){ | ||
| 199 | + callback(_data); | ||
| 200 | + } | ||
| 201 | + }else{ | ||
| 202 | + if(callback){ | ||
| 203 | + callback(null); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + }, | ||
| 207 | + error:function(error){ | ||
| 208 | + //alert('直播数据获取失败') | ||
| 209 | + if(callback){ | ||
| 210 | + callback(null); | ||
| 211 | + } | ||
| 212 | + loger.log(error,'直播数据获取失败') | ||
| 213 | + } | ||
| 214 | + }) | ||
| 215 | + } | ||
| 216 | + _studentCurriculumInfo(num,callback){ | ||
| 217 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id; | ||
| 218 | + let that = this; | ||
| 219 | + $.ajax({ | ||
| 220 | + type: "GET", | ||
| 221 | + url: _url, | ||
| 222 | + timeout:5000, | ||
| 223 | + headers: {siteId:ClassDataProxy.siteId,pageno:num,id:ClassDataProxy.id, | ||
| 224 | + 'token':ClassDataProxy.token}, | ||
| 225 | + success:function(_data){ | ||
| 226 | + | ||
| 227 | + //获取我的课程数据 | ||
| 228 | + if(_data && _data.code == 200){ | ||
| 229 | + if(callback){ | ||
| 230 | + callback(_data); | ||
| 231 | + } | ||
| 232 | + }else{ | ||
| 233 | + if(callback){ | ||
| 234 | + callback(null); | ||
| 235 | + } | ||
| 236 | + } | ||
| 237 | + }, | ||
| 238 | + error:function(error){ | ||
| 239 | + //alert('直播数据获取失败') | ||
| 240 | + if(callback){ | ||
| 241 | + callback(null); | ||
| 242 | + } | ||
| 243 | + loger.log(error,'直播数据获取失败') | ||
| 244 | + } | ||
| 245 | + }) | ||
| 246 | + } | ||
| 247 | + //老师端首页默认数据 | ||
| 248 | + detailPageTeacher(){ | ||
| 249 | + //首页课程 | ||
| 250 | + this._teacherCourseModule(); | ||
| 251 | + //首页直播信息 | ||
| 252 | + this._teacherLiveModule(1); | ||
| 253 | + } | ||
| 254 | + detailPageStudent(){ | ||
| 255 | + this._studentCourseModule(); | ||
| 256 | + //首页课程 | ||
| 257 | + let ind = $('#studentInfoList .liveInfoLeftLiCheck').attr('data'); | ||
| 258 | + let studentMyCenterContentList = $('#studentMyCenterContentList'); | ||
| 259 | + switch (parseInt(ind)){ | ||
| 260 | + case 0: | ||
| 261 | + //待学习 | ||
| 262 | + this._studentStudyModule(studentMyCenterContentList); | ||
| 263 | + break; | ||
| 264 | + case 1: | ||
| 265 | + //已学完 | ||
| 266 | + this._studentStudyOverModule(studentMyCenterContentList); | ||
| 267 | + break; | ||
| 268 | + case 2: | ||
| 269 | + //收藏 | ||
| 270 | + this._studenTcollectModule(studentMyCenterContentList); | ||
| 271 | + break; | ||
| 272 | + default: | ||
| 273 | + return; | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + isLocalStorage(){ | ||
| 279 | + let newDate = new Date(); | ||
| 280 | + let newHours = newDate.getHours(); | ||
| 281 | + let text = newHours>12?'下午好,':'上午好,' | ||
| 282 | + $('#teacherMyCenterTime').text(text); | ||
| 283 | + | ||
| 284 | + | ||
| 285 | + // this.detailpage(); | ||
| 286 | + | ||
| 287 | + loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1) | ||
| 288 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 289 | + //首页默认数据 | ||
| 290 | + // this.detailPageTeacher(); | ||
| 291 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 292 | + $('#teacherMyCenterStatus').text('老师'); | ||
| 293 | + $('#teacherUI .recordLi').eq(2).hide(); | ||
| 294 | + $('#teacherMyCerter').show(); | ||
| 295 | + $('#studentMyCerter').hide(); | ||
| 296 | + $('#myCenterBox').show(); | ||
| 297 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 298 | + //首页默认数据 | ||
| 299 | + // this.detailPageStudent(); | ||
| 300 | + $('#myCenterBox').show(); | ||
| 301 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 302 | + $('#teacherMyCenterStatus').text('同学'); | ||
| 303 | + $('#teacherMyCerter').hide(); | ||
| 304 | + $('#studentMyCerter').show(); | ||
| 305 | + $('#teacherUI .recordLi').eq(2).show(); | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + $('#lanclassBox').hide(); | ||
| 309 | + | ||
| 310 | + $('#oneselfInfoLoginName').val( ClassDataProxy.loginName);//登录名 | ||
| 311 | + $('#oneselfInfoUserName').val(ClassDataProxy.monicker);//用户名 | ||
| 312 | + let setMail = $('#setMail');//邮箱 | ||
| 313 | + let setPhone = $('#setPhone');//手机号 | ||
| 314 | + let userEmail = this.updateEmail(ClassDataProxy.userEmail); | ||
| 315 | + let userMobile = this.updateMobile(ClassDataProxy.userMobile); | ||
| 316 | + setMail.attr('data',ClassDataProxy.userEmail); | ||
| 317 | + setPhone.attr('data',ClassDataProxy.userMobile); | ||
| 318 | + setMail.html(userEmail) | ||
| 319 | + setPhone.html(userMobile) | ||
| 320 | + } | ||
| 321 | + _recordLiHandler(evt){ | ||
| 322 | + let ind = $(evt.currentTarget).attr('data'); | ||
| 323 | + $(evt.currentTarget).addClass('recordLiCheck').siblings().removeClass('recordLiCheck'); | ||
| 324 | + $('.myCenterContentBox').eq(ind).show().siblings().hide(); | ||
| 325 | + switch (parseInt(ind)){ | ||
| 326 | + case 0: | ||
| 327 | + //首页 | ||
| 328 | + this.detailpage(); | ||
| 329 | + break; | ||
| 330 | + case 1: | ||
| 331 | + //我的课程 | ||
| 332 | + this.myCoursesMessage(); | ||
| 333 | + break; | ||
| 334 | + case 2: | ||
| 335 | + //我的预约 | ||
| 336 | + this.myBookingsMessage(); | ||
| 337 | + break; | ||
| 338 | + case 3: | ||
| 339 | + //个人信息 | ||
| 340 | + this._updatMessage(); | ||
| 341 | + break; | ||
| 342 | + default: | ||
| 343 | + return; | ||
| 344 | + } | ||
| 345 | + } | ||
| 346 | + detailpage(){ | ||
| 347 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 348 | + //this.detailPageTeacher(); | ||
| 349 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 350 | + // this.detailPageStudent(); | ||
| 351 | + } | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + /*-------------------老师-------------------*/ | ||
| 355 | + //老师端首页课程显示 | ||
| 356 | + _teacherCourseModule(){ | ||
| 357 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | ||
| 358 | + let that = this; | ||
| 359 | + this._teacherCurriculumInfo(data,3,1,function(_data){ | ||
| 360 | + //首页今日课程渲染 | ||
| 361 | + if(_data){ | ||
| 362 | + that._teacherCourseCourse(_data.returnData.data.meetingInfo); | ||
| 363 | + } | ||
| 364 | + }) | ||
| 365 | + } | ||
| 366 | + //老师端首页课程数据渲染 | ||
| 367 | + _teacherCourseCourse(_data){ | ||
| 368 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 369 | + myCurriculumInfo.empty(); | ||
| 370 | + let that = this; | ||
| 371 | + if(_data) { | ||
| 372 | + for (let i = 0; i < _data.length; i++) { | ||
| 373 | + let item = _data[i]; | ||
| 374 | + if (item) { | ||
| 375 | + let curInfo = this._format(curriculumList, { | ||
| 376 | + _infoTit: item.meetingName, | ||
| 377 | + _meetingNumber: item.meetingNumber, | ||
| 378 | + _countDown: that.loadMeeting(item), | ||
| 379 | + _isShow: (that.loadMeeting(item) == '已开始') ? 'block' : 'none' | ||
| 380 | + }) | ||
| 381 | + myCurriculumInfo.append(curInfo); | ||
| 382 | + } else { | ||
| 383 | + console.error('_gainClassData没数据') | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + } | ||
| 387 | + } | ||
| 388 | + } | ||
| 389 | + //老师端首页直播数据 | ||
| 390 | + _teacherLiveModule(ind){ | ||
| 391 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; | ||
| 392 | + let that = this; | ||
| 393 | + this._teacherCurriculumInfo(data,4,ind,function(_data){ | ||
| 394 | + //首页直播信息渲染 | ||
| 395 | + if(_data){ | ||
| 396 | + that._teacherLiveCourse(_data.returnData.data); | ||
| 397 | + } | ||
| 398 | + }) | ||
| 399 | + } | ||
| 400 | + _teacherLiveCourse(_data){ | ||
| 401 | + let teacherMyCenterContentList = $('#teacherMyCenterContentList'); | ||
| 402 | + teacherMyCenterContentList.empty(); | ||
| 403 | + | ||
| 404 | + let count = _data.count; | ||
| 405 | + let page = _data.page; | ||
| 406 | + let pageno = _data.pageno; | ||
| 407 | + let pagenum = Math.ceil(count / pageno); | ||
| 408 | + let _dataList = _data.meetingInfo; | ||
| 409 | + loger.log('老师端信息想显示',_data) | ||
| 410 | + this.pageNo = pagenum; | ||
| 411 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 412 | + teacherMyCenterContentList.append(adminListTit) | ||
| 413 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 414 | + if(count <= 8){ | ||
| 415 | + $('#teacherMyCerterPageBox').hide(); | ||
| 416 | + } | ||
| 417 | + let _adminList = this._format(adminList,{ | ||
| 418 | + _meetingName : _dataList[i].meetingName, | ||
| 419 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 420 | + _create_user : _dataList[i].create_user, | ||
| 421 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 422 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 423 | + _num : '0' | ||
| 424 | + }) | ||
| 425 | + teacherMyCenterContentList.append(_adminList) | ||
| 426 | + } | ||
| 427 | + teacherMyCenterContentList.append(adminListEnd) | ||
| 428 | + } | ||
| 429 | + _teacherCourse(_data){ | ||
| 430 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 431 | + courseMinuteList.empty(); | ||
| 432 | + let count = _data.count; | ||
| 433 | + let page = _data.page; | ||
| 434 | + let pageno = _data.pageno; | ||
| 435 | + let pagenum = Math.ceil(count / pageno); | ||
| 436 | + let _dataList = _data.meetingInfo; | ||
| 437 | + this.pageNo = pagenum; | ||
| 438 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 439 | + courseMinuteList.append(adminListTit) | ||
| 440 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 441 | + if(count <= 8){ | ||
| 442 | + $('#teacherMyCerterPageBox').hide(); | ||
| 443 | + } | ||
| 444 | + let _adminList = this._format(adminList,{ | ||
| 445 | + _meetingName : _dataList[i].meetingName, | ||
| 446 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 447 | + _create_user : _dataList[i].create_user, | ||
| 448 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 449 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 450 | + _num : '0' | ||
| 451 | + }) | ||
| 452 | + courseMinuteList.append(_adminList) | ||
| 453 | + } | ||
| 454 | + courseMinuteList.append(adminListEnd) | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + /*---------------------------学生-----------------------*/ | ||
| 458 | + //学生端首页課程显示 | ||
| 459 | + _studentCourseModule(){ | ||
| 460 | + let that = this; | ||
| 461 | + this._studentCurriculumInfo(3,function(_data){ | ||
| 462 | + that.studentCourseList(_data.returnData.data); | ||
| 463 | + }) | ||
| 464 | + } | ||
| 465 | + studentCourseList(_data){ | ||
| 466 | + if(_data){ | ||
| 467 | + loger.log('学生端首页课程信息',_data) | ||
| 468 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 469 | + myCurriculumInfo.empty(); | ||
| 470 | + let that = this; | ||
| 471 | + if(_data) { | ||
| 472 | + for (let i = 0; i < _data.length; i++) { | ||
| 473 | + let item = _data[i]; | ||
| 474 | + let timer = ClassDataProxy.getTimeCountDown(item.meetingBeginTime,item.meetingEndTime) | ||
| 475 | + loger.log('newTimenewTimenewTimenewTime',timer) | ||
| 476 | + if (item) { | ||
| 477 | + let curInfo = this._format(curriculumList, { | ||
| 478 | + _infoTit: item.meeting_name, | ||
| 479 | + _meetingNumber: item.meetingNumber, | ||
| 480 | + _countDown:timer , | ||
| 481 | + _isShow: (timer == '已结束') ? 'none' : 'block' | ||
| 482 | + }) | ||
| 483 | + myCurriculumInfo.append(curInfo); | ||
| 484 | + } else { | ||
| 485 | + console.error('_gainClassData没数据') | ||
| 486 | + } | ||
| 487 | + | ||
| 488 | + } | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + } | ||
| 492 | + //学生端首页学习数据 | ||
| 493 | + _studentStudyModule(studentMyCenterContentList){ | ||
| 494 | + let that = this; | ||
| 495 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 496 | + if(_data){ | ||
| 497 | + that.studentStudyList(studentMyCenterContentList,_data.returnData.data); | ||
| 498 | + } | ||
| 499 | + }) | ||
| 500 | + } | ||
| 501 | + studentStudyList(studentMyCenterContentList,_data){ | ||
| 502 | + studentMyCenterContentList.empty(); | ||
| 503 | + $('#courseMinutePageBox').hide(); | ||
| 504 | + for(let i = 0;i<_data.length;i++){ | ||
| 505 | + if(_data[i]){ | ||
| 506 | + if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 507 | + let j = (i%4)==3; | ||
| 508 | + let _classifyList = this._format(classifyList,{ | ||
| 509 | + _classifyListR : j?'classifyListR':'', | ||
| 510 | + _isShowTitle : 'none', | ||
| 511 | + _meetingNumber : _data[i].meetingNumber, | ||
| 512 | + _msgImg : '../images/u373.png', | ||
| 513 | + _meetingName : _data[i].meeting_name, | ||
| 514 | + _create_user : _data[i].teacherName, | ||
| 515 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 516 | + }) | ||
| 517 | + studentMyCenterContentList.append(_classifyList) | ||
| 518 | + } | ||
| 519 | + }else{ | ||
| 520 | + console.error('_gainClassData没数据') | ||
| 521 | + } | ||
| 522 | + } | ||
| 523 | + | ||
| 524 | + } | ||
| 525 | + //已学完 | ||
| 526 | + _studentStudyOverModule(studentMyCenterContentList){ | ||
| 527 | + let that = this; | ||
| 528 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 529 | + that.studentStudyOverList(studentMyCenterContentList,_data.returnData.data); | ||
| 530 | + }) | ||
| 531 | + } | ||
| 532 | + studentStudyOverList(studentMyCenterContentList,_data){ | ||
| 533 | + studentMyCenterContentList.empty(); | ||
| 534 | + $('#courseMinutePageBox').hide(); | ||
| 535 | + for(let i = 0;i<_data.length;i++){ | ||
| 536 | + if(_data[i]){ | ||
| 537 | + if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 538 | + let j = (i%4)==3; | ||
| 539 | + let _classifyList = this._format(classifyList,{ | ||
| 540 | + _classifyListR : j?'classifyListR':'', | ||
| 541 | + _isShowTitle : 'none', | ||
| 542 | + _meetingNumber : _data[i].meetingNumber, | ||
| 543 | + _msgImg : '../images/u373.png', | ||
| 544 | + _meetingName : _data[i].meeting_name, | ||
| 545 | + _create_user : _data[i].teacherName, | ||
| 546 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 547 | + }) | ||
| 548 | + studentMyCenterContentList.append(_classifyList) | ||
| 549 | + } | ||
| 550 | + }else{ | ||
| 551 | + console.error('_gainClassData没数据') | ||
| 552 | + } | ||
| 553 | + } | ||
| 554 | + | ||
| 555 | + } | ||
| 556 | + _studenTcollectModule(studentMyCenterContentList){ | ||
| 557 | + let that = this; | ||
| 558 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 559 | + that.studentTcollectList(studentMyCenterContentList,_data.returnData.data); | ||
| 560 | + }) | ||
| 561 | + } | ||
| 562 | + studentTcollectList(studentMyCenterContentList,_data){ | ||
| 563 | + studentMyCenterContentList.empty(); | ||
| 564 | + $('#courseMinutePageBox').hide(); | ||
| 565 | + /* for(let i = 0;i<_data.length;i++){ | ||
| 566 | + if(_data[i]){ | ||
| 567 | + if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 568 | + let j = (i%4)==3; | ||
| 569 | + let _classifyList = this._format(classifyList,{ | ||
| 570 | + _classifyListR : j?'classifyListR':'', | ||
| 571 | + _isShowTitle : 'none', | ||
| 572 | + _meetingNumber : _data[i].meetingNumber, | ||
| 573 | + _msgImg : '../images/u373.png', | ||
| 574 | + _meetingName : _data[i].meeting_name, | ||
| 575 | + _create_user : _data[i].teacherName, | ||
| 576 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 577 | + }) | ||
| 578 | + studentMyCenterContentList.append(_classifyList) | ||
| 579 | + } | ||
| 580 | + }else{ | ||
| 581 | + console.error('_gainClassData没数据') | ||
| 582 | + } | ||
| 583 | + }*/ | ||
| 584 | + | ||
| 585 | + } | ||
| 586 | + //提交用户信息修改 | ||
| 587 | + _accountInfoSaveBtnHandler(){ | ||
| 588 | + let id = ClassDataProxy.id;//id | ||
| 589 | + | ||
| 590 | + let loginName = ClassDataProxy.loginName;//登录名 | ||
| 591 | + let userMobile = ClassDataProxy.userMobile;//手机号 | ||
| 592 | + let userEmail = ClassDataProxy.userEmail;//邮箱 | ||
| 593 | + let monicker = ClassDataProxy.monicker;//用户名 | ||
| 594 | + let passWord = ClassDataProxy.password;//密码 | ||
| 595 | + | ||
| 596 | + let oneselfInfoLoginName = $('#oneselfInfoLoginName').val();//登录名 | ||
| 597 | + let oneselfInfoUserName = $('#oneselfInfoUserName').val();//用户名 | ||
| 598 | + let oneselfInfoMan = $('#oneselfInfoMan');//性别 | ||
| 599 | + let setPassWord = $('#setPassWord').attr('data');//密码 | ||
| 600 | + let setMail = $('#setMail').attr('data');//邮箱 | ||
| 601 | + let setPhone = $('#setPhone').attr('data');//手机号 | ||
| 602 | + let signInfo = {}; | ||
| 603 | + if(oneselfInfoLoginName != loginName){ | ||
| 604 | + signInfo.loginName = oneselfInfoLoginName; | ||
| 605 | + } | ||
| 606 | + if(oneselfInfoUserName != monicker){ | ||
| 607 | + signInfo.userName = oneselfInfoUserName; | ||
| 608 | + } | ||
| 609 | + if(!setPassWord){ | ||
| 610 | + // signInfo.loginName = oneselfInfoLoginName; | ||
| 611 | + } | ||
| 612 | + if(setMail != userEmail){ | ||
| 613 | + signInfo.userEmail = setMail; | ||
| 614 | + } | ||
| 615 | + if(setPhone != userMobile){ | ||
| 616 | + signInfo.userMobile = setPhone; | ||
| 617 | + } | ||
| 618 | + let that = this; | ||
| 619 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/users/updateUserByUserId/' + id; | ||
| 620 | + $.ajax({ | ||
| 621 | + type: "PUT", | ||
| 622 | + url: _url, | ||
| 623 | + timeout:5000, | ||
| 624 | + headers: {siteId:ClassDataProxy.siteId, | ||
| 625 | + 'token':ClassDataProxy.token}, | ||
| 626 | + data:signInfo, | ||
| 627 | + success:function(_data){ | ||
| 628 | + //获取个人信息数据 | ||
| 629 | + if(_data && _data.code == 200){ | ||
| 630 | + loger.log('修改信息成功',_data) | ||
| 631 | + | ||
| 632 | + ErrorApe.showWarnError('修改信息成功'); | ||
| 633 | + ClassDataProxy.loginName =_data.returnData.data.loginName; | ||
| 634 | + ClassDataProxy.monicker = _data.returnData.data.userName; | ||
| 635 | + ClassDataProxy.userEmail = _data.returnData.data.userEmail; | ||
| 636 | + ClassDataProxy.userMobile = _data.returnData.data.userMobile; | ||
| 637 | + window.localStorage.setItem('loginName', ClassDataProxy.loginName); | ||
| 638 | + window.localStorage.setItem('monicker', ClassDataProxy.monicker); | ||
| 639 | + window.localStorage.setItem('userEmail', ClassDataProxy.userEmail); | ||
| 640 | + window.localStorage.setItem('userMobile', ClassDataProxy.userMobile); | ||
| 641 | + $('#teacherMyCenterName').html(ClassDataProxy.loginName); | ||
| 642 | + }else if(_data.code == 400){ | ||
| 643 | + ErrorApe.showWarnError('账号未修改'); | ||
| 644 | + }else{ | ||
| 645 | + ErrorApe.showWarnError(_data.returnData.data.msg); | ||
| 646 | + } | ||
| 647 | + }, | ||
| 648 | + error:function(error){ | ||
| 649 | + loger.log(error,'修改信息失败') | ||
| 650 | + } | ||
| 651 | + }) | ||
| 652 | + } | ||
| 653 | + clearLocalStorage(){ | ||
| 654 | + window.localStorage.clear(); | ||
| 655 | + ClassDataProxy.userType = ClassDataProxy.USER_TYPE_0; | ||
| 656 | + ClassDataProxy.loginName =""; | ||
| 657 | + ClassDataProxy.password ="" | ||
| 658 | + ClassDataProxy.token =""; | ||
| 659 | + ClassDataProxy.status = false; | ||
| 660 | + | ||
| 661 | + } | ||
| 662 | + //个人信息 | ||
| 663 | + _updatMessage(){ | ||
| 664 | + $('#oneselfInfoLoginName').val( ClassDataProxy.loginName);//登录名 | ||
| 665 | + $('#oneselfInfoUserName').val(ClassDataProxy.monicker);//用户名 | ||
| 666 | + } | ||
| 667 | + //我的预约 | ||
| 668 | + myBookingsMessage(){ | ||
| 669 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 670 | + | ||
| 671 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 672 | + this.studentBookings(); | ||
| 673 | + } | ||
| 674 | + } | ||
| 675 | + studentBookings(){ | ||
| 676 | + let that = this; | ||
| 677 | + let data = $('#subscribeList').find('.liveInfoLeftLiCheck').attr('data'); | ||
| 678 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 679 | + if(_data){ | ||
| 680 | + if(data == '1'){ | ||
| 681 | + that._studentSubscribeTeacher(_data.returnData.data) | ||
| 682 | + }else{ | ||
| 683 | + that._studentSubscribe(_data.returnData.data) | ||
| 684 | + } | ||
| 685 | + | ||
| 686 | + } | ||
| 687 | + }); | ||
| 688 | + | ||
| 689 | + } | ||
| 690 | + _studentSubscribe(_data){ | ||
| 691 | + let teacherCorrelatedInfo = $('#teacherCorrelatedInfo'); | ||
| 692 | + teacherCorrelatedInfo.empty(); | ||
| 693 | + for(let i = 0;i<_data.length;i++){ | ||
| 694 | + if(_data[i]){ | ||
| 695 | + let j = (i%4)==3; | ||
| 696 | + let _classifyList = this._format(classifyList,{ | ||
| 697 | + _classifyListR : j?'classifyListR':'', | ||
| 698 | + _isShowTitle : 'none', | ||
| 699 | + _meetingNumber : _data[i].meetingNumber, | ||
| 700 | + _msgImg : '../images/u373.png', | ||
| 701 | + _meetingName : _data[i].meeting_name, | ||
| 702 | + _create_user : _data[i].teacherName, | ||
| 703 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0], | ||
| 704 | + _studentMeetingId : _data[i].studentMeetingId | ||
| 705 | + }) | ||
| 706 | + teacherCorrelatedInfo.append(_classifyList) | ||
| 707 | + | ||
| 708 | + }else{ | ||
| 709 | + console.error('_gainClassData没数据') | ||
| 710 | + } | ||
| 711 | + } | ||
| 712 | + | ||
| 713 | + } | ||
| 714 | + _studentSubscribeTeacher(_data){ | ||
| 715 | + let teacherCorrelatedInfo = $('#teacherCorrelatedInfo'); | ||
| 716 | + teacherCorrelatedInfo.empty(); | ||
| 717 | + if(_data){ | ||
| 718 | + this.teacherList={}; | ||
| 719 | + for(let i = 0;i<_data.length;i++){ | ||
| 720 | + let item=_data[i]; | ||
| 721 | + if(item){ | ||
| 722 | + let temp = item.teacherName; | ||
| 723 | + if(!this.teacherList[temp]) { | ||
| 724 | + this.teacherList[temp] = []; | ||
| 725 | + } | ||
| 726 | + this.teacherList[temp].push(item) | ||
| 727 | + } | ||
| 728 | + } | ||
| 729 | + for( let key in this.teacherList){ | ||
| 730 | + let teacherInfo = '' | ||
| 731 | + let arrList = this.teacherList[key]; | ||
| 732 | + teacherInfo = this._format(teacherInfoLeft,{ | ||
| 733 | + _teacherName : key, | ||
| 734 | + // meetingNumber | ||
| 735 | + }) | ||
| 736 | + for(let n = 0;n<arrList.length;n++){ | ||
| 737 | + teacherInfo += this._format(teacherInfoCenter,{ | ||
| 738 | + _imgSrc : 'images/u374.png', | ||
| 739 | + _id : arrList[n].teacherName | ||
| 740 | + }) | ||
| 741 | + } | ||
| 742 | + teacherInfo += this._format(teacherInfoRight,{ | ||
| 743 | + _teacherName : key | ||
| 744 | + }) | ||
| 745 | + teacherCorrelatedInfo.append(teacherInfo) | ||
| 746 | + } | ||
| 747 | + } | ||
| 748 | + } | ||
| 749 | + //我的课程 | ||
| 750 | + myCoursesMessage(){ | ||
| 751 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 752 | + this.teacherCourses(); | ||
| 753 | + $('#courseInfoList').hide(); | ||
| 754 | + $('#teacherLiveList').show(); | ||
| 755 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 756 | + this.studentCourses(); | ||
| 757 | + $('#courseInfoList').show(); | ||
| 758 | + $('#teacherLiveList').hide(); | ||
| 759 | + } | ||
| 760 | + } | ||
| 761 | + teacherCourses(){ | ||
| 762 | + let _index = $('#teacherLiveList .liveInfoLeftLiCheck').attr('data'); | ||
| 763 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 764 | + switch (parseInt(_index)){ | ||
| 765 | + case 0: | ||
| 766 | + //正在直播 | ||
| 767 | + loger.log('直播首页信息') | ||
| 768 | + this.teacherNowLiveModule(1); | ||
| 769 | + break; | ||
| 770 | + case 1: | ||
| 771 | + //未开始 | ||
| 772 | + this.teacherNoneLiveModule(1); | ||
| 773 | + loger.log('直播首页信息1') | ||
| 774 | + break; | ||
| 775 | + case 2: | ||
| 776 | + //已结束 | ||
| 777 | + break; | ||
| 778 | + default: | ||
| 779 | + return; | ||
| 780 | + } | ||
| 781 | + | ||
| 782 | + } | ||
| 783 | + teacherNowLiveModule(ind){ | ||
| 784 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; | ||
| 785 | + let that = this; | ||
| 786 | + this._teacherCurriculumInfo(data,12,ind,function(_data){ | ||
| 787 | + //首页直播信息渲染 | ||
| 788 | + if(_data){ | ||
| 789 | + // loger.log('首页直播信息渲染',_data) | ||
| 790 | + that._teacherCourse(_data.returnData.data); | ||
| 791 | + } | ||
| 792 | + }) | ||
| 793 | + } | ||
| 794 | + teacherNoneLiveModule(ind){ | ||
| 795 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | ||
| 796 | + let that = this; | ||
| 797 | + this._teacherCurriculumInfo(data,12,ind,function(_data){ | ||
| 798 | + //首页直播信息渲染 | ||
| 799 | + if(_data){ | ||
| 800 | + that._teacherCourse(_data.returnData.data); | ||
| 801 | + } | ||
| 802 | + }) | ||
| 803 | + } | ||
| 804 | + //老师端课程数据 | ||
| 805 | + _teacherCourseRender(_data){ | ||
| 806 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 807 | + courseMinuteList.empty(); | ||
| 808 | + let count = _data.count; | ||
| 809 | + let page = _data.page; | ||
| 810 | + let pageno = _data.pageno; | ||
| 811 | + let pagenum = Math.ceil(count / pageno); | ||
| 812 | + let _dataList = _data.meetingInfo; | ||
| 813 | + this.pageNo = pagenum; | ||
| 814 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 815 | + | ||
| 816 | + if(count <= 12){ | ||
| 817 | + $('#courseMinutePageBox').hide(); | ||
| 818 | + } | ||
| 819 | + //存储数据按日期分类 | ||
| 820 | + this.dataList={}; | ||
| 821 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 822 | + let item=_dataList[i]; | ||
| 823 | + if(item){ | ||
| 824 | + let temp = item.beginTime.split(' ')[0] | ||
| 825 | + if(!this.dataList[temp]) { | ||
| 826 | + this.dataList[temp] = []; | ||
| 827 | + } | ||
| 828 | + this.dataList[temp].push(item) | ||
| 829 | + } | ||
| 830 | + } | ||
| 831 | + for(let key in this.dataList){ | ||
| 832 | + let j = (key%4)==3; | ||
| 833 | + let arrList = this.dataList[key]; | ||
| 834 | + if(arrList){ | ||
| 835 | + for(let n = 0;n<arrList.length;n++){ | ||
| 836 | + let _classifyList = this._format(classifyList,{ | ||
| 837 | + _classifyListR : j?'classifyListR':'', | ||
| 838 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 839 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 840 | + _msgImg : '../images/u373.png', | ||
| 841 | + _meetingName : arrList[n].meetingName, | ||
| 842 | + _create_user : arrList[n].create_user, | ||
| 843 | + _liveTimer : key | ||
| 844 | + }) | ||
| 845 | + courseMinuteList.append(_classifyList) | ||
| 846 | + } | ||
| 847 | + } | ||
| 848 | + } | ||
| 849 | + } | ||
| 850 | + //学生端 我的课程 切换 | ||
| 851 | + studentCourses(){ | ||
| 852 | + let ind = $('#courseInfoList .liveInfoLeftLiCheck').attr('data'); | ||
| 853 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 854 | + switch (parseInt(ind)){ | ||
| 855 | + case 0: | ||
| 856 | + //待学习 | ||
| 857 | + this.studentFutureModule(courseMinuteList); | ||
| 858 | + break; | ||
| 859 | + case 1: | ||
| 860 | + //已学完 | ||
| 861 | + this.studentFormerlyModule(courseMinuteList); | ||
| 862 | + break; | ||
| 863 | + case 2: | ||
| 864 | + //收藏 | ||
| 865 | + this.studentCollectModule(courseMinuteList); | ||
| 866 | + break; | ||
| 867 | + default: | ||
| 868 | + return; | ||
| 869 | + } | ||
| 870 | + | ||
| 871 | + } | ||
| 872 | + //学生端 我的课程 待学习 | ||
| 873 | + studentFutureModule(courseMinuteList){ | ||
| 874 | + let that = this; | ||
| 875 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 876 | + if(_data){ | ||
| 877 | + that._studentCourseRender(courseMinuteList,_data.returnData.data) | ||
| 878 | + } | ||
| 879 | + }); | ||
| 880 | + | ||
| 881 | + } | ||
| 882 | + //学生端课程数据 待学习 | ||
| 883 | + _studentCourseRender(courseMinuteList,_data){ | ||
| 884 | + courseMinuteList.empty(); | ||
| 885 | + let count = _data.count; | ||
| 886 | + let page = _data.page; | ||
| 887 | + let pageno = _data.pageno; | ||
| 888 | + let pagenum = Math.ceil(count / pageno); | ||
| 889 | + let _dataList = _data; | ||
| 890 | + this.pageNo = pagenum; | ||
| 891 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 892 | + | ||
| 893 | + if(count <= 12){ | ||
| 894 | + $('#courseMinutePageBox').hide(); | ||
| 895 | + } | ||
| 896 | + //存储数据按日期分类 | ||
| 897 | + this.dataList={}; | ||
| 898 | + //if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 899 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 900 | + let item=_dataList[i]; | ||
| 901 | + if(item){ | ||
| 902 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 903 | + if(!this.dataList[temp]) { | ||
| 904 | + this.dataList[temp] = []; | ||
| 905 | + } | ||
| 906 | + this.dataList[temp].push(item) | ||
| 907 | + } | ||
| 908 | + } | ||
| 909 | + for(let key in this.dataList){ | ||
| 910 | + if(ClassDataProxy.getTimeDay(key)){ | ||
| 911 | + let arrList = this.dataList[key]; | ||
| 912 | + if(arrList){ | ||
| 913 | + for(let n = 0;n<arrList.length;n++){ | ||
| 914 | + let j = (n%4) == 3; | ||
| 915 | + let _classifyList = this._format(classifyList,{ | ||
| 916 | + _classifyListR : j ?'classifyListR':'', | ||
| 917 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 918 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 919 | + _msgImg : '../images/u373.png', | ||
| 920 | + _meetingName : arrList[n].meeting_name, | ||
| 921 | + _create_user : arrList[n].teacherName, | ||
| 922 | + _liveTimer : key | ||
| 923 | + }) | ||
| 924 | + courseMinuteList.append(_classifyList) | ||
| 925 | + } | ||
| 926 | + } | ||
| 927 | + } | ||
| 928 | + | ||
| 929 | + } | ||
| 930 | + } | ||
| 931 | + //学生端 我的课程 已学完 | ||
| 932 | + studentFormerlyModule(courseMinuteList){ | ||
| 933 | + let that = this; | ||
| 934 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 935 | + if(_data){ | ||
| 936 | + that._studentFormerlyRender(courseMinuteList,_data.returnData.data) | ||
| 937 | + } | ||
| 938 | + }); | ||
| 939 | + } | ||
| 940 | + //学生端课程数据 已学完 | ||
| 941 | + _studentFormerlyRender(courseMinuteList,_data){ | ||
| 942 | + courseMinuteList.empty(); | ||
| 943 | + let count = _data.count; | ||
| 944 | + let page = _data.page; | ||
| 945 | + let pageno = _data.pageno; | ||
| 946 | + let pagenum = Math.ceil(count / pageno); | ||
| 947 | + let _dataList = _data; | ||
| 948 | + this.pageNo = pagenum; | ||
| 949 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 950 | + | ||
| 951 | + if(count <= 12){ | ||
| 952 | + $('#courseMinutePageBox').hide(); | ||
| 953 | + } | ||
| 954 | + //存储数据按日期分类 | ||
| 955 | + this.dataList={}; | ||
| 956 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 957 | + let item=_dataList[i]; | ||
| 958 | + if(item){ | ||
| 959 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 960 | + if(!this.dataList[temp]) { | ||
| 961 | + this.dataList[temp] = []; | ||
| 962 | + } | ||
| 963 | + this.dataList[temp].push(item) | ||
| 964 | + } | ||
| 965 | + } | ||
| 966 | + for(let key in this.dataList){ | ||
| 967 | + if(!ClassDataProxy.getTimeDay(key)){ | ||
| 968 | + let arrList = this.dataList[key]; | ||
| 969 | + if(arrList){ | ||
| 970 | + for(let n = 0;n<arrList.length;n++){ | ||
| 971 | + let j = (n%4) == 3; | ||
| 972 | + let _classifyList = this._format(classifyList,{ | ||
| 973 | + _classifyListR : j ?'classifyListR':'', | ||
| 974 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 975 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 976 | + _msgImg : '../images/u373.png', | ||
| 977 | + _meetingName : arrList[n].meeting_name, | ||
| 978 | + _create_user : arrList[n].teacherName, | ||
| 979 | + _liveTimer : key | ||
| 980 | + }) | ||
| 981 | + courseMinuteList.append(_classifyList) | ||
| 982 | + } | ||
| 983 | + } | ||
| 984 | + } | ||
| 985 | + | ||
| 986 | + } | ||
| 987 | + } | ||
| 988 | + //学生端 我的课程 收藏 | ||
| 989 | + studentCollectModule(courseMinuteList){ | ||
| 990 | + let that = this; | ||
| 991 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 992 | + if(_data){ | ||
| 993 | + loger.log('显示收藏数据',_data) | ||
| 994 | + that._studentCollectRender(courseMinuteList,_data.returnData.data) | ||
| 995 | + } | ||
| 996 | + }); | ||
| 997 | + } | ||
| 998 | + //学生端课程数据 收藏 | ||
| 999 | + _studentCollectRender(courseMinuteList,_data){ | ||
| 1000 | + courseMinuteList.empty(); | ||
| 1001 | + let count = _data.count; | ||
| 1002 | + let page = _data.page; | ||
| 1003 | + let pageno = _data.pageno; | ||
| 1004 | + let pagenum = Math.ceil(count / pageno); | ||
| 1005 | + let _dataList = _data; | ||
| 1006 | + this.pageNo = pagenum; | ||
| 1007 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 1008 | + | ||
| 1009 | + if(count <= 12){ | ||
| 1010 | + $('#courseMinutePageBox').hide(); | ||
| 1011 | + } | ||
| 1012 | + //存储数据按日期分类 | ||
| 1013 | + this.dataList={}; | ||
| 1014 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1015 | + let item=_dataList[i]; | ||
| 1016 | + if(item){ | ||
| 1017 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 1018 | + if(!this.dataList[temp]) { | ||
| 1019 | + this.dataList[temp] = []; | ||
| 1020 | + } | ||
| 1021 | + this.dataList[temp].push(item) | ||
| 1022 | + } | ||
| 1023 | + } | ||
| 1024 | + for(let key in this.dataList){ | ||
| 1025 | + if(!ClassDataProxy.getTimeDay(key)){ | ||
| 1026 | + let arrList = this.dataList[key]; | ||
| 1027 | + if(arrList){ | ||
| 1028 | + for(let n = 0;n<arrList.length;n++){ | ||
| 1029 | + let j = (n%4) == 3; | ||
| 1030 | + let _classifyList = this._format(classifyList,{ | ||
| 1031 | + _classifyListR : j ?'classifyListR':'', | ||
| 1032 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 1033 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 1034 | + _msgImg : '../images/u373.png', | ||
| 1035 | + _meetingName : arrList[n].meeting_name, | ||
| 1036 | + _create_user : arrList[n].teacherName, | ||
| 1037 | + _liveTimer : key | ||
| 1038 | + }) | ||
| 1039 | + // courseMinuteList.append(_classifyList) | ||
| 1040 | + } | ||
| 1041 | + } | ||
| 1042 | + } | ||
| 1043 | + | ||
| 1044 | + } | ||
| 1045 | + } | ||
| 1046 | + //老师端首页显示课程 | ||
| 1047 | + _teacherHomeCourse(_data){ | ||
| 1048 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 1049 | + myCurriculumInfo.empty(); | ||
| 1050 | + if(_data){ | ||
| 1051 | + for(let i = 0;i < 3;i++){ | ||
| 1052 | + let item = _data[i]; | ||
| 1053 | + if(item){ | ||
| 1054 | + let curInfo = this._format(curriculumList,{ | ||
| 1055 | + _infoTit : item.meetingName, | ||
| 1056 | + _meetingNumber : item.meetingNumber, | ||
| 1057 | + _countDown : that.loadMeeting(item), | ||
| 1058 | + _isShow : (that.loadMeeting(item)=='已开始')?'block':'none' | ||
| 1059 | + }) | ||
| 1060 | + myCurriculumInfo.append(curInfo); | ||
| 1061 | + }else{ | ||
| 1062 | + console.error('_gainClassData没数据') | ||
| 1063 | + } | ||
| 1064 | + | ||
| 1065 | + } | ||
| 1066 | + } | ||
| 1067 | + } | ||
| 1068 | + //老师端首页直播信息 | ||
| 1069 | + _liveClassData(_data){ | ||
| 1070 | + let teacherMyCenterContentList = $('#teacherMyCenterContentList'); | ||
| 1071 | + teacherMyCenterContentList.empty(); | ||
| 1072 | + let count = _data.count; | ||
| 1073 | + let page = _data.page; | ||
| 1074 | + let pageno = _data.pageno; | ||
| 1075 | + let pagenum = Math.ceil(count / pageno); | ||
| 1076 | + let _dataList = _data.meetingInfo; | ||
| 1077 | + this.pageNo = pagenum; | ||
| 1078 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 1079 | + teacherMyCenterContentList.append(adminListTit) | ||
| 1080 | + | ||
| 1081 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1082 | + if(count <= 8){ | ||
| 1083 | + $('#teacherMyCerterPageBox').hide(); | ||
| 1084 | + } | ||
| 1085 | + let _adminList = this._format(adminList,{ | ||
| 1086 | + _meetingName : _dataList[i].meetingName, | ||
| 1087 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 1088 | + _create_user : _dataList[i].create_user, | ||
| 1089 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 1090 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 1091 | + _num : '0' | ||
| 1092 | + }) | ||
| 1093 | + teacherMyCenterContentList.append(_adminList) | ||
| 1094 | + } | ||
| 1095 | + teacherMyCenterContentList.append(adminListEnd) | ||
| 1096 | + } | ||
| 1097 | + | ||
| 1098 | + | ||
| 1099 | + //修改密码 | ||
| 1100 | + _accountPassWordBtnHandler(){ | ||
| 1101 | + this.data = 0; | ||
| 1102 | + this._showInputBox(this.data); | ||
| 1103 | + } | ||
| 1104 | + //修改邮箱 | ||
| 1105 | + _accountEmailBtnHandler(){ | ||
| 1106 | + this.data = 1; | ||
| 1107 | + this._showInputBox(this.data); | ||
| 1108 | + } | ||
| 1109 | + //修改手机号 | ||
| 1110 | + _accountMobilelBtnHandler(){ | ||
| 1111 | + this.data = 2; | ||
| 1112 | + this._showInputBox(this.data); | ||
| 1113 | + } | ||
| 1114 | + _myCenterBoxHandler(){ | ||
| 1115 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_2){ | ||
| 1116 | + return; | ||
| 1117 | + } | ||
| 1118 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 1119 | + $('#slideshow').hide(); | ||
| 1120 | + $('#defaultBox').hide(); | ||
| 1121 | + $('#classifyListBox').hide(); | ||
| 1122 | + $('#lanclassBox').hide(); | ||
| 1123 | + $('#liveContentAllBox').hide(); | ||
| 1124 | + $('#lanclassAllBox').hide(); | ||
| 1125 | + $('#teacherIntroAllBox').hide(); | ||
| 1126 | + $('#teacherDetailBox').hide(); | ||
| 1127 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 1128 | + | ||
| 1129 | + } | ||
| 1130 | + $('#myCenterBox').show(); | ||
| 1131 | + | ||
| 1132 | + } | ||
| 1133 | + _updateInputYesHandler(evt){ | ||
| 1134 | + let updateInput = $('#updateInput').val(); | ||
| 1135 | + switch (parseInt(this.data)){ | ||
| 1136 | + case 0: | ||
| 1137 | + //密码 | ||
| 1138 | + let reg = /^[0-9a-zA-Z]{8,12}$/; | ||
| 1139 | + if(!updateInput || !(reg.test(updateInput))){ | ||
| 1140 | + ErrorApe.showWarnError('密码格式不正确,请重新输入'); | ||
| 1141 | + return; | ||
| 1142 | + } | ||
| 1143 | + $('#setPassWord').attr('data',updateInput); | ||
| 1144 | + this._hideInputBox(); | ||
| 1145 | + break; | ||
| 1146 | + case 1: | ||
| 1147 | + //邮箱 | ||
| 1148 | + let filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | ||
| 1149 | + if(!updateInput || !(filter.test(updateInput))){ | ||
| 1150 | + ErrorApe.showWarnError('邮箱格式不正确,请重新输入'); | ||
| 1151 | + return; | ||
| 1152 | + } | ||
| 1153 | + $('#setMail').attr('data',updateInput); | ||
| 1154 | + $('#setMail').html(this.updateEmail(updateInput)) | ||
| 1155 | + this._hideInputBox(); | ||
| 1156 | + break; | ||
| 1157 | + case 2: | ||
| 1158 | + //手机号 | ||
| 1159 | + let reg1 = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$/; | ||
| 1160 | + let regPhone = "^1[3|4|5|8][0-9]\\d{8}$"; | ||
| 1161 | + let re = new RegExp(regPhone); | ||
| 1162 | + if(!updateInput || !(re.test(updateInput))){ | ||
| 1163 | + ErrorApe.showWarnError('手机格式不正确,请重新输入'); | ||
| 1164 | + return; | ||
| 1165 | + } | ||
| 1166 | + $('#setPhone').attr('data',updateInput); | ||
| 1167 | + $('#setPhone').html(this.updateMobile(updateInput)) | ||
| 1168 | + this._hideInputBox(); | ||
| 1169 | + break; | ||
| 1170 | + default: | ||
| 1171 | + return; | ||
| 1172 | + } | ||
| 1173 | + | ||
| 1174 | + } | ||
| 1175 | + _hideInputBox(){ | ||
| 1176 | + $('#updateInput').val(''); | ||
| 1177 | + $('#updateInputShade').hide(); | ||
| 1178 | + } | ||
| 1179 | + _showInputBox(ind){ | ||
| 1180 | + let arr = ['请输入新密码 :','请输入新邮箱 :','请输入新手机号 :'] | ||
| 1181 | + $('#updateInputShade').show(); | ||
| 1182 | + $('#updateInputText').text(arr[ind]) | ||
| 1183 | + } | ||
| 1184 | + updateEmail(userEmail){ | ||
| 1185 | + return userEmail.replace(/(\d{2})\d{2}(\d{1})/, '$1****$2') | ||
| 1186 | + } | ||
| 1187 | + updateMobile(userMobile){ | ||
| 1188 | + return userMobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') | ||
| 1189 | + } | ||
| 1190 | + _enterClassRoomHandler(evt){ | ||
| 1191 | + let ind = $(evt.target).attr('data'); | ||
| 1192 | + window.open('http://networkshool.xuedianyun.com/3m/attend.do?meetingNumber=' + ind); | ||
| 1193 | + } | ||
| 1194 | + _mouseenter(evt){ | ||
| 1195 | + $(evt.currentTarget).find('.accessLearningBtn').show(); | ||
| 1196 | + } | ||
| 1197 | + _mouseleave(evt){ | ||
| 1198 | + $(evt.currentTarget).find('.accessLearningBtn').hide(); | ||
| 1199 | + } | ||
| 1200 | + _cancelMouseenter(evt){ | ||
| 1201 | + $(evt.currentTarget).find('.cancelReservation').show(); | ||
| 1202 | + } | ||
| 1203 | + _cancelMouseleave(evt){ | ||
| 1204 | + $(evt.currentTarget).find('.cancelReservation').hide(); | ||
| 1205 | + } | ||
| 1206 | + _teacherSubscribeMoveHandler(evt){ | ||
| 1207 | + $('#teacherDetailBox').show(); | ||
| 1208 | + $('#myCenterBox').hide(); | ||
| 1209 | + | ||
| 1210 | + let buttonIsCheck = $('#orderBtn').attr('value','0'); | ||
| 1211 | + if($('#orderBtn').attr('value') == '0'){ | ||
| 1212 | + $('#orderBtn').attr('disabled',false) | ||
| 1213 | + $('#orderBtn').css('background','#ccc') | ||
| 1214 | + } | ||
| 1215 | + | ||
| 1216 | + let teacherDetailCurriculum = $('#teacherDetailCurriculum'); | ||
| 1217 | + teacherDetailCurriculum.empty(); | ||
| 1218 | + | ||
| 1219 | + let _data = $(evt.target).attr('data'); | ||
| 1220 | + if(_data){ | ||
| 1221 | + let _dataList = this.teacherList[_data]; | ||
| 1222 | + $('#teacherDetailInfoDetailName').html(_dataList[0].teacherName); | ||
| 1223 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1224 | + let _teacherDetail = this._format(teacherDetail,{ | ||
| 1225 | + _detailList : _dataList[i].meeting_name | ||
| 1226 | + }) | ||
| 1227 | + teacherDetailCurriculum.append(_teacherDetail) | ||
| 1228 | + } | ||
| 1229 | + } | ||
| 1230 | + } | ||
| 1231 | + //取消预约 | ||
| 1232 | + _cancelSubscribeHandler(evt){ | ||
| 1233 | + let _id = $(evt.target).attr('data'); | ||
| 1234 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/updateStudentMeetingBySite/'+_id; | ||
| 1235 | + let that = this; | ||
| 1236 | + $.ajax({ | ||
| 1237 | + type: "PUT", | ||
| 1238 | + url: _url, | ||
| 1239 | + timeout:5000, | ||
| 1240 | + headers: { | ||
| 1241 | + siteId:ClassDataProxy.siteId, | ||
| 1242 | + 'token':ClassDataProxy.token | ||
| 1243 | + }, | ||
| 1244 | + data:{status:'5'}, | ||
| 1245 | + success:function(_data){ | ||
| 1246 | + //获取课堂数据 | ||
| 1247 | + if(_data && _data.code == 200){ | ||
| 1248 | + that.studentBookings(); | ||
| 1249 | + } | ||
| 1250 | + }, | ||
| 1251 | + error:function(error){ | ||
| 1252 | + console.log(error,'失败') | ||
| 1253 | + } | ||
| 1254 | + }) | ||
| 1255 | + | ||
| 1256 | + } | ||
| 1257 | + _teacherClassDetails(evt){ | ||
| 1258 | + let name = $(evt.target).attr('data'); | ||
| 1259 | + let ind = $(evt.target).index(); | ||
| 1260 | + let _data = this.teacherList[name][ind] | ||
| 1261 | + | ||
| 1262 | + $('#lanclassBox').show(); | ||
| 1263 | + $('#myCenterBox').hide(); | ||
| 1264 | + | ||
| 1265 | + $('#lanclassContentTitle').html(_data.meeting_name); | ||
| 1266 | + $('#lanclassContentInfoName').html(_data.teacherName); | ||
| 1267 | + $('#lanclassContentInfoTimeStart').html('开始时间:'+_data.meetingBeginTime); | ||
| 1268 | + $('#lanclassContentInfoTimeEnd').html('结束时间:'+_data.meetingEndTime); | ||
| 1269 | + | ||
| 1270 | + } | ||
| 1271 | + _judgeListPlace(){ | ||
| 1272 | + let i; | ||
| 1273 | + let curriculumList = document.getElementsByClassName('classifyListMyCenter'); | ||
| 1274 | + for(i=0;i<curriculumList.length;i++){ | ||
| 1275 | + if((i%4) == 3){ | ||
| 1276 | + $(curriculumList[i]).addClass('classifyListR'); | ||
| 1277 | + } | ||
| 1278 | + } | ||
| 1279 | + } | ||
| 1280 | + //切换类的公用样式 | ||
| 1281 | + commonality(evt){ | ||
| 1282 | + $(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck'); | ||
| 1283 | + } | ||
| 1284 | + _teacherInfoListHandler(evt){ | ||
| 1285 | + this.commonality(evt); | ||
| 1286 | + } | ||
| 1287 | + //学生端 首页 | ||
| 1288 | + _studentInfoListHandler(evt){ | ||
| 1289 | + this.commonality(evt); | ||
| 1290 | + this.detailPageStudent(); | ||
| 1291 | + } | ||
| 1292 | + //学生端 我的课程 | ||
| 1293 | + _courseInfoListHandler(evt){ | ||
| 1294 | + this.commonality(evt); | ||
| 1295 | + this.studentCourses(); | ||
| 1296 | + } | ||
| 1297 | + //老师端 我的课程 | ||
| 1298 | + _teacherLiveListHandler(evt){ | ||
| 1299 | + this.commonality(evt); | ||
| 1300 | + this.teacherCourses(); | ||
| 1301 | + } | ||
| 1302 | + _subscribeListHandler(evt){ | ||
| 1303 | + this.commonality(evt); | ||
| 1304 | + this.studentBookings(); | ||
| 1305 | + } | ||
| 1306 | + //工具类 | ||
| 1307 | + _format(str, obj) { | ||
| 1308 | + return str.replace(/\{(\w+)\}/g, function (match, group, index) { | ||
| 1309 | + return obj[group]; | ||
| 1310 | + }); | ||
| 1311 | + }; | ||
| 1312 | +} | ||
| 1313 | +export default MyCenterApe; |
src/ape/MyCenterTeacherApe.js
0 → 100644
| 1 | +//* | ||
| 2 | +// 首页模块 | ||
| 3 | +// */ | ||
| 4 | + | ||
| 5 | +import Loger from "../Loger"; | ||
| 6 | +import Ape from "./Ape"; | ||
| 7 | +import $ from "jquery"; | ||
| 8 | +import ClassDataProxy from "proxy/ClassDataProxy"; | ||
| 9 | +import ErrorApe from "./ErrorApe"; | ||
| 10 | +import MessageTypes from "../MessageTypes"; | ||
| 11 | + | ||
| 12 | +const classifyList = `<div class="courseMinuteListTimeTit" style="display: {_isShowTitle}"> | ||
| 13 | + <span class="courseMinuteListTime">{_liveTimer}</span> | ||
| 14 | + <span class="courseMinuteListWire"></span> | ||
| 15 | + </div> | ||
| 16 | + <div class="classifyListMyCenter {_classifyListR}"> | ||
| 17 | + <div class="myCenterContentMask accessLearningBtn"> | ||
| 18 | + <button class="myCenterContentMaskBtn btnHover" data="{_meetingNumber}">进入学习</button> | ||
| 19 | + </div> | ||
| 20 | + <div class="myCenterContentMask cancelReservation"> | ||
| 21 | + <button class="myCenterContentMaskBtn btnHover" data="{_studentMeetingId}">取消预约</button> | ||
| 22 | + </div> | ||
| 23 | + <img class="myCenterContentListImg" src="{_msgImg}" alt=""> | ||
| 24 | + <p class="myCenterContentListTit">{_meetingName}</p> | ||
| 25 | + <p class="myCenterContentListTit1">主讲人:{_create_user}</p> | ||
| 26 | + <p class="myCenterContentMin">45min</p> | ||
| 27 | + <span class="myCenterContentTimer">{_liveTimer}</span> | ||
| 28 | + </div>`; | ||
| 29 | +const curriculumList = `<li class="teacherTodayCourseList"> | ||
| 30 | + <span class="courseDetailInfo">{_infoTit}</span> | ||
| 31 | + <span class="courseDetailInfo1">距开始还有:<i class="teacherStartContent">{_countDown}</i></span> | ||
| 32 | + <button class="teacherEnterClass btnHover" data="{_meetingNumber}" style="display: {_isShow}">立即进入</button> | ||
| 33 | + </li>`; | ||
| 34 | + | ||
| 35 | +const adminListTit = `<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0" class="t_box"> | ||
| 36 | + <tbody> | ||
| 37 | + <tr align="center" height="44" class="tr_center" bgcolor="#fff" bordercolor="#e6e6e6"> | ||
| 38 | + <th width="7%" class="tr_center"> | ||
| 39 | + 课堂主题 | ||
| 40 | + </th> | ||
| 41 | + <th width="7%" class="tr_center"> | ||
| 42 | + 课堂号 | ||
| 43 | + </th> | ||
| 44 | + <th width="7%" class="tr_center"> | ||
| 45 | + 老师 | ||
| 46 | + </th> | ||
| 47 | + <th width="7%" class="tr_center"> | ||
| 48 | + 课堂状态 | ||
| 49 | + </th> | ||
| 50 | + <th width="15%" class="tr_center"> | ||
| 51 | + 课堂时间 | ||
| 52 | + </th> | ||
| 53 | + <th width="7%" class="tr_center"> | ||
| 54 | + 在线人数 | ||
| 55 | + </th> | ||
| 56 | + <th width="10%" class="tr_center"> | ||
| 57 | + 操作 | ||
| 58 | + </th> | ||
| 59 | + </tr> | ||
| 60 | +`; | ||
| 61 | +//管理首页 | ||
| 62 | +const adminList = `<tr align="center" bgcolor="#FFFFFF" height="44" bordercolor="#e6e6e6"> | ||
| 63 | + <td width="7%" class="tr_main tr_mainLeft">{_meetingName}</td> | ||
| 64 | + <td width="7%" class="tr_main">{_meetingNumber}</td> | ||
| 65 | + <td width="7%" class="tr_main">{_create_user}</td> | ||
| 66 | + <td width="7%" class="tr_main">{_state}</td> | ||
| 67 | + <td width="15%" class="tr_main">{_timer}</td> | ||
| 68 | + <td width="7%" class="tr_main">{_num}</td> | ||
| 69 | + <td width="10%" class="tr_main tr_mainRight" align="center"> | ||
| 70 | + <a class="classHandlePort deleteClass" data="{_aboutMsg}" href="###">文档</a> | ||
| 71 | + <a class="classHandlePort deleteClass" data="{_aboutMsg}" href="###">多媒体</a> | ||
| 72 | + <a class="classHandlePort resolveBtn" href="###" data="{_aboutMsg}">伴音</a> | ||
| 73 | + </td> | ||
| 74 | + </tr> | ||
| 75 | +`; | ||
| 76 | +const adminListEnd = `</tbody></table>`; | ||
| 77 | + | ||
| 78 | +//学生端显示老师信息 | ||
| 79 | +const teacherInfoLeft = ` | ||
| 80 | + <div class="teacherCorrelatedInfoBox"> | ||
| 81 | + <div class="teacherCorrelatedInfoLeft"> | ||
| 82 | + <img class="teacherCorrelatedInfoImg" id="teacherCorrelatedInfoImg" src="images/u293.png" alt=""> | ||
| 83 | + <div class="teacherCorrelatedInfo"> | ||
| 84 | + <b class="teacherCorrelatedInfoName" id="teacherCorrelatedInfoName">{_teacherName}</b> | ||
| 85 | + <b class="teacherCorrelatedInfoMajor">北京市|少儿英语</b> | ||
| 86 | + <b class="teacherCorrelatedInfoCourse">课程:50</b> | ||
| 87 | + <span class="teacherCorrelatedInfoMajorMsg">毕业于外国语学院,专业8级</span> | ||
| 88 | + <p class="cancelReservationBtn"">取消预约</p> | ||
| 89 | + </div> | ||
| 90 | + </div> | ||
| 91 | + <div class="teacherCorrelatedInfoCenter">`; | ||
| 92 | +const teacherInfoCenter= `<img class="teachercourseImg" data="{_id}" src="{_imgSrc}" alt="">`; | ||
| 93 | +const teacherInfoRight = `</div> <div class="teacherCorrelatedInfoBtn" data="{_teacherName}">更多课程</div> | ||
| 94 | + </div></div>`; | ||
| 95 | + | ||
| 96 | +const teacherDetail = `<span class="teacherDetailCurriculumList">《{_detailList}》</span>` | ||
| 97 | + | ||
| 98 | +let loger = Loger.getLoger('PC-MyCenterApe'); | ||
| 99 | +class MyCenterApe extends Ape { | ||
| 100 | + constructor() { | ||
| 101 | + super(); | ||
| 102 | + this.isLocalStorage(); | ||
| 103 | + this.data = 0; | ||
| 104 | + this.dataList = {}; | ||
| 105 | + this.teacherList = {}; | ||
| 106 | + this.messageDetails = []; | ||
| 107 | + this.presentInd = 1;//点击翻页默认为第一页 | ||
| 108 | + this._judgeListPlace(); | ||
| 109 | + this.addEvent(); | ||
| 110 | + // this.init(); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + init() { | ||
| 114 | + | ||
| 115 | + $('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类 | ||
| 116 | + $('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//首页 老师 直播分类 正在直播 未开始 已结束 | ||
| 117 | + $('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏 | ||
| 118 | + $('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏 | ||
| 119 | + $('#teacherLiveList li').on('click',this._teacherLiveListHandler.bind(this));//我的课程 老师 正在直播 未开始 已结束 | ||
| 120 | + | ||
| 121 | + $('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师 | ||
| 122 | + | ||
| 123 | + $('#updateInputYes').on('click',this._updateInputYesHandler.bind(this));//确定时把输入的信息存入数据中 | ||
| 124 | + | ||
| 125 | + $('#accountInfoSaveBtn').on('click',this._accountInfoSaveBtnHandler.bind(this));//更新用户信息按钮 | ||
| 126 | + | ||
| 127 | + $('#updateInputBoxA').on('click',this._hideInputBox.bind(this));//关闭弹框 | ||
| 128 | + $('#updateInputNo').on('click',this._hideInputBox.bind(this));//关闭弹框 | ||
| 129 | + //修改账户信息 | ||
| 130 | + $('#accountPassWordBtn').on('click',this._accountPassWordBtnHandler.bind(this));//密码 | ||
| 131 | + $('#accountEmailBtn').on('click',this._accountEmailBtnHandler.bind(this));//邮箱 | ||
| 132 | + $('#accountMobilelBtn').on('click',this._accountMobilelBtnHandler.bind(this));//手机号 | ||
| 133 | + | ||
| 134 | + $('#studentMyCenterContentList').on('mouseenter','.classifyListMyCenter',this._mouseenter.bind(this));//个人中心移入进入课堂 | ||
| 135 | + $('#studentMyCenterContentList').on('mouseleave','.classifyListMyCenter',this._mouseleave.bind(this));//个人中心移出进入课堂 | ||
| 136 | + | ||
| 137 | + $('#courseMinuteList').on('mouseenter','.classifyListMyCenter',this._mouseenter.bind(this));//课程移入进入课堂 | ||
| 138 | + $('#courseMinuteList').on('mouseleave','.classifyListMyCenter',this._mouseleave.bind(this));//课程移出进入课堂 | ||
| 139 | + | ||
| 140 | + $('#teacherCorrelatedInfo').on('mouseenter','.classifyListMyCenter',this._cancelMouseenter.bind(this));//我的预约 课程移入显示取消预约 | ||
| 141 | + $('#teacherCorrelatedInfo').on('mouseleave','.classifyListMyCenter',this._cancelMouseleave.bind(this));//我的预约 课程移出隐藏取消预约 | ||
| 142 | + | ||
| 143 | + $('#studentMyCenterContentList').on('click','.accessLearningBtn',this._enterClassRoomHandler.bind(this));//我的预约进入课堂 | ||
| 144 | + $('#courseMinuteList').on('click','.accessLearningBtn',this._enterClassRoomHandler.bind(this));//我的预约进入课堂 | ||
| 145 | + | ||
| 146 | + | ||
| 147 | + | ||
| 148 | + $('#myCurriculumInfo').on('click','.teacherEnterClass',this._enterClassRoomHandler.bind(this));//我的课程进入课堂 | ||
| 149 | + | ||
| 150 | + | ||
| 151 | + $('#teacherCorrelatedInfo').on('click','.teacherCorrelatedInfoBtn',this._teacherSubscribeMoveHandler.bind(this));//点击预约查看当前点击的更多信息 | ||
| 152 | + | ||
| 153 | + $('#teacherCorrelatedInfo').on('click','.cancelReservation',this._cancelSubscribeHandler.bind(this));//取消预约 | ||
| 154 | + | ||
| 155 | + $('#teacherCorrelatedInfo').on('click','.teachercourseImg',this._teacherClassDetails.bind(this));//点击进入老师课堂详情页 | ||
| 156 | + | ||
| 157 | + | ||
| 158 | + | ||
| 159 | + $('#teacherMyCerterHomePage').on('click',this._homePageHandler.bind(this));//首页 | ||
| 160 | + $('#teacherMyCerterUpPage').on('click',this._upPageHandler.bind(this));//上页 | ||
| 161 | + $('#teacherMyCerterDownPage').on('click',this._downPageHandler.bind(this));//下页 | ||
| 162 | + $('#teacherMyCerterEndPage').on('click',this._endPageHandler.bind(this));//尾页 | ||
| 163 | + $('#teacherMyCerterSpecificPage').on('click',this._assignPageHandler.bind(this));//指定页 | ||
| 164 | + | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + addEvent() { | ||
| 168 | + | ||
| 169 | + } | ||
| 170 | + //首页 | ||
| 171 | + _createClassHomePage(){ | ||
| 172 | + this._teacherLiveModule(1); | ||
| 173 | + } | ||
| 174 | + //首页 | ||
| 175 | + _homePageHandler(){ | ||
| 176 | + this.presentInd = 1; | ||
| 177 | + this._teacherLiveModule(this.presentInd); | ||
| 178 | + } | ||
| 179 | + //上页 | ||
| 180 | + _upPageHandler(){ | ||
| 181 | + if(this.presentInd > 1){ | ||
| 182 | + this.presentInd--; | ||
| 183 | + this._teacherLiveModule(this.presentInd); | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + //下页 | ||
| 187 | + _downPageHandler(){ | ||
| 188 | + loger.log('点击下一页') | ||
| 189 | + if(this.presentInd < this.pageNo){ | ||
| 190 | + this.presentInd++; | ||
| 191 | + this._teacherLiveModule(this.presentInd); | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + //尾页 | ||
| 195 | + _endPageHandler(){ | ||
| 196 | + this.presentInd = this.pageNo; | ||
| 197 | + this._teacherLiveModule(this.presentInd); | ||
| 198 | + } | ||
| 199 | + //指定页 | ||
| 200 | + _assignPageHandler(){ | ||
| 201 | + let inputVal = $('#teacherMyCerterPageInfoInput').val(); | ||
| 202 | + if(parseInt(inputVal) <= this.pageNo || parseInt(inputVal) >= 1 ){ | ||
| 203 | + this._teacherLiveModule(parseInt(inputVal)); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + loadMeeting(meeting){ | ||
| 207 | + let status = meeting["meetingStatus"]; | ||
| 208 | + if(status != ''){ | ||
| 209 | + if (status == "1" || status == "2") { | ||
| 210 | + return '已开始'; | ||
| 211 | + }else{ | ||
| 212 | + if (status == "2") { | ||
| 213 | + // alert("会议已经开始!"); | ||
| 214 | + return '已开始'; | ||
| 215 | + } else if (status == "3") { | ||
| 216 | + return '未开始'; | ||
| 217 | + // alert("未到开始时间!"); | ||
| 218 | + } else if (status == "4") { | ||
| 219 | + // alert("会议已经结束!"); | ||
| 220 | + return '已结束'; | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + //老师端数据请求 | ||
| 226 | + _teacherCurriculumInfo(data,num,ind,callback){ | ||
| 227 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting'; | ||
| 228 | + let that = this; | ||
| 229 | + $.ajax({ | ||
| 230 | + type: "POST", | ||
| 231 | + url: _url, | ||
| 232 | + timeout:5000, | ||
| 233 | + data : data, | ||
| 234 | + headers: {siteId:ClassDataProxy.siteId,pageno:num, page:ind, | ||
| 235 | + 'token':ClassDataProxy.token}, | ||
| 236 | + success:function(_data){ | ||
| 237 | + | ||
| 238 | + //获取我的课程数据 | ||
| 239 | + if(_data && _data.code == 200){ | ||
| 240 | + if(callback){ | ||
| 241 | + callback(_data); | ||
| 242 | + } | ||
| 243 | + }else{ | ||
| 244 | + if(callback){ | ||
| 245 | + callback(null); | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + }, | ||
| 249 | + error:function(error){ | ||
| 250 | + //alert('直播数据获取失败') | ||
| 251 | + if(callback){ | ||
| 252 | + callback(null); | ||
| 253 | + } | ||
| 254 | + loger.log(error,'直播数据获取失败') | ||
| 255 | + } | ||
| 256 | + }) | ||
| 257 | + } | ||
| 258 | + _studentCurriculumInfo(num,callback){ | ||
| 259 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id; | ||
| 260 | + let that = this; | ||
| 261 | + $.ajax({ | ||
| 262 | + type: "GET", | ||
| 263 | + url: _url, | ||
| 264 | + timeout:5000, | ||
| 265 | + headers: {siteId:ClassDataProxy.siteId,pageno:num,id:ClassDataProxy.id, | ||
| 266 | + 'token':ClassDataProxy.token}, | ||
| 267 | + success:function(_data){ | ||
| 268 | + | ||
| 269 | + //获取我的课程数据 | ||
| 270 | + if(_data && _data.code == 200){ | ||
| 271 | + if(callback){ | ||
| 272 | + callback(_data); | ||
| 273 | + } | ||
| 274 | + }else{ | ||
| 275 | + if(callback){ | ||
| 276 | + callback(null); | ||
| 277 | + } | ||
| 278 | + } | ||
| 279 | + }, | ||
| 280 | + error:function(error){ | ||
| 281 | + //alert('直播数据获取失败') | ||
| 282 | + if(callback){ | ||
| 283 | + callback(null); | ||
| 284 | + } | ||
| 285 | + loger.log(error,'直播数据获取失败') | ||
| 286 | + } | ||
| 287 | + }) | ||
| 288 | + } | ||
| 289 | + //老师端首页默认数据 | ||
| 290 | + detailPageTeacher(){ | ||
| 291 | + //首页课程 | ||
| 292 | + this._teacherCourseModule(); | ||
| 293 | + //首页直播信息 | ||
| 294 | + this._teacherLiveModule(1); | ||
| 295 | + } | ||
| 296 | + detailPageStudent(){ | ||
| 297 | + this._studentCourseModule(); | ||
| 298 | + //首页课程 | ||
| 299 | + let ind = $('#studentInfoList .liveInfoLeftLiCheck').attr('data'); | ||
| 300 | + let studentMyCenterContentList = $('#studentMyCenterContentList'); | ||
| 301 | + switch (parseInt(ind)){ | ||
| 302 | + case 0: | ||
| 303 | + //待学习 | ||
| 304 | + this._studentStudyModule(studentMyCenterContentList); | ||
| 305 | + break; | ||
| 306 | + case 1: | ||
| 307 | + //已学完 | ||
| 308 | + this._studentStudyOverModule(studentMyCenterContentList); | ||
| 309 | + break; | ||
| 310 | + case 2: | ||
| 311 | + //收藏 | ||
| 312 | + this._studenTcollectModule(studentMyCenterContentList); | ||
| 313 | + break; | ||
| 314 | + default: | ||
| 315 | + return; | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + isLocalStorage(){ | ||
| 321 | + let newDate = new Date(); | ||
| 322 | + let newHours = newDate.getHours(); | ||
| 323 | + let text = newHours>12?'下午好,':'上午好,' | ||
| 324 | + $('#teacherMyCenterTime').text(text); | ||
| 325 | + | ||
| 326 | + | ||
| 327 | + // this.detailpage(); | ||
| 328 | + | ||
| 329 | + loger.log('登录老师首页',ClassDataProxy.userType , ClassDataProxy.USER_TYPE_1) | ||
| 330 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 331 | + //首页默认数据 | ||
| 332 | + // this.detailPageTeacher(); | ||
| 333 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 334 | + $('#teacherMyCenterStatus').text('老师'); | ||
| 335 | + $('#teacherUI .recordLi').eq(2).hide(); | ||
| 336 | + $('#teacherMyCerter').show(); | ||
| 337 | + $('#studentMyCerter').hide(); | ||
| 338 | + $('#myCenterBox').show(); | ||
| 339 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 340 | + //首页默认数据 | ||
| 341 | + // this.detailPageStudent(); | ||
| 342 | + $('#myCenterBox').show(); | ||
| 343 | + $('#teacherMyCenterName').text(ClassDataProxy.loginName); | ||
| 344 | + $('#teacherMyCenterStatus').text('同学'); | ||
| 345 | + $('#teacherMyCerter').hide(); | ||
| 346 | + $('#studentMyCerter').show(); | ||
| 347 | + $('#teacherUI .recordLi').eq(2).show(); | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + $('#lanclassBox').hide(); | ||
| 351 | + | ||
| 352 | + $('#oneselfInfoLoginName').val( ClassDataProxy.loginName);//登录名 | ||
| 353 | + $('#oneselfInfoUserName').val(ClassDataProxy.monicker);//用户名 | ||
| 354 | + let setMail = $('#setMail');//邮箱 | ||
| 355 | + let setPhone = $('#setPhone');//手机号 | ||
| 356 | + let userEmail = this.updateEmail(ClassDataProxy.userEmail); | ||
| 357 | + let userMobile = this.updateMobile(ClassDataProxy.userMobile); | ||
| 358 | + setMail.attr('data',ClassDataProxy.userEmail); | ||
| 359 | + setPhone.attr('data',ClassDataProxy.userMobile); | ||
| 360 | + setMail.html(userEmail) | ||
| 361 | + setPhone.html(userMobile) | ||
| 362 | + } | ||
| 363 | + _recordLiHandler(evt){ | ||
| 364 | + let ind = $(evt.currentTarget).attr('data'); | ||
| 365 | + $(evt.currentTarget).addClass('recordLiCheck').siblings().removeClass('recordLiCheck'); | ||
| 366 | + $('.myCenterContentBox').eq(ind).show().siblings().hide(); | ||
| 367 | + switch (parseInt(ind)){ | ||
| 368 | + case 0: | ||
| 369 | + //首页 | ||
| 370 | + this.detailpage(); | ||
| 371 | + break; | ||
| 372 | + case 1: | ||
| 373 | + //我的课程 | ||
| 374 | + this.myCoursesMessage(); | ||
| 375 | + break; | ||
| 376 | + case 2: | ||
| 377 | + //我的预约 | ||
| 378 | + this.myBookingsMessage(); | ||
| 379 | + break; | ||
| 380 | + case 3: | ||
| 381 | + //个人信息 | ||
| 382 | + this._updatMessage(); | ||
| 383 | + break; | ||
| 384 | + default: | ||
| 385 | + return; | ||
| 386 | + } | ||
| 387 | + } | ||
| 388 | + detailpage(){ | ||
| 389 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 390 | + //this.detailPageTeacher(); | ||
| 391 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 392 | + // this.detailPageStudent(); | ||
| 393 | + } | ||
| 394 | + } | ||
| 395 | + | ||
| 396 | + /*-------------------老师-------------------*/ | ||
| 397 | + //老师端首页课程显示 | ||
| 398 | + _teacherCourseModule(){ | ||
| 399 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | ||
| 400 | + let that = this; | ||
| 401 | + this._teacherCurriculumInfo(data,3,1,function(_data){ | ||
| 402 | + //首页今日课程渲染 | ||
| 403 | + if(_data){ | ||
| 404 | + that._teacherCourseCourse(_data.returnData.data.meetingInfo); | ||
| 405 | + } | ||
| 406 | + }) | ||
| 407 | + } | ||
| 408 | + //老师端首页课程数据渲染 | ||
| 409 | + _teacherCourseCourse(_data){ | ||
| 410 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 411 | + myCurriculumInfo.empty(); | ||
| 412 | + let that = this; | ||
| 413 | + if(_data) { | ||
| 414 | + for (let i = 0; i < _data.length; i++) { | ||
| 415 | + let item = _data[i]; | ||
| 416 | + if (item) { | ||
| 417 | + let curInfo = this._format(curriculumList, { | ||
| 418 | + _infoTit: item.meetingName, | ||
| 419 | + _meetingNumber: item.meetingNumber, | ||
| 420 | + _countDown: that.loadMeeting(item), | ||
| 421 | + _isShow: (that.loadMeeting(item) == '已开始') ? 'block' : 'none' | ||
| 422 | + }) | ||
| 423 | + myCurriculumInfo.append(curInfo); | ||
| 424 | + } else { | ||
| 425 | + console.error('_gainClassData没数据') | ||
| 426 | + } | ||
| 427 | + | ||
| 428 | + } | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | + //老师端首页直播数据 | ||
| 432 | + _teacherLiveModule(ind){ | ||
| 433 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; | ||
| 434 | + let that = this; | ||
| 435 | + this._teacherCurriculumInfo(data,4,ind,function(_data){ | ||
| 436 | + //首页直播信息渲染 | ||
| 437 | + if(_data){ | ||
| 438 | + that._teacherLiveCourse(_data.returnData.data); | ||
| 439 | + } | ||
| 440 | + }) | ||
| 441 | + } | ||
| 442 | + _teacherLiveCourse(_data){ | ||
| 443 | + let teacherMyCenterContentList = $('#teacherMyCenterContentList'); | ||
| 444 | + teacherMyCenterContentList.empty(); | ||
| 445 | + | ||
| 446 | + let count = _data.count; | ||
| 447 | + let page = _data.page; | ||
| 448 | + let pageno = _data.pageno; | ||
| 449 | + let pagenum = Math.ceil(count / pageno); | ||
| 450 | + let _dataList = _data.meetingInfo; | ||
| 451 | + loger.log('老师端信息想显示',_data) | ||
| 452 | + this.pageNo = pagenum; | ||
| 453 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 454 | + teacherMyCenterContentList.append(adminListTit) | ||
| 455 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 456 | + if(count <= 8){ | ||
| 457 | + $('#teacherMyCerterPageBox').hide(); | ||
| 458 | + } | ||
| 459 | + let _adminList = this._format(adminList,{ | ||
| 460 | + _meetingName : _dataList[i].meetingName, | ||
| 461 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 462 | + _create_user : _dataList[i].create_user, | ||
| 463 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 464 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 465 | + _num : '0' | ||
| 466 | + }) | ||
| 467 | + teacherMyCenterContentList.append(_adminList) | ||
| 468 | + } | ||
| 469 | + teacherMyCenterContentList.append(adminListEnd) | ||
| 470 | + } | ||
| 471 | + _teacherCourse(_data){ | ||
| 472 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 473 | + courseMinuteList.empty(); | ||
| 474 | + let count = _data.count; | ||
| 475 | + let page = _data.page; | ||
| 476 | + let pageno = _data.pageno; | ||
| 477 | + let pagenum = Math.ceil(count / pageno); | ||
| 478 | + let _dataList = _data.meetingInfo; | ||
| 479 | + this.pageNo = pagenum; | ||
| 480 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 481 | + courseMinuteList.append(adminListTit) | ||
| 482 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 483 | + if(count <= 8){ | ||
| 484 | + $('#teacherMyCerterPageBox').hide(); | ||
| 485 | + } | ||
| 486 | + let _adminList = this._format(adminList,{ | ||
| 487 | + _meetingName : _dataList[i].meetingName, | ||
| 488 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 489 | + _create_user : _dataList[i].create_user, | ||
| 490 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 491 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 492 | + _num : '0' | ||
| 493 | + }) | ||
| 494 | + courseMinuteList.append(_adminList) | ||
| 495 | + } | ||
| 496 | + courseMinuteList.append(adminListEnd) | ||
| 497 | + } | ||
| 498 | + | ||
| 499 | + /*---------------------------学生-----------------------*/ | ||
| 500 | + //学生端首页課程显示 | ||
| 501 | + _studentCourseModule(){ | ||
| 502 | + let that = this; | ||
| 503 | + this._studentCurriculumInfo(3,function(_data){ | ||
| 504 | + that.studentCourseList(_data.returnData.data); | ||
| 505 | + }) | ||
| 506 | + } | ||
| 507 | + studentCourseList(_data){ | ||
| 508 | + if(_data){ | ||
| 509 | + loger.log('学生端首页课程信息',_data) | ||
| 510 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 511 | + myCurriculumInfo.empty(); | ||
| 512 | + let that = this; | ||
| 513 | + if(_data) { | ||
| 514 | + for (let i = 0; i < _data.length; i++) { | ||
| 515 | + let item = _data[i]; | ||
| 516 | + let timer = ClassDataProxy.getTimeCountDown(item.meetingBeginTime,item.meetingEndTime) | ||
| 517 | + loger.log('newTimenewTimenewTimenewTime',timer) | ||
| 518 | + if (item) { | ||
| 519 | + let curInfo = this._format(curriculumList, { | ||
| 520 | + _infoTit: item.meeting_name, | ||
| 521 | + _meetingNumber: item.meetingNumber, | ||
| 522 | + _countDown:timer , | ||
| 523 | + _isShow: (timer == '已结束') ? 'none' : 'block' | ||
| 524 | + }) | ||
| 525 | + myCurriculumInfo.append(curInfo); | ||
| 526 | + } else { | ||
| 527 | + console.error('_gainClassData没数据') | ||
| 528 | + } | ||
| 529 | + | ||
| 530 | + } | ||
| 531 | + } | ||
| 532 | + } | ||
| 533 | + } | ||
| 534 | + //学生端首页学习数据 | ||
| 535 | + _studentStudyModule(studentMyCenterContentList){ | ||
| 536 | + let that = this; | ||
| 537 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 538 | + if(_data){ | ||
| 539 | + that.studentStudyList(studentMyCenterContentList,_data.returnData.data); | ||
| 540 | + } | ||
| 541 | + }) | ||
| 542 | + } | ||
| 543 | + studentStudyList(studentMyCenterContentList,_data){ | ||
| 544 | + studentMyCenterContentList.empty(); | ||
| 545 | + $('#courseMinutePageBox').hide(); | ||
| 546 | + for(let i = 0;i<_data.length;i++){ | ||
| 547 | + if(_data[i]){ | ||
| 548 | + if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 549 | + let j = (i%4)==3; | ||
| 550 | + let _classifyList = this._format(classifyList,{ | ||
| 551 | + _classifyListR : j?'classifyListR':'', | ||
| 552 | + _isShowTitle : 'none', | ||
| 553 | + _meetingNumber : _data[i].meetingNumber, | ||
| 554 | + _msgImg : '../images/u373.png', | ||
| 555 | + _meetingName : _data[i].meeting_name, | ||
| 556 | + _create_user : _data[i].teacherName, | ||
| 557 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 558 | + }) | ||
| 559 | + studentMyCenterContentList.append(_classifyList) | ||
| 560 | + } | ||
| 561 | + }else{ | ||
| 562 | + console.error('_gainClassData没数据') | ||
| 563 | + } | ||
| 564 | + } | ||
| 565 | + | ||
| 566 | + } | ||
| 567 | + //已学完 | ||
| 568 | + _studentStudyOverModule(studentMyCenterContentList){ | ||
| 569 | + let that = this; | ||
| 570 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 571 | + that.studentStudyOverList(studentMyCenterContentList,_data.returnData.data); | ||
| 572 | + }) | ||
| 573 | + } | ||
| 574 | + studentStudyOverList(studentMyCenterContentList,_data){ | ||
| 575 | + studentMyCenterContentList.empty(); | ||
| 576 | + $('#courseMinutePageBox').hide(); | ||
| 577 | + for(let i = 0;i<_data.length;i++){ | ||
| 578 | + if(_data[i]){ | ||
| 579 | + if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 580 | + let j = (i%4)==3; | ||
| 581 | + let _classifyList = this._format(classifyList,{ | ||
| 582 | + _classifyListR : j?'classifyListR':'', | ||
| 583 | + _isShowTitle : 'none', | ||
| 584 | + _meetingNumber : _data[i].meetingNumber, | ||
| 585 | + _msgImg : '../images/u373.png', | ||
| 586 | + _meetingName : _data[i].meeting_name, | ||
| 587 | + _create_user : _data[i].teacherName, | ||
| 588 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 589 | + }) | ||
| 590 | + studentMyCenterContentList.append(_classifyList) | ||
| 591 | + } | ||
| 592 | + }else{ | ||
| 593 | + console.error('_gainClassData没数据') | ||
| 594 | + } | ||
| 595 | + } | ||
| 596 | + | ||
| 597 | + } | ||
| 598 | + _studenTcollectModule(studentMyCenterContentList){ | ||
| 599 | + let that = this; | ||
| 600 | + this._studentCurriculumInfo(4,function(_data){ | ||
| 601 | + that.studentTcollectList(studentMyCenterContentList,_data.returnData.data); | ||
| 602 | + }) | ||
| 603 | + } | ||
| 604 | + studentTcollectList(studentMyCenterContentList,_data){ | ||
| 605 | + studentMyCenterContentList.empty(); | ||
| 606 | + $('#courseMinutePageBox').hide(); | ||
| 607 | + /* for(let i = 0;i<_data.length;i++){ | ||
| 608 | + if(_data[i]){ | ||
| 609 | + if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 610 | + let j = (i%4)==3; | ||
| 611 | + let _classifyList = this._format(classifyList,{ | ||
| 612 | + _classifyListR : j?'classifyListR':'', | ||
| 613 | + _isShowTitle : 'none', | ||
| 614 | + _meetingNumber : _data[i].meetingNumber, | ||
| 615 | + _msgImg : '../images/u373.png', | ||
| 616 | + _meetingName : _data[i].meeting_name, | ||
| 617 | + _create_user : _data[i].teacherName, | ||
| 618 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0] | ||
| 619 | + }) | ||
| 620 | + studentMyCenterContentList.append(_classifyList) | ||
| 621 | + } | ||
| 622 | + }else{ | ||
| 623 | + console.error('_gainClassData没数据') | ||
| 624 | + } | ||
| 625 | + }*/ | ||
| 626 | + | ||
| 627 | + } | ||
| 628 | + //提交用户信息修改 | ||
| 629 | + _accountInfoSaveBtnHandler(){ | ||
| 630 | + let id = ClassDataProxy.id;//id | ||
| 631 | + | ||
| 632 | + let loginName = ClassDataProxy.loginName;//登录名 | ||
| 633 | + let userMobile = ClassDataProxy.userMobile;//手机号 | ||
| 634 | + let userEmail = ClassDataProxy.userEmail;//邮箱 | ||
| 635 | + let monicker = ClassDataProxy.monicker;//用户名 | ||
| 636 | + let passWord = ClassDataProxy.password;//密码 | ||
| 637 | + | ||
| 638 | + let oneselfInfoLoginName = $('#oneselfInfoLoginName').val();//登录名 | ||
| 639 | + let oneselfInfoUserName = $('#oneselfInfoUserName').val();//用户名 | ||
| 640 | + let oneselfInfoMan = $('#oneselfInfoMan');//性别 | ||
| 641 | + let setPassWord = $('#setPassWord').attr('data');//密码 | ||
| 642 | + let setMail = $('#setMail').attr('data');//邮箱 | ||
| 643 | + let setPhone = $('#setPhone').attr('data');//手机号 | ||
| 644 | + let signInfo = {}; | ||
| 645 | + if(oneselfInfoLoginName != loginName){ | ||
| 646 | + signInfo.loginName = oneselfInfoLoginName; | ||
| 647 | + } | ||
| 648 | + if(oneselfInfoUserName != monicker){ | ||
| 649 | + signInfo.userName = oneselfInfoUserName; | ||
| 650 | + } | ||
| 651 | + if(!setPassWord){ | ||
| 652 | + // signInfo.loginName = oneselfInfoLoginName; | ||
| 653 | + } | ||
| 654 | + if(setMail != userEmail){ | ||
| 655 | + signInfo.userEmail = setMail; | ||
| 656 | + } | ||
| 657 | + if(setPhone != userMobile){ | ||
| 658 | + signInfo.userMobile = setPhone; | ||
| 659 | + } | ||
| 660 | + let that = this; | ||
| 661 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/users/updateUserByUserId/' + id; | ||
| 662 | + $.ajax({ | ||
| 663 | + type: "PUT", | ||
| 664 | + url: _url, | ||
| 665 | + timeout:5000, | ||
| 666 | + headers: {siteId:ClassDataProxy.siteId, | ||
| 667 | + 'token':ClassDataProxy.token}, | ||
| 668 | + data:signInfo, | ||
| 669 | + success:function(_data){ | ||
| 670 | + //获取个人信息数据 | ||
| 671 | + if(_data && _data.code == 200){ | ||
| 672 | + loger.log('修改信息成功',_data) | ||
| 673 | + | ||
| 674 | + ErrorApe.showWarnError('修改信息成功'); | ||
| 675 | + ClassDataProxy.loginName =_data.returnData.data.loginName; | ||
| 676 | + ClassDataProxy.monicker = _data.returnData.data.userName; | ||
| 677 | + ClassDataProxy.userEmail = _data.returnData.data.userEmail; | ||
| 678 | + ClassDataProxy.userMobile = _data.returnData.data.userMobile; | ||
| 679 | + window.localStorage.setItem('loginName', ClassDataProxy.loginName); | ||
| 680 | + window.localStorage.setItem('monicker', ClassDataProxy.monicker); | ||
| 681 | + window.localStorage.setItem('userEmail', ClassDataProxy.userEmail); | ||
| 682 | + window.localStorage.setItem('userMobile', ClassDataProxy.userMobile); | ||
| 683 | + $('#teacherMyCenterName').html(ClassDataProxy.loginName); | ||
| 684 | + }else if(_data.code == 400){ | ||
| 685 | + ErrorApe.showWarnError('账号未修改'); | ||
| 686 | + }else{ | ||
| 687 | + ErrorApe.showWarnError(_data.returnData.data.msg); | ||
| 688 | + } | ||
| 689 | + }, | ||
| 690 | + error:function(error){ | ||
| 691 | + loger.log(error,'修改信息失败') | ||
| 692 | + } | ||
| 693 | + }) | ||
| 694 | + } | ||
| 695 | + clearLocalStorage(){ | ||
| 696 | + window.localStorage.clear(); | ||
| 697 | + ClassDataProxy.userType = ClassDataProxy.USER_TYPE_0; | ||
| 698 | + ClassDataProxy.loginName =""; | ||
| 699 | + ClassDataProxy.password ="" | ||
| 700 | + ClassDataProxy.token =""; | ||
| 701 | + ClassDataProxy.status = false; | ||
| 702 | + | ||
| 703 | + } | ||
| 704 | + //个人信息 | ||
| 705 | + _updatMessage(){ | ||
| 706 | + $('#oneselfInfoLoginName').val( ClassDataProxy.loginName);//登录名 | ||
| 707 | + $('#oneselfInfoUserName').val(ClassDataProxy.monicker);//用户名 | ||
| 708 | + } | ||
| 709 | + //我的预约 | ||
| 710 | + myBookingsMessage(){ | ||
| 711 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 712 | + | ||
| 713 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 714 | + this.studentBookings(); | ||
| 715 | + } | ||
| 716 | + } | ||
| 717 | + studentBookings(){ | ||
| 718 | + let that = this; | ||
| 719 | + let data = $('#subscribeList').find('.liveInfoLeftLiCheck').attr('data'); | ||
| 720 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 721 | + if(_data){ | ||
| 722 | + if(data == '1'){ | ||
| 723 | + that._studentSubscribeTeacher(_data.returnData.data) | ||
| 724 | + }else{ | ||
| 725 | + that._studentSubscribe(_data.returnData.data) | ||
| 726 | + } | ||
| 727 | + | ||
| 728 | + } | ||
| 729 | + }); | ||
| 730 | + | ||
| 731 | + } | ||
| 732 | + _studentSubscribe(_data){ | ||
| 733 | + let teacherCorrelatedInfo = $('#teacherCorrelatedInfo'); | ||
| 734 | + teacherCorrelatedInfo.empty(); | ||
| 735 | + for(let i = 0;i<_data.length;i++){ | ||
| 736 | + if(_data[i]){ | ||
| 737 | + let j = (i%4)==3; | ||
| 738 | + let _classifyList = this._format(classifyList,{ | ||
| 739 | + _classifyListR : j?'classifyListR':'', | ||
| 740 | + _isShowTitle : 'none', | ||
| 741 | + _meetingNumber : _data[i].meetingNumber, | ||
| 742 | + _msgImg : '../images/u373.png', | ||
| 743 | + _meetingName : _data[i].meeting_name, | ||
| 744 | + _create_user : _data[i].teacherName, | ||
| 745 | + _liveTimer : _data[i].meetingBeginTime.split(' ')[0], | ||
| 746 | + _studentMeetingId : _data[i].studentMeetingId | ||
| 747 | + }) | ||
| 748 | + teacherCorrelatedInfo.append(_classifyList) | ||
| 749 | + | ||
| 750 | + }else{ | ||
| 751 | + console.error('_gainClassData没数据') | ||
| 752 | + } | ||
| 753 | + } | ||
| 754 | + | ||
| 755 | + } | ||
| 756 | + _studentSubscribeTeacher(_data){ | ||
| 757 | + let teacherCorrelatedInfo = $('#teacherCorrelatedInfo'); | ||
| 758 | + teacherCorrelatedInfo.empty(); | ||
| 759 | + if(_data){ | ||
| 760 | + this.teacherList={}; | ||
| 761 | + for(let i = 0;i<_data.length;i++){ | ||
| 762 | + let item=_data[i]; | ||
| 763 | + if(item){ | ||
| 764 | + let temp = item.teacherName; | ||
| 765 | + if(!this.teacherList[temp]) { | ||
| 766 | + this.teacherList[temp] = []; | ||
| 767 | + } | ||
| 768 | + this.teacherList[temp].push(item) | ||
| 769 | + } | ||
| 770 | + } | ||
| 771 | + for( let key in this.teacherList){ | ||
| 772 | + let teacherInfo = '' | ||
| 773 | + let arrList = this.teacherList[key]; | ||
| 774 | + teacherInfo = this._format(teacherInfoLeft,{ | ||
| 775 | + _teacherName : key, | ||
| 776 | + // meetingNumber | ||
| 777 | + }) | ||
| 778 | + for(let n = 0;n<arrList.length;n++){ | ||
| 779 | + teacherInfo += this._format(teacherInfoCenter,{ | ||
| 780 | + _imgSrc : 'images/u374.png', | ||
| 781 | + _id : arrList[n].teacherName | ||
| 782 | + }) | ||
| 783 | + } | ||
| 784 | + teacherInfo += this._format(teacherInfoRight,{ | ||
| 785 | + _teacherName : key | ||
| 786 | + }) | ||
| 787 | + teacherCorrelatedInfo.append(teacherInfo) | ||
| 788 | + } | ||
| 789 | + } | ||
| 790 | + } | ||
| 791 | + //我的课程 | ||
| 792 | + myCoursesMessage(){ | ||
| 793 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 794 | + this.teacherCourses(); | ||
| 795 | + $('#courseInfoList').hide(); | ||
| 796 | + $('#teacherLiveList').show(); | ||
| 797 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 798 | + this.studentCourses(); | ||
| 799 | + $('#courseInfoList').show(); | ||
| 800 | + $('#teacherLiveList').hide(); | ||
| 801 | + } | ||
| 802 | + } | ||
| 803 | + teacherCourses(){ | ||
| 804 | + let _index = $('#teacherLiveList .liveInfoLeftLiCheck').attr('data'); | ||
| 805 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 806 | + switch (parseInt(_index)){ | ||
| 807 | + case 0: | ||
| 808 | + //正在直播 | ||
| 809 | + loger.log('直播首页信息') | ||
| 810 | + this.teacherNowLiveModule(1); | ||
| 811 | + break; | ||
| 812 | + case 1: | ||
| 813 | + //未开始 | ||
| 814 | + this.teacherNoneLiveModule(1); | ||
| 815 | + loger.log('直播首页信息1') | ||
| 816 | + break; | ||
| 817 | + case 2: | ||
| 818 | + //已结束 | ||
| 819 | + break; | ||
| 820 | + default: | ||
| 821 | + return; | ||
| 822 | + } | ||
| 823 | + | ||
| 824 | + } | ||
| 825 | + teacherNowLiveModule(ind){ | ||
| 826 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName,meetingStatus:1}; | ||
| 827 | + let that = this; | ||
| 828 | + this._teacherCurriculumInfo(data,12,ind,function(_data){ | ||
| 829 | + //首页直播信息渲染 | ||
| 830 | + if(_data){ | ||
| 831 | + // loger.log('首页直播信息渲染',_data) | ||
| 832 | + that._teacherCourse(_data.returnData.data); | ||
| 833 | + } | ||
| 834 | + }) | ||
| 835 | + } | ||
| 836 | + teacherNoneLiveModule(ind){ | ||
| 837 | + let data = {siteId:ClassDataProxy.siteId,create_user : ClassDataProxy.loginName}; | ||
| 838 | + let that = this; | ||
| 839 | + this._teacherCurriculumInfo(data,12,ind,function(_data){ | ||
| 840 | + //首页直播信息渲染 | ||
| 841 | + if(_data){ | ||
| 842 | + that._teacherCourse(_data.returnData.data); | ||
| 843 | + } | ||
| 844 | + }) | ||
| 845 | + } | ||
| 846 | + //老师端课程数据 | ||
| 847 | + _teacherCourseRender(_data){ | ||
| 848 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 849 | + courseMinuteList.empty(); | ||
| 850 | + let count = _data.count; | ||
| 851 | + let page = _data.page; | ||
| 852 | + let pageno = _data.pageno; | ||
| 853 | + let pagenum = Math.ceil(count / pageno); | ||
| 854 | + let _dataList = _data.meetingInfo; | ||
| 855 | + this.pageNo = pagenum; | ||
| 856 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 857 | + | ||
| 858 | + if(count <= 12){ | ||
| 859 | + $('#courseMinutePageBox').hide(); | ||
| 860 | + } | ||
| 861 | + //存储数据按日期分类 | ||
| 862 | + this.dataList={}; | ||
| 863 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 864 | + let item=_dataList[i]; | ||
| 865 | + if(item){ | ||
| 866 | + let temp = item.beginTime.split(' ')[0] | ||
| 867 | + if(!this.dataList[temp]) { | ||
| 868 | + this.dataList[temp] = []; | ||
| 869 | + } | ||
| 870 | + this.dataList[temp].push(item) | ||
| 871 | + } | ||
| 872 | + } | ||
| 873 | + for(let key in this.dataList){ | ||
| 874 | + let j = (key%4)==3; | ||
| 875 | + let arrList = this.dataList[key]; | ||
| 876 | + if(arrList){ | ||
| 877 | + for(let n = 0;n<arrList.length;n++){ | ||
| 878 | + let _classifyList = this._format(classifyList,{ | ||
| 879 | + _classifyListR : j?'classifyListR':'', | ||
| 880 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 881 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 882 | + _msgImg : '../images/u373.png', | ||
| 883 | + _meetingName : arrList[n].meetingName, | ||
| 884 | + _create_user : arrList[n].create_user, | ||
| 885 | + _liveTimer : key | ||
| 886 | + }) | ||
| 887 | + courseMinuteList.append(_classifyList) | ||
| 888 | + } | ||
| 889 | + } | ||
| 890 | + } | ||
| 891 | + } | ||
| 892 | + //学生端 我的课程 切换 | ||
| 893 | + studentCourses(){ | ||
| 894 | + let ind = $('#courseInfoList .liveInfoLeftLiCheck').attr('data'); | ||
| 895 | + let courseMinuteList = $('#courseMinuteList'); | ||
| 896 | + switch (parseInt(ind)){ | ||
| 897 | + case 0: | ||
| 898 | + //待学习 | ||
| 899 | + this.studentFutureModule(courseMinuteList); | ||
| 900 | + break; | ||
| 901 | + case 1: | ||
| 902 | + //已学完 | ||
| 903 | + this.studentFormerlyModule(courseMinuteList); | ||
| 904 | + break; | ||
| 905 | + case 2: | ||
| 906 | + //收藏 | ||
| 907 | + this.studentCollectModule(courseMinuteList); | ||
| 908 | + break; | ||
| 909 | + default: | ||
| 910 | + return; | ||
| 911 | + } | ||
| 912 | + | ||
| 913 | + } | ||
| 914 | + //学生端 我的课程 待学习 | ||
| 915 | + studentFutureModule(courseMinuteList){ | ||
| 916 | + let that = this; | ||
| 917 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 918 | + if(_data){ | ||
| 919 | + that._studentCourseRender(courseMinuteList,_data.returnData.data) | ||
| 920 | + } | ||
| 921 | + }); | ||
| 922 | + | ||
| 923 | + } | ||
| 924 | + //学生端课程数据 待学习 | ||
| 925 | + _studentCourseRender(courseMinuteList,_data){ | ||
| 926 | + courseMinuteList.empty(); | ||
| 927 | + let count = _data.count; | ||
| 928 | + let page = _data.page; | ||
| 929 | + let pageno = _data.pageno; | ||
| 930 | + let pagenum = Math.ceil(count / pageno); | ||
| 931 | + let _dataList = _data; | ||
| 932 | + this.pageNo = pagenum; | ||
| 933 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 934 | + | ||
| 935 | + if(count <= 12){ | ||
| 936 | + $('#courseMinutePageBox').hide(); | ||
| 937 | + } | ||
| 938 | + //存储数据按日期分类 | ||
| 939 | + this.dataList={}; | ||
| 940 | + //if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){ | ||
| 941 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 942 | + let item=_dataList[i]; | ||
| 943 | + if(item){ | ||
| 944 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 945 | + if(!this.dataList[temp]) { | ||
| 946 | + this.dataList[temp] = []; | ||
| 947 | + } | ||
| 948 | + this.dataList[temp].push(item) | ||
| 949 | + } | ||
| 950 | + } | ||
| 951 | + for(let key in this.dataList){ | ||
| 952 | + if(ClassDataProxy.getTimeDay(key)){ | ||
| 953 | + let arrList = this.dataList[key]; | ||
| 954 | + if(arrList){ | ||
| 955 | + for(let n = 0;n<arrList.length;n++){ | ||
| 956 | + let j = (n%4) == 3; | ||
| 957 | + let _classifyList = this._format(classifyList,{ | ||
| 958 | + _classifyListR : j ?'classifyListR':'', | ||
| 959 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 960 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 961 | + _msgImg : '../images/u373.png', | ||
| 962 | + _meetingName : arrList[n].meeting_name, | ||
| 963 | + _create_user : arrList[n].teacherName, | ||
| 964 | + _liveTimer : key | ||
| 965 | + }) | ||
| 966 | + courseMinuteList.append(_classifyList) | ||
| 967 | + } | ||
| 968 | + } | ||
| 969 | + } | ||
| 970 | + | ||
| 971 | + } | ||
| 972 | + } | ||
| 973 | + //学生端 我的课程 已学完 | ||
| 974 | + studentFormerlyModule(courseMinuteList){ | ||
| 975 | + let that = this; | ||
| 976 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 977 | + if(_data){ | ||
| 978 | + that._studentFormerlyRender(courseMinuteList,_data.returnData.data) | ||
| 979 | + } | ||
| 980 | + }); | ||
| 981 | + } | ||
| 982 | + //学生端课程数据 已学完 | ||
| 983 | + _studentFormerlyRender(courseMinuteList,_data){ | ||
| 984 | + courseMinuteList.empty(); | ||
| 985 | + let count = _data.count; | ||
| 986 | + let page = _data.page; | ||
| 987 | + let pageno = _data.pageno; | ||
| 988 | + let pagenum = Math.ceil(count / pageno); | ||
| 989 | + let _dataList = _data; | ||
| 990 | + this.pageNo = pagenum; | ||
| 991 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 992 | + | ||
| 993 | + if(count <= 12){ | ||
| 994 | + $('#courseMinutePageBox').hide(); | ||
| 995 | + } | ||
| 996 | + //存储数据按日期分类 | ||
| 997 | + this.dataList={}; | ||
| 998 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 999 | + let item=_dataList[i]; | ||
| 1000 | + if(item){ | ||
| 1001 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 1002 | + if(!this.dataList[temp]) { | ||
| 1003 | + this.dataList[temp] = []; | ||
| 1004 | + } | ||
| 1005 | + this.dataList[temp].push(item) | ||
| 1006 | + } | ||
| 1007 | + } | ||
| 1008 | + for(let key in this.dataList){ | ||
| 1009 | + if(!ClassDataProxy.getTimeDay(key)){ | ||
| 1010 | + let arrList = this.dataList[key]; | ||
| 1011 | + if(arrList){ | ||
| 1012 | + for(let n = 0;n<arrList.length;n++){ | ||
| 1013 | + let j = (n%4) == 3; | ||
| 1014 | + let _classifyList = this._format(classifyList,{ | ||
| 1015 | + _classifyListR : j ?'classifyListR':'', | ||
| 1016 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 1017 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 1018 | + _msgImg : '../images/u373.png', | ||
| 1019 | + _meetingName : arrList[n].meeting_name, | ||
| 1020 | + _create_user : arrList[n].teacherName, | ||
| 1021 | + _liveTimer : key | ||
| 1022 | + }) | ||
| 1023 | + courseMinuteList.append(_classifyList) | ||
| 1024 | + } | ||
| 1025 | + } | ||
| 1026 | + } | ||
| 1027 | + | ||
| 1028 | + } | ||
| 1029 | + } | ||
| 1030 | + //学生端 我的课程 收藏 | ||
| 1031 | + studentCollectModule(courseMinuteList){ | ||
| 1032 | + let that = this; | ||
| 1033 | + this._studentCurriculumInfo(12,function(_data){ | ||
| 1034 | + if(_data){ | ||
| 1035 | + loger.log('显示收藏数据',_data) | ||
| 1036 | + that._studentCollectRender(courseMinuteList,_data.returnData.data) | ||
| 1037 | + } | ||
| 1038 | + }); | ||
| 1039 | + } | ||
| 1040 | + //学生端课程数据 收藏 | ||
| 1041 | + _studentCollectRender(courseMinuteList,_data){ | ||
| 1042 | + courseMinuteList.empty(); | ||
| 1043 | + let count = _data.count; | ||
| 1044 | + let page = _data.page; | ||
| 1045 | + let pageno = _data.pageno; | ||
| 1046 | + let pagenum = Math.ceil(count / pageno); | ||
| 1047 | + let _dataList = _data; | ||
| 1048 | + this.pageNo = pagenum; | ||
| 1049 | + $('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 1050 | + | ||
| 1051 | + if(count <= 12){ | ||
| 1052 | + $('#courseMinutePageBox').hide(); | ||
| 1053 | + } | ||
| 1054 | + //存储数据按日期分类 | ||
| 1055 | + this.dataList={}; | ||
| 1056 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1057 | + let item=_dataList[i]; | ||
| 1058 | + if(item){ | ||
| 1059 | + let temp = item.meetingBeginTime.split(' ')[0] | ||
| 1060 | + if(!this.dataList[temp]) { | ||
| 1061 | + this.dataList[temp] = []; | ||
| 1062 | + } | ||
| 1063 | + this.dataList[temp].push(item) | ||
| 1064 | + } | ||
| 1065 | + } | ||
| 1066 | + for(let key in this.dataList){ | ||
| 1067 | + if(!ClassDataProxy.getTimeDay(key)){ | ||
| 1068 | + let arrList = this.dataList[key]; | ||
| 1069 | + if(arrList){ | ||
| 1070 | + for(let n = 0;n<arrList.length;n++){ | ||
| 1071 | + let j = (n%4) == 3; | ||
| 1072 | + let _classifyList = this._format(classifyList,{ | ||
| 1073 | + _classifyListR : j ?'classifyListR':'', | ||
| 1074 | + _isShowTitle : n == 0 ?'block':'none', | ||
| 1075 | + _meetingNumber : arrList[n].meetingNumber, | ||
| 1076 | + _msgImg : '../images/u373.png', | ||
| 1077 | + _meetingName : arrList[n].meeting_name, | ||
| 1078 | + _create_user : arrList[n].teacherName, | ||
| 1079 | + _liveTimer : key | ||
| 1080 | + }) | ||
| 1081 | + // courseMinuteList.append(_classifyList) | ||
| 1082 | + } | ||
| 1083 | + } | ||
| 1084 | + } | ||
| 1085 | + | ||
| 1086 | + } | ||
| 1087 | + } | ||
| 1088 | + //老师端首页显示课程 | ||
| 1089 | + _teacherHomeCourse(_data){ | ||
| 1090 | + let myCurriculumInfo = $('#myCurriculumInfo'); | ||
| 1091 | + myCurriculumInfo.empty(); | ||
| 1092 | + if(_data){ | ||
| 1093 | + for(let i = 0;i < 3;i++){ | ||
| 1094 | + let item = _data[i]; | ||
| 1095 | + if(item){ | ||
| 1096 | + let curInfo = this._format(curriculumList,{ | ||
| 1097 | + _infoTit : item.meetingName, | ||
| 1098 | + _meetingNumber : item.meetingNumber, | ||
| 1099 | + _countDown : that.loadMeeting(item), | ||
| 1100 | + _isShow : (that.loadMeeting(item)=='已开始')?'block':'none' | ||
| 1101 | + }) | ||
| 1102 | + myCurriculumInfo.append(curInfo); | ||
| 1103 | + }else{ | ||
| 1104 | + console.error('_gainClassData没数据') | ||
| 1105 | + } | ||
| 1106 | + | ||
| 1107 | + } | ||
| 1108 | + } | ||
| 1109 | + } | ||
| 1110 | + //老师端首页直播信息 | ||
| 1111 | + _liveClassData(_data){ | ||
| 1112 | + let teacherMyCenterContentList = $('#teacherMyCenterContentList'); | ||
| 1113 | + teacherMyCenterContentList.empty(); | ||
| 1114 | + let count = _data.count; | ||
| 1115 | + let page = _data.page; | ||
| 1116 | + let pageno = _data.pageno; | ||
| 1117 | + let pagenum = Math.ceil(count / pageno); | ||
| 1118 | + let _dataList = _data.meetingInfo; | ||
| 1119 | + this.pageNo = pagenum; | ||
| 1120 | + $('#teacherMyCerterPageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录'); | ||
| 1121 | + teacherMyCenterContentList.append(adminListTit) | ||
| 1122 | + | ||
| 1123 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1124 | + if(count <= 8){ | ||
| 1125 | + $('#teacherMyCerterPageBox').hide(); | ||
| 1126 | + } | ||
| 1127 | + let _adminList = this._format(adminList,{ | ||
| 1128 | + _meetingName : _dataList[i].meetingName, | ||
| 1129 | + _meetingNumber : _dataList[i].meetingNumber, | ||
| 1130 | + _create_user : _dataList[i].create_user, | ||
| 1131 | + _state : ClassDataProxy.getTimeEnd(_dataList[i].beginTime,_dataList[i].endTime), | ||
| 1132 | + _timer : _dataList[i].beginTime + '-' + _dataList[i].endTime, | ||
| 1133 | + _num : '0' | ||
| 1134 | + }) | ||
| 1135 | + teacherMyCenterContentList.append(_adminList) | ||
| 1136 | + } | ||
| 1137 | + teacherMyCenterContentList.append(adminListEnd) | ||
| 1138 | + } | ||
| 1139 | + | ||
| 1140 | + | ||
| 1141 | + //修改密码 | ||
| 1142 | + _accountPassWordBtnHandler(){ | ||
| 1143 | + this.data = 0; | ||
| 1144 | + this._showInputBox(this.data); | ||
| 1145 | + } | ||
| 1146 | + //修改邮箱 | ||
| 1147 | + _accountEmailBtnHandler(){ | ||
| 1148 | + this.data = 1; | ||
| 1149 | + this._showInputBox(this.data); | ||
| 1150 | + } | ||
| 1151 | + //修改手机号 | ||
| 1152 | + _accountMobilelBtnHandler(){ | ||
| 1153 | + this.data = 2; | ||
| 1154 | + this._showInputBox(this.data); | ||
| 1155 | + } | ||
| 1156 | + _updateInputYesHandler(evt){ | ||
| 1157 | + let updateInput = $('#updateInput').val(); | ||
| 1158 | + switch (parseInt(this.data)){ | ||
| 1159 | + case 0: | ||
| 1160 | + //密码 | ||
| 1161 | + let reg = /^[0-9a-zA-Z]{8,12}$/; | ||
| 1162 | + if(!updateInput || !(reg.test(updateInput))){ | ||
| 1163 | + ErrorApe.showWarnError('密码格式不正确,请重新输入'); | ||
| 1164 | + return; | ||
| 1165 | + } | ||
| 1166 | + $('#setPassWord').attr('data',updateInput); | ||
| 1167 | + this._hideInputBox(); | ||
| 1168 | + break; | ||
| 1169 | + case 1: | ||
| 1170 | + //邮箱 | ||
| 1171 | + let filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | ||
| 1172 | + if(!updateInput || !(filter.test(updateInput))){ | ||
| 1173 | + ErrorApe.showWarnError('邮箱格式不正确,请重新输入'); | ||
| 1174 | + return; | ||
| 1175 | + } | ||
| 1176 | + $('#setMail').attr('data',updateInput); | ||
| 1177 | + $('#setMail').html(this.updateEmail(updateInput)) | ||
| 1178 | + this._hideInputBox(); | ||
| 1179 | + break; | ||
| 1180 | + case 2: | ||
| 1181 | + //手机号 | ||
| 1182 | + let reg1 = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$/; | ||
| 1183 | + let regPhone = "^1[3|4|5|8][0-9]\\d{8}$"; | ||
| 1184 | + let re = new RegExp(regPhone); | ||
| 1185 | + if(!updateInput || !(re.test(updateInput))){ | ||
| 1186 | + ErrorApe.showWarnError('手机格式不正确,请重新输入'); | ||
| 1187 | + return; | ||
| 1188 | + } | ||
| 1189 | + $('#setPhone').attr('data',updateInput); | ||
| 1190 | + $('#setPhone').html(this.updateMobile(updateInput)) | ||
| 1191 | + this._hideInputBox(); | ||
| 1192 | + break; | ||
| 1193 | + default: | ||
| 1194 | + return; | ||
| 1195 | + } | ||
| 1196 | + | ||
| 1197 | + } | ||
| 1198 | + _hideInputBox(){ | ||
| 1199 | + $('#updateInput').val(''); | ||
| 1200 | + $('#updateInputShade').hide(); | ||
| 1201 | + } | ||
| 1202 | + _showInputBox(ind){ | ||
| 1203 | + let arr = ['请输入新密码 :','请输入新邮箱 :','请输入新手机号 :'] | ||
| 1204 | + $('#updateInputShade').show(); | ||
| 1205 | + $('#updateInputText').text(arr[ind]) | ||
| 1206 | + } | ||
| 1207 | + updateEmail(userEmail){ | ||
| 1208 | + return userEmail.replace(/(\d{2})\d{2}(\d{1})/, '$1****$2') | ||
| 1209 | + } | ||
| 1210 | + updateMobile(userMobile){ | ||
| 1211 | + return userMobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') | ||
| 1212 | + } | ||
| 1213 | + _enterClassRoomHandler(evt){ | ||
| 1214 | + let ind = $(evt.target).attr('data'); | ||
| 1215 | + window.open('http://networkshool.xuedianyun.com/3m/attend.do?meetingNumber=' + ind); | ||
| 1216 | + } | ||
| 1217 | + _mouseenter(evt){ | ||
| 1218 | + $(evt.currentTarget).find('.accessLearningBtn').show(); | ||
| 1219 | + } | ||
| 1220 | + _mouseleave(evt){ | ||
| 1221 | + $(evt.currentTarget).find('.accessLearningBtn').hide(); | ||
| 1222 | + } | ||
| 1223 | + _cancelMouseenter(evt){ | ||
| 1224 | + $(evt.currentTarget).find('.cancelReservation').show(); | ||
| 1225 | + } | ||
| 1226 | + _cancelMouseleave(evt){ | ||
| 1227 | + $(evt.currentTarget).find('.cancelReservation').hide(); | ||
| 1228 | + } | ||
| 1229 | + _teacherSubscribeMoveHandler(evt){ | ||
| 1230 | + $('#teacherDetailBox').show(); | ||
| 1231 | + $('#myCenterBox').hide(); | ||
| 1232 | + | ||
| 1233 | + let buttonIsCheck = $('#orderBtn').attr('value','0'); | ||
| 1234 | + if($('#orderBtn').attr('value') == '0'){ | ||
| 1235 | + $('#orderBtn').attr('disabled',false) | ||
| 1236 | + $('#orderBtn').css('background','#ccc') | ||
| 1237 | + } | ||
| 1238 | + | ||
| 1239 | + let teacherDetailCurriculum = $('#teacherDetailCurriculum'); | ||
| 1240 | + teacherDetailCurriculum.empty(); | ||
| 1241 | + | ||
| 1242 | + let _data = $(evt.target).attr('data'); | ||
| 1243 | + if(_data){ | ||
| 1244 | + let _dataList = this.teacherList[_data]; | ||
| 1245 | + $('#teacherDetailInfoDetailName').html(_dataList[0].teacherName); | ||
| 1246 | + for(let i = 0;i<_dataList.length;i++){ | ||
| 1247 | + let _teacherDetail = this._format(teacherDetail,{ | ||
| 1248 | + _detailList : _dataList[i].meeting_name | ||
| 1249 | + }) | ||
| 1250 | + teacherDetailCurriculum.append(_teacherDetail) | ||
| 1251 | + } | ||
| 1252 | + } | ||
| 1253 | + } | ||
| 1254 | + //取消预约 | ||
| 1255 | + _cancelSubscribeHandler(evt){ | ||
| 1256 | + let _id = $(evt.target).attr('data'); | ||
| 1257 | + let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/updateStudentMeetingBySite/'+_id; | ||
| 1258 | + let that = this; | ||
| 1259 | + $.ajax({ | ||
| 1260 | + type: "PUT", | ||
| 1261 | + url: _url, | ||
| 1262 | + timeout:5000, | ||
| 1263 | + headers: { | ||
| 1264 | + siteId:ClassDataProxy.siteId, | ||
| 1265 | + 'token':ClassDataProxy.token | ||
| 1266 | + }, | ||
| 1267 | + data:{status:'5'}, | ||
| 1268 | + success:function(_data){ | ||
| 1269 | + //获取课堂数据 | ||
| 1270 | + if(_data && _data.code == 200){ | ||
| 1271 | + that.studentBookings(); | ||
| 1272 | + } | ||
| 1273 | + }, | ||
| 1274 | + error:function(error){ | ||
| 1275 | + console.log(error,'失败') | ||
| 1276 | + } | ||
| 1277 | + }) | ||
| 1278 | + | ||
| 1279 | + } | ||
| 1280 | + _teacherClassDetails(evt){ | ||
| 1281 | + let name = $(evt.target).attr('data'); | ||
| 1282 | + let ind = $(evt.target).index(); | ||
| 1283 | + let _data = this.teacherList[name][ind] | ||
| 1284 | + | ||
| 1285 | + $('#lanclassBox').show(); | ||
| 1286 | + $('#myCenterBox').hide(); | ||
| 1287 | + | ||
| 1288 | + $('#lanclassContentTitle').html(_data.meeting_name); | ||
| 1289 | + $('#lanclassContentInfoName').html(_data.teacherName); | ||
| 1290 | + $('#lanclassContentInfoTimeStart').html('开始时间:'+_data.meetingBeginTime); | ||
| 1291 | + $('#lanclassContentInfoTimeEnd').html('结束时间:'+_data.meetingEndTime); | ||
| 1292 | + | ||
| 1293 | + } | ||
| 1294 | + _judgeListPlace(){ | ||
| 1295 | + let i; | ||
| 1296 | + let curriculumList = document.getElementsByClassName('classifyListMyCenter'); | ||
| 1297 | + for(i=0;i<curriculumList.length;i++){ | ||
| 1298 | + if((i%4) == 3){ | ||
| 1299 | + $(curriculumList[i]).addClass('classifyListR'); | ||
| 1300 | + } | ||
| 1301 | + } | ||
| 1302 | + } | ||
| 1303 | + //切换类的公用样式 | ||
| 1304 | + commonality(evt){ | ||
| 1305 | + $(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck'); | ||
| 1306 | + } | ||
| 1307 | + _teacherInfoListHandler(evt){ | ||
| 1308 | + this.commonality(evt); | ||
| 1309 | + } | ||
| 1310 | + //学生端 首页 | ||
| 1311 | + _studentInfoListHandler(evt){ | ||
| 1312 | + this.commonality(evt); | ||
| 1313 | + this.detailPageStudent(); | ||
| 1314 | + } | ||
| 1315 | + //学生端 我的课程 | ||
| 1316 | + _courseInfoListHandler(evt){ | ||
| 1317 | + this.commonality(evt); | ||
| 1318 | + this.studentCourses(); | ||
| 1319 | + } | ||
| 1320 | + //老师端 我的课程 | ||
| 1321 | + _teacherLiveListHandler(evt){ | ||
| 1322 | + this.commonality(evt); | ||
| 1323 | + this.teacherCourses(); | ||
| 1324 | + } | ||
| 1325 | + _subscribeListHandler(evt){ | ||
| 1326 | + this.commonality(evt); | ||
| 1327 | + this.studentBookings(); | ||
| 1328 | + } | ||
| 1329 | + //工具类 | ||
| 1330 | + _format(str, obj) { | ||
| 1331 | + return str.replace(/\{(\w+)\}/g, function (match, group, index) { | ||
| 1332 | + return obj[group]; | ||
| 1333 | + }); | ||
| 1334 | + }; | ||
| 1335 | +} | ||
| 1336 | +export default MyCenterApe; |
| @@ -147,7 +147,7 @@ class PartTimeTeachingApe extends Ape { | @@ -147,7 +147,7 @@ class PartTimeTeachingApe extends Ape { | ||
| 147 | headers: {siteId:ClassDataProxy.siteId, | 147 | headers: {siteId:ClassDataProxy.siteId, |
| 148 | pageno:7, | 148 | pageno:7, |
| 149 | 'page':ind, | 149 | 'page':ind, |
| 150 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 150 | + 'token':ClassDataProxy.token}, |
| 151 | success:function(_data){ | 151 | success:function(_data){ |
| 152 | //获取课堂数据 | 152 | //获取课堂数据 |
| 153 | if(_data && _data.code == 200){ | 153 | if(_data && _data.code == 200){ |
| @@ -145,7 +145,7 @@ class PlayRecordApe extends Ape { | @@ -145,7 +145,7 @@ class PlayRecordApe extends Ape { | ||
| 145 | headers: {siteId:ClassDataProxy.siteId, | 145 | headers: {siteId:ClassDataProxy.siteId, |
| 146 | pageno:7, | 146 | pageno:7, |
| 147 | page:ind, | 147 | page:ind, |
| 148 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 148 | + 'token':ClassDataProxy.token}, |
| 149 | success:function(_data){ | 149 | success:function(_data){ |
| 150 | if(_data && _data.code == 200){ | 150 | if(_data && _data.code == 200){ |
| 151 | loger.log(_data,'录制回放数据信息') | 151 | loger.log(_data,'录制回放数据信息') |
| @@ -41,7 +41,7 @@ class SubscribeApe extends Ape { | @@ -41,7 +41,7 @@ class SubscribeApe extends Ape { | ||
| 41 | "meetingId":id | 41 | "meetingId":id |
| 42 | }, | 42 | }, |
| 43 | headers: {siteId:ClassDataProxy.siteId, | 43 | headers: {siteId:ClassDataProxy.siteId, |
| 44 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 44 | + 'token':ClassDataProxy.token}, |
| 45 | success:function(_data){ | 45 | success:function(_data){ |
| 46 | let arr = ['收藏成功!','预约成功!','报名成功!'] | 46 | let arr = ['收藏成功!','预约成功!','报名成功!'] |
| 47 | //获取课堂数据 | 47 | //获取课堂数据 |
| @@ -53,7 +53,7 @@ class TeacherDetailApe extends Ape { | @@ -53,7 +53,7 @@ class TeacherDetailApe extends Ape { | ||
| 53 | timeout:5000, | 53 | timeout:5000, |
| 54 | headers: {'page':_ele.text(), | 54 | headers: {'page':_ele.text(), |
| 55 | siteId:ClassDataProxy.siteId, | 55 | siteId:ClassDataProxy.siteId, |
| 56 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo', | 56 | + 'token':ClassDataProxy.token |
| 57 | }, | 57 | }, |
| 58 | data:{siteId:ClassDataProxy.siteId,userType : 1}, | 58 | data:{siteId:ClassDataProxy.siteId,userType : 1}, |
| 59 | success:function(_data){ | 59 | success:function(_data){ |
| @@ -84,7 +84,7 @@ class TeacherDetailApe extends Ape { | @@ -84,7 +84,7 @@ class TeacherDetailApe extends Ape { | ||
| 84 | timeout:5000, | 84 | timeout:5000, |
| 85 | headers: {siteId:ClassDataProxy.siteId, | 85 | headers: {siteId:ClassDataProxy.siteId, |
| 86 | userType : 1, | 86 | userType : 1, |
| 87 | - 'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'}, | 87 | + 'token':ClassDataProxy.token}, |
| 88 | data:{siteId:ClassDataProxy.siteId,userType : 1}, | 88 | data:{siteId:ClassDataProxy.siteId,userType : 1}, |
| 89 | success:function(_data){ | 89 | success:function(_data){ |
| 90 | //获取课堂数据 | 90 | //获取课堂数据 |
| @@ -24,7 +24,11 @@ import AboutClassApe from 'ape/AboutClassApe';//约课界面 | @@ -24,7 +24,11 @@ import AboutClassApe from 'ape/AboutClassApe';//约课界面 | ||
| 24 | import ListDetailsApe from 'ape/ListDetailsApe';//列表详情 | 24 | import ListDetailsApe from 'ape/ListDetailsApe';//列表详情 |
| 25 | import AdministratorApe from 'ape/AdministratorApe';//管理员 | 25 | import AdministratorApe from 'ape/AdministratorApe';//管理员 |
| 26 | import PlayRecordApe from 'ape/PlayRecordApe';//录制管理 | 26 | import PlayRecordApe from 'ape/PlayRecordApe';//录制管理 |
| 27 | + | ||
| 27 | import MyCenterApe from 'ape/MyCenterApe';//个人中心 | 28 | import MyCenterApe from 'ape/MyCenterApe';//个人中心 |
| 29 | +import MyCenterStudentApe from 'ape/MyCenterStudentApe';//个人中心老师 | ||
| 30 | +import MyCenterTeacherApe from 'ape/MyCenterTeacherApe';//个人中心学生 | ||
| 31 | + | ||
| 28 | import SubscribeApe from 'ape/SubscribeApe';//预约 | 32 | import SubscribeApe from 'ape/SubscribeApe';//预约 |
| 29 | import CollectApe from 'ape/CollectApe';//预约 | 33 | import CollectApe from 'ape/CollectApe';//预约 |
| 30 | 34 | ||
| @@ -50,6 +54,9 @@ let _listDetailsApe; | @@ -50,6 +54,9 @@ let _listDetailsApe; | ||
| 50 | let _administratorApe; | 54 | let _administratorApe; |
| 51 | let _playRecordApe; | 55 | let _playRecordApe; |
| 52 | let _myCenterApe; | 56 | let _myCenterApe; |
| 57 | +let _myCenterStudentApe; | ||
| 58 | +let _myCenterTeacherApe; | ||
| 59 | + | ||
| 53 | let _subscribeApe; | 60 | let _subscribeApe; |
| 54 | let _collectApe; | 61 | let _collectApe; |
| 55 | 62 | ||
| @@ -140,6 +147,7 @@ class Main { | @@ -140,6 +147,7 @@ class Main { | ||
| 140 | _loginOrRegister = new LoginOrRegister(); | 147 | _loginOrRegister = new LoginOrRegister(); |
| 141 | _loginOrRegister.on(MessageTypes.LOGIN_OUT,this.loginOut.bind(this)); | 148 | _loginOrRegister.on(MessageTypes.LOGIN_OUT,this.loginOut.bind(this)); |
| 142 | _loginOrRegister.on(MessageTypes.LOGIN_IN,this.loginIn.bind(this)); | 149 | _loginOrRegister.on(MessageTypes.LOGIN_IN,this.loginIn.bind(this)); |
| 150 | + _loginOrRegister.on(MessageTypes.LOGIN_MYCENTER,this.loginMycenter.bind(this)); | ||
| 143 | 151 | ||
| 144 | //互动课堂 | 152 | //互动课堂 |
| 145 | _lanclassApe = new LanclassApe(); | 153 | _lanclassApe = new LanclassApe(); |
| @@ -174,6 +182,11 @@ class Main { | @@ -174,6 +182,11 @@ class Main { | ||
| 174 | 182 | ||
| 175 | //个人中心 | 183 | //个人中心 |
| 176 | _myCenterApe = new MyCenterApe(); | 184 | _myCenterApe = new MyCenterApe(); |
| 185 | + //个人中心学生 | ||
| 186 | + _myCenterStudentApe = new MyCenterStudentApe(); | ||
| 187 | + //个人中心老师 | ||
| 188 | + _myCenterTeacherApe = new MyCenterTeacherApe(); | ||
| 189 | + | ||
| 177 | //预约管理 | 190 | //预约管理 |
| 178 | _subscribeApe = new SubscribeApe(); | 191 | _subscribeApe = new SubscribeApe(); |
| 179 | _subscribeApe.on(MessageTypes.ORDER_FINISH,this.orderFinish.bind(this)); | 192 | _subscribeApe.on(MessageTypes.ORDER_FINISH,this.orderFinish.bind(this)); |
| @@ -214,6 +227,17 @@ class Main { | @@ -214,6 +227,17 @@ class Main { | ||
| 214 | } | 227 | } |
| 215 | } | 228 | } |
| 216 | } | 229 | } |
| 230 | + //个人中心 | ||
| 231 | + loginMycenter(){ | ||
| 232 | + loger.log('个人中心') | ||
| 233 | + if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_1){ | ||
| 234 | + // _myCenterTeacherApe | ||
| 235 | + loger.log('个人中心老师') | ||
| 236 | + }else if(ClassDataProxy.userType == ClassDataProxy.USER_TYPE_8){ | ||
| 237 | + // _myCenterStudentApe | ||
| 238 | + loger.log('个人中心学生') | ||
| 239 | + } | ||
| 240 | + } | ||
| 217 | switchClass(_data){ | 241 | switchClass(_data){ |
| 218 | let ind = parseInt(_data); | 242 | let ind = parseInt(_data); |
| 219 | 243 | ||
| @@ -293,6 +317,7 @@ class Main { | @@ -293,6 +317,7 @@ class Main { | ||
| 293 | let userEmail = window.localStorage.getItem('userEmail')|| ''; | 317 | let userEmail = window.localStorage.getItem('userEmail')|| ''; |
| 294 | let monicker = window.localStorage.getItem('monicker')|| ''; | 318 | let monicker = window.localStorage.getItem('monicker')|| ''; |
| 295 | let status = window.localStorage.getItem('status')|| ''; | 319 | let status = window.localStorage.getItem('status')|| ''; |
| 320 | + let token = window.localStorage.getItem('token')|| ''; | ||
| 296 | 321 | ||
| 297 | ClassDataProxy.userType = parseInt(userType); | 322 | ClassDataProxy.userType = parseInt(userType); |
| 298 | ClassDataProxy.loginName = loginName; | 323 | ClassDataProxy.loginName = loginName; |
| @@ -303,6 +328,7 @@ class Main { | @@ -303,6 +328,7 @@ class Main { | ||
| 303 | ClassDataProxy.userEmail = userEmail; | 328 | ClassDataProxy.userEmail = userEmail; |
| 304 | ClassDataProxy.monicker = monicker; | 329 | ClassDataProxy.monicker = monicker; |
| 305 | ClassDataProxy.status = status; | 330 | ClassDataProxy.status = status; |
| 331 | + ClassDataProxy.token = token; | ||
| 306 | loger.log('进入课堂时显示的type值',ClassDataProxy.userType) | 332 | loger.log('进入课堂时显示的type值',ClassDataProxy.userType) |
| 307 | 333 | ||
| 308 | switch (parseInt(userType)){ | 334 | switch (parseInt(userType)){ |
| @@ -360,7 +386,7 @@ class Main { | @@ -360,7 +386,7 @@ class Main { | ||
| 360 | $('#teacherMyCerter').show(); | 386 | $('#teacherMyCerter').show(); |
| 361 | $('#studentMyCerter').hide(); | 387 | $('#studentMyCerter').hide(); |
| 362 | $('.recordLi2').eq(0).addClass('recordLiCheck').siblings().removeClass('recordLiCheck'); | 388 | $('.recordLi2').eq(0).addClass('recordLiCheck').siblings().removeClass('recordLiCheck'); |
| 363 | - | 389 | + $('#teacherUI .recordLi').eq(2).hide(); |
| 364 | $('#liveContentAllBox').hide(); | 390 | $('#liveContentAllBox').hide(); |
| 365 | $('#lanclassAllBox').hide(); | 391 | $('#lanclassAllBox').hide(); |
| 366 | $('#teacherIntroAllBox').hide(); | 392 | $('#teacherIntroAllBox').hide(); |
| @@ -188,15 +188,17 @@ class ClassDataProxy { | @@ -188,15 +188,17 @@ class ClassDataProxy { | ||
| 188 | } | 188 | } |
| 189 | } | 189 | } |
| 190 | //计算时间戳倒计时 | 190 | //计算时间戳倒计时 |
| 191 | - static getTimeCountDown(start){ | 191 | + static getTimeCountDown(start,end){ |
| 192 | 192 | ||
| 193 | let newDate = Date.parse(new Date()); | 193 | let newDate = Date.parse(new Date()); |
| 194 | //开始时间 | 194 | //开始时间 |
| 195 | let newTime = Date.parse(new Date(start)) | 195 | let newTime = Date.parse(new Date(start)) |
| 196 | + //结束时间 | ||
| 197 | + let endTime = Date.parse(new Date(end)) | ||
| 196 | 198 | ||
| 197 | 199 | ||
| 198 | - let t = newTime - newDate; | ||
| 199 | - console.log(t) | 200 | + let t = newDate - endTime; |
| 201 | + let y = newDate - newTime; | ||
| 200 | 202 | ||
| 201 | let hour=Math.floor(t/1000/60/60%24); | 203 | let hour=Math.floor(t/1000/60/60%24); |
| 202 | let min=Math.floor(t/1000/60%60); | 204 | let min=Math.floor(t/1000/60%60); |
| @@ -212,10 +214,15 @@ class ClassDataProxy { | @@ -212,10 +214,15 @@ class ClassDataProxy { | ||
| 212 | sec = "0" + sec; | 214 | sec = "0" + sec; |
| 213 | } | 215 | } |
| 214 | 216 | ||
| 215 | - if(t<0){ | ||
| 216 | - return '已结束'; | 217 | + if(t < 0){ |
| 218 | + if(y < 0){ | ||
| 219 | + return hour + ":" + min + ":" + sec; | ||
| 220 | + | ||
| 221 | + }else{ | ||
| 222 | + return '马上加入'; | ||
| 223 | + } | ||
| 217 | }else{ | 224 | }else{ |
| 218 | - return hour + ":" + min + ":" + sec; | 225 | + return '已结束'; |
| 219 | } | 226 | } |
| 220 | } | 227 | } |
| 221 | //判断是否是今天 | 228 | //判断是否是今天 |
| @@ -261,6 +268,27 @@ class ClassDataProxy { | @@ -261,6 +268,27 @@ class ClassDataProxy { | ||
| 261 | return newMonth + '月' + newDate +'日 ' + ' '+newStartHours + ':00' + ' - ' + newEndHours+':00'; | 268 | return newMonth + '月' + newDate +'日 ' + ' '+newStartHours + ':00' + ' - ' + newEndHours+':00'; |
| 262 | } | 269 | } |
| 263 | } | 270 | } |
| 271 | + static getTimeEnd(start,end){ | ||
| 272 | + let newDate = Date.parse(new Date()); | ||
| 273 | + //开始时间 | ||
| 274 | + let newTime = Date.parse(new Date(start)) | ||
| 275 | + //结束时间 | ||
| 276 | + let endTime = Date.parse(new Date(end)) | ||
| 277 | + | ||
| 278 | + let t = newDate - endTime;//结束时间 | ||
| 279 | + let y = newDate - newTime;//开始时间 | ||
| 280 | + | ||
| 281 | + if(t<0){ | ||
| 282 | + if(y < 0){ | ||
| 283 | + return '未开始'; | ||
| 284 | + }else{ | ||
| 285 | + return '准备'; | ||
| 286 | + } | ||
| 287 | + }else{ | ||
| 288 | + return '已结束'; | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + } | ||
| 264 | } | 292 | } |
| 265 | 293 | ||
| 266 | //Class | 294 | //Class |
-
请 注册 或 登录 后发表评论