Commit bb769353 authored by lujinlei's avatar lujinlei

Merge branch 'dev' of http://gitlab2.dui88.com/laoqifeng/zeroing-libs into dev

parents ec98a15d db73236a
{
"name": "蛋黄超人自定义模块",
"desc": "蛋黄超人自定义模块1.0",
"props": {
"QTextStrArr": {
"alias": "问题文案组,用逗号隔开,不填为默认",
"type": "string",
"default": "1、什么是筑梦空间?,2、金币是什么?,3、怎么获得金币?,4、如何更改用户昵称?,5、个人信息可以进行哪些操作?,6、通过二维码添加好友之后在哪里查看?,7、我的勋章是什么?,8、任务有哪些分类?"
},
"ATextStrArr": {
"alias": "答案文案组,用逗号隔开,不填为默认",
"type": "string",
"default": "筑梦空间带给用户吃喝玩乐的不同体验,在这里你可以进行生活缴费、体验本地优惠、建设我的庄园、畅玩游戏中心等等。,金币是筑梦空间中的虚拟货币,用户可以使用金币游玩游戏、种植植物、兑换实物,同时金币可以按一定比例兑换波豆,波豆可以在波豆商城兑换更丰富的商品。,用户可以通过签到、任务、参与活动以及我的庄园果实售卖方式获得金币。,用户可以点击左上角个人信息按钮进入个人信息弹窗,点击昵称旁的修改按钮对昵称进行修改。,用户可以在个人信息页面进行修改昵称、修改头像、兑换波豆、查询金币明细、扫二维码添加好友等操作。,用户A通过扫描用户B的二维码进入活动之后,双方即绑定为好友,可以排行榜-好友排行榜进行查看。,当用户在筑梦空间的各种行为动作达到一定次数时,会点亮相应的激励勋章。,任务中分为一次性任务、永久开放任务和周期更新任务,一次性任务为完成一次或多次后消失的任务,如浏览车主服务任务、升级房屋任务;永久开放任务为一直可以完成并获得奖励的任务,如邀请好友任务;周期任务为以周期(每日/周/月)为单位进行更新的任务,如分享筑梦空间、去商店购买种子任务,积极完成任务可以获得更多金币。"
},
"ACTTextStrArr": {
"alias": "互动文案组,用逗号隔开,不填为默认",
"type": "string",
"default": "主人你多久没来看我了,我好想你啊,Whoooo,主人你太棒了,主人,果子都成熟了,赶紧去采摘吧,主人,有空地可以种植哦,赶紧去吧!"
},
"type": {
"alias": "类型,用于区分所在场景,用于埋点,0:首页,1:庄园",
"type": "number",
"default": "0"
}
},
"assets": [
{
"name": "大对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/a3d49f913ee300b2834260967010a2e7b2d5c265.png",
"uuid": "21d8b7ca-6ed3-44e5-ada0-f0433f471ac9",
"ext": ".png"
},
{
"name": "小对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/c034f14785a2a36dce266cef0f46bd783ad03cb2.png",
"uuid": "9e4d1860-4762-4ac1-bc44-b3dd8fb307a6",
"ext": ".png"
},
{
"name": "蛋黄超人关闭按钮",
"url": "//yun.duiba.com.cn/aurora/assets/7a346d4e2c2cbce5ab3ac0a74e481525b048fcdd.png",
"uuid": "76f2c800-2174-4a90-ad6d-5853e95eb144",
"ext": ".png"
},
{
"name": "返回按钮",
"url": "//yun.duiba.com.cn/aurora/assets/8f55741c71b2aa7babe5cc517707cdd51b33c3d9.png",
"uuid": "2a555da9-dc05-4046-a5fb-551f0c2692fa",
"ext": ".png"
},
{
"name": "蛋黄超人icon",
"url": "//yun.duiba.com.cn/aurora/assets/baeec26a873006fabf031af8c918153384a732ef.png",
"uuid": "d5df1198-2cad-42e0-a197-fd56a2502d99",
"ext": ".png"
},
{
"name": "蛋黄超人名称",
"url": "//yun.duiba.com.cn/aurora/assets/11b02c3908bcb8d685610caafdab9785fac5fccf.png",
"uuid": "fef58cbd-9c24-4216-896a-2799011df1dc",
"ext": ".png"
},
{
"name": "右箭头",
"url": "//yun.duiba.com.cn/aurora/assets/8be77ba8ce699c4d302cd58e4d3be06919ac732f.png",
"uuid": "8546dcf7-a6e8-4ba2-89f7-b929118e473a",
"ext": ".png"
},
{
"name": "常规呼吸动作",
"url": "//yun.duiba.com.cn/aurora/assets/adc7212454ea1d84ac5824982a57f37d2e745b54.svga",
"uuid": "ba2f8259-71b5-49ac-8310-08538a6b5d07",
"ext": ".svga"
},
{
"name": "招手",
"url": "//yun.duiba.com.cn/aurora/assets/cf78c2f55369b597dfc744159687dc255f18a2b4.svga",
"uuid": "97de87e9-2ea4-4a31-9986-25edcd807c05",
"ext": ".svga"
}
],
"events": {
"in": {
"pictures-ActLabel": {
"alias": "互动显示",
"data": {
"type": "0:24小时未登录互动,1:任务完成互动,2:农作物成熟互动,3:有土地未种植互动"
}
},
"pictures-setProjectId": {
"alias": "设置星速台id与appid",
"data": {
"projectId": "默认为'0'",
"appId": "默认为'0'"
}
}
},
"out": {
"pictures-end": {
"alias": "结束"
}
}
},
"id": "superman",
"code": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :\n\ttypeof define === 'function' && define.amd ? define(['tslib'], factory) :\n\t(global = global || self, global.superman = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\r\n\tfunction prepareProps() {\r\n\t var metaProps = getProps();\r\n\t engine.injectProp(props, metaProps);\r\n\t}\r\n\tfunction injectProps(p) {\r\n\t engine.injectProp(props, p);\r\n\t}\n\n\tvar GTime = (function () {\r\n\t function GTime() {\r\n\t }\r\n\t GTime.getTimestamp = function () {\r\n\t return new Date().getTime();\r\n\t };\r\n\t GTime.GetTimeHMS = function (time) {\r\n\t var t;\r\n\t var h = Math.floor(time / 3600);\r\n\t var hstr = h > 9 ? h : '0' + h;\r\n\t var m = Math.floor((time % 3600) / 60);\r\n\t var mstr = m > 9 ? m : '0' + m;\r\n\t var s = Math.floor(time % 60);\r\n\t var sstr = s > 9 ? s : '0' + s;\r\n\t t = hstr + ':' + mstr + ':' + sstr;\r\n\t return t;\r\n\t };\r\n\t GTime.GetTimeMS = function (time) {\r\n\t var t;\r\n\t var m = Math.floor((time % 3600) / 60);\r\n\t var mstr = m > 9 ? m : '0' + m;\r\n\t var s = Math.floor(time % 60);\r\n\t var sstr = s > 9 ? s : '0' + s;\r\n\t t = mstr + ':' + sstr;\r\n\t return t;\r\n\t };\r\n\t return GTime;\r\n\t}());\n\n\tfunction getTexture(uuid) {\r\n\t return engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n\t}\r\n\tfunction createSvga(name, anchorName) {\r\n\t var inst = new svga.Svga();\r\n\t inst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\t return inst;\r\n\t}\r\n\tfunction clickLog(exposure) {\r\n\t var net = {\r\n\t name: 'clickLog',\r\n\t uri: '/log/click',\r\n\t type: 'get',\r\n\t dataType: 'jsonp',\r\n\t param: exposure,\r\n\t callback: null,\r\n\t hideMsg: true\r\n\t };\r\n\t send(net);\r\n\t}\r\n\tfunction showLog(exposure) {\r\n\t var net = {\r\n\t name: 'showLog',\r\n\t uri: exposure.domain + '/exposure/standard',\r\n\t type: 'get',\r\n\t dataType: 'jsonp',\r\n\t param: exposure,\r\n\t callback: null,\r\n\t hideMsg: true\r\n\t };\r\n\t send(net);\r\n\t}\r\n\tfunction send(net) {\r\n\t var gTime = '?_=' + GTime.getTimestamp();\r\n\t var realUrl = net.uri;\r\n\t if (realUrl.indexOf('?') != -1) {\r\n\t gTime = '&_=' + GTime.getTimestamp();\r\n\t }\r\n\t if (net.addUrl) {\r\n\t realUrl += net.addUrl;\r\n\t }\r\n\t window['$'].ajax({\r\n\t type: net.type,\r\n\t url: realUrl,\r\n\t cache: false,\r\n\t dataType: net.dataType,\r\n\t data: net.param,\r\n\t async: true,\r\n\t });\r\n\t}\n\n\tvar Buried = (function () {\r\n\t function Buried() {\r\n\t }\r\n\t Buried.init = function () {\r\n\t };\r\n\t Buried.createExposure = function (dpm, dcm, embedDomain) {\r\n\t if (embedDomain === void 0) { embedDomain = '//embedlog.duiba.com.cn'; }\r\n\t var exposure = {\r\n\t dpm: dpm,\r\n\t dcm: dcm,\r\n\t appId: Buried.appId,\r\n\t domain: embedDomain\r\n\t };\r\n\t return exposure;\r\n\t };\r\n\t Buried.connectDpm = function (pageId, area, dpm) {\r\n\t return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;\r\n\t };\r\n\t Buried.connectDcm = function (typeId, contentInfo, dcm) {\r\n\t return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;\r\n\t };\r\n\t Buried.connectPlugDcm = function (plugId, type) {\r\n\t return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;\r\n\t };\r\n\t Buried.connectActivityDcm = function (type) {\r\n\t return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;\r\n\t };\r\n\t Buried.appId = '0';\r\n\t Buried.oaId = \"0\";\r\n\t return Buried;\r\n\t}());\n\n\tvar getlogItem = function (i) {\r\n\t var Dpm = Buried.connectDpm(110, i, 1);\r\n\t var Dcm = Buried.connectDcm(202, 0, 0);\r\n\t return Buried.createExposure(Dpm, Dcm);\r\n\t};\n\n\tvar QAText = (function (_super) {\r\n\t tslib.__extends(QAText, _super);\r\n\t function QAText() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.bg = [];\r\n\t _this.bgTexture = [];\r\n\t _this.QLabel = [];\r\n\t _this.ALabel = [];\r\n\t _this.addEventListener(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\r\n\t _this.init();\r\n\t return _this;\r\n\t }\r\n\t QAText.prototype.init = function () {\r\n\t var that = this;\r\n\t that.bigBgOrigin = new engine.Point();\r\n\t that.smallBgOrigin = new engine.Point();\r\n\t that.QText = props.QTextStrArr.split(',');\r\n\t console.log(props.QTextStrArr.split(','));\r\n\t that.AText = props.ATextStrArr.split(',');\r\n\t console.log(props.ATextStrArr.split(','));\r\n\t that.ActText = props.ACTTextStrArr.split(',');\r\n\t console.log(props.ACTTextStrArr.split(','));\r\n\t };\r\n\t QAText.prototype.setup = function () {\r\n\t var that = this;\r\n\t that.removeEventListener(engine.Event.ADDED_TO_STAGE, that.setup, that);\r\n\t that.hideText();\r\n\t that.setGroup();\r\n\t that.setQLabel();\r\n\t that.setALabel();\r\n\t that.setActLabel();\r\n\t that.setEvent();\r\n\t };\r\n\t QAText.prototype.setEvent = function () {\r\n\t };\r\n\t QAText.prototype.setGroup = function () {\r\n\t var that = this;\r\n\t that.QlabelGroup = new engine.Sprite();\r\n\t that.addChild(that.QlabelGroup);\r\n\t that.QlabelGroup.visible = false;\r\n\t that.AlabelGroup = new engine.Sprite();\r\n\t that.addChild(that.AlabelGroup);\r\n\t that.AlabelGroup.visible = false;\r\n\t that.ActlabelGroup = new engine.Sprite();\r\n\t that.addChild(that.ActlabelGroup);\r\n\t that.ActlabelGroup.visible = false;\r\n\t for (var i = 0; i < 3; i++) {\r\n\t var bg = new engine.Image();\r\n\t if (i < 2) {\r\n\t bg.texture = getTexture(\"21d8b7ca-6ed3-44e5-ada0-f0433f471ac9\");\r\n\t if (i == 0) {\r\n\t that.QlabelGroup.addChild(bg);\r\n\t }\r\n\t else {\r\n\t that.AlabelGroup.addChild(bg);\r\n\t }\r\n\t }\r\n\t else {\r\n\t bg.texture = getTexture(\"9e4d1860-4762-4ac1-bc44-b3dd8fb307a6\");\r\n\t that.ActlabelGroup.addChild(bg);\r\n\t }\r\n\t that.bg.push(bg);\r\n\t }\r\n\t that.closeBtn = new engine.Image(getTexture(\"76f2c800-2174-4a90-ad6d-5853e95eb144\"));\r\n\t that.addChild(that.closeBtn);\r\n\t that.closeBtn.mouseEnabled = true;\r\n\t that.closeBtn.addEventListener(engine.MouseEvent.CLICK, that.hideText, that);\r\n\t that.QScrList = new engine.ScrollView();\r\n\t that.QlabelGroup.addChild(that.QScrList);\r\n\t that.QScrList.x = 30;\r\n\t that.QScrList.y = 85;\r\n\t that.QScrList.width = that.bg[0].width - 50;\r\n\t that.QScrList.height = 195;\r\n\t };\r\n\t QAText.prototype.setQText = function (e) {\r\n\t console.log('engine.Event.UPDATE_DATA', e);\r\n\t e.target.getChildByName('问题文本').text = e.data;\r\n\t e.target.name = 'Q_' + e.data.substring(0, 1);\r\n\t };\r\n\t QAText.prototype.setQLabel = function () {\r\n\t var that = this;\r\n\t var label = new engine.Label();\r\n\t label.text = '你想问哪些问题?';\r\n\t label.x = 30;\r\n\t label.y = 30;\r\n\t label.size = 34;\r\n\t label.width = that.bg[0].width - 50;\r\n\t that.QlabelGroup.addChild(label);\r\n\t for (var i = 0; i < that.QText.length; i++) {\r\n\t var img = new engine.Image(getTexture(\"8546dcf7-a6e8-4ba2-89f7-b929118e473a\"));\r\n\t that.QScrList.addChild(img);\r\n\t img.name = 'Q_' + i;\r\n\t img.y = 5 + i * 50;\r\n\t img.x = that.QScrList.width - img.width;\r\n\t img.mouseEnabled = true;\r\n\t img.addEventListener(engine.MouseEvent.CLICK, that.showALabelGroup, that);\r\n\t var label_1 = new engine.Label();\r\n\t that.QScrList.addChild(label_1);\r\n\t label_1.name = 'Q_' + i;\r\n\t label_1.text = that.QText[i];\r\n\t label_1.fillColor = \"#d36800\";\r\n\t label_1.size = 24;\r\n\t label_1.width = img.x;\r\n\t label_1.height = 50;\r\n\t label_1.y = img.y;\r\n\t label_1.mouseEnabled = true;\r\n\t label_1.addEventListener(engine.MouseEvent.CLICK, that.showALabelGroup, that);\r\n\t that.QLabel.push(label_1);\r\n\t }\r\n\t };\r\n\t QAText.prototype.setALabel = function () {\r\n\t var that = this;\r\n\t that.AScrView = new engine.ScrollView();\r\n\t that.AlabelGroup.addChild(that.AScrView);\r\n\t that.AScrView.x = 32;\r\n\t that.AScrView.y = 62;\r\n\t that.AScrView.width = that.bg[0].width - 55;\r\n\t that.AScrView.height = that.bg[0].height - 120;\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var label = new engine.Label();\r\n\t label.x = 0;\r\n\t label.y = 5 + i * 40;\r\n\t label.size = 24;\r\n\t label.width = that.AScrView.width;\r\n\t label.lineSpacing = 11;\r\n\t label.lineType = engine.TEXT_lINETYPE.MULTI;\r\n\t that.AScrView.addChild(label);\r\n\t that.ALabel.push(label);\r\n\t }\r\n\t that.returnBtn = new engine.Image(getTexture('2a555da9-dc05-4046-a5fb-551f0c2692fa'));\r\n\t that.AlabelGroup.addChild(that.returnBtn);\r\n\t that.returnBtn.x = 18;\r\n\t that.returnBtn.y = 20;\r\n\t that.returnBtn.mouseEnabled = true;\r\n\t that.returnBtn.addEventListener(engine.MouseEvent.CLICK, that.showQLabelGroup, that);\r\n\t };\r\n\t QAText.prototype.setActLabel = function () {\r\n\t var that = this;\r\n\t that.ActLabel = new engine.Label();\r\n\t that.ActlabelGroup.addChild(that.ActLabel);\r\n\t that.ActLabel.x = 0;\r\n\t that.ActLabel.y = that.getSmallBgSize().h * 0.5 - 24;\r\n\t that.ActLabel.width = that.getSmallBgSize().w;\r\n\t that.ActLabel.textAlign = engine.TEXT_ALIGN.CENTER;\r\n\t that.ActLabel.size = 24;\r\n\t };\r\n\t QAText.prototype.showQLabelGroup = function (e) {\r\n\t var that = this;\r\n\t if (e && e.target == that.returnBtn) {\r\n\t if (props.type == 0) {\r\n\t clickLog(getlogItem(30));\r\n\t }\r\n\t else if (props.type == 1) {\r\n\t clickLog(getlogItem(80));\r\n\t }\r\n\t }\r\n\t that.x = that.bigBgOrigin.x;\r\n\t that.y = that.bigBgOrigin.y;\r\n\t that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;\r\n\t that.closeBtn.y = -10;\r\n\t that.AlabelGroup.visible = false;\r\n\t that.ActlabelGroup.visible = false;\r\n\t that.QlabelGroup.visible = true;\r\n\t that.QScrList.scrollTo(-1);\r\n\t that.showText();\r\n\t };\r\n\t QAText.prototype.showALabelGroup = function (e) {\r\n\t console.log(\"展示答案\" + e.target.name);\r\n\t var that = this;\r\n\t that.x = that.bigBgOrigin.x;\r\n\t that.y = that.bigBgOrigin.y;\r\n\t that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;\r\n\t that.closeBtn.y = -10;\r\n\t var str = e.target.name.split('_');\r\n\t if (str && str.length > 0)\r\n\t var index = str[1];\r\n\t that.ALabel[0].text = that.QText[index];\r\n\t that.ALabel[1].text = that.AText[index];\r\n\t that.QlabelGroup.visible = false;\r\n\t that.ActlabelGroup.visible = false;\r\n\t that.AlabelGroup.visible = true;\r\n\t this.AScrView.scrollTo(-1);\r\n\t that.showText();\r\n\t if (props.type == 0) {\r\n\t showLog(getlogItem(30));\r\n\t }\r\n\t else if (props.type == 1) {\r\n\t showLog(getlogItem(80));\r\n\t }\r\n\t };\r\n\t QAText.prototype.showActLabelGroup = function (type) {\r\n\t var index = type;\r\n\t var that = this;\r\n\t that.x = that.smallBgOrigin.x;\r\n\t that.y = that.smallBgOrigin.y;\r\n\t that.closeBtn.x = that.bg[2].width - that.closeBtn.width - 10;\r\n\t that.closeBtn.y = 20;\r\n\t that.ActLabel.text = that.ActText[index];\r\n\t that.QlabelGroup.visible = false;\r\n\t that.AlabelGroup.visible = false;\r\n\t that.ActlabelGroup.visible = true;\r\n\t that.showText();\r\n\t if (!that.actLabelTimer) {\r\n\t that.actLabelTimer = setTimeout(function () {\r\n\t that.ActlabelGroup.visible = false;\r\n\t that.hideText();\r\n\t clearTimeout(that.actLabelTimer);\r\n\t }, 3000);\r\n\t }\r\n\t else {\r\n\t clearTimeout(that.actLabelTimer);\r\n\t that.actLabelTimer = setTimeout(function () {\r\n\t that.hideText();\r\n\t that.ActlabelGroup.visible = false;\r\n\t }, 3000);\r\n\t }\r\n\t };\r\n\t QAText.prototype.setBigBgPositon = function (x, y) {\r\n\t this.bigBgOrigin.x = x;\r\n\t this.bigBgOrigin.y = y;\r\n\t };\r\n\t QAText.prototype.setSmallBgPositon = function (x, y) {\r\n\t this.smallBgOrigin.x = x;\r\n\t this.smallBgOrigin.y = y;\r\n\t };\r\n\t QAText.prototype.getBigBgSize = function () {\r\n\t return { w: this.bg[0].width, h: this.bg[0].height };\r\n\t };\r\n\t QAText.prototype.getSmallBgSize = function () {\r\n\t return { w: this.bg[2].width, h: this.bg[2].height };\r\n\t };\r\n\t QAText.prototype.showText = function () {\r\n\t this.visible = true;\r\n\t };\r\n\t QAText.prototype.hideText = function () {\r\n\t if (this.actLabelTimer) {\r\n\t clearTimeout(this.actLabelTimer);\r\n\t }\r\n\t engine.globalEvent.dispatchEvent(\"hideRect\");\r\n\t this.visible = false;\r\n\t };\r\n\t return QAText;\r\n\t}(engine.Sprite));\n\n\tvar TestView = (function (_super) {\r\n\t tslib.__extends(TestView, _super);\r\n\t function TestView() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.qaisOpen = false;\r\n\t _this.addEventListener(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\r\n\t return _this;\r\n\t }\r\n\t TestView.prototype.setup = function () {\r\n\t var that = this;\r\n\t that.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n\t that.rect = new engine.Rect();\r\n\t that.rect.fillColor = \"#000000\";\r\n\t that.rect.alpha = 0.7;\r\n\t that.rect.width = 2000;\r\n\t that.rect.height = 2000;\r\n\t that.rect.visible = false;\r\n\t that.addChild(that.rect);\r\n\t that.breathSvga = createSvga(\"常规呼吸动作\");\r\n\t that.waveSvga = createSvga(\"招手\");\r\n\t that.waveSvga.visible = false;\r\n\t that.breathSvga.visible = true;\r\n\t that.breathSvga.mouseEnabled = that.waveSvga.mouseEnabled = true;\r\n\t that.addChild(that.breathSvga);\r\n\t that.addChild(that.waveSvga);\r\n\t that.breathSvga.x = that.waveSvga.x = engine.gameStage.stage.width - 178 * 0.7;\r\n\t that.breathSvga.y = that.waveSvga.y = engine.gameStage.stage.height / 3 * 2 - 60;\r\n\t that.breathSvga.gotoAndPlay(1);\r\n\t that.breathSvga.scaleX = that.breathSvga.scaleY = 0.7;\r\n\t that.waveSvga.scaleX = that.waveSvga.scaleY = 0.7;\r\n\t that.QAText = new QAText();\r\n\t that.addChild(that.QAText);\r\n\t that.QAText.setBigBgPositon(engine.gameStage.stage.width - that.QAText.getBigBgSize().w - 35, engine.gameStage.stage.height / 3 * 2 - 60 - that.QAText.getBigBgSize().h);\r\n\t that.QAText.setSmallBgPositon(engine.gameStage.stage.width - that.QAText.getSmallBgSize().w - 35, engine.gameStage.stage.height / 3 * 2 - 60 - that.QAText.getSmallBgSize().h);\r\n\t that.addEvnt();\r\n\t };\r\n\t TestView.prototype.addEvnt = function () {\r\n\t var that = this;\r\n\t that.breathSvga.addEventListener(engine.MouseEvent.CLICK, that.touchSuperManImg, that);\r\n\t that.waveSvga.addEventListener(engine.MouseEvent.CLICK, that.touchSuperManImg, that);\r\n\t engine.globalEvent.addEventListener(\"pictures-ActLabel\", that.showActLabelGroup, that);\r\n\t engine.globalEvent.addEventListener(\"pictures-supermanAnim\", that.supermanAnim, that);\r\n\t engine.globalEvent.addEventListener(\"hideRect\", function () { that.rect.visible = false; }, that);\r\n\t };\r\n\t TestView.prototype.supermanAnim = function () {\r\n\t };\r\n\t TestView.prototype.touchSuperManImg = function (e) {\r\n\t console.log(\"点击蛋黄超人\");\r\n\t var that = this;\r\n\t if (that.QAText.visible)\r\n\t return;\r\n\t if (props.type == 0) {\r\n\t clickLog(getlogItem(17));\r\n\t }\r\n\t else if (props.type == 1) {\r\n\t clickLog(getlogItem(51));\r\n\t }\r\n\t that.showWaveSvga();\r\n\t that.QAText.showQLabelGroup(null);\r\n\t that.rect.visible = true;\r\n\t };\r\n\t TestView.prototype.showActLabelGroup = function (e) {\r\n\t var that = this;\r\n\t that.showWaveSvga();\r\n\t that.QAText.showActLabelGroup(parseInt(e.data.type));\r\n\t };\r\n\t TestView.prototype.showWaveSvga = function () {\r\n\t var that = this;\r\n\t that.breathSvga.visible = false;\r\n\t that.waveSvga.visible = true;\r\n\t that.waveSvga.play(false, false);\r\n\t that.waveSvga.once(engine.Event.END_FRAME, function () {\r\n\t that.waveSvga.visible = false;\r\n\t that.breathSvga.gotoAndPlay(1);\r\n\t that.breathSvga.visible = true;\r\n\t }, that);\r\n\t };\r\n\t return TestView;\r\n\t}(engine.Container));\n\n\tvar GameWrapper = (function (_super) {\r\n\t tslib.__extends(GameWrapper, _super);\r\n\t function GameWrapper() {\r\n\t var _this = _super.call(this) || this;\r\n\t engine.globalEvent.addEventListener(\"pictures-setProjectId\", _this.setProjectId, _this);\r\n\t var testView = _this._testView = new TestView();\r\n\t _this.addChild(testView);\r\n\t return _this;\r\n\t }\r\n\t GameWrapper.prototype.setProjectId = function (event) {\r\n\t injectProps(event.data);\r\n\t Buried.oaId = event.data.projectId;\r\n\t Buried.appId = event.data.appId;\r\n\t };\r\n\t GameWrapper.prototype.start = function (event) {\r\n\t injectProps(event.data);\r\n\t };\r\n\t GameWrapper.prototype.stop = function (event) {\r\n\t };\r\n\t return GameWrapper;\r\n\t}(engine.Container));\n\n\tfunction index (props) {\r\n\t prepareProps();\r\n\t injectProps(props);\r\n\t var instance = new GameWrapper();\r\n\t return instance;\r\n\t}\n\n\treturn index;\n\n})));\n"
}
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'jiugong-turntable-change-automatic-rotate';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
properties: {
x: 0,
y: 0,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
let pram = [
{
id:1,
name:'奖品1奖品1',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:2,
name:'奖品2奖品2奖品2',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:3,
name:'奖品333333',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:4,
name:'奖品4545545454',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:5,
name:'奖奖品5奖品5奖品5品5',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:6,
name:'奖品6',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:7,
name:'奖品7',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:8,
name:'奖品奖品5奖品5奖品58',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
}
]
setTimeout(() => {
engine.globalEvent.dispatchEvent('jiugong-turntable-change-init')
}, 1000);
setTimeout(() => {
engine.globalEvent.dispatchEvent('jiugong-turntable-change-prizeData',{resources:pram})
}, 1500);
setTimeout(() => {
engine.globalEvent.dispatchEvent('jiugong-turntable-change-start')
}, 4000);
let pram1 = [
{
id:1,
name:'奖品1',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:2,
name:'奖品2',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:3,
name:'奖品3',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:4,
name:'奖品4',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:5,
name:'奖品5',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:6,
name:'奖品6',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:7,
name:'奖品7',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
},
{
id:8,
name:'奖品8',
img:'//yun.dui88.com/images/201907/ui83og75fr.png'
}
]
setTimeout(() => {
engine.globalEvent.dispatchEvent('jiugong-turntable-change-winPrize',{prizeID:4})
}, 6000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('jiugong-turntable-change-prizeData',{resources:pram1})
// }, 10000);
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>九宫格答题-更换奖池</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: #000000;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script>
<!--<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>-->
<!--//yun.duiba.com.cn/aurora/assets/6a63b68a1fd87eaf60a515968f91a0b1014fe640.ttf-->
<script src="//yun.duiba.com.cn/editor/zeroing/libs/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"> </script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
"use strict";var tslib=require("tslib");function getTexture(e){return engine.Texture.from(getAssetByUUID(e).uuid)}function getTextureByName(e){return getTexture(engine.getAssetByName(e).uuid)}var props={};function prepareProps(){var e=getProps();engine.injectProp(props,e)}function injectProps(e){engine.injectProp(props,e)}var Turntable=function(t){function e(){var e=t.call(this)||this;return e._vertical_Y=props.vertical||20,e._horizontal_X=props.horizontal||20,e._prizeIndex=0,e._boxArray=[],e._boxIndex=0,e.tweenTime=props.tweenTime||200,e.slowTweenTime=props.slowTweenTime||200,e.circleNumber=0,e.turntableOrder=[1,2,3,5,8,7,6,4],e.recordID=-1,e.boxPrizeIndex=-1,e.slowDown=!1,e.isStop=!1,e.automaticFlag=!0,e}return tslib.__extends(e,t),e.prototype.initData=function(e){this.initTurntable(e),this.setNodeOrder()},e.prototype.initTurntable=function(e){var t=null;this._turnTableNode&&(this.removeChild(this._turnTableNode),this._turnTableNode=null,this._boxArray=[],this._prizeIndex=0,this._boxIndex=0),t=this._turnTableNode=new engine.Container,this.addChild(t);for(var i=0;i<3;i++)for(var n,r,o,a,s,h,p=0;p<3;p++){1==p&&1==i||(n=new engine.Container,r=this.getImage("unchecked",1),o=this.getImage("checked",0),n.width=Math.max(r.width,o.width),this._singleNodeWidth=this._singleNodeWidth?this._singleNodeWidth:n.width,n.height=Math.max(r.height,o.height),n.x=p*(n.width+this._horizontal_X),n.y=i*(n.height+this._vertical_Y),n.addChild(r),n.addChild(o),a=new engine.Sprite(engine.Texture.fromImage(e[this._prizeIndex].img)),s=e[this._prizeIndex].id,a.width=props.icon_width,a.height=props.icon_height,a.x=(n.width-a.width)/2+props.icon_X,a.y=(n.height-a.height)/2+props.icon_Y,n.prizeID=s,n.addChild(a),(h=new engine.Label).fillColor=props.prizeName_color,h.size=props.prizeName_size,h.width=r.width,h.textAlign=engine.TEXT_ALIGN.CENTER,h.x=0,h.y=props.prizeName_Ypos,h.text=this.fixTitle(e[this._prizeIndex].name),n.addChild(h),this._prizeIndex++,this._boxArray.push(n),t.addChild(n))}t.x=(750-(3*this._singleNodeWidth+2*this._horizontal_X))/2},e.prototype.setNodeOrder=function(){for(var e=[],t=0;t<this.turntableOrder.length;t++){var i=this.turntableOrder[t];e.push(this._boxArray[i-1])}this._boxArray=e},e.prototype.fixTitle=function(e){if(!e)return"";if(e.split("").length<props.prizeName_maxLength)return e;for(var t="",i=0;i<props.prizeName_retainLength;i++)t+=e.split("")[i];return t+="..."},e.prototype.getImage=function(e,t){var i=new engine.Sprite(getTextureByName(e));return i.x=0,i.y=0,i.alpha=t,i.name=e,i},e.prototype.automaticRotate=function(){var e=this;console.log("enter the automatic rotate");var t=this._boxArray[this._boxIndex].getChildByName("checked");if(this.tweenTime=1e3,!this.automaticFlag)return this._boxIndex=0,this.tweenTime=props.tweenTime||200,void engine.Tween.removeTweens(t);engine.Tween.get(t).to({alpha:1},this.tweenTime/2).to({alpha:0},this.tweenTime/2).call(function(){e._boxIndex++,e._boxIndex>=e._boxArray.length&&(e._boxIndex=0),e.automaticRotate()})},e.prototype.startDraw=function(){var e=this;this.automaticFlag=!1;var t=this._boxArray[this._boxIndex].getChildByName("checked");this.isStop?engine.Tween.removeTweens(t):(this.slowDown&&(this._boxIndex!=this.getNodeIndexOFprize()?this.tweenTime+=this.slowTweenTime:(this.isStop=!0,this.twinkle(t),this.automaticFlag=!0)),engine.Tween.get(t).to({alpha:1},this.tweenTime/2).to({alpha:0},this.tweenTime/2).call(function(){e.circleNumber>=props.circleNumber&&e.getSlowStart()==e._boxIndex&&(e.slowDown=!0),e._boxIndex++,e._boxIndex>=e._boxArray.length&&(e._boxIndex=0,e.circleNumber++),e.startDraw()}))},e.prototype.getSlowStart=function(){if(this.recordID<0)return-1;var e=this.getNodeIndexOFprize();return e<4?e+4:e-4},e.prototype.getNodeIndexOFprize=function(){if(this.recordID<0)return-1;for(var e=0;e<this._boxArray.length;e++){if(this._boxArray[e].prizeID===this.recordID)return e}return-1},e.prototype.twinkle=function(e){engine.Tween.removeTweens(e);var t=1;engine.Tween.get(e,{loop:!0}).to({alpha:0},30).to({alpha:1},30).call(function(){return 5<t?(engine.Tween.removeTweens(e),void engine.globalEvent.dispatchEvent("jiugong-turntable-change-over")):void t++})},e.prototype.setRecordID=function(e){this.recordID=e},e.prototype.reset=function(){this._boxArray.forEach(function(e){engine.Tween.removeTweens(e.getChildByName("checked"))}),this._boxIndex=0,this.tweenTime=props.tweenTime||200,this.slowTweenTime=props.slowTweenTime||200,this.circleNumber=0,this.recordID=-1,this.boxPrizeIndex=-1,this.slowDown=!1,this.isStop=!1,this.automaticFlag=!0;for(var e=0;e<this._boxArray.length;e++){this._boxArray[e].getChildByName("checked").alpha=0}},e}(engine.Container),GameView=function(e){function t(){return e.call(this)||this}return tslib.__extends(t,e),t.prototype.setup=function(){var e;this._hasSetup||(this._hasSetup=!0,e=this._turntable=new Turntable,this.addChild(e))},t.prototype.setPrizeData=function(e){this._turntable.initData(e),this._turntable.automaticRotate()},t.prototype.startDraw=function(){this._turntable.startDraw()},t.prototype.setRecordID=function(e){this._turntable.setRecordID(e)},t.prototype.reset=function(){this._turntable.reset()},t.prototype.setSetup=function(){this._hasSetup=!1},t}(engine.Container),GameWrapper=function(t){function e(){var e=t.call(this)||this;return engine.globalEvent.addEventListener("jiugong-turntable-change-init",e.init,e),engine.globalEvent.addEventListener("jiugong-turntable-change-prizeData",e.initPrizeData,e),engine.globalEvent.addEventListener("jiugong-turntable-change-start",e.start,e),engine.globalEvent.addEventListener("jiugong-turntable-change-winPrize",e.winPrize,e),engine.globalEvent.addEventListener("jiugong-turntable-change-reset",e.reset,e),engine.globalEvent.addEventListener("jiugong-turntable-change-abnormal",e.reset,e),e}return tslib.__extends(e,t),e.prototype.init=function(e){var t=this._gameView=new GameView;this.addChild(t),this._gameView.setup()},e.prototype.initPrizeData=function(e){this._gameView.setSetup(),this._gameView.setPrizeData(e.data.resources)},e.prototype.start=function(e){this._gameView.startDraw()},e.prototype.winPrize=function(e){this._gameView.setRecordID(e.data.prizeID)},e.prototype.reset=function(){this._gameView.reset()},e}(engine.Container);function index(e){return prepareProps(),injectProps(e),new GameWrapper}module.exports=index;
{"version":3,"file":"index.js","sources":["src/custom/jiugong-turntable-change-automatic-rotate/src/game/utils.ts","src/custom/jiugong-turntable-change-automatic-rotate/src/props.ts","src/custom/jiugong-turntable-change-automatic-rotate/src/game/turntable.ts","src/custom/jiugong-turntable-change-automatic-rotate/src/game/GameView.ts","src/custom/jiugong-turntable-change-automatic-rotate/src/game/GameWrapper.ts","src/custom/jiugong-turntable-change-automatic-rotate/src/index.ts"],"sourcesContent":["\r\n/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function getStage(){\r\n\treturn engine.gameStage.stage;\r\n}","/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\r\n\tengine.injectProp(props, metaProps);\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","\r\nimport {getTextureByName} from \"./utils\";\r\nimport {getStage} from \"./utils\";\r\n\r\nimport { props } from '../props';\r\n\r\nexport class Turntable extends engine.Container{\r\n private _turnTableNode:engine.Container;\r\n private _vertical_Y = props.vertical || 20;//纵向间距\r\n private _horizontal_X = props.horizontal || 20;//横向间距\r\n private _prizeIndex = 0;\r\n\r\n private _boxArray = [];\r\n private _boxIndex = 0;//当前下标\r\n\r\n private tweenTime = props.tweenTime || 200;//单个动画时间(毫秒)\r\n private slowTweenTime = props.slowTweenTime || 200;\r\n private circleNumber = 0;//圈数\r\n\r\n private turntableOrder = [1,2,3,5,8,7,6,4]; \r\n private recordID = -1;//中奖奖品ID\r\n private boxPrizeIndex = -1;//中奖奖品节点下标 \r\n private slowDown = false;//是否开始缓速\r\n private isStop = false;\r\n\r\n private automaticFlag = true;\r\n\r\n private _singleNodeWidth;//单个节点宽度\r\n constructor(){\r\n super()\r\n \r\n }\r\n public initData(res){\r\n this.initTurntable(res);\r\n this.setNodeOrder();\r\n }\r\n initTurntable(res){\r\n let turnTableNode = null;\r\n if(this._turnTableNode){\r\n this.removeChild(this._turnTableNode);\r\n this._turnTableNode = null;\r\n this._boxArray = [];\r\n this._prizeIndex = 0;\r\n this._boxIndex = 0;\r\n }\r\n turnTableNode = this._turnTableNode = new engine.Container();\r\n //turnTableNode.y = 50;\r\n this.addChild(turnTableNode);\r\n for (let index_Y = 0; index_Y < 3; index_Y++) {\r\n for (let index_X = 0; index_X < 3; index_X++) { \r\n if(index_X == 1 && index_Y == 1)continue;\r\n let tmpNode:any = new engine.Container()\r\n\r\n let unchecked = this.getImage('unchecked',1);\r\n let checked = this.getImage('checked',0);\r\n\r\n tmpNode.width = Math.max(unchecked.width,checked.width);\r\n this._singleNodeWidth = this._singleNodeWidth ? this._singleNodeWidth : tmpNode.width;\r\n tmpNode.height = Math.max(unchecked.height,checked.height);\r\n tmpNode.x = index_X*(tmpNode.width + this._horizontal_X);\r\n tmpNode.y = index_Y*(tmpNode.height + this._vertical_Y);\r\n tmpNode.addChild(unchecked);\r\n tmpNode.addChild(checked);\r\n \r\n let prize =new engine.Sprite(engine.Texture.fromImage(res[this._prizeIndex].img)) ;\r\n let prizeID = res[this._prizeIndex].id;\r\n prize.width = props.icon_width;\r\n prize.height = props.icon_height;\r\n prize.x = (tmpNode.width - prize.width)/2 + props.icon_X;\r\n prize.y = (tmpNode.height - prize.height)/2 + props.icon_Y;\r\n tmpNode.prizeID = prizeID;\r\n tmpNode.addChild(prize);\r\n \r\n let titleLabel = new engine.Label();\r\n titleLabel.fillColor = props.prizeName_color;\r\n titleLabel.size = props.prizeName_size;\r\n titleLabel.width = unchecked.width;\r\n titleLabel.textAlign = engine.TEXT_ALIGN.CENTER;\r\n titleLabel.x = 0;\r\n titleLabel.y = props.prizeName_Ypos;\r\n \r\n titleLabel.text = this.fixTitle(res[this._prizeIndex].name);\r\n tmpNode.addChild(titleLabel)\r\n \r\n this._prizeIndex ++ ;\r\n this._boxArray.push(tmpNode); \r\n turnTableNode.addChild(tmpNode); \r\n }\r\n }\r\n turnTableNode.x = (750 - (this._singleNodeWidth*3 + this._horizontal_X*2))/2;\r\n }\r\n\r\n setNodeOrder(){\r\n let tmpNodeArray = [];\r\n for (let index = 0; index < this.turntableOrder.length; index++) {\r\n let order = this.turntableOrder[index];\r\n tmpNodeArray.push(this._boxArray[order-1]);\r\n }\r\n this._boxArray = tmpNodeArray;\r\n }\r\n\r\n fixTitle(name){\r\n if(!name){\r\n return \"\"\r\n }\r\n if(name.split(\"\").length<props.prizeName_maxLength){\r\n return name\r\n }\r\n let n = \"\"\r\n for(let i=0;i<props.prizeName_retainLength;i++){\r\n n += name.split(\"\")[i]\r\n }\r\n n+=\"...\"\r\n return n\r\n }\r\n\r\n getImage(resName,alpha){\r\n let tmpImage = new engine.Sprite(getTextureByName(resName));\r\n tmpImage.x = 0\r\n tmpImage.y = 0\r\n tmpImage.alpha = alpha;\r\n tmpImage.name = resName;\r\n return tmpImage;\r\n }\r\n automaticRotate(){\r\n let tmpCheckNode = this._boxArray[this._boxIndex].getChildByName('checked');\r\n // this.slowDown = true;\r\n this.tweenTime = 1000;\r\n if(!this.automaticFlag){\r\n this._boxIndex = 0;\r\n this.tweenTime = props.tweenTime || 200;\r\n // this.slowDown = false;\r\n engine.Tween.removeTweens(tmpCheckNode);return}\r\n // if(this.slowDown)\r\n // {\r\n // if(this._boxIndex != this.getNodeIndexOFprize()){\r\n // this.tweenTime += this.slowTweenTime;\r\n // }else{\r\n // this.isStop = true;\r\n // this.twinkle(tmpCheckNode);\r\n // }\r\n // }\r\n \r\n engine.Tween.get(tmpCheckNode)\r\n .to({alpha:1},this.tweenTime/2)\r\n .to({alpha:0},this.tweenTime/2)\r\n .call(()=>{\r\n // if(this.circleNumber >= props.circleNumber && this.getSlowStart() == this._boxIndex){\r\n // this.slowDown = true;\r\n // }\r\n this._boxIndex ++;\r\n if(this._boxIndex >= this._boxArray.length){\r\n this._boxIndex = 0;\r\n // this.circleNumber++;\r\n }\r\n // if(!this.automaticFlag){\r\n // this._boxIndex = 0;\r\n // engine.Tween.removeTweens(tmpCheckNode);\r\n // // return;\r\n // }\r\n \r\n this.automaticRotate();\r\n \r\n })\r\n }\r\n\r\n startDraw(){\r\n this.automaticFlag = false;\r\n let tmpCheckNode = this._boxArray[this._boxIndex].getChildByName('checked');\r\n if(this.isStop){engine.Tween.removeTweens(tmpCheckNode);return}\r\n if(this.slowDown)\r\n {\r\n if(this._boxIndex != this.getNodeIndexOFprize()){\r\n this.tweenTime += this.slowTweenTime;\r\n }else{\r\n this.isStop = true;\r\n this.twinkle(tmpCheckNode);\r\n\r\n this.automaticFlag = true;\r\n }\r\n }\r\n engine.Tween.get(tmpCheckNode)\r\n .to({alpha:1},this.tweenTime/2)\r\n .to({alpha:0},this.tweenTime/2)\r\n .call(()=>{\r\n if(this.circleNumber >= props.circleNumber && this.getSlowStart() == this._boxIndex){\r\n this.slowDown = true;\r\n }\r\n this._boxIndex ++;\r\n if(this._boxIndex >= this._boxArray.length){\r\n this._boxIndex = 0;\r\n this.circleNumber++;\r\n }\r\n \r\n this.startDraw();\r\n \r\n \r\n })\r\n }\r\n\r\n //获取开始减速的下标\r\n private getSlowStart(){\r\n if(this.recordID < 0)return -1;\r\n let tmpIndex = this.getNodeIndexOFprize();\r\n if(tmpIndex < 4){\r\n return tmpIndex + 4;\r\n }else{\r\n return tmpIndex - 4\r\n }\r\n }\r\n //获取奖品节点下标\r\n getNodeIndexOFprize(){\r\n if(this.recordID < 0)return -1;\r\n for (let index = 0; index < this._boxArray.length; index++) {\r\n let element = this._boxArray[index];\r\n if(element.prizeID === this.recordID){\r\n return index;\r\n } \r\n }\r\n return -1;\r\n }\r\n //中奖节点闪烁\r\n twinkle(tmpNode){\r\n engine.Tween.removeTweens(tmpNode)\r\n let twinkleTime = 1;\r\n engine.Tween.get(tmpNode, {loop:true})\r\n .to({alpha:0}, 30)\r\n .to({alpha:1}, 30)\r\n .call(()=>{\r\n if(twinkleTime > 5){\r\n engine.Tween.removeTweens(tmpNode);\r\n engine.globalEvent.dispatchEvent('jiugong-turntable-change-over')\r\n return;\r\n }else{\r\n twinkleTime++;\r\n }\r\n })\r\n }\r\n setRecordID(prizeID){\r\n this.recordID = prizeID;\r\n }\r\n reset(){\r\n this._boxArray.forEach(element => {\r\n engine.Tween.removeTweens(element.getChildByName('checked'));\r\n });\r\n this._boxIndex = 0;//当前下标\r\n this.tweenTime = props.tweenTime || 200;//单个动画时间(毫秒)\r\n this.slowTweenTime = props.slowTweenTime || 200;\r\n this.circleNumber = 0;//圈数\r\n this.recordID = -1;//中奖奖品ID\r\n this.boxPrizeIndex = -1;//中奖奖品节点下标 \r\n this.slowDown = false;//是否开始缓速\r\n this.isStop = false;\r\n\r\n this.automaticFlag = true;\r\n\r\n for (let index = 0; index < this._boxArray.length; index++) {\r\n let element = this._boxArray[index];\r\n element.getChildByName('checked').alpha = 0;\r\n }\r\n \r\n }\r\n\r\n}","\r\n/**\r\n * Created by rockyl on 2018/8/16.\r\n */\r\n\r\nimport {props} from \"../props\";\r\nimport { Turntable } from \"./turntable\";\r\n\r\n\r\n\r\n\r\n\r\nexport default class GameView extends engine.Container {\r\n\r\n\t\r\n\tprivate _hasSetup;\r\n\tprivate _turntable:Turntable;\r\n\tconstructor() {\r\n\t\tsuper();\t\r\n\t}\r\n\t setup(){\r\n\t\tif (this._hasSetup) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._hasSetup = true;\r\n\t\t\r\n\t\tlet turntable = this._turntable = new Turntable();\r\n\t\tthis.addChild(turntable);\r\n\t}\r\n\tsetPrizeData(res){\r\n\t\tthis._turntable.initData(res);\r\n\t\tthis._turntable.automaticRotate();\r\n\t}\r\n\tstartDraw(){\r\n\t\t// this._turntable.startDraw();\r\n\t}\r\n\tsetRecordID(prizeID){\r\n\t\tthis._turntable.setRecordID(prizeID)\r\n\t}\r\n\treset(){\r\n\t\tthis._turntable.reset();\r\n\t}\r\n\tsetSetup(){\r\n\t\tthis._hasSetup = false;\r\n\t}\r\n}\r\n","\r\n\r\nimport { props } from '../props';\r\n\r\n\r\n/**\r\n * Created by rockyl on 2020-01-09.\r\n */\r\n\r\nimport GameView from \"./GameView\";\r\n\r\nexport class GameWrapper extends engine.Container {\r\n\tprivate _gameView: GameView;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-init', this.init, this);\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-prizeData', this.initPrizeData, this);\r\n\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-start', this.start, this);\r\n\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-winPrize', this.winPrize, this);\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-reset', this.reset, this);\r\n\t\tengine.globalEvent.addEventListener('jiugong-turntable-change-abnormal', this.reset, this);\r\n\t}\r\n\r\n\tinit(event: engine.Event) {\r\n\t\t//初始化场景\r\n\t\tlet gameView = this._gameView = new GameView();\r\n\t\tthis.addChild(gameView);\r\n\t\tthis._gameView.setup();\r\n\t}\r\n\tinitPrizeData(event: engine.Event){\r\n\t\tthis._gameView.setSetup();\r\n\t\tthis._gameView.setPrizeData(event.data.resources);\r\n\t}\r\n\r\n\t//开始抽奖\r\n\tstart(event: engine.Event){\r\n\t\tthis._gameView.startDraw();\r\n\t}\r\n\twinPrize(event: engine.Event){\r\n\t\tthis._gameView.setRecordID(event.data.prizeID)\r\n\t}\r\n\treset(){\r\n\t\tthis._gameView.reset();\r\n\t}\r\n\t// private visibilitychange(){\r\n\t// \tdocument.addEventListener('visibilitychange', function () {\r\n // if (document.visibilityState === 'hidden') {\r\n\t// \t\t\tconsole.log('放置后台');\r\n\t// \t\t\tengine.globalEvent.dispatchEvent('answer-game-visibilitychange',{hidden:true});\r\n // }\r\n // });\r\n\t// }\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport {GameWrapper} from \"./game/GameWrapper\";\r\nimport {injectProps, prepareProps} from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\r\n\tlet instance = new GameWrapper();\r\n\treturn instance;\r\n}\r\n"],"names":["__extends"],"mappings":";;;;;;UAKgB,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;UAEe,gBA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,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "九宫格抽奖-更换奖池",
"desc": "九宫格抽奖模块-更换奖池",
"props": {
"horizontal": {
"alias": "横向间距",
"type": "number",
"default": 1
},
"vertical": {
"alias": "纵向间距",
"type": "number",
"default": 1
},
"circleNumber": {
"alias": "至少转的圈数",
"type": "number",
"default": 3
},
"tweenTime": {
"alias": "单个奖品节点动画时间(毫秒)",
"type": "number",
"default": 200
},
"slowTweenTime": {
"alias": "中奖后缓速递增时长",
"type": "number",
"default": 200
},
"icon_width": {
"alias": "奖品图宽度",
"type": "number",
"default": 110
},
"icon_height": {
"alias": "奖品图高度",
"type": "number",
"default": 110
},
"icon_X": {
"alias": "奖品X轴偏移量(底框背景有透明)",
"type": "number",
"default": 0
},
"icon_Y": {
"alias": "奖品Y轴偏移量(底框背景有透明)",
"type": "number",
"default": -20
},
"prizeName_size": {
"alias": "奖品名字字号",
"type": "number",
"default": 30
},
"prizeName_Ypos": {
"alias": "奖品名字相对于底框的高度",
"type": "number",
"default": 50
},
"prizeName_color": {
"alias": "奖品名字颜色值",
"type": "string",
"default": "#e8805d"
},
"prizeName_maxLength": {
"alias": "奖品名字最长显示长度",
"type": "number",
"default": 8
},
"prizeName_retainLength": {
"alias": "奖品名字超过长度保留多少字数",
"type": "number",
"default": 5
}
},
"assets": [
{
"name": "unchecked",
"url": "//yun.duiba.com.cn/aurora/assets/3351a20f982fea1fbcbbb3b85bc03f6b547c8bbc.png",
"uuid": "48dc9c00-92c3-4926-8d6b-9eb3e0d0668d",
"ext": ".png"
},
{
"name": "checked",
"url": " //yun.duiba.com.cn/aurora/assets/2a9f9ecc43eb912db553fa4685c1987a937f0198.png",
"uuid": "1d7bc84d-689d-4a6a-a023-e4a7b9659083",
"ext": ".png"
}
],
"events": {
"in": {
"jiugong-turntable-change-init": {
"alias": "初始化",
"data": {
}
},
"jiugong-turntable-change-prizeData": {
"alias": "奖品数据",
"data": {
}
},
"jiugong-turntable-change-start": {
"alias": "开始",
"data": {
}
},
"jiugong-turntable-change-winPrize": {
"alias": "中奖",
"data": {
}
},
"jiugong-turntable-change-abnormal": {
"alias": "异常",
"data": {
}
},
"jiugong-turntable-change-reset": {
"alias": "重置",
"data": {
}
}
},
"out": {
"jiugong-turntable-change-over": {
"alias": "结束",
"data": {
}
}
}
}
}
\ No newline at end of file
/**
* Created by rockyl on 2018/8/16.
*/
import {props} from "../props";
import { Turntable } from "./turntable";
export default class GameView extends engine.Container {
private _hasSetup;
private _turntable:Turntable;
constructor() {
super();
}
setup(){
if (this._hasSetup) {
return;
}
this._hasSetup = true;
let turntable = this._turntable = new Turntable();
this.addChild(turntable);
}
setPrizeData(res){
this._turntable.initData(res);
this._turntable.automaticRotate();
}
startDraw(){
this._turntable.startDraw();
}
setRecordID(prizeID){
this._turntable.setRecordID(prizeID)
}
reset(){
this._turntable.reset();
}
setSetup(){
this._hasSetup = false;
}
}
import { props } from '../props';
/**
* Created by rockyl on 2020-01-09.
*/
import GameView from "./GameView";
export class GameWrapper extends engine.Container {
private _gameView: GameView;
constructor() {
super();
engine.globalEvent.addEventListener('jiugong-turntable-change-init', this.init, this);
engine.globalEvent.addEventListener('jiugong-turntable-change-prizeData', this.initPrizeData, this);
engine.globalEvent.addEventListener('jiugong-turntable-change-start', this.start, this);
engine.globalEvent.addEventListener('jiugong-turntable-change-winPrize', this.winPrize, this);
engine.globalEvent.addEventListener('jiugong-turntable-change-reset', this.reset, this);
engine.globalEvent.addEventListener('jiugong-turntable-change-abnormal', this.reset, this);
}
init(event: engine.Event) {
//初始化场景
let gameView = this._gameView = new GameView();
this.addChild(gameView);
this._gameView.setup();
}
initPrizeData(event: engine.Event){
this._gameView.setSetup();
this._gameView.setPrizeData(event.data.resources);
}
//开始抽奖
start(event: engine.Event){
this._gameView.startDraw();
}
winPrize(event: engine.Event){
this._gameView.setRecordID(event.data.prizeID)
}
reset(){
this._gameView.reset();
}
// private visibilitychange(){
// document.addEventListener('visibilitychange', function () {
// if (document.visibilityState === 'hidden') {
// console.log('放置后台');
// engine.globalEvent.dispatchEvent('answer-game-visibilitychange',{hidden:true});
// }
// });
// }
}
import {getTextureByName} from "./utils";
import {getStage} from "./utils";
import { props } from '../props';
export class Turntable extends engine.Container{
private _turnTableNode:engine.Container;
private _vertical_Y = props.vertical || 20;//纵向间距
private _horizontal_X = props.horizontal || 20;//横向间距
private _prizeIndex = 0;
private _boxArray = [];
private _boxIndex = 0;//当前下标
private tweenTime = props.tweenTime || 200;//单个动画时间(毫秒)
private slowTweenTime = props.slowTweenTime || 200;
private circleNumber = 0;//圈数
private turntableOrder = [1,2,3,5,8,7,6,4];
private recordID = -1;//中奖奖品ID
private boxPrizeIndex = -1;//中奖奖品节点下标
private slowDown = false;//是否开始缓速
private isStop = false;
private automaticFlag = true;
private _singleNodeWidth;//单个节点宽度
constructor(){
super()
}
public initData(res){
this.initTurntable(res);
this.setNodeOrder();
}
initTurntable(res){
let turnTableNode = null;
if(this._turnTableNode){
this.removeChild(this._turnTableNode);
this._turnTableNode = null;
this._boxArray = [];
this._prizeIndex = 0;
this._boxIndex = 0;
}
turnTableNode = this._turnTableNode = new engine.Container();
//turnTableNode.y = 50;
this.addChild(turnTableNode);
for (let index_Y = 0; index_Y < 3; index_Y++) {
for (let index_X = 0; index_X < 3; index_X++) {
if(index_X == 1 && index_Y == 1)continue;
let tmpNode:any = new engine.Container()
let unchecked = this.getImage('unchecked',1);
let checked = this.getImage('checked',0);
tmpNode.width = Math.max(unchecked.width,checked.width);
this._singleNodeWidth = this._singleNodeWidth ? this._singleNodeWidth : tmpNode.width;
tmpNode.height = Math.max(unchecked.height,checked.height);
tmpNode.x = index_X*(tmpNode.width + this._horizontal_X);
tmpNode.y = index_Y*(tmpNode.height + this._vertical_Y);
tmpNode.addChild(unchecked);
tmpNode.addChild(checked);
let prize =new engine.Sprite(engine.Texture.fromImage(res[this._prizeIndex].img)) ;
let prizeID = res[this._prizeIndex].id;
prize.width = props.icon_width;
prize.height = props.icon_height;
prize.x = (tmpNode.width - prize.width)/2 + props.icon_X;
prize.y = (tmpNode.height - prize.height)/2 + props.icon_Y;
tmpNode.prizeID = prizeID;
tmpNode.addChild(prize);
let titleLabel = new engine.Label();
titleLabel.fillColor = props.prizeName_color;
titleLabel.size = props.prizeName_size;
titleLabel.width = unchecked.width;
titleLabel.textAlign = engine.TEXT_ALIGN.CENTER;
titleLabel.x = 0;
titleLabel.y = props.prizeName_Ypos;
titleLabel.text = this.fixTitle(res[this._prizeIndex].name);
tmpNode.addChild(titleLabel)
this._prizeIndex ++ ;
this._boxArray.push(tmpNode);
turnTableNode.addChild(tmpNode);
}
}
turnTableNode.x = (750 - (this._singleNodeWidth*3 + this._horizontal_X*2))/2;
}
setNodeOrder(){
let tmpNodeArray = [];
for (let index = 0; index < this.turntableOrder.length; index++) {
let order = this.turntableOrder[index];
tmpNodeArray.push(this._boxArray[order-1]);
}
this._boxArray = tmpNodeArray;
}
fixTitle(name){
if(!name){
return ""
}
if(name.split("").length<props.prizeName_maxLength){
return name
}
let n = ""
for(let i=0;i<props.prizeName_retainLength;i++){
n += name.split("")[i]
}
n+="..."
return n
}
getImage(resName,alpha){
let tmpImage = new engine.Sprite(getTextureByName(resName));
tmpImage.x = 0
tmpImage.y = 0
tmpImage.alpha = alpha;
tmpImage.name = resName;
return tmpImage;
}
automaticRotate(){
console.log('enter the automatic rotate');
let tmpCheckNode = this._boxArray[this._boxIndex].getChildByName('checked');
this.tweenTime = 1000;
if(!this.automaticFlag){
this._boxIndex = 0;
this.tweenTime = props.tweenTime || 200;
engine.Tween.removeTweens(tmpCheckNode);return}
engine.Tween.get(tmpCheckNode)
.to({alpha:1},this.tweenTime/2)
.to({alpha:0},this.tweenTime/2)
.call(()=>{
this._boxIndex ++;
if(this._boxIndex >= this._boxArray.length){
this._boxIndex = 0;
// this.circleNumber++;
}
this.automaticRotate();
})
}
startDraw(){
this.automaticFlag = false;
let tmpCheckNode = this._boxArray[this._boxIndex].getChildByName('checked');
if(this.isStop){engine.Tween.removeTweens(tmpCheckNode);return}
if(this.slowDown)
{
if(this._boxIndex != this.getNodeIndexOFprize()){
this.tweenTime += this.slowTweenTime;
}else{
this.isStop = true;
this.twinkle(tmpCheckNode);
this.automaticFlag = true;
}
}
engine.Tween.get(tmpCheckNode)
.to({alpha:1},this.tweenTime/2)
.to({alpha:0},this.tweenTime/2)
.call(()=>{
if(this.circleNumber >= props.circleNumber && this.getSlowStart() == this._boxIndex){
this.slowDown = true;
}
this._boxIndex ++;
if(this._boxIndex >= this._boxArray.length){
this._boxIndex = 0;
this.circleNumber++;
}
this.startDraw();
})
}
//获取开始减速的下标
private getSlowStart(){
if(this.recordID < 0)return -1;
let tmpIndex = this.getNodeIndexOFprize();
if(tmpIndex < 4){
return tmpIndex + 4;
}else{
return tmpIndex - 4
}
}
//获取奖品节点下标
getNodeIndexOFprize(){
if(this.recordID < 0)return -1;
for (let index = 0; index < this._boxArray.length; index++) {
let element = this._boxArray[index];
if(element.prizeID === this.recordID){
return index;
}
}
return -1;
}
//中奖节点闪烁
twinkle(tmpNode){
engine.Tween.removeTweens(tmpNode)
let twinkleTime = 1;
engine.Tween.get(tmpNode, {loop:true})
.to({alpha:0}, 30)
.to({alpha:1}, 30)
.call(()=>{
if(twinkleTime > 5){
engine.Tween.removeTweens(tmpNode);
engine.globalEvent.dispatchEvent('jiugong-turntable-change-over')
return;
}else{
twinkleTime++;
}
})
}
setRecordID(prizeID){
this.recordID = prizeID;
}
reset(){
this._boxArray.forEach(element => {
engine.Tween.removeTweens(element.getChildByName('checked'));
});
this._boxIndex = 0;//当前下标
this.tweenTime = props.tweenTime || 200;//单个动画时间(毫秒)
this.slowTweenTime = props.slowTweenTime || 200;
this.circleNumber = 0;//圈数
this.recordID = -1;//中奖奖品ID
this.boxPrizeIndex = -1;//中奖奖品节点下标
this.slowDown = false;//是否开始缓速
this.isStop = false;
this.automaticFlag = true;
for (let index = 0; index < this._boxArray.length; index++) {
let element = this._boxArray[index];
element.getChildByName('checked').alpha = 0;
}
}
}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function getStage(){
return engine.gameStage.stage;
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-20.
*/
import {GameWrapper} from "./game/GameWrapper";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new GameWrapper();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
export class Buried {
appId;
consumerId;
oaId;
/**
* 初始化
*/
static init() {
// appId = window["appId"];
// oaId = window["projectId"];
this.appId = window.CFG.appID;
this.oaId = window.CFG.projectId;
}
/**
* 创建dpm埋点数据
* @param {string} dpm 点击埋点
* @param {string} dcm 曝光埋点
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
static createExposure(dpm, dcm, embedDomain = '//embedlog.duiba.com.cn') {
let dom
dom = "1.0.0.0"
const exposure = {
dpm: dpm,
dcm: dcm,
// dom: dom,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
}
/**
* dpm拼接
* @param pageId 页面ID
* @param area 区域
* @param dpm 埋点号
* @returns {string}
*/
static connectDpm(pageId, area, dpm) {
return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;
}
/**
* dcm拼接
* @param typeId 类型ID
* @param contentInfo 内容信息
* @param dcm 埋点号
* @returns {string}
*/
static connectDcm(typeId, contentInfo, dcm) {
return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;
}
/**
* 插件dcm拼接
* @param plugId 插件ID
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
static connectPlugDcm(plugId, type) {
return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;
}
/**
* 活动dcm拼接
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
static connectActivityDcm(type) {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
}
}
import { Buried } from "./Buried";
export class NetBuried {
// constructor() { }
exposure = []
dpm = []
dcm = []
showLog(i, d) {
var appId = window.CFG.appID || 77208;
var oaId = window.CFG.projectId;
if (d) {
this.dpm[i] = `${appId}.110.${i}.${d}`;
} else {
this.dpm[i] = `${appId}.110.${i}.1`;
}
this.dcm[i] = `202.${oaId}.0.0`;
this.exposure[i] = Buried.createExposure(this.dpm[i], this.dcm[i]);
this._showLog(this.exposure[i]);
}
clickLog(i, d) {
var appId = window.CFG.appID || 77208;
var oaId = window.CFG.projectId;
if (d) {
this.dpm[i] = `${appId}.110.${i}.${d}`;
} else {
this.dpm[i] = `${appId}.110.${i}.1`;
}
this.dcm[i] = `202.${oaId}.0.0`;
this.exposure[i] = Buried.createExposure(this.dpm[i], this.dcm[i]);
this._clickLog(this.exposure[i]);
}
/**
* 兑吧点击埋点
* @param {IExposureData} exposure
*/
_clickLog(exposure) {
const net = {
name: 'clickLog',
uri: '/log/click',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
this.send(net);
}
/**
* 兑吧曝光埋点
* @param {IExposureData} exposure
*/
_showLog(exposure) {
const net = {
name: 'showLog',
uri: exposure.domain + '/exposure/standard',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
this.send(net);
}
/**
* 发送请求
* @param net
*/
send(net) {
let realUrl = net.uri;
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if (net.addUrl) {
realUrl += net.addUrl;
}
window['$'].ajax({
type: net.type,
url: realUrl,
dataType: net.dataType,
data: net.param,
async: true,
success: (result) => {
},
error: (message) => {
}
});
}
}
\ No newline at end of file
/**
* Created by renjianfeng on 2020-03-13.
*/
const customId = 'superman';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const { props: propsOption, assets } = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
properties: {
x: 0,
y: 0,
}
}],
customs: [],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-setProjectId',{projectId:"wegg",appId:"77205"})
// },1000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-ActLabel',{type:2})
// },1000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-ActLabel',{type:3})
// },2000);
// // const d = engine.gameStage.sceneContainer.getChildAt(0);
// // engine.gameStage.sceneContainer.getChildAt(0).x = (d.stage.width-props.W)/2;
// // engine.gameStage.sceneContainer.getChildAt(0).y = (d.stage.height-props.H)/2;
// }, 3000);
// setTimeout(()=>{
// engine.globalEvent.dispatchEvent("pictures-reset",{})
// },10000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-start', {
// picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png",
// // picUrl: "http://yun.duiba.com.cn/aurora/assets/d23e73d37ec01931e48cbd0a4095367044c5675c.png"
// blockUrl: "888"
// });
// }, 30*1000);
});
// engine.globalEvent.addEventListener('pictures-game-fail', (e) => {
// console.log(e.type, e.data);
// });
// engine.globalEvent.addEventListener('pictures-game-success', (e) => {
// console.log(e.type, e.data);
// });
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: gray;
}
.game-container{
width: 100%;
height: 100%;
line-height:0;
font-size:0;
}
</style>
</head>
<body>
<div id="game-container" class="game-container"></div>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/engine.1de84ff79dba19e949088de63aa75af51a515e5c.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"></script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<!-- <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script> -->
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "玩家icon",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "888",
"ext": ".png"
},
{
"name": "雨滴",
"url": "//yun.duiba.com.cn/aurora/assets/8564c8c9be3aead71b05a0bab8d7d07ac3f778a1.png",
"uuid": "264a6192-d7bf-45e8-8f15-6ba2c439a532",
"ext": ".png"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/171e92283cd13c013ee1b76d28d252ff08815d47.png",
"uuid": "eb88b42d-e151-4c1b-94b9-7c16f7bfac29",
"ext": ".png"
},
{
"name": "石块",
"url": "//yun.duiba.com.cn/aurora/assets/99b0af0c59fe79a415a3f032149cfacc27e3ac2c.png",
"uuid": "ab1bdabc-21ba-46bf-9299-6c638f766c88",
"ext": ".png"
},
{
"name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga",
"uuid": "b521bf94-20e1-44dd-8eca-d24996cbaeae",
"ext": ".svga"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
"uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
"ext": ".svga"
},
{
"name": "玩家",
"url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
"uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
"ext": ".svga"
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global.superman = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
var GTime = (function () {
function GTime() {
}
GTime.getTimestamp = function () {
return new Date().getTime();
};
GTime.GetTimeHMS = function (time) {
var t;
var h = Math.floor(time / 3600);
var hstr = h > 9 ? h : '0' + h;
var m = Math.floor((time % 3600) / 60);
var mstr = m > 9 ? m : '0' + m;
var s = Math.floor(time % 60);
var sstr = s > 9 ? s : '0' + s;
t = hstr + ':' + mstr + ':' + sstr;
return t;
};
GTime.GetTimeMS = function (time) {
var t;
var m = Math.floor((time % 3600) / 60);
var mstr = m > 9 ? m : '0' + m;
var s = Math.floor(time % 60);
var sstr = s > 9 ? s : '0' + s;
t = mstr + ':' + sstr;
return t;
};
return GTime;
}());
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function createSvga(name, anchorName) {
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
function clickLog(exposure) {
var net = {
name: 'clickLog',
uri: '/log/click',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
function showLog(exposure) {
var net = {
name: 'showLog',
uri: exposure.domain + '/exposure/standard',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
function send(net) {
var gTime = '?_=' + GTime.getTimestamp();
var realUrl = net.uri;
if (realUrl.indexOf('?') != -1) {
gTime = '&_=' + GTime.getTimestamp();
}
if (net.addUrl) {
realUrl += net.addUrl;
}
window['$'].ajax({
type: net.type,
url: realUrl,
cache: false,
dataType: net.dataType,
data: net.param,
async: true,
});
}
var Buried = (function () {
function Buried() {
}
Buried.init = function () {
};
Buried.createExposure = function (dpm, dcm, embedDomain) {
if (embedDomain === void 0) { embedDomain = '//embedlog.duiba.com.cn'; }
var exposure = {
dpm: dpm,
dcm: dcm,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
};
Buried.connectDpm = function (pageId, area, dpm) {
return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;
};
Buried.connectDcm = function (typeId, contentInfo, dcm) {
return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;
};
Buried.connectPlugDcm = function (plugId, type) {
return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;
};
Buried.connectActivityDcm = function (type) {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
};
Buried.appId = '0';
Buried.oaId = "0";
return Buried;
}());
var getlogItem = function (i) {
var Dpm = Buried.connectDpm(110, i, 1);
var Dcm = Buried.connectDcm(202, 0, 0);
return Buried.createExposure(Dpm, Dcm);
};
var QAText = (function (_super) {
tslib.__extends(QAText, _super);
function QAText() {
var _this = _super.call(this) || this;
_this.bg = [];
_this.bgTexture = [];
_this.QLabel = [];
_this.ALabel = [];
_this.addEventListener(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
_this.init();
return _this;
}
QAText.prototype.init = function () {
var that = this;
that.bigBgOrigin = new engine.Point();
that.smallBgOrigin = new engine.Point();
that.QText = props.QTextStrArr.split(',');
console.log(props.QTextStrArr.split(','));
that.AText = props.ATextStrArr.split(',');
console.log(props.ATextStrArr.split(','));
that.ActText = props.ACTTextStrArr.split(',');
console.log(props.ACTTextStrArr.split(','));
};
QAText.prototype.setup = function () {
var that = this;
that.removeEventListener(engine.Event.ADDED_TO_STAGE, that.setup, that);
that.hideText();
that.setGroup();
that.setQLabel();
that.setALabel();
that.setActLabel();
that.setEvent();
};
QAText.prototype.setEvent = function () {
};
QAText.prototype.setGroup = function () {
var that = this;
that.QlabelGroup = new engine.Sprite();
that.addChild(that.QlabelGroup);
that.QlabelGroup.visible = false;
that.AlabelGroup = new engine.Sprite();
that.addChild(that.AlabelGroup);
that.AlabelGroup.visible = false;
that.ActlabelGroup = new engine.Sprite();
that.addChild(that.ActlabelGroup);
that.ActlabelGroup.visible = false;
for (var i = 0; i < 3; i++) {
var bg = new engine.Image();
if (i < 2) {
bg.texture = getTexture("21d8b7ca-6ed3-44e5-ada0-f0433f471ac9");
if (i == 0) {
that.QlabelGroup.addChild(bg);
}
else {
that.AlabelGroup.addChild(bg);
}
}
else {
bg.texture = getTexture("9e4d1860-4762-4ac1-bc44-b3dd8fb307a6");
that.ActlabelGroup.addChild(bg);
}
that.bg.push(bg);
}
that.closeBtn = new engine.Image(getTexture("76f2c800-2174-4a90-ad6d-5853e95eb144"));
that.addChild(that.closeBtn);
that.closeBtn.mouseEnabled = true;
that.closeBtn.addEventListener(engine.MouseEvent.CLICK, that.hideText, that);
that.QScrList = new engine.ScrollView();
that.QlabelGroup.addChild(that.QScrList);
that.QScrList.x = 30;
that.QScrList.y = 85;
that.QScrList.width = that.bg[0].width - 50;
that.QScrList.height = 195;
};
QAText.prototype.setQText = function (e) {
console.log('engine.Event.UPDATE_DATA', e);
e.target.getChildByName('问题文本').text = e.data;
e.target.name = 'Q_' + e.data.substring(0, 1);
};
QAText.prototype.setQLabel = function () {
var that = this;
var label = new engine.Label();
label.text = '你想问哪些问题?';
label.x = 30;
label.y = 30;
label.size = 34;
label.width = that.bg[0].width - 50;
that.QlabelGroup.addChild(label);
for (var i = 0; i < that.QText.length; i++) {
var img = new engine.Image(getTexture("8546dcf7-a6e8-4ba2-89f7-b929118e473a"));
that.QScrList.addChild(img);
img.name = 'Q_' + i;
img.y = 5 + i * 50;
img.x = that.QScrList.width - img.width;
img.mouseEnabled = true;
img.addEventListener(engine.MouseEvent.CLICK, that.showALabelGroup, that);
var label_1 = new engine.Label();
that.QScrList.addChild(label_1);
label_1.name = 'Q_' + i;
label_1.text = that.QText[i];
label_1.fillColor = "#d36800";
label_1.size = 24;
label_1.width = img.x;
label_1.height = 50;
label_1.y = img.y;
label_1.mouseEnabled = true;
label_1.addEventListener(engine.MouseEvent.CLICK, that.showALabelGroup, that);
that.QLabel.push(label_1);
}
};
QAText.prototype.setALabel = function () {
var that = this;
that.AScrView = new engine.ScrollView();
that.AlabelGroup.addChild(that.AScrView);
that.AScrView.x = 32;
that.AScrView.y = 62;
that.AScrView.width = that.bg[0].width - 55;
that.AScrView.height = that.bg[0].height - 120;
for (var i = 0; i < 2; i++) {
var label = new engine.Label();
label.x = 0;
label.y = 5 + i * 40;
label.size = 24;
label.width = that.AScrView.width;
label.lineSpacing = 11;
label.lineType = engine.TEXT_lINETYPE.MULTI;
that.AScrView.addChild(label);
that.ALabel.push(label);
}
that.returnBtn = new engine.Image(getTexture('2a555da9-dc05-4046-a5fb-551f0c2692fa'));
that.AlabelGroup.addChild(that.returnBtn);
that.returnBtn.x = 18;
that.returnBtn.y = 20;
that.returnBtn.mouseEnabled = true;
that.returnBtn.addEventListener(engine.MouseEvent.CLICK, that.showQLabelGroup, that);
};
QAText.prototype.setActLabel = function () {
var that = this;
that.ActLabel = new engine.Label();
that.ActlabelGroup.addChild(that.ActLabel);
that.ActLabel.x = 0;
that.ActLabel.y = that.getSmallBgSize().h * 0.5 - 24;
that.ActLabel.width = that.getSmallBgSize().w;
that.ActLabel.textAlign = engine.TEXT_ALIGN.CENTER;
that.ActLabel.size = 24;
};
QAText.prototype.showQLabelGroup = function (e) {
var that = this;
if (e && e.target == that.returnBtn) {
if (props.type == 0) {
clickLog(getlogItem(30));
}
else if (props.type == 1) {
clickLog(getlogItem(80));
}
}
that.x = that.bigBgOrigin.x;
that.y = that.bigBgOrigin.y;
that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;
that.closeBtn.y = -10;
that.AlabelGroup.visible = false;
that.ActlabelGroup.visible = false;
that.QlabelGroup.visible = true;
that.QScrList.scrollTo(-1);
that.showText();
};
QAText.prototype.showALabelGroup = function (e) {
console.log("展示答案" + e.target.name);
var that = this;
that.x = that.bigBgOrigin.x;
that.y = that.bigBgOrigin.y;
that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;
that.closeBtn.y = -10;
var str = e.target.name.split('_');
if (str && str.length > 0)
var index = str[1];
that.ALabel[0].text = that.QText[index];
that.ALabel[1].text = that.AText[index];
that.QlabelGroup.visible = false;
that.ActlabelGroup.visible = false;
that.AlabelGroup.visible = true;
this.AScrView.scrollTo(-1);
that.showText();
if (props.type == 0) {
showLog(getlogItem(30));
}
else if (props.type == 1) {
showLog(getlogItem(80));
}
};
QAText.prototype.showActLabelGroup = function (type) {
var index = type;
var that = this;
that.x = that.smallBgOrigin.x;
that.y = that.smallBgOrigin.y;
that.closeBtn.x = that.bg[2].width - that.closeBtn.width - 10;
that.closeBtn.y = 20;
that.ActLabel.text = that.ActText[index];
that.QlabelGroup.visible = false;
that.AlabelGroup.visible = false;
that.ActlabelGroup.visible = true;
that.showText();
if (!that.actLabelTimer) {
that.actLabelTimer = setTimeout(function () {
that.ActlabelGroup.visible = false;
that.hideText();
clearTimeout(that.actLabelTimer);
}, 3000);
}
else {
clearTimeout(that.actLabelTimer);
that.actLabelTimer = setTimeout(function () {
that.hideText();
that.ActlabelGroup.visible = false;
}, 3000);
}
};
QAText.prototype.setBigBgPositon = function (x, y) {
this.bigBgOrigin.x = x;
this.bigBgOrigin.y = y;
};
QAText.prototype.setSmallBgPositon = function (x, y) {
this.smallBgOrigin.x = x;
this.smallBgOrigin.y = y;
};
QAText.prototype.getBigBgSize = function () {
return { w: this.bg[0].width, h: this.bg[0].height };
};
QAText.prototype.getSmallBgSize = function () {
return { w: this.bg[2].width, h: this.bg[2].height };
};
QAText.prototype.showText = function () {
this.visible = true;
};
QAText.prototype.hideText = function () {
if (this.actLabelTimer) {
clearTimeout(this.actLabelTimer);
}
engine.globalEvent.dispatchEvent("hideRect");
this.visible = false;
};
return QAText;
}(engine.Sprite));
var TestView = (function (_super) {
tslib.__extends(TestView, _super);
function TestView() {
var _this = _super.call(this) || this;
_this.qaisOpen = false;
_this.addEventListener(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
TestView.prototype.setup = function () {
var that = this;
that.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);
that.rect = new engine.Rect();
that.rect.fillColor = "#000000";
that.rect.alpha = 0.7;
that.rect.width = 2000;
that.rect.height = 2000;
that.rect.visible = false;
that.addChild(that.rect);
that.breathSvga = createSvga("常规呼吸动作");
that.waveSvga = createSvga("招手");
that.waveSvga.visible = false;
that.breathSvga.visible = true;
that.breathSvga.mouseEnabled = that.waveSvga.mouseEnabled = true;
that.addChild(that.breathSvga);
that.addChild(that.waveSvga);
that.breathSvga.x = that.waveSvga.x = engine.gameStage.stage.width - 178 * 0.7;
that.breathSvga.y = that.waveSvga.y = engine.gameStage.stage.height / 3 * 2 - 60;
that.breathSvga.gotoAndPlay(1);
that.breathSvga.scaleX = that.breathSvga.scaleY = 0.7;
that.waveSvga.scaleX = that.waveSvga.scaleY = 0.7;
that.QAText = new QAText();
that.addChild(that.QAText);
that.QAText.setBigBgPositon(engine.gameStage.stage.width - that.QAText.getBigBgSize().w - 35, engine.gameStage.stage.height / 3 * 2 - 60 - that.QAText.getBigBgSize().h);
that.QAText.setSmallBgPositon(engine.gameStage.stage.width - that.QAText.getSmallBgSize().w - 35, engine.gameStage.stage.height / 3 * 2 - 60 - that.QAText.getSmallBgSize().h);
that.addEvnt();
};
TestView.prototype.addEvnt = function () {
var that = this;
that.breathSvga.addEventListener(engine.MouseEvent.CLICK, that.touchSuperManImg, that);
that.waveSvga.addEventListener(engine.MouseEvent.CLICK, that.touchSuperManImg, that);
engine.globalEvent.addEventListener("pictures-ActLabel", that.showActLabelGroup, that);
engine.globalEvent.addEventListener("pictures-supermanAnim", that.supermanAnim, that);
engine.globalEvent.addEventListener("hideRect", function () { that.rect.visible = false; }, that);
};
TestView.prototype.supermanAnim = function () {
};
TestView.prototype.touchSuperManImg = function (e) {
console.log("点击蛋黄超人");
var that = this;
if (that.QAText.visible)
return;
if (props.type == 0) {
clickLog(getlogItem(17));
}
else if (props.type == 1) {
clickLog(getlogItem(51));
}
that.showWaveSvga();
that.QAText.showQLabelGroup(null);
that.rect.visible = true;
};
TestView.prototype.showActLabelGroup = function (e) {
var that = this;
that.showWaveSvga();
that.QAText.showActLabelGroup(parseInt(e.data.type));
};
TestView.prototype.showWaveSvga = function () {
var that = this;
that.breathSvga.visible = false;
that.waveSvga.visible = true;
that.waveSvga.play(false, false);
that.waveSvga.once(engine.Event.END_FRAME, function () {
that.waveSvga.visible = false;
that.breathSvga.gotoAndPlay(1);
that.breathSvga.visible = true;
}, that);
};
return TestView;
}(engine.Container));
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
function GameWrapper() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener("pictures-setProjectId", _this.setProjectId, _this);
var testView = _this._testView = new TestView();
_this.addChild(testView);
return _this;
}
GameWrapper.prototype.setProjectId = function (event) {
injectProps(event.data);
Buried.oaId = event.data.projectId;
Buried.appId = event.data.appId;
};
GameWrapper.prototype.start = function (event) {
injectProps(event.data);
};
GameWrapper.prototype.stop = function (event) {
};
return GameWrapper;
}(engine.Container));
function index (props) {
prepareProps();
injectProps(props);
var instance = new GameWrapper();
return instance;
}
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/superman/src/props.ts","src/custom/superman/src/game/GTime.ts","src/custom/superman/src/game/utils.ts","src/custom/superman/src/game/Buried.ts","src/custom/superman/src/game/getlogItem.ts","src/custom/superman/src/game/QAText.ts","src/custom/superman/src/game/TestView.ts","src/custom/superman/src/game/GameWrapper.ts","src/custom/superman/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\r\n\tengine.injectProp(props, metaProps);\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","\r\nexport class GTime {\r\n /**\r\n * 获取当前时间戳\r\n * @returns {number}\r\n */\r\n public static getTimestamp(): number {\r\n return new Date().getTime();\r\n }\r\n\r\n /**\r\n * 转化时分秒\r\n * @param time \r\n */\r\n public static GetTimeHMS(time:number):string{\r\n let t;\r\n\r\n let h = Math.floor(time / 3600);\r\n let hstr = h > 9 ? h : '0' + h;\r\n\r\n let m = Math.floor((time % 3600) / 60);\r\n let mstr = m > 9 ? m : '0' + m;\r\n\r\n let s = Math.floor(time % 60);\r\n let sstr = s > 9 ? s : '0' + s;\r\n\r\n t = hstr + ':' + mstr + ':' + sstr;\r\n\r\n return t;\r\n }\r\n\r\n /**\r\n * 转化分秒\r\n * @param time \r\n */\r\n public static GetTimeMS(time:number):string{\r\n let t;\r\n\r\n let m = Math.floor((time % 3600) / 60);\r\n let mstr = m > 9 ? m : '0' + m;\r\n\r\n let s = Math.floor(time % 60);\r\n let sstr = s > 9 ? s : '0' + s;\r\n\r\n t = mstr + ':' + sstr;\r\n\r\n return t;\r\n }\r\n}","/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\nimport {IExposureData} from './IExposureData'\r\nimport {INetData} from './INetData'\r\nimport { GTime } from './GTime';\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n\r\nexport function getIndexFromRC(row,col,maxCol){\r\n\tlet index;\r\n\tindex = row * maxCol + col ;\r\n\treturn index\r\n}\r\n\r\n\r\n\r\n\r\nexport function getRandomArray(array){\r\n\tarray.sort(function() {\r\n\t\treturn .5 - Math.random();\r\n\t});\r\n}\r\n\r\n/**\r\n * 兑吧点击埋点\r\n * @param {IExposureData} exposure\r\n */\r\n export function clickLog(exposure: IExposureData): void {\r\n const net: INetData = {\r\n name: 'clickLog',\r\n uri: '/log/click',\r\n type: 'get',\r\n dataType: 'jsonp',\r\n param: exposure,\r\n callback: null,\r\n hideMsg: true\r\n };\r\n send(net);\r\n }\r\n\r\n /**\r\n * 兑吧曝光埋点\r\n * @param {IExposureData} exposure\r\n */\r\n export function showLog(exposure: IExposureData): void {\r\n const net: INetData = {\r\n name: 'showLog',\r\n uri: exposure.domain + '/exposure/standard',\r\n type: 'get',\r\n dataType: 'jsonp',\r\n param: exposure,\r\n callback: null,\r\n hideMsg: true\r\n };\r\n send(net);\r\n }\r\n\r\n /**\r\n * 发送请求\r\n * @param net \r\n */\r\n export function send(net: INetData): void {\r\n let gTime: string = '?_=' + GTime.getTimestamp();\r\n let realUrl: string = net.uri;\r\n if (realUrl.indexOf('?') != -1) {\r\n gTime = '&_=' + GTime.getTimestamp();\r\n }\r\n\r\n //url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)\r\n if (net.addUrl) {\r\n realUrl += net.addUrl;\r\n }\r\n\r\n window['$'].ajax({\r\n type: net.type,\r\n // url: realUrl + gTime,\r\n url: realUrl,\r\n cache: false,\r\n dataType: net.dataType,\r\n data: net.param,\r\n async: true,\r\n // success: (result) => {\r\n // this.onResponse(net, result);\r\n // },\r\n // error: (message) => {\r\n // this.onError(net);\r\n // }\r\n });\r\n }\r\n\r\n ","// import { DataManager } from './../manager/DataManager';\r\nimport { IExposureData } from './IExposureData';\r\n// import { IExposureData } from '..';\r\n\r\nexport class Buried {\r\n public static appId: string = '0';\r\n public static consumerId: number;\r\n public static oaId: string = \"0\";\r\n\r\n /**\r\n * 初始化\r\n */\r\n public static init(): void {\r\n // if(DataManager.ins.gameCfgData) {\r\n // this.appId = DataManager.ins.gameCfgData.appInfo.appId;\r\n // this.consumerId = DataManager.ins.getInfoData.consumerId;\r\n // this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId;\r\n // } else if(DataManager.ins.customCfgData){\r\n // this.appId = DataManager.ins.customCfgData.appId;\r\n // this.consumerId = DataManager.ins.customCfgData.consumerId;\r\n // this.oaId = DataManager.ins.customCfgData.oaId ;\r\n // } else if(DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId){\r\n // this.appId = DataManager.ins.petIndexData.appId;\r\n // this.consumerId = DataManager.ins.petIndexData.consumerId;\r\n // this.oaId = DataManager.ins.petIndexData.activityId ;\r\n // } else if(DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId){\r\n // this.appId = DataManager.ins.petsIndexData.appId;\r\n // this.consumerId = DataManager.ins.petsIndexData.consumerId;\r\n // this.oaId = DataManager.ins.petsIndexData.activityId ;\r\n // }\r\n }\r\n\r\n /**\r\n * 创建dpm埋点数据\r\n * @param {string} dpm 点击埋点\r\n * @param {string} dcm 曝光埋点\r\n * @param {string} embedDomain 埋点域名\r\n * @returns {{dpm: string; consumerId: number; domain: string; appId: number}}\r\n */\r\n public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {\r\n const exposure: any = {\r\n dpm: dpm,\r\n dcm: dcm,\r\n appId: Buried.appId,\r\n domain: embedDomain\r\n };\r\n return exposure;\r\n }\r\n\r\n /**\r\n * dpm拼接\r\n * @param pageId 页面ID \r\n * @param area 区域\r\n * @param dpm 埋点号\r\n * @returns {string}\r\n */\r\n public static connectDpm(pageId: number, area: number, dpm: number): string {\r\n return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;\r\n }\r\n\r\n /**\r\n * dcm拼接\r\n * @param typeId 类型ID\r\n * @param contentInfo 内容信息\r\n * @param dcm 埋点号\r\n * @returns {string}\r\n */\r\n public static connectDcm(typeId: number, contentInfo: number, dcm: number): string {\r\n return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;\r\n }\r\n\r\n /**\r\n * 插件dcm拼接\r\n * @param plugId 插件ID\r\n * @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面\r\n * @returns {string}\r\n */\r\n public static connectPlugDcm(plugId: number, type: number): string {\r\n return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;\r\n }\r\n\r\n /**\r\n * 活动dcm拼接\r\n * @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面\r\n * @returns {string}\r\n */\r\n public static connectActivityDcm(type: number): string {\r\n return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;\r\n }\r\n\r\n}\r\n","import { Buried } from \"./Buried\";\r\nimport {props} from '../props'\r\n\r\nexport const getlogItem = (i) =>{\r\n const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点\r\n const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点\r\n return Buried.createExposure(Dpm, Dcm);\r\n};","import { getTexture, clickLog, showLog } from \"./utils\";\r\nimport {props, injectProps} from \"../props\";\r\nimport { getlogItem } from \"./getlogItem\";\r\n\r\nexport default class QAText extends engine.Sprite{\r\n bg:engine.Image[] = [];\r\n bgTexture:engine.Texture[] = [];\r\n titelLabel:engine.Label;\r\n QLabel:engine.Label[] = [];\r\n ALabel:engine.Label[] = [];\r\n ActLabel:engine.Label;\r\n QlabelGroup:engine.Sprite;\r\n AlabelGroup:engine.Sprite;\r\n ActlabelGroup:engine.Sprite;\r\n QText:string[]; //问题文本组\r\n AText:string[]; //回答文本组\r\n ActText:string[]; //互动文本组\r\n bigBgOrigin:engine.Point;\r\n smallBgOrigin:engine.Point;\r\n returnBtn:engine.Image; //回答文本组的返回按钮\r\n closeBtn:engine.Image; //关闭按钮\r\n QScrList:engine.ScrollView;//问题滚动视图\r\n AScrView:engine.ScrollView;//答案滚动视图\r\n\r\n actLabelTimer;\r\n\r\n constructor(){\r\n super();\r\n this.addEventListener(engine.Event.ADDED_TO_STAGE,this.setup,this)\r\n this.init();\r\n }\r\n\r\n init(){\r\n var that = this; \r\n that.bigBgOrigin = new engine.Point();\r\n that.smallBgOrigin = new engine.Point();\r\n that.QText = props.QTextStrArr.split(',');\r\n //that.QText.unshift('你想问哪些问题?')\r\n console.log(props.QTextStrArr.split(','));\r\n\r\n that.AText = props.ATextStrArr.split(',')\r\n console.log(props.ATextStrArr.split(','));\r\n \r\n that.ActText = props.ACTTextStrArr.split(',');\r\n console.log(props.ACTTextStrArr.split(','));\r\n }\r\n\r\n setup(){\r\n var that = this;\r\n that.removeEventListener(engine.Event.ADDED_TO_STAGE,that.setup,that);\r\n that.hideText();\r\n that.setGroup();\r\n that.setQLabel();\r\n that.setALabel();\r\n that.setActLabel();\r\n that.setEvent();\r\n }\r\n\r\n setEvent(){\r\n \r\n }\r\n\r\n /**设置各个文本组 */\r\n setGroup(){\r\n var that = this;\r\n //问题文本组\r\n that.QlabelGroup = new engine.Sprite();\r\n // that.QlabelGroup.addChild(that.bg[0]);\r\n that.addChild(that.QlabelGroup);\r\n that.QlabelGroup.visible = false;\r\n \r\n //答案文本组\r\n that.AlabelGroup = new engine.Sprite();\r\n // that.AlabelGroup.addChild(that.bg[1]);\r\n that.addChild(that.AlabelGroup)\r\n that.AlabelGroup.visible = false;\r\n\r\n //互动文本组\r\n that.ActlabelGroup = new engine.Sprite();\r\n // that.ActlabelGroup.addChild(that.bg[1]);\r\n that.addChild(that.ActlabelGroup);\r\n that.ActlabelGroup.visible = false;\r\n \r\n for(let i=0;i<3;i++){\r\n let bg = new engine.Image();\r\n if(i<2){\r\n bg.texture = getTexture(\"21d8b7ca-6ed3-44e5-ada0-f0433f471ac9\"); //大气泡\r\n if(i==0){\r\n that.QlabelGroup.addChild(bg);\r\n }else{\r\n that.AlabelGroup.addChild(bg);\r\n }\r\n }\r\n else{\r\n bg.texture = getTexture(\"9e4d1860-4762-4ac1-bc44-b3dd8fb307a6\"); //小气泡\r\n that.ActlabelGroup.addChild(bg);\r\n }\r\n that.bg.push(bg);\r\n }\r\n\r\n that.closeBtn = new engine.Image(getTexture(\"76f2c800-2174-4a90-ad6d-5853e95eb144\"));\r\n that.addChild(that.closeBtn);\r\n that.closeBtn.mouseEnabled = true;\r\n that.closeBtn.addEventListener(engine.MouseEvent.CLICK,that.hideText,that);\r\n\r\n //问题列表\r\n that.QScrList = new engine.ScrollView();\r\n that.QlabelGroup.addChild(that.QScrList);\r\n that.QScrList.x = 30;\r\n that.QScrList.y = 85;\r\n that.QScrList.width = that.bg[0].width-50;\r\n that.QScrList.height = 195;\r\n \r\n }\r\n /**设置列表内问题文本 */\r\n setQText(e){\r\n console.log('engine.Event.UPDATE_DATA', e)\r\n e.target.getChildByName('问题文本').text = e.data;\r\n e.target.name = 'Q_'+ e.data.substring(0,1);\r\n }\r\n\r\n /**设置问题文本组 */\r\n setQLabel(){\r\n var that = this;\r\n let label = new engine.Label();\r\n label.text = '你想问哪些问题?';\r\n label.x = 30;\r\n label.y = 30;\r\n label.size = 34;\r\n label.width = that.bg[0].width-50;\r\n that.QlabelGroup.addChild(label);\r\n for(let i=0;i<that.QText.length;i++){\r\n let img = new engine.Image(getTexture(\"8546dcf7-a6e8-4ba2-89f7-b929118e473a\"))\r\n that.QScrList.addChild(img);\r\n img.name = 'Q_'+i;\r\n img.y = 5 + i*50;\r\n img.x = that.QScrList.width - img.width;\r\n img.mouseEnabled = true;\r\n img.addEventListener(engine.MouseEvent.CLICK,that.showALabelGroup,that);\r\n\r\n let label = new engine.Label();\r\n that.QScrList.addChild(label);\r\n label.name = 'Q_'+i;\r\n label.text = that.QText[i];\r\n label.fillColor = \"#d36800\";\r\n label.size = 24;\r\n label.width = img.x;\r\n label.height = 50;\r\n label.y = img.y;\r\n label.mouseEnabled = true;\r\n label.addEventListener(engine.MouseEvent.CLICK,that.showALabelGroup,that);\r\n that.QLabel.push(label); \r\n \r\n }\r\n }\r\n\r\n /**设置答案文本 */\r\n setALabel(){\r\n var that = this;\r\n that.AScrView = new engine.ScrollView();\r\n that.AlabelGroup.addChild(that.AScrView);\r\n that.AScrView.x = 32\r\n that.AScrView.y = 62\r\n that.AScrView.width = that.bg[0].width - 55;\r\n that.AScrView.height = that.bg[0].height - 120;\r\n for(let i=0;i<2;i++){\r\n let label = new engine.Label();\r\n label.x = 0\r\n label.y = 5 + i * 40\r\n label.size = 24;\r\n label.width = that.AScrView.width;\r\n label.lineSpacing = 11;\r\n label.lineType = engine.TEXT_lINETYPE.MULTI;\r\n //that.AlabelGroup.addChild(label);\r\n that.AScrView.addChild(label);\r\n that.ALabel.push(label);\r\n }\r\n \r\n that.returnBtn = new engine.Image(getTexture('2a555da9-dc05-4046-a5fb-551f0c2692fa'));\r\n that.AlabelGroup.addChild(that.returnBtn);\r\n // that.returnBtn.x = that.bg[1].width - that.returnBtn.width*2;\r\n // that.returnBtn.y = that.bg[1].height - that.returnBtn.height-30;\r\n that.returnBtn.x = 18;\r\n that.returnBtn.y = 20;\r\n\r\n that.returnBtn.mouseEnabled = true;\r\n that.returnBtn.addEventListener(engine.MouseEvent.CLICK,that.showQLabelGroup,that);\r\n }\r\n\r\n /**设置互动文本 */\r\n setActLabel(){\r\n var that = this;\r\n that.ActLabel = new engine.Label();\r\n that.ActlabelGroup.addChild(that.ActLabel);\r\n that.ActLabel.x = 0;\r\n that.ActLabel.y = that.getSmallBgSize().h*0.5-24;\r\n that.ActLabel.width = that.getSmallBgSize().w;\r\n // that.ActLabel.height = that.getSmallBgSize().h;\r\n that.ActLabel.textAlign = engine.TEXT_ALIGN.CENTER;\r\n // that.ActLabel.verticalAlign = engine.VERTICAL_ALIGN.MIDDLE;\r\n that.ActLabel.size = 24;\r\n }\r\n\r\n /**展示问题组 */\r\n showQLabelGroup(e:engine.MouseEvent){\r\n var that = this;\r\n if(e&&e.target == that.returnBtn){\r\n if(props.type == 0){\r\n clickLog(getlogItem(30));\r\n }else if(props.type == 1){\r\n clickLog(getlogItem(80));\r\n }\r\n }\r\n that.x = that.bigBgOrigin.x;\r\n that.y = that.bigBgOrigin.y;\r\n that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;\r\n that.closeBtn.y = -10;\r\n that.AlabelGroup.visible = false;\r\n that.ActlabelGroup.visible = false;\r\n that.QlabelGroup.visible = true;\r\n that.QScrList.scrollTo(-1);\r\n that.showText();\r\n \r\n }\r\n\r\n /**展示答案组 */\r\n showALabelGroup(e:engine.MouseEvent){\r\n console.log(\"展示答案\"+e.target.name);\r\n var that = this;\r\n that.x = that.bigBgOrigin.x;\r\n that.y = that.bigBgOrigin.y;\r\n that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;\r\n that.closeBtn.y = -10;\r\n\r\n let str = e.target.name.split('_');\r\n if(str&&str.length>0)\r\n var index = str[1];\r\n that.ALabel[0].text = that.QText[index];\r\n //that.ALabel[0].visible = false;//不显示问题\r\n that.ALabel[1].text = that.AText[index];\r\n that.QlabelGroup.visible = false;\r\n that.ActlabelGroup.visible = false;\r\n that.AlabelGroup.visible = true;\r\n this.AScrView.scrollTo(-1); \r\n that.showText();\r\n if(props.type == 0){\r\n showLog(getlogItem(30));\r\n }else if(props.type == 1){\r\n showLog(getlogItem(80));\r\n }\r\n }\r\n\r\n /**展示互动组 */\r\n showActLabelGroup(type){\r\n // injectProps(event.data);\r\n let index = type;\r\n var that = this;\r\n that.x = that.smallBgOrigin.x;\r\n that.y = that.smallBgOrigin.y;\r\n that.closeBtn.x = that.bg[2].width - that.closeBtn.width-10;\r\n that.closeBtn.y = 20;\r\n that.ActLabel.text = that.ActText[index];\r\n that.QlabelGroup.visible = false;\r\n that.AlabelGroup.visible = false;\r\n that.ActlabelGroup.visible = true;\r\n that.showText();\r\n if(!that.actLabelTimer){\r\n that.actLabelTimer = setTimeout(() => {\r\n that.ActlabelGroup.visible = false;\r\n that.hideText();\r\n clearTimeout(that.actLabelTimer)\r\n }, 3000);\r\n }else{\r\n clearTimeout(that.actLabelTimer);\r\n that.actLabelTimer = setTimeout(() => {\r\n that.hideText();\r\n that.ActlabelGroup.visible = false;\r\n }, 3000);\r\n }\r\n \r\n \r\n }\r\n\r\n setBigBgPositon(x:number,y:number){\r\n this.bigBgOrigin.x = x;\r\n this.bigBgOrigin.y = y;\r\n }\r\n\r\n setSmallBgPositon(x:number,y:number){\r\n this.smallBgOrigin.x = x;\r\n this.smallBgOrigin.y = y;\r\n }\r\n\r\n getBigBgSize(){\r\n return {w:this.bg[0].width,h:this.bg[0].height}\r\n }\r\n\r\n getSmallBgSize(){\r\n return {w:this.bg[2].width,h:this.bg[2].height}\r\n }\r\n\r\n showText(){\r\n this.visible = true;\r\n }\r\n\r\n hideText(){\r\n if(this.actLabelTimer){\r\n clearTimeout(this.actLabelTimer);\r\n }\r\n engine.globalEvent.dispatchEvent(\"hideRect\");\r\n this.visible = false;\r\n }\r\n}","import {getTexture, createSvga, showLog, clickLog} from './utils'\r\nimport QAText from './QAText';\r\nimport {getlogItem} from './getlogItem';\r\nimport { props } from '../props';\r\n\r\n\r\nexport default class TestView extends engine.Container{\r\n worldTime:number;\r\n supermanImg:engine.Image;\r\n qaisOpen:boolean = false;\r\n QAText:QAText;\r\n breathSvga:svga.Svga;\r\n waveSvga:svga.Svga;\r\n rect:engine.Rect;\r\n\r\n constructor(){\r\n super()\r\n this.addEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n }\r\n\r\n setup(){\r\n var that = this;\r\n that.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this)\r\n that.rect = new engine.Rect();\r\n that.rect.fillColor = \"#000000\";\r\n that.rect.alpha = 0.7;\r\n that.rect.width = 2000;\r\n that.rect.height = 2000;\r\n that.rect.visible = false;\r\n that.addChild(that.rect);\r\n that.breathSvga = createSvga(\"常规呼吸动作\");\r\n that.waveSvga = createSvga(\"招手\");\r\n that.waveSvga.visible = false;\r\n that.breathSvga.visible = true;\r\n that.breathSvga.mouseEnabled = that.waveSvga.mouseEnabled = true;\r\n that.addChild(that.breathSvga);\r\n that.addChild(that.waveSvga);\r\n that.breathSvga.x = that.waveSvga.x = engine.gameStage.stage.width - 178*0.7; \r\n that.breathSvga.y = that.waveSvga.y = engine.gameStage.stage.height/3*2-60;\r\n that.breathSvga.gotoAndPlay(1);\r\n // that.breathSvga.scale = 0.6;\r\n // that.waveSvga.scale = 0.6;\r\n that.breathSvga.scaleX = that.breathSvga.scaleY = 0.7;\r\n that.waveSvga.scaleX = that.waveSvga.scaleY = 0.7;\r\n \r\n that.QAText = new QAText();\r\n that.addChild(that.QAText);\r\n that.QAText.setBigBgPositon(engine.gameStage.stage.width - that.QAText.getBigBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getBigBgSize().h)\r\n that.QAText.setSmallBgPositon(engine.gameStage.stage.width - that.QAText.getSmallBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getSmallBgSize().h)\r\n\r\n that.addEvnt();\r\n }\r\n\r\n addEvnt(){\r\n var that = this;\r\n // that.supermanImg.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);\r\n that.breathSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);\r\n that.waveSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);\r\n engine.globalEvent.addEventListener(\"pictures-ActLabel\",that.showActLabelGroup,that);\r\n engine.globalEvent.addEventListener(\"pictures-supermanAnim\",that.supermanAnim,that);\r\n engine.globalEvent.addEventListener(\"hideRect\",()=>{that.rect.visible = false},that);\r\n }\r\n\r\n /**蛋黄超人动效 */\r\n supermanAnim(){\r\n\r\n }\r\n\r\n /**点击蛋黄超人 */\r\n touchSuperManImg(e:engine.MouseEvent){\r\n console.log(\"点击蛋黄超人\")\r\n var that = this;\r\n if(that.QAText.visible) return;\r\n if(props.type == 0){\r\n clickLog(getlogItem(17))\r\n }else if(props.type == 1){\r\n clickLog(getlogItem(51))\r\n }\r\n //蛋黄超人动效\r\n that.showWaveSvga();\r\n that.QAText.showQLabelGroup(null);\r\n that.rect.visible = true;\r\n }\r\n\r\n /**展示互动文案组 */\r\n showActLabelGroup(e:engine.Event){\r\n var that = this;\r\n //蛋黄超人动效\r\n that.showWaveSvga();\r\n that.QAText.showActLabelGroup(parseInt(e.data.type))\r\n }\r\n\r\n showWaveSvga(){\r\n var that = this;\r\n that.breathSvga.visible = false;\r\n that.waveSvga.visible = true;\r\n that.waveSvga.play(false,false);\r\n that.waveSvga.once(engine.Event.END_FRAME,()=>{\r\n that.waveSvga.visible = false;\r\n that.breathSvga.gotoAndPlay(1)\r\n that.breathSvga.visible = true;\r\n },that)\r\n }\r\n\r\n\r\n}","// import GameView from \"./GameView\";\r\nimport { injectProps } from \"../props\";\r\n\r\nimport TestView from './TestView'\r\nimport { Buried } from \"./Buried\";\r\n\r\n\r\nexport class GameWrapper extends engine.Container{\r\n\t// private _gameView:GameView\r\n\t\r\n\tprivate _testView:TestView\r\n\r\n constructor(){\r\n super();\r\n // engine.globalEvent.addEventListener('pictures-start', this.start, this);\r\n // engine.globalEvent.addEventListener('pictures-stop', this.stop, this);\r\n engine.globalEvent.addEventListener(\"pictures-setProjectId\",this.setProjectId,this);\r\n\r\n\t\t//创建实例\r\n\t\t// let gameView = this._gameView = new GameView();\r\n\t\t// this.addChild(gameView);\r\n\r\n\t\tlet testView = this._testView = new TestView();\r\n\t\tthis.addChild(testView);\r\n }\r\n\r\n setProjectId(event:engine.Event){\r\n injectProps(event.data);\r\n Buried.oaId = event.data.projectId;\r\n Buried.appId = event.data.appId;\r\n }\r\n\r\n\tstart(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\r\n\t\t// this._status = 1;\r\n\r\n\t\t// this._testView.start();\r\n\t}\r\n\tstop(event: engine.Event) {\r\n\t\t// this._testView.stop();\r\n\t}\r\n}","\r\n\r\nimport {GameWrapper} from \"./game/GameWrapper\";\r\nimport {injectProps, prepareProps} from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\r\n\tlet instance = new GameWrapper();\r\n\t\r\n\treturn instance;\r\n\t\r\n}\r\n"],"names":["__extends"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;UAEX,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;UAEe,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B;;CCbA;KAAA;MA+CC;KA1CiB,kBAAY,GAA1B;SACI,OAAO,IAAI,IAAI,EAAE,C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c": "蛋黄超人自定义模块1.0",
"props": {
"QTextStrArr":{
"alias":"问题文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"1、什么是筑梦空间?,2、金币是什么?,3、怎么获得金币?,4、如何更改用户昵称?,5、个人信息可以进行哪些操作?,6、通过二维码添加好友之后在哪里查看?,7、我的勋章是什么?,8、任务有哪些分类?"
},
"ATextStrArr":{
"alias":"答案文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"筑梦空间带给用户吃喝玩乐的不同体验,在这里你可以进行生活缴费、体验本地优惠、建设我的庄园、畅玩游戏中心等等。,金币是筑梦空间中的虚拟货币,用户可以使用金币游玩游戏、种植植物、兑换实物,同时金币可以按一定比例兑换波豆,波豆可以在波豆商城兑换更丰富的商品。,用户可以通过签到、任务、参与活动以及我的庄园果实售卖方式获得金币。,用户可以点击左上角个人信息按钮进入个人信息弹窗,点击昵称旁的修改按钮对昵称进行修改。,用户可以在个人信息页面进行修改昵称、修改头像、兑换波豆、查询金币明细、扫二维码添加好友等操作。,用户A通过扫描用户B的二维码进入活动之后,双方即绑定为好友,可以排行榜-好友排行榜进行查看。,当用户在筑梦空间的各种行为动作达到一定次数时,会点亮相应的激励勋章。,任务中分为一次性任务、永久开放任务和周期更新任务,一次性任务为完成一次或多次后消失的任务,如浏览车主服务任务、升级房屋任务;永久开放任务为一直可以完成并获得奖励的任务,如邀请好友任务;周期任务为以周期(每日/周/月)为单位进行更新的任务,如分享筑梦空间、去商店购买种子任务,积极完成任务可以获得更多金币。"
},
"ACTTextStrArr":{
"alias":"互动文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"主人你多久没来看我了,我好想你啊,Whoooo,主人你太棒了,主人,果子都成熟了,赶紧去采摘吧,主人,有空地可以种植哦,赶紧去吧!"
},
"type":{
"alias":"类型,用于区分所在场景,用于埋点,0:首页,1:庄园",
"type":"number",
"default":"0"
}
},
"assets": [
{
"name": "大对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/a3d49f913ee300b2834260967010a2e7b2d5c265.png",
"uuid": "21d8b7ca-6ed3-44e5-ada0-f0433f471ac9",
"ext": ".png"
},
{
"name": "小对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/c034f14785a2a36dce266cef0f46bd783ad03cb2.png",
"uuid": "9e4d1860-4762-4ac1-bc44-b3dd8fb307a6",
"ext": ".png"
},
{
"name": "蛋黄超人关闭按钮",
"url": "//yun.duiba.com.cn/aurora/assets/7a346d4e2c2cbce5ab3ac0a74e481525b048fcdd.png",
"uuid": "76f2c800-2174-4a90-ad6d-5853e95eb144",
"ext": ".png"
},
{
"name": "返回按钮",
"url": "//yun.duiba.com.cn/aurora/assets/8f55741c71b2aa7babe5cc517707cdd51b33c3d9.png",
"uuid": "2a555da9-dc05-4046-a5fb-551f0c2692fa",
"ext": ".png"
},
{
"name":"蛋黄超人icon",
"url":"//yun.duiba.com.cn/aurora/assets/baeec26a873006fabf031af8c918153384a732ef.png",
"uuid":"d5df1198-2cad-42e0-a197-fd56a2502d99",
"ext":".png"
},
{
"name":"蛋黄超人名称",
"url":"//yun.duiba.com.cn/aurora/assets/11b02c3908bcb8d685610caafdab9785fac5fccf.png",
"uuid":"fef58cbd-9c24-4216-896a-2799011df1dc",
"ext":".png"
},
{
"name":"右箭头",
"url":"//yun.duiba.com.cn/aurora/assets/8be77ba8ce699c4d302cd58e4d3be06919ac732f.png",
"uuid":"8546dcf7-a6e8-4ba2-89f7-b929118e473a",
"ext":".png"
},
{
"name":"常规呼吸动作",
"url":"//yun.duiba.com.cn/aurora/assets/adc7212454ea1d84ac5824982a57f37d2e745b54.svga",
"uuid":"ba2f8259-71b5-49ac-8310-08538a6b5d07",
"ext":".svga"
},
{
"name":"招手",
"url":"//yun.duiba.com.cn/aurora/assets/cf78c2f55369b597dfc744159687dc255f18a2b4.svga",
"uuid":"97de87e9-2ea4-4a31-9986-25edcd807c05",
"ext":".svga"
}
],
"events": {
"in": {
"pictures-ActLabel":{
"alias":"互动显示",
"data":{
"type":"0:24小时未登录互动,1:任务完成互动,2:农作物成熟互动,3:有土地未种植互动"
}
},
"pictures-setProjectId":{
"alias":"设置星速台id与appid",
"data":{
"projectId":"默认为'0'",
"appId":"默认为'0'"
}
}
},
"out": {
"pictures-end": {
"alias": "结束"
}
}
}
}
\ No newline at end of file
// import { DataManager } from './../manager/DataManager';
import { IExposureData } from './IExposureData';
// import { IExposureData } from '..';
export class Buried {
public static appId: string = '0';
public static consumerId: number;
public static oaId: string = "0";
/**
* 初始化
*/
public static init(): void {
// if(DataManager.ins.gameCfgData) {
// this.appId = DataManager.ins.gameCfgData.appInfo.appId;
// this.consumerId = DataManager.ins.getInfoData.consumerId;
// this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId;
// } else if(DataManager.ins.customCfgData){
// this.appId = DataManager.ins.customCfgData.appId;
// this.consumerId = DataManager.ins.customCfgData.consumerId;
// this.oaId = DataManager.ins.customCfgData.oaId ;
// } else if(DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId){
// this.appId = DataManager.ins.petIndexData.appId;
// this.consumerId = DataManager.ins.petIndexData.consumerId;
// this.oaId = DataManager.ins.petIndexData.activityId ;
// } else if(DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId){
// this.appId = DataManager.ins.petsIndexData.appId;
// this.consumerId = DataManager.ins.petsIndexData.consumerId;
// this.oaId = DataManager.ins.petsIndexData.activityId ;
// }
}
/**
* 创建dpm埋点数据
* @param {string} dpm 点击埋点
* @param {string} dcm 曝光埋点
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {
const exposure: any = {
dpm: dpm,
dcm: dcm,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
}
/**
* dpm拼接
* @param pageId 页面ID
* @param area 区域
* @param dpm 埋点号
* @returns {string}
*/
public static connectDpm(pageId: number, area: number, dpm: number): string {
return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;
}
/**
* dcm拼接
* @param typeId 类型ID
* @param contentInfo 内容信息
* @param dcm 埋点号
* @returns {string}
*/
public static connectDcm(typeId: number, contentInfo: number, dcm: number): string {
return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;
}
/**
* 插件dcm拼接
* @param plugId 插件ID
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
public static connectPlugDcm(plugId: number, type: number): string {
return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;
}
/**
* 活动dcm拼接
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
public static connectActivityDcm(type: number): string {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
}
}
export class GTime {
/**
* 获取当前时间戳
* @returns {number}
*/
public static getTimestamp(): number {
return new Date().getTime();
}
/**
* 转化时分秒
* @param time
*/
public static GetTimeHMS(time:number):string{
let t;
let h = Math.floor(time / 3600);
let hstr = h > 9 ? h : '0' + h;
let m = Math.floor((time % 3600) / 60);
let mstr = m > 9 ? m : '0' + m;
let s = Math.floor(time % 60);
let sstr = s > 9 ? s : '0' + s;
t = hstr + ':' + mstr + ':' + sstr;
return t;
}
/**
* 转化分秒
* @param time
*/
public static GetTimeMS(time:number):string{
let t;
let m = Math.floor((time % 3600) / 60);
let mstr = m > 9 ? m : '0' + m;
let s = Math.floor(time % 60);
let sstr = s > 9 ? s : '0' + s;
t = mstr + ':' + sstr;
return t;
}
}
\ No newline at end of file
// import {props} from '../props'
// import {getTexture,getTextureByName} from './utils'
// // import {Ball} from './Ball';
// import {Bullets} from './Bullets';
// export default class GameView extends engine.Container{
// startBtn:engine.Sprite
// stageBg: engine.Sprite;
// planeModel:engine.Sprite;
// pictureWrapper: engine.Sprite;
// gameBg: engine.Sprite;
// bullet: engine.Sprite;
// ball:engine.Sprite;
// constructor(){
// super()
// this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
// }
// setup(){
// this.stageBg = new engine.Sprite(getTexture('308742a0-0ea2-4610-b34a-a230add82021'))
// this.addChild(this.stageBg)
// this.gameBg = new engine.Sprite(getTexture('76820072-df5a-4ab7-8cb7-10c8cd8605c8'))
// this.bullet = new engine.Sprite(getTexture('18852543-1f1d-498b-af64-88cd3b343758'))
// // 开始按钮
// this.startBtn = new engine.Sprite(getTexture('855e3d77-ffff-443d-b884-4f67a2ebe458'))
// this.startBtn.x = (750 - this.startBtn.width) / 2;
// this.startBtn.y = (this.stage.height - this.startBtn.height) / 2 + 300;
// this.stageBg.addChild(this.startBtn)
// this.startBtn.addEventListener(engine.MouseEvent.CLICK,this.onClick,this)
// }
// mouseX;
// mouseY;
// planeCenterX;
// centerX
// ballArray:engine.Sprite[] = []
// bulletArray:engine.Sprite[] = []
// // baller:Ball
// bulleter:Bullets
// ballerArray:any[] = []
// bulletsArray:any[] = []
// score:number = 0
// start(){
// // 炮车
// this.planeModel = new engine.Sprite(getTexture('32ec481a-3f75-4c36-95ed-ee97aa936517'))
// this.planeModel.x = (750 - this.planeModel.width) / 2;
// this.planeModel.y = (this.stage.height - this.planeModel.height)
// this.planeModel.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onDown,this)
// // 子弹
// // this.bullet.x = 375;
// // this.bullet.y = 1150
// this.gameBg.addChild(this.planeModel)
// let boom = new engine.Sprite(getTexture('38ec6627-efa8-4f7a-9bdc-3c73cea717f1'))
// // 计分
// // 敌机
// setInterval(()=>{
// let ball = new engine.Sprite(getTexture('780b6b63-3abd-4246-94ba-2a3fbdb3c5af'));
// ball.x = Math.random() * (750 - ball.width ) ;
// ball.y = Math.random() * (ball.height);
// let life = 5
// this.ballerArray.push({ball,life})
// this.gameBg.addChild(ball)
// },500)
// // 敌机移动
// // setInterval(()=>{
// // let index
// // for(let ball of this.ballerArray){
// // // ball.x += Math.random() * (40) + (-20);
// // ball.y += 1;
// // if(ball.y > this.stage.height){
// // this.gameBg.removeChild(ball)
// // index = this.ballerArray.indexOf(ball)
// // this.ballerArray = this.ballerArray.filter((ele,i)=>i != index)
// // }
// // }
// // },16)
// // 添加生命值
// setInterval(()=>{
// let index
// for(let ballObj of this.ballerArray){
// // ball.x += Math.random() * (40) + (-20);
// ballObj.ball.y += 1;
// if(ballObj.ball.y > this.stage.height){
// this.gameBg.removeChild(ballObj.ball)
// index = this.ballerArray.indexOf(ballObj)
// this.ballerArray = this.ballerArray.filter((ele,i)=>i != index)
// }
// }
// },16)
// // 子弹
// setInterval(()=>{
// let bullet = new engine.Sprite(getTexture('18852543-1f1d-498b-af64-88cd3b343758'))
// bullet.x = this.planeModel ? this.planeModel.x + this.planeModel.width / 2 - bullet.width / 2 : 375 - bullet.width / 2 ;
// bullet.y = 1150
// let harm = 1;
// this.bulletsArray.push({bullet,harm});
// this.gameBg.addChild(bullet)
// },100)
// // 子弹移动
// // 计算伤害
// // 碰撞
// // setInterval(()=>{
// // for(let bullet of this.bulletsArray){
// // console.log(this.ballerArray)
// // console.log(this.bulletsArray)
// // console.log("===================");
// // bullet.y -= 40;
// // if(bullet.y < -40){
// // this.gameBg.removeChild(bullet)
// // let index = this.bulletsArray.indexOf(bullet)
// // this.bulletsArray = this.bulletsArray.filter((ele,i)=>i != index)
// // }
// // for(let baller of this.ballerArray){
// // let y = bullet.y - baller.y;
// // let bulletRight = bullet.x + bullet.width;
// // if(bulletRight > baller.x && bulletRight < (baller.x + baller.width) || bullet.x > baller.x && bullet.x < (baller.x + baller.width)){
// // if(y <= 0){
// // // 击中 移除敌机
// // this.gameBg.removeChild(bullet)
// // let index = this.bulletsArray.indexOf(bullet)
// // this.bulletsArray = this.bulletsArray.filter((ele,i)=>i != index)
// // boom.x = baller.x;
// // boom.y = baller.y;
// // this.gameBg.addChild(boom)
// // this.gameBg.removeChild(baller)
// // let ind = this.ballerArray.indexOf(baller)
// // this.ballerArray = this.ballerArray.filter((ele,i)=>i != ind)
// // setTimeout(() => {
// // this.gameBg.removeChild(boom);
// // }, 1500);
// // }
// // }
// // }
// // }
// // },20)
// setInterval(()=>{
// for(let bulletObj of this.bulletsArray){
// console.log(this.ballerArray)
// console.log(this.bulletsArray)
// console.log("得分:"+this.score)
// console.log("===================");
// bulletObj.bullet.y -= 40;
// if(bulletObj.bullet.y < -40){
// this.gameBg.removeChild(bulletObj.bullet)
// let index = this.bulletsArray.indexOf(bulletObj)
// this.bulletsArray = this.bulletsArray.filter((ele,i)=>i != index)
// }
// for(let ballObj of this.ballerArray){
// let y = bulletObj.bullet.y - ballObj.ball.y;
// let bulletRight = bulletObj.bullet.x + bulletObj.bullet.width;
// if(bulletRight > ballObj.ball.x && bulletRight < (ballObj.ball.x + ballObj.ball.width) || bulletObj.bullet.x > ballObj.ball.x && bulletObj.bullet.x < (ballObj.ball.x + ballObj.ball.width)){
// if(y <= 0){
// // 击中 移除敌机
// ballObj.life -= bulletObj.harm;
// // 加分
// this.score += bulletObj.harm;
// // console.log("得分:"+this.score)
// //子弹移除
// this.gameBg.removeChild(bulletObj.bullet)
// let index = this.bulletsArray.indexOf(bulletObj)
// this.bulletsArray = this.bulletsArray.filter((ele,i)=>i != index)
// if(ballObj.life === 0){
// this.gameBg.removeChild(ballObj.ball)
// let ind = this.ballerArray.indexOf(ballObj)
// this.ballerArray = this.ballerArray.filter((ele,i)=>i != ind)
// boom.x = ballObj.ball.x;
// boom.y = ballObj.ball.y;
// this.gameBg.addChild(boom)
// setTimeout(() => {
// this.gameBg.removeChild(boom);
// }, 1500);
// }
// }
// }
// }
// }
// },20)
// }
// stop(){}
// onDown(e){
// this.mouseX = e.localX
// this.mouseY = e.localY
// this.stage.addEventListener(engine.MouseEvent.MOUSE_MOVE,this.onMove,this)
// this.planeModel.x = e.stageX - this.mouseX;
// this.planeCenterX = this.planeModel.x + this.planeModel.width / 2;
// }
// onMove(e:engine.MouseEvent){
// // 以图片中心为准
// this.centerX = this.planeModel.width / 2;
// let movedCenter = this.centerX + e.stageX - this.mouseX;
// if(movedCenter < 0){
// this.planeModel.x = -this.centerX;
// } else if(movedCenter >750){
// this.planeModel.x = 750 - this.centerX;
// } else {
// this.planeModel.x = e.stageX - this.mouseX;
// this.planeCenterX = this.planeModel.x + this.planeModel.width / 2;
// // console.log(e.stageX,e.stageY)
// }
// }
// onClick(){
// this.addChild(this.gameBg);
// this.gameBg.addChild(this.planeModel)
// }
// shoot(w){
// setInterval(()=>{
// let bullet = new engine.Sprite(getTexture('18852543-1f1d-498b-af64-88cd3b343758'));
// bullet.x = this.planeModel.x && this.planeModel.x + this.centerX - this.bullet.width / 2 + w || 375 - this.bullet.width / 2 + w;
// bullet.y = 1150
// this.gameBg.addChild(bullet)
// this.bullet.y = this.bullet.y - 40;
// let timeid = setInterval(()=>{
// bullet.y = bullet.y - 40;
// if(bullet.y < -40){
// this.gameBg.removeChild(bullet)
// clearInterval(timeid)
// }
// },1000/60)
// },1000/60)
// }
// // ball:engine.Sprite;
// drop(){
// let ball = new engine.Sprite(getTexture('780b6b63-3abd-4246-94ba-2a3fbdb3c5af'));
// ball.x = Math.random() * (750 - ball.width ) + ball.width;
// ball.y = Math.random() * (ball.height)
// this.gameBg.addChild(ball)
// setInterval(()=>{
// ball.y += 1;
// if(ball.y > this.stage.height){
// this.gameBg.removeChild(ball)
// }
// },50)
// }
// }
\ No newline at end of file
// import GameView from "./GameView";
import { injectProps } from "../props";
import TestView from './TestView'
import { Buried } from "./Buried";
export class GameWrapper extends engine.Container{
// private _gameView:GameView
private _testView:TestView
constructor(){
super();
// engine.globalEvent.addEventListener('pictures-start', this.start, this);
// engine.globalEvent.addEventListener('pictures-stop', this.stop, this);
engine.globalEvent.addEventListener("pictures-setProjectId",this.setProjectId,this);
//创建实例
// let gameView = this._gameView = new GameView();
// this.addChild(gameView);
let testView = this._testView = new TestView();
this.addChild(testView);
}
setProjectId(event:engine.Event){
injectProps(event.data);
Buried.oaId = event.data.projectId;
Buried.appId = event.data.appId;
}
start(event: engine.Event) {
injectProps(event.data);
// this._status = 1;
// this._testView.start();
}
stop(event: engine.Event) {
// this._testView.stop();
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 埋点信息
*/
export interface IExposureData {
activityId?: number;
activityUseType?: string;
advertId?: number;
appId: number;
consumerId: number;
dcm: string;
domain: string;
dpm: string;
ip?: string;
isEmbed?: boolean;
materialId?: number;
orderId?: string;
os?: string;
}
\ No newline at end of file
export interface INetData {
//名字
name: any;
//地址
uri: string;
//接口类型 get、post等
type: string;
//返回数据类型
dataType: string;
//参数
param: any;
//回调
callback: Function;
//轮询次数
pollingCount?: number;
//轮询条件检查
pollingCheck?: Function;
//url拼接内容
addUrl?: string;
//是否显示错误提示
hideMsg?: boolean;
}
\ No newline at end of file
import { getTexture, clickLog, showLog } from "./utils";
import {props, injectProps} from "../props";
import { getlogItem } from "./getlogItem";
export default class QAText extends engine.Sprite{
bg:engine.Image[] = [];
bgTexture:engine.Texture[] = [];
titelLabel:engine.Label;
QLabel:engine.Label[] = [];
ALabel:engine.Label[] = [];
ActLabel:engine.Label;
QlabelGroup:engine.Sprite;
AlabelGroup:engine.Sprite;
ActlabelGroup:engine.Sprite;
QText:string[]; //问题文本组
AText:string[]; //回答文本组
ActText:string[]; //互动文本组
bigBgOrigin:engine.Point;
smallBgOrigin:engine.Point;
returnBtn:engine.Image; //回答文本组的返回按钮
closeBtn:engine.Image; //关闭按钮
QScrList:engine.ScrollView;//问题滚动视图
AScrView:engine.ScrollView;//答案滚动视图
actLabelTimer;
constructor(){
super();
this.addEventListener(engine.Event.ADDED_TO_STAGE,this.setup,this)
this.init();
}
init(){
var that = this;
that.bigBgOrigin = new engine.Point();
that.smallBgOrigin = new engine.Point();
that.QText = props.QTextStrArr.split(',');
//that.QText.unshift('你想问哪些问题?')
console.log(props.QTextStrArr.split(','));
that.AText = props.ATextStrArr.split(',')
console.log(props.ATextStrArr.split(','));
that.ActText = props.ACTTextStrArr.split(',');
console.log(props.ACTTextStrArr.split(','));
}
setup(){
var that = this;
that.removeEventListener(engine.Event.ADDED_TO_STAGE,that.setup,that);
that.hideText();
that.setGroup();
that.setQLabel();
that.setALabel();
that.setActLabel();
that.setEvent();
}
setEvent(){
}
/**设置各个文本组 */
setGroup(){
var that = this;
//问题文本组
that.QlabelGroup = new engine.Sprite();
// that.QlabelGroup.addChild(that.bg[0]);
that.addChild(that.QlabelGroup);
that.QlabelGroup.visible = false;
//答案文本组
that.AlabelGroup = new engine.Sprite();
// that.AlabelGroup.addChild(that.bg[1]);
that.addChild(that.AlabelGroup)
that.AlabelGroup.visible = false;
//互动文本组
that.ActlabelGroup = new engine.Sprite();
// that.ActlabelGroup.addChild(that.bg[1]);
that.addChild(that.ActlabelGroup);
that.ActlabelGroup.visible = false;
for(let i=0;i<3;i++){
let bg = new engine.Image();
if(i<2){
bg.texture = getTexture("21d8b7ca-6ed3-44e5-ada0-f0433f471ac9"); //大气泡
if(i==0){
that.QlabelGroup.addChild(bg);
}else{
that.AlabelGroup.addChild(bg);
}
}
else{
bg.texture = getTexture("9e4d1860-4762-4ac1-bc44-b3dd8fb307a6"); //小气泡
that.ActlabelGroup.addChild(bg);
}
that.bg.push(bg);
}
that.closeBtn = new engine.Image(getTexture("76f2c800-2174-4a90-ad6d-5853e95eb144"));
that.addChild(that.closeBtn);
that.closeBtn.mouseEnabled = true;
that.closeBtn.addEventListener(engine.MouseEvent.CLICK,that.hideText,that);
//问题列表
that.QScrList = new engine.ScrollView();
that.QlabelGroup.addChild(that.QScrList);
that.QScrList.x = 30;
that.QScrList.y = 85;
that.QScrList.width = that.bg[0].width-50;
that.QScrList.height = 195;
}
/**设置列表内问题文本 */
setQText(e){
console.log('engine.Event.UPDATE_DATA', e)
e.target.getChildByName('问题文本').text = e.data;
e.target.name = 'Q_'+ e.data.substring(0,1);
}
/**设置问题文本组 */
setQLabel(){
var that = this;
let label = new engine.Label();
label.text = '你想问哪些问题?';
label.x = 30;
label.y = 30;
label.size = 34;
label.width = that.bg[0].width-50;
that.QlabelGroup.addChild(label);
for(let i=0;i<that.QText.length;i++){
let img = new engine.Image(getTexture("8546dcf7-a6e8-4ba2-89f7-b929118e473a"))
that.QScrList.addChild(img);
img.name = 'Q_'+i;
img.y = 5 + i*50;
img.x = that.QScrList.width - img.width;
img.mouseEnabled = true;
img.addEventListener(engine.MouseEvent.CLICK,that.showALabelGroup,that);
let label = new engine.Label();
that.QScrList.addChild(label);
label.name = 'Q_'+i;
label.text = that.QText[i];
label.fillColor = "#d36800";
label.size = 24;
label.width = img.x;
label.height = 50;
label.y = img.y;
label.mouseEnabled = true;
label.addEventListener(engine.MouseEvent.CLICK,that.showALabelGroup,that);
that.QLabel.push(label);
}
}
/**设置答案文本 */
setALabel(){
var that = this;
that.AScrView = new engine.ScrollView();
that.AlabelGroup.addChild(that.AScrView);
that.AScrView.x = 32
that.AScrView.y = 62
that.AScrView.width = that.bg[0].width - 55;
that.AScrView.height = that.bg[0].height - 120;
for(let i=0;i<2;i++){
let label = new engine.Label();
label.x = 0
label.y = 5 + i * 40
label.size = 24;
label.width = that.AScrView.width;
label.lineSpacing = 11;
label.lineType = engine.TEXT_lINETYPE.MULTI;
//that.AlabelGroup.addChild(label);
that.AScrView.addChild(label);
that.ALabel.push(label);
}
that.returnBtn = new engine.Image(getTexture('2a555da9-dc05-4046-a5fb-551f0c2692fa'));
that.AlabelGroup.addChild(that.returnBtn);
// that.returnBtn.x = that.bg[1].width - that.returnBtn.width*2;
// that.returnBtn.y = that.bg[1].height - that.returnBtn.height-30;
that.returnBtn.x = 18;
that.returnBtn.y = 20;
that.returnBtn.mouseEnabled = true;
that.returnBtn.addEventListener(engine.MouseEvent.CLICK,that.showQLabelGroup,that);
}
/**设置互动文本 */
setActLabel(){
var that = this;
that.ActLabel = new engine.Label();
that.ActlabelGroup.addChild(that.ActLabel);
that.ActLabel.x = 0;
that.ActLabel.y = that.getSmallBgSize().h*0.5-24;
that.ActLabel.width = that.getSmallBgSize().w;
// that.ActLabel.height = that.getSmallBgSize().h;
that.ActLabel.textAlign = engine.TEXT_ALIGN.CENTER;
// that.ActLabel.verticalAlign = engine.VERTICAL_ALIGN.MIDDLE;
that.ActLabel.size = 24;
}
/**展示问题组 */
showQLabelGroup(e:engine.MouseEvent){
var that = this;
if(e&&e.target == that.returnBtn){
if(props.type == 0){
clickLog(getlogItem(30));
}else if(props.type == 1){
clickLog(getlogItem(80));
}
}
that.x = that.bigBgOrigin.x;
that.y = that.bigBgOrigin.y;
that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;
that.closeBtn.y = -10;
that.AlabelGroup.visible = false;
that.ActlabelGroup.visible = false;
that.QlabelGroup.visible = true;
that.QScrList.scrollTo(-1);
that.showText();
}
/**展示答案组 */
showALabelGroup(e:engine.MouseEvent){
console.log("展示答案"+e.target.name);
var that = this;
that.x = that.bigBgOrigin.x;
that.y = that.bigBgOrigin.y;
that.closeBtn.x = that.bg[0].width - that.closeBtn.width + 20;
that.closeBtn.y = -10;
let str = e.target.name.split('_');
if(str&&str.length>0)
var index = str[1];
that.ALabel[0].text = that.QText[index];
//that.ALabel[0].visible = false;//不显示问题
that.ALabel[1].text = that.AText[index];
that.QlabelGroup.visible = false;
that.ActlabelGroup.visible = false;
that.AlabelGroup.visible = true;
this.AScrView.scrollTo(-1);
that.showText();
if(props.type == 0){
showLog(getlogItem(30));
}else if(props.type == 1){
showLog(getlogItem(80));
}
}
/**展示互动组 */
showActLabelGroup(type){
// injectProps(event.data);
let index = type;
var that = this;
that.x = that.smallBgOrigin.x;
that.y = that.smallBgOrigin.y;
that.closeBtn.x = that.bg[2].width - that.closeBtn.width-10;
that.closeBtn.y = 20;
that.ActLabel.text = that.ActText[index];
that.QlabelGroup.visible = false;
that.AlabelGroup.visible = false;
that.ActlabelGroup.visible = true;
that.showText();
if(!that.actLabelTimer){
that.actLabelTimer = setTimeout(() => {
that.ActlabelGroup.visible = false;
that.hideText();
clearTimeout(that.actLabelTimer)
}, 3000);
}else{
clearTimeout(that.actLabelTimer);
that.actLabelTimer = setTimeout(() => {
that.hideText();
that.ActlabelGroup.visible = false;
}, 3000);
}
}
setBigBgPositon(x:number,y:number){
this.bigBgOrigin.x = x;
this.bigBgOrigin.y = y;
}
setSmallBgPositon(x:number,y:number){
this.smallBgOrigin.x = x;
this.smallBgOrigin.y = y;
}
getBigBgSize(){
return {w:this.bg[0].width,h:this.bg[0].height}
}
getSmallBgSize(){
return {w:this.bg[2].width,h:this.bg[2].height}
}
showText(){
this.visible = true;
}
hideText(){
if(this.actLabelTimer){
clearTimeout(this.actLabelTimer);
}
engine.globalEvent.dispatchEvent("hideRect");
this.visible = false;
}
}
\ No newline at end of file
import {getTexture, createSvga, showLog, clickLog} from './utils'
import QAText from './QAText';
import {getlogItem} from './getlogItem';
import { props } from '../props';
export default class TestView extends engine.Container{
worldTime:number;
supermanImg:engine.Image;
qaisOpen:boolean = false;
QAText:QAText;
breathSvga:svga.Svga;
waveSvga:svga.Svga;
rect:engine.Rect;
constructor(){
super()
this.addEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
setup(){
var that = this;
that.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this)
that.rect = new engine.Rect();
that.rect.fillColor = "#000000";
that.rect.alpha = 0.7;
that.rect.width = 2000;
that.rect.height = 2000;
that.rect.visible = false;
that.addChild(that.rect);
that.breathSvga = createSvga("常规呼吸动作");
that.waveSvga = createSvga("招手");
that.waveSvga.visible = false;
that.breathSvga.visible = true;
that.breathSvga.mouseEnabled = that.waveSvga.mouseEnabled = true;
that.addChild(that.breathSvga);
that.addChild(that.waveSvga);
that.breathSvga.x = that.waveSvga.x = engine.gameStage.stage.width - 178*0.7;
that.breathSvga.y = that.waveSvga.y = engine.gameStage.stage.height/3*2-60;
that.breathSvga.gotoAndPlay(1);
// that.breathSvga.scale = 0.6;
// that.waveSvga.scale = 0.6;
that.breathSvga.scaleX = that.breathSvga.scaleY = 0.7;
that.waveSvga.scaleX = that.waveSvga.scaleY = 0.7;
that.QAText = new QAText();
that.addChild(that.QAText);
that.QAText.setBigBgPositon(engine.gameStage.stage.width - that.QAText.getBigBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getBigBgSize().h)
that.QAText.setSmallBgPositon(engine.gameStage.stage.width - that.QAText.getSmallBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getSmallBgSize().h)
that.addEvnt();
}
addEvnt(){
var that = this;
// that.supermanImg.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
that.breathSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
that.waveSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
engine.globalEvent.addEventListener("pictures-ActLabel",that.showActLabelGroup,that);
engine.globalEvent.addEventListener("pictures-supermanAnim",that.supermanAnim,that);
engine.globalEvent.addEventListener("hideRect",()=>{that.rect.visible = false},that);
}
/**蛋黄超人动效 */
supermanAnim(){
}
/**点击蛋黄超人 */
touchSuperManImg(e:engine.MouseEvent){
console.log("点击蛋黄超人")
var that = this;
if(that.QAText.visible) return;
if(props.type == 0){
clickLog(getlogItem(17))
}else if(props.type == 1){
clickLog(getlogItem(51))
}
//蛋黄超人动效
that.showWaveSvga();
that.QAText.showQLabelGroup(null);
that.rect.visible = true;
}
/**展示互动文案组 */
showActLabelGroup(e:engine.Event){
var that = this;
//蛋黄超人动效
that.showWaveSvga();
that.QAText.showActLabelGroup(parseInt(e.data.type))
}
showWaveSvga(){
var that = this;
that.breathSvga.visible = false;
that.waveSvga.visible = true;
that.waveSvga.play(false,false);
that.waveSvga.once(engine.Event.END_FRAME,()=>{
that.waveSvga.visible = false;
that.breathSvga.gotoAndPlay(1)
that.breathSvga.visible = true;
},that)
}
}
\ No newline at end of file
import { Buried } from "./Buried";
import {props} from '../props'
export const getlogItem = (i) =>{
const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点
const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点
return Buried.createExposure(Dpm, Dcm);
};
\ No newline at end of file
{
"a":1
}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
import {IExposureData} from './IExposureData'
import {INetData} from './INetData'
import { GTime } from './GTime';
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function createSvga(name, anchorName?) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
export function getIndexFromRC(row,col,maxCol){
let index;
index = row * maxCol + col ;
return index
}
export function getRandomArray(array){
array.sort(function() {
return .5 - Math.random();
});
}
/**
* 兑吧点击埋点
* @param {IExposureData} exposure
*/
export function clickLog(exposure: IExposureData): void {
const net: INetData = {
name: 'clickLog',
uri: '/log/click',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
/**
* 兑吧曝光埋点
* @param {IExposureData} exposure
*/
export function showLog(exposure: IExposureData): void {
const net: INetData = {
name: 'showLog',
uri: exposure.domain + '/exposure/standard',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
/**
* 发送请求
* @param net
*/
export function send(net: INetData): void {
let gTime: string = '?_=' + GTime.getTimestamp();
let realUrl: string = net.uri;
if (realUrl.indexOf('?') != -1) {
gTime = '&_=' + GTime.getTimestamp();
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if (net.addUrl) {
realUrl += net.addUrl;
}
window['$'].ajax({
type: net.type,
// url: realUrl + gTime,
url: realUrl,
cache: false,
dataType: net.dataType,
data: net.param,
async: true,
// success: (result) => {
// this.onResponse(net, result);
// },
// error: (message) => {
// this.onError(net);
// }
});
}
\ No newline at end of file
import {GameWrapper} from "./game/GameWrapper";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new GameWrapper();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
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