Commit c19fa890 authored by AU-Pro-mac's avatar AU-Pro-mac

fixed open animaiton load lottie bug --01

parent 44b9e3fa
......@@ -1539,7 +1539,7 @@ const resCanvasListCsd = {
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture__.b7037af9b8c768386bbe994c40e5331fbd8d4e8a.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760': {
......@@ -1860,6 +1860,7 @@ var Main = (function () {
}
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
if (gameType === 1)
ctrls_1.changeScene(MainScene_1.CsdScene);
else if (gameType === 2)
......@@ -1873,11 +1874,10 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}, 60);
}, 200);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
});
......@@ -1905,7 +1905,6 @@ var Main = (function () {
Main.prototype.onAddToStage = function () {
return __awaiter(this, void 0, void 0, function () {
var resCanvasList;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -1919,22 +1918,20 @@ var Main = (function () {
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
this.loadImageTextures(resCanvasList).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 1:
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
case 4:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
}); });
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 2:
case 5:
_a.sent();
console.log("initLottieList完成");
FYGE.GDispatcher.dispatchEvent("loadEnd");
......@@ -2051,6 +2048,7 @@ var TbNetName;
TbNetName["getUserInfo"] = "mine.getUserInfo";
TbNetName["getPrizeInfo"] = "mine.getPrizeInfo";
TbNetName["seePrize"] = "mine.seePrize";
TbNetName["onload"] = "mine.animationOnloaded";
})(TbNetName = exports.TbNetName || (exports.TbNetName = {}));
var dataRecord = {};
var fc;
......@@ -15770,6 +15768,9 @@ var XxlScene = (function (_super) {
XxlScene.prototype.updateScore = function (userGetScore) {
var _this = this;
this.userScore += userGetScore;
if (this.userScore > this.robotScore) {
this.updateFakeScore(this.robot.getScore(this.userScore, this.timeNum));
}
if (this.level < 2 && this.userScore >= 1000 && this.userScore < 2000) {
this.level = 2;
this.llevelText.text = "第" + this.level + "关";
......@@ -16047,7 +16048,7 @@ var XxlScene = (function (_super) {
XxlScene.prototype.findCircleItemByPos = function (p0, p1) {
for (var _i = 0, _a = this.circleItems; _i < _a.length; _i++) {
var co = _a[_i];
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3) {
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3 + 5) {
if (this.selectItems.indexOf(co) == -1) {
return co;
}
......
This diff is collapsed.
......@@ -1541,7 +1541,7 @@ const resCanvasListCsd = {
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture__.b7037af9b8c768386bbe994c40e5331fbd8d4e8a.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760': {
......@@ -1862,6 +1862,7 @@ var Main = (function () {
}
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
if (gameType === 1)
ctrls_1.changeScene(MainScene_1.CsdScene);
else if (gameType === 2)
......@@ -1875,11 +1876,10 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}, 60);
}, 200);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
});
......@@ -1907,7 +1907,6 @@ var Main = (function () {
Main.prototype.onAddToStage = function () {
return __awaiter(this, void 0, void 0, function () {
var resCanvasList;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -1921,22 +1920,20 @@ var Main = (function () {
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
this.loadImageTextures(resCanvasList).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 1:
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
case 4:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
}); });
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 2:
case 5:
_a.sent();
console.log("initLottieList完成");
FYGE.GDispatcher.dispatchEvent("loadEnd");
......@@ -2053,6 +2050,7 @@ var TbNetName;
TbNetName["getUserInfo"] = "mine.getUserInfo";
TbNetName["getPrizeInfo"] = "mine.getPrizeInfo";
TbNetName["seePrize"] = "mine.seePrize";
TbNetName["onload"] = "mine.animationOnloaded";
})(TbNetName = exports.TbNetName || (exports.TbNetName = {}));
var dataRecord = {};
var fc;
......@@ -15772,6 +15770,9 @@ var XxlScene = (function (_super) {
XxlScene.prototype.updateScore = function (userGetScore) {
var _this = this;
this.userScore += userGetScore;
if (this.userScore > this.robotScore) {
this.updateFakeScore(this.robot.getScore(this.userScore, this.timeNum));
}
if (this.level < 2 && this.userScore >= 1000 && this.userScore < 2000) {
this.level = 2;
this.llevelText.text = "第" + this.level + "关";
......@@ -16049,7 +16050,7 @@ var XxlScene = (function (_super) {
XxlScene.prototype.findCircleItemByPos = function (p0, p1) {
for (var _i = 0, _a = this.circleItems; _i < _a.length; _i++) {
var co = _a[_i];
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3) {
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3 + 5) {
if (this.selectItems.indexOf(co) == -1) {
return co;
}
......
......@@ -87,6 +87,7 @@ export class Main {
// 切换游戏
changeGameSence(gameType) {
this.gameType = gameType
console.log('changeGameSence')
if (gameType === 1) changeScene(CsdScene)
else if (gameType === 2) changeScene(XxlScene)
else if (gameType === 3) changeScene(OpenAni)
......@@ -101,7 +102,7 @@ export class Main {
setTimeout(() => {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete')
}, 60);
}, 200);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url)
// [
......@@ -155,16 +156,16 @@ export class Main {
await RES.loadSparkAssets(resCanvasList)
console.log('resloadingList 加载完毕')
this.loadImageTextures(resCanvasList).then(async res => {
await this.loadImageTextures(resCanvasList)
await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList)
console.log(22222222222222222222)
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
changeScene(OpenAni)
sendTbNet(TbNetName.onload, {})
// changeScene(CsdScene)
// changeScene(XxlScene)
})
sendTbNet(TbNetName.onload, {})
await InitLottie.initLottieList(resLottieList);
console.log("initLottieList完成")
......
......@@ -95,10 +95,8 @@ Page({
// 页面加载
// 开场动画
this.openAnimation().then(async res_ => {
this.backToPage()
this.onAnimationLoadOver()
this.getAuth()
})
},
// 获取用户授权信息
......@@ -219,6 +217,33 @@ Page({
},
openAnimationTimeout: null,
// 收到 canvas lottie 加载结束的 信息 -- 且等待 开场动画 30s
onAnimationLoadOver (msg = '') {
if (msg = 'lottieReady') {
console.log('%creceive canvas lottie ready, onAnimationLoadOver', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
console.log(`%c${msg}`, 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
this.openAnimationTimeout = null
clearTimeout(this.openAnimationTimeout)
this.openAnimationTimeout = setTimeout(() => {
this.backToPage()
}, 5000)
} else if (!this.openAnimationTimeout) {
console.log('%conAnimationLoadOver timeout run', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
this.openAnimationTimeout = setTimeout(() => {
this.backToPage()
}, 30000)
}
},
// 开场动画
openAnimation () {
return new Promise((resolve, reject) => {
this.setData({ gameShow: true, gameType: 3, gameShow_timeout: true })
})
},
// 检查助力标记
checkDohelpReturnMark () {
console.warn('检查助力返回标记!!', this.query)
......@@ -327,16 +352,6 @@ Page({
})
},
// 开场动画
openAnimation () {
return new Promise((resolve, reject) => {
this.setData({ gameShow: true, gameType: 3, gameShow_timeout: true })
setTimeout(() => {
resolve('complete')
}, 5000)
})
},
// 去游戏 防抖
handleClickGame (e) { debounce(this.changeGameOrPage(e), 300) },
......
......@@ -1541,7 +1541,7 @@ const resCanvasListCsd = {
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture__.b7037af9b8c768386bbe994c40e5331fbd8d4e8a.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760': {
......@@ -1862,6 +1862,7 @@ var Main = (function () {
}
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
if (gameType === 1)
ctrls_1.changeScene(MainScene_1.CsdScene);
else if (gameType === 2)
......@@ -1875,11 +1876,10 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
setTimeout(function () {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}, 60);
}, 200);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url);
});
......@@ -1907,7 +1907,6 @@ var Main = (function () {
Main.prototype.onAddToStage = function () {
return __awaiter(this, void 0, void 0, function () {
var resCanvasList;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -1921,22 +1920,20 @@ var Main = (function () {
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
this.loadImageTextures(resCanvasList).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 1:
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
case 4:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
}); });
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 2:
case 5:
_a.sent();
console.log("initLottieList完成");
FYGE.GDispatcher.dispatchEvent("loadEnd");
......@@ -2053,6 +2050,7 @@ var TbNetName;
TbNetName["getUserInfo"] = "mine.getUserInfo";
TbNetName["getPrizeInfo"] = "mine.getPrizeInfo";
TbNetName["seePrize"] = "mine.seePrize";
TbNetName["onload"] = "mine.animationOnloaded";
})(TbNetName = exports.TbNetName || (exports.TbNetName = {}));
var dataRecord = {};
var fc;
......@@ -15772,6 +15770,9 @@ var XxlScene = (function (_super) {
XxlScene.prototype.updateScore = function (userGetScore) {
var _this = this;
this.userScore += userGetScore;
if (this.userScore > this.robotScore) {
this.updateFakeScore(this.robot.getScore(this.userScore, this.timeNum));
}
if (this.level < 2 && this.userScore >= 1000 && this.userScore < 2000) {
this.level = 2;
this.llevelText.text = "第" + this.level + "关";
......@@ -16049,7 +16050,7 @@ var XxlScene = (function (_super) {
XxlScene.prototype.findCircleItemByPos = function (p0, p1) {
for (var _i = 0, _a = this.circleItems; _i < _a.length; _i++) {
var co = _a[_i];
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3) {
if (this.getDistance(co.point, p0) < this.radius * 1.5 && this.getDistance(p1, co.point) < this.radius / 3 + 5) {
if (this.selectItems.indexOf(co) == -1) {
return co;
}
......
......@@ -138,7 +138,7 @@ Component({
},
// 開場動畫結束
openAnimationOver() {
this.props.onAnimationLoadOver()
this.props.onAnimationLoadOver('lottieReady')
},
// 从游戏中返回
back () {
......
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