Commit 9a162863 authored by limingzhe's avatar limingzhe

fix: debug

parent 53791fe3
......@@ -364,10 +364,16 @@ cc.Class({
this.viewArr = [];
this.teachingMaterialArr = [
{key: "人教版", name: "同步 人教版 内容", res: 'book_rjb'},
{key: "外研版", name: "同步 外研版 内容", res: 'book_wyb'},
{key: "沪教版", name: "同步 沪教版 内容", res: 'book_ljb'},
{key: "学前班", name: "同步 学前班 内容", res: 'book_xqb'},
{key: "人教版", name: "同步 人教版 内容", res: ''},
{key: "外研版", name: "同步 外研版 内容", res: ''},
{key: "沪教版", name: "同步 沪教版 内容", res: ''},
{key: "学前班", name: "同步 学前班 内容", res: ''},
{key: "Level 1", name: "迪格 Level 1", res: 'dg_1'},
{key: "Level 2", name: "迪格 Level 2", res: 'dg_2'},
{key: "Level 3", name: "迪格 Level 3", res: 'dg_3'},
{key: "Level 4", name: "迪格 Level 4", res: 'dg_4'},
{key: "Level 5", name: "迪格 Level 5", res: 'dg_5'},
{key: "Level 6", name: "迪格 Level 6", res: 'dg_6'},
];
this.routeArr = [];
......@@ -1063,7 +1069,7 @@ cc.Class({
this.homeView.addChild(topBg, 2);
this.topBg = topBg;
const labelNode = this.getLabel("绘 玩 听 写 助 手", fontSize, true);
const labelNode = this.getLabel("听 写 助 手", fontSize, true);
labelNode.color = cc.Color.WHITE;
this.homeView.addChild(labelNode, 3);
labelNode.y = topBg.y - topBg.height / 2.5 * topBg.scaleY;
......@@ -1071,6 +1077,21 @@ cc.Class({
this.titleH = topBg.height / 2.5 * topBg.scaleY * 2;
const backBtn = getSprNode("btn_back");
this.homeView.addChild(backBtn, 4);
backBtn.scale = this.topBg.scale;
backBtn.y = labelNode.y;
backBtn.x = -this.canvas.width / 2 + this.titleH / 2;
backBtn.addComponent(cc.Button);
backBtn.on("click", () => {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
middleLayer.getComponent('middleLayer').exitGame();
}
})
// this.titleLabel = labelNode.getComponent(cc.Label);
// const backBtn = getSprNode("btn_back");
......@@ -1185,12 +1206,11 @@ cc.Class({
let resName;
let curBookData = this.getCusBookDataByName(data.text_en);
// if (!data) {
if (!data || !curBookData || !curBookData.res) {
resName = 'bg_book';
// } else {
// resName = curBookData.res;
// }
} else {
resName = curBookData.res;
}
if (!curBookData) {
curBookData = {name: '迪格 ' + data.text_en}
......@@ -1200,38 +1220,35 @@ cc.Class({
const book = getSprNode(resName);
node.addChild(book);
let labelNode;
if (!data || !curBookData || !curBookData.res) {
labelNode = this.getLabel(curBookData.name, 30);
labelNode.x = 25;
labelNode.y = book.height / 4;
book.addChild(labelNode, 2);
const labelNode = this.getLabel(curBookData.name, 30);
labelNode.x = 25;
labelNode.y = book.height / 4;
book.addChild(labelNode, 2);
const tempW = 245;
const tempH = 58;
// const labelBg = getSprNode("white");
// labelBg.x = labelNode.x;
// labelBg.y = labelNode.y;
delayCall(0.01, () => {
console.log('labelNode.width + 20', (labelNode.width + 20));
console.log('labelNode.height + 20', (labelNode.height + 20));
})
const labelBg = new cc.Node();
const ctx = labelBg.addComponent(cc.Graphics);
ctx.roundRect(-tempW / 2, -tempH/2, tempW, tempH, tempW / 18);
ctx.fillColor = cc.Color.WHITE;
ctx.fill();
labelBg.x = labelNode.x;
labelBg.y = labelNode.y;
const tempW = 245;
const tempH = 58;
// labelBg.scaleX = tempW / labelBg.width;
// labelBg.scaleY = tempH / labelBg.height;
book.addChild(labelBg);
}
delayCall(0.01, () => {
// labelBg.scaleX = (labelNode.width + 20) / labelBg.width;
// labelBg.scaleY = (labelNode.height + 20) / labelBg.height;
console.log('labelNode.width + 20', (labelNode.width + 20));
console.log('labelNode.height + 20', (labelNode.height + 20));
})
const labelBg = new cc.Node();
const ctx = labelBg.addComponent(cc.Graphics);
ctx.roundRect(-tempW / 2, -tempH/2, tempW, tempH, tempW / 18);
ctx.fillColor = cc.Color.WHITE;
ctx.fill();
labelBg.x = labelNode.x;
labelBg.y = labelNode.y;
book.addChild(labelBg);
......
{
"ver": "2.3.5",
"uuid": "f6d55fa2-f508-442a-a085-37f5b91e44e2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_1": {
"ver": "1.0.4",
"uuid": "595101f4-282d-4bac-bd91-9c111cd07763",
"rawTextureUuid": "f6d55fa2-f508-442a-a085-37f5b91e44e2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d93a82ff-72e3-4e40-bf84-d62fb8219d32",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_2": {
"ver": "1.0.4",
"uuid": "e0219455-e1cf-4932-ab03-12c135195b08",
"rawTextureUuid": "d93a82ff-72e3-4e40-bf84-d62fb8219d32",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5f39fd29-aa3b-4639-b053-50471a0e20fb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_3": {
"ver": "1.0.4",
"uuid": "758e96be-d94f-4f17-8e08-c1878ac8dd45",
"rawTextureUuid": "5f39fd29-aa3b-4639-b053-50471a0e20fb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "422af4a0-6b4a-449d-ad75-cc7cce480785",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_4": {
"ver": "1.0.4",
"uuid": "09b9bee6-6dc4-4d4f-81c9-a3a6b2807ebd",
"rawTextureUuid": "422af4a0-6b4a-449d-ad75-cc7cce480785",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "bf2ba6de-68b2-4505-8f9a-dc42aaaca8b2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_5": {
"ver": "1.0.4",
"uuid": "d20db597-86a3-4a39-94c6-c4436d6a2bea",
"rawTextureUuid": "bf2ba6de-68b2-4505-8f9a-dc42aaaca8b2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c285dcbc-c85f-4c43-b065-2c46b90fee59",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 383,
"height": 424,
"platformSettings": {},
"subMetas": {
"dg_6": {
"ver": "1.0.4",
"uuid": "282f483b-395d-4c95-9ce5-0cd25a022ae5",
"rawTextureUuid": "c285dcbc-c85f-4c43-b065-2c46b90fee59",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 383,
"height": 424,
"rawWidth": 383,
"rawHeight": 424,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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