Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU03
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
PU03
Commits
2ea4551e
Commit
2ea4551e
authored
Jun 15, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
65c3a252
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
55 deletions
+90
-55
ng-template-generator_20200615 14-02-03.zip
publish/ng-template-generator_20200615 14-02-03.zip
+0
-0
form.component.html
src/app/form/form.component.html
+8
-8
form.component.ts
src/app/form/form.component.ts
+24
-4
play.component.ts
src/app/play/play.component.ts
+58
-43
6.png
src/assets/play/6.png
+0
-0
7.png
src/assets/play/7.png
+0
-0
No files found.
publish/ng-template-generator_2020061
4 19-35-57
.zip
→
publish/ng-template-generator_2020061
5 14-02-03
.zip
View file @
2ea4551e
No preview for this file type
src/app/form/form.component.html
View file @
2ea4551e
...
@@ -15,21 +15,21 @@
...
@@ -15,21 +15,21 @@
<span>
显示选项
</span><span>
:
</span>
<span>
显示选项
</span><span>
:
</span>
</div>
</div>
<div
style=
"flex:3"
>
<div
style=
"flex:3"
>
<nz-radio-group
[(
ngModel
)]="
item
.
contentObj
.
mainQuestion
.
type
"
(
ngModelChange
)="
saveItem
()"
>
<nz-radio-group
[(
ngModel
)]="
contentObj
.
mainQuestion
.
type
"
(
ngModelChange
)="
saveItem
()"
>
<label
nz-radio
[
nzValue
]="'
Text
'"
>
文字
</label>
<label
nz-radio
[
nzValue
]="'
Text
'"
>
文字
</label>
<label
nz-radio
[
nzValue
]="'
Image
'"
>
图片
</label>
<label
nz-radio
[
nzValue
]="'
Image
'"
>
图片
</label>
<label
nz-radio
[
nzValue
]="'
LongAudio
'"
>
长音频
</label>
<label
nz-radio
[
nzValue
]="'
LongAudio
'"
>
长音频
</label>
</nz-radio-group>
</nz-radio-group>
</div>
</div>
<div
style=
"flex:8"
>
<div
style=
"flex:8"
>
<div
*
ngIf=
"
item.
contentObj.mainQuestion.type=='Image'"
>
<div
*
ngIf=
"contentObj.mainQuestion.type=='Image'"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
item
.
contentObj
.
mainQuestion
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
item
.
contentObj
.
mainQuestion
,
'
image_url
')"
></app-upload-image-with-preview>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
contentObj
.
mainQuestion
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
contentObj
.
mainQuestion
,
'
image_url
')"
></app-upload-image-with-preview>
</div>
</div>
<div
*
ngIf=
"
item.
contentObj.mainQuestion.type=='Text'"
>
<div
*
ngIf=
"contentObj.mainQuestion.type=='Text'"
>
<textarea
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
item
.
contentObj
.
mainQuestion
.
text
"
(
blur
)="
saveItem
()"
></textarea>
<textarea
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
contentObj
.
mainQuestion
.
text
"
(
blur
)="
saveItem
()"
></textarea>
</div>
</div>
<div
*
ngIf=
"
item.
contentObj.mainQuestion.type=='LongAudio'"
>
<div
*
ngIf=
"contentObj.mainQuestion.type=='LongAudio'"
>
<app-audio-recorder
[
audioUrl
]="
item
.
contentObj
.
mainQuestion
.
longAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
item
,
'
longAudio_url
')"
></app-audio-recorder>
<app-audio-recorder
[
audioUrl
]="
contentObj
.
mainQuestion
.
longAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
contentObj
.
mainQuestion
,
'
longAudio_url
')"
></app-audio-recorder>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<span>
短音频
</span><span>
:
</span>
<span>
短音频
</span><span>
:
</span>
</div>
</div>
<div
style=
"flex:3"
>
<div
style=
"flex:3"
>
<app-audio-recorder
[
audioUrl
]="
item
.
contentObj
.
mainQuestion
.
shortAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
item
,
'
shortAudio_url
')"
></app-audio-recorder>
<app-audio-recorder
[
audioUrl
]="
contentObj
.
mainQuestion
.
shortAudio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
contentObj
.
mainQuestion
,
'
shortAudio_url
')"
></app-audio-recorder>
</div>
</div>
<div
style=
"flex:8"
></div>
<div
style=
"flex:8"
></div>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
2ea4551e
...
@@ -20,6 +20,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -20,6 +20,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
get
item
()
{
get
item
()
{
return
this
.
_item
;
return
this
.
_item
;
}
}
contentObj
=
{
"
version
"
:
"
1.0
"
,
key
:
"
DataKey_PU03
"
,
mainQuestion
:{
type
:
"
Text
"
,
text
:
""
,
image_url
:
""
,
shortAudio_url
:
""
,
longAudio_url
:
""
},
textUp
:[],
textDown
:[]
}
@
Output
()
@
Output
()
update
=
new
EventEmitter
();
update
=
new
EventEmitter
();
...
@@ -32,7 +45,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -32,7 +45,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
.
contentObj
=
{};
this
.
item
.
contentObj
=
{};
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
getData
((
data
)
=>
{
getData
((
data
)
=>
{
//
console.log("读取数据", data)
console
.
log
(
"
读取数据
"
,
data
)
if
(
data
)
{
if
(
data
)
{
this
.
item
=
data
;
this
.
item
=
data
;
}
else
{
}
else
{
...
@@ -42,7 +55,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -42,7 +55,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
.
contentObj
=
{};
this
.
item
.
contentObj
=
{};
}
}
this
.
init
();
this
.
init
();
//
this.refresh();
this
.
refresh
();
this
.
save
()
this
.
save
()
},
this
.
KEY
);
},
this
.
KEY
);
}
}
...
@@ -54,9 +67,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -54,9 +67,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
init
()
{
init
()
{
if
(
!
this
.
item
.
contentObj
||
!
this
.
item
.
contentObj
.
mainQuestion
){
if
(
Object
.
keys
(
this
.
item
.
contentObj
).
length
!=
0
&&
this
.
item
.
contentObj
.
version
&&
this
.
item
.
contentObj
.
version
==
defauleFormData
.
version
)
{
this
.
item
.
contentObj
=
defauleFormData
console
.
log
(
"
读取数据
"
,
this
.
item
.
contentObj
)
this
.
contentObj
=
this
.
item
.
contentObj
;
}
else
{
this
.
contentObj
=
defauleFormData
;
// console.log("使用默认数据", this.contentObj)
this
.
item
.
contentObj
=
this
.
contentObj
;
}
}
this
.
options
=
[]
this
.
options
=
[]
this
.
item
.
contentObj
.
textDown
.
forEach
((
item
,
index
)
=>
{
this
.
item
.
contentObj
.
textDown
.
forEach
((
item
,
index
)
=>
{
this
.
options
.
push
(
index
)
this
.
options
.
push
(
index
)
...
...
src/app/play/play.component.ts
View file @
2ea4551e
...
@@ -170,10 +170,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -170,10 +170,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// 映射预加载音频[网路]资源 返回包含音频路径的数组
// 映射预加载音频[网路]资源 返回包含音频路径的数组
mapToAduioArray
(
contentObj
){
mapToAduioArray
(
contentObj
){
let
array
=
[]
let
array
=
[]
if
(
contentObj
.
mainQuestion
.
type
==
"
Image
"
){
if
(
contentObj
.
mainQuestion
.
type
==
"
LongAudio
"
){
array
.
push
(
contentObj
.
mainQuestion
.
shortAudio_url
)
array
.
push
(
contentObj
.
mainQuestion
.
longAudio_url
)
array
.
push
(
contentObj
.
mainQuestion
.
longAudio_url
)
}
}
array
.
push
(
contentObj
.
mainQuestion
.
shortAudio_url
)
return
array
return
array
}
}
...
@@ -476,7 +476,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -476,7 +476,10 @@ export class PlayComponent implements OnInit, OnDestroy {
longAudio
.
audio
=
this
.
g_cartoon
.
audio
.
get
(
this
.
g_formData
.
mainQuestion
.
longAudio_url
)
longAudio
.
audio
=
this
.
g_cartoon
.
audio
.
get
(
this
.
g_formData
.
mainQuestion
.
longAudio_url
)
// 时间标签
// 时间标签
let
time
=
longAudio
.
audio
.
duration
let
time
=
0
;
if
(
longAudio
.
audio
){
time
=
longAudio
.
audio
.
duration
}
let
endTime
=
Math
.
floor
(
time
/
60
)
let
endTime
=
Math
.
floor
(
time
/
60
)
let
timeString
=
""
let
timeString
=
""
if
(
endTime
<
9
){
if
(
endTime
<
9
){
...
@@ -514,6 +517,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -514,6 +517,10 @@ export class PlayComponent implements OnInit, OnDestroy {
slider
.
enableSlider
=
false
;
slider
.
enableSlider
=
false
;
slider
.
release
=
()
=>
{
slider
.
release
=
()
=>
{
if
(
!
longAudio
.
audio
){
this
.
g_enableMapUp
=
true
;
return
;
}
slider
.
enableSlider
=
false
;
slider
.
enableSlider
=
false
;
this
.
g_enableMapDown
=
true
;
this
.
g_enableMapDown
=
true
;
longAudio
.
refreshAudioProgress
();
longAudio
.
refreshAudioProgress
();
...
@@ -533,6 +540,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -533,6 +540,7 @@ export class PlayComponent implements OnInit, OnDestroy {
})
})
// 音频时间
// 音频时间
if
(
longAudio
.
audio
){
longAudio
.
audio
.
onended
=
()
=>
{
longAudio
.
audio
.
onended
=
()
=>
{
longAudio
.
pause
()
longAudio
.
pause
()
longAudio
.
pause_icon
.
visible
=
false
;
longAudio
.
pause_icon
.
visible
=
false
;
...
@@ -545,7 +553,6 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -545,7 +553,6 @@ export class PlayComponent implements OnInit, OnDestroy {
let
per
=
longAudio
.
audio
.
currentTime
/
time
let
per
=
longAudio
.
audio
.
currentTime
/
time
slider
.
ref
.
x
=
-
(
527
/
2
)
+
527
*
per
slider
.
ref
.
x
=
-
(
527
/
2
)
+
527
*
per
coverColor
.
width
=
slider
.
ref
.
x
-
(
-
(
527
/
2
))
coverColor
.
width
=
slider
.
ref
.
x
-
(
-
(
527
/
2
))
}
}
let
_time
=
parseInt
(
longAudio
.
audio
.
currentTime
)
let
_time
=
parseInt
(
longAudio
.
audio
.
currentTime
)
let
m
=
parseInt
(
_time
/
60
+
""
)
let
m
=
parseInt
(
_time
/
60
+
""
)
...
@@ -558,6 +565,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -558,6 +565,8 @@ export class PlayComponent implements OnInit, OnDestroy {
let
per
=
dis
/
527
let
per
=
dis
/
527
longAudio
.
audio
.
currentTime
=
longAudio
.
audio
.
duration
*
per
longAudio
.
audio
.
currentTime
=
longAudio
.
audio
.
duration
*
per
}
}
}
longAudio
.
ref
.
addChild
(
audioClick
.
ref
)
longAudio
.
ref
.
addChild
(
audioClick
.
ref
)
longAudio
.
ref
.
addChild
(
longAudio_pause
)
longAudio
.
ref
.
addChild
(
longAudio_pause
)
...
@@ -569,6 +578,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -569,6 +578,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// 滑动滑块
// 滑动滑块
this
.
subscribeMapDownEvent
(
slider
.
id
,
()
=>
{
this
.
subscribeMapDownEvent
(
slider
.
id
,
()
=>
{
if
(
!
longAudio
.
audio
){
this
.
g_enableMapDown
=
true
;
return
;
}
if
(
!
slider
.
enableSlider
){
if
(
!
slider
.
enableSlider
){
slider
.
enableSlider
=
true
;
slider
.
enableSlider
=
true
;
this
.
enableMoveAsstant
(()
=>
{
this
.
enableMoveAsstant
(()
=>
{
...
@@ -594,6 +607,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -594,6 +607,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// 播放按钮点击
// 播放按钮点击
this
.
subscribeMapDownEvent
(
audioClick
.
id
,
()
=>
{
this
.
subscribeMapDownEvent
(
audioClick
.
id
,
()
=>
{
if
(
!
longAudio
.
audio
){
this
.
g_enableMapDown
=
true
;
return
;
}
if
(
longAudio
.
isPlay
){
if
(
longAudio
.
isPlay
){
longAudio
.
pause
()
longAudio
.
pause
()
longAudio
.
isPlay
=
false
;
longAudio
.
isPlay
=
false
;
...
@@ -706,21 +723,20 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -706,21 +723,20 @@ export class PlayComponent implements OnInit, OnDestroy {
A3
.
push
(
temp
.
e3
)
A3
.
push
(
temp
.
e3
)
A4
.
push
(
temp
.
e4
)
A4
.
push
(
temp
.
e4
)
A5
.
push
(
temp
.
e5
)
A5
.
push
(
temp
.
e5
)
A6
.
push
(
temp
.
e6
)
})
})
//
let movedDis =this.alignCenter(A1)
let
movedDis
=
this
.
alignCenter
(
A1
)
//
A2.forEach(item=>{
A2
.
forEach
(
item
=>
{
//
item.x = item.x + movedDis
item
.
x
=
item
.
x
+
movedDis
//
})
})
//
A3.forEach(item=>{
A3
.
forEach
(
item
=>
{
//
item.x = item.x + movedDis
item
.
x
=
item
.
x
+
movedDis
//
})
})
//
A4.forEach(item=>{
A4
.
forEach
(
item
=>
{
//
item.x = item.x + movedDis
item
.
x
=
item
.
x
+
movedDis
//
})
})
//
A5.forEach(item=>{
A5
.
forEach
(
item
=>
{
//
item.x = item.x + movedDis
item
.
x
=
item
.
x
+
movedDis
//
})
})
}
}
createCardUp
(
index
,
label
,
pos
){
createCardUp
(
index
,
label
,
pos
){
...
@@ -892,8 +908,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -892,8 +908,7 @@ export class PlayComponent implements OnInit, OnDestroy {
e2
:
panzi
,
e2
:
panzi
,
e3
:
label
,
e3
:
label
,
e4
:
dot
,
e4
:
dot
,
e5
:
card
.
startAni
,
e5
:
dot_red
e6
:
dot_red
}
}
}
}
...
@@ -1013,7 +1028,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1013,7 +1028,7 @@ export class PlayComponent implements OnInit, OnDestroy {
borderRight
.
ref
.
visible
=
true
borderRight
.
ref
.
visible
=
true
// 连接节点
// 连接节点
let
dot
=
this
.
g_cartoon
.
createImage
(
"
icon_dian
1
"
,
(
w
,
h
)
=>
{
let
dot
=
this
.
g_cartoon
.
createImage
(
"
icon_dian
2
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
37
*
this
.
g_mapScale
/
w
,
sx
:
37
*
this
.
g_mapScale
/
w
,
sy
:
37
*
this
.
g_mapScale
/
h
sy
:
37
*
this
.
g_mapScale
/
h
...
...
src/assets/play/6.png
View replaced file @
65c3a252
View file @
2ea4551e
187 Bytes
|
W:
|
H:
1.46 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/7.png
View replaced file @
65c3a252
View file @
2ea4551e
187 Bytes
|
W:
|
H:
1.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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