Commit 4fc0860e authored by limingzhe's avatar limingzhe

feat: 滚动条 提交按钮出现

parent cb63e0a9
...@@ -2224,15 +2224,15 @@ export class ScrollView extends MySprite { ...@@ -2224,15 +2224,15 @@ export class ScrollView extends MySprite {
const boxEdgeY = curChild.y + (1 - curChild.anchorY) * curChild.height * curChild.scaleY; const boxEdgeY = curChild.y + (1 - curChild.anchorY) * curChild.height * curChild.scaleY;
if (!children[i].colorRect) { if (!children[i].colorRect) {
const rect = new ShapeRectNew(); // const rect = new ShapeRectNew();
rect.fillColor = '#ff0000'; // rect.fillColor = '#ff0000';
rect.setSize(curChild.width * curChild.scaleX, curChild.height * curChild.scaleY, 0); // rect.setSize(curChild.width * curChild.scaleX, curChild.height * curChild.scaleY, 0);
rect.alpha = 0.3; // rect.alpha = 0.3;
rect.x = boxEdgeX - curChild.width * curChild.scaleX; // rect.x = boxEdgeX - curChild.width * curChild.scaleX;
rect.y = boxEdgeY - curChild.height * curChild.scaleY; // rect.y = boxEdgeY - curChild.height * curChild.scaleY;
this.content.addChild(rect); // this.content.addChild(rect);
children[i].colorRect = rect; // children[i].colorRect = rect;
} }
// console.log('boxEdgeY: ', boxEdgeY); // console.log('boxEdgeY: ', boxEdgeY);
......
...@@ -667,8 +667,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -667,8 +667,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initMaskPic(); this.initMaskPic();
this.relink(); this.relink();
this.checkShowSubmit();
// this.gameStart(); this.gameStart();
// this.initBtn(); // this.initBtn();
...@@ -689,6 +690,19 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -689,6 +690,19 @@ export class PlayComponent implements OnInit, OnDestroy {
// // this.testInput() // // this.testInput()
} }
showSubmit() {
this.submitBtn.visible = true;
this.submitBtn.shadowSpr.visible = true;
}
hideSubmit() {
this.submitBtn.visible = false;
this.submitBtn.shadowSpr.visible = false;
}
testInput() { testInput() {
const tmpRect = this.sentenceEmptyArr[0].getBoundingBox(); const tmpRect = this.sentenceEmptyArr[0].getBoundingBox();
...@@ -1633,8 +1647,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1633,8 +1647,6 @@ export class PlayComponent implements OnInit, OnDestroy {
if (!this.canTouch) { if (!this.canTouch) {
return; return;
} }
...@@ -1770,6 +1782,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1770,6 +1782,8 @@ export class PlayComponent implements OnInit, OnDestroy {
mapUp(event) { mapUp(event) {
this.checkShowSubmit();
if (this.resultPanel) { if (this.resultPanel) {
this.resultSv.onTouchEnd(this.mx, this.my); this.resultSv.onTouchEnd(this.mx, this.my);
return; return;
...@@ -2281,15 +2295,28 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2281,15 +2295,28 @@ export class PlayComponent implements OnInit, OnDestroy {
checkShowSubmit() { checkShowSubmit() {
for (let i=0; i<this.btnArr.length; i++) {
if (this.btnArr[i].visible) { const arr = this.hotZoneArr;
console.log('arr: ', arr);
for (let i=0; i<arr.length; i++) {
console.log('i: ', i);
console.log('arr[i]: ', arr[i]);
if (arr[i].data.gIdx == '0') {
if (!arr[i].label || !arr[i].label.text) {
this.hideSubmit();
return; return;
} }
} }
this.submitBtn.visible = true;
this.submitBtn.shadowSpr.visible = true;
this.submitBtn.offBtn.visible = false; }
this.showSubmit();
} }
......
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