Commit 032e9356 authored by wildfirecode's avatar wildfirecode

1

parent ee3a7c81
node_modules
debug
.rpt2_cache
\ No newline at end of file
.rpt2_cache
dist
\ No newline at end of file
......@@ -36,7 +36,9 @@
"script": "./scripts/MainController",
"properties": {
"Popup": "entity|dbfac9aa-8955-4725-89cf-eae9f8cf7595",
"Toast": "entity|1d7c03a2-f89a-47ca-9681-7dd17352a14f"
"Toast": "entity|1d7c03a2-f89a-47ca-9681-7dd17352a14f",
"actId": "dynamic|CFG|actId",
"hdToolId": "dynamic|CFG|hdToolId"
},
"disabled": false
},
......@@ -102,7 +104,8 @@
"startbtn": "entity|5f3ed06e-c47a-491e-a3a1-9ac0e700a302",
"ajaxElement": "dynamic|API|ajaxElement",
"doJoin": "dynamic|API|doJoin",
"getNgameStartStatus": "dynamic|API|getNgameStartStatus"
"getNgameStartStatus": "dynamic|API|getNgameStartStatus",
"getOrderStatus": "dynamic|API|getOrderStatus"
},
"disabled": false
},
......@@ -114,7 +117,7 @@
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "GET",
"method": "POST",
"name": "doJoin",
"uri": "/hdtool/recon/doJoin",
"onError": [
......@@ -153,6 +156,28 @@
],
"uri": "/hdtool/recon/ngame/getNgameStartStatus"
}
},
{
"script": "./scripts/api/SamplePollingApi",
"properties": {
"uri": "/hdtool/recon/getOrderStatus",
"method": "GET",
"onError": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "onError_getOrderStatus"
}
],
"onResponse": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "onResponse_getOrderStatus"
}
],
"name": "getOrderStatus"
}
}
],
"uuid": "41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
......@@ -787,7 +812,8 @@
},
{
"script": "components/base/TouchInterrupt",
"properties": {}
"properties": {},
"disabled": true
},
{
"script": "components/other/FullStageSize",
......@@ -811,6 +837,10 @@
"width": 750,
"height": 1624
}
},
{
"script": "components/base/TouchInterrupt",
"properties": {}
}
],
"uuid": "f708d7fe-e1f6-4e0b-a691-245ac5a7014b",
......@@ -1172,14 +1202,16 @@
{
"script": "./scripts/dialogs/PrizeDialogContent",
"properties": {
"pic": "entity|5e468650-9e44-4f2d-8dba-be066cd89c37"
"pic": "entity|5e468650-9e44-4f2d-8dba-be066cd89c37",
"label": "entity|e6dc4c00-8481-4356-8610-8abe1a354663",
"getOrderStatus": "dynamic|API|getOrderStatus"
}
}
],
"uuid": "48d00d27-5587-4a24-b5ba-f8a11a714e39",
"children": [
{
"name": "Entity",
"name": "bg",
"components": [
{
"script": "components/base/Transform",
......@@ -1192,7 +1224,8 @@
}
}
],
"uuid": "b31d86ab-24d9-4ee7-a434-7f9ffe60278b"
"uuid": "b31d86ab-24d9-4ee7-a434-7f9ffe60278b",
"disabled": false
},
{
"name": "CloseButton",
......@@ -1261,7 +1294,14 @@
"properties": {
"upRes": "res|8b0f2eee-8cb0-4499-ab58-49e7f2caee18",
"downRes": "res|8b0f2eee-8cb0-4499-ab58-49e7f2caee18",
"disabledRes": "res|8b0f2eee-8cb0-4499-ab58-49e7f2caee18"
"disabledRes": "res|8b0f2eee-8cb0-4499-ab58-49e7f2caee18",
"onClick": [
{
"entity": "entity|48d00d27-5587-4a24-b5ba-f8a11a714e39",
"component": 1,
"method": "onClick_usebtn"
}
]
}
}
],
......@@ -1276,7 +1316,8 @@
"properties": {
"position": {
"x": 0,
"y": 30
"y": 50,
"_type_": "scilla/support/Vector2D"
}
}
},
......@@ -1288,7 +1329,7 @@
"uuid": "5e468650-9e44-4f2d-8dba-be066cd89c37"
}
],
"disabled": false
"disabled": true
}
],
"disabled": false
......
......@@ -5,10 +5,14 @@
*/
import { TextureRenderer } from "scilla-components/src";
import { EngineConfig, Entity, AssetsManager, Texture, createTexture } from "scilla/src";
import { AssetsManager, createTexture, EngineConfig, Entity, Texture, dynamic } from "scilla/src";
import DialogContent from "../popup/DialogContent";
import { setScale } from "../transformUtils";
export default class PrizeDialogContent extends DialogContent {
pic: Entity;
getOrderStatus:dynamic;
private loadImage = (url: string): Promise<HTMLImageElement> => {
return new Promise<HTMLImageElement>((resolve, reject) => {
let img = new Image();
......@@ -31,15 +35,24 @@ export default class PrizeDialogContent extends DialogContent {
return texture;
}
pic: Entity;
onClick_usebtn(){
window.location.href=this.getOrderStatus.lottery.link
}
onAwake() {
super.onAwake();
AssetsManager
}
async setup(data: any = {}) {
async setup(dat1a: any = {}) {
const texRender = this.pic.getComponent(TextureRenderer);
const texture = await this.loadTexture('//yun1.duiba.com.cn/upload/uP99F1462438316972.png');
texRender.texture=texture;
const texture = await this.loadTexture(this.getOrderStatus.lottery.imgUrl);
texRender.texture = texture;
if (texture.bounds.width > texture.bounds.height) {
const maxWidth = 500;
setScale(this.pic, maxWidth / texture.bounds.width)
} else {
const width = 250;
setScale(this.pic, width / texture.bounds.width)
}
}
}
......@@ -8,51 +8,43 @@ import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { getRotation, setRotation } from "../transformUtils";
import { Button } from "scilla-components/src";
import { Button, TouchInterrupt } from "scilla-components/src";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
rankbtn: Entity;
rulebtn: Entity;
treeWrapper: Entity;
private _gifts: Entity[];
onAwake() {
super.onAwake();
// this.setCountText('');
// SingleSceneNavigator
console.log('fuck start scene')
this._gifts = this.treeWrapper.getChildrenByName('gift');
setTimeout(() => {
this.bubbling('showDialog', 'Prize','fuck');
}, 1000);
}
private setCountText(text: string) {
setText(this.countTxt, text);
}
// private setCountText(text: string) {
// setText(this.countTxt, text);
// }
initGameStage() {
// this.updateCountText();
this.bubbling('showToast', '活动还未开始\n敬请期待')
// // this.updateCountText();
// this.bubbling('showToast', '活动还未开始\n敬请期待')
}
updateCountText() {
const { element } = this.ajaxElement;
let text = ''
if (element.freeLimit > 0) {
text = `今日剩余免费次数:${element.freeLimit}次`;
} else {
text = `${element.needCredits}${window['CFG'].unitName}/次`
}
this.setCountText(text);
}
// updateCountText() {
// const { element } = this.ajaxElement;
// let text = ''
// if (element.freeLimit > 0) {
// text = `今日剩余免费次数:${element.freeLimit}次`;
// } else {
// text = `${element.needCredits}${window['CFG'].unitName}/次`
// }
// this.setCountText(text);
// }
onClick_startbtn() {
this.startbtn.getComponent(Button).enabled = false;
......@@ -62,7 +54,20 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onShakeOver() {
if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.dojoinFunc(tokenObj.token);
}, (key: string, messageObj: any) => {
// this.onError(net);
});
} else {
this.dojoinFunc();
}
}
dojoinFunc(token?) {
this.broadcast('callApi', 1, 'doJoin', {
token: token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
......@@ -90,29 +95,88 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
}
onGotDojoin(error) {
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
// this.startbtn.getComponent(Button).enabled = true;
this.broadcast('callApi', 1, 'getNgameStartStatus', {
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
// this.broadcast('callApi', 1, 'getNgameStartStatus', {
// orderId: this.doJoin
// });
}
onGotDojoinError(...argument) {
onGotDojoinError(error) {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGotDojoinError', argument);
if (error === '0') {
this.bubbling('showDialog', 'Alert', '活动还未开始\n敬请期待~');
}
else if (error === '1') {
this.bubbling('showDialog', 'Alert', '活动已结束\n下次早点来哦~');
}
else if (error === '2') {
this.bubbling('showDialog', 'Alert', '您已经没有抽奖机会了');
}
else {
this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
}
console.log('onGotDojoinError', error);
}
onResponse_getOrderStatus() {
this.startbtn.getComponent(Button).enabled = true;
console.log('onResponse_getOrderStatus', this.getOrderStatus);
if (this.getOrderStatus.lottery) {
this.bubbling('showDialog', 'Prize', this.getOrderStatus);
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
}
onError_getOrderStatus(error) {
this.startbtn.getComponent(Button).enabled = true;
this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// if (error === '0') {
// this.bubbling('showDialog', 'Alert', '活动还未开始\n敬请期待~');
// }
// else if (error === '1') {
// this.bubbling('showDialog', 'Alert', '活动已结束\n下次早点来哦~');
// }
// else if (error === '2') {
// this.bubbling('showDialog', 'Alert', '您已经没有抽奖机会了');
// }
// else {
// this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// }
console.log('onError_getOrderStatus', error);
}
onGot_getNgameStartStatus() {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
// this.bubbling('fuck', 'play');
if (this.getNgameStartStatus.orderId) {
this.bubbling('showDialog', 'Prize', this.getNgameStartStatus);
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
}
onGotError_getNgameStartStatus(...argument) {
onGotError_getNgameStartStatus(error) {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGotError_getNgameStartStatus', argument);
this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// if (error === '0') {
// this.bubbling('showDialog', 'Alert', '活动还未开始\n敬请期待~');
// }
// else if (error === '1') {
// this.bubbling('showDialog', 'Alert', '活动已结束\n下次早点来哦~');
// }
// else if (error === '2') {
// this.bubbling('showDialog', 'Alert', '您已经没有抽奖机会了');
// }
// else {
// this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// }
console.log('onGotError_getNgameStartStatus', error);
}
onClick_rulebtn() {
......
......@@ -20,14 +20,14 @@ export const setAlpha = (val: Entity | ScillaComponent, alpha: number) => {
}
}
export const setScale = (val: Entity | ScillaComponent, x) => {
export const setScale = (val: Entity | ScillaComponent, sacle) => {
if (val instanceof Entity) {
val.getComponent(Transform).scale.x = x;
val.getComponent(Transform).scale.y = x;
val.getComponent(Transform).scale.x = sacle;
val.getComponent(Transform).scale.y = sacle;
}
else if (val instanceof ScillaComponent) {
val.entity.getComponent(Transform).scale.x = x;
val.entity.getComponent(Transform).scale.y = x;
val.entity.getComponent(Transform).scale.x = sacle;
val.entity.getComponent(Transform).scale.y = sacle;
}
}
......
No preview for this file type
This diff is collapsed.
{
"file": "prize.png",
"frames": {
"prizebg.png": {
"x": 1,
"y": 1,
"w": 604,
"h": 871,
"offX": 0,
"offY": 0,
"sourceW": 604,
"sourceH": 871
},
"usebtn.png": {
"x": 1,
"y": 874,
"w": 333,
"h": 99,
"offX": 0,
"offY": 0,
"sourceW": 333,
"sourceH": 99
}
}
}
\ No newline at end of file
{
"file": "rule.png",
"frames": {
"游戏说明-1.png": {
"x": 1,
"y": 1,
"w": 549,
"h": 628,
"offX": 0,
"offY": 0,
"sourceW": 549,
"sourceH": 628
},
"closeBtn-1.png": {
"x": 1,
"y": 631,
"w": 56,
"h": 56,
"offX": 0,
"offY": 0,
"sourceW": 56,
"sourceH": 56
}
}
}
\ No newline at end of file
{
"file": "start.png",
"frames": {
"roles.png": {
"x": 1,
"y": 1,
"w": 665,
"h": 523,
"offX": 0,
"offY": 0,
"sourceW": 665,
"sourceH": 523
},
"startbtn.png": {
"x": 668,
"y": 1,
"w": 329,
"h": 111,
"offX": 0,
"offY": 0,
"sourceW": 329,
"sourceH": 111
},
"口红.png": {
"x": 999,
"y": 1,
"w": 62,
"h": 106,
"offX": 0,
"offY": 0,
"sourceW": 62,
"sourceH": 106
},
"栅栏.png": {
"x": 668,
"y": 114,
"w": 309,
"h": 111,
"offX": 0,
"offY": 0,
"sourceW": 309,
"sourceH": 111
},
"礼盒.png": {
"x": 668,
"y": 227,
"w": 173,
"h": 156,
"offX": 0,
"offY": 0,
"sourceW": 173,
"sourceH": 156
},
"兑吧大牌券.png": {
"x": 843,
"y": 227,
"w": 148,
"h": 145,
"offX": 0,
"offY": 0,
"sourceW": 148,
"sourceH": 145
},
"8分.png": {
"x": 843,
"y": 374,
"w": 138,
"h": 117,
"offX": 0,
"offY": 0,
"sourceW": 138,
"sourceH": 117
},
"recordbtn.png": {
"x": 668,
"y": 385,
"w": 135,
"h": 34,
"offX": 0,
"offY": 0,
"sourceW": 135,
"sourceH": 34
},
"rulebtn.png": {
"x": 668,
"y": 421,
"w": 134,
"h": 34,
"offX": 0,
"offY": 0,
"sourceW": 134,
"sourceH": 34
},
"炸弹.png": {
"x": 668,
"y": 457,
"w": 128,
"h": 162,
"offX": 0,
"offY": 0,
"sourceW": 128,
"sourceH": 162
},
"树.png": {
"x": 1,
"y": 526,
"w": 621,
"h": 814,
"offX": 0,
"offY": 0,
"sourceW": 621,
"sourceH": 814
},
"组 81.png": {
"x": 798,
"y": 493,
"w": 119,
"h": 198,
"offX": 0,
"offY": 0,
"sourceW": 119,
"sourceH": 198
},
"text1.png": {
"x": 1,
"y": 1342,
"w": 598,
"h": 191,
"offX": 0,
"offY": 0,
"sourceW": 598,
"sourceH": 191
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>shuijf</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,
p {
padding: 0;
margin: 0;
border: 0;
}
html,
body {
height: 100%;
background-color: #282C34;
}
#loading {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
#floatLayer::-webkit-scrollbar {
display: none
}
</style>
</head>
<body>
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<div id="loading">
<img src="loading.gif" />
</div>
<script src="./zepto.min.js"></script>
<script src="./security.js"></script>
<script src="bundle.js"></script>
<script>
var CFG = { "actId": "3335069", "oaId": "3335069", "unitName": "积分", "btnUnitName": "积分", "doJoin": "/hdtool/doJoin?dpm=1.3.1.0&activityId=3335069", "quireOrder": "/hdtool/getOrderStatus", "styleConfig": "/hdtool/getHdtoolConfig", "getElement": "/hdtool/ajaxElement", "getPrizeDetail": "/hdtool/prizeDetail", "ajaxThroughInfo": "/hdtool/ajaxThroughInfo", "throughSubmit": "/hdtool/throughSubmit", "gameGetOrder": "/hdtool/getOrderInfo", "gameSubmit": "/hdtool/gameSubmit", "doSubmit": "/hdtool/submit", "adslotId": "", "consumerId": "1", "isNotLoginUser": false, "uid": "1", "hdType": "duiba", "hdToolId": "42363", "appType": "credits", "subType": "custom", "directSendCoupon": "false", "ajaxAction": "", "recommendQueue": "/recommend/getRecommend", "recommendSkin": "/recommend/getRecommendSkin", "isShowDetail": true, "preview": false, "from": "", "login": "//activity.m.duiba.com.cn/hdtool/login?dpm=1.3.3.0", "flowRedirectUrl": "", "flowRedirectTuiaUrl": "", "isOpenRecommend": false, "getCreditsLink": "http://baidu.com?uid=1&dbnewopen", "appId": "1", "recordUrl": "//activity.m.duiba.com.cn/crecord/record?dbnewopen&dpm=1.3.2.0", "shareDesc": "分享分享文案文案", "entranceDesc": "测试领奖,也可到我的奖品领奖,24小时内有效哦", "isSHowMeat": true, "needCouponModal": true, "needRecommendModal": true, "asyncFiles": [], "shareAndroidLinkActivity": "http://www.duiba.com.cn", "shareIosLinkActivity": "http://www.iqiyi.com", "appName": "custom", "needShare": true, "shareTitle": "", "shareSubTitle": "", "sharePicUrl": "", "shareLink": "", "shareAndroidDeeplink": "", "shareIOSDeeplink": "" };
function requirelogin() {
console.log('requirelogin');
}
setTimeout(function () {
var loadingEl = document.getElementById('loading');
function onProcess(p) {
if (p >= 1) {
loadingEl.style.display = 'none';
}
}
var options = {};//window['inputOptions'] ||
window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
</script>
<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
':35729/livereload.js?snipver=1"></' + 'script>')
</script>
</body>
</html>
\ No newline at end of file
{
"name": "shuijf",
"engineConfig": {
"fps": 63,
"designWidth": 750,
"designHeight": 1624,
"scaleMode": "fixedWidth",
"modifyCanvasSize": false,
"resPath": ""
},
"customConfig": {
"scene": {
"scenes": {
"main": "scenes/main.scene"
},
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl": "http://localhost:4001"
},
"dataCenterConfig": {
"dataCenterRoot": [
"API",
"CFG"
]
}
}
{
"success": true,
"code": "0000000000",
"code": "2",
"desc": "OK",
"timestamp": 1548915321930,
"data": 123456
......
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1548923950498,
"code": "1C000000001",
"data": {
"element": {
"success": false,
"isCreditsTypeOpen": false,
"needCredits": "100",
"myCredits": "999999630434",
"myCreditsLong": 999999630434,
"needCreditsLong": 100,
"freeLimit": -1,
"status": 1,
"freeEmpty": true
"creditsInfo": {
"activityId": 21194,
"score": 31,
"recordStatus": 1,
"developerBizId": "3013273",
"prizeId": 1
},
"lottery": {
"id": null,
"type": "thanks",
"imgUrl": null,
"link": null,
"title": null,
"itemId": null,
"appItemId": null,
"bonus": null,
"bonusMin": null,
"bonusMax": null,
"needAccount": null,
"appLucky": null,
"tip": null,
"useBtnText": null,
"validate": null,
"couponCode": null,
"couponKey": null,
"stInfoDpmImg": null,
"stInfoDpmClose": null,
"stInfoDpmGoUse": null,
"showUse": null,
"openUrl": null,
"iosDownloadUrl": null,
"androidDownloadUrl": null,
"isDownloadUrl": null,
"confirm": null,
"phaseNumber": null,
"happyCode": null,
"imgUrl": "//yun.duiba.com.cn/babi/img/q7yx1sus73.gif",
"imgUrl1": "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"itemId": 20348,
"appHidden": true,
"zybangJson": null
"link": "//activity.m.duibatest.com.cn/activity/takePrizeNew?recordId=3395303&dbnewopen",
"id": 9,
"title": "虚拟商品",
"type": "v",
"isDownloadUrl": true
},
"exposure": null,
"creditsInfo": {
"activityId": 82567,
"prizeId": 4,
"orderNum": null,
"developerBizId": "3029576",
"score": null,
"recordStatus": 1,
"errorMsg": null
},
"againTag": null
}
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 4993862,
"freeLimit": 2,
"success": true,
"myCredits": "4993862",
"needCredits": "200",
"freeEmpty": false,
"needCreditsLong": 200,
"status": 5
}
},
"success": true,
"desc": "OK",
"timestamp": 1550543212313
}
\ No newline at end of file
{
"success": false,
"code": "C000000001",
"success": true,
"code": "0",
"desc": "OK",
"timestamp": 1550570639368,
"data": {
"orderId": "883006813674240289",
"orderId": "12345",
"submitToken": "d895deb9118f4b938d0b70a3dd2ace19",
"credits": "999999491765",
"unitName": "金币",
......
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