Commit 0bcbd4be authored by Li MingZhe's avatar Li MingZhe

fix: 瓶子异常

parent 652562c0
......@@ -85,12 +85,14 @@ cc.Class({
if (aspect) {
console.log('aspect : ', aspect);
this.serverAllUser = aspect.all_user;
this.initHistoryData(aspect.user_aspect);
}
this.initHistoryData(aspect.user_aspect);
console.log('data:', data);
this.data = data || this.getDefaultData();
this.preloadItem()
})
},
......@@ -196,6 +198,7 @@ cc.Class({
c.onEvent('show_cap', (data, next) => {
console.log('in show_cap event', data);
this.historyData = data.historyData;
this.data.groupArr = this.historyData.arrData;
this.showCapAnima(data.index);
next();
});
......@@ -247,11 +250,14 @@ cc.Class({
if (user_aspect) {
let data = JSON.parse(user_aspect).historyData;
for (let i=0; i<this.serverAllUser.length; i++) {
if (this.serverAllUser[i].aspect) {
const userHistoryData = JSON.parse(this.serverAllUser[i].aspect).historyData
if (userHistoryData.dateTime > data.dateTime) {
if (userHistoryData && userHistoryData.dateTime > data.dateTime) {
data = userHistoryData;
}
}
}
this.historyData = data;
console.log('this.historyData: ', this.historyData);
}
......@@ -274,7 +280,7 @@ cc.Class({
return;
}
this.data.groupArr = this.historyData.arrData;
this.groupIndex = this.historyData.index;
// this.groupIndex = this.historyData.index;
this.curBottle = this.bottleArr[this.historyData.index];
this.reconnectBottleState();
......@@ -288,6 +294,7 @@ cc.Class({
if (arrData[i]?.isEnd) {
this.bottleArr[i].scroll.active = false;
this.bottleArr[i].cap.active = false;
this.bottleArr[i].data.isEnd = true;
}
}
},
......@@ -745,8 +752,10 @@ cc.Class({
})
this.curBottle = bottle;
this.groupIndex = this.data.groupArr.indexOf( bottle.data );
this.curBottle.data.isEnd = true;
// this.groupIndex = this.data.groupArr.indexOf( bottle.data );
// this.curBottle.data.isEnd = true;
this.data.groupArr[index].isEnd = true;
playAudio(this.capClip);
},
......
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