Commit 16c75716 authored by Tt's avatar Tt

1

parent 9a52d056
...@@ -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("-------------------------");
......
This diff is collapsed.
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment