Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSIWB2504
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
SSIWB2504
Commits
89d42798
Commit
89d42798
authored
Aug 07, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(play): 修复鱼点击事件和可见性检查问题
parent
d3460e10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
16 deletions
+32
-16
play.component.ts
src/app/play/play.component.ts
+32
-16
No files found.
src/app/play/play.component.ts
View file @
89d42798
...
@@ -375,6 +375,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -375,6 +375,8 @@ export class PlayComponent implements OnInit, OnDestroy {
* @param dataIndex 数据索引
* @param dataIndex 数据索引
*/
*/
toggleItemSelection
(
itemNode
,
dataIndex
)
{
toggleItemSelection
(
itemNode
,
dataIndex
)
{
if
(
!
this
.
layoutPage
.
ref
.
visible
)
return
;
const
isSelected
=
itemNode
.
ref
.
isSelected
||
false
;
const
isSelected
=
itemNode
.
ref
.
isSelected
||
false
;
const
selectMark
=
itemNode
.
ref
.
selectMark
;
const
selectMark
=
itemNode
.
ref
.
selectMark
;
...
@@ -695,9 +697,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -695,9 +697,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
cat_center
=
this
.
createCat
(
'
center
'
);
// 创建中间猫
this
.
cat_center
=
this
.
createCat
(
'
center
'
);
// 创建中间猫
}
}
const
type
=
'
big
'
//
const type = 'big'
const
data
=
this
.
g_formData
.
questions
[
0
];
//
const data = this.g_formData.questions[0];
const
fish
=
this
.
createFish
(
type
,
data
);
//
const fish = this.createFish(type, data);
// const paopao = this.brokePaopao(fish);
// const paopao = this.brokePaopao(fish);
}
}
...
@@ -873,11 +875,16 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -873,11 +875,16 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
createFish
(
type
,
data
)
{
createFish
(
type
,
data
)
{
const
fishId
=
`fish_
${
Math
.
floor
(
Math
.
random
()
*
1000
)}
_
${
Date
.
now
()}
`
// 创建鱼元素
// 创建鱼元素
const
fish
=
this
.
g_cartoon
.
createCartoonElement
(
'
fish
'
,
'
MySprite
'
);
const
fish
=
this
.
g_cartoon
.
createCartoonElement
(
fishId
,
'
MySprite
'
);
fish
.
ref
.
init
(
this
.
g_cartoon
.
images
.
get
(
'
fish
'
));
fish
.
ref
.
init
(
this
.
g_cartoon
.
images
.
get
(
'
fish
'
));
fish
.
ref
.
scaleX
=
this
.
g_mapScale
;
fish
.
ref
.
scaleX
=
this
.
g_mapScale
;
fish
.
ref
.
scaleY
=
this
.
g_mapScale
;
fish
.
ref
.
scaleY
=
this
.
g_mapScale
;
fish
.
ref
.
width
=
localImagesSize
[
'
pao_pao_da_png
'
].
width
*
this
.
g_mapScale
;
fish
.
ref
.
height
=
localImagesSize
[
'
pao_pao_da_png
'
].
height
*
this
.
g_mapScale
;
fish
.
ref
.
x
=
this
.
g_canvasWidth
/
2
;
fish
.
ref
.
x
=
this
.
g_canvasWidth
/
2
;
fish
.
ref
.
y
=
this
.
g_canvasHeight
/
2
;
fish
.
ref
.
y
=
this
.
g_canvasHeight
/
2
;
let
itemWidth
=
300
*
this
.
g_mapScale
;
let
itemWidth
=
300
*
this
.
g_mapScale
;
...
@@ -900,6 +907,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -900,6 +907,7 @@ export class PlayComponent implements OnInit, OnDestroy {
pao_pao_po_ani
.
ref
.
x
=
0
pao_pao_po_ani
.
ref
.
x
=
0
pao_pao_po_ani
.
ref
.
y
=
-
90
*
this
.
g_mapScale
;
pao_pao_po_ani
.
ref
.
y
=
-
90
*
this
.
g_mapScale
;
fish
.
ref
.
addChild
(
pao_pao_po_ani
.
ref
);
fish
.
ref
.
addChild
(
pao_pao_po_ani
.
ref
);
pao_pao_po_ani
.
ref
.
visible
=
false
;
// 一条小鱼
// 一条小鱼
const
colors
=
[
'
huang
'
,
'
ju
'
,
'
lan
'
,
'
lv
'
]
const
colors
=
[
'
huang
'
,
'
ju
'
,
'
lan
'
,
'
lv
'
]
const
nameYu
=
colors
[
Math
.
floor
(
Math
.
random
()
*
colors
.
length
)]
+
'
_yu
'
const
nameYu
=
colors
[
Math
.
floor
(
Math
.
random
()
*
colors
.
length
)]
+
'
_yu
'
...
@@ -946,6 +954,14 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -946,6 +954,14 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
render
(
fish
.
ref
,
zIndexMap
.
card
);
this
.
render
(
fish
.
ref
,
zIndexMap
.
card
);
fish
[
'
child_paopao_bg
'
]
=
pao_pao_da_png
;
fish
[
'
child_paopao_bg
'
]
=
pao_pao_da_png
;
fish
[
'
child_paopao_ani
'
]
=
pao_pao_po_ani
;
fish
[
'
child_paopao_ani
'
]
=
pao_pao_po_ani
;
// 注册点击事件处理函数
this
.
subscribeMapDownEvent
(
fishId
,
()
=>
{
console
.
log
(
'
fish click
'
,
fish
);
// 点击气泡时执行brokePaopao方法
this
.
brokePaopao
(
fish
);
this
.
g_enableMapDown
=
true
;
})
return
fish
;
return
fish
;
}
}
...
...
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