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
Hide 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 {
...
@@ -142,7 +142,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
//添加一页
//添加一页
addSon
(
a
,
b
,
c
)
{
addSon
(
a
,
b
,
c
)
{
let
length
=
this
.
picArr
[
a
].
child
[
b
].
child
[
0
].
child
.
length
+
this
.
picArr
[
a
].
child
[
b
].
child
[
1
].
child
.
length
;
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
=
{
let
cla
=
{
title
:
""
,
title
:
""
,
child
:
[]
child
:
[]
...
@@ -182,40 +182,39 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -182,40 +182,39 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
check
()
{
check
()
{
if
(
1
)
return
;
if
(
!
this
.
picArr
)
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
;
this
.
errs
.
length
=
0
;
for
(
let
m
=
0
;
m
<
picArr
.
length
;
m
++
)
{
// let picArr = this.picArr;
for
(
let
n
=
0
;
n
<
picArr
[
m
].
length
;
n
++
)
{
// function tia(info) {
if
(
picArr
[
m
][
n
].
length
<
2
)
{
// let str = "";
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
卡片少于2个`
);
// if (info.radioValue == "A") {
}
// if (!info.title) str += ",图片";
for
(
let
i
=
0
;
i
<
picArr
[
m
][
n
].
length
;
i
++
)
{
// } else if (info.radioValue == "B") {
let
item
=
picArr
[
m
][
n
][
i
];
// if (!info.pic_url) str += ",图片";
let
left
=
item
.
left
;
// } else if (info.radioValue == "C") {
let
right
=
item
.
right
;
// if (!info.audio_url) str += ",音频";
let
code0
=
tia
(
left
);
// } else {
let
code1
=
tia
(
right
);
// str += "卡片"
if
(
code0
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 左侧
${
code0
}
`
);
// }
if
(
code1
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 右侧
${
code1
}
`
);
// 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
(
this
.
errs
);
console
.
log
(
this
.
errs
);
console
.
log
(
"
-------------------------
"
);
console
.
log
(
"
-------------------------
"
);
...
...
play/assets/scene/scene/data.js
View file @
16c75716
function
retData
()
{
function
retData
()
{
// let item = {"contentObj":{"picArr":[[[{"cardId":"","left":{"title":"boy1","pic_url":"http://staging-teach.cdn.ireadabc.com/1baedb0b31dc5503e65e114ce21940ab.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"C"},"right":{"title":"food","pic_url":"http://staging-teach.cdn.ireadabc.com/38117778476574c7ef8b445cf24d6eb5.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"A"},"radioValue":"B"},{"cardId":"","left":{"title":"boy2","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"C"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/21373528a7f38575e871de1d8e5a9671.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"B"},"radioValue":"E"}],[{"cardId":"","left":{"title":"girl1","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/205722475ccaca6233b2f28e635405ca.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5d099c38000b804241f7dc1286b17457.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/205722475ccaca6233b2f28e635405ca.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"girl2","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/0b6ef24f15c6d8ad7bf27cc913445ebf.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/0abab9a26d537ebf1835a2ed8430162e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/0b6ef24f15c6d8ad7bf27cc913445ebf.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"girl3","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/b2c170f84b85dddf554b5c837d1d6e30.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5f34d4100a6ecb187fd715c99e917fc8.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/b2c170f84b85dddf554b5c837d1d6e30.mp3","radioValue":"B"},"radioValue":"D"}]],[[{"cardId":"","left":{"title":"rabbit","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/fe229e6b32f385fb8fe5eb9ec5843c66.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"cat","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/9c5fa50efd7a004f24ea7fcbcf81080e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"B"},"radioValue":"A"},{"cardId":"","left":{"title":"coffe","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/3d0fea61d5d97f3caf04a9b738a0291b.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/9d114554c4760ff35f1ff5479504a531.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"tea","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/448291140d0b780c0278a14bf49277cb.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/bf26f92e4f0557ad70ac27006855dae9.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"B"},"radioValue":"D"}]],[[{"cardId":"","left":{"title":"cool","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/0e67aa701df18cbb5581ffb81ffa7836.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/38117778476574c7ef8b445cf24d6eb5.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/4c0379bc0f3bd0722874b2e11fb35336.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"big eye","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/fe226bc303f03ea994cb9a93d1620284.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/21373528a7f38575e871de1d8e5a9671.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/b985b71cd2f3c2d31e45992e4ae69d7f.mp3","radioValue":"B"},"radioValue":"A"},{"cardId":"","left":{"title":"cute","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/84c7b82de1a09da792237a174ebe071b.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5d099c38000b804241f7dc1286b17457.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/7c1d1540233b6d050eae8215679104a8.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"shuai","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/9e799e7e86cd50c6699ca0e859c8aa1f.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/338dbee896e1fa8869495c84c603c33f.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/9a6b3177ab53ba75bcf293df1065bb64.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"big m","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"C"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/0abab9a26d537ebf1835a2ed8430162e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"B"},"radioValue":"E"}]]]}}
// let item = {"contentObj":{"picArr":[[[{"cardId":"","left":{"title":"boy1","pic_url":"http://staging-teach.cdn.ireadabc.com/1baedb0b31dc5503e65e114ce21940ab.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"C"},"right":{"title":"food","pic_url":"http://staging-teach.cdn.ireadabc.com/38117778476574c7ef8b445cf24d6eb5.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"A"},"radioValue":"B"},{"cardId":"","left":{"title":"boy2","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"C"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/21373528a7f38575e871de1d8e5a9671.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"B"},"radioValue":"E"}],[{"cardId":"","left":{"title":"girl1","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/205722475ccaca6233b2f28e635405ca.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5d099c38000b804241f7dc1286b17457.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/205722475ccaca6233b2f28e635405ca.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"girl2","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/0b6ef24f15c6d8ad7bf27cc913445ebf.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/0abab9a26d537ebf1835a2ed8430162e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/0b6ef24f15c6d8ad7bf27cc913445ebf.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"girl3","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/b2c170f84b85dddf554b5c837d1d6e30.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5f34d4100a6ecb187fd715c99e917fc8.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/b2c170f84b85dddf554b5c837d1d6e30.mp3","radioValue":"B"},"radioValue":"D"}]],[[{"cardId":"","left":{"title":"rabbit","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/fe229e6b32f385fb8fe5eb9ec5843c66.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"cat","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/9c5fa50efd7a004f24ea7fcbcf81080e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"B"},"radioValue":"A"},{"cardId":"","left":{"title":"coffe","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/3d0fea61d5d97f3caf04a9b738a0291b.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/9d114554c4760ff35f1ff5479504a531.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/a7bd7c4de71319db5b6b0b60f0957e21.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"tea","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/448291140d0b780c0278a14bf49277cb.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/bf26f92e4f0557ad70ac27006855dae9.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/6c8dcd159d4f05bc93838cc47d3895f4.mp3","radioValue":"B"},"radioValue":"D"}]],[[{"cardId":"","left":{"title":"cool","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/0e67aa701df18cbb5581ffb81ffa7836.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/38117778476574c7ef8b445cf24d6eb5.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/4c0379bc0f3bd0722874b2e11fb35336.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"big eye","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/fe226bc303f03ea994cb9a93d1620284.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/21373528a7f38575e871de1d8e5a9671.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/b985b71cd2f3c2d31e45992e4ae69d7f.mp3","radioValue":"B"},"radioValue":"A"},{"cardId":"","left":{"title":"cute","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/84c7b82de1a09da792237a174ebe071b.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/5d099c38000b804241f7dc1286b17457.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/7c1d1540233b6d050eae8215679104a8.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"shuai","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/9e799e7e86cd50c6699ca0e859c8aa1f.mp3","radioValue":"A"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/338dbee896e1fa8869495c84c603c33f.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/9a6b3177ab53ba75bcf293df1065bb64.mp3","radioValue":"B"},"radioValue":"D"},{"cardId":"","left":{"title":"big m","pic_url":"","audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","radioValue":"C"},"right":{"title":"","pic_url":"http://staging-teach.cdn.ireadabc.com/0abab9a26d537ebf1835a2ed8430162e.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/17cc0e2a383e4632147dc495a1397915.mp3","radioValue":"B"},"radioValue":"E"}]]]}}
let
item
=
{
// let item = {
"
contentObj
"
:
{
// "contentObj": {
"
picArr
"
:
[
// "picArr": [
{
// {
"
title
"
:
"
title
"
,
// "title": "title",
"
child
"
:
[
// "child": [
{
// {
"
title
"
:
"
main
"
,
// "title": "main",
"
child
"
:
// "child":
[
// [
{
// {
"
title
"
:
"
sub1
"
,
// "title": "sub1",
"
child
"
:
[
// "child": [
{
// {
"
title
"
:
"
son11
"
,
// "title": "son11",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
aa
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
bb
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
cc
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/0cd859af88f946a66313cc06e4628fd2.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
dd
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/021d3b3904cb6e675286ac8fcb60da2b.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "aa", "pic_url": "http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png", "audio_url": "" }, { "cardId": "", "title": "bb", "pic_url": "http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png", "audio_url": "" }, { "cardId": "", "title": "cc", "pic_url": "http://staging-teach.cdn.ireadabc.com/0cd859af88f946a66313cc06e4628fd2.png", "audio_url": "" }, { "cardId": "", "title": "dd", "pic_url": "http://staging-teach.cdn.ireadabc.com/021d3b3904cb6e675286ac8fcb60da2b.png", "audio_url": "" }]
},
// },
{
// {
"
title
"
:
"
son12
"
,
// "title": "son12",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
a2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/1c897715153af629e0aa1bfbf54472a4.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
b2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/756083716a8ab9f2b6b66331e659845d.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
c2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/6c13e8f14b294ca866205633b9f44891.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
d2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/b3f29929c06d1af57bb6eb08d3f5b0d0.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "a2", "pic_url": "http://staging-teach.cdn.ireadabc.com/1c897715153af629e0aa1bfbf54472a4.png", "audio_url": "" }, { "cardId": "", "title": "b2", "pic_url": "http://staging-teach.cdn.ireadabc.com/756083716a8ab9f2b6b66331e659845d.png", "audio_url": "" }, { "cardId": "", "title": "c2", "pic_url": "http://staging-teach.cdn.ireadabc.com/6c13e8f14b294ca866205633b9f44891.png", "audio_url": "" }, { "cardId": "", "title": "d2", "pic_url": "http://staging-teach.cdn.ireadabc.com/b3f29929c06d1af57bb6eb08d3f5b0d0.png", "audio_url": "" }]
},
// },
{
// {
"
title
"
:
"
son13
"
,
// "title": "son13",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
a3
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
b3
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
c3
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
d3
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "a3", "pic_url": "http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png", "audio_url": "" }, { "cardId": "", "title": "b3", "pic_url": "http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png", "audio_url": "" }, { "cardId": "", "title": "c3", "pic_url": "http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png", "audio_url": "" }, { "cardId": "", "title": "d3", "pic_url": "http://staging-teach.cdn.ireadabc.com/26524d3fa6a060d80664b40cfb6105f6.png", "audio_url": "" }]
}
// }
]
// ]
},
{
// }, {
"
title
"
:
"
sub2
"
,
// "title": "sub2",
"
child
"
:
[{
// "child": [{
"
title
"
:
"
son21
"
,
// "title": "son21",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q1
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/fde35aaec618529b0b2b6cb3a18d1f85.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
w1
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/0cd859af88f946a66313cc06e4628fd2.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
e1
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/021d3b3904cb6e675286ac8fcb60da2b.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "q1", "pic_url": "http://staging-teach.cdn.ireadabc.com/fde35aaec618529b0b2b6cb3a18d1f85.png", "audio_url": "" }, { "cardId": "", "title": "w1", "pic_url": "http://staging-teach.cdn.ireadabc.com/0cd859af88f946a66313cc06e4628fd2.png", "audio_url": "" }, { "cardId": "", "title": "e1", "pic_url": "http://staging-teach.cdn.ireadabc.com/021d3b3904cb6e675286ac8fcb60da2b.png", "audio_url": "" }]
},
// },
{
// {
"
title
"
:
"
son22
"
,
// "title": "son22",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/756083716a8ab9f2b6b66331e659845d.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
q3
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/6e9fec092bc8d547be4ad9fd5e01acf1.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "q2", "pic_url": "http://staging-teach.cdn.ireadabc.com/756083716a8ab9f2b6b66331e659845d.png", "audio_url": "" }, { "cardId": "", "title": "q3", "pic_url": "http://staging-teach.cdn.ireadabc.com/6e9fec092bc8d547be4ad9fd5e01acf1.png", "audio_url": "" }]
},
// },
{
// {
"
title
"
:
"
son23
"
,
// "title": "son23",
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q4
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/b0f3c1a415015b254692a5d536b5b3fa.png
"
,
"
audio_url
"
:
""
},
{
"
cardId
"
:
""
,
"
title
"
:
"
w4
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/cfa80b631a57638fd27cdef0d5aa2c2d.png
"
,
"
audio_url
"
:
""
}]
// "child": [{ "cardId": "", "title": "q4", "pic_url": "http://staging-teach.cdn.ireadabc.com/b0f3c1a415015b254692a5d536b5b3fa.png", "audio_url": "" }, { "cardId": "", "title": "w4", "pic_url": "http://staging-teach.cdn.ireadabc.com/cfa80b631a57638fd27cdef0d5aa2c2d.png", "audio_url": "" }]
}
// }
]
// ]
}]
// }]
}]
// }]
}]
// }]
}
// }
}
// }
let
item
=
{
"
contentObj
"
:
{
"
picArr
"
:
[{
"
title
"
:
"
fff
"
,
"
child
"
:
[{
"
title
"
:
"
ddd
"
,
"
child
"
:
[{
"
title
"
:
"
aaa
"
,
"
child
"
:
[{
"
title
"
:
"
fff
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
1
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png
"
,
"
audio_url
"
:
""
}]
}]
},
{
"
title
"
:
"
bbb
"
,
"
child
"
:
[{
"
title
"
:
"
ee
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/fde35aaec618529b0b2b6cb3a18d1f85.png
"
,
"
audio_url
"
:
""
}]
}]
}]
}]
}]
}
}
return
item
;
return
item
;
}
}
export
const
itemData
=
retData
();
export
const
itemData
=
retData
();
\ No newline at end of file
play/assets/scene/scene/scene.js
View file @
16c75716
...
@@ -303,6 +303,26 @@ cc.Class({
...
@@ -303,6 +303,26 @@ cc.Class({
},
},
setSuccessItemPos
(
box
,
item
)
{
setSuccessItemPos
(
box
,
item
)
{
//判断当前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
scale
=
item
.
scale
;
let
itemA
=
box
.
data
.
id
%
100
-
1
;
//坐标x
let
itemA
=
box
.
data
.
id
%
100
-
1
;
//坐标x
let
itemB
=
box
.
data
.
success
.
length
-
1
;
//坐标y
let
itemB
=
box
.
data
.
success
.
length
-
1
;
//坐标y
...
@@ -311,7 +331,7 @@ cc.Class({
...
@@ -311,7 +331,7 @@ cc.Class({
let
y
=
0
;
let
y
=
0
;
// let addY = -40 * scale;
// let addY = -40 * scale;
let
addY
=
-
43
*
scale
;
let
addY
=
-
43
*
scale
;
item
.
x
=
x
+
addX
*
itemA
;
item
.
x
=
x
+
addX
*
arr
[
itemA
]
;
item
.
y
=
y
+
addY
*
itemB
;
item
.
y
=
y
+
addY
*
itemB
;
},
},
initItems
()
{
initItems
()
{
...
@@ -319,7 +339,6 @@ cc.Class({
...
@@ -319,7 +339,6 @@ cc.Class({
let
son
=
pg
.
view
.
find
(
this
,
"
items/item
"
);
let
son
=
pg
.
view
.
find
(
this
,
"
items/item
"
);
let
box
=
pg
.
view
.
find
(
this
,
"
items
"
);
let
box
=
pg
.
view
.
find
(
this
,
"
items
"
);
let
sonleis
=
GameManager
.
getIns
().
getCards
();
let
sonleis
=
GameManager
.
getIns
().
getCards
();
sonleis
.
length
=
10
;
if
(
sonleis
.
length
<=
14
)
{
if
(
sonleis
.
length
<=
14
)
{
let
x
=
-
500
;
let
x
=
-
500
;
let
addX
=
165
;
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