Commit 4104ce72 authored by AU-Pro-mac's avatar AU-Pro-mac

add new code & fixed some bugs --01

parent abcff205
......@@ -126,7 +126,6 @@ var RES;
for (var key in resList) {
list.push(resList[key]);
}
console.log("开始加载spark资源1");
var p = new Promise(function (resolve, reject) {
loadResList(function (s) {
if (s) {
......@@ -174,7 +173,6 @@ var RES;
RES.loadGroup = loadGroup;
function getResAsync(str, comFun, thisObj) {
var type = str.substring(str.lastIndexOf(".") + 1, str.length);
console.log("开始加载spark资源4", type);
if (type == "png" || type == "jpg") {
if (FYGE.TextureCache[str]) {
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
......@@ -186,7 +184,6 @@ var RES;
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log("加载成功图片", image);
FYGE.Texture.addToCache(FYGE.Texture.from(image), str);
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
resolve(FYGE.TextureCache[str]);
......@@ -261,7 +258,6 @@ var RES;
if (!countAll)
callback(true);
var mark = true;
console.log("开始加载spark资源2");
for (var i = 0; i < countAll; i++) {
var resName = arr[i]['url'];
getResAsync("" + resName, function (res, str) {
......@@ -269,7 +265,6 @@ var RES;
mark = false;
if (++count == countAll)
callback(mark);
console.log("开始加载spark资源3");
}, this);
}
}
......@@ -1878,6 +1873,7 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}
......@@ -1920,7 +1916,6 @@ var Main = (function () {
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 1:
_a.sent();
console.log("FYGE.TextureCache", FYGE.TextureCache);
console.log('resloadingList 加载完毕');
this.loadImageTextures(resCanvasList).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -128,7 +128,6 @@ var RES;
for (var key in resList) {
list.push(resList[key]);
}
console.log("开始加载spark资源1");
var p = new Promise(function (resolve, reject) {
loadResList(function (s) {
if (s) {
......@@ -176,7 +175,6 @@ var RES;
RES.loadGroup = loadGroup;
function getResAsync(str, comFun, thisObj) {
var type = str.substring(str.lastIndexOf(".") + 1, str.length);
console.log("开始加载spark资源4", type);
if (type == "png" || type == "jpg") {
if (FYGE.TextureCache[str]) {
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
......@@ -188,7 +186,6 @@ var RES;
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log("加载成功图片", image);
FYGE.Texture.addToCache(FYGE.Texture.from(image), str);
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
resolve(FYGE.TextureCache[str]);
......@@ -263,7 +260,6 @@ var RES;
if (!countAll)
callback(true);
var mark = true;
console.log("开始加载spark资源2");
for (var i = 0; i < countAll; i++) {
var resName = arr[i]['url'];
getResAsync("" + resName, function (res, str) {
......@@ -271,7 +267,6 @@ var RES;
mark = false;
if (++count == countAll)
callback(mark);
console.log("开始加载spark资源3");
}, this);
}
}
......@@ -1880,6 +1875,7 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}
......@@ -1922,7 +1918,6 @@ var Main = (function () {
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 1:
_a.sent();
console.log("FYGE.TextureCache", FYGE.TextureCache);
console.log('resloadingList 加载完毕');
this.loadImageTextures(resCanvasList).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
......
......@@ -6,8 +6,8 @@ var fs = require("fs");
// fs.readFileSync("./output.js")
// )
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
var endPath = "C:/Users/Duiba/Desktop/work/雅顿/new/new_taobao/taobao_mini/client/pages/pagecanvas/"
// var endPath = '/Applications/DUIBA-TAOBAO/YD/new_taobao/taobao_mini/client/pages/pagecanvas/';
// var endPath = "C:/Users/Duiba/Desktop/work/雅顿/new/new_taobao/taobao_mini/client/pages/pagecanvas/"
var endPath = '/Applications/DUIBA-TAOBAO/YD/new_taobao/taobao_mini/client/pages/pagecanvas/';
var version = Math.round(new Date().getTime() / 1000);
......
......@@ -98,8 +98,11 @@ export class Main {
FYGE.GlobalLoader.loadImage(
(s, image) => {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete')
console.log('ssss', image)
setTimeout(() => {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete')
}, 60);
}
}, resCanvasList['63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'].url)
// [
......
......@@ -1238,7 +1238,7 @@ const resCanvasList = {
'7fcd3fb3-57bd-436a-afca-989b68b6b311': {
name: '背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/时光挑战赛背景__m.0a7dc2a8e1dc99921330774023817a27285b17d2.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/时光挑战赛背景__m.0a7dc2a8e1dc99921330774023817a27285b17d2.png',
uuid: '7fcd3fb3-57bd-436a-afca-989b68b6b311'
},
'7d1ec658-9371-4d52-b4d7-e75d04037daf': {
......@@ -1262,265 +1262,265 @@ const resCanvasList = {
'b022fbdd-8607-435a-a205-19fc3b5123eb': {
name: '铜色',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/铜色.eb01abbf52e377b6ff7b7f590e04a2d823c966fa.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/铜色.eb01abbf52e377b6ff7b7f590e04a2d823c966fa.png',
uuid: 'b022fbdd-8607-435a-a205-19fc3b5123eb'
},
'da63a36d-3bec-4707-8624-3fbb3dea02ab': {
name: '光效_00001',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00001.cc36a09f5f1ed0a2314a6b823ec2aab618948d74.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00001.cc36a09f5f1ed0a2314a6b823ec2aab618948d74.png',
uuid: 'da63a36d-3bec-4707-8624-3fbb3dea02ab'
},
'3456aea7-5f71-4964-a366-89eb2379082e': {
name: '光效_00002',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00002.c7f9f3bbceee77f6b9874108ba26b0460354892d.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00002.c7f9f3bbceee77f6b9874108ba26b0460354892d.png',
uuid: '3456aea7-5f71-4964-a366-89eb2379082e'
},
'cf8eaf18-c14d-4d4e-96e6-1cd3b8fbbab3': {
name: '光效_00003',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00003.dd6074a704ad16948bebce7a24d13f1c812aa535.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00003.dd6074a704ad16948bebce7a24d13f1c812aa535.png',
uuid: 'cf8eaf18-c14d-4d4e-96e6-1cd3b8fbbab3'
},
'512d1a11-0a61-461d-98f9-280188a120b8': {
name: '光效_00004',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00004.ce0a3a7c0ccee33c368eebbe3f85a36edcc28998.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00004.ce0a3a7c0ccee33c368eebbe3f85a36edcc28998.png',
uuid: '512d1a11-0a61-461d-98f9-280188a120b8'
},
'b38eceeb-780d-4f30-aa29-76a63f0dd24c': {
name: '光效_00005',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00005.5f2dea6555a08e44809064c10c46403be49aea7f.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00005.5f2dea6555a08e44809064c10c46403be49aea7f.png',
uuid: 'b38eceeb-780d-4f30-aa29-76a63f0dd24c'
},
'370ac7a9-8654-4b6d-b58b-ca8ee5d46d4a': {
name: '光效_00006',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00006.0adbb68fbcf94e41c582849948bf05d6b9781d54.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00006.0adbb68fbcf94e41c582849948bf05d6b9781d54.png',
uuid: '370ac7a9-8654-4b6d-b58b-ca8ee5d46d4a'
},
'9c259901-9df9-471e-80ec-d7da2f3079d0': {
name: '光效_00007',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00007.f222e6fefcd054bca14f19576db429436e930173.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00007.f222e6fefcd054bca14f19576db429436e930173.png',
uuid: '9c259901-9df9-471e-80ec-d7da2f3079d0'
},
'c1af4634-b601-48b5-b194-0754f80fcd1b': {
name: '光效_00008',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00008.300db61d542b5ef8a1167c12323034eb6f913402.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00008.300db61d542b5ef8a1167c12323034eb6f913402.png',
uuid: 'c1af4634-b601-48b5-b194-0754f80fcd1b'
},
'7716e0b7-81ad-4925-97bb-7a0f41be64cb': {
name: '光效_00009',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00009.53ed4e1fe34d29f5e1042ef4f1d4fb06b03a7f59.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00009.53ed4e1fe34d29f5e1042ef4f1d4fb06b03a7f59.png',
uuid: '7716e0b7-81ad-4925-97bb-7a0f41be64cb'
},
'35aa2a64-6f17-4665-8e8a-31b8504081cf': {
name: '光效_00010',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00010.c3631caa37d18f83efb9abf630f3a829a9118937.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00010.c3631caa37d18f83efb9abf630f3a829a9118937.png',
uuid: '35aa2a64-6f17-4665-8e8a-31b8504081cf'
},
'8cfb811c-1e3f-4deb-91c2-781f473167c3': {
name: '光效_00011',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00011.6678ff6e413759720b8f0ff23967b55cfc72b87e.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00011.6678ff6e413759720b8f0ff23967b55cfc72b87e.png',
uuid: '8cfb811c-1e3f-4deb-91c2-781f473167c3'
},
'5edcc725-aa13-4ee0-a7eb-e065d2e8a802': {
name: '光效_00012',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/光效_00012.b2e7f21e215b17223e4c0261d7c9f16f9be0bb16.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/光效_00012.b2e7f21e215b17223e4c0261d7c9f16f9be0bb16.png',
uuid: '5edcc725-aa13-4ee0-a7eb-e065d2e8a802'
},
'b896bbc5-e4e1-4161-97c8-6f43b066f30b': {
name: 'bg__m',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/bg__m.c28ef9508f067c27371312592adb60dd82d1653d.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/bg__m.c28ef9508f067c27371312592adb60dd82d1653d.png',
uuid: 'b896bbc5-e4e1-4161-97c8-6f43b066f30b'
},
'024b1ca1-1da7-4279-8bfd-1826e440525d': {
name: 'pk胜利获得奖品无文案背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/pk胜利获得奖品无文案背景.0d040881e1326fef2c84a86ba0b3e5228ce42cbe.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/pk胜利获得奖品无文案背景.0d040881e1326fef2c84a86ba0b3e5228ce42cbe.png',
uuid: '024b1ca1-1da7-4279-8bfd-1826e440525d'
},
'1b34f12b-ba72-41ec-848f-9e0de49403ee': {
name: 'pk胜利获得雅顿币背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/pk胜利获得雅顿币背景.fbacbd443654a6ae2b61d574d8c2d01c4945bea7.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/pk胜利获得雅顿币背景.fbacbd443654a6ae2b61d574d8c2d01c4945bea7.png',
uuid: '1b34f12b-ba72-41ec-848f-9e0de49403ee'
},
'f45dff96-8004-4fc8-bb74-20af177cd5f3': {
name: 'pk失败背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/pk失败背景.76dc33bcd146019064c41ff9db80d2318763f467.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/pk失败背景.76dc33bcd146019064c41ff9db80d2318763f467.png',
uuid: 'f45dff96-8004-4fc8-bb74-20af177cd5f3'
},
'5b61fddb-b1f8-4e24-bc2a-e356b540d70c': {
name: '白关闭',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/白关闭.21337c05d84f35081518085be78f1a55c386d0e2.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/白关闭.21337c05d84f35081518085be78f1a55c386d0e2.png',
uuid: '5b61fddb-b1f8-4e24-bc2a-e356b540d70c'
},
'9152efa4-2647-4354-9aec-7e23eb02bc22': {
name: '查看商品',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/查看商品.6ce90ced1dce7438d8a7d7585daf15dd2066b830.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/查看商品.6ce90ced1dce7438d8a7d7585daf15dd2066b830.png',
uuid: '9152efa4-2647-4354-9aec-7e23eb02bc22'
},
'6ffd395c-2bbd-424b-8322-6ffd89f26dc7': {
name: '对手匹配中0',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/对手匹配中0.5af99a55d3d2cfe59eadb4d19fc15b5dbd2185b9.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/对手匹配中0.5af99a55d3d2cfe59eadb4d19fc15b5dbd2185b9.png',
uuid: '6ffd395c-2bbd-424b-8322-6ffd89f26dc7'
},
'09ad238c-792e-45f2-98a0-fb64c97fc343': {
name: '对手匹配中1',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/对手匹配中1.668eea2ed2e3ee4077988cc75ab0bd5b2e1da1e0.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/对手匹配中1.668eea2ed2e3ee4077988cc75ab0bd5b2e1da1e0.png',
uuid: '09ad238c-792e-45f2-98a0-fb64c97fc343'
},
'8dd8a44b-1d9f-4ef5-8654-a37642ce6c57': {
name: '对手匹配中2',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/对手匹配中2.a1f428e3bbab16c45347e5d79cfc9d7937ab083a.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/对手匹配中2.a1f428e3bbab16c45347e5d79cfc9d7937ab083a.png',
uuid: '8dd8a44b-1d9f-4ef5-8654-a37642ce6c57'
},
'7e4905a6-b811-4923-820c-57cb725a7341': {
name: '对手匹配中3',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/对手匹配中3.2f20039e5601c8e80b67cf77f910262b821f350f.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/对手匹配中3.2f20039e5601c8e80b67cf77f910262b821f350f.png',
uuid: '7e4905a6-b811-4923-820c-57cb725a7341'
},
'647ae09a-7d11-4e03-96a2-ec8355e44a04': {
name: '关闭',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/关闭.478515dc464257d3f3e7c09b760b30e35d439a20.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/关闭.478515dc464257d3f3e7c09b760b30e35d439a20.png',
uuid: '647ae09a-7d11-4e03-96a2-ec8355e44a04'
},
'652675b5-b20f-4069-9568-f4ae633a0b7d': {
name: '奖品区域',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/奖品区域.a0a94f462d19f656bc1805069138ee2f0f6ebbbf.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/奖品区域.a0a94f462d19f656bc1805069138ee2f0f6ebbbf.png',
uuid: '652675b5-b20f-4069-9568-f4ae633a0b7d'
},
'c1875fdc-c1a1-491a-ba5b-1783f87e8d06': {
name: '平行四边形',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/平行四边形.d2edfc481ef3b634c7d3e24a6bc16921ab98e681.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/平行四边形.d2edfc481ef3b634c7d3e24a6bc16921ab98e681.png',
uuid: 'c1875fdc-c1a1-491a-ba5b-1783f87e8d06'
},
'2a8ee937-a863-4f5f-89eb-c8be40e0d5c5': {
name: '头像',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/头像.6f2d859f4ea1546438f0a4f91111faae706764f5.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/头像.6f2d859f4ea1546438f0a4f91111faae706764f5.png',
uuid: '2a8ee937-a863-4f5f-89eb-c8be40e0d5c5'
},
'781f95f5-18e1-49d6-aeb7-0464ddacd279': {
name: '右框',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/右框.4903d5656913366bab535e5db40431af060dc893.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/右框.4903d5656913366bab535e5db40431af060dc893.png',
uuid: '781f95f5-18e1-49d6-aeb7-0464ddacd279'
},
'77c6c9c9-5855-4b90-977e-27a2ffb8cd66': {
name: '再来一局',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/再来一局2.0f42d20f7c2a50ca2d6af3c6fa5867a731888dc5.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/再来一局2.0f42d20f7c2a50ca2d6af3c6fa5867a731888dc5.png',
uuid: '77c6c9c9-5855-4b90-977e-27a2ffb8cd66'
},
'5c1a2887-809b-4443-80cd-6f5526ebb540': {
name: '再来一局2',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/再来一局.e870c07bcf86e9197a063e70f196e5bf1666c61c.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/再来一局.e870c07bcf86e9197a063e70f196e5bf1666c61c.png',
uuid: '5c1a2887-809b-4443-80cd-6f5526ebb540'
},
'd5a0cbd7-6cb5-4dee-9a42-52a907eb6aed': {
name: '左框',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/左框.9e43afd6609f2bbe1f2eaf9c82607695c36550a4.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/左框.9e43afd6609f2bbe1f2eaf9c82607695c36550a4.png',
uuid: 'd5a0cbd7-6cb5-4dee-9a42-52a907eb6aed'
},
'0bc476b6-e334-40ac-8d60-614febb85885': {
name: '白色星星',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/白色星星.a2e4d2c3a06511b89bcff2333116832822fc6569.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/白色星星.a2e4d2c3a06511b89bcff2333116832822fc6569.png',
uuid: '0bc476b6-e334-40ac-8d60-614febb85885'
},
'2ce5cca4-0ea6-4460-a30c-6bd80446e38d': {
name: '背景星星',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/背景星星.4427e4094b413b4b509568f9026764590a895508.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/背景星星.4427e4094b413b4b509568f9026764590a895508.png',
uuid: '2ce5cca4-0ea6-4460-a30c-6bd80446e38d'
},
'c795ef77-7c31-47e9-b9c5-90cb5cbb2e78': {
name: '倒计时',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/倒计时.4fb5040ba3b85b4cc727de24d49fbcd5192ff6e6.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/倒计时.4fb5040ba3b85b4cc727de24d49fbcd5192ff6e6.png',
uuid: 'c795ef77-7c31-47e9-b9c5-90cb5cbb2e78'
},
'17bc9ddc-3c21-447e-9f73-4008eb49d830': {
name: '顶部消除分数',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/顶部消除分数.6196aa3e19063ea69b410604ca98f03cbf930f7c.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/顶部消除分数.6196aa3e19063ea69b410604ca98f03cbf930f7c.png',
uuid: '17bc9ddc-3c21-447e-9f73-4008eb49d830'
},
'3edac9c3-f88b-46cb-b763-525c3c774f1b': {
name: '关卡框',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/关卡框.1dfa3309bf16a2cd5f3abb7d1acb554a480c3998.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/关卡框.1dfa3309bf16a2cd5f3abb7d1acb554a480c3998.png',
uuid: '3edac9c3-f88b-46cb-b763-525c3c774f1b'
},
'5c5a81d6-4d33-4332-b4d8-a5947eedfa67': {
name: '红色星星',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/红色星星.a59c7696ad96eb2af3d08c72746bfeb84692e3b2.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/红色星星.a59c7696ad96eb2af3d08c72746bfeb84692e3b2.png',
uuid: '5c5a81d6-4d33-4332-b4d8-a5947eedfa67'
},
'400ad87f-1daf-47e6-8dae-83d50744f546': {
name: '红色进度条',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/红色进度条.f29a09445e730cae8359ac32eb7f6b0a0e120734.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/红色进度条.f29a09445e730cae8359ac32eb7f6b0a0e120734.png',
uuid: '400ad87f-1daf-47e6-8dae-83d50744f546'
},
'a7c7ac21-bda9-4906-b042-66e86cbccd0a': {
name: '进度条背景',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/进度条背景.b79ca5a0c3e4660cdc124bb21f3d1bfc9d68b401.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/进度条背景.b79ca5a0c3e4660cdc124bb21f3d1bfc9d68b401.png',
uuid: 'a7c7ac21-bda9-4906-b042-66e86cbccd0a'
},
'5bc08e08-54d1-4b67-a146-679c4ce1984d': {
name: 'PK',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/PK.f7e4bb9029bf786ff55396b5480213664f6451fd.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/PK.f7e4bb9029bf786ff55396b5480213664f6451fd.png',
uuid: '5bc08e08-54d1-4b67-a146-679c4ce1984d'
},
'1aaad06e-0c83-4ce1-a34b-89e1827fdf6b': {
name: '引导2',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/引导2.73f43e52ed6e331c0f6f495c41e3133ef3ff166e.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/引导2.73f43e52ed6e331c0f6f495c41e3133ef3ff166e.png',
uuid: '1aaad06e-0c83-4ce1-a34b-89e1827fdf6b'
},
'8ec95cad-73d7-4d81-8394-9ff688f8407b': {
name: '引导3',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/引导3.846cfb2168642f0c3ccc8e55aa5c254b60d22d66.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/引导3.846cfb2168642f0c3ccc8e55aa5c254b60d22d66.png',
uuid: '8ec95cad-73d7-4d81-8394-9ff688f8407b'
},
'c6193d9b-bd32-4929-a5fe-90d3da65215e': {
name: '引导4',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/引导4.d4de05da4af15a51897475371dcd560e475ce332.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/引导4.d4de05da4af15a51897475371dcd560e475ce332.png',
uuid: 'c6193d9b-bd32-4929-a5fe-90d3da65215e'
},
'427a3ff3-01b0-485c-8c65-b63e7139ef2f': {
name: '引导1',
ext: '.png',
url: '//yun.duiba.com.cn/spark-dev/assets/引导1.bee6160a10e790308c2f02b27374a62860fe43d2.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/引导1.bee6160a10e790308c2f02b27374a62860fe43d2.png',
uuid: '427a3ff3-01b0-485c-8c65-b63e7139ef2f'
}
};
......@@ -1541,145 +1541,145 @@ const resCanvasListCsd = {
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
url: 'https://yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760': {
name: 'guangTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/guangTexture.dadeebd0dd913c91d75a6bdab7810fa6a77b8b37.png',
url: 'https://yun.duiba.com.cn/spark/assets/guangTexture.dadeebd0dd913c91d75a6bdab7810fa6a77b8b37.png',
uuid: 'bdb3cbec-1af5-49e9-89ba-2c2ecd90f760'
},
'e2adae2c-ac89-49cc-a200-8daec42da146': {
name: 'lightTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/lightTexture.dae8dbc3cb6445863531557ca3b90b1b185eb995.png',
url: 'https://yun.duiba.com.cn/spark/assets/lightTexture.dae8dbc3cb6445863531557ca3b90b1b185eb995.png',
uuid: 'e2adae2c-ac89-49cc-a200-8daec42da146'
},
'334aff33-1a9e-4277-aafe-3d9f22eab3d5': {
name: '传送带返回',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带返回.2311961239a4cec1102cbaef694bcfa96e8e813d.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带返回.2311961239a4cec1102cbaef694bcfa96e8e813d.png',
uuid: '334aff33-1a9e-4277-aafe-3d9f22eab3d5'
},
'ad20a814-c0d4-4010-a76d-8e9114778580': {
name: '传送带棍子',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带棍子.1c8129c1c01b0ffff79c62f7248de814b90d5b58.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带棍子.1c8129c1c01b0ffff79c62f7248de814b90d5b58.png',
uuid: 'ad20a814-c0d4-4010-a76d-8e9114778580'
},
'217e095b-5c92-4c79-a8b2-a13730815d1d': {
name: '传送带bg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带bg.e8059ac6374da38450ba34c437b6b4040f931e87.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带bg.e8059ac6374da38450ba34c437b6b4040f931e87.png',
uuid: '217e095b-5c92-4c79-a8b2-a13730815d1d'
},
'd1379fca-f21e-40f0-b0f0-06c188d4b4dc': {
name: '商品1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品1.599f9257a53195dceb9f40c0c0f7aded34cdc131.png',
url: 'https://yun.duiba.com.cn/spark/assets/商品1.599f9257a53195dceb9f40c0c0f7aded34cdc131.png',
uuid: 'd1379fca-f21e-40f0-b0f0-06c188d4b4dc'
},
'0bd734c1-9c1a-428e-8a9c-cef373baed9d': {
name: '商品2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品2.8949611178fa2d44d4273855d7ec2f6dbaa2fbe0.png',
url: 'https://yun.duiba.com.cn/spark/assets/商品2.8949611178fa2d44d4273855d7ec2f6dbaa2fbe0.png',
uuid: '0bd734c1-9c1a-428e-8a9c-cef373baed9d'
},
'9e512c7f-88e2-4b85-a2f0-afd2062247e1': {
name: '商品3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品3.b767697456aee2b09886ebcf716ab1661f2d3ac3.png',
url: 'https://yun.duiba.com.cn/spark/assets/商品3.b767697456aee2b09886ebcf716ab1661f2d3ac3.png',
uuid: '9e512c7f-88e2-4b85-a2f0-afd2062247e1'
},
'30ac266d-0388-4659-9c3e-e741f3c671c7': {
name: '商品4',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品4.71ddf430f5224890c7a4740ac50e9d59b8fa32e4.png',
url: 'https://yun.duiba.com.cn/spark/assets/商品4.71ddf430f5224890c7a4740ac50e9d59b8fa32e4.png',
uuid: '30ac266d-0388-4659-9c3e-e741f3c671c7'
},
'f5c2161d-88e7-42f9-bcd6-de4ba299b73f': {
name: '引导1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导1.82653046b0d6983278d2d4bed8dda890de8eb310.png',
url: 'https://yun.duiba.com.cn/spark/assets/引导1.82653046b0d6983278d2d4bed8dda890de8eb310.png',
uuid: 'f5c2161d-88e7-42f9-bcd6-de4ba299b73f'
},
'946ce030-1669-4d8f-a074-b120e738b148': {
name: '引导2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导2.835e6f14c4d0be0a55a505671d54cdb3ac357c13.png',
url: 'https://yun.duiba.com.cn/spark/assets/引导2.835e6f14c4d0be0a55a505671d54cdb3ac357c13.png',
uuid: '946ce030-1669-4d8f-a074-b120e738b148'
},
'e23c5ce1-444f-41c3-a05b-08024ac27678': {
name: '引导3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
url: 'https://yun.duiba.com.cn/spark/assets/引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
uuid: 'e23c5ce1-444f-41c3-a05b-08024ac27678'
},
'f455b42a-0e67-43d8-b7c5-520760160631': {
name: '炸弹',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/炸弹.67df66e9cf5e166c8cf6d340886ef094a84954c9.png',
url: 'https://yun.duiba.com.cn/spark/assets/炸弹.67df66e9cf5e166c8cf6d340886ef094a84954c9.png',
uuid: 'f455b42a-0e67-43d8-b7c5-520760160631'
},
'b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0': {
name: '主要传送带',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/主要传送带.123506a9d21e1e865dfb73a111841cf5d54432ca.png',
url: 'https://yun.duiba.com.cn/spark/assets/主要传送带.123506a9d21e1e865dfb73a111841cf5d54432ca.png',
uuid: 'b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0'
},
'9df91df7-fc44-4d31-9f52-88d1ff65c9ba': {
name: 'userboard_left',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/userboard_left.b3ac0315adf5b1fc08faf81dadad51e842d17c6f.png',
url: 'https://yun.duiba.com.cn/spark/assets/userboard_left.b3ac0315adf5b1fc08faf81dadad51e842d17c6f.png',
uuid: '9df91df7-fc44-4d31-9f52-88d1ff65c9ba'
},
'9606b410-5d79-4759-a3f6-026dbb6fad0b': {
name: 'userboard_right',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/userboard_right.e62f8797b851fa7758f16d0a5b1fae6729989f8c.png',
url: 'https://yun.duiba.com.cn/spark/assets/userboard_right.e62f8797b851fa7758f16d0a5b1fae6729989f8c.png',
uuid: '9606b410-5d79-4759-a3f6-026dbb6fad0b'
},
'01def08f-119f-463d-bc75-1c7ab44b55d5': {
name: '传送带左边传送带2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带左边传送带2.7fea2ca2aa3d648a8bdb8af805c6bd43bcdf7f19.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带左边传送带2.7fea2ca2aa3d648a8bdb8af805c6bd43bcdf7f19.png',
uuid: '01def08f-119f-463d-bc75-1c7ab44b55d5'
},
'f6ba8f6a-54e0-4b75-93f3-00f5051f58eb': {
name: '齿轮',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/齿轮.d6b4a63009dbe5f489f39eec37952e644589337a.png',
url: 'https://yun.duiba.com.cn/spark/assets/齿轮.d6b4a63009dbe5f489f39eec37952e644589337a.png',
uuid: 'f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'
},
'b36dec27-734f-4458-8719-afda29c8c296': {
name: '传送带带子2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带带子2.57e04400bd98aeb93f87a6413c82ad39ea68c372.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带带子2.57e04400bd98aeb93f87a6413c82ad39ea68c372.png',
uuid: 'b36dec27-734f-4458-8719-afda29c8c296'
},
'2137d3de-174f-42b1-8ebc-c5eb667ed250': {
name: '传送带左边传送带',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带左边传送带.9ecaa198fe5be733f7de4f917aac0d8a8474aa0b.png',
url: 'https://yun.duiba.com.cn/spark/assets/传送带左边传送带.9ecaa198fe5be733f7de4f917aac0d8a8474aa0b.png',
uuid: '2137d3de-174f-42b1-8ebc-c5eb667ed250'
},
'828f6676-7956-473a-a951-bc2f5f1ba8a3': {
name: 'csd引导1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导1.d0aed3a62df5cbac7680a56fb8fd3403e76abe1f.png',
url: 'https://yun.duiba.com.cn/spark/assets/csd引导1.d0aed3a62df5cbac7680a56fb8fd3403e76abe1f.png',
uuid: '828f6676-7956-473a-a951-bc2f5f1ba8a3'
},
'bc6aa86d-7cd8-4a11-9bd1-931040af3c6e': {
name: 'csd引导2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导2.17f2a21407b5e055d93595f63c9c23d029828ab9.png',
url: 'https://yun.duiba.com.cn/spark/assets/csd引导2.17f2a21407b5e055d93595f63c9c23d029828ab9.png',
uuid: 'bc6aa86d-7cd8-4a11-9bd1-931040af3c6e'
},
'0668f8d0-6fb3-46f9-a5e4-952aef42f05c': {
name: 'csd引导3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
url: 'https://yun.duiba.com.cn/spark/assets/csd引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
uuid: '0668f8d0-6fb3-46f9-a5e4-952aef42f05c'
}
};
......@@ -1875,6 +1875,7 @@ var Main = (function () {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
console.log('ssss', image);
FYGE.createTextureSheet(new FYGE.BaseTexture(image), lottieTexture);
resolve('complete');
}
......@@ -1927,7 +1928,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
_a.sent();
ctrls_1.changeScene(XxlScene_1.XxlScene);
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
......@@ -15114,7 +15115,8 @@ var Robot = (function () {
this._time = 120 + Math.random() * 30;
this._needWin = needWin;
}
Robot.prototype.getScore = function (userScore, gameLeftTime) {
Robot.prototype.getScore = function (userScore, gameLeftTime, dt) {
if (dt === void 0) { dt = 0; }
if (this._time < 0) {
this._time = 120 + Math.random() * 60;
if (this._needWin) {
......@@ -15247,7 +15249,7 @@ exports.Star = Star;
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0;
exports.config = {
time: 12,
time: 120,
first: 1000,
second: 2000,
third: 3000,
......@@ -15772,6 +15774,7 @@ var XxlScene = (function (_super) {
case 0:
if (!!this.isGameEnd) return [3, 2];
this.isGameEnd = true;
this.updateFakeScore(this.robot.getScore(this.userScore, this.timeNum));
return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getPrizeInfo)];
case 1:
prizeInfo = _a.sent();
......@@ -15798,6 +15801,9 @@ var XxlScene = (function (_super) {
};
XxlScene.prototype.updateFakeScore = function (userGetScore) {
var _this = this;
if (this.isGameEnd || !this.isGameStart) {
return;
}
if (this.robotScore == userGetScore) {
return;
}
......@@ -16123,7 +16129,6 @@ var XxlScene = (function (_super) {
return;
}
if (this.isGameEnd) {
this.updateFakeScore(this.robot.getScore(this.userScore, this.timeNum));
this.gameOver();
return;
}
......@@ -16137,6 +16142,9 @@ var XxlScene = (function (_super) {
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
if (dt < 0) {
dt = 0;
}
this.tt += dt / 1000 >> 0;
var ntt = XxlConfig_1.config.time - this.tt;
if (ntt != this.timeNum) {
......
......@@ -94,18 +94,21 @@ Page({
// 开始旋转 转盘
async startDraw () {
console.log('%cstartDraw run', ConsoleStyle)
if (this.data.rotateFlag) return
this.setData({ rotateFlag: true })
console.log('%cstartDraw run', ConsoleStyle)
if (!this.data.leftTimes > 0) {
commonToast('您还没有抽奖次数')
setTimeout(() => { this.setData({ rotateFlag: false }) }, 300)
return
}
const { success, data } = await API.drawLotteryPrize({ activityId: this.activityId}).catch(res => {
commonToast(res && res.message)
this.setData({ rotateFlag: false })
return
}) || {}
console.log('%c--------领取实物奖品\n' + '-----yd.receiveObjectPrize\n', ConsoleStyle, data)
console.log('%c--------转盘抽奖\n' + '-----yd.drawLotteryPrize\n', ConsoleStyle, data)
// test code -
// let success = true
......@@ -115,9 +118,6 @@ Page({
// name: '一碗热翔',
// image: '//yun.duiba.com.cn/spark/assets/9be08f492b1e9fb4006cd676bcf5df760856b74a.png'
// }
// test code -
this.setData({ rotateFlag: true })
if (success && data) {
......@@ -132,7 +132,7 @@ Page({
// 1:权益(优惠券),2:积分,3:实物
} else if (data.type == 1 || data.type == 2 || data.type == 3) {
this.data.listTurnTable.forEach((item, index) => {
if (item._id == data.id) {
if (item._id == data.prizeId) {
rotateT = index + 1
rotateT = 4 + 1
this.setData({ rewardsInfo: data })
......@@ -144,56 +144,61 @@ Page({
}
// 调整位置-归零
this.animateRotation(this.timerCount ? 360 * (++this.timerCount * 2) : 0, 1)
this.animateRotation(this.timerCount ? 360 * (++this.timerCount * 2) : 0, 20)
rotateDeg = rotateT * 60 - 30
this.timerCount += 1
// 开始动画
setTimeout(() => {
this.animateRotation(360 * (++this.timerCount * 2) + rotateDeg, 1000 * (rotateDeg / 360) + 1000)
// 更改 rotateFlag - 弹窗 结果弹窗
setTimeout(() => {
this.setData({ rotateFlag: false })
if (data.type !== 5) {
this.showCommonMoadalT2({
title: '恭喜你',
content: `恭喜您获得${data.name}`,
confirmCallback1: async () => {
await this.getGameInfo()
this.closeCommonModalT2()
this.gotoMyPrize()
},
confirmCallback2: async () => {
await this.getGameInfo()
this.closeCommonModalT2()
},
btnImg1: resList['240b56fa-66ce-414c-86ea-4ac13a3ac4e2'].url,
btnImg2: resList['8d3b3b51-d535-48e6-a76c-d61920da4826'].url,
rewardsImg: data.image
})
} else {
this.showCommonMoadalT1({
title: '很遗憾',
content: `奖励与你擦肩而过\n 再接再厉哦~`,
confirmCallback: async () => {
await this.getGameInfo()
this.closeCommonModalT1()
},
btnImg: resList['fd0d94ef-fe1a-4771-8ba2-ad7aadacafc0'].url
})
}
}, 1000 * (rotateDeg / 360) + 1000 + 20)
this.animateRotation(360 * (this.timerCount * 2) + rotateDeg, 1000 * (rotateDeg / 360) + 40)
}, 300)
// 更改 rotateFlag - 弹窗 结果弹窗
setTimeout(() => {
if (data.type !== 5) {
this.showCommonMoadalT2({
title: '恭喜你',
content: `恭喜您获得${data.name}`,
confirmCallback1: async () => {
this.setData({ rotateFlag: false })
await this.getGameInfo()
this.closeCommonModalT2()
this.gotoMyPrize()
},
confirmCallback2: async () => {
this.setData({ rotateFlag: false })
await this.getGameInfo()
this.closeCommonModalT2()
},
btnImg1: resList['240b56fa-66ce-414c-86ea-4ac13a3ac4e2'].url,
btnImg2: resList['8d3b3b51-d535-48e6-a76c-d61920da4826'].url,
rewardsImg: data.image
})
} else {
this.showCommonMoadalT1({
title: '很遗憾',
content: `奖励与你擦肩而过\n 再接再厉哦~`,
confirmCallback: async () => {
this.setData({ rotateFlag: false })
await this.getGameInfo()
this.closeCommonModalT1()
},
btnImg: resList['fd0d94ef-fe1a-4771-8ba2-ad7aadacafc0'].url
})
}
}, 1000 * (rotateDeg / 360) + 1000 + 100)
let time = this.data.leftTimes - 1
this.setData({ leftTimes: time })
} else {
commonToast('网络拥堵,请稍后再试')
this.setData({ rotateFlag: false })
}
},
// 旋转动画rot:旋转角度,timegap:旋转时间
animateRotation (rot, timegap) {
console.log('animateRotation run')
console.log('animateRotation run', rot, timegap)
let animation = my.createAnimation({
transformOrigin: 'center center',
duration: timegap,
......@@ -296,11 +301,11 @@ Page({
// 通用弹层 - 关闭 - T1
closeCommonModalT1() {
this.setData({ commonModalVisibleT1: false });
this.setData({ commonModalVisibleT1: false, rotateFlag: false });
},
// 通用弹层 - 关闭 - T2
closeCommonModalT2() {
this.setData({ commonModalVisibleT2: false });
this.setData({ commonModalVisibleT2: false, rotateFlag: false });
},
onModalT2One () { this.data.onModalT2One() },
......
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