Commit 5927b3de authored by wjf's avatar wjf

l

parent a317d322
......@@ -29,7 +29,7 @@
<body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" data-orientation="auto"
data-scale-mode="showAll" data-frame-rate="60" data-content-width="750" data-content-height="1624"
data-multi-fingered="2" data-show-fps="true" data-show-log="false" data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
data-multi-fingered="2" data-show-fps="false" data-show-log="false" data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<script src="libs/decomp.min.js"></script>
......@@ -43,6 +43,9 @@
<script src="libs/security.js"></script>
<script src="libs/downloadApp.js"></script>
<!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjs/5.4.0/math.js'></script> -->
<!-- 加密的两个js -->
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/aes.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/pad-zeropadding.js"></script>
<script>
// localStorage.clear();
// localStorage.setItem('currentLv','Gift2');
......
......@@ -23,15 +23,16 @@ import BoomNoPrizePanel from "../../src/panels/BoomNoPrizePanel";
import CashPrizePanel from "../../src/panels/CashPrizePanel";
import CashNoPrizePanel from "../../src/panels/CashNoPrizePanel";
import CashBigPrizePanel from "../../src/panels/CashBigPrize";
import { ajaxElement } from "../../src/hdTool";
export default class MainBase extends eui.UILayer {
constructor() {
super();
check_webp_feature();
Loading.instace.loadImage();
DataManager.ins.gameCfgData = window['CFG'];
DataManager.ins.gameCfgData.gameInfo.gameId = window["gameId"];
this.getData();
// DataManager.ins.gameCfgData = window['CFG'];
// DataManager.ins.gameCfgData.gameInfo.gameId = window["gameId"];
// this.getData();
}
protected registerModules() {
......@@ -58,9 +59,9 @@ export default class MainBase extends eui.UILayer {
panels.forEach(item => PanelCtrl.instance.registerPanel(item[0], item[1]));
scenes.forEach(item => SceneCtrl.instance.registerScene(item[0], item[1]));
NetManager.ins.onNotSuccess = (msg) => {
showAlertPanel(msg)
}
// NetManager.ins.onNotSuccess = (msg) => {
// showAlertPanel(msg)
// }
}
protected get startSceneConfig() {
......@@ -154,6 +155,7 @@ export default class MainBase extends eui.UILayer {
// }
private async runGame() {
await ajaxElement();
await this.loadResource()
if (!window['development'])
RES.getResAsync(`alert_json`);
......
......@@ -21,7 +21,7 @@ export default class Loading extends egret.Sprite {
_bg: egret.Bitmap;
_progress: egret.Bitmap;
loadImage() {
this.getBitmap(Loading.bg, (bitmap: egret.Bitmap) => {
const t = Date.now() - window['__startTime__'];
console.log(`首屏loading显示时间:${t}ms`);
......@@ -38,6 +38,13 @@ export default class Loading extends egret.Sprite {
this._progress.anchorOffsetX = this._progress.anchorOffsetY = 28;
this.addChild(this._progress);
})
//加个透明的,阻止事件
var bg: egret.Shape = new egret.Shape();
bg.graphics.beginFill(0x000000, 0);
bg.graphics.drawRect(0, 0, 750, 1624);
bg.graphics.endFill();
bg.touchEnabled = true;
this.addChildAt(bg, 0);
}
static get instace(): Loading {
......
......@@ -2,24 +2,27 @@ import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import { HtmlTextParser } from "../HtmlTextParser";
import Panel from "./Panel";
import { globalData } from "../../../src/hdTool";
export default class RulePanel extends Panel {
public labContent: eui.Label;
public scroller: eui.Scroller;
start() {
if (!DataManager.ins.getRuleData)
NetManager.ins.getRule(() => {
this.addRule();
});
else
this.addRule();
// if (!DataManager.ins.getRuleData)
// NetManager.ins.getRule(() => {
// this.addRule();
// });
// else
this.addRule();
}
group: eui.Group;
private addRule() {
const text = DataManager.ins.getRuleData.ruleText;
this.labContent.textFlow = (new HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
// const text = DataManager.ins.getRuleData.ruleText;
// this.labContent.textFlow = (new HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
this.labContent.textFlow = (new HtmlTextParser).parser(globalData.rule || "");
// console.log(this.labContent)
}
get skinKey() { return 'Rule' }
get skinKey() { return 'Rule' }
}
\ No newline at end of file
{
"type": "activity",
"name": "game"
"name": "qiaoqiaoban1207"
}
\ No newline at end of file
......@@ -24,8 +24,8 @@ class TuiaAutoUpload {
var _this = this;
this.client = new OSS({
region: 'oss-cn-hangzhou',
accessKeyId: 'LTAIdGi1IOap7fkF',
accessKeySecret: 'SKrOOp6EVtDGEV47yn0t2h97gyNioQ',
accessKeyId: 'LTAI4Fw25WcfcGv7FvcHoiHK',
accessKeySecret: 'NZk1NtT9J5HFaAolNbtQdzTzLLvLYm',
bucket: _this.type === 'prod' ? 'duiba' : 'daily-duiba'
});
this.bar = new ProgressBar(chalk.yellow(` 文件上传中 [:bar] :current/${this.files().length} :percent :elapseds`), {
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert","version":5,"files":["../assets/alert/alertbg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert","version":5,"files":["..\\assets\\alert\\alertbg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"boomnoprize","version":5,"files":["../assets/boomnoprize/boomnoprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"boomnoprize","version":5,"files":["..\\assets\\boomnoprize\\boomnoprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"boomprize","version":5,"files":["../assets/boomprize/getbtn.png","../assets/boomprize/boomprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"boomprize","version":5,"files":["..\\assets\\boomprize\\getbtn.png","..\\assets\\boomprize\\boomprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashbigprize","version":5,"files":["../assets/cashbigprize/cashbigprizebg.png","../assets/cashbigprize/getbtn2.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashbigprize","version":5,"files":["..\\assets\\cashbigprize\\cashbigprizebg.png","..\\assets\\cashbigprize\\getbtn2.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashnoprize","version":5,"files":["../assets/cashnoprize/cashnoprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashnoprize","version":5,"files":["..\\assets\\cashnoprize\\cashnoprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashprize","version":5,"files":["../assets/cashprize/getbtn3.png","../assets/cashprize/cashprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"cashprize","version":5,"files":["..\\assets\\cashprize\\getbtn3.png","..\\assets\\cashprize\\cashprizebg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["..\\assets\\startScene\\title.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule","version":5,"files":["../assets/rule/X.png","../assets/rule/ruleBg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule","version":5,"files":["..\\assets\\rule\\X.png","..\\assets\\rule\\ruleBg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start","version":5,"files":["../assets/startScene/toast.png","../assets/startScene/toast_success.png","../assets/startScene/toast_failed.png","../assets/startScene/startbtnGray.png","../assets/startScene/startbtn.png","../assets/startScene/ruleBtn.png","../assets/startScene/recordbtn.png","../assets/startScene/rankBtn.png","../assets/startScene/optionBtn.png","../assets/startScene/getit.png","../assets/startScene/closeBtn.png","../assets/startScene/btnRight1.png","../assets/startScene/btnRight.png","../assets/startScene/btnLeft1.png","../assets/startScene/btnLeft.png","../assets/startScene/boomalert.png","../assets/startScene/bg3.png","../assets/startScene/arrow.png","../assets/startScene/转盘前景.png","../assets/startScene/小丑+转盘.png","../assets/startScene/显示器纹路.png","../assets/startScene/碗前盖.png","../assets/startScene/碗后盖.png","../assets/startScene/甜筒-已获得.png","../assets/startScene/甜筒-未获得.png","../assets/startScene/甜甜圈-已获得.png","../assets/startScene/甜甜圈-未获得.png","../assets/startScene/糖果-已获得.png","../assets/startScene/糖果-未获得.png","../assets/startScene/前景.png","../assets/startScene/目标.png","../assets/startScene/礼盒-已获得.png","../assets/startScene/礼盒-未获得.png","../assets/startScene/垃圾桶前盖.png","../assets/startScene/垃圾桶后盖.png","../assets/startScene/垃圾桶.png","../assets/startScene/进度条-已显示.png","../assets/startScene/进度条-未显示.png","../assets/startScene/金蛋-已获得.png","../assets/startScene/金蛋-未获得.png","../assets/startScene/奖品.png","../assets/startScene/红包gray.png","../assets/startScene/红包.png","../assets/startScene/灯2.png","../assets/startScene/灯1.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start","version":5,"files":["..\\assets\\startScene\\toast.png","..\\assets\\startScene\\toast_success.png","..\\assets\\startScene\\toast_failed.png","..\\assets\\startScene\\startbtnGray.png","..\\assets\\startScene\\startbtn.png","..\\assets\\startScene\\ruleBtn.png","..\\assets\\startScene\\recordbtn.png","..\\assets\\startScene\\rankBtn.png","..\\assets\\startScene\\optionBtn.png","..\\assets\\startScene\\getit.png","..\\assets\\startScene\\closeBtn.png","..\\assets\\startScene\\btnRight1.png","..\\assets\\startScene\\btnRight.png","..\\assets\\startScene\\btnLeft1.png","..\\assets\\startScene\\btnLeft.png","..\\assets\\startScene\\boomalert.png","..\\assets\\startScene\\bg3.png","..\\assets\\startScene\\arrow.png","..\\assets\\startScene\\转盘前景.png","..\\assets\\startScene\\小丑+转盘.png","..\\assets\\startScene\\显示器纹路.png","..\\assets\\startScene\\碗前盖.png","..\\assets\\startScene\\碗后盖.png","..\\assets\\startScene\\甜筒-已获得.png","..\\assets\\startScene\\甜筒-未获得.png","..\\assets\\startScene\\甜甜圈-已获得.png","..\\assets\\startScene\\甜甜圈-未获得.png","..\\assets\\startScene\\糖果-已获得.png","..\\assets\\startScene\\糖果-未获得.png","..\\assets\\startScene\\前景.png","..\\assets\\startScene\\目标.png","..\\assets\\startScene\\礼盒-已获得.png","..\\assets\\startScene\\礼盒-未获得.png","..\\assets\\startScene\\垃圾桶前盖.png","..\\assets\\startScene\\垃圾桶后盖.png","..\\assets\\startScene\\垃圾桶.png","..\\assets\\startScene\\进度条-已显示.png","..\\assets\\startScene\\进度条-未显示.png","..\\assets\\startScene\\金蛋-已获得.png","..\\assets\\startScene\\金蛋-未获得.png","..\\assets\\startScene\\奖品.png","..\\assets\\startScene\\红包gray.png","..\\assets\\startScene\\红包.png","..\\assets\\startScene\\灯2.png","..\\assets\\startScene\\灯1.png","..\\assets\\startScene\\title.png"]}
\ No newline at end of file
......@@ -5,7 +5,7 @@
"name": "rule"
},
{
"keys": "toast_png,toast_success_png,toast_failed_png,startscenebg_jpg,startbtnGray_png,startbtn_png,ruleBtn_png,recordbtn_png,rankBtn_png,optionBtn_png,getit_png,closeBtn_png,btnRight1_png,btnRight_png,btnLeft1_png,btnLeft_png,boomalert_png,bg3_png,arrow_png,转盘前景_png,小丑+转盘_png,显示器纹路_png,碗前盖_png,碗后盖_png,甜筒-已获得_png,甜筒-未获得_png,甜甜圈-已获得_png,甜甜圈-未获得_png,糖果-已获得_png,糖果-未获得_png,前景_png,目标_png,礼盒-已获得_png,礼盒-未获得_png,垃圾桶前盖_png,垃圾桶后盖_png,垃圾桶_png,进度条-已显示_png,进度条-未显示_png,金蛋-已获得_png,金蛋-未获得_png,奖品_png,红包gray_png,红包_png,灯2_png,灯1_png",
"keys": "toast_png,toast_success_png,toast_failed_png,startscenebg_jpg,startbtnGray_png,startbtn_png,ruleBtn_png,recordbtn_png,rankBtn_png,optionBtn_png,getit_png,closeBtn_png,btnRight1_png,btnRight_png,btnLeft1_png,btnLeft_png,boomalert_png,bg3_png,arrow_png,转盘前景_png,小丑+转盘_png,显示器纹路_png,碗前盖_png,碗后盖_png,甜筒-已获得_png,甜筒-未获得_png,甜甜圈-已获得_png,甜甜圈-未获得_png,糖果-已获得_png,糖果-未获得_png,前景_png,目标_png,礼盒-已获得_png,礼盒-未获得_png,垃圾桶前盖_png,垃圾桶后盖_png,垃圾桶_png,进度条-已显示_png,进度条-未显示_png,金蛋-已获得_png,金蛋-未获得_png,奖品_png,红包gray_png,红包_png,灯2_png,灯1_png,title_png",
"name": "start"
},
{
......@@ -31,6 +31,10 @@
{
"keys": "alertbg_png",
"name": "alert"
},
{
"keys": "title_png",
"name": "preload"
}
],
"resources": [
......@@ -412,6 +416,11 @@
"url": "assets/extra/candy_icon.png",
"type": "image",
"name": "candy_icon_png"
},
{
"url": "assets/startScene/title.png",
"type": "image",
"name": "title_png"
}
]
}
\ No newline at end of file
......@@ -15,6 +15,7 @@
<e:Image id="leftbasket" source="垃圾桶后盖_png" x="69.5" y="1214.5" anchorOffsetX="64"/>
<e:Image id="arrow" source="arrow_png" y="1041" anchorOffsetX="275" anchorOffsetY="279" rotation="0" x="373"/>
<e:Image id="pipeline" source="bg3_png" y="0" x="0"/>
<e:Image id="title" y="0" x="0" source="title_png"/>
<e:Image id="fg" source="前景_png" x="0" y="1220"/>
<e:Image id="rightbasket1" source="碗前盖_png" x="645.5" y="1237.5" anchorOffsetX="93.5"/>
<e:Image id="leftbasket1" source="垃圾桶前盖_png" x="48" y="1217" anchorOffsetX="87.5"/>
......
This diff is collapsed.
......@@ -3,16 +3,27 @@ import Panel from "../../libs/new_wx/components/Panel";
import { LotteryType } from "../../libs/tw/enum/LotteryType";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { globalData } from "../hdTool";
export default class BoomPrizePanel extends Panel {
start(data) {
const lottery = DataManager.ins.getPlugOrderStatusData.lottery;
const lottery = globalData.lottery//DataManager.ins.getPlugOrderStatusData.lottery;
this.data = lottery;
this.data.imgurl = this.data.img = this.data.imgUrl;
this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio;
showPlugLog(lottery);
// showPlugLog(lottery);
//@ts-ignore
var type = lottery.type;
if (type == LotteryType.COUPON || type == LotteryType.LUCKY) {
this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio;
} else {
this.img.width = this.picBigWidth / this.bigPicRatio;
this.img.height = this.picBigWidth / this.bigPicRatio;
}
}
initEvents() {
......@@ -22,19 +33,19 @@ export default class BoomPrizePanel extends Panel {
}
onUse() {
const lottery = DataManager.ins.getPlugOrderStatusData.lottery;
const lottery: any = globalData.lottery;
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
window["downloadAppConfig"] =
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
window["downloadApp"]();
if (lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
}
// if (lottery.type == "lucky") {
// NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
// }
}
else {
window.location.href = lottery.link;
......
......@@ -14,6 +14,8 @@ import { playToastSuccess } from "./playMovieClip";
import doStart from "../../libs/new_tw/ctrls/doStart";
import wait from "../../libs/new_tc/wait";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { globalData, showToast, doJoin, getNgameStartStatus, getRecordUrl } from "../hdTool";
import Loading from "../../libs/new_wx/components/Loading";
export default class StartScene extends StartSceneBase {
_engine: Matter.Engine;
......@@ -53,6 +55,19 @@ export default class StartScene extends StartSceneBase {
super.start();
resetData();
initLevel(this);
//标题适配
if (this.stage.stageHeight < 1170) {
this["title"].y = 1170 - this.stage.stageHeight
}
//加个我的奖品按钮
let recordBtn = this.addChild(new eui.Image("//yun.duiba.com.cn/db_games/activity/qiaoqiaoban1207/recordBtn.png"))
recordBtn.x = 20, recordBtn.y = 15;
recordBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
recordBtn.touchEnabled = false;
setTimeout(() => { recordBtn.touchEnabled = true; }, 1000)
window.location.href = getRecordUrl('00');
}, this)
// console.log(recordBtn)
// wait(5000).then(()=>PanelCtrl.instance.addMask());
egret.lifecycle.onPause = () => {
console.log("app 进入后台");
......@@ -190,8 +205,28 @@ export default class StartScene extends StartSceneBase {
this['guide'].addChild(createMask())
this['startBtnBg'].addChild(createMask())
this.updateGetInfoView();
this.updateExemptionTxt();
// this.updateGetInfoView();
// this.updateExemptionTxt();
if (!globalData.element) return;
this.startBtn.visible = this['startBtnBg'].visible = this.countTxt.visible = true;
this.updateCountTxt();
}
updateCountTxt() {
const { freeLimit, status, needCredits, myCredits } = globalData.element;
if (freeLimit >= 1) {
this.countTxt.text = "免费游戏次数:" + freeLimit
} else if (status == 4) {
this.countTxt.text = "今日无剩余次数"
} else if (status == 3) {
this.countTxt.text = "无剩余次数"
}
else {
if (status == 1) {
this.countTxt.text = (window["CFG"].unitName || "积分") + "不足";
} else {
this.countTxt.text = "每局消耗" + needCredits + (window["CFG"].unitName || "积分");
}
}
}
async onPanelRemoved(e: egret.Event) {
......@@ -203,12 +238,12 @@ export default class StartScene extends StartSceneBase {
} else if (panel.type == ModuleTypes.CashBigPrize || panel.type == ModuleTypes.CashNoPrizePanel || panel.type == ModuleTypes.CashPrizePanel) {
resetLevel();
this['startBtnBg'].visible = this['startBtn'].visible = this['countTxt'].visible = true;
this.updateStartBtnStatus();
// this.updateStartBtnStatus();
this.updateCountTxt();
}
else if (panel.type == ModuleTypes.ALERT_PANEL) {
this['startBtnBg'].visible = this['startBtn'].visible = this['countTxt'].visible = true;
this.updateStartBtnStatus();
// this.updateStartBtnStatus();
this.updateCountTxt();
}
}
......@@ -235,15 +270,60 @@ export default class StartScene extends StartSceneBase {
}
onTap_startBtn(e?: egret.Event) {
doStart((success) => {
if (!success) return;
wait(1000).then(() => NetManager.ins.getInfo())
this['startBtnBg'].visible = false;
this['startBtn'].visible = false;
this['countTxt'].visible = false;
createItems(this);
});
// doStart((success) => {
// if (!success) return;
// wait(1000).then(() => NetManager.ins.getInfo())
// this['startBtnBg'].visible = false;
// this['startBtn'].visible = false;
// this['countTxt'].visible = false;
// createItems(this);
// });
if (window["CFG"].isNotLoginUser) {
showToast("您未登录,正在尝试登录中")
// console.log('调用登录方法');
if (window['requirelogin']) {
window['requirelogin']();
} else if (window['requireLogin']) {
window['requireLogin']();
} else {
}
}
//没有次数
else if (globalData.element) {
//判断次数
const { freeLimit, status } = globalData.element;
if (freeLimit >= 1) {
this.doJoin();
} else if (status == 4 || status == 3) {
showToast("参与次数已达上限")
} else {
if (status == 1) {
showToast((window["CFG"].unitName || "积分") + "不足")
} else {
this.doJoin()
}
}
} else {
showToast("网络异常,请稍后再试")
}
}
async doJoin() {
console.log(123213)
Loading.instace.show()
const doJoinData = await doJoin()
Loading.instace.hide();
if (doJoinData.success) { //轮询
Loading.instace.show();
const startData = await getNgameStartStatus(doJoinData.data)
Loading.instace.hide();
if (startData.success) {//轮询成功
this['startBtnBg'].visible = false;
this['startBtn'].visible = false;
this['countTxt'].visible = false;
createItems(this);
}
}
}
destroy() {
......
......@@ -5,14 +5,15 @@ import Loading from "../../libs/new_wx/components/Loading";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { award } from "./collisionConfig";
import { stopCreateItems } from "./createItems";
import createItems, { stopCreateItems } from "./createItems";
import LabelType from "./LabelType";
import { addItem, clearLevel, isAllLevelPass, isLevelPass, nextLevel } from "./level";
import { addItem, clearLevel, isAllLevelPass, isLevelPass, nextLevel, updateLevelView } from "./level";
import { playBoom, playBoomAlert, playSuccess, playToast, playToastSuccess } from "./playMovieClip";
import StartScene from "./StartScene";
import vibrate from "./vibrate";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { LotteryType } from "../../libs/tw/enum/LotteryType";
import { submit, getOrderStatus, ajaxElement } from "../hdTool";
const removeAward = (_this: StartScene) => {
const bodies = Matter.Composite.allBodies(_this._engine.world);
......@@ -40,9 +41,12 @@ const check = (_this: StartScene) => {
// _this._egretRender._root.graphics.drawRect(center2 - paddingX2, ypos2, paddingX2 * 2, h2);
// _this._egretRender._root.graphics.endFill();
let isSubmit = false;
const bodies = Matter.Composite.allBodies(_this._engine.world);
const isAward = (i: Matter.Body) => { return i.collisionFilter.group == award }
bodies.forEach(async (i) => {
if (isSubmit) return;
if (!isAward(i)) return;
if (i['timer']) {
const t0 = Date.now() - i['timer'];
......@@ -90,16 +94,19 @@ const check = (_this: StartScene) => {
playBoom(_this['group']);
removeAward(_this);
stopCreateItems();
await wait(700);
Loading.instace.show();
plugDoJoin((success) => {
Loading.instace.hide();
if (success)
if (plugIsWinning())
PanelCtrl.instance.show(ModuleTypes.BoomPrizePanel);
else
PanelCtrl.instance.show(ModuleTypes.BoomNoPrizePanel);
}, window['pluginID']);
await updateLevelView(false);
await playToastSuccess(_this, 0);
createItems(_this);
// await wait(700);
// Loading.instace.show();
// plugDoJoin((success) => {
// Loading.instace.hide();
// if (success)
// if (plugIsWinning())
// PanelCtrl.instance.show(ModuleTypes.BoomPrizePanel);
// else
// PanelCtrl.instance.show(ModuleTypes.BoomNoPrizePanel);
// }, window['pluginID']);
}
}
else {
......@@ -112,19 +119,52 @@ const check = (_this: StartScene) => {
stopCreateItems();
removeAward(_this);
// Loading.instace.show();
// plugDoJoin((success) => {
// Loading.instace.hide();
// if (success)
// if (plugIsWinning()) {
// if (DataManager.ins.getPlugOrderStatusData.lottery.type == LotteryType.ALIPAY)
// PanelCtrl.instance.show(ModuleTypes.CashBigPrize);
// else
// PanelCtrl.instance.show(ModuleTypes.CashPrizePanel);
// }
// else
// PanelCtrl.instance.show(ModuleTypes.CashNoPrizePanel);
// }, window['pluginBigPrizeID']);
Loading.instace.show();
plugDoJoin((success) => {
Loading.instace.hide();
if (success)
if (plugIsWinning()) {
if (DataManager.ins.getPlugOrderStatusData.lottery.type == LotteryType.ALIPAY)
PanelCtrl.instance.show(ModuleTypes.CashBigPrize);
else
PanelCtrl.instance.show(ModuleTypes.CashPrizePanel);
}
else
isSubmit = true;
submit().then((res) => {
if (res.success) {
//轮询了
getOrderStatus().then((rr) => {
if (rr.success) {
Loading.instace.hide();
var lottery = rr.data.lottery
//中奖弹框
if (!lottery || lottery.type == "thanks") {
PanelCtrl.instance.show(ModuleTypes.CashNoPrizePanel);
} else {
if (lottery.type == LotteryType.ALIPAY)
PanelCtrl.instance.show(ModuleTypes.CashBigPrize);
else
PanelCtrl.instance.show(ModuleTypes.CashPrizePanel);
}
} else {
//重新获取数据
ajaxElement().then((r) => {
Loading.instace.hide();
PanelCtrl.instance.show(ModuleTypes.CashNoPrizePanel);
})
}
})
} else {//失败
ajaxElement().then((r) => {
Loading.instace.hide();
PanelCtrl.instance.show(ModuleTypes.CashNoPrizePanel);
}, window['pluginBigPrizeID']);
})
}
})
} else {
playToastSuccess(_this)
......
......@@ -35,6 +35,7 @@ const ontick = () => {
frameInterval = 60;
dir = null;
}
// if(i==0)i = Math.floor(Math.random() * types.length);
// i=4;
const type = types[i];
let body;
......
......@@ -104,7 +104,24 @@ const config = {
},
'/summer/getOrderStatus':{
data: './json/getSummerOrderStatus.json'
}
},
'/hdtool/refactor/ngame/submit': {
data: './json/ngameSubmit.json'
},
'/hdtool/recon/ajaxElement': {
data: './json/ajaxElement.json'
},
'/hdtool/recon/getOrderStatus': {
data: './json/getOrderStatus.json'
},
'/hdtool/recon/doJoin': {
data: './json/doJoin.json'
},
'/hdtool/recon/ngame/getNgameStartStatus': {
data: './json/getNgameStartStatus.json'
},
}
for (let item in config) {
......
{
"success": true,
//闯关信息
"throughCurrent": "1",
"throughMode": 3,
"throughNum": 1,
"throughCurrentStep": 8,
"jsTest": "//yun.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191434.js",
//弹层js
"cssTest": "//yun.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191440.css",
//弹层css
"rule": "欢迎加入夺宝大作战",
"type": "hdtool",
"options": [
{
"hidden": false,
"id": 212949,
"logo": "//yun.duiba.com.cn/upload/uP99F1462438316972.png",
"name": "谢谢参与",
"prizeType": "thanks"
"code": "0000000000",
"data": {
"creditsConf": {
"creditsUp": 100,
"creditsType": "virtual",
"creditsDown": 50,
"prize": [
{
"img": "adsfsadf",
"credits": 20,
"id": 4,
"title": "0.3"
},
{
"img": "sadfasdf",
"credits": 150,
"id": 3,
"title": "1.5倍"
},
{
"img": "sadfasdf",
"credits": 100,
"id": 2,
"title": "1倍"
},
{
"img": "sadfasdf",
"credits": 50,
"id": 1,
"title": "0.5倍"
}
]
},
"floating": {
"jsTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191434.js",
"cssTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191440.css"
},
{
"hidden": false,
"id": 212951,
"logo": "//yun.duiba.com.cn/upload/uP99F1462438316972.png",
"name": "谢谢参与",
"prizeType": "thanks"
"options": [
{
"itemId": 47861,
"hidden": false,
"prizeType": "thanks",
"name": "谢谢参与",
"description": "",
"logo": "//yun1.duiba.com.cn/upload/uP99F1462438316972.png",
"id": 15581
},
{
"itemId": 47862,
"hidden": false,
"prizeType": "lucky",
"name": "幸运福袋",
"description": "",
"logo": "//yun1.duiba.com.cn/webapp/img/luckynewn.png",
"id": 15582
},
{
"itemId": 47863,
"scoreArea": "",
"hidden": false,
"prizeType": "alipay",
"name": "支付宝1",
"description": "",
"logo": "//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"id": 15585
},
{
"itemId": 47864,
"scoreArea": "",
"hidden": false,
"prizeType": "alipay",
"name": "支付宝1",
"description": "",
"logo": "//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"id": 15585
}
],
"rule": "adsfasdfasd啊实打实爱的额求稳怕哦i求稳怕请问赔钱片尾曲哦物品i区乌日千万人i去我日哦确认iqo【iadsfasdfasd啊实打实爱的额求稳怕哦i求稳怕请问赔钱片尾曲哦物品i区乌日千万人i去我日哦确认iqo【iadsfasdfasd啊实打实爱的额求稳怕哦i求稳怕请问赔钱片尾曲哦物品i区乌日千万人i去我日哦确认iqo【i",
"type": "hdtool",
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 999999632167,
"freeLimit": 5,
"success": false,
"myCredits": "999999632167",
"needCredits": "100",
"freeEmpty": true,
"needCreditsLong": 9,
"status": 7
},
"coinPusherConf": {
"exchangeRate": 60,
"creditsGear": "25,60,75,80"
}
],
"element": {
"isCreditsTypeOpen": false,
"freeLimit": 104,
"myCredits": "858102",
"needCredits": "2",
"status": 5
}
}
},
"success": true,
"desc": "OK",
"timestamp": 1548832971636
}
\ No newline at end of file
{
"needCredits": 0,
"status": 1,
"orderId": "544328581298130001",
"success": false,
"message": "我靠又报错了"
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":123456
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1550570639368,
"data":{
"orderId":"883006813674240289",
"submitToken":"d895deb9118f4b938d0b70a3dd2ace19",
"credits":"999999491765",
"unitName":"金币",
"consumerCredits":999999491765
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548923950498,
"data":{
"element":{
"success":false,
"isCreditsTypeOpen":false,
"needCredits":"100",
"myCredits":"1123",
"myCreditsLong":1123,
"needCreditsLong":9,
"freeLimit":2,
"status":6,
"freeEmpty":true
},
"lottery":{
"id":null,
"type":"111",
"imgUrl":"//yun.duiba.com.cn/images/201607/73htz55ih9.jpg",
"link":null,
"title":"重复券测试grape",
"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,
"appHidden":true,
"zybangJson":null
},
"exposure":11111,
"creditsInfo":{
"activityId":82567,
"prizeId":4,
"orderNum":null,
"developerBizId":"3029576",
"score":null,
"recordStatus":1,
"errorMsg":null
},
"againTag":null
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1550646190489,
"data":{
"score":100,
"maxScore":100
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment