Commit a65dd002 authored by spc's avatar spc

Merge branch 'yd11_20200922' of gitlab2.dui88.com:wanghongyuan/new_taobao into yd11_20200922

parents 6da53b0c c6a25eef
......@@ -1685,40 +1685,6 @@ const resCanvasListCsd = {
/***/ }),
/***/ "./resLottieList.js":
/*!**************************!*\
!*** ./resLottieList.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _resCanvasList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resCanvasList */ "./resCanvasList.js");
const resLottieList = {
// "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
// json:BlueCatTexture
// },
// "orengeCat":{
// imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
// json:OrengeCatTexture
// },
// "sanhuaCat":{
// imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
// json:SanhuaCatTexture
// },
// "xianluoCat":{
// imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
// json:XianluoCatTexture
// }
}
/* harmony default export */ __webpack_exports__["default"] = (resLottieList);
/***/ }),
/***/ "./src/Ins.ts":
/*!********************!*\
!*** ./src/Ins.ts ***!
......@@ -1830,15 +1796,14 @@ var resCanvasListCsd_1 = __webpack_require__(/*! ../resCanvasListCsd */ "./resCa
var lottieTexture = __webpack_require__(/*! ./openAnimation/Texture.json */ "./src/openAnimation/Texture.json");
var lottieTextureCsd_smoke = __webpack_require__(/*! ./chuansongdai/lottie/smoke/smokeTexture.json */ "./src/chuansongdai/lottie/smoke/smokeTexture.json");
var lottieTextureCsd_light = __webpack_require__(/*! ./chuansongdai/lottie/light/lightTexture.json */ "./src/chuansongdai/lottie/light/lightTexture.json");
var resLottieList_1 = __webpack_require__(/*! ../resLottieList */ "./resLottieList.js");
var Ins_1 = __webpack_require__(/*! ./Ins */ "./src/Ins.ts");
var initLottie_1 = __webpack_require__(/*! ./initLottie */ "./src/initLottie.ts");
var XxlScene_1 = __webpack_require__(/*! ./xiaoxiaole/XxlScene */ "./src/xiaoxiaole/XxlScene.ts");
var MainScene_1 = __webpack_require__(/*! ./chuansongdai/MainScene */ "./src/chuansongdai/MainScene.ts");
var MainScene_2 = __webpack_require__(/*! ./openAnimation/MainScene */ "./src/openAnimation/MainScene.ts");
exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () {
function Main(canvas) {
console.time('main.ts constructor');
console.warn = function () { };
var sysInfo;
if (my) {
......@@ -1858,6 +1823,21 @@ var Main = (function () {
self.requestID = FYGE.getRequestAnimationFrame()(loop);
}
}
Main.prototype.loadLottieFasterAndFaster = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTextures(resCanvasList_1.default)];
case 1:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
console.timeEnd('main.ts constructor');
return [2];
}
});
});
};
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
......@@ -1913,27 +1893,15 @@ var Main = (function () {
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
return [4, this.loadLottieFasterAndFaster()];
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
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);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 5:
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 2:
_a.sent();
console.log("initLottieList完成");
console.log('resloadingList 加载完毕');
FYGE.GDispatcher.dispatchEvent("loadEnd");
return [2];
}
......@@ -5364,69 +5332,6 @@ var G_EVENT;
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
/***/ }),
/***/ "./src/initLottie.ts":
/*!***************************!*\
!*** ./src/initLottie.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitLottie = void 0;
var InitLottie;
(function (InitLottie) {
function initLottieList(resList) {
console.log("开始加载lottie资源");
var list = [];
for (var key in resList) {
list.push(resList[key]);
}
console.log(list);
var p = new Promise(function (resolve, reject) {
initLottie(function (s) {
if (s) {
resolve();
}
else {
reject();
}
}, list);
});
return p;
}
InitLottie.initLottieList = initLottieList;
function initLottie(callback, arr) {
var count = 0;
var countAll = arr.length;
console.log(countAll);
if (!countAll)
callback(true);
var mark = true;
var _loop_1 = function (i) {
var textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), textureJson);
}
else {
mark = false;
}
if (++count == countAll)
callback(mark);
}, arr[i]["imgUrl"]);
};
for (var i = 0; i < countAll; i++) {
_loop_1(i);
}
}
InitLottie.initLottie = initLottie;
})(InitLottie = exports.InitLottie || (exports.InitLottie = {}));
/***/ }),
/***/ "./src/openAnimation/MainScene.ts":
......
This diff is collapsed.
......@@ -1687,40 +1687,6 @@ const resCanvasListCsd = {
/***/ }),
/***/ "./resLottieList.js":
/*!**************************!*\
!*** ./resLottieList.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _resCanvasList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resCanvasList */ "./resCanvasList.js");
const resLottieList = {
// "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
// json:BlueCatTexture
// },
// "orengeCat":{
// imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
// json:OrengeCatTexture
// },
// "sanhuaCat":{
// imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
// json:SanhuaCatTexture
// },
// "xianluoCat":{
// imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
// json:XianluoCatTexture
// }
}
/* harmony default export */ __webpack_exports__["default"] = (resLottieList);
/***/ }),
/***/ "./src/Ins.ts":
/*!********************!*\
!*** ./src/Ins.ts ***!
......@@ -1832,15 +1798,14 @@ var resCanvasListCsd_1 = __webpack_require__(/*! ../resCanvasListCsd */ "./resCa
var lottieTexture = __webpack_require__(/*! ./openAnimation/Texture.json */ "./src/openAnimation/Texture.json");
var lottieTextureCsd_smoke = __webpack_require__(/*! ./chuansongdai/lottie/smoke/smokeTexture.json */ "./src/chuansongdai/lottie/smoke/smokeTexture.json");
var lottieTextureCsd_light = __webpack_require__(/*! ./chuansongdai/lottie/light/lightTexture.json */ "./src/chuansongdai/lottie/light/lightTexture.json");
var resLottieList_1 = __webpack_require__(/*! ../resLottieList */ "./resLottieList.js");
var Ins_1 = __webpack_require__(/*! ./Ins */ "./src/Ins.ts");
var initLottie_1 = __webpack_require__(/*! ./initLottie */ "./src/initLottie.ts");
var XxlScene_1 = __webpack_require__(/*! ./xiaoxiaole/XxlScene */ "./src/xiaoxiaole/XxlScene.ts");
var MainScene_1 = __webpack_require__(/*! ./chuansongdai/MainScene */ "./src/chuansongdai/MainScene.ts");
var MainScene_2 = __webpack_require__(/*! ./openAnimation/MainScene */ "./src/openAnimation/MainScene.ts");
exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () {
function Main(canvas) {
console.time('main.ts constructor');
console.warn = function () { };
var sysInfo;
if (my) {
......@@ -1860,6 +1825,21 @@ var Main = (function () {
self.requestID = FYGE.getRequestAnimationFrame()(loop);
}
}
Main.prototype.loadLottieFasterAndFaster = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTextures(resCanvasList_1.default)];
case 1:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
console.timeEnd('main.ts constructor');
return [2];
}
});
});
};
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
......@@ -1915,27 +1895,15 @@ var Main = (function () {
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
return [4, this.loadLottieFasterAndFaster()];
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
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);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 5:
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 2:
_a.sent();
console.log("initLottieList完成");
console.log('resloadingList 加载完毕');
FYGE.GDispatcher.dispatchEvent("loadEnd");
return [2];
}
......@@ -5366,69 +5334,6 @@ var G_EVENT;
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
/***/ }),
/***/ "./src/initLottie.ts":
/*!***************************!*\
!*** ./src/initLottie.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitLottie = void 0;
var InitLottie;
(function (InitLottie) {
function initLottieList(resList) {
console.log("开始加载lottie资源");
var list = [];
for (var key in resList) {
list.push(resList[key]);
}
console.log(list);
var p = new Promise(function (resolve, reject) {
initLottie(function (s) {
if (s) {
resolve();
}
else {
reject();
}
}, list);
});
return p;
}
InitLottie.initLottieList = initLottieList;
function initLottie(callback, arr) {
var count = 0;
var countAll = arr.length;
console.log(countAll);
if (!countAll)
callback(true);
var mark = true;
var _loop_1 = function (i) {
var textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), textureJson);
}
else {
mark = false;
}
if (++count == countAll)
callback(mark);
}, arr[i]["imgUrl"]);
};
for (var i = 0; i < countAll; i++) {
_loop_1(i);
}
}
InitLottie.initLottie = initLottie;
})(InitLottie = exports.InitLottie || (exports.InitLottie = {}));
/***/ }),
/***/ "./src/openAnimation/MainScene.ts":
......
......@@ -84,6 +84,13 @@ export class Main {
}
}
// 尽快加载完
async loadLottieFasterAndFaster () {
await this.loadImageTextures(resCanvasList_)
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
sendTbNet(TbNetName.onload, {})
}
// 切换游戏
changeGameSence(gameType) {
this.gameType = gameType
......@@ -152,23 +159,15 @@ export class Main {
Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins.stageW, Ins.stageH)
let resCanvasList = Object.assign(resCanvasList_, resCanvasListCsd)
// changeScene(CsdScene)
// changeScene(XxlScene)
await this.loadLottieFasterAndFaster()
changeScene(OpenAni)
let resCanvasList = Object.assign(resCanvasList_, resCanvasListCsd)
await RES.loadSparkAssets(resCanvasList)
console.log('resloadingList 加载完毕')
await this.loadImageTextures(resCanvasList)
await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList)
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
// changeScene(OpenAni)
// changeScene(CsdScene)
changeScene(XxlScene)
sendTbNet(TbNetName.onload, {})
await InitLottie.initLottieList(resLottieList);
console.log("initLottieList完成")
FYGE.GDispatcher.dispatchEvent("loadEnd");
// showPanel(NoStepPanel)
......
......@@ -96,8 +96,41 @@ Page({
// 页面加载
// 开场动画
this.setData({ gameShow: true, gameType: 3, gameShow_timeout: true })
// 开场动画 => 业务页面 监听
// cover: getAuth login init checkDohelp
this.onAnimationLoadOver()
},
openAnimationTimeout: null,
onAnimationLoadFlag: false,
// 收到 canvas lottie 加载结束的 信息 -- 且等待 开场动画 5s
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;')
if (this.onAnimationLoadFlag) return
clearTimeout(this.openAnimationTimeout)
this.openAnimationTimeout = setTimeout(() => {
this.setData({ gameShow_timeout: false, gameType: 0 })
setTimeout(() => { this.setData({ gameShow: false }) }, 350)
// 主要的 授权 => 登陆 => 获取基本信息 开始
this.getAuth()
}, 4500)
} else if (!this.openAnimationTimeout) {
console.log('%conAnimationLoadOver timeout run', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
this.openAnimationTimeout = setTimeout(() => {
this.setData({ gameShow_timeout: false, gameType: 0 })
setTimeout(() => { this.setData({ gameShow: false }) }, 350)
this.onAnimationLoadFlag = true
// 主要的 授权 => 登陆 => 获取基本信息 开始
this.getAuth()
}, 5550)
}
},
// 获取用户授权信息
......@@ -218,34 +251,6 @@ 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;')
clearTimeout(this.openAnimationTimeout)
this.openAnimationTimeout = setTimeout(() => {
this.setData({ gameShow_timeout: false, gameType: 0 })
setTimeout(() => { this.setData({ gameShow: false }) }, 350)
}, 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.setData({ gameShow_timeout: false, gameType: 0 })
setTimeout(() => { this.setData({ gameShow: false }) }, 350)
}, 30000)
}
},
// 开场动画
openAnimation () {
return new Promise((resolve, reject) => {
this.setData({ gameShow: true, gameType: 3, gameShow_timeout: true })
})
},
// 检查助力标记
checkDohelpReturnMark () {
console.warn('检查助力返回标记!!', this.query)
......@@ -256,7 +261,8 @@ Page({
// 助力
checkDohelp(){
if (this.query.inviteId) {
API.doHelp({activityId: app.activityId, inviteId: this.query.inviteId}).then(res=>{
API.doHelp({activityId: app.activityId, inviteId: this.query.inviteId})
.then(res=>{
const { code, data, success, message } = res
console.log('%c-----助力接口\n' + '-----yd.doHelp\n', ConsoleStyle, res)
if (success) {
......@@ -268,8 +274,7 @@ Page({
},
btnImg: '//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png' })
} else {
if (code == '430004') commonToast(message)
if (!data.isVip) {
if (!data.isVip || data.url) {
app.vipUrl = data.url
this.showCommonMoadalT1({
title: '温馨提示',
......@@ -278,12 +283,25 @@ Page({
navigateToOutside(data.url)
},
btnImg: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png' })
} else {
commonToast(message);
}
}
commonToast(JSON.stringify(err));
})
.catch(err => {
console.log(`%c助力失败!!!\n` + '-----yd.doHelp\n', ConsoleStyle, err)
if (err.data.url) {
app.vipUrl = data.url
this.showCommonMoadalT1({
title: '温馨提示',
content: '成为会员 才能为他助力哦~',
confirmCallback: () => {
navigateToOutside(data.url)
},
btnImg: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png' })
} else {
commonToast(err.message + '.');
}
}).catch(err=>{
console.log(err)
commonToast(err.message);
});
} else {
console.log('不是分享落地页,不需要走助力~')
......
......@@ -1687,40 +1687,6 @@ const resCanvasListCsd = {
/***/ }),
/***/ "./resLottieList.js":
/*!**************************!*\
!*** ./resLottieList.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _resCanvasList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resCanvasList */ "./resCanvasList.js");
const resLottieList = {
// "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
// json:BlueCatTexture
// },
// "orengeCat":{
// imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
// json:OrengeCatTexture
// },
// "sanhuaCat":{
// imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
// json:SanhuaCatTexture
// },
// "xianluoCat":{
// imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
// json:XianluoCatTexture
// }
}
/* harmony default export */ __webpack_exports__["default"] = (resLottieList);
/***/ }),
/***/ "./src/Ins.ts":
/*!********************!*\
!*** ./src/Ins.ts ***!
......@@ -1832,15 +1798,14 @@ var resCanvasListCsd_1 = __webpack_require__(/*! ../resCanvasListCsd */ "./resCa
var lottieTexture = __webpack_require__(/*! ./openAnimation/Texture.json */ "./src/openAnimation/Texture.json");
var lottieTextureCsd_smoke = __webpack_require__(/*! ./chuansongdai/lottie/smoke/smokeTexture.json */ "./src/chuansongdai/lottie/smoke/smokeTexture.json");
var lottieTextureCsd_light = __webpack_require__(/*! ./chuansongdai/lottie/light/lightTexture.json */ "./src/chuansongdai/lottie/light/lightTexture.json");
var resLottieList_1 = __webpack_require__(/*! ../resLottieList */ "./resLottieList.js");
var Ins_1 = __webpack_require__(/*! ./Ins */ "./src/Ins.ts");
var initLottie_1 = __webpack_require__(/*! ./initLottie */ "./src/initLottie.ts");
var XxlScene_1 = __webpack_require__(/*! ./xiaoxiaole/XxlScene */ "./src/xiaoxiaole/XxlScene.ts");
var MainScene_1 = __webpack_require__(/*! ./chuansongdai/MainScene */ "./src/chuansongdai/MainScene.ts");
var MainScene_2 = __webpack_require__(/*! ./openAnimation/MainScene */ "./src/openAnimation/MainScene.ts");
exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () {
function Main(canvas) {
console.time('main.ts constructor');
console.warn = function () { };
var sysInfo;
if (my) {
......@@ -1860,6 +1825,21 @@ var Main = (function () {
self.requestID = FYGE.getRequestAnimationFrame()(loop);
}
}
Main.prototype.loadLottieFasterAndFaster = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTextures(resCanvasList_1.default)];
case 1:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
console.timeEnd('main.ts constructor');
return [2];
}
});
});
};
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
......@@ -1915,27 +1895,15 @@ var Main = (function () {
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
return [4, this.loadLottieFasterAndFaster()];
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
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);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 5:
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 2:
_a.sent();
console.log("initLottieList完成");
console.log('resloadingList 加载完毕');
FYGE.GDispatcher.dispatchEvent("loadEnd");
return [2];
}
......@@ -5366,69 +5334,6 @@ var G_EVENT;
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
/***/ }),
/***/ "./src/initLottie.ts":
/*!***************************!*\
!*** ./src/initLottie.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitLottie = void 0;
var InitLottie;
(function (InitLottie) {
function initLottieList(resList) {
console.log("开始加载lottie资源");
var list = [];
for (var key in resList) {
list.push(resList[key]);
}
console.log(list);
var p = new Promise(function (resolve, reject) {
initLottie(function (s) {
if (s) {
resolve();
}
else {
reject();
}
}, list);
});
return p;
}
InitLottie.initLottieList = initLottieList;
function initLottie(callback, arr) {
var count = 0;
var countAll = arr.length;
console.log(countAll);
if (!countAll)
callback(true);
var mark = true;
var _loop_1 = function (i) {
var textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), textureJson);
}
else {
mark = false;
}
if (++count == countAll)
callback(mark);
}, arr[i]["imgUrl"]);
};
for (var i = 0; i < countAll; i++) {
_loop_1(i);
}
}
InitLottie.initLottie = initLottie;
})(InitLottie = exports.InitLottie || (exports.InitLottie = {}));
/***/ }),
/***/ "./src/openAnimation/MainScene.ts":
......
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