Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt10_tydh
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
ngt10_tydh
Commits
88e32403
Commit
88e32403
authored
Nov 17, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增图片类型
parent
1bad1dfe
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
2047 additions
and
389 deletions
+2047
-389
ngt10_tydh.fire
assets/ngt10_tydh/scene/ngt10_tydh.fire
+1749
-365
ngt10_tydh.ts
assets/ngt10_tydh/scene/ngt10_tydh.ts
+86
-11
Game.ts
assets/ngt10_tydh/scene/tool/Game.ts
+4
-2
defaultData.ts
assets/ngt10_tydh/script/defaultData.ts
+3
-3
bg3.png
assets/ngt10_tydh/textures/bg3.png
+0
-0
bg3.png.meta
assets/ngt10_tydh/textures/bg3.png.meta
+36
-0
bg_text.png
assets/ngt10_tydh/textures/bg_text.png
+0
-0
bg_text.png.meta
assets/ngt10_tydh/textures/bg_text.png.meta
+36
-0
btn_close.png
assets/ngt10_tydh/textures/btn_close.png
+0
-0
btn_close.png.meta
assets/ngt10_tydh/textures/btn_close.png.meta
+36
-0
pic.jpg
assets/ngt10_tydh/textures/pic.jpg
+0
-0
pic.jpg.meta
assets/ngt10_tydh/textures/pic.jpg.meta
+36
-0
pic_box.png
assets/ngt10_tydh/textures/pic_box.png
+0
-0
pic_box.png.meta
assets/ngt10_tydh/textures/pic_box.png.meta
+36
-0
form.component.html
form/src/app/form/form.component.html
+21
-7
form.component.ts
form/src/app/form/form.component.ts
+4
-1
No files found.
assets/ngt10_tydh/scene/ngt10_tydh.fire
View file @
88e32403
This diff is collapsed.
Click to expand it.
assets/ngt10_tydh/scene/ngt10_tydh.ts
View file @
88e32403
...
@@ -37,11 +37,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -37,11 +37,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
img_record
:
cc
.
Node
=
null
;
img_record
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
record_word
:
cc
.
Node
=
null
;
layout_pic
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
question
_word
:
cc
.
Node
=
null
;
layout
_word
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
box2d
:
cc
.
Node
=
null
;
box2d
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
layout_img
:
cc
.
Node
=
null
;
onLoadEnd
()
{
onLoadEnd
()
{
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
...
@@ -69,6 +71,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -69,6 +71,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onRecord
,
this
);
this
.
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onRecord
,
this
);
this
.
btn_laba
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
showLaba
,
this
);
this
.
btn_laba
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
showLaba
,
this
);
this
.
img_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchRecordEnd
,
this
);
this
.
img_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchRecordEnd
,
this
);
cc
.
find
(
"
btn_close
"
,
this
.
layout_img
).
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onCloseTips
,
this
);
pg
.
event
.
on
(
"
game_start
"
,
()
=>
{
pg
.
event
.
on
(
"
game_start
"
,
()
=>
{
this
.
gameStart
();
this
.
gameStart
();
});
});
...
@@ -88,7 +91,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -88,7 +91,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
gameStart
(
isPlayAudio
=
true
)
{
gameStart
(
isPlayAudio
=
true
)
{
Game
.
getIns
().
state
=
GAME_STATE
.
RUNNING
;
Game
.
getIns
().
state
=
GAME_STATE
.
RUNNING
;
this
.
showQuestion
();
this
.
showQuestion
(
isPlayAudio
);
isPlayAudio
&&
this
.
showLaba
();
isPlayAudio
&&
this
.
showLaba
();
}
}
...
@@ -98,8 +101,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -98,8 +101,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
zjz_ske
.
active
=
false
;
zjz_ske
.
active
=
false
;
this
.
playLocalAudio
(
"
again
"
);
this
.
playLocalAudio
(
"
again
"
);
this
.
initData
();
this
.
initData
();
this
.
record_word
.
getComponent
(
cc
.
Label
).
string
=
""
;
//
this.record_word.getComponent(cc.Label).string = "";
this
.
question_word
.
getComponent
(
cc
.
Label
).
string
=
""
;
//
this.question_word.getComponent(cc.Label).string = "";
pg
.
event
.
emit
(
"
mouse_10_num
"
,
Game
.
getIns
().
total
);
pg
.
event
.
emit
(
"
mouse_10_num
"
,
Game
.
getIns
().
total
);
pg
.
event
.
emit
(
'
box2d_init
'
,
Game
.
getIns
().
getTotalPageNum
());
pg
.
event
.
emit
(
'
box2d_init
'
,
Game
.
getIns
().
getTotalPageNum
());
this
.
gameStart
();
this
.
gameStart
();
...
@@ -111,14 +114,84 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -111,14 +114,84 @@ export default class SceneComponent extends MyCocosSceneComponent {
// let item = this.node.getChildByName("item");
// let item = this.node.getChildByName("item");
// item.y -= 5;
// item.y -= 5;
}
}
private
showQuestion
(
showImg
=
true
)
{
private
showQuestion
()
{
let
question
=
Game
.
getIns
().
getCurrentPage
();
let
question
=
Game
.
getIns
().
getCurrentPage
();
this
.
question_word
.
getComponent
(
cc
.
Label
).
string
=
question
.
text
;
if
(
question
.
type
==
"
txt
"
)
{
let
question_word
=
cc
.
find
(
"
question_word
"
,
this
.
layout_word
);
question_word
.
getComponent
(
cc
.
Label
).
string
=
question
.
text
;
let
record_word
=
cc
.
find
(
"
record_word
"
,
this
.
layout_word
);
record_word
.
getComponent
(
cc
.
Label
).
string
=
""
;
this
.
layout_word
.
active
=
true
;
this
.
layout_pic
.
active
=
false
;
}
else
{
let
question_word
=
cc
.
find
(
"
question_word
"
,
this
.
layout_pic
);
question_word
.
getComponent
(
cc
.
Label
).
string
=
question
.
text
;
let
record_word
=
cc
.
find
(
"
record_word
"
,
this
.
layout_pic
);
record_word
.
getComponent
(
cc
.
Label
).
string
=
""
;
let
pic
=
cc
.
find
(
"
pic
"
,
this
.
layout_pic
);
pg
.
view
.
setNetImg
(
pic
,
question
.
picUrl
,
{
w
:
242
,
h
:
242
});
this
.
layout_word
.
active
=
false
;
this
.
layout_pic
.
active
=
true
;
pic
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
showBigPic
,
this
);
showImg
&&
this
.
showLayoutImg
();
}
}
}
private
showRecordWord
(
word
)
{
let
question
=
Game
.
getIns
().
getCurrentPage
();
if
(
question
.
type
==
"
txt
"
)
{
let
record_word
=
cc
.
find
(
"
record_word
"
,
this
.
layout_word
);
record_word
.
getComponent
(
cc
.
Label
).
string
=
word
||
""
;
}
else
{
let
record_word
=
cc
.
find
(
"
record_word
"
,
this
.
layout_pic
);
record_word
.
getComponent
(
cc
.
Label
).
string
=
word
||
""
;
}
}
private
showLayoutImg
(
hide
=
true
)
{
let
question
=
Game
.
getIns
().
getCurrentPage
();
if
(
question
.
type
!=
"
img
"
)
return
;
let
big_pic
=
cc
.
find
(
"
big_pic
"
,
this
.
layout_img
);
big_pic
.
setPosition
(
0
,
0
);
big_pic
.
scale
=
1
;
pg
.
view
.
setNetImg
(
big_pic
,
question
.
picUrl
,
{
w
:
720
,
h
:
720
});
this
.
layout_img
.
active
=
true
;
hide
&&
this
.
tipsActionHide
();
}
private
tipsActionHide
(
isAction
=
true
)
{
let
big_pic
=
cc
.
find
(
"
big_pic
"
,
this
.
layout_img
);
let
small_pic
=
cc
.
find
(
"
small_pic
"
,
this
.
layout_img
);
let
scaleX
=
small_pic
.
width
/
big_pic
.
width
;
let
scaleY
=
small_pic
.
height
/
big_pic
.
height
;
let
t
=
isAction
?
4
:
0
;
let
btn
=
cc
.
find
(
"
btn_close
"
,
this
.
layout_img
);
btn
.
active
=
false
;
cc
.
tween
(
big_pic
).
delay
(
t
).
to
(
0.3
,
{
scaleX
:
scaleX
,
scaleY
:
scaleY
,
x
:
small_pic
.
x
,
y
:
small_pic
.
y
})
.
call
(()
=>
{
this
.
layout_img
.
active
=
false
;
})
.
start
();
}
private
showBigPic
()
{
let
big_pic
=
cc
.
find
(
"
big_pic
"
,
this
.
layout_img
);
let
small_pic
=
cc
.
find
(
"
small_pic
"
,
this
.
layout_img
);
let
scaleX
=
small_pic
.
width
/
big_pic
.
width
;
let
scaleY
=
small_pic
.
height
/
big_pic
.
height
;
big_pic
.
x
=
small_pic
.
x
;
big_pic
.
y
=
small_pic
.
y
;
small_pic
.
scaleX
=
scaleX
;
small_pic
.
scaleY
=
scaleY
;
this
.
layout_img
.
active
=
true
;
let
btn
=
cc
.
find
(
"
btn_close
"
,
this
.
layout_img
);
cc
.
tween
(
big_pic
).
to
(
0.3
,
{
scaleX
:
1
,
scaleY
:
1
,
x
:
0
,
y
:
0
})
.
call
(()
=>
{
btn
.
active
=
true
;
})
.
start
();
}
private
onCloseTips
()
{
this
.
tipsActionHide
(
false
);
}
private
showTip
(
show
=
true
)
{
private
showTip
(
show
=
true
)
{
let
tip_bg
=
cc
.
find
(
"
btn_record/tip_bg
"
,
this
.
node
);
let
tip_bg
=
cc
.
find
(
"
btn_record/tip_bg
"
,
this
.
node
);
...
@@ -224,7 +297,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -224,7 +297,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
this
.
recordIntervalId
)
clearInterval
(
this
.
recordIntervalId
);
if
(
this
.
recordIntervalId
)
clearInterval
(
this
.
recordIntervalId
);
this
.
btn_record
.
active
=
true
;
this
.
btn_record
.
active
=
true
;
this
.
img_record
.
active
=
false
;
this
.
img_record
.
active
=
false
;
this
.
record_word
.
getComponent
(
cc
.
Label
).
string
=
data
.
text
;
this
.
showRecordWord
(
data
.
text
)
if
(
data
.
text
==
Game
.
getIns
().
getCurrentPage
().
word
)
{
if
(
data
.
text
==
Game
.
getIns
().
getCurrentPage
().
word
)
{
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
this
.
playLocalAudio
(
"
diaoluo
"
);
this
.
playLocalAudio
(
"
diaoluo
"
);
...
@@ -288,7 +361,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -288,7 +361,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
emit
(
"
box2d_roll
"
)
pg
.
event
.
emit
(
"
box2d_roll
"
)
}
else
{
}
else
{
this
.
playLocalAudio
(
"
next
"
);
this
.
playLocalAudio
(
"
next
"
);
this
.
record_word
.
getComponent
(
cc
.
Label
).
string
=
""
;
this
.
showRecordWord
(
""
)
this
.
gameStart
();
this
.
gameStart
();
}
}
}
}
...
@@ -332,12 +405,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -332,12 +405,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
start_ske
).
delay
(
1
).
by
(
0.5
,
{
x
:
500
}).
call
(()
=>
{
cc
.
tween
(
start_ske
).
delay
(
1
).
by
(
0.5
,
{
x
:
500
}).
call
(()
=>
{
this
.
layout_start
.
active
=
false
;
this
.
layout_start
.
active
=
false
;
this
.
showLaba
(
true
);
this
.
showLaba
(
true
);
this
.
showLayoutImg
();
}).
start
();
}).
start
();
});
});
}).
start
();
}).
start
();
}
else
{
}
else
{
this
.
layout_start
.
active
=
false
;
this
.
layout_start
.
active
=
false
;
this
.
showLaba
(
true
);
this
.
showLaba
(
true
);
this
.
showLayoutImg
();
}
}
})
})
}
}
...
...
assets/ngt10_tydh/scene/tool/Game.ts
View file @
88e32403
...
@@ -45,16 +45,18 @@ export class Item {
...
@@ -45,16 +45,18 @@ export class Item {
public
audio
;
public
audio
;
public
duration
;
public
duration
;
public
optionList
;
public
optionList
;
public
bgItem
;
public
hotZoneItemArr
;
public
word
;
public
word
;
public
picUrl
;
public
type
;
public
text
:
string
;
public
text
:
string
;
public
isClick
:
boolean
;
public
isClick
:
boolean
;
constructor
(
data
,
page
)
{
constructor
(
data
,
page
)
{
this
.
audio
=
data
.
audio
;
this
.
audio
=
data
.
audio
;
this
.
text
=
data
.
text
;
this
.
text
=
data
.
text
;
this
.
word
=
data
.
word
;
this
.
word
=
data
.
word
;
this
.
type
=
data
.
type
;
this
.
duration
=
data
.
time
;
this
.
duration
=
data
.
time
;
this
.
picUrl
=
data
.
image
;
this
.
page
=
page
;
this
.
page
=
page
;
// this.optionList = data.options.map((o, idx) => {
// this.optionList = data.options.map((o, idx) => {
...
...
assets/ngt10_tydh/script/defaultData.ts
View file @
88e32403
...
@@ -23,13 +23,13 @@ export const defaultData =
...
@@ -23,13 +23,13 @@ export const defaultData =
"
type
"
:
"
img
"
,
"
type
"
:
"
img
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3
"
,
"
text
"
:
"
what are you kettle ?
"
,
"
text
"
:
"
what are you kettle ?
"
,
"
image
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/95c760f287a3c55bacc6c12ea47259ea.jpg
"
,
"
time
"
:
10
,
"
time
"
:
10
,
"
audioName
"
:
"
cape.mp3
"
,
"
audioName
"
:
"
cape.mp3
"
,
"
word
"
:
"
oh no
"
"
word
"
:
"
oh no
"
},
},
{
{
"
type
"
:
"
img
"
,
"
type
"
:
"
txt
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/944ae51b57fb9390dd03104d9651e5f4_l.mp3
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/944ae51b57fb9390dd03104d9651e5f4_l.mp3
"
,
"
text
"
:
"
what your name ?
"
,
"
text
"
:
"
what your name ?
"
,
"
image
"
:
""
,
"
image
"
:
""
,
...
@@ -38,7 +38,7 @@ export const defaultData =
...
@@ -38,7 +38,7 @@ export const defaultData =
"
word
"
:
"
join
"
"
word
"
:
"
join
"
},
},
{
{
"
type
"
:
"
img
"
,
"
type
"
:
"
txt
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3
"
,
"
text
"
:
"
what are you disdain?
"
,
"
text
"
:
"
what are you disdain?
"
,
"
image
"
:
""
,
"
image
"
:
""
,
...
...
assets/ngt10_tydh/textures/bg3.png
0 → 100644
View file @
88e32403
13.5 KB
assets/ngt10_tydh/textures/bg3.png.meta
0 → 100644
View file @
88e32403
{
"ver": "2.3.5",
"uuid": "f2e561fb-156c-4edc-9137-5dc6ef1b3f7f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1096,
"height": 424,
"platformSettings": {},
"subMetas": {
"bg3": {
"ver": "1.0.4",
"uuid": "3f24ea61-fd4e-47c5-92fb-101bf0bd77f7",
"rawTextureUuid": "f2e561fb-156c-4edc-9137-5dc6ef1b3f7f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1096,
"height": 424,
"rawWidth": 1096,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ngt10_tydh/textures/bg_text.png
0 → 100644
View file @
88e32403
4.91 KB
assets/ngt10_tydh/textures/bg_text.png.meta
0 → 100644
View file @
88e32403
{
"ver": "2.3.5",
"uuid": "cb5ae762-1e06-4f54-b95a-ee1b84c36a7c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 911,
"height": 107,
"platformSettings": {},
"subMetas": {
"bg_text": {
"ver": "1.0.4",
"uuid": "d9143143-15c2-4f19-ab93-79f11b0fde4a",
"rawTextureUuid": "cb5ae762-1e06-4f54-b95a-ee1b84c36a7c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 911,
"height": 107,
"rawWidth": 911,
"rawHeight": 107,
"borderTop": 30,
"borderBottom": 30,
"borderLeft": 60,
"borderRight": 60,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ngt10_tydh/textures/btn_close.png
0 → 100644
View file @
88e32403
1.75 KB
assets/ngt10_tydh/textures/btn_close.png.meta
0 → 100644
View file @
88e32403
{
"ver": "2.3.5",
"uuid": "1f5ec521-15a2-49f0-8237-747efff6f487",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 60,
"height": 60,
"platformSettings": {},
"subMetas": {
"btn_close": {
"ver": "1.0.4",
"uuid": "61e4ee90-b002-4136-a69e-d680cb74b360",
"rawTextureUuid": "1f5ec521-15a2-49f0-8237-747efff6f487",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 60,
"rawWidth": 60,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ngt10_tydh/textures/pic.jpg
0 → 100644
View file @
88e32403
15.3 KB
assets/ngt10_tydh/textures/pic.jpg.meta
0 → 100644
View file @
88e32403
{
"ver": "2.3.5",
"uuid": "846774ad-b6a9-4f31-9ac7-6ccc8d505d6e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 250,
"height": 250,
"platformSettings": {},
"subMetas": {
"pic": {
"ver": "1.0.4",
"uuid": "38b63c37-4f15-441d-b599-8804e758545f",
"rawTextureUuid": "846774ad-b6a9-4f31-9ac7-6ccc8d505d6e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 250,
"height": 250,
"rawWidth": 250,
"rawHeight": 250,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ngt10_tydh/textures/pic_box.png
0 → 100644
View file @
88e32403
1.17 KB
assets/ngt10_tydh/textures/pic_box.png.meta
0 → 100644
View file @
88e32403
{
"ver": "2.3.5",
"uuid": "da449a78-119f-43a0-970e-bae114518b2a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 252,
"height": 252,
"platformSettings": {},
"subMetas": {
"pic_box": {
"ver": "1.0.4",
"uuid": "c6d5765b-730f-4f41-b95e-8241655ad3a2",
"rawTextureUuid": "da449a78-119f-43a0-970e-bae114518b2a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 252,
"height": 252,
"rawWidth": 252,
"rawHeight": 252,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
form/src/app/form/form.component.html
View file @
88e32403
...
@@ -110,7 +110,21 @@
...
@@ -110,7 +110,21 @@
题目{{i+1}}
题目{{i+1}}
</div>
</div>
<div
style=
"margin-top: 20px;"
>
<div
class=
"word-type-option-title"
>
题目类型:
</div>
<div
style=
"margin-top: 5px;"
>
<nz-radio-group
[(
ngModel
)]="
question
.
type
"
(
ngModelChange
)="
ngChange
()"
>
<label
nz-radio
nzValue=
"img"
>
<span
[
style
]="{
color:question
.
type=
='img'
?
'#
169BD5
'
:
'#
000
'}"
>
图片
</span>
</label>
<label
nz-radio
nzValue=
"txt"
>
<span
[
style
]="{
color:question
.
type=
='txt'
?
'#
169BD5
'
:
'#
000
'}"
>
文字
</span>
</label>
</nz-radio-group>
</div>
</div>
<div
class=
"option-text"
>
<div
class=
"option-text"
>
<div
class=
"word-input-title"
>
<div
class=
"word-input-title"
>
<span
style=
"color:red;margin-left:-15px"
>
*
</span>
<span
style=
"color:red;margin-left:-15px"
>
*
</span>
...
@@ -144,13 +158,13 @@
...
@@ -144,13 +158,13 @@
</div>
</div>
</div>
</div>
</div>
</div>
<
!-- <div
>
<
div
*
ngIf=
"question.type=='img'"
>
<span
style=
"font-size: 20px;"
>
标题图片:
</span>
<span
style=
"font-size: 20px;"
>
标题图片:
</span>
<div
style=
"width:300px"
>
<div
style=
"width:300px"
>
<app-upload-image-with-preview
[
picUrl
]="
question
.
image
"
<app-upload-image-with-preview
[
picUrl
]="
question
.
image
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,'
image
',
question
)"
></app-upload-image-with-preview>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,'
image
',
question
)"
></app-upload-image-with-preview>
</div>
</div>
</div>
-->
</div>
<div
class=
"option-time"
>
<div
class=
"option-time"
>
<div
class=
"word-input-title"
>
<div
class=
"word-input-title"
>
<span>
录音时间:
</span>
<span>
录音时间:
</span>
...
@@ -160,15 +174,15 @@
...
@@ -160,15 +174,15 @@
</div>
</div>
<div
style=
"margin:0 20px"
>
<div
style=
"margin:0 20px"
>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeQuestion
(
i
)"
>
删除题目
</button>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeQuestion
(
i
)"
>
删除题目
</button>
<button
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
<button
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
nzType=
"default"
nzDanger
(
click
)="
copyQuestion
(
i
)"
>
复制题目
</button>
(
click
)="
copyQuestion
(
i
)"
>
复制题目
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div
style=
"margin-top: 20px;"
>
<div
style=
"margin-top: 20px;"
>
<button
class=
"btn-blue"
style=
"width: 1000px; height: 50px;"
nz-button
<button
class=
"btn-blue"
style=
"width: 1000px; height: 50px;"
nz-button
nzType=
"default"
nzDanger
nzType=
"default"
nzDanger
(
click
)="
addQuestion
()"
>
+增加题目
</button>
(
click
)="
addQuestion
()"
>
+增加题目
</button>
</div>
</div>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
88e32403
...
@@ -52,7 +52,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -52,7 +52,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addQuestion
()
{
addQuestion
()
{
// if (this.item.questions.length == 6) return;
// if (this.item.questions.length == 6) return;
this
.
item
.
questions
.
push
({
this
.
item
.
questions
.
push
({
type
:
'
img
'
,
type
:
'
txt
'
,
audio
:
''
,
audio
:
''
,
text
:
''
,
text
:
''
,
image
:
''
,
image
:
''
,
...
@@ -97,4 +97,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -97,4 +97,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
console
.
log
(
e
);
console
.
log
(
e
);
this
.
save
();
this
.
save
();
}
}
ngChange
()
{
this
.
save
();
}
}
}
\ No newline at end of file
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