Commit 77f08c29 authored by yu's avatar yu

1

parent 2413df18
{
"ver": "1.1.0",
"uuid": "32a07afb-a7de-49ad-afa5-5151a4f801df",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -208,36 +208,28 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -208,36 +208,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.layout_qe.removeAllChildren(); this.layout_qe.removeAllChildren();
data.contentArr.forEach((dt, idx) => { data.contentArr.forEach((dt, idx) => {
let item = dt.block ? cc.instantiate(this.item_qeR) : cc.instantiate(this.item_qeN); let item = cc.instantiate(this.item_qeN);
item.getComponent(cc.Label).string = dt.text; item.getComponent(cc.Label).string = dt.text;
item.active = true; item.active = true;
// item.getComponent(cc.Label)._forceUpdateRenderData(true);
item.parent = this.layout_qe; item.parent = this.layout_qe;
// this.layout_qe.getComponent(cc.Layout).updateLayout();
if (dt.block) { if (dt.block) {
let ri = cc.instantiate(this.item_qeR);
ri.parent = item;
this.wordItams.push(item); this.wordItams.push(item);
item.getComponent(cc.Label).enabled = false; ri.getComponent(cc.Label).string = dt.text;
ri.getComponent(cc.Label).enabled = false;
ri.active = true;
} }
item.data = dt.text.split(" ").join("");; item.data = dt.text.split(" ").join("");;
}) })
// this.layout_qe.getComponent(cc.Layout).updateLayout();
// let width = this.layout_qe.width;
// if (width < 1450) {
// this.layout_qe.getComponent(cc.Layout).type = cc.Layout.Type.HORIZONTAL;
// }
// this.layout_qe.getComponent(cc.Layout).updateLayout();
this.layout_op.removeAllChildren(); this.layout_op.removeAllChildren();
data.optionList.forEach((dt, idx) => { data.optionList.forEach((dt, idx) => {
let item = cc.instantiate(this.item_op); let item = cc.instantiate(this.item_op);
// let width = this.layout_op.width;
// item.getComponent(cc.Label)._forceUpdateRenderData(true);
// if (width > 1400) {
// this.layout_op.getComponent(cc.Layout).type = cc.Layout.Type.GRID;
// }
item.parent = this.layout_op; item.parent = this.layout_op;
// this.layout_op.getComponent(cc.Layout).updateLayout();
this.iniItem(item, dt.txt) this.iniItem(item, dt.txt)
}) })
this.layout_op.getComponent(cc.Layout).updateLayout(); this.layout_op.getComponent(cc.Layout).updateLayout();
...@@ -327,9 +319,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -327,9 +319,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
return return
} }
this.playLocalAudio("right"); this.playLocalAudio("right");
let right_ske = cc.find("right_ske", itemBg); let item_right = cc.find("item_right", itemBg);
item_right.getComponent(cc.Label).enabled = true;
itemBg.getComponent(cc.Label).enabled = false;
let right_ske = cc.find("right_ske", item_right);
right_ske.active = true; right_ske.active = true;
target.parent = null; target.parent = null;
target.destroy(); target.destroy();
itemBg.getComponent(cc.Label).enabled = true; itemBg.getComponent(cc.Label).enabled = true;
...@@ -345,7 +342,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -345,7 +342,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
private checkIsEnd() { private checkIsEnd() {
let count = 0; let count = 0;
this.wordItams.forEach((ch) => { this.wordItams.forEach((ch) => {
if (ch.getComponent(cc.Label).enabled) count++ let item_right = cc.find("item_right", ch);
if (item_right && item_right.getComponent(cc.Label).enabled) count++
}) })
return count >= this.wordItams.length; return count >= this.wordItams.length;
} }
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
</div> </div>
<div class="border-dashed" style="margin-top: 20px;width: 800px;"> <div class="border-dashed" style="margin-top: 20px;width: 800px;">
<h2>点击文本设置空格</h2> <h2>点击文本设置挖空项</h2>
<span *ngFor="let cont of question.contentArr; let i = index" style="margin-bottom: 5px; "> <span *ngFor="let cont of question.contentArr; let i = index" style="margin-bottom: 5px; ">
<span style="font-size: 40px;" *ngIf="cont.block" class="option-title-line" <span style="font-size: 40px;" *ngIf="cont.block" class="option-title-line"
(click)="onBlock(cont,false)" [innerHtml]="cont.text"></span> (click)="onBlock(cont,false)" [innerHtml]="cont.text"></span>
......
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