Commit 063c86e8 authored by wjf's avatar wjf

l

parent aeb79820
......@@ -430,8 +430,17 @@ export class NetManager extends ABNetManager {
};
this.send(net);
}
hc_submit(callback: Function, gamedata,score?): void {
/**
*
* @param callback
* @param orderId 订单id,来自doJoin,,DataManager.ins.getData("hc_doJoin").data
* @param score 关卡
* @param gameData json带分数和通关元素
* @param submitToken token,来自getNgameStartStatus,,DataManager.ins.getData("getNgameStartStatus").data.submitToken
*/
hc_submit(callback: Function, orderId: number, score: number, gameData: string, submitToken: string): void {
const sign = this.createSgin(orderId, score, gameData, submitToken);
NetName.CUSTOM_DO_JOIN
const net: INetData = {
name: 'hc_submit',
uri: '/hdtool/happyclear/submit',
......@@ -439,10 +448,12 @@ export class NetManager extends ABNetManager {
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId,
gameData: gamedata,
gameData: gameData,
sign: sign,
dynamicData: JSON.stringify([]),
detect: window['detect'],
deviceSessionId: window['_device_session_id'],
score:score
deviceSessionId: window['_device_session_id'],
score: score,
},
hideMsg: true,
callback: callback
......@@ -464,6 +475,13 @@ export class NetManager extends ABNetManager {
this.send(net);
}
/**
*
* @param callback
* @param orderId DataManager.ins.getData("doJoin").data,或hc_doJoin
* @param pollingCheck
* @param pollingCount
*/
getOrderStatus(callback: Function, orderId: number, pollingCheck?: Function, pollingCount = 10): void {
const param: any = {
orderId: orderId
......@@ -814,19 +832,19 @@ export class NetManager extends ABNetManager {
this.send(net);
}
public hc_exchange(callback: Function, category: number, propType?: number): void {
const d:any = {
const d: any = {
activityId: DataManager.ins.customCfgData.actId,
category: category
};
if(propType) {
d.propType=propType;
if (propType) {
d.propType = propType;
}
const net: INetData = {
name: 'hc_exchange',
uri: '/customActivity/happyclear/exchange',
type: 'post',
dataType: 'json',
param:d ,
param: d,
callback: callback
};
this.send(net);
......@@ -970,16 +988,16 @@ export class NetManager extends ABNetManager {
this.getToken(net);
}
public hc_doJoin(callback: Function,score: number,detect,deviceSessionId): void {
public hc_doJoin(callback: Function, score: number, detect, deviceSessionId): void {
const param: any = {
activityId: DataManager.ins.customCfgData.actId,
activityType: 'hdtool',
score:score,
score: score,
consumerId: window['CFG'].consumerId,
detect: window['detect'],
deviceSessionId: window['_device_session_id']
};
const net: INetData = {
name: 'hc_doJoin',
uri: '/hdtool/happyclear/doJoin',
......
......@@ -9,7 +9,7 @@ import { Lattice } from '../something/class/Lattice';
import { Pool } from '../something/Pool';
import { RecoverName } from '../something/enum/RecoverName';
import { Element } from '../something/class/Element';
import { ElementType, submitTran } from '../something/enum/ElementType';
import { ElementType, submitTran, codeMsgs } from '../something/enum/ElementType';
import { EffectType } from '../something/enum/EffectType';
import { BoomAni } from '../something/anis/BoomAni';
import { IceAni } from '../something/anis/IceAni';
......@@ -87,6 +87,8 @@ export default class MainScene extends Scene {
get skinKey() { return 'Main' }
exposure
chapterData: ChapterData;
//关数
chapter:number
//所有的格子数组
lattices: Lattice[];
//最后一行的行数
......@@ -192,11 +194,11 @@ export default class MainScene extends Scene {
//初始化索引信息
Tool.init();
//第几关
// var chapter = (data && data.chapter) ? data.chapter : 1;
var chapter = 20
this.chapterTxt.text = "第" + chapter + "关";
// this.chapter = (data && data.chapter) ? data.chapter : 1;
this.chapter = 20;
this.chapterTxt.text = "第" + this.chapter + "关";
//关卡数据
this.chapterData = Chapters[chapter];
this.chapterData = Chapters[this.chapter];
this.initUi();
this.initSvgas();
//先禁掉事件
......@@ -236,10 +238,10 @@ export default class MainScene extends Scene {
//引导提示
if (chapter <= 5) {
if (this.chapter <= 5) {
Loading.instace.show()
let g = new GuideMsg();
g.init(chapter, () => {
g.init(this.chapter, () => {
Loading.instace.hide()
this.addChild(g);
this.enableMouseEvt(true);
......@@ -2034,9 +2036,8 @@ export default class MainScene extends Scene {
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)
DataManager.ins.getData("hc_doJoin").data,
() => { return DataManager.ins.getCustomOrderStatusData.code == "C000000001"; })
} else {
Loading.instace.hide();
if (!data) {
......@@ -2047,14 +2048,19 @@ export default class MainScene extends Scene {
this.submit(json);
}, 1300)
} else {
//提交失败
showToast("提交失败")
//提交失败,根据错误码显示错误信息
var txt = codeMsgs[data.code] || "提交失败";
showToast(txt);
setTimeout(() => {
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE);
}, 1300)
}
}
}, json)
},
DataManager.ins.getData("hc_doJoin").data,
this.chapter,
json,
DataManager.ins.getData("getNgameStartStatus").data.submitToken)
}
/**
......
......@@ -11,6 +11,13 @@ export enum ElementType {
LOLLIPOP,//棒棒糖6
ICE,//冰块7
}
export const codeMsgs = {
"E1002090011": "用户关卡记录异常",
"E1002090012": "暂不能挑战此关卡",
"E1002090015": "关卡目标未完成",
"E1002090016": "游戏数据提交异常",
"E1002090017": "游戏关卡配置异常或关卡暂未开放",
}
//提交时候的对应字段字段,分数额外,字段是1
export const submitTran = {
0: 4,
......
......@@ -45,18 +45,26 @@ export class ScoreProgress {
}
}
w = (663 - 595) * scale + 595;
if (this.star3.source != "lightedStar_png") this.star3.source = "lightedStar_png";
if (this.star3.source != "lightedStar_png") {
this.star3.source = "lightedStar_png";
this.starCount = 3;
};
}
else if (value >= this.starScores[1]) {
scale = (value - this.starScores[1]) / (this.starScores[2] - this.starScores[1]);
w = (595 - 522) * scale + 522;
if (this.star2.source != "lightedStar_png") this.star2.source = "lightedStar_png";
if (this.star2.source != "lightedStar_png") {
this.star2.source = "lightedStar_png";
this.starCount = 2;
};
}
else if (value >= this.starScores[0]) {
scale = (value - this.starScores[0]) / (this.starScores[1] - this.starScores[0]);
w = (522 - 446) * scale + 446;
if (this.star1.source != "lightedStar_png") this.star1.source = "lightedStar_png";
if (this.star1.source != "lightedStar_png") {
this.star1.source = "lightedStar_png";
this.starCount = 1;
};
} else {
scale = value / this.starScores[0];
w = (446 - 188) * scale + 188;
......
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