Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L215
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
East_L215
Commits
d2be6932
Commit
d2be6932
authored
Apr 12, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev completed
parent
0cb0e9f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
form.component.html
src/app/form/form.component.html
+2
-2
form.component.ts
src/app/form/form.component.ts
+16
-8
play.component.ts
src/app/play/play.component.ts
+1
-7
No files found.
src/app/form/form.component.html
View file @
d2be6932
...
...
@@ -23,7 +23,7 @@
</div>
<div
style=
"flex:2"
>
<div>
<nz-select
[(
ngModel
)]="
item
.
contentObj
.
cardContainerSetting
.
type
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
contentObj
.
cardContainerSetting
.
type
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
*
ngFor=
"let p of containerType"
[
nzValue
]="
p
"
[
nzLabel
]="
containerTypeMap
[
p
]"
></nz-option>
</nz-select>
</div>
...
...
@@ -107,7 +107,7 @@
</div>
<div
style=
"float:right; text-align: right; padding-right: 20px;"
>
<button
style=
"margin-bottom: 10px;"
nz-button
nzType=
"danger"
(
click
)="
deleteItem
(
i
)"
>
<span>
删除
本题
</span>
<span>
删除
</span>
</button>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
d2be6932
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
}
from
'
@angular/core
'
;
const
defaultData
=
{
version
:
"
1.3
"
,
bgMusic
:
""
,
dataArray
:[],
cardContainerSetting
:
{
...
...
@@ -19,7 +20,14 @@ const defaultData = {
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
_item
:
any
;
contentObj
contentObj
=
{
bgMusic
:
""
,
dataArray
:[],
cardContainerSetting
:
{
type
:
"
A
"
,
image_url
:
""
}
}
hotZoneItemArr
:
Array
<
Object
>
=
[];
bgItem
:
Object
;
containerTypeMap
=
{
...
...
@@ -71,17 +79,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
init
()
{
if
(
Object
.
keys
(
this
.
item
.
contentObj
).
length
!=
0
)
{
if
(
Object
.
keys
(
this
.
item
.
contentObj
).
length
!=
0
&&
this
.
item
.
contentObj
.
version
&&
this
.
item
.
contentObj
.
version
==
defaultData
.
version
)
{
// console.log("读取数据", this.item.contentObj)
this
.
contentObj
=
this
.
item
.
contentObj
;
}
else
{
this
.
contentObj
=
this
.
getDefaultPicArr
();
// console.log("使用默认数据", this.contentObj)
this
.
item
.
contentObj
=
this
.
contentObj
;
}
console
.
log
(
this
.
contentObj
)
}
cardItemData
(){
return
{
audio_url
:
""
,
displayT
ype
:
"
text
"
,
text
:
""
,
image_url
:
""
}
return
{
audio_url
:
""
,
t
ype
:
"
text
"
,
text
:
""
,
image_url
:
""
}
}
cardChoiceData
(){
...
...
@@ -141,8 +150,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
onTitleAudioUploadSuccess
(
e
)
{
this
.
item
.
contentObj
.
bgMusic
=
e
.
url
;
onTitleAudioUploadSuccess
(
e
)
{
this
.
contentObj
.
bgMusic
=
e
.
url
;
this
.
save
();
}
...
...
@@ -162,14 +171,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
saveItem
()
{
console
.
log
(
this
.
item
.
contentObj
.
bgMusic
)
this
.
save
();
}
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
KEY
);
this
.
refresh
();
console
.
log
(
"
保存
"
,
this
.
item
)
//
console.log("保存", this.item)
}
refresh
()
{
...
...
src/app/play/play.component.ts
View file @
d2be6932
...
...
@@ -384,8 +384,6 @@ export class PlayComponent implements OnInit, OnDestroy {
pos
.
sy
=
228
*
this
.
g_mapScale
;
break
;
}
console
.
log
(
this
.
g_cartoon
.
images
.
get
(
this
.
g_formData
.
cardContainerSetting
.
image_url
))
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
'
card-container
'
,
pos
.
image
,
(
w
,
h
)
=>
{
return
{
sx
:
pos
.
sx
/
w
,
...
...
@@ -397,7 +395,6 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
this
.
g_cartoon
.
getOrigin
().
y
-
(
h
/
2
)
*
this
.
g_mapScale
+
pos
.
y
}
})
console
.
log
(
element
)
this
.
render
(
element
.
ref
)
}
...
...
@@ -898,7 +895,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this
.
subscribeMapDownEvent
(
"
start-button
"
,
()
=>
{
console
.
log
(
"
Ok - Clikc
"
)
element
.
click
()
})
...
...
@@ -921,7 +917,6 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
ref
.
scaleX
=
0
;
element
.
ref
.
scaleY
=
0
;
element
.
show
=
()
=>
{
console
.
log
(
"
Show
"
)
element
.
ref
.
scaleX
=
element
.
ref
.
initScaleX
;
element
.
ref
.
scaleY
=
element
.
ref
.
initScaleY
;
}
...
...
@@ -932,7 +927,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this
.
subscribeMapDownEvent
(
"
restart-button
"
,
()
=>
{
console
.
log
(
"
Res - click
"
)
element
.
hide
()
this
.
restartGame
()
})
...
...
@@ -1076,7 +1070,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// ----------------------------------
initDefaultData
()
{
if
(
Object
.
keys
(
this
.
g_formData
).
length
===
0
)
{
console
.
log
(
"
Init default form data
"
)
//
console.log("Init default form data")
this
.
g_formData
=
defauleFormData
;
}
}
...
...
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