Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
董佳音
/
networkSchool
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
董佳音
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9060a56ab7c7c4c69674e8e09745d0527a40cbd2
9060a56a
1 parent
f78f8be8
dong1026-1
...
dev
dong0913-1
dong0914-1
dong0921-1
dong0928-1
dong0928-2
dong1009-1
dong1011-1
dong1011-2
dong1012-1
v1.9.1.20171017
v1.9.0.20171012
v1.8.10.20171011
v1.8.9.20171011
v1.8.8.20170929
v1.8.7.20170928
v1.8.6.20170928
v1.8.3.20170914
v1.8.2.20170914
修改首页数据显示,详情页
隐藏空白字符变更
内嵌
并排对比
正在显示
14 个修改的文件
包含
1046 行增加
和
406 行删除
dist/stylesheets/style.css
etc/umd.template.html
src/MessageTypes.js
src/ape/CollectApe.js
src/ape/CreateClassApe.js
src/ape/HomeApe.js
src/ape/LanclassApe.js
src/ape/ListDetailsApe.js
src/ape/LiveClassApe.js
src/ape/MyCenterApe.js
src/ape/SubscribeApe.js
src/ape/TeacherDetailApe.js
src/main.js
src/proxy/ClassDataProxy.js
dist/stylesheets/style.css
查看文件 @
9060a56
...
...
@@ -378,6 +378,7 @@ body{
.classifyListContent
{
width
:
100%
;
min-height
:
600px
;
margin-bottom
:
20px
;
float
:
left
;
}
.classifyList
{
...
...
etc/umd.template.html
查看文件 @
9060a56
...
...
@@ -89,19 +89,118 @@
</div>
</div>
<!--课堂分类列表-->
<div
class=
"classifyListBox"
id=
"classifyListBox"
>
<div
class=
"classifyListTitle"
id=
"classifyListTitle"
>
最新直播课程
</div>
<div
class=
"classifyListContent"
id=
"classifyListContent"
>
<!--<div class="classifyList">
<img class="curriculumListImg" src="" alt="">
<p class="curriculumListTit">初一英语阅读理解习题课</p>
<p class="curriculumListInfo">
<span class="curriculumListTime">今天 09:00-21:30</span>
<span class="curriculumListNum">3200人已预约</span>
</p>
</div>-->
<!--最新直播课程-->
<div
class=
"classifyListBox"
id=
"liveContentAllBox"
>
<div
class=
"classifyListTitle"
>
最新直播课程
</div>
<div
class=
"classifyListContent"
id=
"liveContent"
>
</div>
<div
class=
"pageNumContentBox"
id=
"livePageBox"
>
<table
width=
"100%"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr>
<td
height=
"60"
colspan=
"11"
class=
"tr_bottom"
style=
""
>
<span
class=
"classHandlerPageMsg"
id=
"livePageNumMsg"
style=
"line-height: 38px; padding-left: 20px; float: left"
>
第1页/共2页,有16个记录
</span>
<ul
class=
"classHandlerPageInfoBox"
>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerHomePage"
id=
"livePageNumHomePage"
>
首页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerUpPage"
id=
"livePageNumUpPage"
>
上一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerDownPage"
id=
"livePageNumDownPage"
>
下一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerEndPage"
id=
"livePageNumEndPage"
>
尾页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<input
id=
"livePageInfoInput"
class=
"classHandlerPageInfoInput"
type=
"text"
>
</li>
<li
class=
"classHandlerPageInfo classHandlerPageInfoCheck"
>
<span
id=
"liveSpecificPage"
>
GO
</span>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--最新互动课程-->
<div
class=
"classifyListBox"
id=
"lanclassAllBox"
>
<div
class=
"classifyListTitle"
>
最新互动课程
</div>
<div
class=
"classifyListContent"
id=
"lanclassContent"
>
</div>
<div
class=
"pageNumContentBox"
id=
"lanclassPageBox"
>
<table
width=
"100%"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr>
<td
height=
"60"
colspan=
"11"
class=
"tr_bottom"
style=
""
>
<span
class=
"classHandlerPageMsg"
id=
"pageNumContentMsg"
style=
"line-height: 38px; padding-left: 20px; float: left"
>
第1页/共2页,有16个记录
</span>
<ul
class=
"classHandlerPageInfoBox"
>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerHomePage"
id=
"pageNumContentHomePage"
>
首页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerUpPage"
id=
"pageNumContentUpPage"
>
上一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerDownPage"
id=
"pageNumContentDownPage"
>
下一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerEndPage"
id=
"pageNumContentEndPage"
>
尾页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<input
id=
"pageNumContentPageInfoInput"
class=
"classHandlerPageInfoInput"
type=
"text"
>
</li>
<li
class=
"classHandlerPageInfo classHandlerPageInfoCheck"
>
<span
id=
"pageNumContentSpecificPage"
>
GO
</span>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--推荐老师-->
<div
class=
"classifyListBox"
id=
"teacherIntroAllBox"
>
<div
class=
"classifyListTitle"
id=
"teacherIntroTitle"
>
推荐老师
</div>
<div
class=
"classifyListContent"
id=
"teacherIntroContent"
>
</div>
<div
class=
"pageNumContentBox"
id=
"teacherIntroPageBox"
>
<table
width=
"100%"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
>
<tbody>
<tr>
<td
height=
"60"
colspan=
"11"
class=
"tr_bottom"
style=
""
>
<span
class=
"classHandlerPageMsg"
id=
"pageNumContentMsg"
style=
"line-height: 38px; padding-left: 20px; float: left"
>
第1页/共2页,有16个记录
</span>
<ul
class=
"classHandlerPageInfoBox"
>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerHomePage"
id=
"pageNumContentHomePage"
>
首页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerUpPage"
id=
"pageNumContentUpPage"
>
上一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerDownPage"
id=
"pageNumContentDownPage"
>
下一页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<span
class=
"classHandlerEndPage"
id=
"pageNumContentEndPage"
>
尾页
</span>
</li>
<li
class=
"classHandlerPageInfo"
>
<input
id=
"pageNumContentPageInfoInput"
class=
"classHandlerPageInfoInput"
type=
"text"
>
</li>
<li
class=
"classHandlerPageInfo classHandlerPageInfoCheck"
>
<span
id=
"pageNumContentSpecificPage"
>
GO
</span>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"pageNumContentBox"
id=
"pageNumContentBox"
></div>
</div>
<!--直播课堂详情-->
<div
class=
"lanclassBox"
id=
"lanclassBox"
>
...
...
@@ -127,11 +226,11 @@
<span
id=
"qqIcon"
class=
"thirdPartyIcon qqIcon iconfont"
>

</span>
<span
id=
"weiboIcon"
class=
"thirdPartyIcon weiboIcon iconfont"
>

</span>
</div>
<div
class=
"collectBox"
id=
"collectYes"
data=
"
0
"
>
<div
class=
"collectBox"
id=
"collectYes"
data=
"
6
"
>
<img
class=
"collectIcon"
id=
"collectYesIcon"
src=
"images/collect.png"
alt=
""
>
<span
class=
"collectText"
>
已收藏
</span>
</div>
<div
class=
"collectBox"
id=
"collectNo"
data=
"
0
"
>
<div
class=
"collectBox"
id=
"collectNo"
data=
"
7
"
>
<img
class=
"collectIcon"
id=
"collectNoIcon"
src=
"images/not-collect.png"
alt=
""
>
<span
class=
"collectText"
>
未收藏
</span>
</div>
...
...
@@ -142,10 +241,7 @@
课程介绍
</p>
<p
class=
"lanclassIntroduceContent"
id=
"lanclassIntroduceDescription"
>
课程介绍Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet.
Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar
tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget.
中学生英语听力水平的提高,除了在课堂上掌握教材和大纲所要求的听力知识外,还必须进行大量的听力训练,才能达到消化所学知识、熟能生巧的地步。目前市场上的同步听力训练辅导材料,大都是针对某一特定的教材,按教材和教学要求进行编写,这固然可以帮助学生消化和掌握课堂所学内容,由于单元教学目标要求的限制,无法进行系统的、有针对性的听力训练。本套听力丛书就是针对目前中学英语听力教学中的这一特殊情况,根据中学生的实际情况而编写的。
</p>
</div>
<div
class=
"lanclassContent teacherInfos"
id=
"teacherInfos"
>
...
...
@@ -153,25 +249,22 @@
老师简介
</div>
<div
class=
"teacherInfoData"
>
<span
class=
"teacherInfoName"
>
张媛媛
</span>
<span
class=
"teacherInfoName"
id=
"teacherInfoName"
>
张媛媛
</span>
<span
class=
"teacherInfoSchool"
id=
"teacherInfoSchool"
>
北京外国语学院
</span>
</div>
<div
class=
"lanclassIntroduceContent"
id=
"teacherInfoContent"
>
课程介绍Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet.
Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar
tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus
1982年1月毕业于北京师范学院(现北京师范大学)外语系英语专业。在二十多年的教学工作中,曾讲授初中、高中、师范英语班、大专英语班及教师继续教育的英语课程。获得广泛好评。在全国范围内正式出版书籍近三十本;制作出版英语口语教学VCD6盘。北京市英语教师继续教育学科指导小组成员。1998年被评为北京市英语骨干教师.2000年参加国家级英语骨干教师培训,2003年被评为北京市英语学科带头人,2005年被评为北京市特级教师。
</div>
</div>
</div>
<!--
互动课堂
详情页-->
<!--
老师
详情页-->
<div
class=
"teacherDetailBox"
id=
"teacherDetailBox"
>
<div
class=
"teacherDetailInfo"
>
<div
class=
"teacherDetailInfoLeft"
>
<img
class=
"teacherDetailInfoImg"
id=
"teacherDetailInfoImg"
src=
""
alt=
""
>
<ul
class=
"teacherDetailInfoDetailBox"
>
<li
class=
"teacherDetailInfoDetailTit"
>
<span
class=
"teacherDetailInfoDetailName"
id=
"teacherDetailInfoDetailName"
>
张
3333
</span>
<span
class=
"teacherDetailInfoDetailName"
id=
"teacherDetailInfoDetailName"
>
张
媛媛
</span>
<span
class=
"teacherDetailInfoDetailSex"
id=
"teacherDetailInfoDetailSex"
>
女
</span>
</li>
<li
class=
"teacherDetailInfoDetailSpeciality"
>
...
...
@@ -201,7 +294,7 @@
授课内容:
</p>
<p
class=
"teacherDetailReferralContent"
id=
"teacherDetailReferralContent"
>
授课内容授课内容授课内容授课内容授课内容授课内容授课内容授课内容授课内容授课内容授课内容授课内容
中学生英语听力水平的提高,除了在课堂上掌握教材和大纲所要求的听力知识外,还必须进行大量的听力训练,才能达到消化所学知识、熟能生巧的地步。目前市场上的同步听力训练辅导材料,大都是针对某一特定的教材,按教材和教学要求进行编写,这固然可以帮助学生消化和掌握课堂所学内容,由于单元教学目标要求的限制,无法进行系统的、有针对性的听力训练。本套听力丛书就是针对目前中学英语听力教学中的这一特殊情况,根据中学生的实际情况而编写的。
</p>
</div>
<button
class=
"teacherDetailOrderBtn btnHover"
id=
"orderBtn"
data=
"1"
value=
'1'
>
我要预约
</button>
...
...
@@ -214,31 +307,31 @@
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
教师职称:
</label>
<span
class=
"teacherDetailPost"
id=
"teacherDetailPost"
>
111
</span>
<span
class=
"teacherDetailPost"
id=
"teacherDetailPost"
>
特技教师
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
最高学历:
</label>
<span
id=
"teacherDetailEducation"
>
111
</span>
<span
id=
"teacherDetailEducation"
>
硕士
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
毕业院校:
</label>
<span
id=
"teacherDetailAcademy"
>
111
</span>
<span
id=
"teacherDetailAcademy"
>
北京外国语大学
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
授课方式:
</label>
<span
id=
"teacherDetailWay"
>
111
</span>
<span
id=
"teacherDetailWay"
>
线上/线下均可
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
授课地区:
</label>
<span
id=
"teacherDetailArea"
>
111
</span>
<span
id=
"teacherDetailArea"
>
不限
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
基本简介:
</label>
<span
id=
"teacherDetailSynopsis"
>
111
</span>
<span
id=
"teacherDetailSynopsis"
>
【1】专业8级,英语会考不算强,能说说好才算强
</span>
</li>
<li
class=
"teacherDetailBasics"
>
<label
class=
"teacherDetailBasicsTitle"
>
教学特点:
</label>
<span
id=
"teacherDetailTrait"
>
111
</span>
<span
id=
"teacherDetailTrait"
>
温文尔雅
</span>
</li>
</ul>
<div
class=
"teacherDetailCurriculum"
>
...
...
@@ -1383,8 +1476,8 @@
<div
class=
"studentMyCerter"
id=
"studentMyCerter"
>
<div
class=
"myCenterContentTitleBox"
>
<ul
class=
"liveInfoLeft"
id=
"studentInfoList"
>
<li
class=
"liveInfoLeftLi liveInfoLeftLiCheck"
data=
"1"
>
待学习
</li>
<li
class=
"liveInfoLeftLi"
data=
"0"
>
已学完
</li>
<li
class=
"liveInfoLeftLi liveInfoLeftLiCheck"
data=
"0"
>
待学习
</li>
<li
class=
"liveInfoLeftLi"
data=
"1"
>
已学完
</li>
<li
class=
"liveInfoLeftLi"
data=
"2"
>
收藏
</li>
</ul>
</div>
...
...
@@ -1406,11 +1499,11 @@
<!--我的课程-->
<div
class=
"myCenterContentBox"
>
<div
class=
"myCenterContentTitleBox studyContent"
>
<div
class=
"liveInfoLeft"
id=
"courseInfoList"
>
<div
class=
"liveInfoLeftLi liveInfoLeftLiCheck"
>
待学习
</div>
<div
class=
"liveInfoLeftLi"
>
已学完
</div>
<div
class=
"liveInfoLeftLi"
>
收藏
</div>
</div>
<ul
class=
"liveInfoLeft"
id=
"courseInfoList"
>
<li
class=
"liveInfoLeftLi liveInfoLeftLiCheck"
data=
"0"
>
待学习
</li>
<li
class=
"liveInfoLeftLi"
data=
"1"
>
已学完
</li>
<li
class=
"liveInfoLeftLi"
data=
"2"
>
收藏
</li>
</ul>
</div>
<div
class=
"courseMinuteList"
id=
"courseMinuteList"
>
<div
class=
"courseMinuteListTimeTit"
>
...
...
src/MessageTypes.js
查看文件 @
9060a56
...
...
@@ -13,6 +13,8 @@ MessageTypes.LOGIN_IN= "login_in"; //更新用户退出
//header按钮
MessageTypes
.
HOME_SKIP
=
"home_skip"
;
//首页跳转
MessageTypes
.
SWITCH_HEADER
=
"switch_header"
;
//head 头部 切换
//管理员列表
...
...
@@ -20,5 +22,9 @@ MessageTypes.SWITCH_CLASS= "switch_class"; //创建课堂
//创建课堂成功
MessageTypes
.
ADD_CLASS
=
"add_class"
;
//创建课堂
//预约成功
MessageTypes
.
ORDER_FINISH
=
"order_finish"
;
//预约成功
export
default
MessageTypes
;
...
...
src/ape/CollectApe.js
0 → 100644
查看文件 @
9060a56
//*
// 收藏模块
// */
import
Loger
from
"../Loger"
;
import
Ape
from
"./Ape"
;
import
$
from
"jquery"
;
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
import
MessageTypes
from
"../MessageTypes"
;
import
ErrorApe
from
"./ErrorApe"
;
let
loger
=
Loger
.
getLoger
(
'PC-CollectApe'
);
class
CollectApe
extends
Ape
{
constructor
()
{
super
();
this
.
addEvent
();
this
.
init
();
}
init
()
{
$
(
'#collectYes'
).
on
(
'click'
,
this
.
_collectYesHandler
.
bind
(
this
));
//取消收藏
$
(
'#collectNo'
).
on
(
'click'
,
this
.
_collectNoHandler
.
bind
(
this
));
//收藏
}
addEvent
()
{
}
_collectNoHandler
(
evt
){
let
that
=
this
;
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/studentMeeting/addStudentMeeting'
;
let
status
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
let
id
=
$
(
'#lanclassBox'
).
attr
(
'data'
);
loger
.
log
(
'收藏数据信息'
,
status
)
let
data
=
{
siteId
:
ClassDataProxy
.
siteId
,
"studentId"
:
ClassDataProxy
.
id
,
"status"
:
parseInt
(
status
),
"meetingId"
:
id
}
this
.
detailPage
(
_url
,
data
,
function
(
_data
){
if
(
_data
&&
_data
.
code
==
200
){
that
.
_collectNoClick
();
ErrorApe
.
showWarnError
(
'收藏成功'
);
loger
.
log
(
'收藏数据信息'
,
_data
)
}
})
}
_collectYesHandler
(
evt
){
let
that
=
this
;
let
status
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
let
id
=
$
(
'#lanclassBox'
).
attr
(
'data'
);
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/studentMeeting/updateStudentMeetingBySite/'
+
id
;
let
data
=
{
status
:
7
}
this
.
detailPage
(
_url
,
data
,
function
(
_data
){
if
(
_data
&&
_data
.
code
==
200
){
that
.
_collectYesClick
();
ErrorApe
.
showWarnError
(
'取消收藏'
);
loger
.
log
(
'收藏数据信息'
,
_data
)
}
})
}
detailPage
(
url
,
data
,
callback
){
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
timeout
:
5000
,
data
:
data
,
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
success
:
function
(
_data
){
//获取我的课程数据
if
(
_data
&&
_data
.
code
==
200
){
if
(
callback
){
callback
(
_data
);
}
}
else
{
if
(
callback
){
callback
(
null
);
}
}
},
error
:
function
(
error
){
if
(
callback
){
callback
(
null
);
}
loger
.
log
(
error
,
'收藏数据获取失败'
)
}
})
}
toLogin
(){
$
(
'#userLoginBox'
).
show
();
}
_collectYesClick
(){
$
(
'#collectYes '
).
hide
();
$
(
'#collectNo '
).
show
();
}
_collectNoClick
(){
$
(
'#collectYes '
).
show
();
$
(
'#collectNo '
).
hide
();
}
//工具类
_format
(
str
,
obj
)
{
return
str
.
replace
(
/
\{(\w
+
)\}
/g
,
function
(
match
,
group
,
index
)
{
return
obj
[
group
];
});
};
}
export
default
CollectApe
;
\ No newline at end of file
...
...
src/ape/CreateClassApe.js
查看文件 @
9060a56
...
...
@@ -256,7 +256,7 @@ class CreateClassApe extends Ape {
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/meeting/createMeeting'
;
//let userName = window.localStorage.getItem('loginName');
let
userType
=
window
.
localStorage
.
getItem
(
'userType'
);
dateList
.
siteId
=
'networkschool'
;
dateList
.
siteId
=
ClassDataProxy
.
siteId
;
dateList
.
userId
=
'123'
;
// dateList.userName = userName;
dateList
.
userType
=
userType
;
...
...
src/ape/HomeApe.js
查看文件 @
9060a56
...
...
@@ -7,7 +7,7 @@ import Ape from "./Ape";
import
$
from
"jquery"
;
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
import
MessageTypes
from
"../MessageTypes"
;
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
id
=
"{_id}"
>
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
<
p
class
=
"curriculumListTit"
>
{
_classroomTitle
}
<
/p
>
<
p
class
=
"curriculumListInfo"
>
...
...
@@ -16,7 +16,7 @@ const classifyList = `<div class="classifyList {_classifyListR}" id="{_id}">
<
/p
>
<
/div>`
;
const
teacherList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"
1"
id
=
"
{_id}"
>
const
teacherList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
<
p
class
=
"curriculumListTit"
>
{
_classroomTitle
}
<
/p
>
<
p
class
=
"curriculumListInfo"
>
...
...
@@ -37,8 +37,12 @@ class HomeApe extends Ape {
}
init
()
{
$
(
'#defaultBtn'
).
on
(
'click'
,
this
.
_lanclassBtnHandler
.
bind
(
this
));
$
(
'#header_list li'
).
on
(
'click'
,
this
.
switchHeaderHandler
.
bind
(
this
));
$
(
'#liveBtnMove'
).
on
(
'click'
,
this
.
liveBtnMoveHandler
.
bind
(
this
));
$
(
'#lanclassBtnMove'
).
on
(
'click'
,
this
.
lanclassBtnMoveHandler
.
bind
(
this
));
$
(
'#teacherBtnMove'
).
on
(
'click'
,
this
.
teacherBtnMoveHandler
.
bind
(
this
));
}
addEvent
()
{
...
...
@@ -46,7 +50,27 @@ class HomeApe extends Ape {
}
isLocalStorage
(){
$
(
'#myCenterBox'
).
hide
();
this
.
detailPage
();
this
.
homeAllDate
();
}
switchHeaderHandler
(
evt
){
$
(
evt
.
currentTarget
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
let
ind
=
$
(
evt
.
target
).
index
();
this
.
_emit
(
MessageTypes
.
SWITCH_HEADER
,
ind
);
}
liveBtnMoveHandler
(){
this
.
switchClass
(
1
);
this
.
_emit
(
MessageTypes
.
SWITCH_HEADER
,
1
);
}
lanclassBtnMoveHandler
(){
this
.
switchClass
(
2
);
this
.
_emit
(
MessageTypes
.
SWITCH_HEADER
,
2
);
}
teacherBtnMoveHandler
(){
this
.
switchClass
(
3
);
this
.
_emit
(
MessageTypes
.
SWITCH_HEADER
,
3
);
}
switchClass
(
ind
){
$
(
'#header_list li'
).
eq
(
ind
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
}
_judgeListPlace
(){
let
i
;
...
...
@@ -57,31 +81,78 @@ class HomeApe extends Ape {
}
}
}
_lanclassBtnHandler
(
evt
){
loger
.
log
(
'首页'
,
ClassDataProxy
.
userType
)
$
(
evt
.
target
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
this
.
studentClick
();
homeAllDate
(){
//直播信息
this
.
liveModule
();
//互动信息
this
.
interactModule
();
//老师信息
this
.
teacherModule
();
}
detailPage
(){
//直播信息
liveModule
(){
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/meeting/getMeeting'
;
let
data
=
{
siteId
:
ClassDataProxy
.
siteId
,
meetingStatus
:
2
}
let
that
=
this
;
this
.
detailPage
(
_url
,
data
,
8
,
1
,
function
(
_data
){
if
(
_data
){
//loger.log('首页直播信息',_data)
that
.
_liveClassData
(
_data
.
returnData
.
data
.
meetingInfo
);
}
})
}
//互动信息
interactModule
(){
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/meeting/getMeeting'
;
let
data
=
{
siteId
:
ClassDataProxy
.
siteId
,
meetingStatus
:
1
}
let
that
=
this
;
this
.
detailPage
(
_url
,
data
,
8
,
1
,
function
(
_data
){
if
(
_data
){
// loger.log('首页互动信息',_data)
that
.
_gainClassData
(
_data
.
returnData
.
data
.
meetingInfo
);
}
})
}
//老师信息
teacherModule
(){
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/users/getUserByUserType'
;
let
data
=
{
siteId
:
ClassDataProxy
.
siteId
,
userType
:
1
}
let
that
=
this
;
this
.
detailPage
(
_url
,
data
,
8
,
1
,
function
(
_data
){
if
(
_data
){
// loger.log('首页老师信息',_data)
that
.
_teacherDate
(
_data
.
returnData
.
data
.
users
);
}
})
}
detailPage
(
url
,
data
,
num
,
ind
,
callback
){
let
that
=
this
;
$
.
ajax
({
type
:
"POST"
,
url
:
_url
,
data
:{
siteId
:
ClassDataProxy
.
siteId
},
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
url
:
url
,
timeout
:
5000
,
data
:
data
,
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
pageno
:
num
,
page
:
ind
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
success
:
function
(
_data
){
// loger.log(_data,'成功')
//获取课堂数据
//获取我的课程数据
if
(
_data
&&
_data
.
code
==
200
){
that
.
_gainClassData
(
_data
.
returnData
.
data
);
if
(
callback
){
callback
(
_data
);
}
}
else
{
if
(
callback
){
callback
(
null
);
}
}
},
error
:
function
(
error
){
//alert('首页数据获取失败')
that
.
_gainClassDataErr
();
console
.
log
(
error
,
'首页数据获取失败'
)
//alert('直播数据获取失败')
if
(
callback
){
callback
(
null
);
}
loger
.
log
(
error
,
'直播数据获取失败'
)
}
})
}
...
...
@@ -94,51 +165,68 @@ class HomeApe extends Ape {
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
}
_
gain
ClassData
(
_data
){
_
live
ClassData
(
_data
){
let
liveList
=
$
(
'#liveList'
);
let
lanclassList
=
$
(
'#lanclassList'
);
let
teacherIntro
=
$
(
'#teacherIntro'
);
liveList
.
empty
();
lanclassList
.
empty
();
teacherIntro
.
empty
();
if
(
_data
){
let
_dataList
=
_data
.
meetingInfo
;
//直播互动
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
){
if
(
i
<
8
){
let
j
=
(
i
%
4
)
==
3
;
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_data
List
[
i
].
beginTime
,
_dataList
[
i
].
endTime
)
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_data
[
i
].
beginTime
,
_data
[
i
].
endTime
)
let
_classifyList
=
this
.
_format
(
classifyList
,{
_classifyListR
:
j
?
'classifyListR'
:
''
,
_id
:
_data
List
[
i
].
id
,
_id
:
_data
[
i
].
id
,
_msgImg
:
'../images/u373.png'
,
_classroomTitle
:
_data
List
[
i
].
meetingName
,
_classroomTitle
:
_data
[
i
].
meetingName
,
_schoolTime
:
_getTime
,
_subscribeNum
:
_data
List
[
i
].
reservationNumber
+
'人预约'
_subscribeNum
:
_data
[
i
].
reservationNumber
+
'人预约'
})
liveList
.
append
(
_classifyList
);
lanclassList
.
append
(
_classifyList
);
}
}
//老师
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
}
}
_gainClassData
(
_data
){
let
lanclassList
=
$
(
'#lanclassList'
);
lanclassList
.
empty
();
if
(
_data
){
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
){
if
(
i
<
8
){
let
j
=
(
i
%
4
)
==
3
;
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_dataList
[
i
].
beginTime
,
_dataList
[
i
].
endTime
)
let
_classifyList
=
this
.
_format
(
teacherList
,{
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_data
[
i
].
beginTime
,
_data
[
i
].
endTime
)
let
_classifyList
=
this
.
_format
(
classifyList
,{
_classifyListR
:
j
?
'classifyListR'
:
''
,
_id
:
_data
List
[
i
].
id
,
_id
:
_data
[
i
].
id
,
_msgImg
:
'../images/u373.png'
,
_classroomTitle
:
_data
List
[
i
].
create_user
,
_classroomTitle
:
_data
[
i
].
meetingName
,
_schoolTime
:
_getTime
,
_subscribeNum
:
_data
List
[
i
].
reservationNumber
+
'人预约'
_subscribeNum
:
_data
[
i
].
reservationNumber
+
'人预约'
})
teacherIntro
.
append
(
_classifyList
);
lanclassList
.
append
(
_classifyList
);
}
}
}
}
_teacherDate
(
_data
){
let
teacherIntro
=
$
(
'#teacherIntro'
);
teacherIntro
.
empty
();
if
(
_data
){
for
(
let
i
=
0
;
i
<
_data
.
length
;
i
++
){
let
j
=
(
i
%
4
)
==
3
;
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_data
[
i
].
create_time
,
_data
[
i
].
end_time
)
let
_classifyList
=
this
.
_format
(
teacherList
,{
_classifyListR
:
j
?
'classifyListR'
:
''
,
_id
:
_data
[
i
].
id
,
_msgImg
:
'../images/u373.png'
,
_classroomTitle
:
_data
[
i
].
user_name
,
_schoolTime
:
_getTime
.
split
(
'-'
)[
0
],
_subscribeNum
:
_data
[
i
].
reservationNumber
+
'人预约'
})
teacherIntro
.
append
(
_classifyList
);
}
}
}
_gainClassDataErr
(){
let
liveList
=
$
(
'#liveList'
);
let
lanclassList
=
$
(
'#lanclassList'
);
...
...
src/ape/LanclassApe.js
查看文件 @
9060a56
...
...
@@ -8,7 +8,7 @@ import $ from "jquery";
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
let
loger
=
Loger
.
getLoger
(
'PC-LanclassApe'
);
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
id
=
"{_id}"
>
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
<
p
class
=
"curriculumListTit"
>
{
_classroomTitle
}
<
/p
>
<
p
class
=
"curriculumListInfo"
>
...
...
@@ -20,7 +20,6 @@ const classifyList = `<div class="classifyList {_classifyListR}" id="{_id}">
class
LanclassApe
extends
Ape
{
constructor
()
{
super
();
this
.
classDateList
=
{};
//课堂的所有数据
this
.
addEvent
();
this
.
init
();
}
...
...
@@ -30,10 +29,7 @@ class LanclassApe extends Ape {
this
.
_judgeListPlace
();
$
(
'#collectYes'
).
hide
();
$
(
'#lanclassBtn'
).
on
(
'click'
,
this
.
_lanclassBtnHandler
.
bind
(
this
));
//互动课堂
$
(
'#lanclassBtnMove'
).
on
(
'click'
,
this
.
_lanclassBtnHandler
.
bind
(
this
));
//互动课堂
$
(
'#classifyListBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
$
(
'#lanclassPageBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
}
addEvent
()
{
...
...
@@ -41,21 +37,16 @@ class LanclassApe extends Ape {
}
_judgeListPlace
(){
let
i
=
(
i
%
4
);
$
(
'#
classifyList
Content'
).
find
(
'.classifyList'
).
eq
(
i
==
3
).
addClass
(
'classifyListR'
);
$
(
'#
lanclass
Content'
).
find
(
'.classifyList'
).
eq
(
i
==
3
).
addClass
(
'classifyListR'
);
}
_lanclassBtnHandler
(
evt
){
this
.
_clearListContent
();
this
.
_showLoadingImg
();
loger
.
log
(
'直播'
,
ClassDataProxy
.
userType
)
let
_ele
=
$
(
evt
.
target
);
if
(
_ele
.
attr
(
'data'
)){
$
(
'.header_listMsg'
).
eq
(
_ele
.
attr
(
'data'
)).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
}
$
(
evt
.
target
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
isLocalStorage
(){
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'.curriculumBox'
).
hide
();
$
(
'#classifyListBox'
).
show
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
show
();
$
(
'#teacherIntroAllBox'
).
hide
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
...
...
@@ -76,15 +67,13 @@ class LanclassApe extends Ape {
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
,
},
data
:{
siteId
:
ClassDataProxy
.
siteId
},
success
:
function
(
_data
){
if
(
_data
!=
200
){
// loger.warn(_data.data.msg)
if
(
_data
&&
_data
.
code
==
200
){
//切换列表内容
that
.
_classDateContent
(
_data
.
returnData
.
data
);
loger
.
log
(
_data
,
'成功'
)
}
that
.
classDateList
=
_data
.
returnData
.
data
;
//切换列表内容
that
.
_classDateContent
(
that
.
classDateList
);
loger
.
log
(
_data
,
'成功'
)
},
error
:
function
(
error
){
console
.
log
(
error
,
'失败'
)
...
...
@@ -101,54 +90,46 @@ class LanclassApe extends Ape {
type
:
"POST"
,
url
:
_url
,
timeout
:
5000
,
data
:{
siteId
:
ClassDataProxy
.
siteId
},
data
:{
siteId
:
ClassDataProxy
.
siteId
,
meetingStatus
:
1
},
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
success
:
function
(
_data
){
// loger.log(_data,'成功')
//获取课堂数据
that
.
_gainClassData
(
_data
);
if
(
_data
&&
_data
.
code
==
200
){
that
.
_gainClassData
(
_data
.
returnData
.
data
);
}
},
error
:
function
(
error
){
//alert('互动界面获取数据失败')
that
.
_gainClassDataErr
();
console
.
log
(
error
,
'互动界面获取数据失败'
)
}
})
}
_gainClassData
(
_data
){
if
(
_data
&&
_data
.
code
==
200
){
this
.
classDateList
=
_data
.
returnData
.
data
;
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
//切换列表分类的标题
this
.
_classDateTitle
();
if
(
_data
){
let
lanclassContent
=
$
(
'#lanclassContent'
);
lanclassContent
.
empty
();
//切换列表内容
this
.
_classDateContent
(
this
.
classDateList
);
this
.
_classDateContent
(
_data
);
//页码
this
.
_classDatepageNum
(
this
.
classDateList
);
this
.
_classDatepageNum
(
_data
);
}
}
_classDateTitle
(){
$
(
'#classifyListTitle'
).
html
(
$
(
'.header_listMsgCheck'
).
attr
(
'data'
));
}
//清楚列表数据
_clearListContent
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
classifyListTitle
=
$
(
'#classifyListTitle'
);
classifyListTitle
.
empty
();
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
lanclassContent
=
$
(
'#lanclassContent'
);
lanclassContent
.
empty
();
let
lanclassPageBox
=
$
(
'#lanclassPageBox'
);
lanclassPageBox
.
empty
();
}
//列表显示loading
_showLoadingImg
(){
let
loadingImg
=
`
<
img
class
=
"loadingImg"
src
=
"images/loading.gif"
alt
=
""
>
`
;
$
(
'#
classifyList
Content'
).
append
(
loadingImg
);
$
(
'#
lanclass
Content'
).
append
(
loadingImg
);
}
_classDateContent
(
_data
){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
lanclassContent
=
$
(
'#lanclassContent'
);
lanclassContent
.
empty
();
let
_dataList
=
_data
.
meetingInfo
;
if
(
_dataList
){
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
...
...
@@ -162,7 +143,7 @@ class LanclassApe extends Ape {
_schoolTime
:
_getTime
,
_subscribeNum
:
_dataList
[
i
].
reservationNumber
+
'人预约'
})
classifyList
Content
.
append
(
_classifyList
);
lanclass
Content
.
append
(
_classifyList
);
}
}
}
...
...
@@ -173,33 +154,35 @@ class LanclassApe extends Ape {
this
.
pagingConstruct
(
1
,
_pageNum
);
}
pagingConstruct
(
paging
,
total
){
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
lanclassPageBox
=
$
(
'#lanclassPageBox'
);
lanclassPageBox
.
empty
();
let
pagingDivInnerHTML
=
'<div class="pageNumContent">'
;
let
isHiddenExist
=
0
;
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
i
<
4
||
i
<
(
paging
+
4
)
&&
i
>
(
paging
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
2
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
if
(
total
>
1
){
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
if
(
i
<
4
||
i
<
(
paging
+
3
)
&&
i
>
(
paging
-
2
)
||
i
>
(
total
/
2
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
3
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
}
}
}
}
}
pagingDivInnerHTML
+=
'</div>'
;
pageNumContent
Box
.
append
(
pagingDivInnerHTML
);
lanclassPage
Box
.
append
(
pagingDivInnerHTML
);
}
_gainClassDataErr
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
lanclassContent
=
$
(
'#lanclassContent'
);
lanclassContent
.
empty
();
let
_classifyList
=
'<div class="dataErrorTitle">数据获取失败~</div>'
classifyList
Content
.
append
(
_classifyList
)
lanclass
Content
.
append
(
_classifyList
)
}
//工具类
_format
(
str
,
obj
)
{
...
...
src/ape/ListDetailsApe.js
查看文件 @
9060a56
...
...
@@ -18,9 +18,14 @@ class ListDetailsApe extends Ape {
}
init
()
{
$
(
'#themeBox '
).
on
(
'click'
,
'.classifyList'
,
this
.
_curriculumListHandler
.
bind
(
this
));
//详情页
$
(
'#collectYes '
).
on
(
'click'
,
this
.
_collectYesHandler
.
bind
(
this
));
$
(
'#collectNo '
).
on
(
'click'
,
this
.
_collectNoHandler
.
bind
(
this
));
$
(
'#liveContentAllBox '
).
on
(
'click'
,
'.classifyList'
,
this
.
_curriculumListHandler
.
bind
(
this
));
//直播详情页
$
(
'#liveListBox '
).
on
(
'click'
,
'.classifyList'
,
this
.
_curriculumListHandler
.
bind
(
this
));
//首页 进入 直播详情页
$
(
'#lanclassAllBox '
).
on
(
'click'
,
'.classifyList'
,
this
.
_curriculumListHandler
.
bind
(
this
));
//互动详情页
$
(
'#lanclassList '
).
on
(
'click'
,
'.classifyList'
,
this
.
_curriculumListHandler
.
bind
(
this
));
//首页 进入 互动详情页
$
(
'#teacherIntroAllBox '
).
on
(
'click'
,
'.classifyList'
,
this
.
_teacherInfoHandler
.
bind
(
this
));
//老师详情页
$
(
'#teacherIntro '
).
on
(
'click'
,
'.classifyList'
,
this
.
_teacherInfoHandler
.
bind
(
this
));
//首页 进入 老师详情页
}
addEvent
()
{
...
...
@@ -34,73 +39,120 @@ class ListDetailsApe extends Ape {
$
(
'#orderBtn'
).
css
(
'background'
,
'#3498db'
)
}
this
.
commonalityClass
();
$
(
'#slideshow'
).
hide
();
let
_id
=
evt
.
currentTarget
.
id
;
let
_id
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
this
.
_id
=
_id
;
let
isDate
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
this
.
isDate
=
isDate
;
this
.
detailPage
(
_id
);
this
.
classInfoDetail
(
_id
);
}
_collectYesHandler
(){
$
(
'#collectYes '
).
hide
();
$
(
'#collectNo '
).
show
();
commonalityClass
(){
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
}
_collectNoHandler
(){
$
(
'#collectYes '
).
show
();
$
(
'#collectNo '
).
hide
();
_teacherInfoHandler
(
evt
){
this
.
commonalityClass
();
let
_id
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
this
.
_id
=
_id
;
this
.
teacherInfoDetail
(
_id
);
}
detailPage
(
_id
){
classInfoDetail
(
_id
){
let
that
=
this
;
let
signInfo
=
{
let
data
=
{
id
:
_id
,
siteId
:
'markettest'
siteId
:
ClassDataProxy
.
siteId
}
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/meeting/getMeeting'
;
this
.
detailPage
(
_url
,
data
,
function
(
_data
){
if
(
_data
){
that
.
_gainClassData
(
_data
.
returnData
.
data
);
}
})
}
teacherInfoDetail
(
_id
){
let
that
=
this
;
let
data
=
{
id
:
_id
,
siteId
:
ClassDataProxy
.
siteId
,
userType
:
1
}
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/users/getUserByUserType'
;
this
.
detailPage
(
_url
,
data
,
function
(
_data
){
if
(
_data
){
that
.
_classDateContent
(
_data
.
returnData
.
data
);
}
})
}
detailPage
(
url
,
data
,
callback
){
$
.
ajax
({
type
:
"post"
,
url
:
_url
,
type
:
"POST"
,
url
:
url
,
timeout
:
5000
,
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
data
:
signInfo
,
data
:
data
,
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
success
:
function
(
_data
){
//获取
课堂
数据
//获取
我的课程
数据
if
(
_data
&&
_data
.
code
==
200
){
that
.
_gainClassData
(
_data
);
if
(
callback
){
callback
(
_data
);
}
}
else
{
if
(
callback
){
callback
(
null
);
}
}
},
error
:
function
(
error
){
console
.
log
(
error
,
'失败'
)
//alert('直播数据获取失败')
if
(
callback
){
callback
(
null
);
}
loger
.
log
(
error
,
'直播数据获取失败'
)
}
})
}
_gainClassData
(
_data
){
//切换列表内容
this
.
_classDateContent
(
_data
.
returnData
.
data
);
let
_dataList
=
_data
.
meetingInfo
;
if
(
_dataList
){
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
let
item
=
_dataList
[
i
];
if
(
item
.
id
==
this
.
_id
){
this
.
_liveRender
(
item
);
loger
.
log
(
'课堂信息桑心'
,
item
)
}
}
}
}
_classDateContent
(
_data
){
let
_dataList
=
_data
.
meetingInfo
[
0
];
if
(
this
.
isDate
){
this
.
_lanclassRender
(
_dataList
);
}
else
{
this
.
_liveRender
(
_dataList
);
let
teacherList
=
_data
.
users
;
if
(
teacherList
){
for
(
let
i
=
0
;
i
<
teacherList
.
length
;
i
++
){
let
item
=
teacherList
[
i
];
if
(
item
.
id
==
this
.
_id
){
this
.
_lanclassRender
(
item
);
}
}
}
$
(
'#classifyListBox'
).
hide
();
}
//
互动课堂
//
老师
_lanclassRender
(
_dataList
){
$
(
'#defaultBox'
).
hide
();
$
(
'.curriculumBox'
).
hide
();
$
(
'#teacherDetailBox'
).
show
();
$
(
'#teacherDetailBox'
).
attr
(
'data'
,
this
.
_id
);
$
(
'#teacherDetailInfoImg'
).
attr
(
'src'
,
'images/u293.png'
);
//老师授课标题图片
$
(
'#teacherDetailInfoDetailName'
).
text
(
_dataList
.
user
N
ame
);
//老师名字
$
(
'#teacherDetailInfoDetailName'
).
text
(
_dataList
.
user
_n
ame
);
//老师名字
$
(
'#teacherDetailInfoDetailSex'
).
text
();
//老师性别
$
(
'#teacherDetailInfoDetailPoint'
).
text
();
//老师专长
$
(
'#teacherDetailInfoDetailAge'
).
text
(
_dataList
.
capacity
+
'年'
);
//老师教龄
$
(
'#teacherDetailInfoDetailAge'
).
text
(
3
+
'年'
);
//老师教龄
$
(
'#teacherDetailInfoDetailGrade'
).
text
();
//老师评分
$
(
'#teacherDetailReferralContent'
).
text
();
//老师授课内容
$
(
'#teacherDetailPost'
).
text
();
//老师职称
...
...
@@ -111,7 +163,7 @@ class ListDetailsApe extends Ape {
$
(
'#teacherDetailSynopsis'
).
text
();
//老师授课简介
}
//
直播
课堂
//课堂
_liveRender
(
_dataList
){
$
(
'#defaultBox'
).
hide
();
$
(
'.curriculumBox'
).
hide
();
...
...
@@ -121,6 +173,7 @@ class ListDetailsApe extends Ape {
$
(
'#lanclassContentTitle'
).
text
(
_dataList
.
meetingName
);
//老师授课标题
$
(
'#lanclassContentInfoPortrait'
).
text
();
//老师授课老师头像
$
(
'#lanclassContentInfoName'
).
text
(
_dataList
.
create_user
);
//老师授课老师名字
$
(
'#teacherInfoName'
).
text
(
_dataList
.
create_user
);
//老师授课老师名字
$
(
'#lanclassContentInfoTimeStart'
).
text
(
_dataList
.
createTime
);
//老师授课开始时间
$
(
'#lanclassContentInfoTimeEnd'
).
text
(
_dataList
.
endTime
);
//老师授课结束时间
$
(
'#collectYes'
);
//老师授课是否收藏
...
...
src/ape/LiveClassApe.js
查看文件 @
9060a56
...
...
@@ -6,9 +6,9 @@ import Loger from "../Loger";
import
Ape
from
"./Ape"
;
import
$
from
"jquery"
;
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
let
loger
=
Loger
.
getLoger
(
'PC-L
anc
lassApe'
);
let
loger
=
Loger
.
getLoger
(
'PC-L
iveC
lassApe'
);
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
id
=
"{_id}"
>
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
<
p
class
=
"curriculumListTit"
>
{
_classroomTitle
}
<
/p
>
<
p
class
=
"curriculumListInfo"
>
...
...
@@ -17,10 +17,9 @@ const classifyList = `<div class="classifyList {_classifyListR}" id="{_id}">
<
/p
>
<
/div>`
;
class
L
anc
lassApe
extends
Ape
{
class
L
iveC
lassApe
extends
Ape
{
constructor
()
{
super
();
this
.
classDateList
=
{};
//课堂的所有数据
this
.
addEvent
();
this
.
init
();
}
...
...
@@ -30,10 +29,7 @@ class LanclassApe extends Ape {
this
.
_judgeListPlace
();
$
(
'#collectYes'
).
hide
();
$
(
'#liveBtn'
).
on
(
'click'
,
this
.
_lanclassBtnHandler
.
bind
(
this
));
//直播课堂
$
(
'#liveBtnMove'
).
on
(
'click'
,
this
.
_lanclassBtnHandler
.
bind
(
this
));
//直播课堂
$
(
'#classifyListBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
$
(
'#livePageBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
}
addEvent
()
{
...
...
@@ -41,20 +37,16 @@ class LanclassApe extends Ape {
}
_judgeListPlace
(){
let
i
=
(
i
%
4
);
$
(
'#
classifyList
Content'
).
find
(
'.classifyList'
).
eq
(
i
==
3
).
addClass
(
'classifyListR'
);
$
(
'#
live
Content'
).
find
(
'.classifyList'
).
eq
(
i
==
3
).
addClass
(
'classifyListR'
);
}
_lanclassBtnHandler
(
evt
){
this
.
_clearListContent
();
this
.
_showLoadingImg
();
loger
.
log
(
'互动'
,
ClassDataProxy
.
userType
)
let
_ele
=
$
(
evt
.
target
);
if
(
_ele
.
attr
(
'data'
)){
$
(
'.header_listMsg'
).
eq
(
_ele
.
attr
(
'data'
)).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
}
$
(
evt
.
target
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
isLocalStorage
(){
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'#classifyListBox'
).
show
();
$
(
'#liveContentAllBox'
).
show
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
...
...
@@ -77,13 +69,11 @@ class LanclassApe extends Ape {
},
data
:{
siteId
:
ClassDataProxy
.
siteId
},
success
:
function
(
_data
){
if
(
_data
!=
200
){
// loger.warn(_data.data.msg)
}
that
.
classDateList
=
_data
.
returnData
.
data
;
//切换列表内容
that
.
_classDateContent
(
that
.
classDateList
);
loger
.
log
(
_data
,
'成功'
)
if
(
_data
&&
_data
.
code
==
200
){
that
.
_classDateContent
(
_data
.
returnData
.
data
);
loger
.
log
(
_data
,
'成功'
)
}
},
error
:
function
(
error
){
//alert('直播翻页数据获取失败')
...
...
@@ -101,13 +91,15 @@ class LanclassApe extends Ape {
type
:
"POST"
,
url
:
_url
,
timeout
:
5000
,
data
:{
siteId
:
ClassDataProxy
.
siteId
},
data
:{
siteId
:
ClassDataProxy
.
siteId
,
meetingStatus
:
2
},
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
success
:
function
(
_data
){
// loger.log(_data,'成功')
//获取课堂数据
that
.
_gainClassData
(
_data
);
if
(
_data
&&
_data
.
code
==
200
){
that
.
_gainClassData
(
_data
.
returnData
.
data
);
}
},
error
:
function
(
error
){
//alert('直播数据获取失败')
...
...
@@ -117,44 +109,36 @@ class LanclassApe extends Ape {
})
}
_gainClassData
(
_data
){
if
(
_data
&&
_data
.
code
==
200
){
this
.
classDateList
=
_data
.
returnData
.
data
;
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
//切换列表分类的标题
this
.
_classDateTitle
();
if
(
_data
){
let
liveContent
=
$
(
'#liveContent'
);
liveContent
.
empty
();
//切换列表内容
this
.
_classDateContent
(
this
.
classDateList
);
this
.
_classDateContent
(
_data
);
//页码
this
.
_classDatepageNum
(
this
.
classDateList
);
this
.
_classDatepageNum
(
_data
);
}
}
_gainClassDataErr
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
liveContent
=
$
(
'#liveContent'
);
liveContent
.
empty
();
let
_classifyList
=
'<div class="dataErrorTitle">数据获取失败~</div>'
classifyListContent
.
append
(
_classifyList
)
}
_classDateTitle
(){
$
(
'#classifyListTitle'
).
html
(
$
(
'.header_listMsgCheck'
).
attr
(
'data'
));
liveContent
.
append
(
_classifyList
)
}
//清楚列表数据
_clearListContent
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
classifyListTitle
=
$
(
'#classifyListTitle'
);
classifyListTitle
.
empty
();
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
liveContent
=
$
(
'#liveContent'
);
liveContent
.
empty
();
let
livePageBox
=
$
(
'#livePageBox'
);
livePageBox
.
empty
();
}
//列表显示loading
_showLoadingImg
(){
let
loadingImg
=
`
<
img
class
=
"loadingImg"
src
=
"images/loading.gif"
alt
=
""
>
`
;
$
(
'#
classifyListContent
'
).
append
(
loadingImg
);
$
(
'#
livePageBox
'
).
append
(
loadingImg
);
}
_classDateContent
(
_data
){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
liveContent
=
$
(
'#liveContent'
);
liveContent
.
empty
();
let
_dataList
=
_data
.
meetingInfo
;
if
(
_dataList
){
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
...
...
@@ -168,7 +152,7 @@ class LanclassApe extends Ape {
_schoolTime
:
_getTime
,
_subscribeNum
:
_dataList
[
i
].
reservationNumber
+
'人预约'
})
classifyList
Content
.
append
(
_classifyList
);
live
Content
.
append
(
_classifyList
);
}
}
}
...
...
@@ -179,27 +163,29 @@ class LanclassApe extends Ape {
this
.
pagingConstruct
(
1
,
_pageNum
);
}
pagingConstruct
(
paging
,
total
){
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
livePageBox
=
$
(
'#livePageBox'
);
livePageBox
.
empty
();
let
pagingDivInnerHTML
=
'<div class="pageNumContent">'
;
let
isHiddenExist
=
0
;
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
i
<
4
||
i
<
(
paging
+
4
)
&&
i
>
(
paging
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
2
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
if
(
total
>
1
){
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
if
(
i
<
4
||
i
<
(
paging
+
3
)
&&
i
>
(
paging
-
2
)
||
i
>
(
total
/
2
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
3
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
}
}
}
}
}
pagingDivInnerHTML
+=
'</div>'
;
pageNumContent
Box
.
append
(
pagingDivInnerHTML
);
livePage
Box
.
append
(
pagingDivInnerHTML
);
}
//工具类
_format
(
str
,
obj
)
{
...
...
@@ -208,4 +194,4 @@ class LanclassApe extends Ape {
});
};
}
export
default
LanclassApe
;
\ No newline at end of file
export
default
LiveClassApe
;
\ No newline at end of file
...
...
src/ape/MyCenterApe.js
查看文件 @
9060a56
...
...
@@ -114,6 +114,9 @@ class MyCenterApe extends Ape {
$('#teacherUI li').on('click',this._recordLiHandler.bind(this));//课堂分类
$('#teacherInfoList li').on('click',this._teacherInfoListHandler.bind(this));//直播分类 正在直播 未开始 已结束
$('#studentInfoList li').on('click',this._studentInfoListHandler.bind(this));//首页 学生 待学习 已学完 收藏
$('#courseInfoList li').on('click',this._courseInfoListHandler.bind(this));//我的课程 学生 待学习 已学完 收藏
$('#subscribeList .liveInfoLeftLi').on('click',this._subscribeListHandler.bind(this));//课程 老师
$('#updateInputYes').on('click',this._updateInputYesHandler.bind(this));//确定时把输入的信息存入数据中
...
...
@@ -150,6 +153,8 @@ class MyCenterApe extends Ape {
$('#teacherCorrelatedInfo').on('click','.teachercourseImg',this._teacherClassDetails.bind(this));//点击进入老师课堂详情页
$('#teacherMyCerterHomePage').on('click',this._homePageHandler.bind(this));//首页
$('#teacherMyCerterUpPage').on('click',this._upPageHandler.bind(this));//上页
$('#teacherMyCerterDownPage').on('click',this._downPageHandler.bind(this));//下页
...
...
@@ -249,13 +254,14 @@ class MyCenterApe extends Ape {
}
})
}
_studentCurriculumInfo(num,callback){
_studentCurriculumInfo(
data,
num,callback){
let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/getStudentMeetingByStudentId/'+ClassDataProxy.id;
let that = this;
$.ajax({
type: "
GET
",
url: _url,
timeout:5000,
data:data,
headers: {siteId:ClassDataProxy.siteId,pageno:num,id:ClassDataProxy.id,
'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'},
success:function(_data){
...
...
@@ -289,9 +295,25 @@ class MyCenterApe extends Ape {
}
detailPageStudent(){
//首页课程
this._studentCourseModule();
//首页显示信息
this._studentStudyModule();
let ind = $('#studentInfoList .liveInfoLeftLiCheck').attr('data');
let studentMyCenterContentList = $('#studentMyCenterContentList');
switch (parseInt(ind)){
case 0:
//待学习
this._studentStudyModule(studentMyCenterContentList);
break;
case 1:
//已学完
this._studentStudyOverModule(studentMyCenterContentList);
break;
case 2:
//收藏
this._studenTcollectModule(studentMyCenterContentList);
break;
default:
return;
}
}
isLocalStorage(){
...
...
@@ -363,11 +385,25 @@ class MyCenterApe extends Ape {
this.detailPageStudent();
}
}
_teacherInfoListHandler(evt){
//切换类的公用样式
commonality(evt){
$(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck');
}
_teacherInfoListHandler(evt){
this.commonality(evt);
}
//学生端 首页
_studentInfoListHandler(evt){
this.commonality(evt);
this.detailPageStudent();
}
//学生端 我的课程
_courseInfoListHandler(evt){
this.commonality(evt);
this.studentCourses();
}
_subscribeListHandler(evt){
$(evt.currentTarget).addClass('liveInfoLeftLiCheck').siblings().removeClass('liveInfoLeftLiCheck'
);
this.commonality(evt
);
this.studentBookings();
}
/*-------------------老师-------------------*/
...
...
@@ -496,7 +532,7 @@ class MyCenterApe extends Ape {
/*---------------------------学生-----------------------*/
_studentCourseModule(){
let that = this;
this._studentCurriculumInfo(3,function(_data){
this._studentCurriculumInfo(
{},
3,function(_data){
that.studentCourseList(_data.returnData.data);
})
}
...
...
@@ -508,12 +544,13 @@ class MyCenterApe extends Ape {
if(_data) {
for (let i = 0; i < _data.length; i++) {
let item = _data[i];
let timer = ClassDataProxy.getTimeCountDown(item.meetingBeginTime)
if (item) {
let curInfo = this._format(curriculumList, {
_infoTit: item.meeting_name,
_meetingNumber: item.meetingNumber,
_countDown: that.loadMeeting(item),
_isShow: (that.loadMeeting(item) == '已开始') ? 'block' : 'none'
_countDown:timer ,
_isShow: (timer == '已结束') ? 'none' : 'block'
})
myCurriculumInfo.append(curInfo);
} else {
...
...
@@ -524,36 +561,100 @@ class MyCenterApe extends Ape {
}
}
}
_studentStudyModule(){
let that = this;
this._studentCurriculumInfo(4,function(_data){
that.studentStudyList(_data.returnData.data);
_studentStudyModule(studentMyCenterContentList){
let that = this;
this._studentCurriculumInfo({},4,function(_data){
if(_data){
that.studentStudyList(studentMyCenterContentList,_data.returnData.data);
}
})
}
studentStudyList(_data){
let studentMyCenterContentList = $('#studentMyCenterContentList');
studentStudyList(studentMyCenterContentList,_data){
studentMyCenterContentList.empty();
$('#courseMinutePageBox').hide();
for(let i = 0;i<_data.length;i++){
if(_data[i]){
if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){
let j = (i%4)==3;
let _classifyList = this._format(classifyList,{
_classifyListR : j?'classifyListR':'',
_isShowTitle : 'none',
_meetingNumber : _data[i].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : _data[i].meeting_name,
_create_user : _data[i].teacherName,
_liveTimer : _data[i].meetingBeginTime.split(' ')[0]
})
studentMyCenterContentList.append(_classifyList)
}
}else{
console.error('_gainClassData没数据')
}
}
}
//已学完
_studentStudyOverModule(studentMyCenterContentList){
let that = this;
this._studentCurriculumInfo({},4,function(_data){
that.studentStudyOverList(studentMyCenterContentList,_data.returnData.data);
})
}
studentStudyOverList(studentMyCenterContentList,_data){
studentMyCenterContentList.empty();
$('#courseMinutePageBox').hide();
for(let i = 0;i<_data.length;i++){
if(_data[i]){
let j = (i%4)==3;
let _classifyList = this._format(classifyList,{
_classifyListR : j?'classifyListR':'',
_isShowTitle : 'none',
_meetingNumber : _data[i].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : _data[i].meeting_name,
_create_user : _data[i].teacherName,
_liveTimer : _data[i].meetingBeginTime.split(' ')[0]
})
studentMyCenterContentList.append(_classifyList)
if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){
let j = (i%4)==3;
let _classifyList = this._format(classifyList,{
_classifyListR : j?'classifyListR':'',
_isShowTitle : 'none',
_meetingNumber : _data[i].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : _data[i].meeting_name,
_create_user : _data[i].teacherName,
_liveTimer : _data[i].meetingBeginTime.split(' ')[0]
})
studentMyCenterContentList.append(_classifyList)
}
}else{
console.error('_gainClassData没数据')
}
}
}
_studenTcollectModule(studentMyCenterContentList){
let that = this;
this._studentCurriculumInfo({},4,function(_data){
that.studentTcollectList(studentMyCenterContentList,_data.returnData.data);
})
}
studentTcollectList(studentMyCenterContentList,_data){
studentMyCenterContentList.empty();
$('#courseMinutePageBox').hide();
/* for(let i = 0;i<_data.length;i++){
if(_data[i]){
if(!ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){
let j = (i%4)==3;
let _classifyList = this._format(classifyList,{
_classifyListR : j?'classifyListR':'',
_isShowTitle : 'none',
_meetingNumber : _data[i].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : _data[i].meeting_name,
_create_user : _data[i].teacherName,
_liveTimer : _data[i].meetingBeginTime.split(' ')[0]
})
studentMyCenterContentList.append(_classifyList)
}
}else{
console.error('_gainClassData没数据')
}
}*/
}
//提交用户信息修改
_accountInfoSaveBtnHandler(){
let id = ClassDataProxy.id;//id
...
...
@@ -651,7 +752,7 @@ class MyCenterApe extends Ape {
studentBookings(){
let that = this;
let data = $('#subscribeList').find('.liveInfoLeftLiCheck').attr('data');
this._studentCurriculumInfo(12,function(_data){
this._studentCurriculumInfo(
{},
12,function(_data){
if(_data){
if(data == '1'){
that._studentSubscribeTeacher(_data.returnData.data)
...
...
@@ -738,13 +839,202 @@ class MyCenterApe extends Ape {
that._teacherCourse(_data.returnData.data);
})
}
//学生端 我的课程 切换
studentCourses(){
let ind = $('#courseInfoList .liveInfoLeftLiCheck').attr('data');
let courseMinuteList = $('#courseMinuteList');
switch (parseInt(ind)){
case 0:
//待学习
this.studentFutureModule(courseMinuteList);
break;
case 1:
//已学完
this.studentFormerlyModule(courseMinuteList);
break;
case 2:
//收藏
this.studentCollectModule(courseMinuteList);
break;
default:
return;
}
}
//学生端 我的课程 待学习
studentFutureModule(courseMinuteList){
let that = this;
this._studentCurriculumInfo(12,function(_data){
this._studentCurriculumInfo(
{},
12,function(_data){
if(_data){
that._studentCourseRender(_data.returnData.data)
that._studentCourseRender(
courseMinuteList,
_data.returnData.data)
}
});
}
//学生端课程数据 待学习
_studentCourseRender(courseMinuteList,_data){
courseMinuteList.empty();
let count = _data.count;
let page = _data.page;
let pageno = _data.pageno;
let pagenum = Math.ceil(count / pageno);
let _dataList = _data;
this.pageNo = pagenum;
$('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录');
if(count <= 12){
$('#courseMinutePageBox').hide();
}
//存储数据按日期分类
this.dataList={};
//if(ClassDataProxy.getTimeDay(_data[i].meetingBeginTime)){
for(let i = 0;i<_dataList.length;i++){
let item=_dataList[i];
if(item){
let temp = item.meetingBeginTime.split(' ')[0]
if(!this.dataList[temp]) {
this.dataList[temp] = [];
}
this.dataList[temp].push(item)
}
}
for(let key in this.dataList){
if(ClassDataProxy.getTimeDay(key)){
let arrList = this.dataList[key];
if(arrList){
for(let n = 0;n<arrList.length;n++){
let j = (n%4) == 3;
let _classifyList = this._format(classifyList,{
_classifyListR : j ?'classifyListR':'',
_isShowTitle : n == 0 ?'block':'none',
_meetingNumber : arrList[n].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : arrList[n].meeting_name,
_create_user : arrList[n].teacherName,
_liveTimer : key
})
courseMinuteList.append(_classifyList)
}
}
}
}
}
//学生端 我的课程 已学完
studentFormerlyModule(courseMinuteList){
let that = this;
this._studentCurriculumInfo({},12,function(_data){
if(_data){
that._studentFormerlyRender(courseMinuteList,_data.returnData.data)
}
});
}
//学生端课程数据 已学完
_studentFormerlyRender(courseMinuteList,_data){
courseMinuteList.empty();
let count = _data.count;
let page = _data.page;
let pageno = _data.pageno;
let pagenum = Math.ceil(count / pageno);
let _dataList = _data;
this.pageNo = pagenum;
$('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录');
if(count <= 12){
$('#courseMinutePageBox').hide();
}
//存储数据按日期分类
this.dataList={};
for(let i = 0;i<_dataList.length;i++){
let item=_dataList[i];
if(item){
let temp = item.meetingBeginTime.split(' ')[0]
if(!this.dataList[temp]) {
this.dataList[temp] = [];
}
this.dataList[temp].push(item)
}
}
for(let key in this.dataList){
if(!ClassDataProxy.getTimeDay(key)){
let arrList = this.dataList[key];
if(arrList){
for(let n = 0;n<arrList.length;n++){
let j = (n%4) == 3;
let _classifyList = this._format(classifyList,{
_classifyListR : j ?'classifyListR':'',
_isShowTitle : n == 0 ?'block':'none',
_meetingNumber : arrList[n].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : arrList[n].meeting_name,
_create_user : arrList[n].teacherName,
_liveTimer : key
})
courseMinuteList.append(_classifyList)
}
}
}
}
}
//学生端 我的课程 收藏
studentCollectModule(courseMinuteList){
let that = this;
let data = {}
this._studentCurriculumInfo(data,12,function(_data){
if(_data){
loger.log('显示收藏数据',_data)
that._studentCollectRender(courseMinuteList,_data.returnData.data)
}
});
}
//学生端课程数据 收藏
_studentCollectRender(courseMinuteList,_data){
courseMinuteList.empty();
let count = _data.count;
let page = _data.page;
let pageno = _data.pageno;
let pagenum = Math.ceil(count / pageno);
let _dataList = _data;
this.pageNo = pagenum;
$('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录');
if(count <= 12){
$('#courseMinutePageBox').hide();
}
//存储数据按日期分类
this.dataList={};
for(let i = 0;i<_dataList.length;i++){
let item=_dataList[i];
if(item){
let temp = item.meetingBeginTime.split(' ')[0]
if(!this.dataList[temp]) {
this.dataList[temp] = [];
}
this.dataList[temp].push(item)
}
}
for(let key in this.dataList){
if(!ClassDataProxy.getTimeDay(key)){
let arrList = this.dataList[key];
if(arrList){
for(let n = 0;n<arrList.length;n++){
let j = (n%4) == 3;
let _classifyList = this._format(classifyList,{
_classifyListR : j ?'classifyListR':'',
_isShowTitle : n == 0 ?'block':'none',
_meetingNumber : arrList[n].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : arrList[n].meeting_name,
_create_user : arrList[n].teacherName,
_liveTimer : key
})
// courseMinuteList.append(_classifyList)
}
}
}
}
}
//老师端首页显示课程
_teacherHomeCourse(_data){
...
...
@@ -854,53 +1144,7 @@ class MyCenterApe extends Ape {
}
}
}
//学生端课程数据
_studentCourseRender(_data){
let courseMinuteList = $('#courseMinuteList');
courseMinuteList.empty();
let count = _data.count;
let page = _data.page;
let pageno = _data.pageno;
let pagenum = Math.ceil(count / pageno);
let _dataList = _data;
this.pageNo = pagenum;
$('#courseMinutePageMsg').html('第'+page+'页/共'+pagenum+'页,有'+count+'个记录');
if(count <= 12){
$('#courseMinutePageBox').hide();
}
//存储数据按日期分类
this.dataList={};
for(let i = 0;i<_dataList.length;i++){
let item=_dataList[i];
if(item){
let temp = item.meetingBeginTime.split(' ')[0]
if(!this.dataList[temp]) {
this.dataList[temp] = [];
}
this.dataList[temp].push(item)
}
}
for(let key in this.dataList){
let arrList = this.dataList[key];
if(arrList){
for(let n = 0;n<arrList.length;n++){
let j = (n%4) == 3;
let _classifyList = this._format(classifyList,{
_classifyListR : j ?'classifyListR':'',
_isShowTitle : n == 0 ?'block':'none',
_meetingNumber : arrList[n].meetingNumber,
_msgImg : '../images/u373.png',
_meetingName : arrList[n].meeting_name,
_create_user : arrList[n].teacherName,
_liveTimer : key
})
courseMinuteList.append(_classifyList)
}
}
}
}
//修改密码
_accountPassWordBtnHandler(){
this.data = 0;
...
...
@@ -1030,6 +1274,7 @@ class MyCenterApe extends Ape {
}
}
}
//取消预约
_cancelSubscribeHandler(evt){
let _id = $(evt.target).attr('data');
let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/studentMeeting/updateStudentMeetingBySite/'+_id;
...
...
src/ape/SubscribeApe.js
查看文件 @
9060a56
...
...
@@ -21,9 +21,6 @@ class SubscribeApe extends Ape {
init
()
{
$
(
'#lanclassContentApply'
).
on
(
'click'
,
this
.
_lanclassContentApplyHandler
.
bind
(
this
));
//我要报名
$
(
'#orderBtn'
).
on
(
'click'
,
this
.
_lanclassContentApplyHandler
.
bind
(
this
));
//我要预约
$
(
'#collectYes'
).
on
(
'click'
,
this
.
_lanclassContentApplyHandler
.
bind
(
this
));
//取消收藏
$
(
'#collectNo'
).
on
(
'click'
,
this
.
_lanclassContentApplyHandler
.
bind
(
this
));
//收藏
}
addEvent
()
{
...
...
@@ -51,6 +48,7 @@ class SubscribeApe extends Ape {
if
(
_data
&&
_data
.
code
==
200
){
loger
.
log
(
_data
,
'预约信息'
)
$
(
'#teacherDetailRemindersBox'
).
show
();
that
.
_emit
(
MessageTypes
.
ORDER_FINISH
);
}
else
if
(
_data
.
returnData
.
data
.
msg
==
'您已预约这堂课'
&&
ClassDataProxy
.
loginName
){
ErrorApe
.
showWarnError
(
'您已预约这堂课'
);
}
else
{
...
...
src/ape/TeacherDetailApe.js
查看文件 @
9060a56
...
...
@@ -9,7 +9,7 @@ import ClassDataProxy from "proxy/ClassDataProxy";
let
loger
=
Loger
.
getLoger
(
'PC-TeacherDetailApe'
);
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"
1"
id
=
"
{_id}"
>
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
<
p
class
=
"curriculumListTit"
>
{
_classroomTitle
}
<
/p
>
<
p
class
=
"curriculumListInfo"
>
...
...
@@ -21,8 +21,6 @@ const classifyList = `<div class="classifyList {_classifyListR}" data="1" id="{_
class
TeacherDetailApe
extends
Ape
{
constructor
()
{
super
();
this
.
classDateList
=
{};
//课堂的所有数据
this
.
isLocalStorage
();
this
.
addEvent
();
this
.
init
();
}
...
...
@@ -30,10 +28,7 @@ class TeacherDetailApe extends Ape {
init
()
{
$
(
'#collectYes'
).
hide
();
$
(
'#teacherBtn'
).
on
(
'click'
,
this
.
_teacherBtnHandler
.
bind
(
this
));
//推荐老师
$
(
'#teacherBtnMove'
).
on
(
'click'
,
this
.
_teacherBtnHandler
.
bind
(
this
));
//推荐老师
$
(
'#classifyListBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
$
(
'#teacherIntroPageBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
}
...
...
@@ -41,18 +36,6 @@ class TeacherDetailApe extends Ape {
}
isLocalStorage
(){
if
(
ClassDataProxy
.
userType
==
ClassDataProxy
.
USER_TYPE_1
){
$
(
'#myCenterBox'
).
show
();
}
}
_teacherBtnHandler
(
evt
){
this
.
_clearListContent
();
this
.
_showLoadingImg
();
let
_ele
=
$
(
evt
.
target
);
if
(
_ele
.
attr
(
'data'
)){
$
(
'.header_listMsg'
).
eq
(
_ele
.
attr
(
'data'
)).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
}
$
(
evt
.
target
).
addClass
(
'header_listMsgCheck'
).
siblings
().
removeClass
(
'header_listMsgCheck'
);
this
.
studentClickTeacher
();
//学生点击老师模块
this
.
detailPage
();
}
...
...
@@ -60,7 +43,7 @@ class TeacherDetailApe extends Ape {
_pageNumBtnHandler
(
evt
){
loger
.
log
(
'点击翻页'
)
let
_ele
=
$
(
evt
.
target
);
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/
meeting/getMeeting
'
;
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/
users/getUserByUserType
'
;
let
that
=
this
;
if
(
_ele
.
siblings
().
length
>
0
&&
_ele
.
text
()
!=
'...'
){
_ele
.
addClass
(
'pageNumBtnCheck'
).
siblings
().
removeClass
(
'pageNumBtnCheck'
);
...
...
@@ -72,15 +55,16 @@ class TeacherDetailApe extends Ape {
siteId
:
ClassDataProxy
.
siteId
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
,
},
data
:{
siteId
:
ClassDataProxy
.
siteId
},
data
:{
siteId
:
ClassDataProxy
.
siteId
,
userType
:
1
},
success
:
function
(
_data
){
loger
.
log
(
'点击翻页返回数据'
,
_data
)
if
(
_data
!=
200
){
loger
.
warn
(
_data
.
returnData
.
data
.
msg
)
}
that
.
classDateList
=
_data
.
returnData
.
data
;
//切换列表内容
that
.
_classDateContent
(
that
.
classDateList
);
if
(
_data
&&
_data
.
code
==
200
){
//切换列表内容
that
.
_classDateContent
(
_data
.
returnData
.
data
);
}
},
error
:
function
(
error
){
//alert('老师翻页数据获取失败')
...
...
@@ -93,7 +77,7 @@ class TeacherDetailApe extends Ape {
}
detailPage
(){
let
that
=
this
;
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/
meeting/getMeeting
'
;
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/
users/getUserByUserType
'
;
$
.
ajax
({
type
:
"POST"
,
url
:
_url
,
...
...
@@ -101,11 +85,11 @@ class TeacherDetailApe extends Ape {
headers
:
{
siteId
:
ClassDataProxy
.
siteId
,
userType
:
1
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
data
:{
siteId
:
ClassDataProxy
.
siteId
},
data
:{
siteId
:
ClassDataProxy
.
siteId
,
userType
:
1
},
success
:
function
(
_data
){
//获取课堂数据
if
(
_data
&&
_data
.
code
==
200
){
that
.
_gainClassData
(
_data
);
that
.
_gainClassData
(
_data
.
returnData
.
data
);
}
},
...
...
@@ -117,54 +101,48 @@ class TeacherDetailApe extends Ape {
})
}
_gainClassDataErr
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
teacherIntroContent
=
$
(
'#teacherIntroContent'
);
teacherIntroContent
.
empty
();
let
_classifyList
=
'<div class="dataErrorTitle">数据获取失败~</div>'
classifyList
Content
.
append
(
_classifyList
)
teacherIntro
Content
.
append
(
_classifyList
)
}
//清除列表数据
_clearListContent
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
classifyListTitle
=
$
(
'#classifyListTitle'
);
classifyListTitle
.
empty
();
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
teacherIntroContent
=
$
(
'#teacherIntroContent'
);
teacherIntroContent
.
empty
();
let
teacherIntroPageBox
=
$
(
'#teacherIntroPageBox'
);
teacherIntroPageBox
.
empty
();
}
//列表显示loading
_showLoadingImg
(){
let
loadingImg
=
`
<
img
class
=
"loadingImg"
src
=
"images/loading.gif"
alt
=
""
>
`
;
$
(
'#
classifyList
Content'
).
append
(
loadingImg
);
$
(
'#
teacherIntro
Content'
).
append
(
loadingImg
);
}
_gainClassData
(
_data
){
this
.
classDateList
=
_data
.
returnData
.
data
;
this
.
_clearListContent
();
//切换列表分类的标题
this
.
_classDateTitle
();
//切换列表内容
this
.
_classDateContent
(
this
.
classDateList
);
//页码
this
.
_classDatepageNum
(
this
.
classDateList
);
}
_classDateTitle
(){
$
(
'#classifyListTitle'
).
html
(
$
(
'#teacherTitle'
).
html
());
if
(
_data
){
this
.
_clearListContent
();
//切换列表内容
this
.
_classDateContent
(
_data
);
//页码
this
.
_classDatepageNum
(
_data
);
}
}
_classDateContent
(
_data
){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
let
_dataList
=
_data
.
meetingInfo
;
let
teacherIntroContent
=
$
(
'#teacherIntroContent'
);
teacherIntroContent
.
empty
();
let
_dataList
=
_data
.
users
;
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
let
j
=
(
i
%
4
)
==
3
;
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_dataList
[
i
].
beginTime
,
_dataList
[
i
].
endT
ime
)
let
_getTime
=
ClassDataProxy
.
getTimeDifference
(
_dataList
[
i
].
create_time
,
_dataList
[
i
].
end_t
ime
)
let
_classifyList
=
this
.
_format
(
classifyList
,{
_classifyListR
:
j
?
'classifyListR'
:
''
,
_id
:
_dataList
[
i
].
id
,
_msgImg
:
'../images/u373.png'
,
_classroomTitle
:
_dataList
[
i
].
meetingName
,
_schoolTime
:
_getTime
,
_subscribeNum
:
'27人已预约'
_classroomTitle
:
_dataList
[
i
].
user_name
,
_schoolTime
:
_getTime
.
split
(
'-'
)[
0
],
_subscribeNum
:
_dataList
[
i
].
reservationNumber
+
'人预约'
})
classifyList
Content
.
append
(
_classifyList
);
teacherIntro
Content
.
append
(
_classifyList
);
}
}
_classDatepageNum
(
_data
){
//page
...
...
@@ -174,27 +152,30 @@ class TeacherDetailApe extends Ape {
this
.
pagingConstruct
(
1
,
_pageNum
);
}
pagingConstruct
(
paging
,
total
){
let
pageNumContentBox
=
$
(
'#pageNumContentBox'
);
pageNumContentBox
.
empty
();
let
teacherIntroPageBox
=
$
(
'#teacherIntroPageBox'
);
teacherIntroPageBox
.
empty
();
let
pagingDivInnerHTML
=
'<div class="pageNumContent">'
;
let
isHiddenExist
=
0
;
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
i
<
4
||
i
<
(
paging
+
4
)
&&
i
>
(
paging
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
2
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
if
(
total
>
1
){
for
(
let
i
=
1
;
i
<=
total
;
i
++
){
if
(
i
==
paging
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn pageNumBtnCheck">'
+
i
+
'</span>'
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
if
(
i
<
4
||
i
<
(
paging
+
3
)
&&
i
>
(
paging
-
2
)
||
i
>
(
total
/
2
-
2
)
&&
i
<
(
total
/
2
+
2
)
||
i
>
(
total
-
3
))
{
pagingDivInnerHTML
+=
'<span class="pageNumBtn">'
+
i
+
'</span>'
;
isHiddenExist
=
0
;
}
else
{
if
(
isHiddenExist
==
0
){
pagingDivInnerHTML
+=
'<span class="pageNumBtn">...</span>'
;
isHiddenExist
=
1
;
}
}
}
}
}
pagingDivInnerHTML
+=
'</div>'
;
pageNumContent
Box
.
append
(
pagingDivInnerHTML
);
teacherIntroPage
Box
.
append
(
pagingDivInnerHTML
);
}
_teacherHome
(){
$
(
'#slideshow'
).
hide
();
...
...
@@ -211,10 +192,14 @@ class TeacherDetailApe extends Ape {
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'.curriculumBox'
).
hide
();
$
(
'#classifyListBox'
).
show
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
show
();
}
//工具类
...
...
src/main.js
查看文件 @
9060a56
...
...
@@ -26,6 +26,8 @@ import AdministratorApe from 'ape/AdministratorApe';//管理员
import
PlayRecordApe
from
'ape/PlayRecordApe'
;
//录制管理
import
MyCenterApe
from
'ape/MyCenterApe'
;
//个人中心
import
SubscribeApe
from
'ape/SubscribeApe'
;
//预约
import
CollectApe
from
'ape/CollectApe'
;
//预约
import
MessageTypes
from
"MessageTypes"
;
...
...
@@ -49,6 +51,9 @@ let _administratorApe;
let
_playRecordApe
;
let
_myCenterApe
;
let
_subscribeApe
;
let
_collectApe
;
let
_headSwitchTitleApe
;
class
Main
{
constructor
()
{
...
...
@@ -143,6 +148,7 @@ class Main {
//首页
_homeApe
=
new
HomeApe
();
_homeApe
.
on
(
MessageTypes
.
HOME_SKIP
,
this
.
homeSkip
.
bind
(
this
));
_homeApe
.
on
(
MessageTypes
.
SWITCH_HEADER
,
this
.
switchHeader
.
bind
(
this
));
//老师
_teacherDetailApe
=
new
TeacherDetailApe
();
//兼课
...
...
@@ -170,7 +176,9 @@ class Main {
_myCenterApe
=
new
MyCenterApe
();
//预约管理
_subscribeApe
=
new
SubscribeApe
();
_subscribeApe
.
on
(
MessageTypes
.
ORDER_FINISH
,
this
.
orderFinish
.
bind
(
this
));
//收藏
_collectApe
=
new
CollectApe
();
}
...
...
@@ -246,10 +254,34 @@ class Main {
break
;
}
}
switchHeader
(
_data
){
let
ind
=
parseInt
(
_data
);
switch
(
ind
){
case
0
:
_homeApe
.
studentClick
();
break
;
case
1
:
_liveClassApe
.
isLocalStorage
();
break
;
case
2
:
_lanclassApe
.
isLocalStorage
();
break
;
case
3
:
_teacherDetailApe
.
isLocalStorage
();
break
;
default
:
return
;
}
}
addClass
(
_data
){
loger
.
log
(
'创建课堂成功'
)
_managementHomePageApe
.
detailPage
();
}
//预约成功重新渲染数据
orderFinish
(){
_homeApe
.
homeAllDate
();
}
//判断登录用户的状态
_localStorageState
(){
let
userType
=
window
.
localStorage
.
getItem
(
'userType'
)
||
0
;
...
...
@@ -307,7 +339,9 @@ class Main {
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#classifyListBox'
).
hide
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
$
(
'#partTimeTeachingBox'
).
hide
();
$
(
'#recordUl .recordLi'
).
eq
(
0
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
$
(
'.classManagementRight'
).
eq
(
0
).
show
().
siblings
().
hide
();
...
...
@@ -320,19 +354,24 @@ class Main {
$
(
'#header_seek'
).
hide
();
$
(
'#androidDownload'
).
hide
();
$
(
'#classManagementBox'
).
hide
();
$
(
'#classifyListBox'
).
hide
();
$
(
'#partTimeTeachingBox'
).
hide
();
$
(
'#myCenterBox'
).
show
();
$
(
'.myCenterContentBox'
).
eq
(
0
).
show
().
siblings
().
hide
();
$
(
'#teacherMyCerter'
).
show
();
$
(
'#studentMyCerter'
).
hide
();
$
(
'.recordLi2'
).
eq
(
0
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
}
_student
(){
$
(
'#slideshow'
).
show
();
$
(
'#defaultBox'
).
show
();
$
(
'.curriculumBox'
).
show
();
$
(
'#classifyListBox'
).
hide
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
...
...
@@ -353,6 +392,9 @@ class Main {
$
(
'#classifyListBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
$
(
'#partTimeTeachingBox'
).
show
();
$
(
'#liveContentAllBox'
).
hide
();
$
(
'#lanclassAllBox'
).
hide
();
$
(
'#teacherIntroAllBox'
).
hide
();
}
//获取国际化语言
_localConfig
()
{
...
...
src/proxy/ClassDataProxy.js
查看文件 @
9060a56
...
...
@@ -187,6 +187,54 @@ class ClassDataProxy {
return
'已结束'
;
}
}
//计算时间戳倒计时
static
getTimeCountDown
(
start
){
let
newDate
=
Date
.
parse
(
new
Date
());
//开始时间
let
newTime
=
Date
.
parse
(
new
Date
(
start
))
let
t
=
newTime
-
newDate
;
console
.
log
(
t
)
let
hour
=
Math
.
floor
(
t
/
1000
/
60
/
60
%
24
);
let
min
=
Math
.
floor
(
t
/
1000
/
60
%
60
);
let
sec
=
Math
.
floor
(
t
/
1000
%
60
);
if
(
hour
<
10
)
{
hour
=
"0"
+
hour
;
}
if
(
min
<
10
)
{
min
=
"0"
+
min
;
}
if
(
sec
<
10
)
{
sec
=
"0"
+
sec
;
}
if
(
t
<
0
){
return
'已结束'
;
}
else
{
return
hour
+
":"
+
min
+
":"
+
sec
;
}
}
//判断是否是今天
static
getTimeDay
(
start
){
let
newDate
=
new
Date
();
let
month
=
newDate
.
getMonth
()
+
1
;
let
day
=
newDate
.
getDate
();
let
oldDate
=
new
Date
(
start
);
let
d_month
=
oldDate
.
getMonth
()
+
1
;
let
d_day
=
oldDate
.
getDate
();
if
(
month
==
d_month
&&
day
==
d_day
){
return
true
;
}
else
{
return
false
;
}
}
//计算时间差值显示列表
static
getTimeDifference
(
start
,
end
){
let
newTime
=
new
Date
();
...
...
@@ -202,15 +250,15 @@ class ClassDataProxy {
let
newDate
=
newStart
.
getDate
();
//日
let
newEndHours
=
oldHours
<
10
?
'0'
+
oldHours
:
oldHours
;
let
newStartHours
=
newHours
<
10
?
'0'
+
newHours
:
newHours
;
let
newStartHours
=
newHours
<
10
?
'0'
+
newHours
:
newHours
;
let
newStartDate
=
newStart
.
getDate
()
+
1
<
10
?
'0'
+
newStart
.
getDate
():
newStart
.
getDate
();
let
newStartDate
=
(
newStart
.
getDate
()
+
1
)
<
10
?
'0'
+
newStart
.
getDate
():
newStart
.
getDate
();
let
newStartDay
=
newStart
.
getDay
()
<
10
?
'0'
+
newStart
.
getDay
():
newStart
.
getDay
();
if
(
date
==
0
){
return
'今天 '
+
' '
+
newStartHours
+
':00'
+
' - '
+
newEndHours
+
':00'
;
}
else
{
return
newMonth
+
'月'
+
newDate
+
'日 '
+
' '
+
new
Hours
+
':00'
+
' - '
+
ol
dHours
+
':00'
;
return
newMonth
+
'月'
+
newDate
+
'日 '
+
' '
+
new
StartHours
+
':00'
+
' - '
+
newEn
dHours
+
':00'
;
}
}
}
...
...
请
注册
或
登录
后发表评论