Commit 5ba6cf22 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 83601044 7508ba81
......@@ -46,6 +46,8 @@ import { getlogItem } from '../Main';
import getHomeData, { getPropNums } from '../getHomeData';
import PropType from '../PropType';
import { PropNumShow } from '../something/uis/PropNumShow';
import { NetName } from '../../libs/tw/enum/NetName';
import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl';
// import BridgeFactory from "../../libs/JSBridge/bridge/BridgeFactory";
const aniClass = {
......@@ -190,8 +192,8 @@ export default class MainScene extends Scene {
//初始化索引信息
Tool.init();
//第几关
var chapter = (data && data.chapter) ? data.chapter : 1;
// var chapter = 19
// var chapter = (data && data.chapter) ? data.chapter : 1;
var chapter = 20
this.chapterTxt.text = "第" + chapter + "关";
//关卡数据
this.chapterData = Chapters[chapter];
......@@ -239,11 +241,29 @@ export default class MainScene extends Scene {
let g = new GuideMsg();
g.init(chapter, () => {
Loading.instace.hide()
this.addChild(g)
this.addChild(g);
this.enableMouseEvt(true);
})
}
//开启事件,具体不应该放在这里,到时看
this.enableMouseEvt(true);
} else {
//开启事件,具体不应该放在这里,到时看
this.enableMouseEvt(true);
}
//测试代码
var fail = new eui.Image(RES.getRes("guideKnowBtn_png"));
fail.x = 10;
fail.y = 10;
fail.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
playSound(SoundType.fail);
PanelCtrl.instance.show("failed");
}, this)
this.addChild(fail);
var sucess = new eui.Image(RES.getRes("guideKnowBtn_png"));
sucess.x = 474;
sucess.y = 10;
sucess.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
this.submit(JSON.stringify({ 1: 0 }))
}, this)
this.addChild(sucess)
}
/**
* 加载所有用到的svga
......@@ -1388,10 +1408,7 @@ export default class MainScene extends Scene {
//通关了
//提交分数等
var json = this.getSubmitJson()
console.log(json)
playSound(SoundType.sucess);
//区分奖品
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
this.submit(json)
}
return
}
......@@ -1983,7 +2000,7 @@ export default class MainScene extends Scene {
/**
* 获得提交数据的jsob
*/
getSubmitJson() {
getSubmitJson(): string {
var json = {};
//分数
json[1] = this.score;
......@@ -1995,7 +2012,49 @@ export default class MainScene extends Scene {
}
}
}
return json
return JSON.stringify(json)
}
/**
* 包括捞结果
* @param json
* @param callback
*/
submit(json: string) {
Loading.instace.show();
NetManager.ins.hc_submit((s, data) => {
if (s) {
NetManager.ins.getOrderStatus((s) => {
Loading.instace.hide();
playSound(SoundType.sucess);
if (s) {
//区分奖品,待写
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
} else {
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
},
DataManager.ins.getData(NetName.CUSTOM_DO_JOIN).data,
() => { return DataManager.ins.getData(NetName.CUSTOM_ORDER_STATUS).code == "C000000001"; },
10)
} else {
Loading.instace.hide();
if (!data) {
//错误弹框,网络错误
//提交失败
showToast("网络错误,再次连接中")
setTimeout(() => {
this.submit(json);
}, 1300)
} else {
//提交失败
showToast("提交失败")
setTimeout(() => {
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE);
}, 1300)
}
}
}, json)
}
/**
......
......@@ -595,7 +595,7 @@ export const Chapters: ChapterData[] = [
2, 2, 2, 1, 1, 1, 2, 2, 2,
2, 5, 5, 2, 2, 2, 5, 5, 2,
5, 5, 5, 5, 5, 5, 5, 5, 5,
2, 5, 2, 0, 1, 0, 2, 5, 2,
2, 5, 2, 0, 2, 0, 2, 5, 2,
],
generateLats: [0, 1, 2, 3, 4, 5, 6, 7, 8],
},
......
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