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 @@
"metas": [
{
"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": {},
"isInline": true,
"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 @@
},
"uri": {
"type": "link"
},
"params": {
"type": "link"
}
},
"output": {
......@@ -74,8 +77,8 @@
]
},
"design": {
"x": 160,
"y": 199
"x": 275,
"y": 204
}
},
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db": {
......@@ -105,8 +108,8 @@
},
"output": {},
"design": {
"x": 489,
"y": 107
"x": 507,
"y": 115
}
}
},
......@@ -114,11 +117,15 @@
"metas": [
{
"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": {
"uri": {
"type": "string",
"alias": "URI"
},
"params": {
"type": "map",
"alias": "参数"
}
},
"isInline": true,
......
......@@ -13,7 +13,7 @@
"error"
],
"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",
"type": "builtin"
}
......@@ -6,13 +6,45 @@
"alias": "是否关闭全部弹窗",
"type": "boolean",
"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": [
"complete"
],
"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",
"type": "builtin"
}
......@@ -10,6 +10,26 @@
"viewName": {
"alias": "目标视图名",
"type": "string"
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐变",
"value": "fade"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
}
},
"output": [
......@@ -17,7 +37,7 @@
"exception"
],
"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",
"type": "builtin"
}
......@@ -10,13 +10,45 @@
"alias": "是否居中展示",
"type": "boolean",
"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": [
"complete"
],
"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",
"type": "builtin"
}
......@@ -10,13 +10,33 @@
"alias": "是否替换场景",
"type": "boolean",
"default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{
"label": "无动效",
"value": "simple"
},
{
"label": "渐变",
"value": "fade"
}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
}
},
"output": [
"complete"
],
"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",
"type": "builtin"
}
......@@ -43,8 +43,13 @@
"alias": "点击自动触发",
"type": "boolean",
"default": true
},
"asSharePage": {
"alias": "作为分享页曝光",
"type": "boolean",
"default": false
}
},
"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']) {
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' });
}
}
});
if (top.location.href.indexOf('preview') >= 0) {
scope.token = 'dev-token';
next('success', args);
}
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 {
export const dataCenter: DataCenter;
export let env: {};
export let env: any;
export function injectEnv(data: any): void;
......
......@@ -41,7 +41,7 @@ async function watchWrapper(sourcePath, output) {
});
compileProcess(sourcePath, output)
} else {
await compileProcess(file, program.output)
await compileProcess(sourcePath, program.output)
}
}
......
......@@ -5,22 +5,10 @@
const assets = [
{
"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",
"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){
......
......@@ -49,8 +49,8 @@
return state_1.value;
}
};
GameObject.prototype.destroy = function () {
_super.prototype.destroy.call(this);
GameObject.prototype.dispose = function () {
this.destroy();
this.disableAllComponents();
};
GameObject.prototype.disableAllComponents = function () {
......@@ -69,7 +69,6 @@
};
return GameObject;
}(engine.Container));
//# sourceMappingURL=GameObject.js.map
var GameComponent = (function () {
function GameComponent(owner) {
......@@ -103,14 +102,12 @@
});
return GameComponent;
}());
//# sourceMappingURL=GameComponent.js.map
var DataMgr;
(function (DataMgr) {
DataMgr.game = null;
DataMgr.minEnableCaptchaScore = null;
})(DataMgr || (DataMgr = {}));
//# sourceMappingURL=DataMgr.js.map
var Physics = (function (_super) {
tslib.__extends(Physics, _super);
......@@ -171,7 +168,6 @@
};
return Physics;
}(GameComponent));
//# sourceMappingURL=Physics.js.map
var Collider = (function (_super) {
tslib.__extends(Collider, _super);
......@@ -312,7 +308,6 @@
ColliderType[ColliderType["Rect"] = 1] = "Rect";
ColliderType[ColliderType["Point"] = 2] = "Point";
})(ColliderType || (ColliderType = {}));
//# sourceMappingURL=Collider.js.map
var MConst;
(function (MConst) {
......@@ -352,7 +347,6 @@
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 || (MConst = {}));
//# sourceMappingURL=MConst.js.map
var MoveObjcet = (function (_super) {
tslib.__extends(MoveObjcet, _super);
......@@ -364,7 +358,6 @@
}
return MoveObjcet;
}(GameObject));
//# sourceMappingURL=MoveObject.js.map
var MEvent = (function () {
function MEvent() {
......@@ -427,7 +420,6 @@
};
return MEvent;
}());
//# sourceMappingURL=MEvent.js.map
var MTimer = (function () {
function MTimer() {
......@@ -513,7 +505,6 @@
_onFrame.call(MTimer.deltaTime);
timerTickEvent.call();
}
//# sourceMappingURL=MTimer.js.map
var GameMgr = (function () {
function GameMgr(name) {
......@@ -530,7 +521,6 @@
};
return GameMgr;
}());
//# sourceMappingURL=GameMgr.js.map
function getTexture(uuid) {
var config = getAssetByUUID(uuid);
......@@ -543,7 +533,6 @@
function clamp(target, min, max) {
return Math.min(max, Math.max(min, target));
}
//# sourceMappingURL=utils.js.map
var bulletSpeedValue = 20;
var frameCountThatBulletsMoveInX = 4;
......@@ -621,7 +610,6 @@
};
return HorizontalMoveMgr;
}(GameMgr));
//# sourceMappingURL=Bullet.js.map
var SoundMgr = (function () {
function SoundMgr() {
......@@ -660,7 +648,6 @@
dong: "7fc04e43-1465-4336-92a3-d6039ee88cb3",
boom: "ca6b799f-be85-4e94-99df-812f31801490"
};
//# sourceMappingURL=SoundMgr.js.map
var props = {};
function prepareProps() {
......@@ -670,7 +657,6 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var Car = (function (_super) {
tslib.__extends(Car, _super);
......@@ -792,7 +778,6 @@
};
return Car;
}(GameObject));
//# sourceMappingURL=Car.js.map
var PlayerController = (function (_super) {
tslib.__extends(PlayerController, _super);
......@@ -829,7 +814,6 @@
}
return PlayerController;
}(engine.Container));
//# sourceMappingURL=PlayerController.js.map
var MConfigs;
(function (MConfigs) {
......@@ -930,7 +914,6 @@
},
};
})(MConfigs || (MConfigs = {}));
//# sourceMappingURL=MConfigs.js.map
var MUtils;
(function (MUtils) {
......@@ -990,7 +973,6 @@
}
MUtils.setColorFilter = setColorFilter;
})(MUtils || (MUtils = {}));
//# sourceMappingURL=MUtils.js.map
function getBallScore(bulletScore, powerScore, colorIndex) {
var getScoreFromRange = function (_a) {
......@@ -1078,7 +1060,6 @@
}
return newArray;
}
//# sourceMappingURL=GUtils.js.map
var UILayer = (function (_super) {
tslib.__extends(UILayer, _super);
......@@ -1090,7 +1071,6 @@
}
return UILayer;
}(engine.Container));
//# sourceMappingURL=UILayer.js.map
var DebugMgr = (function (_super) {
tslib.__extends(DebugMgr, _super);
......@@ -1212,7 +1192,7 @@
return;
}
delete this.shapeMap[key];
shape.destroy();
shape.dispose();
};
DebugMgr.prototype.init = function (context) {
context.addChild(this);
......@@ -1245,7 +1225,6 @@
DebugMgr._instance = null;
return DebugMgr;
}(UILayer));
//# sourceMappingURL=DebugMgr.js.map
var instanceId1 = null;
var instanceId2 = null;
......@@ -1483,7 +1462,6 @@
7: 2
};
var GroupMaxIndex = 7;
//# sourceMappingURL=PhycicsSystem.js.map
var PoolGroup = (function () {
function PoolGroup(layer) {
......@@ -1506,7 +1484,6 @@
};
return Pool;
}());
//# sourceMappingURL=Pool.js.map
var padding = 10;
var GuideMask = (function (_super) {
......@@ -1627,7 +1604,7 @@
DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask(index, x, y);
this.currentGuideMask.onClick = function (context) {
context.destroy();
context.dispose();
DataMgr.game.pause = false;
if (_this.done.length >= Object.keys(MConfigs.guide).length) {
DataMgr.game.onGuideDone();
......@@ -1641,7 +1618,6 @@
GuideMgr._instance = null;
return GuideMgr;
}());
//# sourceMappingURL=GuideMgr.js.map
var tempPower = null;
var imageNames = [
......@@ -1888,7 +1864,6 @@
Ball.textures = [];
return Ball;
}(MoveObjcet));
//# sourceMappingURL=Ball.js.map
var BallPool = (function (_super) {
tslib.__extends(BallPool, _super);
......@@ -1930,7 +1905,6 @@
};
return BallPoolGroup;
}(PoolGroup));
//# sourceMappingURL=BallPool.js.map
var FrameAnimationMgr = (function (_super) {
tslib.__extends(FrameAnimationMgr, _super);
......@@ -2031,7 +2005,6 @@
FrameAnimation.caches = {};
return FrameAnimation;
}(engine.Container));
//# sourceMappingURL=FrameAnimation.js.map
var PoolFrameAnimation = (function (_super) {
tslib.__extends(PoolFrameAnimation, _super);
......@@ -2080,7 +2053,6 @@
};
return AnimationPoolGroup;
}(PoolGroup));
//# sourceMappingURL=AnimationPool.js.map
var BulletPool = (function (_super) {
tslib.__extends(BulletPool, _super);
......@@ -2101,7 +2073,6 @@
};
return BulletPool;
}(Pool));
//# sourceMappingURL=BulletPool.js.map
var TextureMgr;
(function (TextureMgr) {
......@@ -2137,7 +2108,6 @@
}
TextureMgr.get = get;
})(TextureMgr || (TextureMgr = {}));
//# sourceMappingURL=TextureMgr.js.map
var InitSpeedValue = 0.08;
var alphaDuration = 300;
......@@ -2270,7 +2240,6 @@
};
return SpBoomEffectPoolGroup;
}(PoolGroup));
//# sourceMappingURL=SpBoomEffect.js.map
var dropImgNames = [
"f7221f86-f376-40ce-b0e8-f7ea573ec780",
......@@ -2390,7 +2359,6 @@
};
return Drop;
}(MoveObjcet));
//# sourceMappingURL=Drop.js.map
var DropPool = (function (_super) {
tslib.__extends(DropPool, _super);
......@@ -2424,7 +2392,6 @@
};
return DropPoolGroup;
}(PoolGroup));
//# sourceMappingURL=DropPool.js.map
var DropBlinkMgr = (function (_super) {
tslib.__extends(DropBlinkMgr, _super);
......@@ -2458,7 +2425,7 @@
return true;
}
else {
e.drop.destroy();
e.drop.dispose();
return false;
}
});
......@@ -2468,7 +2435,6 @@
return DropBlinkMgr;
}(GameMgr));
var BlinkDuration = 3;
//# sourceMappingURL=DropBlinkMgr.js.map
var Game = (function () {
function Game(parent) {
......@@ -2582,7 +2548,7 @@
this.pause = false;
};
Game.prototype.destroy = function () {
this.node.destroy();
this.node.dispose();
for (var _i = 0, _a = this.mgrs; _i < _a.length; _i++) {
var mgr = _a[_i];
mgr.onDestroy();
......@@ -2804,7 +2770,6 @@
});
return Game;
}());
//# sourceMappingURL=Game.js.map
var ShootPlanet = (function (_super) {
tslib.__extends(ShootPlanet, _super);
......@@ -2857,13 +2822,12 @@
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);
};
};
return ShootPlanet;
}(engine.Container));
//# sourceMappingURL=ShootPlanet.js.map
function index (props) {
prepareProps();
......@@ -2871,7 +2835,6 @@
var instance = new ShootPlanet();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -77,7 +77,7 @@
"assets": [
{
"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",
"ext": ".jpg"
},
......
......@@ -88,7 +88,7 @@ export default class Game {
/**销毁游戏 */
public destroy() {
this.node.destroy();
this.node.dispose();
for (let mgr of this.mgrs) {
mgr.onDestroy();
}
......
......@@ -44,8 +44,8 @@ export default class GameObject extends engine.Container {
}
/**销毁时禁用所有组件 */
destroy() {
super.destroy();
dispose() {
this.destroy();
this.disableAllComponents();
}
......
......@@ -139,7 +139,7 @@ export default class DebugMgr extends UILayer {
}
delete this.shapeMap[key];
shape.destroy();
shape.dispose();
}
init(context: engine.Container) {
......
......@@ -39,7 +39,7 @@ export default class DropBlinkMgr extends GameMgr {
if (e.count < 60 / BlinkDuration * 2) {
return true;
} else {
e.drop.destroy();
e.drop.dispose();
return false;
}
......
......@@ -40,7 +40,7 @@ export default class GuideMgr {
DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask(index, x, y);
this.currentGuideMask.onClick = (context) => {
context.destroy();
context.dispose();
DataMgr.game.pause = false;
if(this.done.length >= Object.keys(MConfigs.guide).length){
......
......@@ -66,7 +66,7 @@ export class ShootPlanet extends engine.Container {
}
});
engine.DisplayObject.prototype.destroy = function () {
engine.DisplayObject.prototype.dispose = function () {
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 @@
"metas": [
{
"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": {},
"isInline": true,
"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 @@
},
"uri": {
"type": "link"
},
"params": {
"type": "link"
}
},
"output": {
......@@ -74,8 +77,8 @@
]
},
"design": {
"x": 160,
"y": 199
"x": 275,
"y": 204
}
},
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db": {
......@@ -105,8 +108,8 @@
},
"output": {},
"design": {
"x": 489,
"y": 107
"x": 507,
"y": 115
}
}
},
......@@ -114,11 +117,15 @@
"metas": [
{
"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": {
"uri": {
"type": "string",
"alias": "URI"
},
"params": {
"type": "map",
"alias": "参数"
}
},
"isInline": true,
......
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'});
if(top.location.href.indexOf('preview') >= 0){ //预览环境
scope.token = 'dev-token';
next('success', args);
}else{
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'});
}
}
......@@ -2,9 +2,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){
engine.gameStage.popupContainer.popAll();
engine.gameStage.popupContainer.popAll(options);
}else{
engine.gameStage.popupContainer.pop();
engine.gameStage.popupContainer.pop(options);
}
next('complete');
......@@ -6,6 +6,23 @@
"alias": "是否关闭全部弹窗",
"type": "boolean",
"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": [
......
......@@ -2,22 +2,32 @@
* 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) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
} else {
let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName);
if (view) {
gameStage.sceneContainer.popAll(view);
next('complete');
}else{
next('exception', '视图不存在');
}
gameStage.instantiateView(props.viewName).then(
view => {
if (view) {
gameStage.sceneContainer.popAll(view, options);
next('complete');
} else {
next('exception', '视图不存在');
}
});
}
}else{
engine.gameStage.sceneContainer.pop();
} else {
engine.gameStage.sceneContainer.pop(options);
next('complete');
......
......@@ -10,6 +10,20 @@
"viewName": {
"alias": "目标视图名",
"type": "string"
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐变", "value":"fade"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
}
},
"output": [
......
......@@ -2,16 +2,26 @@
* Created by rockyl on 2019-11-16.
*/
let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
} else {
let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName);
if (view) {
gameStage.popupContainer.push(view, {center: props.center});
}
gameStage.instantiateView(props.viewName).then(
view => {
if (view) {
let options = {
effect,
effectParams,
center: props.center,
};
gameStage.popupContainer.push(view, options);
}
}
);
next('complete');
}
......@@ -10,6 +10,23 @@
"alias": "是否居中展示",
"type": "boolean",
"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": [
......
......@@ -3,22 +3,30 @@
*/
let replace = engine.findVariable('replace', args, props);
let effect = engine.findVariable('effect', args, props);
let effectParams = engine.findVariable('effectParams', args, props);
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
} else {
let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName);
if (view) {
if (replace) {
gameStage.sceneContainer.replace(view);
} else {
gameStage.sceneContainer.push(view);
gameStage.instantiateView(props.viewName).then(
view => {
if (view) {
let options = {
effect,
effectParams,
};
if (replace) {
gameStage.sceneContainer.replace(view, options);
} else {
gameStage.sceneContainer.push(view, options);
}
}
}
}
);
next('complete');
}
......@@ -10,6 +10,20 @@
"alias": "是否替换场景",
"type": "boolean",
"default": false
},
"effect": {
"alias": "动效",
"type": "enum",
"enum": [
{"label":"无动效", "value":"simple"},
{"label":"渐变", "value":"fade"}
],
"default": "simple"
},
"effectParams": {
"alias": "动效参数",
"type": "map",
"default": {}
}
},
"output": [
......
/**
* Created by rockyl on 2019-11-20.
*/
import injectProp = engine.injectProp;
export default class BuriedPoint extends engine.ScriptBase {
static id = 'buried-point';
......@@ -94,11 +95,14 @@ export default class BuriedPoint extends engine.ScriptBase {
}
async log(type) {
let otherQuery:any = {
appId: engine.env.appID,
};
await log(type, {
dpm: this['__dpm'],
dcm: this['__dcm'],
dom: this['__dom'],
});
}, otherQuery);
if (this.id !== undefined) {
engine.globalEvent.dispatchEvent('buried-point-success', {
type,
......@@ -116,15 +120,16 @@ function fill(src) {
return result;
}
function log(type, data) {
function log(type, data, otherQuery?: any) {
let {dpm, dcm, dom} = data;
const params: any = {
dpm, dcm, appId: engine.env.appID
dpm, dcm,
};
if (dom !== '0.0.0.0') {
params.dom = dom;
}
injectProp(params, otherQuery);
let isExposure = type === 'exposure';
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