Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
comparetree
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
comparetree
Commits
16c75716
Commit
16c75716
authored
Jun 15, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9a52d056
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
81 deletions
+100
-81
form.component.ts
form/src/app/form/form.component.ts
+32
-33
data.js
play/assets/scene/scene/data.js
+47
-46
scene.js
play/assets/scene/scene/scene.js
+21
-2
No files found.
form/src/app/form/form.component.ts
View file @
16c75716
...
...
@@ -142,7 +142,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
//添加一页
addSon
(
a
,
b
,
c
)
{
let
length
=
this
.
picArr
[
a
].
child
[
b
].
child
[
0
].
child
.
length
+
this
.
picArr
[
a
].
child
[
b
].
child
[
1
].
child
.
length
;
if
(
length
<
6
)
{
if
(
length
<
6
)
{
let
cla
=
{
title
:
""
,
child
:
[]
...
...
@@ -182,40 +182,39 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
check
()
{
if
(
1
)
return
;
if
(
!
this
.
picArr
)
return
;
let
picArr
=
this
.
picArr
;
function
tia
(
info
)
{
let
str
=
""
;
if
(
info
.
radioValue
==
"
A
"
)
{
if
(
!
info
.
title
)
str
+=
"
,图片
"
;
}
else
if
(
info
.
radioValue
==
"
B
"
)
{
if
(
!
info
.
pic_url
)
str
+=
"
,图片
"
;
}
else
if
(
info
.
radioValue
==
"
C
"
)
{
if
(
!
info
.
audio_url
)
str
+=
"
,音频
"
;
}
else
{
str
+=
"
卡片
"
}
if
(
str
)
str
+=
"
未上传
"
return
str
;
}
this
.
errs
.
length
=
0
;
for
(
let
m
=
0
;
m
<
picArr
.
length
;
m
++
)
{
for
(
let
n
=
0
;
n
<
picArr
[
m
].
length
;
n
++
)
{
if
(
picArr
[
m
][
n
].
length
<
2
)
{
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
卡片少于2个`
);
}
for
(
let
i
=
0
;
i
<
picArr
[
m
][
n
].
length
;
i
++
)
{
let
item
=
picArr
[
m
][
n
][
i
];
let
left
=
item
.
left
;
let
right
=
item
.
right
;
let
code0
=
tia
(
left
);
let
code1
=
tia
(
right
);
if
(
code0
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 左侧
${
code0
}
`
);
if
(
code1
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 右侧
${
code1
}
`
);
}
}
}
// let picArr = this.picArr;
// function tia(info) {
// let str = "";
// if (info.radioValue == "A") {
// if (!info.title) str += ",图片";
// } else if (info.radioValue == "B") {
// if (!info.pic_url) str += ",图片";
// } else if (info.radioValue == "C") {
// if (!info.audio_url) str += ",音频";
// } else {
// str += "卡片"
// }
// if (str) str += "未上传"
// return str;
// }
// for (let m = 0; m < picArr.length; m++) {
// for (let n = 0; n < picArr[m].length; n++) {
// if (picArr[m][n].length < 2) {
// this.errs.push(`星-${m + 1} 页-${n + 1} 卡片少于2个`);
// }
// for (let i = 0; i < picArr[m][n].length; i++) {
// let item = picArr[m][n][i];
// let left = item.left;
// let right = item.right;
// let code0 = tia(left);
// let code1 = tia(right);
// if (code0) this.errs.push(`星-${m + 1} 页-${n + 1} 第${i + 1}个卡片 左侧${code0}`);
// if (code1) this.errs.push(`星-${m + 1} 页-${n + 1} 第${i + 1}个卡片 右侧${code1}`);
// }
// }
// }
console
.
log
(
"
this.errs
"
);
console
.
log
(
this
.
errs
);
console
.
log
(
"
-------------------------
"
);
...
...
play/assets/scene/scene/data.js
View file @
16c75716
This diff is collapsed.
Click to expand it.
play/assets/scene/scene/scene.js
View file @
16c75716
...
...
@@ -303,6 +303,26 @@ cc.Class({
},
setSuccessItemPos
(
box
,
item
)
{
//判断当前item应该放在哪里
let
list1
=
this
.
_zhuClass
.
child
[
0
];
let
list2
=
this
.
_zhuClass
.
child
[
1
];
let
arr
=
[];
let
arr1
=
[];
let
arr2
=
[];
if
(
list1
.
child
.
length
>
0
)
{
arr1
.
push
(
1
);
arr1
.
push
(
0
);
arr1
.
push
(
2
);
arr1
.
length
=
list1
.
child
.
length
;
}
if
(
list2
.
child
.
length
>
0
)
{
arr2
.
push
(
4
);
arr2
.
push
(
5
);
arr2
.
push
(
3
);
arr2
.
length
=
list2
.
child
.
length
;
}
arr
=
arr1
.
concat
(
arr2
);
let
scale
=
item
.
scale
;
let
itemA
=
box
.
data
.
id
%
100
-
1
;
//坐标x
let
itemB
=
box
.
data
.
success
.
length
-
1
;
//坐标y
...
...
@@ -311,7 +331,7 @@ cc.Class({
let
y
=
0
;
// let addY = -40 * scale;
let
addY
=
-
43
*
scale
;
item
.
x
=
x
+
addX
*
itemA
;
item
.
x
=
x
+
addX
*
arr
[
itemA
]
;
item
.
y
=
y
+
addY
*
itemB
;
},
initItems
()
{
...
...
@@ -319,7 +339,6 @@ cc.Class({
let
son
=
pg
.
view
.
find
(
this
,
"
items/item
"
);
let
box
=
pg
.
view
.
find
(
this
,
"
items
"
);
let
sonleis
=
GameManager
.
getIns
().
getCards
();
sonleis
.
length
=
10
;
if
(
sonleis
.
length
<=
14
)
{
let
x
=
-
500
;
let
addX
=
165
;
...
...
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