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
71724be646d6adea1591a3f54a957f3ef4e0f94d
71724be6
1 parent
77bb12f5
修改用户信息修改
隐藏空白字符变更
内嵌
并排对比
正在显示
12 个修改的文件
包含
341 行增加
和
171 行删除
dist/stylesheets/style.css
etc/umd.template.html
src/ape/HomeApe.js
src/ape/LanclassApe.js
src/ape/LiveClassApe.js
src/ape/LoginOrRegister.js
src/ape/MyCenterApe.js
src/ape/Slideshow.js
src/ape/SubscribeApe.js
src/ape/TeacherDetailApe.js
src/main.js
src/proxy/ClassDataProxy.js
dist/stylesheets/style.css
查看文件 @
71724be
...
...
@@ -1164,6 +1164,7 @@ body{
position
:
absolute
;
left
:
0
;
top
:
0
;
display
:
none
;
}
.usersign
{
width
:
420px
;
...
...
@@ -1370,8 +1371,9 @@ body{
border-radius
:
3px
;
}
.removeConfirm
{
margin
:
0
30px
0
60
px
;
margin
:
0
40px
0
65
px
;
background
:
#3498db
;
color
:
#fff
;
}
.removeCancel
{
background
:
#e6e6e6
;
...
...
@@ -1386,6 +1388,7 @@ body{
top
:
0
;
bottom
:
0
;
margin
:
auto
;
z-index
:
1
;
background
:
#fffdfd
;
cursor
:
default
;
font-size
:
14px
;
...
...
@@ -1757,4 +1760,32 @@ body{
cursor
:
pointer
;
float
:
right
;
margin-top
:
83px
;
}
\ No newline at end of file
}
/*个人信息修改弹框*/
.updateInputBox
{
width
:
410px
;
height
:
200px
;
background
:
#fff
;
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
margin
:
auto
;
}
.updateInputContent
{
padding
:
55px
35px
;
}
.updateInputText
{
float
:
left
;
line-height
:
40px
;
}
.updateInput
{
width
:
200px
;
height
:
40px
;
border
:
1px
solid
#ccc
;
line-height
:
40px
;
margin-left
:
10px
;
outline
:
none
;
padding-left
:
6px
;
}
...
...
etc/umd.template.html
查看文件 @
71724be
...
...
@@ -946,7 +946,7 @@
</div>
</div>
</div>
<!--个人中心-->
<div
id=
"myCenterBox"
class=
"myCenterBox"
>
<div
class=
"myCenterLeftBox"
>
<ul
class=
"recordUl"
id=
"teacherUI"
>
...
...
@@ -1122,10 +1122,10 @@
<li
class=
"accountInfoList"
>
<label
class=
"accountInfoIcon"
>

</label>
<div
class=
"accountInfo"
>
<span
class=
"significanceInfo"
><label>
账号密码
</label></span>
<span
class=
"significanceInfo"
><label>
账号密码
</label><
label
id=
"setPassWord"
></label><
/span>
<span
class=
"significanceInfoHint"
>
用于保护账号信息和登录安全
</span>
</div>
<span
class=
"accountInfoBtn"
>
修改
</span>
<span
class=
"accountInfoBtn"
id=
"accountPassWordBtn"
data=
"0"
>
修改
</span>
</li>
<li
class=
"accountInfoList"
>
<label
class=
"accountInfoIcon"
>

</label>
...
...
@@ -1133,7 +1133,7 @@
<span
class=
"significanceInfo"
><label
class=
"significanceInfoTit"
>
安全邮箱
</label><label
id=
"setMail"
>
hi*****n@3mang.com
</label></span>
<span
class=
"significanceInfoHint"
>
用于保护账号信息和登录安全
</span>
</div>
<span
class=
"accountInfoBtn"
>
修改
</span>
<span
class=
"accountInfoBtn"
id=
"accountEmailBtn"
data=
"1"
>
修改
</span>
</li>
<li
class=
"accountInfoList"
>
<label
class=
"accountInfoIcon"
>

</label>
...
...
@@ -1141,7 +1141,7 @@
<span
class=
"significanceInfo"
><label
class=
"significanceInfoTit"
>
安全手机
</label><label
id=
"setPhone"
>
139*****168
</label></span>
<span
class=
"significanceInfoHint"
>
用于保护账号信息和登录安全
</span>
</div>
<span
class=
"accountInfoBtn"
>
修改
</span>
<span
class=
"accountInfoBtn"
id=
"accountMobilelBtn"
data=
"2"
>
修改
</span>
</li>
<li
class=
"accountInfoList accountInfoList1"
>
<button
class=
"accountInfoBtn accountInfoSaveBtn"
id=
"accountInfoSaveBtn"
>
保存
</button>
...
...
@@ -1277,5 +1277,19 @@
<a
href=
"javascript: void(0)"
class=
"warnHintA iconfont"
id=
"warnHintA"
>

</a>
<p
class=
"warnHintContent"
id=
"warnHintContent"
></p>
</div>
<!--修改信息输入框-->
<div
class=
"userSignBox"
id=
"updateInputShade"
>
<div
class=
"updateInputBox"
>
<a
href=
"javascript: void(0)"
class=
"warnHintA iconfont"
id=
"updateInputBoxA"
>

</a>
<div
class=
"updateInputContent"
>
<span
class=
"updateInputText"
id=
"updateInputText"
>
请输入新密码 :
</span>
<input
type=
"text"
class=
"updateInput"
id=
"updateInput"
>
<div
class=
"removeHandlerBtn"
>
<button
class=
"removeConfirm btnHover"
id=
"updateInputYes"
>
确定
</button>
<button
class=
"removeCancel"
id=
"updateInputNo"
>
取消
</button>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
...
...
src/ape/HomeApe.js
查看文件 @
71724be
...
...
@@ -46,6 +46,7 @@ class HomeApe extends Ape {
}
isLocalStorage
(){
$
(
'#myCenterBox'
).
hide
();
this
.
detailPage
();
}
_judgeListPlace
(){
...
...
@@ -112,14 +113,7 @@ class HomeApe extends Ape {
$
(
'#classifyListBox'
).
hide
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
}
teacher
(){
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'.curriculumBox'
).
hide
();
$
(
'#classifyListBox'
).
show
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
}
_gainClassData
(
_data
){
let
liveList
=
$
(
'#liveList'
);
...
...
@@ -130,7 +124,6 @@ class HomeApe extends Ape {
teacherIntro
.
empty
();
if
(
_data
){
let
_dataList
=
_data
.
meetingInfo
;
loger
.
log
(
'显示当前时间'
,
_dataList
[
0
])
for
(
let
i
=
0
;
i
<
_dataList
.
length
;
i
++
){
if
(
i
<
8
){
let
j
=
(
i
%
4
)
==
3
;
...
...
src/ape/LanclassApe.js
查看文件 @
71724be
...
...
@@ -58,6 +58,7 @@ class LanclassApe extends Ape {
$
(
'#classifyListBox'
).
show
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
this
.
detailPage
();
}
//点击翻页
...
...
src/ape/LiveClassApe.js
查看文件 @
71724be
...
...
@@ -57,6 +57,7 @@ class LanclassApe extends Ape {
$
(
'#classifyListBox'
).
show
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
this
.
detailPage
();
}
//点击翻页
...
...
src/ape/LoginOrRegister.js
查看文件 @
71724be
...
...
@@ -221,6 +221,7 @@ class LoginOrRegister extends Ape {
"companyName"
:
null
,
//公司名字
"userName"
:
_name
.
value
,
//用户名
"userRole"
:
4
,
// 用户角色 0超级管理员,1管理员,2监课,3老师,4学生
"userType"
:
8
,
"userEmail"
:
mail
.
value
,
// 用户邮箱
"userMobile"
:
parseInt
(
phone
.
value
),
// 用户手机号
"content"
:
"2017-09-01"
,
// 用户简介
...
...
@@ -306,14 +307,24 @@ class LoginOrRegister extends Ape {
ClassDataProxy
.
status
=
true
;
ClassDataProxy
.
id
=
_data
.
returnData
.
data
.
id
;
window
.
localStorage
.
setItem
(
"loginName"
,
ClassDataProxy
.
loginName
);
window
.
localStorage
.
setItem
(
"password"
,
ClassDataProxy
.
password
);
ClassDataProxy
.
monicker
=
_data
.
returnData
.
data
.
userName
;
ClassDataProxy
.
userEmail
=
_data
.
returnData
.
data
.
userEmail
;
ClassDataProxy
.
userMobile
=
_data
.
returnData
.
data
.
userMobile
;
window
.
localStorage
.
setItem
(
"loginName"
,
ClassDataProxy
.
loginName
);
//登录名
window
.
localStorage
.
setItem
(
"password"
,
ClassDataProxy
.
password
);
//密码
window
.
localStorage
.
setItem
(
"userType"
,
ClassDataProxy
.
userType
);
window
.
localStorage
.
setItem
(
"token"
,
ClassDataProxy
.
token
);
window
.
localStorage
.
setItem
(
'status'
,
ClassDataProxy
.
status
);
window
.
localStorage
.
setItem
(
'id'
,
ClassDataProxy
.
id
);
window
.
localStorage
.
setItem
(
'monicker'
,
ClassDataProxy
.
monicker
);
window
.
localStorage
.
setItem
(
'userEmail'
,
ClassDataProxy
.
userEmail
);
window
.
localStorage
.
setItem
(
'userMobile'
,
ClassDataProxy
.
userMobile
);
that
.
successLogin
();
//登录成功后 个人信息输入信息框中
that
.
updateChangeUser
(
_data
);
}
else
{
ErrorApe
.
showWarnError
(
_data
.
returnData
.
data
.
msg
);
...
...
@@ -337,6 +348,30 @@ class LoginOrRegister extends Ape {
this
.
_userLoginAHandler
();
this
.
_emit
(
MessageTypes
.
LOGIN_IN
,{
userType
:
ClassDataProxy
.
userType
});
}
updateChangeUser
(
_data
){
loger
.
log
(
_data
)
let
_dataList
=
_data
.
returnData
.
data
;
let
oneselfInfoLoginName
=
$
(
'#oneselfInfoLoginName'
);
//登录名
let
oneselfInfoUserName
=
$
(
'#oneselfInfoUserName'
);
//用户名
let
setPassWord
=
$
(
'#setPassWord'
);
//密码
let
setMail
=
$
(
'#setMail'
);
//邮箱
let
setPhone
=
$
(
'#setPhone'
);
//手机号
oneselfInfoLoginName
.
val
(
_dataList
.
loginName
);
oneselfInfoUserName
.
val
(
_dataList
.
userName
);
setMail
.
attr
(
'data'
,
_dataList
.
userEmail
);
setPhone
.
attr
(
'data'
,
_dataList
.
userMobile
);
let
userEmail
=
this
.
updateEmail
(
_dataList
.
userEmail
);
let
userMobile
=
this
.
updateMobile
(
_dataList
.
userMobile
);
setMail
.
html
(
userEmail
)
setPhone
.
html
(
userMobile
)
}
updateEmail
(
userEmail
){
return
userEmail
.
replace
(
/
(\d{2})\d{2}(\d{1})
/
,
'$1****$2'
)
}
updateMobile
(
userMobile
){
return
userMobile
.
replace
(
/
(\d{3})\d{4}(\d{4})
/
,
'$1****$2'
)
}
}
export
default
LoginOrRegister
;
\ No newline at end of file
...
...
src/ape/MyCenterApe.js
查看文件 @
71724be
...
...
@@ -6,6 +6,7 @@ import Loger from "../Loger";
import
Ape
from
"./Ape"
;
import
$
from
"jquery"
;
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
import
ErrorApe
from
"./ErrorApe"
;
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
id
=
"{_id}"
>
<
img
class
=
"curriculumListImg"
src
=
"{_msgImg}"
alt
=
""
>
...
...
@@ -21,17 +22,235 @@ let loger = Loger.getLoger('PC-MyCenterApe');
class
MyCenterApe
extends
Ape
{
constructor
()
{
super
();
this
.
isLocalStorage
();
this
.
data
=
0
;
this
.
addEvent
();
this
.
init
();
}
init
()
{
$
(
'#personageInfo'
).
on
(
'click'
,
this
.
_myCenterBoxHandler
.
bind
(
this
));
//个人中心
$
(
'#teacherUI li'
).
on
(
'click'
,
this
.
_recordLiHandler
.
bind
(
this
));
//课堂分类
$
(
'#updateInputYes'
).
on
(
'click'
,
this
.
_updateInputYesHandler
.
bind
(
this
));
//确定时把输入的信息存入数据中
$
(
'#accountInfoSaveBtn'
).
on
(
'click'
,
this
.
_accountInfoSaveBtnHandler
.
bind
(
this
));
//更新用户信息按钮
$
(
'#updateInputBoxA'
).
on
(
'click'
,
this
.
_hideInputBox
.
bind
(
this
));
//关闭弹框
$
(
'#updateInputNo'
).
on
(
'click'
,
this
.
_hideInputBox
.
bind
(
this
));
//关闭弹框
//修改账户信息
$
(
'#accountPassWordBtn'
).
on
(
'click'
,
this
.
_accountPassWordBtnHandler
.
bind
(
this
));
//密码
$
(
'#accountEmailBtn'
).
on
(
'click'
,
this
.
_accountEmailBtnHandler
.
bind
(
this
));
//邮箱
$
(
'#accountMobilelBtn'
).
on
(
'click'
,
this
.
_accountMobilelBtnHandler
.
bind
(
this
));
//手机号
}
addEvent
()
{
}
isLocalStorage
(){
$
(
'#teacherMyCenterName'
).
text
(
ClassDataProxy
.
loginName
);
$
(
'.myCenterContentBox'
).
eq
(
0
).
show
();
let
newDate
=
new
Date
();
let
newHours
=
newDate
.
getHours
();
let
text
=
newHours
>
12
?
'下午好,'
:
'上午好,'
$
(
'#teacherMyCenterTime'
).
text
(
text
);
$
(
'.recordLi2'
).
eq
(
0
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
$
(
'#oneselfInfoLoginName'
).
val
(
ClassDataProxy
.
loginName
);
//登录名
$
(
'#oneselfInfoUserName'
).
val
(
ClassDataProxy
.
monicker
);
//用户名
let
setMail
=
$
(
'#setMail'
);
//邮箱
let
setPhone
=
$
(
'#setPhone'
);
//手机号
let
userEmail
=
this
.
updateEmail
(
ClassDataProxy
.
userEmail
);
let
userMobile
=
this
.
updateMobile
(
ClassDataProxy
.
userMobile
);
setMail
.
attr
(
'data'
,
ClassDataProxy
.
userEmail
);
setPhone
.
attr
(
'data'
,
ClassDataProxy
.
userMobile
);
setMail
.
html
(
userEmail
)
setPhone
.
html
(
userMobile
)
}
_recordLiHandler
(
evt
){
let
ind
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
$
(
evt
.
currentTarget
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
$
(
'.myCenterContentBox'
).
eq
(
ind
).
show
().
siblings
().
hide
();
switch
(
parseInt
(
ind
)){
case
0
:
//首页
break
;
case
1
:
//我的课程
break
;
case
2
:
//我的预约
break
;
case
3
:
//个人信息
this
.
_updatMessage
();
break
;
default
:
return
;
}
}
_accountInfoSaveBtnHandler
(){
let
id
=
ClassDataProxy
.
id
;
//id
let
loginName
=
ClassDataProxy
.
loginName
;
//登录名
let
userMobile
=
ClassDataProxy
.
userMobile
;
//手机号
let
userEmail
=
ClassDataProxy
.
userEmail
;
//邮箱
let
monicker
=
ClassDataProxy
.
monicker
;
//用户名
let
passWord
=
ClassDataProxy
.
password
;
//密码
let
oneselfInfoLoginName
=
$
(
'#oneselfInfoLoginName'
).
val
();
//登录名
let
oneselfInfoUserName
=
$
(
'#oneselfInfoUserName'
).
val
();
//用户名
let
oneselfInfoMan
=
$
(
'#oneselfInfoMan'
);
//性别
let
setPassWord
=
$
(
'#setPassWord'
).
attr
(
'data'
);
//密码
let
setMail
=
$
(
'#setMail'
).
attr
(
'data'
);
//邮箱
let
setPhone
=
$
(
'#setPhone'
).
attr
(
'data'
);
//手机号
let
signInfo
=
{};
if
(
oneselfInfoLoginName
!=
loginName
){
signInfo
.
loginName
=
oneselfInfoLoginName
;
}
if
(
oneselfInfoUserName
!=
monicker
){
signInfo
.
userName
=
oneselfInfoUserName
;
}
if
(
!
setPassWord
){
// signInfo.loginName = oneselfInfoLoginName;
}
if
(
setMail
!=
userEmail
){
signInfo
.
userEmail
=
setMail
;
}
if
(
setPhone
!=
userMobile
){
signInfo
.
userMobile
=
setPhone
;
}
loger
.
log
(
signInfo
)
let
that
=
this
;
let
_url
=
ClassDataProxy
.
locationProtocol
+
ClassDataProxy
.
locationProt
+
'/users/updateUserByUserId/'
+
id
;
loger
.
log
(
_url
)
$
.
ajax
({
type
:
"PUT"
,
url
:
_url
,
timeout
:
5000
,
headers
:
{
siteId
:
'markettest'
,
'token'
:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
data
:
signInfo
,
success
:
function
(
_data
){
loger
.
log
(
'修改信息成功'
,
_data
)
//获取个人信息数据
if
(
_data
&&
_data
.
code
==
200
){
loger
.
log
(
'修改信息成功'
,
_data
)
ErrorApe
.
showWarnError
(
'修改信息成功'
);
ClassDataProxy
.
loginName
=
_data
.
returnData
.
data
.
loginName
;
ClassDataProxy
.
monicker
=
_data
.
returnData
.
data
.
userName
;
ClassDataProxy
.
userEmail
=
_data
.
returnData
.
data
.
userEmail
;
ClassDataProxy
.
userMobile
=
_data
.
returnData
.
data
.
userMobile
;
window
.
localStorage
.
setItem
(
'loginName'
,
ClassDataProxy
.
loginName
);
window
.
localStorage
.
setItem
(
'monicker'
,
ClassDataProxy
.
monicker
);
window
.
localStorage
.
setItem
(
'userEmail'
,
ClassDataProxy
.
userEmail
);
window
.
localStorage
.
setItem
(
'userMobile'
,
ClassDataProxy
.
userMobile
);
}
},
error
:
function
(
error
){
// alert('老师界面获取数据失败')
loger
.
log
(
error
,
'修改信息失败'
)
}
})
}
clearLocalStorage
(){
window
.
localStorage
.
clear
();
ClassDataProxy
.
userType
=
ClassDataProxy
.
USER_TYPE_0
;
ClassDataProxy
.
loginName
=
""
;
ClassDataProxy
.
password
=
""
ClassDataProxy
.
token
=
""
;
ClassDataProxy
.
status
=
false
;
}
//个人信息
_updatMessage
(){
$
(
'#oneselfInfoLoginName'
).
val
(
ClassDataProxy
.
loginName
);
//登录名
$
(
'#oneselfInfoUserName'
).
val
(
ClassDataProxy
.
monicker
);
//用户名
}
//修改密码
_accountPassWordBtnHandler
(){
this
.
data
=
0
;
this
.
_showInputBox
(
this
.
data
);
}
//修改邮箱
_accountEmailBtnHandler
(){
this
.
data
=
1
;
this
.
_showInputBox
(
this
.
data
);
}
//修改手机号
_accountMobilelBtnHandler
(){
this
.
data
=
2
;
this
.
_showInputBox
(
this
.
data
);
loger
.
log
(
this
.
data
)
}
_myCenterBoxHandler
(){
loger
.
log
(
ClassDataProxy
.
userType
)
if
(
ClassDataProxy
.
userType
==
ClassDataProxy
.
USER_TYPE_8
){
$
(
'#slideshow'
).
hide
();
$
(
'#defaultBox'
).
hide
();
$
(
'#classifyListBox'
).
hide
();
}
$
(
'#myCenterBox'
).
show
();
}
_updateInputYesHandler
(
evt
){
let
updateInput
=
$
(
'#updateInput'
).
val
();
switch
(
parseInt
(
this
.
data
)){
case
0
:
//密码
let
reg
=
/^
[
0-9a-zA-Z
]{8,12}
$/
;
if
(
!
updateInput
||
!
(
reg
.
test
(
updateInput
))){
ErrorApe
.
showWarnError
(
'密码格式不正确,请重新输入'
);
return
;
}
$
(
'#setPassWord'
).
attr
(
'data'
,
updateInput
);
this
.
_hideInputBox
();
break
;
case
1
:
//邮箱
let
filter
=
/^
([
a-zA-Z0-9_
\.\-])
+
\@(([
a-zA-Z0-9
\-])
+
\.)
+
([
a-zA-Z0-9
]{2,4})
+$/
;
if
(
!
updateInput
||
!
(
filter
.
test
(
updateInput
))){
ErrorApe
.
showWarnError
(
'邮箱格式不正确,请重新输入'
);
return
;
}
$
(
'#setMail'
).
attr
(
'data'
,
updateInput
);
$
(
'#setMail'
).
html
(
this
.
updateEmail
(
updateInput
))
this
.
_hideInputBox
();
break
;
case
2
:
//手机号
let
reg1
=
/^
((
13
[
0-9
])
|
(
14
[
5|7
])
|
(
15
([
0-3
]
|
[
5-9
]))
|
(
18
[
0,5-9
]))\\
d
{8}
$/
;
let
regPhone
=
"^1[3|4|5|8][0-9]\\d{8}$"
;
let
re
=
new
RegExp
(
regPhone
);
if
(
!
updateInput
||
!
(
re
.
test
(
updateInput
))){
ErrorApe
.
showWarnError
(
'手机格式不正确,请重新输入'
);
return
;
}
$
(
'#setPhone'
).
attr
(
'data'
,
updateInput
);
$
(
'#setPhone'
).
html
(
this
.
updateMobile
(
updateInput
))
this
.
_hideInputBox
();
break
;
default
:
return
;
}
}
_hideInputBox
(){
$
(
'#updateInput'
).
val
(
''
);
$
(
'#updateInputShade'
).
hide
();
}
_showInputBox
(
ind
){
let
arr
=
[
'请输入新密码 :'
,
'请输入新邮箱 :'
,
'请输入新手机号 :'
]
$
(
'#updateInputShade'
).
show
();
$
(
'#updateInputText'
).
text
(
arr
[
ind
])
}
updateEmail
(
userEmail
){
return
userEmail
.
replace
(
/
(\d{2})\d{2}(\d{1})
/
,
'$1****$2'
)
}
updateMobile
(
userMobile
){
return
userMobile
.
replace
(
/
(\d{3})\d{4}(\d{4})
/
,
'$1****$2'
)
}
//工具类
_format
(
str
,
obj
)
{
return
str
.
replace
(
/
\{(\w
+
)\}
/g
,
function
(
match
,
group
,
index
)
{
...
...
src/ape/Slideshow.js
查看文件 @
71724be
...
...
@@ -35,8 +35,6 @@ class Slideshow extends Ape {
this
.
_imgReload
();
}
slideImg
(){
let
oli
=
document
.
getElementById
(
'dots'
).
getElementsByTagName
(
"li"
);
let
_num
=
0
;
...
...
@@ -49,106 +47,28 @@ class Slideshow extends Ape {
this
.
len
=
size
;
this
.
_timer
=
setInterval
(
function
(){
li
[
_num
].
style
.
display
=
"none"
;
_num
=++
_num
==
size
?
0
:
_num
;
li
[
_num
].
style
.
display
=
"inline-block"
;
// $("#motionMapBox").stop().animate({left:-this.num*this.windowWidth},500);
$
(
"#dots li"
).
eq
(
_num
).
addClass
(
'active'
).
siblings
().
removeClass
(
'active'
);
//
$("#dots li").eq(_num).addClass('active').siblings().removeClass('active');
},
3000
);
//切换时间
}
_mouseenterHandler
(){
clearInterval
(
this
.
_timer
);
//
clearInterval(this._timer);
}
_mouseleaveHandler
(){
setInterval
(
this
.
_timer
);
//
setInterval(this._timer);
}
_move
(){
let
li
=
document
.
getElementById
(
'motionMapBox'
).
getElementsByTagName
(
"li"
);
this
.
_timer
=
setInterval
(
function
(){
li
[
_num
].
style
.
display
=
"none"
;
_num
=++
_num
==
size
?
0
:
_num
;
li
[
_num
].
style
.
display
=
"inline-block"
;
// $("#motionMapBox").stop().animate({left:-this.num*this.windowWidth},500);
$
(
"#dots li"
).
eq
(
_num
).
addClass
(
'active'
).
siblings
().
removeClass
(
'active'
);
},
3000
);
//切换时间
}
slideImg
(){
/* let i = 0;
let width = $('.slidesMap').width();
let clone=$(".slidesMap").first().clone();
$("#motionMapBox").append(clone);
let size = document.getElementById('motionMapBox').getElementsByTagName("li").length;
for(let j=0;j<size-1;j++){
$("#dots").append("<li></li>");
}
$("#dots li").first().addClass('active');
$(".dots li").hover(function(){
let index=$(this).index();
i=index;
$(".motionMapBox").stop().animate({left:-index*width},500);
$(this).addClass('active').siblings().removeClass('active');
})*/
/* let t=setInterval(function(){
i++;
move();
},2000);
//对banner定时器的操作
$(".slideshow").hover(function(){
clearInterval(t);
},function(){
t=setInterval(move,2000);
})*/
/*function move(){
if(i==size){
$("#motionMapBox").css({left:0});
i=1;
}
if(i==-1){
$("#motionMapBox").css({left:-(size-1)*width});
i=size-2;
}
$("#motionMapBox").stop().animate({left:-i*width},500);
if(i==size-1){
$("#dots li").eq(0).addClass('active').siblings().removeClass('active');
}else{
$("#dots li").eq(i).addClass('active').siblings().removeClass('active');
}
}*/
}
_imgReload
(){
let
_windowWidth
=
$
(
"body"
).
width
();
this
.
windowWidth
=
_windowWidth
;
$
(
'.slidesMap'
).
css
({
width
:
_windowWidth
+
"px"
});
$
(
'.slidesImg'
).
css
({
width
:
_windowWidth
+
"px"
});
/* let imgHeight = 0;
let wtmp = $("body").width();
$("#motionMapBox li").each(function(){
$(this).css({width:wtmp + "px"});
});
$(".slidesImg").each(function(){
$(this).css({width:wtmp + "px"});
imgHeight = $(this).height();
});*/
$
(
'#motionMapBox'
).
width
(
$
(
".slidesMap"
).
length
*
_windowWidth
)
}
...
...
src/ape/SubscribeApe.js
查看文件 @
71724be
...
...
@@ -35,8 +35,6 @@ class SubscribeApe extends Ape {
let
status
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
let
id
=
$
(
'#lanclassBox'
).
attr
(
'data'
);
this
.
id
=
id
;
loger
.
log
(
'显示预约信息'
,
parseInt
(
status
))
$
.
ajax
({
type
:
"POST"
,
url
:
_url
,
...
...
src/ape/TeacherDetailApe.js
查看文件 @
71724be
...
...
@@ -7,8 +7,6 @@ import Ape from "./Ape";
import
$
from
"jquery"
;
import
ClassDataProxy
from
"proxy/ClassDataProxy"
;
//import lyzCalendar from "css/lyz.calendar.css";
let
loger
=
Loger
.
getLoger
(
'PC-TeacherDetailApe'
);
const
classifyList
=
`
<
div
class
=
"classifyList {_classifyListR}"
data
=
"1"
id
=
"{_id}"
>
...
...
@@ -37,30 +35,12 @@ class TeacherDetailApe extends Ape {
$
(
'#classifyListBox'
).
on
(
'click'
,
'.pageNumBtn'
,
this
.
_pageNumBtnHandler
.
bind
(
this
));
//点击翻页
$
(
'#teacherUI li'
).
on
(
'click'
,
this
.
_recordLiHandler
.
bind
(
this
));
//课堂分类
}
addEvent
()
{
}
isLocalStorage
(){
if
(
ClassDataProxy
.
userType
==
ClassDataProxy
.
USER_TYPE_1
){
$
(
'#myCenterBox'
).
show
();
$
(
'#teacherMyCenterName'
).
text
(
ClassDataProxy
.
loginName
);
$
(
'.myCenterContentBox'
).
eq
(
0
).
show
();
let
newDate
=
new
Date
();
let
newHours
=
newDate
.
getHours
();
let
text
=
newHours
>
12
?
'下午好,'
:
'上午好,'
$
(
'#teacherMyCenterTime'
).
text
(
text
);
loger
.
log
(
'老师名字'
,
ClassDataProxy
.
loginName
)
}
}
_recordLiHandler
(
evt
){
let
ind
=
$
(
evt
.
currentTarget
).
attr
(
'data'
);
$
(
evt
.
currentTarget
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
$
(
'.myCenterContentBox'
).
eq
(
ind
).
show
().
siblings
().
hide
();
}
_teacherBtnHandler
(
evt
){
this
.
_clearListContent
();
...
...
@@ -133,7 +113,7 @@ class TeacherDetailApe extends Ape {
}
})
}
//清
楚
列表数据
//清
除
列表数据
_clearListContent
(){
let
classifyListContent
=
$
(
'#classifyListContent'
);
classifyListContent
.
empty
();
...
...
@@ -225,13 +205,9 @@ class TeacherDetailApe extends Ape {
$
(
'#classifyListBox'
).
show
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
}
//老师点击老师模块
teacherClickTeacher
(){
loger
.
log
(
'老师点击老师列表'
)
$
(
'#classifyListBox'
).
hide
();
$
(
'#myCenterBox'
).
show
();
}
//工具类
_format
(
str
,
obj
)
{
return
str
.
replace
(
/
\{(\w
+
)\}
/g
,
function
(
match
,
group
,
index
)
{
...
...
src/main.js
查看文件 @
71724be
...
...
@@ -38,7 +38,7 @@ let _subscribeApe;
class
Main
{
constructor
()
{
this
.
clientVersion
=
"v1.6.
6
.20170904"
;
this
.
clientVersion
=
"v1.6.
7
.20170904"
;
loger
.
warn
(
"clientVersion:"
+
this
.
clientVersion
);
let
locationProtocol
=
location
.
protocol
;
...
...
@@ -181,9 +181,19 @@ class Main {
let
userType
=
window
.
localStorage
.
getItem
(
'userType'
)
||
0
;
let
loginName
=
window
.
localStorage
.
getItem
(
'loginName'
)
||
''
;
let
id
=
window
.
localStorage
.
getItem
(
'id'
)
||
''
;
let
userMobile
=
window
.
localStorage
.
getItem
(
'userMobile'
)
||
''
;
let
userEmail
=
window
.
localStorage
.
getItem
(
'userEmail'
)
||
''
;
let
monicker
=
window
.
localStorage
.
getItem
(
'monicker'
)
||
''
;
ClassDataProxy
.
userType
=
parseInt
(
userType
);
ClassDataProxy
.
loginName
=
loginName
;
ClassDataProxy
.
id
=
id
;
//个人信息
ClassDataProxy
.
userMobile
=
userMobile
;
ClassDataProxy
.
userEmail
=
userEmail
;
ClassDataProxy
.
monicker
=
monicker
;
loger
.
log
(
'进入课堂时显示的type值'
,
ClassDataProxy
.
userType
)
switch
(
parseInt
(
userType
)){
...
...
@@ -216,6 +226,7 @@ class Main {
$
(
'#header_seek'
).
hide
();
$
(
'#androidDownload'
).
hide
();
$
(
'#classManagementBox'
).
show
();
$
(
'#myCenterBox'
).
hide
();
}
_teacherHome
(){
$
(
'#slideshow'
).
hide
();
...
...
@@ -226,7 +237,9 @@ class Main {
$
(
'#androidDownload'
).
hide
();
$
(
'#classManagementBox'
).
hide
();
$
(
'#classifyListBox'
).
hide
();
$
(
'#myCenterBox'
).
show
();
$
(
'#myCenterBox'
).
hide
();
$
(
'.myCenterContentBox'
).
eq
(
0
).
show
();
$
(
'.recordLi2'
).
eq
(
0
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
}
_student
(){
$
(
'#slideshow'
).
show
();
...
...
@@ -235,6 +248,9 @@ class Main {
$
(
'#classifyListBox'
).
hide
();
$
(
'#teacherDetailBox'
).
hide
();
$
(
'#lanclassBox'
).
hide
();
$
(
'#myCenterBox'
).
hide
();
$
(
'.myCenterContentBox'
).
eq
(
0
).
show
();
$
(
'.recordLi2'
).
eq
(
0
).
addClass
(
'recordLiCheck'
).
siblings
().
removeClass
(
'recordLiCheck'
);
}
//获取国际化语言
_localConfig
()
{
...
...
src/proxy/ClassDataProxy.js
查看文件 @
71724be
...
...
@@ -2,44 +2,6 @@ class ClassDataProxy {
constructor
()
{
}
//获取课堂初始化的参数
static
getInitClassData
()
{
let
_data
=
{};
_data
.
classId
=
this
.
classId
;
_data
.
portal
=
this
.
portal
;
_data
.
userRole
=
this
.
userRole
;
_data
.
userName
=
this
.
userName
;
_data
.
userId
=
this
.
userId
;
return
_data
;
}
//获取加入课堂的参数
static
getJoinClassData
()
{
let
_data
=
{};
_data
.
password
=
this
.
password
;
_data
.
userName
=
this
.
userName
;
_data
.
autoLogin
=
this
.
autoLogin
;
return
_data
;
}
//生成时间戳毫秒
static
creatTimestamp
()
{
let
time
=
new
Date
().
getTime
();
return
time
;
}
//生成时间戳 string
static
creatTimestampStr
()
{
let
curTime
=
new
Date
();
let
timeStr
=
""
+
curTime
.
getFullYear
()
+
"-"
;
timeStr
+=
(
curTime
.
getMonth
()
+
1
)
+
"-"
;
timeStr
+=
curTime
.
getDate
()
+
"-"
;
timeStr
+=
curTime
.
getHours
()
+
"-"
;
timeStr
+=
curTime
.
getMinutes
()
+
"-"
;
timeStr
+=
curTime
.
getSeconds
();
return
timeStr
;
}
//把时间戳转为时间格式
static
timestampToDateTime
(
value
)
{
var
theTime
=
parseInt
(
value
);
// 秒
...
...
@@ -266,6 +228,10 @@ ClassDataProxy.token ="";
ClassDataProxy
.
status
=
false
;
ClassDataProxy
.
id
=
''
;
ClassDataProxy
.
userMobile
=
''
;
ClassDataProxy
.
userEmail
=
''
;
ClassDataProxy
.
monicker
=
""
;
ClassDataProxy
.
USER_TYPE_0
=
0
;
ClassDataProxy
.
USER_TYPE_1
=
1
;
ClassDataProxy
.
USER_TYPE_2
=
2
;
...
...
请
注册
或
登录
后发表评论