Commit e1c65b21 authored by rockyl's avatar rockyl

完成栈式视图动效功能

parent 596ecfbe
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
"metas": [ "metas": [
{ {
"id": "duiba-api-transform", "id": "duiba-api-transform",
"script": "if (args.success) {\n\tvar payload;\n\n\tif (typeof args.data === 'object') {\n\t\tpayload = engine.objClone(args.data);\n\n\t\tvar origin = engine.objClone(args);\n\t\tObject.defineProperty(payload, '__origin', {\n\t\t\tget: function () {\n\t\t\t\treturn origin\n\t\t\t},\n\t\t\tenumerable: false\n\t\t});\n\t} else {\n\t\tpayload = args.data;\n\t}\n\tnext('success', payload);\n}\nelse {\n\tengine.globalEvent.dispatchEvent('net-failed', args);\n\tnext('failed', args);\n}", "script": "if (args.success) {\n\tvar payload;\n\n\tif (args.data && typeof args.data === 'object') {\n\t\tpayload = engine.objClone(args.data);\n\n\t\tvar origin = engine.objClone(args);\n\t\tObject.defineProperty(payload, '__origin', {\n\t\t\tget: function () {\n\t\t\t\treturn origin\n\t\t\t},\n\t\t\tenumerable: false\n\t\t});\n\t} else {\n\t\tpayload = args.data;\n\t}\n\tnext('success', payload);\n}\nelse {\n\tengine.globalEvent.dispatchEvent('net-failed', args);\n\tnext('failed', args);\n}",
"props": {}, "props": {},
"isInline": true, "isInline": true,
"name": "兑吧接口转换", "name": "兑吧接口转换",
......
{
"script": "var bizIdMap = {\n\t'sharePage': '506',\n\t'pageRemain': '156'\n}\n\nvar bizId = bizIdMap[props.id];\n\nif(bizId){\n\tengine.accessLog(bizId);\n}\n\nnext('success');\n",
"props": {
"id": {
"type": "enum",
"enum": [
"sharePage",
"pageRemain"
],
"alias": "类型",
"default": "sharePage"
}
},
"name": "访问日志接口",
"output": [
"success"
],
"id": "access-log",
"group": "projectX",
"type": "builtin"
}
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
}, },
"uri": { "uri": {
"type": "link" "type": "link"
},
"params": {
"type": "link"
} }
}, },
"output": { "output": {
...@@ -74,8 +77,8 @@ ...@@ -74,8 +77,8 @@
] ]
}, },
"design": { "design": {
"x": 160, "x": 275,
"y": 199 "y": 204
} }
}, },
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db": { "f9a32b46-aec1-4bd2-9b98-3d9a427d87db": {
...@@ -105,8 +108,8 @@ ...@@ -105,8 +108,8 @@
}, },
"output": {}, "output": {},
"design": { "design": {
"x": 489, "x": 507,
"y": 107 "y": 115
} }
} }
}, },
...@@ -114,11 +117,15 @@ ...@@ -114,11 +117,15 @@
"metas": [ "metas": [
{ {
"id": "a4b27753-4cbb-47e3-9b31-51ced475e41a", "id": "a4b27753-4cbb-47e3-9b31-51ced475e41a",
"script": "var uri = engine.findVariable('uri', args, props);\nvar url;\n\nvar hash = window.location.hash;\ntry {\n\thash = top.location.hash;\n} catch (e) {\n}\nvar pathname = window.location.pathname;\ntry {\n\tpathname = top.location.pathname;\n} catch (e) {\n}\n\nif(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && pathname === '/preview' || hash.indexOf('preview/') >= 0){\n\tvar projectX = 'projectx';\n\tvar projectID = engine.env.projectID;\n url = engine.joinPath(projectX, projectID, uri);\n}else{\n url = uri;\n}\n\nscope.url = url;\n\nnext('success', args);", "script": "var uri = engine.findVariable('uri', args, props);\nvar url;\n\nvar hash = window.location.hash;\ntry {\n\thash = top.location.hash;\n} catch (e) {\n}\nvar pathname = window.location.pathname;\ntry {\n\tpathname = top.location.pathname;\n} catch (e) {\n}\n\nif(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && pathname === '/preview' || hash.indexOf('preview/') >= 0){\n\tvar projectX = 'projectx';\n\tvar projectID = engine.env.projectID;\n url = engine.joinPath(projectX, projectID, uri);\n}else{\n url = uri;\n}\n\nscope.url = url;\n\nvar params = engine.findVariable('params', args, props);\nif (!params) {\n\tparams = {};\n}\nparams.user_type = global.env.newUser ? '0' : '1';\nparams.is_from_share = global.env.fromShare ? '0' : '1';\nif(args === undefined || args === null){\n\targs = {}\n}\nargs.params = params;\n\nnext('success', args);",
"props": { "props": {
"uri": { "uri": {
"type": "string", "type": "string",
"alias": "URI" "alias": "URI"
},
"params": {
"type": "map",
"alias": "参数"
} }
}, },
"isInline": true, "isInline": true,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"error" "error"
], ],
"id": "px-token", "id": "px-token",
"script": "if (window['getPxToken']) {\n window['getPxToken'](function (e, token) {\n switch (e) {\n case 'net error':\n next('error', { type: 'error' });\n break;\n case 'need login':\n next('failed', { type: 'failed' });\n break;\n case 'state invalid':\n next('invalid', { type: 'invalid' });\n break;\n default:\n if (token) {\n scope.token = token;\n next('success', args);\n }\n else {\n next('invalid', { type: 'invalid key' });\n }\n }\n });\n}\nelse {\n next('error', { type: 'no ready' });\n}\n", "script": "if (top.location.href.indexOf('preview') >= 0) {\n scope.token = 'dev-token';\n next('success', args);\n}\nelse {\n if (window['getPxToken']) {\n window['getPxToken'](function (e, token) {\n switch (e) {\n case 'net error':\n next('error', { type: 'error' });\n break;\n case 'need login':\n next('failed', { type: 'failed' });\n break;\n case 'state invalid':\n next('invalid', { type: 'invalid' });\n break;\n default:\n if (token) {\n scope.token = token;\n next('success', args);\n }\n else {\n next('invalid', { type: 'invalid key' });\n }\n }\n });\n }\n else {\n next('error', { type: 'no ready' });\n }\n}\n",
"group": "projectX", "group": "projectX",
"type": "builtin" "type": "builtin"
} }
...@@ -6,13 +6,45 @@ ...@@ -6,13 +6,45 @@
"alias": "是否关闭全部弹窗", "alias": "是否关闭全部弹窗",
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐隐渐现",
"value": "fade"
},
{
"label": "飞入飞出",
"value": "flew"
},
{
"label": "缩放",
"value": "zoom"
},
{
"label": "紫金葫芦",
"value": "hulu"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
"complete" "complete"
], ],
"id": "pop-dialog", "id": "pop-dialog",
"script": "if (props.closeAll) {\n engine.gameStage.popupContainer.popAll();\n}\nelse {\n engine.gameStage.popupContainer.pop();\n}\nnext('complete');\n", "script": "var effect = engine.findVariable('effect', args, props);\nvar effectParams = engine.findVariable('effectParams', args, props);\nvar options = {\n effect: effect,\n effectParams: effectParams,\n};\nif (props.closeAll) {\n engine.gameStage.popupContainer.popAll(options);\n}\nelse {\n engine.gameStage.popupContainer.pop(options);\n}\nnext('complete');\n",
"group": "view", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -10,6 +10,26 @@ ...@@ -10,6 +10,26 @@
"viewName": { "viewName": {
"alias": "目标视图名", "alias": "目标视图名",
"type": "string" "type": "string"
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐变",
"value": "fade"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
...@@ -17,7 +37,7 @@ ...@@ -17,7 +37,7 @@
"exception" "exception"
], ],
"id": "pop-scene", "id": "pop-scene",
"script": "if (props.popAll) {\n if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n }\n else {\n var gameStage = engine.gameStage;\n var view = gameStage.instantiateView(props.viewName);\n if (view) {\n gameStage.sceneContainer.popAll(view);\n next('complete');\n }\n else {\n next('exception', '视图不存在');\n }\n }\n}\nelse {\n engine.gameStage.sceneContainer.pop();\n next('complete');\n}\n", "script": "var effect = engine.findVariable('effect', args, props);\nvar effectParams = engine.findVariable('effectParams', args, props);\nvar options = {\n effect: effect,\n effectParams: effectParams,\n};\nif (props.popAll) {\n if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n }\n else {\n var gameStage_1 = engine.gameStage;\n gameStage_1.instantiateView(props.viewName).then(function (view) {\n if (view) {\n gameStage_1.sceneContainer.popAll(view, options);\n next('complete');\n }\n else {\n next('exception', '视图不存在');\n }\n });\n }\n}\nelse {\n engine.gameStage.sceneContainer.pop(options);\n next('complete');\n}\n",
"group": "view", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -10,13 +10,45 @@ ...@@ -10,13 +10,45 @@
"alias": "是否居中展示", "alias": "是否居中展示",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐隐渐现",
"value": "fade"
},
{
"label": "飞入飞出",
"value": "flew"
},
{
"label": "缩放",
"value": "zoom"
},
{
"label": "紫金葫芦",
"value": "hulu"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
"complete" "complete"
], ],
"id": "push-dialog", "id": "push-dialog",
"script": "if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage = engine.gameStage;\n var view = gameStage.instantiateView(props.viewName);\n if (view) {\n gameStage.popupContainer.push(view, { center: props.center });\n }\n next('complete');\n}\n", "script": "var effect = engine.findVariable('effect', args, props);\nvar effectParams = engine.findVariable('effectParams', args, props);\nif (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage_1 = engine.gameStage;\n gameStage_1.instantiateView(props.viewName).then(function (view) {\n if (view) {\n var options = {\n effect: effect,\n effectParams: effectParams,\n center: props.center,\n };\n gameStage_1.popupContainer.push(view, options);\n }\n });\n next('complete');\n}\n",
"group": "view", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -10,13 +10,33 @@ ...@@ -10,13 +10,33 @@
"alias": "是否替换场景", "alias": "是否替换场景",
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐变",
"value": "fade"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
"complete" "complete"
], ],
"id": "push-scene", "id": "push-scene",
"script": "var replace = engine.findVariable('replace', args, props);\nif (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage = engine.gameStage;\n var view = gameStage.instantiateView(props.viewName);\n if (view) {\n if (replace) {\n gameStage.sceneContainer.replace(view);\n }\n else {\n gameStage.sceneContainer.push(view);\n }\n }\n next('complete');\n}\n", "script": "var replace = engine.findVariable('replace', args, props);\nvar effect = engine.findVariable('effect', args, props);\nvar effectParams = engine.findVariable('effectParams', args, props);\nif (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage_1 = engine.gameStage;\n gameStage_1.instantiateView(props.viewName).then(function (view) {\n if (view) {\n var options = {\n effect: effect,\n effectParams: effectParams,\n };\n if (replace) {\n gameStage_1.sceneContainer.replace(view, options);\n }\n else {\n gameStage_1.sceneContainer.push(view, options);\n }\n }\n });\n next('complete');\n}\n",
"group": "view", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -43,8 +43,13 @@ ...@@ -43,8 +43,13 @@
"alias": "点击自动触发", "alias": "点击自动触发",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
"asSharePage": {
"alias": "作为分享页曝光",
"type": "boolean",
"default": false
} }
}, },
"id": "buried-point", "id": "buried-point",
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = 'appID.0.0.0';\n _this.dcm = '202.projectID.0.0';\n _this.dom = '0.0.0.0';\n _this.autoExposure = true;\n _this.onceAutoExposure = false;\n _this.autoExposureType = 'visible';\n _this.autoClick = true;\n _this.checkFps = 5;\n _this._autoExposured = false;\n _this._hostVisible = false;\n _this.checkVisibility = function () {\n var worldVisible = _this.host.worldVisible;\n if (worldVisible !== _this._hostVisible) {\n _this._hostVisible = worldVisible;\n if (worldVisible) {\n _this._onVisible();\n }\n }\n };\n return _this;\n }\n BuriedPoint.prototype.onModify = function (value, key, oldValue) {\n switch (key) {\n case 'dpm':\n case 'dcm':\n case 'dom':\n this['__' + key] = fill(value);\n break;\n }\n };\n BuriedPoint.prototype.mounted = function () {\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n this._timer = setInterval(this.checkVisibility, 1000 / this.checkFps);\n };\n BuriedPoint.prototype.destroy = function () {\n this.host.removeEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n if (this._timer) {\n clearInterval(this._timer);\n this._timer = null;\n }\n };\n BuriedPoint.prototype.awake = function () {\n if (this.autoExposure && this.autoExposureType === 'awake') {\n this.autoLogExposure();\n }\n };\n BuriedPoint.prototype._onVisible = function (e) {\n if (e === void 0) { e = null; }\n if (this.autoExposure && this.autoExposureType === 'visible') {\n this.autoLogExposure();\n }\n };\n BuriedPoint.prototype.autoLogExposure = function () {\n if (!this._autoExposured) {\n if (this.onceAutoExposure) {\n this._autoExposured = true;\n }\n this.logExposure();\n }\n };\n BuriedPoint.prototype._onClick = function (e) {\n if (this.autoClick) {\n this.logClick();\n }\n };\n BuriedPoint.prototype.logExposure = function () {\n this.log('exposure');\n };\n BuriedPoint.prototype.logClick = function () {\n this.log('click');\n };\n BuriedPoint.prototype.log = function (type) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, log(type, {\n dpm: this['__dpm'],\n dcm: this['__dcm'],\n dom: this['__dom'],\n })];\n case 1:\n _a.sent();\n if (this.id !== undefined) {\n engine.globalEvent.dispatchEvent('buried-point-success', {\n type: type,\n id: this.id,\n });\n }\n return [2];\n }\n });\n });\n };\n BuriedPoint.id = 'buried-point';\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dpm\", void 0);\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dcm\", void 0);\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dom\", void 0);\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm, appId: engine.env.appID\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n var isExposure = type === 'exposure';\n return engine.httpRequest(isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n" "code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar injectProp = engine.injectProp;\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = 'appID.0.0.0';\n _this.dcm = '202.projectID.0.0';\n _this.dom = '0.0.0.0';\n _this.autoExposure = true;\n _this.onceAutoExposure = false;\n _this.autoExposureType = 'visible';\n _this.autoClick = true;\n _this.asSharePage = false;\n _this.checkFps = 5;\n _this._autoExposured = false;\n _this._hostVisible = false;\n _this.checkVisibility = function () {\n var worldVisible = _this.host.worldVisible;\n if (worldVisible !== _this._hostVisible) {\n _this._hostVisible = worldVisible;\n if (worldVisible) {\n _this._onVisible();\n }\n }\n };\n return _this;\n }\n BuriedPoint.prototype.onModify = function (value, key, oldValue) {\n switch (key) {\n case 'dpm':\n case 'dcm':\n case 'dom':\n this['__' + key] = fill(value);\n break;\n }\n };\n BuriedPoint.prototype.mounted = function () {\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n this._timer = setInterval(this.checkVisibility, 1000 / this.checkFps);\n };\n BuriedPoint.prototype.destroy = function () {\n this.host.removeEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n if (this._timer) {\n clearInterval(this._timer);\n this._timer = null;\n }\n };\n BuriedPoint.prototype.awake = function () {\n if (this.autoExposure && this.autoExposureType === 'awake') {\n this.autoLogExposure();\n }\n };\n BuriedPoint.prototype._onVisible = function (e) {\n if (e === void 0) { e = null; }\n if (this.autoExposure && this.autoExposureType === 'visible') {\n this.autoLogExposure();\n }\n };\n BuriedPoint.prototype.autoLogExposure = function () {\n if (!this._autoExposured) {\n if (this.onceAutoExposure) {\n this._autoExposured = true;\n }\n this.logExposure();\n }\n };\n BuriedPoint.prototype._onClick = function (e) {\n if (this.autoClick) {\n this.logClick();\n }\n };\n BuriedPoint.prototype.logExposure = function () {\n this.log('exposure');\n };\n BuriedPoint.prototype.logClick = function () {\n this.log('click');\n };\n BuriedPoint.prototype.log = function (type) {\n return __awaiter(this, void 0, void 0, function () {\n var otherQuery;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n otherQuery = {\n appId: engine.env.appID,\n };\n if (this.asSharePage) {\n otherQuery.share = '1';\n }\n return [4, log(type, {\n dpm: this['__dpm'],\n dcm: this['__dcm'],\n dom: this['__dom'],\n }, otherQuery)];\n case 1:\n _a.sent();\n if (this.id !== undefined) {\n engine.globalEvent.dispatchEvent('buried-point-success', {\n type: type,\n id: this.id,\n });\n }\n return [2];\n }\n });\n });\n };\n BuriedPoint.id = 'buried-point';\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dpm\", void 0);\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dcm\", void 0);\n __decorate([\n engine.dirtyFieldTrigger\n ], BuriedPoint.prototype, \"dom\", void 0);\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data, otherQuery) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm,\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n injectProp(params, otherQuery);\n var isExposure = type === 'exposure';\n return engine.httpRequest(isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n"
} }
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameObject = (function (_super) {
__extends(GameObject, _super);
function GameObject() {
var _this = _super.call(this) || this;
_this.name = "";
_this.componentList = [];
_this.mouseEnabled = false;
_this.mouseChildren = false;
return _this;
}
GameObject.prototype.addComponent = function (cls) {
if (this.getComponent(cls) != null) {
console.error("component is existent");
return;
}
var ins = new cls(this);
ins.enabled = true;
this.componentList.push(ins);
return ins;
};
GameObject.prototype.getComponent = function (cls) {
for (var _i = 0, _a = this.componentList; _i < _a.length; _i++) {
var i = _a[_i];
if (i instanceof cls) {
return i;
}
}
return null;
};
GameObject.prototype.removeComponent = function (cls) {
var _loop_1 = function (i) {
if (i instanceof cls) {
i.enabled = false;
this_1.componentList = this_1.componentList.filter(function (e) { return e != i; });
return { value: void 0 };
}
};
var this_1 = this;
for (var _i = 0, _a = this.componentList; _i < _a.length; _i++) {
var i = _a[_i];
var state_1 = _loop_1(i);
if (typeof state_1 === "object")
return state_1.value;
}
};
GameObject.prototype.dispose = function () {
this.destroy();
this.disableAllComponents();
};
GameObject.prototype.disableAllComponents = function () {
var _this = this;
Object.keys(this.componentList).forEach(function (e) { return _this.componentList[e].enabled = false; });
};
GameObject.prototype.enableAllComponents = function () {
var _this = this;
Object.keys(this.componentList).forEach(function (e) { return _this.componentList[e].enabled = true; });
};
GameObject.prototype.onCollisionEnter = function (other) {
};
GameObject.prototype.onCollisionStay = function (other) {
};
GameObject.prototype.onCollisionExit = function (other) {
};
return GameObject;
}(engine.Container));
exports.default = GameObject;
if (window['getPxToken']) { if (top.location.href.indexOf('preview') >= 0) {
window['getPxToken'](function (e, token) { scope.token = 'dev-token';
switch (e) { next('success', args);
case 'net error':
next('error', { type: 'error' });
break;
case 'need login':
next('failed', { type: 'failed' });
break;
case 'state invalid':
next('invalid', { type: 'invalid' });
break;
default:
if (token) {
scope.token = token;
next('success', args);
}
else {
next('invalid', { type: 'invalid key' });
}
}
});
} }
else { else {
next('error', { type: 'no ready' }); if (window['getPxToken']) {
window['getPxToken'](function (e, token) {
switch (e) {
case 'net error':
next('error', { type: 'error' });
break;
case 'need login':
next('failed', { type: 'failed' });
break;
case 'state invalid':
next('invalid', { type: 'invalid' });
break;
default:
if (token) {
scope.token = token;
next('success', args);
}
else {
next('invalid', { type: 'invalid key' });
}
}
});
}
else {
next('error', { type: 'no ready' });
}
} }
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var injectProp = engine.injectProp;
var BuriedPoint = (function (_super) {
__extends(BuriedPoint, _super);
function BuriedPoint() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.dpm = 'appID.0.0.0';
_this.dcm = '202.projectID.0.0';
_this.dom = '0.0.0.0';
_this.autoExposure = true;
_this.onceAutoExposure = false;
_this.autoExposureType = 'visible';
_this.autoClick = true;
_this.checkFps = 5;
_this._autoExposured = false;
_this._hostVisible = false;
_this.checkVisibility = function () {
var worldVisible = _this.host.worldVisible;
if (worldVisible !== _this._hostVisible) {
_this._hostVisible = worldVisible;
if (worldVisible) {
_this._onVisible();
}
}
};
return _this;
}
BuriedPoint.prototype.onModify = function (value, key, oldValue) {
switch (key) {
case 'dpm':
case 'dcm':
case 'dom':
this['__' + key] = fill(value);
break;
}
};
BuriedPoint.prototype.mounted = function () {
this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);
this._timer = setInterval(this.checkVisibility, 1000 / this.checkFps);
};
BuriedPoint.prototype.destroy = function () {
this.host.removeEventListener(engine.MouseEvent.CLICK, this._onClick, this);
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
};
BuriedPoint.prototype.awake = function () {
if (this.autoExposure && this.autoExposureType === 'awake') {
this.autoLogExposure();
}
};
BuriedPoint.prototype._onVisible = function (e) {
if (e === void 0) { e = null; }
if (this.autoExposure && this.autoExposureType === 'visible') {
this.autoLogExposure();
}
};
BuriedPoint.prototype.autoLogExposure = function () {
if (!this._autoExposured) {
if (this.onceAutoExposure) {
this._autoExposured = true;
}
this.logExposure();
}
};
BuriedPoint.prototype._onClick = function (e) {
if (this.autoClick) {
this.logClick();
}
};
BuriedPoint.prototype.logExposure = function () {
this.log('exposure');
};
BuriedPoint.prototype.logClick = function () {
this.log('click');
};
BuriedPoint.prototype.log = function (type) {
return __awaiter(this, void 0, void 0, function () {
var otherQuery;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
otherQuery = {
appId: engine.env.appID,
};
return [4, log(type, {
dpm: this['__dpm'],
dcm: this['__dcm'],
dom: this['__dom'],
}, otherQuery)];
case 1:
_a.sent();
if (this.id !== undefined) {
engine.globalEvent.dispatchEvent('buried-point-success', {
type: type,
id: this.id,
});
}
return [2];
}
});
});
};
BuriedPoint.id = 'buried-point';
__decorate([
engine.dirtyFieldTrigger
], BuriedPoint.prototype, "dpm", void 0);
__decorate([
engine.dirtyFieldTrigger
], BuriedPoint.prototype, "dcm", void 0);
__decorate([
engine.dirtyFieldTrigger
], BuriedPoint.prototype, "dom", void 0);
return BuriedPoint;
}(engine.ScriptBase));
exports.default = BuriedPoint;
function fill(src) {
var result = src;
for (var key_1 in engine.env) {
result = result.replace(key_1, engine.env[key_1]);
}
return result;
}
function log(type, data, otherQuery) {
var dpm = data.dpm, dcm = data.dcm, dom = data.dom;
var params = {
dpm: dpm, dcm: dcm,
};
if (dom !== '0.0.0.0') {
params.dom = dom;
}
injectProp(params, otherQuery);
var isExposure = type === 'exposure';
return engine.httpRequest(isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');
}
...@@ -5564,7 +5564,7 @@ declare module engine { ...@@ -5564,7 +5564,7 @@ declare module engine {
export const dataCenter: DataCenter; export const dataCenter: DataCenter;
export let env: {}; export let env: any;
export function injectEnv(data: any): void; export function injectEnv(data: any): void;
......
...@@ -41,7 +41,7 @@ async function watchWrapper(sourcePath, output) { ...@@ -41,7 +41,7 @@ async function watchWrapper(sourcePath, output) {
}); });
compileProcess(sourcePath, output) compileProcess(sourcePath, output)
} else { } else {
await compileProcess(file, program.output) await compileProcess(sourcePath, program.output)
} }
} }
......
...@@ -5,22 +5,10 @@ ...@@ -5,22 +5,10 @@
const assets = [ const assets = [
{ {
"name": "橘色转盘", "name": "橘色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/9dfdf39ce4f4693c336cbdd996e05bd392921e0e.png", "url": "//yun.duiba.com.cn/aurora/assets/5bdcac217a30d87361b2fb86378f60bf1d8cea7b.png",
"uuid": "b6ed99bc-2da1-4e6d-840e-54371be041aa", "uuid": "b6ed99bc-2da1-4e6d-840e-54371be041aa",
"ext": '.png' "ext": '.png'
}, },
{
"name": "蓝色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/088cff75c4035b87ff421c2dd87391c6a7bea607.png",
"uuid": "4d8e2af4-4f8e-4f84-ab05-8ae172bbf8a6",
"ext": '.png'
},
{
"name": "紫色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/e0ac6904227d8e3878ed23be33e58d3ce2180f2d.png",
"uuid": "c3dd14af-1b98-4cb8-b725-fa75cf15e96d",
"ext": '.png'
},
]; ];
function loadAssets(customModuleAssets, onProgress, onComplete){ function loadAssets(customModuleAssets, onProgress, onComplete){
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
return state_1.value; return state_1.value;
} }
}; };
GameObject.prototype.destroy = function () { GameObject.prototype.dispose = function () {
_super.prototype.destroy.call(this); this.destroy();
this.disableAllComponents(); this.disableAllComponents();
}; };
GameObject.prototype.disableAllComponents = function () { GameObject.prototype.disableAllComponents = function () {
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
}; };
return GameObject; return GameObject;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=GameObject.js.map
var GameComponent = (function () { var GameComponent = (function () {
function GameComponent(owner) { function GameComponent(owner) {
...@@ -103,14 +102,12 @@ ...@@ -103,14 +102,12 @@
}); });
return GameComponent; return GameComponent;
}()); }());
//# sourceMappingURL=GameComponent.js.map
var DataMgr; var DataMgr;
(function (DataMgr) { (function (DataMgr) {
DataMgr.game = null; DataMgr.game = null;
DataMgr.minEnableCaptchaScore = null; DataMgr.minEnableCaptchaScore = null;
})(DataMgr || (DataMgr = {})); })(DataMgr || (DataMgr = {}));
//# sourceMappingURL=DataMgr.js.map
var Physics = (function (_super) { var Physics = (function (_super) {
tslib.__extends(Physics, _super); tslib.__extends(Physics, _super);
...@@ -171,7 +168,6 @@ ...@@ -171,7 +168,6 @@
}; };
return Physics; return Physics;
}(GameComponent)); }(GameComponent));
//# sourceMappingURL=Physics.js.map
var Collider = (function (_super) { var Collider = (function (_super) {
tslib.__extends(Collider, _super); tslib.__extends(Collider, _super);
...@@ -312,7 +308,6 @@ ...@@ -312,7 +308,6 @@
ColliderType[ColliderType["Rect"] = 1] = "Rect"; ColliderType[ColliderType["Rect"] = 1] = "Rect";
ColliderType[ColliderType["Point"] = 2] = "Point"; ColliderType[ColliderType["Point"] = 2] = "Point";
})(ColliderType || (ColliderType = {})); })(ColliderType || (ColliderType = {}));
//# sourceMappingURL=Collider.js.map
var MConst; var MConst;
(function (MConst) { (function (MConst) {
...@@ -352,7 +347,6 @@ ...@@ -352,7 +347,6 @@
MConst.WenzhouLocation = new engine.Rectangle(119.37, 27.03, 1.81, 1.33); MConst.WenzhouLocation = new engine.Rectangle(119.37, 27.03, 1.81, 1.33);
MConst.HangzhouLocation = new engine.Rectangle(118.21, 29.11, 2.09, 1.22); MConst.HangzhouLocation = new engine.Rectangle(118.21, 29.11, 2.09, 1.22);
})(MConst || (MConst = {})); })(MConst || (MConst = {}));
//# sourceMappingURL=MConst.js.map
var MoveObjcet = (function (_super) { var MoveObjcet = (function (_super) {
tslib.__extends(MoveObjcet, _super); tslib.__extends(MoveObjcet, _super);
...@@ -364,7 +358,6 @@ ...@@ -364,7 +358,6 @@
} }
return MoveObjcet; return MoveObjcet;
}(GameObject)); }(GameObject));
//# sourceMappingURL=MoveObject.js.map
var MEvent = (function () { var MEvent = (function () {
function MEvent() { function MEvent() {
...@@ -427,7 +420,6 @@ ...@@ -427,7 +420,6 @@
}; };
return MEvent; return MEvent;
}()); }());
//# sourceMappingURL=MEvent.js.map
var MTimer = (function () { var MTimer = (function () {
function MTimer() { function MTimer() {
...@@ -513,7 +505,6 @@ ...@@ -513,7 +505,6 @@
_onFrame.call(MTimer.deltaTime); _onFrame.call(MTimer.deltaTime);
timerTickEvent.call(); timerTickEvent.call();
} }
//# sourceMappingURL=MTimer.js.map
var GameMgr = (function () { var GameMgr = (function () {
function GameMgr(name) { function GameMgr(name) {
...@@ -530,7 +521,6 @@ ...@@ -530,7 +521,6 @@
}; };
return GameMgr; return GameMgr;
}()); }());
//# sourceMappingURL=GameMgr.js.map
function getTexture(uuid) { function getTexture(uuid) {
var config = getAssetByUUID(uuid); var config = getAssetByUUID(uuid);
...@@ -543,7 +533,6 @@ ...@@ -543,7 +533,6 @@
function clamp(target, min, max) { function clamp(target, min, max) {
return Math.min(max, Math.max(min, target)); return Math.min(max, Math.max(min, target));
} }
//# sourceMappingURL=utils.js.map
var bulletSpeedValue = 20; var bulletSpeedValue = 20;
var frameCountThatBulletsMoveInX = 4; var frameCountThatBulletsMoveInX = 4;
...@@ -621,7 +610,6 @@ ...@@ -621,7 +610,6 @@
}; };
return HorizontalMoveMgr; return HorizontalMoveMgr;
}(GameMgr)); }(GameMgr));
//# sourceMappingURL=Bullet.js.map
var SoundMgr = (function () { var SoundMgr = (function () {
function SoundMgr() { function SoundMgr() {
...@@ -660,7 +648,6 @@ ...@@ -660,7 +648,6 @@
dong: "7fc04e43-1465-4336-92a3-d6039ee88cb3", dong: "7fc04e43-1465-4336-92a3-d6039ee88cb3",
boom: "ca6b799f-be85-4e94-99df-812f31801490" boom: "ca6b799f-be85-4e94-99df-812f31801490"
}; };
//# sourceMappingURL=SoundMgr.js.map
var props = {}; var props = {};
function prepareProps() { function prepareProps() {
...@@ -670,7 +657,6 @@ ...@@ -670,7 +657,6 @@
function injectProps(p) { function injectProps(p) {
engine.injectProp(props, p); engine.injectProp(props, p);
} }
//# sourceMappingURL=props.js.map
var Car = (function (_super) { var Car = (function (_super) {
tslib.__extends(Car, _super); tslib.__extends(Car, _super);
...@@ -792,7 +778,6 @@ ...@@ -792,7 +778,6 @@
}; };
return Car; return Car;
}(GameObject)); }(GameObject));
//# sourceMappingURL=Car.js.map
var PlayerController = (function (_super) { var PlayerController = (function (_super) {
tslib.__extends(PlayerController, _super); tslib.__extends(PlayerController, _super);
...@@ -829,7 +814,6 @@ ...@@ -829,7 +814,6 @@
} }
return PlayerController; return PlayerController;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=PlayerController.js.map
var MConfigs; var MConfigs;
(function (MConfigs) { (function (MConfigs) {
...@@ -930,7 +914,6 @@ ...@@ -930,7 +914,6 @@
}, },
}; };
})(MConfigs || (MConfigs = {})); })(MConfigs || (MConfigs = {}));
//# sourceMappingURL=MConfigs.js.map
var MUtils; var MUtils;
(function (MUtils) { (function (MUtils) {
...@@ -990,7 +973,6 @@ ...@@ -990,7 +973,6 @@
} }
MUtils.setColorFilter = setColorFilter; MUtils.setColorFilter = setColorFilter;
})(MUtils || (MUtils = {})); })(MUtils || (MUtils = {}));
//# sourceMappingURL=MUtils.js.map
function getBallScore(bulletScore, powerScore, colorIndex) { function getBallScore(bulletScore, powerScore, colorIndex) {
var getScoreFromRange = function (_a) { var getScoreFromRange = function (_a) {
...@@ -1078,7 +1060,6 @@ ...@@ -1078,7 +1060,6 @@
} }
return newArray; return newArray;
} }
//# sourceMappingURL=GUtils.js.map
var UILayer = (function (_super) { var UILayer = (function (_super) {
tslib.__extends(UILayer, _super); tslib.__extends(UILayer, _super);
...@@ -1090,7 +1071,6 @@ ...@@ -1090,7 +1071,6 @@
} }
return UILayer; return UILayer;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=UILayer.js.map
var DebugMgr = (function (_super) { var DebugMgr = (function (_super) {
tslib.__extends(DebugMgr, _super); tslib.__extends(DebugMgr, _super);
...@@ -1212,7 +1192,7 @@ ...@@ -1212,7 +1192,7 @@
return; return;
} }
delete this.shapeMap[key]; delete this.shapeMap[key];
shape.destroy(); shape.dispose();
}; };
DebugMgr.prototype.init = function (context) { DebugMgr.prototype.init = function (context) {
context.addChild(this); context.addChild(this);
...@@ -1245,7 +1225,6 @@ ...@@ -1245,7 +1225,6 @@
DebugMgr._instance = null; DebugMgr._instance = null;
return DebugMgr; return DebugMgr;
}(UILayer)); }(UILayer));
//# sourceMappingURL=DebugMgr.js.map
var instanceId1 = null; var instanceId1 = null;
var instanceId2 = null; var instanceId2 = null;
...@@ -1483,7 +1462,6 @@ ...@@ -1483,7 +1462,6 @@
7: 2 7: 2
}; };
var GroupMaxIndex = 7; var GroupMaxIndex = 7;
//# sourceMappingURL=PhycicsSystem.js.map
var PoolGroup = (function () { var PoolGroup = (function () {
function PoolGroup(layer) { function PoolGroup(layer) {
...@@ -1506,7 +1484,6 @@ ...@@ -1506,7 +1484,6 @@
}; };
return Pool; return Pool;
}()); }());
//# sourceMappingURL=Pool.js.map
var padding = 10; var padding = 10;
var GuideMask = (function (_super) { var GuideMask = (function (_super) {
...@@ -1627,7 +1604,7 @@ ...@@ -1627,7 +1604,7 @@
DataMgr.game.pause = true; DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask(index, x, y); this.currentGuideMask = new GuideMask(index, x, y);
this.currentGuideMask.onClick = function (context) { this.currentGuideMask.onClick = function (context) {
context.destroy(); context.dispose();
DataMgr.game.pause = false; DataMgr.game.pause = false;
if (_this.done.length >= Object.keys(MConfigs.guide).length) { if (_this.done.length >= Object.keys(MConfigs.guide).length) {
DataMgr.game.onGuideDone(); DataMgr.game.onGuideDone();
...@@ -1641,7 +1618,6 @@ ...@@ -1641,7 +1618,6 @@
GuideMgr._instance = null; GuideMgr._instance = null;
return GuideMgr; return GuideMgr;
}()); }());
//# sourceMappingURL=GuideMgr.js.map
var tempPower = null; var tempPower = null;
var imageNames = [ var imageNames = [
...@@ -1888,7 +1864,6 @@ ...@@ -1888,7 +1864,6 @@
Ball.textures = []; Ball.textures = [];
return Ball; return Ball;
}(MoveObjcet)); }(MoveObjcet));
//# sourceMappingURL=Ball.js.map
var BallPool = (function (_super) { var BallPool = (function (_super) {
tslib.__extends(BallPool, _super); tslib.__extends(BallPool, _super);
...@@ -1930,7 +1905,6 @@ ...@@ -1930,7 +1905,6 @@
}; };
return BallPoolGroup; return BallPoolGroup;
}(PoolGroup)); }(PoolGroup));
//# sourceMappingURL=BallPool.js.map
var FrameAnimationMgr = (function (_super) { var FrameAnimationMgr = (function (_super) {
tslib.__extends(FrameAnimationMgr, _super); tslib.__extends(FrameAnimationMgr, _super);
...@@ -2031,7 +2005,6 @@ ...@@ -2031,7 +2005,6 @@
FrameAnimation.caches = {}; FrameAnimation.caches = {};
return FrameAnimation; return FrameAnimation;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=FrameAnimation.js.map
var PoolFrameAnimation = (function (_super) { var PoolFrameAnimation = (function (_super) {
tslib.__extends(PoolFrameAnimation, _super); tslib.__extends(PoolFrameAnimation, _super);
...@@ -2080,7 +2053,6 @@ ...@@ -2080,7 +2053,6 @@
}; };
return AnimationPoolGroup; return AnimationPoolGroup;
}(PoolGroup)); }(PoolGroup));
//# sourceMappingURL=AnimationPool.js.map
var BulletPool = (function (_super) { var BulletPool = (function (_super) {
tslib.__extends(BulletPool, _super); tslib.__extends(BulletPool, _super);
...@@ -2101,7 +2073,6 @@ ...@@ -2101,7 +2073,6 @@
}; };
return BulletPool; return BulletPool;
}(Pool)); }(Pool));
//# sourceMappingURL=BulletPool.js.map
var TextureMgr; var TextureMgr;
(function (TextureMgr) { (function (TextureMgr) {
...@@ -2137,7 +2108,6 @@ ...@@ -2137,7 +2108,6 @@
} }
TextureMgr.get = get; TextureMgr.get = get;
})(TextureMgr || (TextureMgr = {})); })(TextureMgr || (TextureMgr = {}));
//# sourceMappingURL=TextureMgr.js.map
var InitSpeedValue = 0.08; var InitSpeedValue = 0.08;
var alphaDuration = 300; var alphaDuration = 300;
...@@ -2270,7 +2240,6 @@ ...@@ -2270,7 +2240,6 @@
}; };
return SpBoomEffectPoolGroup; return SpBoomEffectPoolGroup;
}(PoolGroup)); }(PoolGroup));
//# sourceMappingURL=SpBoomEffect.js.map
var dropImgNames = [ var dropImgNames = [
"f7221f86-f376-40ce-b0e8-f7ea573ec780", "f7221f86-f376-40ce-b0e8-f7ea573ec780",
...@@ -2390,7 +2359,6 @@ ...@@ -2390,7 +2359,6 @@
}; };
return Drop; return Drop;
}(MoveObjcet)); }(MoveObjcet));
//# sourceMappingURL=Drop.js.map
var DropPool = (function (_super) { var DropPool = (function (_super) {
tslib.__extends(DropPool, _super); tslib.__extends(DropPool, _super);
...@@ -2424,7 +2392,6 @@ ...@@ -2424,7 +2392,6 @@
}; };
return DropPoolGroup; return DropPoolGroup;
}(PoolGroup)); }(PoolGroup));
//# sourceMappingURL=DropPool.js.map
var DropBlinkMgr = (function (_super) { var DropBlinkMgr = (function (_super) {
tslib.__extends(DropBlinkMgr, _super); tslib.__extends(DropBlinkMgr, _super);
...@@ -2458,7 +2425,7 @@ ...@@ -2458,7 +2425,7 @@
return true; return true;
} }
else { else {
e.drop.destroy(); e.drop.dispose();
return false; return false;
} }
}); });
...@@ -2468,7 +2435,6 @@ ...@@ -2468,7 +2435,6 @@
return DropBlinkMgr; return DropBlinkMgr;
}(GameMgr)); }(GameMgr));
var BlinkDuration = 3; var BlinkDuration = 3;
//# sourceMappingURL=DropBlinkMgr.js.map
var Game = (function () { var Game = (function () {
function Game(parent) { function Game(parent) {
...@@ -2582,7 +2548,7 @@ ...@@ -2582,7 +2548,7 @@
this.pause = false; this.pause = false;
}; };
Game.prototype.destroy = function () { Game.prototype.destroy = function () {
this.node.destroy(); this.node.dispose();
for (var _i = 0, _a = this.mgrs; _i < _a.length; _i++) { for (var _i = 0, _a = this.mgrs; _i < _a.length; _i++) {
var mgr = _a[_i]; var mgr = _a[_i];
mgr.onDestroy(); mgr.onDestroy();
...@@ -2804,7 +2770,6 @@ ...@@ -2804,7 +2770,6 @@
}); });
return Game; return Game;
}()); }());
//# sourceMappingURL=Game.js.map
var ShootPlanet = (function (_super) { var ShootPlanet = (function (_super) {
tslib.__extends(ShootPlanet, _super); tslib.__extends(ShootPlanet, _super);
...@@ -2857,13 +2822,12 @@ ...@@ -2857,13 +2822,12 @@
return Math.sqrt(this.x * this.x + this.y * this.y); return Math.sqrt(this.x * this.x + this.y * this.y);
} }
}); });
engine.DisplayObject.prototype.destroy = function () { engine.DisplayObject.prototype.dispose = function () {
this.parent.removeChild(this); this.parent.removeChild(this);
}; };
}; };
return ShootPlanet; return ShootPlanet;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=ShootPlanet.js.map
function index (props) { function index (props) {
prepareProps(); prepareProps();
...@@ -2871,7 +2835,6 @@ ...@@ -2871,7 +2835,6 @@
var instance = new ShootPlanet(); var instance = new ShootPlanet();
return instance; return instance;
} }
//# sourceMappingURL=index.js.map
return index; return index;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
"assets": [ "assets": [
{ {
"name": "背景图", "name": "背景图",
"url": "//yun.duiba.com.cn/aurora/assets/7510d51070768f7e2c9fc2418d2ab5695c5b68f7.jpg", "url": "//yun.duiba.com.cn/aurora/assets/5bdcac217a30d87361b2fb86378f60bf1d8cea7b.png",
"uuid": "d99368b8-af5d-4d9e-981e-7bce3e1c1e84", "uuid": "d99368b8-af5d-4d9e-981e-7bce3e1c1e84",
"ext": ".jpg" "ext": ".jpg"
}, },
......
...@@ -88,7 +88,7 @@ export default class Game { ...@@ -88,7 +88,7 @@ export default class Game {
/**销毁游戏 */ /**销毁游戏 */
public destroy() { public destroy() {
this.node.destroy(); this.node.dispose();
for (let mgr of this.mgrs) { for (let mgr of this.mgrs) {
mgr.onDestroy(); mgr.onDestroy();
} }
......
...@@ -44,8 +44,8 @@ export default class GameObject extends engine.Container { ...@@ -44,8 +44,8 @@ export default class GameObject extends engine.Container {
} }
/**销毁时禁用所有组件 */ /**销毁时禁用所有组件 */
destroy() { dispose() {
super.destroy(); this.destroy();
this.disableAllComponents(); this.disableAllComponents();
} }
......
...@@ -139,7 +139,7 @@ export default class DebugMgr extends UILayer { ...@@ -139,7 +139,7 @@ export default class DebugMgr extends UILayer {
} }
delete this.shapeMap[key]; delete this.shapeMap[key];
shape.destroy(); shape.dispose();
} }
init(context: engine.Container) { init(context: engine.Container) {
......
...@@ -39,7 +39,7 @@ export default class DropBlinkMgr extends GameMgr { ...@@ -39,7 +39,7 @@ export default class DropBlinkMgr extends GameMgr {
if (e.count < 60 / BlinkDuration * 2) { if (e.count < 60 / BlinkDuration * 2) {
return true; return true;
} else { } else {
e.drop.destroy(); e.drop.dispose();
return false; return false;
} }
......
...@@ -40,7 +40,7 @@ export default class GuideMgr { ...@@ -40,7 +40,7 @@ export default class GuideMgr {
DataMgr.game.pause = true; DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask(index, x, y); this.currentGuideMask = new GuideMask(index, x, y);
this.currentGuideMask.onClick = (context) => { this.currentGuideMask.onClick = (context) => {
context.destroy(); context.dispose();
DataMgr.game.pause = false; DataMgr.game.pause = false;
if(this.done.length >= Object.keys(MConfigs.guide).length){ if(this.done.length >= Object.keys(MConfigs.guide).length){
......
...@@ -66,7 +66,7 @@ export class ShootPlanet extends engine.Container { ...@@ -66,7 +66,7 @@ export class ShootPlanet extends engine.Container {
} }
}); });
engine.DisplayObject.prototype.destroy = function () { engine.DisplayObject.prototype.dispose = function () {
this.parent.removeChild(this); this.parent.removeChild(this);
} }
} }
......
{
"props": {
"url": {
"type": "dynamic",
"alias": "链接"
},
"method": {
"type": "enum",
"enum": [
"get",
"post"
],
"alias": "方法",
"default": "get"
},
"type": {
"type": "enum",
"enum": [
"json",
"text",
"jsonp"
],
"alias": "类型",
"default": "json"
},
"name": {
"type": "string",
"alias": "数据名"
},
"params": {
"type": "map",
"alias": "参数"
},
"headers": {
"type": "map",
"alias": "头部"
}
},
"name": "兑吧接口",
"output": [
"success",
"failed"
],
"desc": "通用兑吧接口",
"sub": {
"5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56": {
"uuid": "5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56",
"meta": "entry",
"props": {},
"output": {
"success": [
"69e28053-dfb3-459e-a9e5-4964c6e35193"
]
},
"design": {
"x": 0,
"y": 0,
"input": {}
}
},
"69e28053-dfb3-459e-a9e5-4964c6e35193": {
"uuid": "69e28053-dfb3-459e-a9e5-4964c6e35193",
"meta": "http-request",
"props": {
"url": {
"type": "link"
},
"method": {
"type": "link"
},
"type": {
"type": "link"
},
"params": {
"type": "link"
},
"headers": {
"type": "link"
}
},
"output": {
"success": [
"39dce565-539b-44b6-901c-0344467795a8"
]
},
"design": {
"x": 95,
"y": 134
}
},
"39dce565-539b-44b6-901c-0344467795a8": {
"uuid": "39dce565-539b-44b6-901c-0344467795a8",
"meta": "duiba-api-transform",
"props": {},
"output": {
"success": [
"e95e7bbc-b592-4f87-b433-77fd03a9ef51"
]
},
"design": {
"x": 304,
"y": 95
}
},
"e95e7bbc-b592-4f87-b433-77fd03a9ef51": {
"uuid": "e95e7bbc-b592-4f87-b433-77fd03a9ef51",
"meta": "put-data",
"props": {
"name": {
"type": "link"
}
},
"output": {},
"design": {
"x": 461,
"y": 255
}
}
},
"subEntry": "5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56",
"metas": [
{
"id": "duiba-api-transform",
"script": "if (args.success) {\n\tvar payload;\n\n\tif (args.data && typeof args.data === 'object') {\n\t\tpayload = engine.objClone(args.data);\n\n\t\tvar origin = engine.objClone(args);\n\t\tObject.defineProperty(payload, '__origin', {\n\t\t\tget: function () {\n\t\t\t\treturn origin\n\t\t\t},\n\t\t\tenumerable: false\n\t\t});\n\t} else {\n\t\tpayload = args.data;\n\t}\n\tnext('success', payload);\n}\nelse {\n\tengine.globalEvent.dispatchEvent('net-failed', args);\n\tnext('failed', args);\n}",
"props": {},
"isInline": true,
"name": "兑吧接口转换",
"output": [
"success",
"failed"
],
"desc": "将http请求返回成兑吧接口的解析"
}
]
}
\ No newline at end of file
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
"metas": [ "metas": [
{ {
"id": "duiba-api-transform", "id": "duiba-api-transform",
"script": "if (args.success) {\n\tvar payload;\n\n\tif (typeof args.data === 'object') {\n\t\tpayload = engine.objClone(args.data);\n\n\t\tvar origin = engine.objClone(args);\n\t\tObject.defineProperty(payload, '__origin', {\n\t\t\tget: function () {\n\t\t\t\treturn origin\n\t\t\t},\n\t\t\tenumerable: false\n\t\t});\n\t} else {\n\t\tpayload = args.data;\n\t}\n\tnext('success', payload);\n}\nelse {\n\tengine.globalEvent.dispatchEvent('net-failed', args);\n\tnext('failed', args);\n}", "script": "if (args.success) {\n\tvar payload;\n\n\tif (args.data && typeof args.data === 'object') {\n\t\tpayload = engine.objClone(args.data);\n\n\t\tvar origin = engine.objClone(args);\n\t\tObject.defineProperty(payload, '__origin', {\n\t\t\tget: function () {\n\t\t\t\treturn origin\n\t\t\t},\n\t\t\tenumerable: false\n\t\t});\n\t} else {\n\t\tpayload = args.data;\n\t}\n\tnext('success', payload);\n}\nelse {\n\tengine.globalEvent.dispatchEvent('net-failed', args);\n\tnext('failed', args);\n}",
"props": {}, "props": {},
"isInline": true, "isInline": true,
"name": "兑吧接口转换", "name": "兑吧接口转换",
......
{
"script": "var bizIdMap = {\n\t'sharePage': '506',\n\t'pageRemain': '156'\n}\n\nvar bizId = bizIdMap[props.id];\n\nif(bizId){\n\tengine.accessLog(bizId);\n}\n\nnext('success');\n",
"props": {
"id": {
"type": "enum",
"enum": [
"sharePage",
"pageRemain"
],
"alias": "类型",
"default": "sharePage"
}
},
"name": "访问日志接口",
"output": [
"success"
]
}
\ No newline at end of file
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
}, },
"uri": { "uri": {
"type": "link" "type": "link"
},
"params": {
"type": "link"
} }
}, },
"output": { "output": {
...@@ -74,8 +77,8 @@ ...@@ -74,8 +77,8 @@
] ]
}, },
"design": { "design": {
"x": 160, "x": 275,
"y": 199 "y": 204
} }
}, },
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db": { "f9a32b46-aec1-4bd2-9b98-3d9a427d87db": {
...@@ -105,8 +108,8 @@ ...@@ -105,8 +108,8 @@
}, },
"output": {}, "output": {},
"design": { "design": {
"x": 489, "x": 507,
"y": 107 "y": 115
} }
} }
}, },
...@@ -114,11 +117,15 @@ ...@@ -114,11 +117,15 @@
"metas": [ "metas": [
{ {
"id": "a4b27753-4cbb-47e3-9b31-51ced475e41a", "id": "a4b27753-4cbb-47e3-9b31-51ced475e41a",
"script": "var uri = engine.findVariable('uri', args, props);\nvar url;\n\nvar hash = window.location.hash;\ntry {\n\thash = top.location.hash;\n} catch (e) {\n}\nvar pathname = window.location.pathname;\ntry {\n\tpathname = top.location.pathname;\n} catch (e) {\n}\n\nif(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && pathname === '/preview' || hash.indexOf('preview/') >= 0){\n\tvar projectX = 'projectx';\n\tvar projectID = engine.env.projectID;\n url = engine.joinPath(projectX, projectID, uri);\n}else{\n url = uri;\n}\n\nscope.url = url;\n\nnext('success', args);", "script": "var uri = engine.findVariable('uri', args, props);\nvar url;\n\nvar hash = window.location.hash;\ntry {\n\thash = top.location.hash;\n} catch (e) {\n}\nvar pathname = window.location.pathname;\ntry {\n\tpathname = top.location.pathname;\n} catch (e) {\n}\n\nif(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && pathname === '/preview' || hash.indexOf('preview/') >= 0){\n\tvar projectX = 'projectx';\n\tvar projectID = engine.env.projectID;\n url = engine.joinPath(projectX, projectID, uri);\n}else{\n url = uri;\n}\n\nscope.url = url;\n\nvar params = engine.findVariable('params', args, props);\nif (!params) {\n\tparams = {};\n}\nparams.user_type = global.env.newUser ? '0' : '1';\nparams.is_from_share = global.env.fromShare ? '0' : '1';\nif(args === undefined || args === null){\n\targs = {}\n}\nargs.params = params;\n\nnext('success', args);",
"props": { "props": {
"uri": { "uri": {
"type": "string", "type": "string",
"alias": "URI" "alias": "URI"
},
"params": {
"type": "map",
"alias": "参数"
} }
}, },
"isInline": true, "isInline": true,
......
if (window['getPxToken']) { if(top.location.href.indexOf('preview') >= 0){ //预览环境
window['getPxToken'](function (e, token) { scope.token = 'dev-token';
switch (e) { next('success', args);
case 'net error': }else{
next('error', {type: 'error'}); if (window['getPxToken']) {
break; window['getPxToken'](function (e, token) {
case 'need login': switch (e) {
next('failed', {type: 'failed'}); case 'net error':
break; next('error', {type: 'error'});
case 'state invalid': break;
next('invalid', {type: 'invalid'}); case 'need login':
break; next('failed', {type: 'failed'});
default: break;
if(token){ case 'state invalid':
scope.token = token; next('invalid', {type: 'invalid'});
next('success', args); break;
}else{ default:
next('invalid', {type: 'invalid key'}); if(token){
} scope.token = token;
} next('success', args);
}); }else{
} else { next('invalid', {type: 'invalid key'});
next('error', {type: 'no ready'}); }
}
});
} else {
next('error', {type: 'no ready'});
}
} }
...@@ -2,9 +2,16 @@ ...@@ -2,9 +2,16 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
let options = {
effect,
effectParams,
};
if(props.closeAll){ if(props.closeAll){
engine.gameStage.popupContainer.popAll(); engine.gameStage.popupContainer.popAll(options);
}else{ }else{
engine.gameStage.popupContainer.pop(); engine.gameStage.popupContainer.pop(options);
} }
next('complete'); next('complete');
...@@ -6,6 +6,23 @@ ...@@ -6,6 +6,23 @@
"alias": "是否关闭全部弹窗", "alias": "是否关闭全部弹窗",
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐隐渐现", "value":"fade"},
{"label":"飞入飞出", "value":"flew"},
{"label":"缩放", "value":"zoom"},
{"label":"紫金葫芦", "value":"hulu"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
......
...@@ -2,22 +2,32 @@ ...@@ -2,22 +2,32 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
if(props.popAll){ let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
let options = {
effect,
effectParams,
};
if (props.popAll) {
if (!props.viewName) { if (!props.viewName) {
console.log('没有设置视图名'); console.log('没有设置视图名');
next('exception', '没有设置视图名'); next('exception', '没有设置视图名');
}else{ } else {
let gameStage = engine.gameStage; let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName); gameStage.instantiateView(props.viewName).then(
if (view) { view => {
gameStage.sceneContainer.popAll(view); if (view) {
next('complete'); gameStage.sceneContainer.popAll(view, options);
}else{ next('complete');
next('exception', '视图不存在'); } else {
} next('exception', '视图不存在');
}
});
} }
}else{ } else {
engine.gameStage.sceneContainer.pop(); engine.gameStage.sceneContainer.pop(options);
next('complete'); next('complete');
......
...@@ -10,6 +10,20 @@ ...@@ -10,6 +10,20 @@
"viewName": { "viewName": {
"alias": "目标视图名", "alias": "目标视图名",
"type": "string" "type": "string"
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐变", "value":"fade"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
......
...@@ -2,16 +2,26 @@ ...@@ -2,16 +2,26 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
if (!props.viewName) { if (!props.viewName) {
console.log('没有设置视图名'); console.log('没有设置视图名');
next('exception', '没有设置视图名'); next('exception', '没有设置视图名');
}else{ } else {
let gameStage = engine.gameStage; let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName); gameStage.instantiateView(props.viewName).then(
if (view) { view => {
gameStage.popupContainer.push(view, {center: props.center}); if (view) {
} let options = {
effect,
effectParams,
center: props.center,
};
gameStage.popupContainer.push(view, options);
}
}
);
next('complete'); next('complete');
} }
...@@ -10,6 +10,23 @@ ...@@ -10,6 +10,23 @@
"alias": "是否居中展示", "alias": "是否居中展示",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐隐渐现", "value":"fade"},
{"label":"飞入飞出", "value":"flew"},
{"label":"缩放", "value":"zoom"},
{"label":"紫金葫芦", "value":"hulu"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
......
...@@ -3,22 +3,30 @@ ...@@ -3,22 +3,30 @@
*/ */
let replace = engine.findVariable('replace', args, props); let replace = engine.findVariable('replace', args, props);
let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
if (!props.viewName) { if (!props.viewName) {
console.log('没有设置视图名'); console.log('没有设置视图名');
next('exception', '没有设置视图名'); next('exception', '没有设置视图名');
} else { } else {
let gameStage = engine.gameStage; let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName); gameStage.instantiateView(props.viewName).then(
if (view) { view => {
if (replace) { if (view) {
gameStage.sceneContainer.replace(view); let options = {
} else { effect,
gameStage.sceneContainer.push(view); effectParams,
};
if (replace) {
gameStage.sceneContainer.replace(view, options);
} else {
gameStage.sceneContainer.push(view, options);
}
}
} }
} );
next('complete'); next('complete');
} }
...@@ -10,6 +10,20 @@ ...@@ -10,6 +10,20 @@
"alias": "是否替换场景", "alias": "是否替换场景",
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐变", "value":"fade"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
} }
}, },
"output": [ "output": [
......
/** /**
* Created by rockyl on 2019-11-20. * Created by rockyl on 2019-11-20.
*/ */
import injectProp = engine.injectProp;
export default class BuriedPoint extends engine.ScriptBase { export default class BuriedPoint extends engine.ScriptBase {
static id = 'buried-point'; static id = 'buried-point';
...@@ -94,11 +95,14 @@ export default class BuriedPoint extends engine.ScriptBase { ...@@ -94,11 +95,14 @@ export default class BuriedPoint extends engine.ScriptBase {
} }
async log(type) { async log(type) {
let otherQuery:any = {
appId: engine.env.appID,
};
await log(type, { await log(type, {
dpm: this['__dpm'], dpm: this['__dpm'],
dcm: this['__dcm'], dcm: this['__dcm'],
dom: this['__dom'], dom: this['__dom'],
}); }, otherQuery);
if (this.id !== undefined) { if (this.id !== undefined) {
engine.globalEvent.dispatchEvent('buried-point-success', { engine.globalEvent.dispatchEvent('buried-point-success', {
type, type,
...@@ -116,15 +120,16 @@ function fill(src) { ...@@ -116,15 +120,16 @@ function fill(src) {
return result; return result;
} }
function log(type, data) { function log(type, data, otherQuery?: any) {
let {dpm, dcm, dom} = data; let {dpm, dcm, dom} = data;
const params: any = { const params: any = {
dpm, dcm, appId: engine.env.appID dpm, dcm,
}; };
if (dom !== '0.0.0.0') { if (dom !== '0.0.0.0') {
params.dom = dom; params.dom = dom;
} }
injectProp(params, otherQuery);
let isExposure = type === 'exposure'; let isExposure = type === 'exposure';
return engine.httpRequest( return engine.httpRequest(
......
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