Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
ls_gramophone
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
ls_gramophone
Commits
bc618756
Commit
bc618756
authored
Jun 21, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.20调整
parent
e34eeed3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
355 additions
and
51 deletions
+355
-51
ls_gramophone.meta
assets/ls_gramophone.meta
+15
-1
ls_gramophone.fire
assets/ls_gramophone/scene/ls_gramophone.fire
+244
-10
ls_gramophone.ts
assets/ls_gramophone/scene/ls_gramophone.ts
+29
-15
btn_last.png
assets/ls_gramophone/textures/btn_last.png
+0
-0
btn_last.png.meta
assets/ls_gramophone/textures/btn_last.png.meta
+36
-0
form.component.html
form/src/app/form/form.component.html
+31
-25
No files found.
assets/ls_gramophone.meta
View file @
bc618756
{"ver":"1.1.2","uuid":"4e7ab4f4-4d24-404d-84db-f43ee5136c53","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "4e7ab4f4-4d24-404d-84db-f43ee5136c53",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/ls_gramophone/scene/ls_gramophone.fire
View file @
bc618756
...
...
@@ -118,18 +118,21 @@
},
{
"__id__": 126
},
{
"__id__": 130
}
],
"_active": true,
"_components": [
{
"__id__": 13
0
"__id__": 13
4
},
{
"__id__": 13
1
"__id__": 13
5
},
{
"__id__": 13
2
"__id__": 13
6
}
],
"_prefab": null,
...
...
@@ -3624,7 +3627,7 @@
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX":
5
0,
"_N$spacingX": 0,
"_N$spacingY": 15,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
...
...
@@ -3802,8 +3805,8 @@
"_enabled": true,
"horizontal": true,
"vertical": true,
"inertia":
tru
e,
"brake":
0.4
,
"inertia":
fals
e,
"brake":
1
,
"elastic": true,
"bounceDuration": 0.1,
"scrollEvents": [],
...
...
@@ -3814,10 +3817,10 @@
"content": {
"__id__": 74
},
"scrollThreshold": 0.
5
,
"autoPageTurningThreshold":
5
00,
"pageTurningEventTiming": 0.
8
,
"pageTurningSpeed": 0.
3
,
"scrollThreshold": 0.
9
,
"autoPageTurningThreshold":
3
00,
"pageTurningEventTiming": 0.
1
,
"pageTurningSpeed": 0.
1
,
"pageEvents": [],
"_N$sizeMode": 0,
"_N$direction": 0,
...
...
@@ -6220,6 +6223,234 @@
"_N$target": null,
"_id": "15HkoamNxAXYUbyeq1Sc83"
},
{
"__type__": "cc.Node",
"_name": "btn_last",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 131
}
],
"_active": true,
"_components": [
{
"__id__": 133
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-27.636,
-320,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4ezmuiPOFHYIrRJjLMgQqi"
},
{
"__type__": "cc.Node",
"_name": "btn_arrow",
"_objFlags": 0,
"_parent": {
"__id__": 130
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 132
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 79,
"height": 54
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.623,
-0.894,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "7dvJsICDFCk6EzbgKE/hoQ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 131
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "35afc627-cf82-476e-a954-bb4d6e254b18"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "fbfVEwA/NBKLB93oUH5SPf"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 130
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "c0fJJ8YktCzqXcyZvtRYij"
},
{
"__type__": "cc.Canvas",
"_name": "",
...
...
@@ -6287,6 +6518,9 @@
"btn_arrow": {
"__id__": 126
},
"btn_last": {
"__id__": 130
},
"_id": "eaTVUpqahPfZeO9+sUI7RP"
}
]
\ No newline at end of file
assets/ls_gramophone/scene/ls_gramophone.ts
View file @
bc618756
...
...
@@ -31,6 +31,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
btn_arrow
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
btn_last
:
cc
.
Node
=
null
;
// 录音中
_recording
=
false
;
// 录音音频
...
...
@@ -198,7 +201,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
pag
.
getComponent
(
cc
.
PageView
).
enabled
=
false
;
// 录音界面
let
mask
=
cc
.
find
(
'
Canvas/mask
'
);
mask
.
active
=
false
;
...
...
@@ -364,7 +367,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
resetRecord
();
});
this
.
btn_arrow
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onArrow
,
this
);
this
.
btn_last
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onLast
,
this
);
this
.
setPagBg
();
this
.
refreshArrow
();
}
private
roundIdx
;
private
setPagBg
()
{
...
...
@@ -387,31 +392,40 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
private
refreshArrow
()
{
this
.
btn_last
.
active
=
this
.
roundIdx
>
0
;
this
.
btn_arrow
.
active
=
this
.
roundIdx
<
this
.
data
.
questions
.
length
-
1
;
}
private
arrowTouch
=
false
;
private
onArrow
()
{
if
(
this
.
arrowTouch
)
return
;
this
.
arrowTouch
=
true
;
this
.
roundIdx
++
;
let
pag
=
cc
.
find
(
"
PageView
"
,
this
.
node
);
pag
.
getComponent
(
cc
.
PageView
).
enabled
=
true
;
pag
.
getComponent
(
cc
.
PageView
).
scrollToPage
(
this
.
roundIdx
,
0.1
);
this
.
setPagBg
();
this
.
refreshArrow
();
}
private
onLast
()
{
if
(
this
.
arrowTouch
)
return
;
this
.
arrowTouch
=
true
;
this
.
roundIdx
--
;
let
pag
=
cc
.
find
(
"
PageView
"
,
this
.
node
);
let
len
=
pag
.
getComponent
(
cc
.
PageView
).
getPages
().
length
;
if
(
len
<=
1
)
return
;
pag
.
getComponent
(
cc
.
PageView
).
scrollToPage
(
1
,
0.5
);
setTimeout
(()
=>
{
this
.
setPagBg
();
this
.
arrowTouch
=
false
;
pag
.
getComponent
(
cc
.
PageView
).
removePageAtIndex
(
0
);
},
600
);
pag
.
getComponent
(
cc
.
PageView
).
enabled
=
true
;
pag
.
getComponent
(
cc
.
PageView
).
scrollToPage
(
this
.
roundIdx
,
0.1
);
this
.
setPagBg
();
this
.
refreshArrow
();
}
private
pageTurning
()
{
if
(
this
.
arrowTouch
)
return
;
this
.
roundIdx
++
;
let
pag
=
cc
.
find
(
"
PageView
"
,
this
.
node
);
let
idx
=
pag
.
getComponent
(
cc
.
PageView
).
getCurrentPageIndex
();
if
(
idx
!=
0
)
{
pag
.
getComponent
(
cc
.
PageView
).
removePageAtIndex
(
0
);
}
this
.
setPagBg
();
this
.
log
(
"
31232
"
)
pag
.
getComponent
(
cc
.
PageView
).
scrollToPage
(
this
.
roundIdx
,
0.1
);
setTimeout
(()
=>
{
pag
.
getComponent
(
cc
.
PageView
).
enabled
=
false
;
this
.
arrowTouch
=
false
;
},
200
);
}
/**
* 重置文字
...
...
assets/ls_gramophone/textures/btn_last.png
0 → 100644
View file @
bc618756
2.07 KB
assets/ls_gramophone/textures/btn_last.png.meta
0 → 100644
View file @
bc618756
{
"ver": "2.3.5",
"uuid": "1961dc02-5b8a-49af-9e52-e93d86d4dfd3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 79,
"height": 54,
"platformSettings": {},
"subMetas": {
"btn_last": {
"ver": "1.0.4",
"uuid": "35afc627-cf82-476e-a954-bb4d6e254b18",
"rawTextureUuid": "1961dc02-5b8a-49af-9e52-e93d86d4dfd3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 79,
"height": 54,
"rawWidth": 79,
"rawHeight": 54,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
form/src/app/form/form.component.html
View file @
bc618756
...
...
@@ -74,7 +74,7 @@
</style>
<div
class=
"model-content"
>
<div
nz-row
>
<div
nz-row
style=
"margin: 20px;width: 1000px;"
>
<div
nz-col
[
nzSpan
]="
18
"
[
nzOffset
]="
1
"
>
<nz-card
nzTitle=
"标题信息"
>
<nz-form-item>
...
...
@@ -91,85 +91,91 @@
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
题目音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<nz-form-control
[
nzSpan
]="
20
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
questionTextAudio
"
[
_audioName
]="
item
.
questionTextAudioName
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
questionTextAudio
')"
(
audioName
)="
onAudioName
($
event
,
item
,
'
questionTextAudioName
')"
></app-audio-recorder>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
questionTextAudio
')"
(
audioName
)="
onAudioName
($
event
,
item
,
'
questionTextAudioName
')"
></app-audio-recorder>
</nz-form-control>
</nz-form-item>
</nz-card>
</div>
</div>
<br/>
<br
/>
<!--页面区域-->
<div
nz-row
>
<div
nz-row
style=
"margin: 20px;width: 1000px;"
>
<div
nz-col
[
nzSpan
]="
18
"
[
nzOffset
]="
1
"
>
<div
*
ngFor=
"let page of item.questions; let j=index"
style=
"margin-bottom: 5mm;"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
24
'
[
nzMd
]='
24
'
[
nzLg
]='
24
'
>
<div
*
ngFor=
"let page of item.questions; let j=index"
style=
"margin-bottom: 5mm;"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
24
'
[
nzMd
]='
24
'
[
nzLg
]='
24
'
>
<nz-card
nzTitle=
"第{{j+1}}页"
[
nzHoverable
]="
true
"
[
nzExtra
]="
actionCard
"
>
<!--题目区域-->
<div
nz-row
>
<div
style=
"width: 800px;"
nz-row
>
<div
nz-col
[
nzSpan
]="
18
"
[
nzOffset
]="
1
"
>
<nz-card
nzTitle=
"故事图片及完整音频"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
完整音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<nz-form-control
[
nzSpan
]="
20
"
>
<app-audio-recorder
[
audioUrl
]="
page
.
audio
"
[
_audioName
]="
page
.
audioName
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
page
,
'
audio
')"
(
audioName
)="
onAudioName
($
event
,
page
,
'
audioName
')"
></app-audio-recorder>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
page
,
'
audio
')"
(
audioName
)="
onAudioName
($
event
,
page
,
'
audioName
')"
></app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
故事图片
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-upload-image-with-preview
style=
"width: 100%"
[
picUrl
]="
page
.
pageImage
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
page
,
'
pageImage
')"
></app-upload-image-with-preview>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
page
,
'
pageImage
')"
></app-upload-image-with-preview>
</nz-form-control>
</nz-form-item>
</nz-card>
</div>
</div>
<br/>
<br
/>
<!--题目区域-->
<div
nz-row
>
<div
nz-row
style=
"width: 800px;"
>
<div
nz-col
[
nzSpan
]="
18
"
[
nzOffset
]="
1
"
>
<h4
nz-typography
>
文本内容:
</h4>
<div
*
ngFor=
"let data of page.options; let i=index"
style=
"margin-bottom: 5mm;"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
24
'
[
nzMd
]='
24
'
[
nzLg
]='
24
'
>
<div
*
ngFor=
"let data of page.options; let i=index"
style=
"margin-bottom: 5mm;"
nz-col
[
nzXs
]='
24
'
[
nzSm
]='
24
'
[
nzMd
]='
24
'
[
nzLg
]='
24
'
>
<nz-card
nzTitle=
"文本{{i+1}}"
[
nzHoverable
]="
true
"
[
nzExtra
]="
actionCard
"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
20
"
>
<app-audio-recorder
[
audioUrl
]="
data
.
audio
"
[
_audioName
]="
data
.
audioName
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
data
,
'
audio
')"
(
audioName
)="
onAudioName
($
event
,
data
,
'
audioName
')"
></app-audio-recorder>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
data
,
'
audio
')"
(
audioName
)="
onAudioName
($
event
,
data
,
'
audioName
')"
></app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
<font
style=
"color: red;"
>
*
</font>
文本
</nz-form-label>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<textarea
nz-input
rows=
"4"
[(
ngModel
)]="
data
.
text
"
(
blur
)="
save
()"
placeholder=
"输入文本内容"
></textarea>
<textarea
nz-input
rows=
"4"
[(
ngModel
)]="
data
.
text
"
(
blur
)="
save
()"
placeholder=
"输入文本内容"
></textarea>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
>
录音时间(s)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
type=
"text"
[(
ngModel
)]="
data
.
duration
"
(
blur
)="
save
()"
placeholder=
"录音超过时间自动提交成绩"
>
<input
nz-input
type=
"text"
[(
ngModel
)]="
data
.
duration
"
(
blur
)="
save
()"
placeholder=
"录音超过时间自动提交成绩"
>
</nz-form-control>
</nz-form-item>
</nz-card>
<ng-template
#
actionCard
>
<button
nz-button
nzType=
"danger"
(
click
)="
removeoption
(
j
,
i
)"
>
<i
nz-icon
nzType=
"delete"
nzTheme=
"outline"
></i>
删除
</button>
<button
nz-button
nzType=
"default"
(
click
)="
copyoption
(
j
,
i
)"
>
</button>
<button
nz-button
nzType=
"default"
(
click
)="
copyoption
(
j
,
i
)"
>
<i
nz-icon
nzType=
"copy"
nzTheme=
"outline"
></i>
复制
</button>
</button>
</ng-template>
</div>
</div>
</div>
<br/>
<br
/>
<div
nz-row
>
<div
nz-col
[
nzSpan
]="
18
"
[
nzOffset
]="
1
"
>
<button
nz-button
nzType=
"primary"
nzSize=
"large"
(
click
)="
addoption
(
j
)"
>
...
...
@@ -177,7 +183,7 @@
</button>
</div>
</div>
<br/>
<br
/>
</nz-card>
<ng-template
#
actionCard
>
<button
nz-button
nzType=
"danger"
(
click
)="
removequestion
(
j
)"
>
...
...
@@ -194,7 +200,7 @@
</button>
</div>
</div>
<nz-modal
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="
null
"
[
nzContent
]="
modalContent
"
[
nzFooter
]="
modalFooter
"
(
nzOnCancel
)="
handleCancel
()"
>
...
...
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