Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_usercenter
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
NJ_usercenter
Commits
f144d97b
Commit
f144d97b
authored
Jun 20, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 录音报告展示
parent
1c7443f4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
66 deletions
+98
-66
NJ_usercenter.fire
assets/NJ_usercenter/scene/NJ_usercenter.fire
+60
-60
NJ_usercenter.ts
assets/NJ_usercenter/scene/NJ_usercenter.ts
+1
-1
clickEvent.ts
assets/NJ_usercenter/script/clickEvent.ts
+37
-5
No files found.
assets/NJ_usercenter/scene/NJ_usercenter.fire
View file @
f144d97b
This diff is collapsed.
Click to expand it.
assets/NJ_usercenter/scene/NJ_usercenter.ts
View file @
f144d97b
...
@@ -41,7 +41,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -41,7 +41,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initData
()
{
initData
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
{
if
(
!
middleLayer
)
{
cc
.
sys
.
localStorage
.
setItem
(
'
token
'
,
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NCwicGhvbmUiOiIxNTUwMDAwMDAwMSIsInNpZ24iOi
JmYWYxMzkxZi1iYzk4LTQ1ZjUtYmNjOC1mYjIxZmIyYTY3MmMiLCJpYXQiOjE2NTQ2Njk5OTgsImV4cCI6MTY1NzI2MTk5OH0.4UtU-6XFVgPjvSvlwHLZ74WW6Gqk_n7X5zJvtVEyq_c
'
);
cc
.
sys
.
localStorage
.
setItem
(
'
token
'
,
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NCwicGhvbmUiOiIxNTUwMDAwMDAwMSIsInNpZ24iOi
I3MjhlYzkwZC1kZmIyLTQxMzktOWMyMS0yNGQwZjg4NDYwMmUiLCJpYXQiOjE2NTU3MDY4MjUsImV4cCI6MTY1ODI5ODgyNX0.Rkhjn9MJxXAOoHnjBzjdCcLBtE-87ps5790SIdYQrZE
'
);
}
}
this
.
token
=
cc
.
sys
.
localStorage
.
getItem
(
"
token
"
);
this
.
token
=
cc
.
sys
.
localStorage
.
getItem
(
"
token
"
);
}
}
...
...
assets/NJ_usercenter/script/clickEvent.ts
View file @
f144d97b
import
{
asyncDelay
,
asyncCallNetworkApiGet
,
getSpriteFrimeByUrl
}
from
"
./util
"
;
import
{
asyncDelay
,
asyncCallNetworkApiGet
,
getSpriteFrimeByUrl
,
playAudioByUrl
}
from
"
./util
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
levels
=
{
const
levels
=
{
...
@@ -197,6 +197,14 @@ export default class NewClass extends cc.Component {
...
@@ -197,6 +197,14 @@ export default class NewClass extends cc.Component {
sentenceItem
.
parent
=
node
;
sentenceItem
.
parent
=
node
;
sentenceRow
.
removeAllChildren
();
sentenceRow
.
removeAllChildren
();
sentenceItem
.
parent
=
sentenceRow
;
sentenceItem
.
parent
=
sentenceRow
;
// 录音
const
tips
=
cc
.
find
(
"
tips_bg
"
,
contentNode
);
const
row
=
cc
.
find
(
"
row
"
,
tips
);
row
.
parent
=
node
;
tips
.
removeAllChildren
();
row
.
parent
=
tips
;
}
}
async
onShowLearnDetail
(
evt
:
cc
.
Event
)
{
async
onShowLearnDetail
(
evt
:
cc
.
Event
)
{
...
@@ -219,11 +227,13 @@ export default class NewClass extends cc.Component {
...
@@ -219,11 +227,13 @@ export default class NewClass extends cc.Component {
recordcount
,
recordcount
,
kn_letters
,
kn_letters
,
kn_words
,
kn_words
,
kn_sentences
kn_sentences
,
OP05
,
OP_06_3
}
=
JSON
.
parse
(
res
).
data
;
}
=
JSON
.
parse
(
res
).
data
;
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/recordbg/recordcount
"
).
getComponent
(
cc
.
Label
).
string
=
learntimes
;
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/recordbg/recordcount
"
).
getComponent
(
cc
.
Label
).
string
=
recordcount
;
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/learnbg/learntime
"
).
getComponent
(
cc
.
Label
).
string
=
recordcount
;
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/learnbg/learntime
"
).
getComponent
(
cc
.
Label
).
string
=
learntimes
;
const
resultNode
=
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnresult/itembg
"
);
const
resultNode
=
cc
.
find
(
"
Canvas/reportdetail/view/content/userdetail_scollpage/learnresult/itembg
"
);
...
@@ -298,6 +308,25 @@ export default class NewClass extends cc.Component {
...
@@ -298,6 +308,25 @@ export default class NewClass extends cc.Component {
cc
.
find
(
"
split_line
"
,
resultNode
).
active
=
false
;
cc
.
find
(
"
split_line
"
,
resultNode
).
active
=
false
;
}
}
if
(
OP05
)
{
const
rowData
=
JSON
.
parse
(
OP05
).
result
;
const
tips
=
cc
.
find
(
"
tips_bg
"
,
resultNode
);
const
row
=
cc
.
find
(
"
row
"
,
tips
);
for
(
let
i
=
0
;
i
<
rowData
.
length
;
i
++
)
{
const
{
word
,
score
,
audio_url
}
=
rowData
[
i
];
const
itemClone
=
cc
.
instantiate
(
row
);
itemClone
.
parent
=
tips
;
itemClone
.
active
=
true
;
cc
.
find
(
"
item1/word
"
,
itemClone
).
getComponent
(
cc
.
Label
).
string
=
word
;
cc
.
find
(
"
item3/goodjob
"
,
itemClone
).
active
=
(
score
>=
80
);
cc
.
find
(
"
item2/play_icon
"
,
itemClone
).
attr
({
audio_url
});
}
}
else
{
cc
.
find
(
`Canvas/reportdetail/view/content/userdetail_scollpage/learnresult/itembg/tips_bg/row`
).
active
=
false
;
}
// 设置页面高度
// 设置页面高度
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
const
learnresult
=
cc
.
find
(
`Canvas/reportdetail/view/content/userdetail_scollpage/learnresult`
);
const
learnresult
=
cc
.
find
(
`Canvas/reportdetail/view/content/userdetail_scollpage/learnresult`
);
...
@@ -322,7 +351,10 @@ export default class NewClass extends cc.Component {
...
@@ -322,7 +351,10 @@ export default class NewClass extends cc.Component {
const
animationState
=
playNode
.
getComponent
(
cc
.
Animation
).
getAnimationState
(
"
play1
"
);
const
animationState
=
playNode
.
getComponent
(
cc
.
Animation
).
getAnimationState
(
"
play1
"
);
animationState
.
wrapMode
=
cc
.
WrapMode
.
Loop
;
animationState
.
wrapMode
=
cc
.
WrapMode
.
Loop
;
animationState
.
play
();
animationState
.
play
();
playAudioByUrl
(
node
.
audio_url
,
()
=>
{
animationState
.
stop
();
playNode
.
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