Commit ebf253c0 authored by wildfirecode's avatar wildfirecode

Merge branch 'hotfix20200326' into dev

parents 9e6afd87 70debc38
......@@ -78,6 +78,7 @@ import ShopTipPanel from "../../src/panels/ShopTipPanel";
import RechargePanel from "../../src/panels/RechargePanel";
import BombTips2Panel from "../../src/panels/BombTips2Panel";
import BackIndexPanel from "../../src/panels/BackIndexPanel";
import HelpBloodPanel from "../../src/panels/help/HelpBloodPanel";
export default class MainBase extends eui.UILayer {
constructor() {
......@@ -166,6 +167,7 @@ export default class MainBase extends eui.UILayer {
['taskCenterNoPrize', { cls: TaskCenterNoPrize }],
['shopTip', { cls: ShopTipPanel }],
['recharge', { cls: RechargePanel }],
['HelpBloodPanel', { cls: HelpBloodPanel }],
];
const scenes = [
......
......@@ -2,6 +2,7 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/HelpBloodSkin.exml",
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="HelpBloodSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Image source="help_blood_1_bg_png" y="26" horizontalCenter="0"/>
<e:Image source="help_blood_1_btn_png" y="752" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
......@@ -55,39 +55,16 @@ export default class MapScene extends Scene {
private icons = {};
private actIcon: ActIcon = null;
sendInvite() {
private sendInvite() {
const code = Utils.getRequestByKey('shareCode') || Utils.getRequestByKey('token');//0224新加用token取一边
if (!code) return;
if (doHelpFlag) {
return;
}
//0224修改,取sceneCode,
const sceneCode = Utils.getRequestByKey('sceneCode')
if (sceneCode == CodeChannels.AddBlood) {//加体力的,0228到时会修改成助力,这里要加逻辑
//if (window["test0228"]) {//测试助力,到时失败code再和后端对接
NetManager.ins.doHelpNew((s, res) => {
doHelpFlag = true;
if (s) {
NetManager.ins.showLog(getlogItem(83))
showToast("助力成功!一起闯关赢现金吧")
}
else {
var codeMsgs = {//具体code还没给
"2002002016": "不可以给自己助力哦~",//
"2002002036": "已经给好友助力过了哦~",
// "2002002037": "已经给好友助力过了哦~",
"2002002025": "今日助力次数已达上限啦!",
//新加的,还没给,其他的都用助力失败
"2002002013": "口令无效,请复制正确的口令!",
"2002002015": "口令不存在",
"2002002026": "好友今日被助力已达上限啦!"
}
showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败");
}
}, code)
// } else {
// showToast("欢迎小主,闯关就能拿现金~");
// }
if (sceneCode == CodeChannels.AddBlood) {
const netCallback = ()=>{ doHelpFlag = true; };
PanelCtrl.instance.show('HelpBloodPanel',{netCallback:netCallback,code:code});
}
else if (sceneCode == CodeChannels.RankPlay) {//排行榜邀请好友的,不需要了
showToast("欢迎加入游戏,去闯关吧");
......
......@@ -155,59 +155,7 @@ export default class StartPanel extends Panel {
onTap_startBtn() {
const homeData = getHomeData();
if (homeData.remainEnargy <= 0) {
if (/*homeData.askForEnergy*/this.askForEnergyCount) {
PanelCtrl.instance.show('blood2Panel');
} else {
if (iswx()) {
getShareUrl(this.stage);
NetManager.ins.hc_askForEnergy((success) => {
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
wait(2000).then(() => {
showToast('分享成功~');
});
})
} else {
// if (window["test0228"]) {
//如果之前没获取到,就再发接口,几率很低
if (!DataManager.ins.getData("getUserShareCode")) {
this.touchEnabled = false
this.touchChildren = false
NetManager.ins.getUserShareCode((s, res) => {
this.touchEnabled = true
this.touchChildren = true
if (!s) {
showToast("获取分享信息失败,请重试")
} else {
showShareCodePanel(
CodeChannels.AddBlood,
res.data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
)
}
})
} else {
showShareCodePanel(
CodeChannels.AddBlood,
DataManager.ins.getData("getUserShareCode").data,
() => { wait(2000).then(() => { showToast('分享成功'); }); }
);
}
// } else {
// showShareCodePanel(CodeChannels.AddBlood, null, () => {
// NetManager.ins.hc_askForEnergy((success) => {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId']);
// wait(2000).then(() => {
// showToast('分享成功');
// });
// })
// });
// }
}
}
PanelCtrl.instance.show('blood2Panel');
return;
}
......
import Panel from "../../../libs/new_wx/components/Panel";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
export default class HelpBloodPanel extends Panel {
netCallback;
code;
start(data) {
this.netCallback = data.netCallback;
this.code = data.code;
}
onClick(){
NetManager.ins.doHelpNew((s, res) => {
this.netCallback();
// doHelpFlag = true;
if (s) {
NetManager.ins.showLog(getlogItem(83))
showToast("助力成功!一起闯关赢现金吧")
}
else {
var codeMsgs = {//具体code还没给
"2002002016": "不可以给自己助力哦~",//
"2002002036": "已经给好友助力过了哦~",
// "2002002037": "已经给好友助力过了哦~",
"2002002025": "今日助力次数已达上限啦!",
//新加的,还没给,其他的都用助力失败
"2002002013": "口令无效,请复制正确的口令!",
"2002002015": "口令不存在",
"2002002026": "好友今日被助力已达上限啦!"
}
showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败");
}
}, this.code)
}
get skinResKey() { return 'helpGroup' }
}
\ No newline at end of file
......@@ -2780,7 +2780,7 @@
"num": 3
}
],
"remainEnargy": 99,
"remainEnargy": 0,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150
......
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