Commit a621fdcd authored by Li MingZhe's avatar Li MingZhe

fix: pos

parent 31c655ad
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<button nz-button nzType="dashed" (click)="addGroupBtnClick()" style="width: 150px; height: 55px; margin: 50px;"> <button *ngIf="item.groupArr?.length <= 4" nz-button nzType="dashed" (click)="addGroupBtnClick()" style="width: 150px; height: 55px; margin: 50px;">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加题 添加题
</button> </button>
......
...@@ -94,7 +94,7 @@ cc.Class({ ...@@ -94,7 +94,7 @@ cc.Class({
_animaResList: null, _animaResList: null,
preloadItem() { preloadItem() {
this.addPreloadImage(); this.addPreloadImage();
// this.addPreloadAudio(); this.addPreloadAudio();
// this.addPreloadAnima(); // this.addPreloadAnima();
this.preload(); this.preload();
}, },
...@@ -130,26 +130,13 @@ cc.Class({ ...@@ -130,26 +130,13 @@ cc.Class({
for (let i=0; i<groupArr.length; i++) { for (let i=0; i<groupArr.length; i++) {
this._imageResList.push({ url: groupArr[i].pic_url || ''}); this._imageResList.push({ url: groupArr[i].pic_url || ''});
} }
} }
}, },
addPreloadAudio() { addPreloadAudio() {
const groupArr = this.data.groupArr; this._audioResList.push({ url: this.data.title_audio_url || ''});
if (groupArr) {
for (let i=0; i<groupArr.length; i++) {
const optionArr = groupArr[i].optionArr;
for (let j=0; j<optionArr.length; j++) {
this._audioResList.push({ url: optionArr[j].audio_url || ''});
}
this._audioResList.push({ url: groupArr[i].audio_url || ''});
}
}
}, },
addPreloadAnima() { addPreloadAnima() {
...@@ -269,11 +256,11 @@ cc.Class({ ...@@ -269,11 +256,11 @@ cc.Class({
initPosArr() { initPosArr() {
this.posData = { this.posData = {
'1': [[0, 0]], '1': [[100, 0]],
'2': [[-50, 150], [50, -150]], '2': [[-50, 150], [200, -150]],
'3': [[-50, 150], [50, -150], [350, 0]], '3': [[-50, 150], [50, -150], [350, 0]],
'4': [[-250, 130], [-100, -150], [125, 150], [300, -130]], '4': [[-150, 130], [0, -150], [225, 150], [400, -130]],
'5': [[-250, 130], [-200, -180], [25, 150], [130, -130], [350, 50]], '5': [[-200, 170], [-100, -180], [125, 150], [230, -150], [470, 20]],
'6': [[], [], [], [], [], []], '6': [[], [], [], [], [], []],
'7': [[], [], [], [], [], [], []], '7': [[], [], [], [], [], [], []],
} }
...@@ -502,7 +489,7 @@ cc.Class({ ...@@ -502,7 +489,7 @@ cc.Class({
console.log('this.posData: ', this.posData); console.log('this.posData: ', this.posData);
const key = arr.length const key = 5//arr.length
const posArr = this.posData[key.toString()]; const posArr = this.posData[key.toString()];
for (let i=0; i<key; i++) { for (let i=0; i<key; i++) {
const bottle = this.getBottle(arr[i]); const bottle = this.getBottle(arr[i]);
...@@ -529,7 +516,7 @@ cc.Class({ ...@@ -529,7 +516,7 @@ cc.Class({
} }
this.role = role; this.role = role;
role.x = -500 * this._mapScaleMin; role.x = -470 * this._mapScaleMin;
role.y = -40 * this._mapScaleMin; role.y = -40 * this._mapScaleMin;
role.baseX = role.x; role.baseX = role.x;
...@@ -663,7 +650,7 @@ cc.Class({ ...@@ -663,7 +650,7 @@ cc.Class({
}, },
delayCall(time, cb) { delayCall(time, cb) {
cc.tween(this) return cc.tween(this)
.delay(time) .delay(time)
.call(() => { .call(() => {
if (cb) { if (cb) {
...@@ -734,8 +721,6 @@ cc.Class({ ...@@ -734,8 +721,6 @@ cc.Class({
this.roleBack(); this.roleBack();
this.setLayer2ByData(); this.setLayer2ByData();
this.hideSpeakIcon();
this.layer1.active = false; this.layer1.active = false;
this.layer2.active = true; this.layer2.active = true;
...@@ -756,6 +741,8 @@ cc.Class({ ...@@ -756,6 +741,8 @@ cc.Class({
this.setLayer2Pic(data); this.setLayer2Pic(data);
this.setLayer2TeacherPanel(data); this.setLayer2TeacherPanel(data);
this.setLayer2StudentPanel(data); this.setLayer2StudentPanel(data);
this.hideSpeakIcon();
}, },
...@@ -875,6 +862,7 @@ cc.Class({ ...@@ -875,6 +862,7 @@ cc.Class({
}, },
speakTween: null,
showSpeakIcon() { showSpeakIcon() {
if (this.isTeacher) { if (this.isTeacher) {
...@@ -885,11 +873,13 @@ cc.Class({ ...@@ -885,11 +873,13 @@ cc.Class({
this.appear(this.speakIcon, 0.5) this.appear(this.speakIcon, 0.5)
playAudio(this.speakClip); playAudio(this.speakClip);
const tmpBottle = this.curBottle;
this.delayCall(3, () => { if (this.speakTween) {
if (tmpBottle == this.curBottle) { this.speakTween.stop();
this.hideSpeakIcon();
} }
this.speakTween = this.delayCall(3, () => {
this.hideSpeakIcon();
this.speakTween = null;
}) })
}, },
......
No preview for this file type
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