Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DG_FAF
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
DG_FAF
Commits
349cbbd5
Commit
349cbbd5
authored
Feb 20, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加页头页尾图片配置
parent
52cca651
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
23 deletions
+68
-23
DG_FAF.fire
assets/DG_FAF/scene/DG_FAF.fire
+4
-8
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+22
-3
defaultData_DG_FAF.ts
assets/DG_FAF/script/defaultData_DG_FAF.ts
+1
-1
util_DG_FAF.ts
assets/DG_FAF/script/util_DG_FAF.ts
+10
-0
form.component.html
form_angular/src/app/form/form.component.html
+31
-11
No files found.
assets/DG_FAF/scene/DG_FAF.fire
View file @
349cbbd5
...
...
@@ -866,7 +866,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1
38
"height": 1
42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -878,7 +878,7 @@
"ctor": "Float64Array",
"array": [
0,
5
31
,
5
29
,
0,
0,
0,
...
...
@@ -979,9 +979,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "cddea2ff-d29d-46e9-a62d-22fd51f0514a"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
...
...
@@ -1201,9 +1199,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ed9aebd7-be72-4a8c-9cf0-05e55d7e82e5"
},
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
...
...
assets/DG_FAF/scene/DG_FAF.ts
View file @
349cbbd5
import
{
asyncDelay
,
onHomeworkFinish
,
playAudioByUrl
,
loadImageByUrl
,
getSprNode
,
}
from
"
../script/util_DG_FAF
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent_DG_FAF
"
;
...
...
@@ -34,6 +33,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
console
.
log
(
this
.
data
);
this
.
initSize
();
this
.
initEventListener
();
this
.
initHeaderAndFooter
();
await
this
.
initHotZoneBg
();
this
.
initHotZoneItem
();
}
...
...
@@ -107,7 +107,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 检查是否可以提交
this
.
checkCanSubmit
();
})
}
// 初始化头部和底部图片
initHeaderAndFooter
()
{
loadImageByUrl
(
this
.
data
.
header_image_url
,
(
sf
)
=>
{
const
imgNode
=
cc
.
find
(
"
Canvas/Header/img
"
);
const
sfSize
=
sf
.
getOriginalSize
();
const
sx
=
imgNode
.
parent
.
width
/
sfSize
.
width
;
const
sy
=
imgNode
.
parent
.
height
/
sfSize
.
height
;
imgNode
.
scale
=
Math
.
min
(
sx
,
sy
)
imgNode
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
})
loadImageByUrl
(
this
.
data
.
footer_image_url
,
(
sf
)
=>
{
const
imgNode
=
cc
.
find
(
"
Canvas/Footer/img
"
);
const
sfSize
=
sf
.
getOriginalSize
();
const
sx
=
imgNode
.
parent
.
width
/
sfSize
.
width
;
const
sy
=
imgNode
.
parent
.
height
/
sfSize
.
height
;
imgNode
.
scale
=
Math
.
min
(
sx
,
sy
)
imgNode
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
})
}
hotZoneBg
=
null
;
...
...
assets/DG_FAF/script/defaultData_DG_FAF.ts
View file @
349cbbd5
This diff is collapsed.
Click to expand it.
assets/DG_FAF/script/util_DG_FAF.ts
View file @
349cbbd5
...
...
@@ -113,6 +113,16 @@ export function playAudioByUrl(audio_url, cb=null) {
}
}
export
function
loadImageByUrl
(
image_url
,
cb
=
null
)
{
if
(
image_url
)
{
cc
.
assetManager
.
loadRemote
(
image_url
,
(
err
,
texture
)
=>
{
if
(
cb
)
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
)
cb
(
spriteFrame
);
}
});
}
}
export
function
btnClickAnima
(
btn
,
time
=
0.15
,
rate
=
1.05
)
{
btn
.
tmpScale
=
btn
.
scale
;
...
...
form_angular/src/app/form/form.component.html
View file @
349cbbd5
...
...
@@ -3,6 +3,26 @@
<app-formula-input [(ngfModel)]="item.title" (ngfBlur)="save()"></app-formula-input><br> -->
<div
style=
"padding: 20px;"
>
<div
style=
"margin: 30px;"
></div>
<h2
style=
"margin-top: 10px;"
>
页头-页尾配置
</h2>
<div
style=
"font-size: 16px; border: 2px solid #ccc; border-radius: 10px; padding: 10px; display: flex; height: 180px;"
>
<div
style=
"width: 200px; height: 112px;"
>
<h5>
页头图片:
</h5>
<app-upload-image-with-preview
[
picUrl
]="
item
.
header_image_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
header_image_url
',
item
)"
>
</app-upload-image-with-preview>
</div>
<div
style=
"width: 200px; height: 112px; margin-left: 20px;"
>
<h5>
页尾图片:
</h5>
<app-upload-image-with-preview
[
picUrl
]="
item
.
footer_image_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
footer_image_url
',
item
)"
>
</app-upload-image-with-preview>
</div>
</div>
<h2
>
热区位置配置:
</h2>
<app-custom-hot-zone
[
bgItem
]="
item
.
bgItem
"
...
...
@@ -38,21 +58,21 @@
<thead>
<tr>
<th
nzWidth=
"100px"
nzAlign=
"center"
>
序号
</th>
<th
nzWidth=
"2
00px"
nzAlign=
"center"
>
正确答案
</th>
<th
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
分数
</th>
<th
*
ngIf=
"it.hotZoneType == '3' || it.hotZoneType == '4'"
nzWidth=
"1
00px"
nzAlign=
"center"
>
正确答案
</th>
<th
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
分数
</th>
<th
*
ngIf=
"it.hotZoneType == '0'"
>
文字
</th>
<th
*
ngIf=
"it.hotZoneType == '1'"
>
图片
</th>
<th
*
ngIf=
"it.hotZoneType == '3' || it.hotZoneType == '4'"
>
热区索引
</th>
<th
nzWidth=
"1
0%
"
>
操作
</th>
<th
nzWidth=
"1
50px
"
>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of contentTable.data; let i = index;"
>
<ng-container
*
ngIf=
"!(editCache[i] && editCache[i].edit); else editTemplate"
>
<td
nzWidth=
"100px"
nzAlign=
"center"
>
{{ i + 1 }}
</td>
<td
*
ngIf=
"it.hotZoneType == '3'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
{{ data.isCorrect?'正确':'错误' }}
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
{{ data.isCheck?'勾选':'不勾选' }}
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
{{ data.score }}
</td>
<td
*
ngIf=
"it.hotZoneType == '3'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
{{ data.isCorrect?'正确':'错误' }}
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
{{ data.isCheck?'勾选':'不勾选' }}
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
{{ data.score }}
</td>
<td
*
ngIf=
"it.hotZoneType == '0'"
>
{{ data.text }}
</td>
<td
*
ngIf=
"it.hotZoneType == '1'"
>
<img
*
ngIf=
"data.image_url"
[
src
]="
data
.
image_url
"
width=
"200"
height=
"200"
style=
"object-fit: contain;"
/>
...
...
@@ -61,7 +81,7 @@
<td
*
ngIf=
"it.hotZoneType == '3' || it.hotZoneType == '4'"
>
<span
style=
"margin-left: 10px;"
>
索引: {{data.selectHotZoneIndex + 1}} 热区名:{{item.hotZoneItemArr
&&
item.hotZoneItemArr[data.selectHotZoneIndex] ? item.hotZoneItemArr[data.selectHotZoneIndex].itemName : "未配置"}}
</span>
</td>
<td
nzWidth=
"1
0%
"
>
<td
nzWidth=
"1
50px
"
>
<a
(
click
)="
startHotZoneConfigEdit
(
i
,
data
)"
>
编辑
</a>
<nz-divider
nzType=
"vertical"
></nz-divider>
<a
(
click
)="
deleteHotZoneConfigItem
(
it
,
i
)"
>
删除
</a>
...
...
@@ -69,13 +89,13 @@
</ng-container>
<ng-template
#
editTemplate
>
<td
nzWidth=
"100px"
nzAlign=
"center"
>
{{ i + 1 }}
</td>
<td
*
ngIf=
"it.hotZoneType == '3'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
<td
*
ngIf=
"it.hotZoneType == '3'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
<label
nz-checkbox
[(
ngModel
)]="
editCache
[
i
].
data
.
isCorrect
"
></label>
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
2
00px"
nzAlign=
"center"
>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
1
00px"
nzAlign=
"center"
>
<label
nz-checkbox
[(
ngModel
)]="
editCache
[
i
].
data
.
isCheck
"
></label>
</td>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
2
00px"
>
<td
*
ngIf=
"it.hotZoneType == '4'"
nzWidth=
"
1
00px"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
editCache
[
i
].
data
.
score
"
/>
</td>
<td
*
ngIf=
"it.hotZoneType == '0'"
>
...
...
@@ -98,7 +118,7 @@
<td
nzWidth=
"10%"
>
<a
(
click
)="
saveHotZoneConfigEdit
(
i
,
it
)"
class=
"save"
>
保存
</a>
<nz-divider
nzType=
"vertical"
></nz-divider>
<a
nz-popconfirm
nzPopconfirmTitle=
"
Sure to cancel
?"
(
nzOnConfirm
)="
cancelHotZoneConfigEdit
(
i
,
data
)"
>
取消
</a>
<a
nz-popconfirm
nzPopconfirmTitle=
"
确定取消
?"
(
nzOnConfirm
)="
cancelHotZoneConfigEdit
(
i
,
data
)"
>
取消
</a>
</td>
</ng-template>
</tr>
...
...
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