Commit 121bd2a0 authored by wildfirecode's avatar wildfirecode

1

parent b55bc6cd
No preview for this file type
node_modules
debug
debug/*.js
debug/*.js.map
.rpt2_cache
dist
**/*/.DS_Store
\ No newline at end of file
......@@ -189,6 +189,21 @@
}
]
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "POST",
"name": "limitTimes",
"onResponse": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "updateCountFromNet"
}
],
"uri": "/customActivity/sjf/activity/getActivityFreeLimt"
}
}
],
"uuid": "41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
......@@ -383,7 +398,7 @@
"_x": 0,
"_y": 245.1060606060605,
"x": 0,
"y": 199.07431457431449
"y": 187.64574314574307
}
}
},
......@@ -429,7 +444,7 @@
"_x": 0,
"_y": 299.651515151515,
"x": 0,
"y": 271.08008658008646
"y": 259.65151515151507
}
}
},
......@@ -481,7 +496,7 @@
"script": "components/renderer/TextRenderer",
"properties": {
"fillColor": "rgba(254, 220, 187, 1)",
"text": "啥也没发"
"text": ""
}
}
],
......
......@@ -21,7 +21,8 @@ export default class MainController extends ScillaComponent {
initEnv();
console.log('游戏刷新了...');
// const limit = localStorage.getItem('')
}
......
......@@ -4,16 +4,16 @@
* 简单的api组件
*/
import {utils, } from 'scilla/src'
import { utils, } from 'scilla/src'
import ApiComponent from "./ApiComponent";
import {callApi} from "../net/webService";
import { callApi } from "../net/webService";
export default class SampleApi extends ApiComponent {
uri: string;
ignoreSuccessField = false;
async callApi(name, paramsInput, ...args){
if(this.name == name){
async callApi(name, paramsInput, ...args) {
if (this.name == name) {
await this.execute(paramsInput, ...args);
}
}
......@@ -23,20 +23,22 @@ export default class SampleApi extends ApiComponent {
const params = {};
if(this.params){
if (this.params) {
utils.injectProp(params, this.params);
}
if(paramsInput){
if (paramsInput) {
utils.injectProp(params, paramsInput);
}
const {uri, method} = this;
const { uri, method } = this;
try {
console.log(`${uri}==>${JSON.stringify(params)}`);
const response = await callApi(uri, params, method, 'json', this.ignoreSuccessField);
this.onGotResponse(response);
console.log(`${uri}<<==${JSON.stringify(response)}`);
return response.data;
} catch (e) {
......
......@@ -52,14 +52,36 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
updateCountFromNet(limit: number) {
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountFromNet', `剩余次数:${limit}`)
}
updateCountTxtFromDojoin() {
let limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
}
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountTxtFromDojoin', `剩余次数:${limit}`)
}
onAwake() {
super.onAwake();
this.updateCountTxt();
this.broadcast('callApi', 1, 'rankInfo2', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this.broadcast('callApi', 1, 'limitTimes', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this._shakeTimes = 0;
this._counter = 0;
this._lastTime = -1;
......@@ -88,18 +110,6 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
return 'prizeShowed-' + window['CFG'].weixinUid + '-' + window['CFG'].weddingId + '-' + window['CFG'].activityId
}
updateCountTxt() {
let limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
} else {
limit = window['CFG'].freeLimit;
}
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log(`剩余次数:${limit}`)
}
initGameStage() {
console.log('initGameStage')
}
......@@ -131,7 +141,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.startbtn.getComponent(Button).enabled = true;
this.updateCountTxt();
this.updateCountTxtFromDojoin();
setTimeout(() => {
this.bubbling('fuck', 'guide');
}, 50);
......
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.shuijf = {})));
}(this, (function (exports) { 'use strict';
(global = global || self, factory(global.shuijf = {}));
}(this, function (exports) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
......@@ -162,7 +162,7 @@
if (Array.isArray(valueConfig)) {
target[key] = {};
try {
for (var valueConfig_1 = (e_1 = void 0, __values(valueConfig)), valueConfig_1_1 = valueConfig_1.next(); !valueConfig_1_1.done; valueConfig_1_1 = valueConfig_1.next()) {
for (var valueConfig_1 = __values(valueConfig), valueConfig_1_1 = valueConfig_1.next(); !valueConfig_1_1.done; valueConfig_1_1 = valueConfig_1.next()) {
var field = valueConfig_1_1.value;
target[key][field] = data[key][field];
}
......@@ -1808,8 +1808,8 @@
var _animData = this._animData;
var texture, frameData;
if (_animData) {
var frames_1 = _animData.frames;
frameData = frames_1[frameIndex];
var frames = _animData.frames;
frameData = frames[frameIndex];
if (frameData) {
var res = frameData.res;
texture = textureMap[res];
......@@ -1936,7 +1936,7 @@
if (cache === void 0) { cache = true; }
if (options === void 0) { options = {}; }
if (type === void 0) { type = 'arraybuffer'; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var response, result;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -1988,7 +1988,7 @@
};
AssetsManager.prototype.loadJson5 = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var txt, jsonData;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -2006,7 +2006,7 @@
};
AssetsManager.prototype.loadPrefab = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var data;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -2040,9 +2040,9 @@
try {
for (var _b = __values(config.textures), _c = _b.next(); !_c.done; _c = _b.next()) {
var textureConfig = _c.value;
var name_1 = textureConfig.name, uuid_1 = textureConfig.uuid;
var texture = sheet.getTexture(name_1);
_this.cacheRes(texture, name_1, uuid_1);
var name = textureConfig.name, uuid_1 = textureConfig.uuid;
var texture = sheet.getTexture(name);
_this.cacheRes(texture, name, uuid_1);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
......@@ -2065,9 +2065,8 @@
};
AssetsManager.prototype.loadSheetDisperse = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
var sheet, _a, _b, _c, name_2, uuid_2, subUrl, texture, e_2_1;
var e_2, _d;
return __awaiter(this, void 0, Promise, function () {
var e_2, _a, sheet, _b, _c, _d, name, uuid_2, subUrl, texture, e_2_1;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
......@@ -2075,19 +2074,19 @@
_e.label = 1;
case 1:
_e.trys.push([1, 6, 7, 8]);
_a = __values(config.textures), _b = _a.next();
_b = __values(config.textures), _c = _b.next();
_e.label = 2;
case 2:
if (!!_b.done) return [3, 5];
_c = _b.value, name_2 = _c.name, uuid_2 = _c.uuid;
subUrl = url.replace('-disperse', '') + '/' + name_2;
if (!!_c.done) return [3, 5];
_d = _c.value, name = _d.name, uuid_2 = _d.uuid;
subUrl = url.replace('-disperse', '') + '/' + name;
return [4, this.loadTexture(subUrl, uuid_2)];
case 3:
texture = _e.sent();
sheet.inputTexture(name_2, texture);
sheet.inputTexture(name, texture);
_e.label = 4;
case 4:
_b = _a.next();
_c = _b.next();
return [3, 2];
case 5: return [3, 8];
case 6:
......@@ -2096,7 +2095,7 @@
return [3, 8];
case 7:
try {
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
return [7];
......@@ -2141,17 +2140,17 @@
var img = result[1];
putFrameAnim(img, data);
var animations = {};
for (var name_3 in data.mc) {
var animation = getFrameAnimation(name_3);
for (var name in data.mc) {
var animation = getFrameAnimation(name);
if (cache) {
var uuid_3 = name_3;
var uuid_3 = name;
if (config) {
var cfg = _this.findAnimConfig(config.animations, name_3);
var cfg = _this.findAnimConfig(config.animations, name);
uuid_3 = cfg.uuid;
}
_this.cacheRes(animation, name_3, uuid_3);
_this.cacheRes(animation, name, uuid_3);
}
animations[name_3] = animation;
animations[name] = animation;
}
if (cache) {
_this.cacheRes(animations, url, uuid);
......@@ -2178,7 +2177,7 @@
};
AssetsManager.prototype.loadImageFromBlob = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var imgBlob, e_3;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -2200,7 +2199,7 @@
};
AssetsManager.prototype.loadTexture = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var img, texture;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -2218,7 +2217,7 @@
};
AssetsManager.prototype.loadTextureFromBlob = function (url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, void 0, Promise, function () {
var img, texture;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -2748,9 +2747,9 @@
if (!isLocalPos) {
var doc = document.documentElement;
var left = box.left + window.pageXOffset - doc.clientLeft;
var top_1 = box.top + window.pageYOffset - doc.clientTop;
var top = box.top + window.pageYOffset - doc.clientTop;
x = pageX - left;
y = pageY - top_1;
y = pageY - top;
}
var newX = x;
var newY = y;
......@@ -2779,9 +2778,9 @@
var box = this._canvasElement.getBoundingClientRect();
var doc = document.documentElement;
var left = box.left + window.pageXOffset - doc.clientLeft;
var top_2 = box.top + window.pageYOffset - doc.clientTop;
var top = box.top + window.pageYOffset - doc.clientTop;
x += left;
y += top_2;
y += top;
}
return {
x: x, y: y,
......@@ -2830,11 +2829,11 @@
function setupEntity(config, root, pid) {
var entity = null;
if (config) {
var name_1 = config.name, uuid = config.uuid, children = config.children;
var name = config.name, uuid = config.uuid, children = config.children;
if (pid !== undefined && uuid !== undefined) {
uuid = pid + '_' + uuid;
}
entity = root || new Entity(name_1, uuid);
entity = root || new Entity(name, uuid);
entityMap[uuid] = entity;
if (children) {
for (var i = 0, li = children.length; i < li; i++) {
......@@ -4363,12 +4362,12 @@
});
var Scene = (function () {
function Scene(engine$$1) {
function Scene(engine) {
this._resourceGroups = {
preload: [],
delay: [],
};
this._engine = engine$$1;
this._engine = engine;
}
Object.defineProperty(Scene.prototype, "root", {
get: function () {
......@@ -4611,7 +4610,7 @@
this.transformToLocal();
this.render();
if (EngineConfig.drawRenderRect) {
var _a = this, context = _a.context, _debugDrawColor = _a._debugDrawColor, _b = _a.bounds, width = _b.width, height = _b.height, _c = _a._anchorOffset, x_1 = _c.x, y = _c.y, _d = _a.transform.pivot, px = _d.x, py = _d.y;
var _a = this, context = _a.context, _debugDrawColor = _a._debugDrawColor, _b = _a.bounds, width = _b.width, height = _b.height, _c = _a._anchorOffset, x = _c.x, y = _c.y, _d = _a.transform.pivot, px = _d.x, py = _d.y;
context.globalAlpha = 0.9;
context.strokeStyle = _debugDrawColor;
context.fillStyle = _debugDrawColor;
......@@ -5098,8 +5097,8 @@
style.color = this.color;
}
if (this.htmlText) {
var _a = this.transform, _b = _a.globalPosition, x_1 = _b.x, y = _b.y, width = _a.width, height = _a.height;
var _c = engine.canvasPosToPagePos(x_1, y), px = _c.x, py = _c.y;
var _a = this.transform, _b = _a.globalPosition, x = _b.x, y = _b.y, width = _a.width, height = _a.height;
var _c = engine.canvasPosToPagePos(x, y), px = _c.x, py = _c.y;
var _d = engine.canvasPosToPagePos(width, height), pWidth = _d.x, pHeight = _d.y;
if (style.left !== (px - pWidth / 2) + 'px') {
style.left = (px - pWidth / 2) + 'px';
......@@ -5587,9 +5586,9 @@
CameraController.prototype.updateViewport = function () {
if (this.viewportAnchor) {
var _a = this.stageSize, width = _a.width, height = _a.height;
var _b = this.viewportAnchor, x_1 = _b.x, y = _b.y;
var _b = this.viewportAnchor, x = _b.x, y = _b.y;
var _c = this.transform.scale, sx = _c.x, sy = _c.y;
this.transform.position.setXY(width * x_1 * sx, height * y * sy);
this.transform.position.setXY(width * x * sx, height * y * sy);
}
};
CameraController.prototype.followTarget = function () {
......@@ -5897,9 +5896,9 @@
var _a = this, currentCanvasContext = _a.currentCanvasContext, frameAnimation = _a.frameAnimation, _currentFrameIndex = _a._currentFrameIndex, bounds = _a.bounds;
var _b = frameAnimation.getFrame(_currentFrameIndex), texture = _b.texture, data = _b.data;
if (texture) {
var img = texture.img, _c = texture.bounds, x_1 = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;
var img = texture.img, _c = texture.bounds, x = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;
bounds.setTo(data.x, data.y, textureWidth, textureHeight);
currentCanvasContext.drawImage(img, x_1, y, textureWidth, textureHeight, data.x, data.y, textureWidth, textureHeight);
currentCanvasContext.drawImage(img, x, y, textureWidth, textureHeight, data.x, data.y, textureWidth, textureHeight);
}
};
return FrameAnimationRenderer;
......@@ -7088,7 +7087,7 @@
entity.getComponent(TextRenderer).text = text + '';
};
var getTween = function (context, val, obj, duration, ease$$1) {
var getTween = function (context, val, obj, duration, ease) {
return new Promise(function (r) {
var target;
if (val instanceof Transform) {
......@@ -7115,9 +7114,9 @@
delete obj[key];
}
}
createTween(context, target.position, true).to(postionObj, duration, ease$$1);
createTween(context, target.scale, true).to(scaleObj, duration, ease$$1);
createTween(context, target, true).to(obj, duration, ease$$1).call(r);
createTween(context, target.position, true).to(postionObj, duration, ease);
createTween(context, target.scale, true).to(scaleObj, duration, ease);
createTween(context, target, true).to(obj, duration, ease).call(r);
});
};
......@@ -7397,7 +7396,7 @@
img.src = url;
});
};
_this.loadTexture = function (url) { return __awaiter(_this, void 0, void 0, function () {
_this.loadTexture = function (url) { return __awaiter(_this, void 0, Promise, function () {
var img, texture;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -7553,13 +7552,32 @@
}
}
};
SceneStart.prototype.updateCountFromNet = function (limit) {
if (limit < 0)
limit = 0;
setText$1(this.countTxt, "\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
console.log('updateCountFromNet', "\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
};
SceneStart.prototype.updateCountTxtFromDojoin = function () {
var limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
}
if (limit < 0)
limit = 0;
setText$1(this.countTxt, "\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
console.log('updateCountTxtFromDojoin', "\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
};
SceneStart.prototype.onAwake = function () {
_super.prototype.onAwake.call(this);
this.updateCountTxt();
this.broadcast('callApi', 1, 'rankInfo2', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this.broadcast('callApi', 1, 'limitTimes', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this._shakeTimes = 0;
this._counter = 0;
this._lastTime = -1;
......@@ -7584,19 +7602,6 @@
SceneStart.prototype.getKey = function () {
return 'prizeShowed-' + window['CFG'].weixinUid + '-' + window['CFG'].weddingId + '-' + window['CFG'].activityId;
};
SceneStart.prototype.updateCountTxt = function () {
var limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
}
else {
limit = window['CFG'].freeLimit;
}
if (limit < 0)
limit = 0;
setText$1(this.countTxt, "\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
console.log("\u5269\u4F59\u6B21\u6570\uFF1A" + limit);
};
SceneStart.prototype.initGameStage = function () {
console.log('initGameStage');
};
......@@ -7617,7 +7622,7 @@
var _this = this;
console.log('onGotDojoin', this.doJoin);
this.startbtn.getComponent(Button).enabled = true;
this.updateCountTxt();
this.updateCountTxtFromDojoin();
setTimeout(function () {
_this.bubbling('fuck', 'guide');
}, 50);
......@@ -7977,7 +7982,7 @@
img.src = url;
});
};
_this.loadTexture = function (url) { return __awaiter(_this, void 0, void 0, function () {
_this.loadTexture = function (url) { return __awaiter(_this, void 0, Promise, function () {
var img, texture;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -8393,10 +8398,12 @@
_b.label = 2;
case 2:
_b.trys.push([2, 4, , 5]);
console.log(uri + "==>" + JSON.stringify(params));
return [4, callApi(uri, params, method, 'json', this.ignoreSuccessField)];
case 3:
response = _b.sent();
this.onGotResponse(response);
console.log(uri + "<<==" + JSON.stringify(response));
return [2, response.data];
case 4:
e_1 = _b.sent();
......@@ -8563,6 +8570,7 @@
this._toast = this.Toast.getComponent(Toast);
this._popup = this.Popup.getComponent(Popup);
initEnv();
console.log('游戏刷新了...');
};
MainController.prototype.showToast = function (content, duration) {
this._toast.show({
......@@ -8616,7 +8624,7 @@
img.src = url;
});
};
_this.loadTexture = function (url) { return __awaiter(_this, void 0, void 0, function () {
_this.loadTexture = function (url) { return __awaiter(_this, void 0, Promise, function () {
var img, texture;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -8772,5 +8780,5 @@
Object.defineProperty(exports, '__esModule', { value: true });
})));
}));
//# sourceMappingURL=bundle.js.map
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,6 +12,9 @@
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -23,13 +26,13 @@
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<script src="//yun.duiba.com.cn/db_games/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/security.js"></script>
<script src="//yun.duiba.com.cn/db_games/1561641018/bundle.js"></script>
<script src="//yun.duiba.com.cn/db_games/1561707303/bundle.js"></script>
<script> setTimeout(function () {
var loadingEl = document.getElementById('loading'); function onProcess(p) { if (p >= 1) { loadingEl.style.display = 'none'; } }
var options = { resPath: "//yun.duiba.com.cn/db_games/1561639721/" }; window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
var options = { resPath: "//yun.duiba.com.cn/db_games/1561707833/" }; window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
window['COUNT_DOWN_SEC'] = 10;
window['COUNT_DOWN_SEC'] = 5;
window['ruleContent'] = 'starttttttt<br>第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行<br>第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行endddddd';
</script>
......@@ -70,8 +73,6 @@
<script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<script>
// init vConsole
......
......@@ -16,8 +16,8 @@
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl1": "",
"webServiceUrl": "http://localhost:4001"
"webServiceUrl1": "http://localhost:4001",
"webServiceUrl": ""
},
"dataCenterConfig": {
"dataCenterRoot": [
......
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1561625108247,
"data": 111
}
\ No newline at end of file
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