Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_kyxq
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
middleLayer_for_kyxq
Commits
f1e39bae
Commit
f1e39bae
authored
Nov 09, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并发音显示列表
parent
235d5aa0
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2312 additions
and
1482 deletions
+2312
-1482
middleLayer_for_kyxq.fire
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
+2284
-1470
LessonReport.ts
assets/middleLayer_for_kyxq/script/LessonReport.ts
+28
-12
No files found.
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
View file @
f1e39bae
This diff is collapsed.
Click to expand it.
assets/middleLayer_for_kyxq/script/LessonReport.ts
View file @
f1e39bae
...
@@ -34,8 +34,9 @@ export default class NewClass extends cc.Component {
...
@@ -34,8 +34,9 @@ export default class NewClass extends cc.Component {
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
stars
:
cc
.
Node
=
null
;
stars
:
cc
.
Node
=
null
;
// 语音Item 模板
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
scente
nceItem
:
cc
.
Node
=
null
;
pronou
nceItem
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
storyItem
:
cc
.
Node
=
null
;
storyItem
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
...
@@ -72,12 +73,16 @@ export default class NewClass extends cc.Component {
...
@@ -72,12 +73,16 @@ export default class NewClass extends cc.Component {
nd_storyHFWord
:
cc
.
Node
=
null
;
nd_storyHFWord
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
nd_storyStory
:
cc
.
Node
=
null
;
nd_storyStory
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
nd_procA
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
nd_procB
:
cc
.
Node
=
null
;
// LIFE-CYCLE CALLBACKS:
// LIFE-CYCLE CALLBACKS:
m_sentenceNodeList
=
[]
m_sentenceNodeList
=
[]
onLoad
()
{
onLoad
()
{
this
.
scente
nceItem
.
active
=
false
this
.
pronou
nceItem
.
active
=
false
this
.
storyItem
.
zIndex
=
111
this
.
storyItem
.
zIndex
=
111
this
.
itemCnt
.
zIndex
=
-
1
this
.
itemCnt
.
zIndex
=
-
1
}
}
...
@@ -106,7 +111,7 @@ export default class NewClass extends cc.Component {
...
@@ -106,7 +111,7 @@ export default class NewClass extends cc.Component {
this
.
title
.
string
=
_data
.
name
this
.
title
.
string
=
_data
.
name
this
.
unit
.
string
=
_data
.
unitName
this
.
unit
.
string
=
_data
.
unitName
this
.
last_play
.
string
=
lastDate
?
`
${
dateFormate
(
"
yyyy.MM.dd
"
,
lastDate
)}
学习过`
:
"
未学过1
"
this
.
last_play
.
string
=
lastDate
?
`
${
dateFormate
(
"
yyyy.MM.dd
"
,
lastDate
)}
学习过`
:
"
未学过1
"
this
.
question_right_percent1
.
string
=
_data
.
question_right_percent
// 正确率 - 白色描边
this
.
question_right_percent1
.
string
=
""
;
//
_data.question_right_percent // 正确率 - 白色描边
this
.
question_right_percent2
.
string
=
_data
.
question_right_percent
// 正确率 - 主体红字
this
.
question_right_percent2
.
string
=
_data
.
question_right_percent
// 正确率 - 主体红字
this
.
study_duration
.
string
=
_data
.
study_duration
>
999
?
Math
.
floor
(
_data
.
study_duration
/
60
*
10
)
/
10
:
_data
.
study_duration
// 学习时长
this
.
study_duration
.
string
=
_data
.
study_duration
>
999
?
Math
.
floor
(
_data
.
study_duration
/
60
*
10
)
/
10
:
_data
.
study_duration
// 学习时长
this
.
study_duration_unit
.
string
=
_data
.
study_duration
>
999
?
"
小时
"
:
"
分钟
"
;
this
.
study_duration_unit
.
string
=
_data
.
study_duration
>
999
?
"
小时
"
:
"
分钟
"
;
...
@@ -119,12 +124,13 @@ export default class NewClass extends cc.Component {
...
@@ -119,12 +124,13 @@ export default class NewClass extends cc.Component {
}
}
this
.
m_sentenceNodeList
=
[]
this
.
m_sentenceNodeList
=
[]
this
.
nd_procA
.
active
=
_data
.
excellents
.
length
!=
0
;
for
(
let
v
of
_data
.
excellents
)
{
for
(
let
v
of
_data
.
excellents
)
{
this
.
m_sentenceNodeList
.
push
(
this
.
createItem
(
v
,
"
优秀发音
"
))
this
.
m_sentenceNodeList
.
push
(
this
.
createItem
(
v
,
this
.
nd_procA
))
}
}
this
.
nd_procB
.
active
=
_data
.
tryagains
.
length
!=
0
;
for
(
let
v
of
_data
.
tryagains
)
{
for
(
let
v
of
_data
.
tryagains
)
{
this
.
m_sentenceNodeList
.
push
(
this
.
createItem
(
v
,
"
薄弱跟读
"
))
this
.
m_sentenceNodeList
.
push
(
this
.
createItem
(
v
,
this
.
nd_procB
))
}
}
// 句子
// 句子
...
@@ -189,16 +195,24 @@ export default class NewClass extends cc.Component {
...
@@ -189,16 +195,24 @@ export default class NewClass extends cc.Component {
this
.
reportSV
.
scrollToTop
()
this
.
reportSV
.
scrollToTop
()
}
}
createItem
(
v
,
titleStr
)
{
createItem
(
v
,
parent
)
{
let
_node
=
cc
.
instantiate
(
this
.
scente
nceItem
)
let
_node
=
cc
.
instantiate
(
this
.
pronou
nceItem
)
_node
.
active
=
true
_node
.
active
=
true
this
.
cont
ent
.
addChild
(
_node
)
par
ent
.
addChild
(
_node
)
// 星星的判定标准需要改
// 星星的判定标准需要改
for
(
let
i
=
1
;
i
<=
3
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
3
;
i
++
)
{
_node
.
getChildByName
(
`star
${
i
}
`
).
active
=
v
.
overall
>=
i
*
33
// 高亮
_node
.
getChildByName
(
`active_star
${
i
}
`
).
active
=
v
.
overall
>=
i
*
33
;
// 非高亮
_node
.
getChildByName
(
`star
${
i
}
`
).
active
=
v
.
overall
<
i
*
33
}
}
_node
.
getChildByName
(
"
lbl
"
).
getComponent
(
cc
.
Label
).
string
=
v
.
test_text
_node
.
getChildByName
(
"
title
"
).
getComponent
(
cc
.
Label
).
string
=
titleStr
// 判断一下字数,超长以后截掉,补省略号
let
contentText
=
v
.
test_text
;
if
(
contentText
.
length
>
22
)
{
contentText
=
contentText
.
substring
(
0
,
22
)
+
"
...
"
}
_node
.
getChildByName
(
"
lbl
"
).
getComponent
(
cc
.
Label
).
string
=
contentText
let
btn_stop
=
_node
.
getChildByName
(
"
btn_stop
"
)
let
btn_stop
=
_node
.
getChildByName
(
"
btn_stop
"
)
let
btn_play
=
_node
.
getChildByName
(
"
btn_play
"
)
let
btn_play
=
_node
.
getChildByName
(
"
btn_play
"
)
...
@@ -234,9 +248,11 @@ export default class NewClass extends cc.Component {
...
@@ -234,9 +248,11 @@ export default class NewClass extends cc.Component {
});
});
})
})
})
})
btn_stop
.
on
(
"
click
"
,
()
=>
{
btn_stop
.
on
(
"
click
"
,
()
=>
{
this
.
stopAudio
()
this
.
stopAudio
()
})
})
_node
.
on
(
"
stop_audio
"
,
()
=>
{
_node
.
on
(
"
stop_audio
"
,
()
=>
{
btn_play
.
active
=
true
btn_play
.
active
=
true
btn_stop
.
active
=
false
btn_stop
.
active
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment