Commit 750d53bc authored by wildfirecode's avatar wildfirecode

1

parent db167370
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="HelpBloodSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="help_blood_1_bg_png" y="26" horizontalCenter="0"/>
<e:Image source="help_blood_1_bg_png" y="26" horizontalCenter="0" visible="false"/>
<e:Group y="855" horizontalCenter="0">
<e:Image id="helpbtn" source="help_blood_1_btn_png" x="0" y="0"/>
<e:Image id="gobtn" source="help_blood_fail_btn_png" x="0" y="0" visible="false"/>
</e:Group>
<e:Group y="88" width="100%" horizontalCenter="0">
<e:Group y="108" width="100%" horizontalCenter="0">
<e:Image id="txt_standby" source="help_blood_1_text_png" y="0" horizontalCenter="0" visible="false"/>
<e:Image id="txt_success" source="help_blood_success_text2_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error2002002026" source="help_blood_fail_text_png" horizontalCenter="0" visible="false"/>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="HelpInviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="g1">
</e:Group>
<e:Image y="26" horizontalCenter="0" source="help_invite2_png"/>
<e:Group y="855" horizontalCenter="0">
<e:Image id="helpbtn" x="0" y="0" source="help_invite2_btn_png"/>
......
......@@ -3,16 +3,16 @@
<e:Image y="240" horizontalCenter="0" source="help_invite_bg_png"/>
<e:Group y="695" horizontalCenter="0">
<e:Image id="helpbtn" y="0" source="help_invite_btn1_png" horizontalCenter="0"/>
<e:Image id="gobtn2" x="0" y="0" source="help_invite_fail_btn_png" visible="false"/>
<e:Image id="gobtn1" source="help_invite_success_btn_png" horizontalCenter="0" visible="false"/>
<e:Image id="go2btn" x="0" y="0" source="help_invite_fail_btn_png" visible="false"/>
<e:Image id="go1btn" source="help_invite_success_btn_png" horizontalCenter="0" visible="false"/>
</e:Group>
<e:Group y="294" width="100%" horizontalCenter="0">
<e:Image id="txt_standby" y="0" horizontalCenter="0" source="help_invite_text_png" visible="false"/>
<e:Image id="txt_success" horizontalCenter="0" source="help_invite_success_txt_png" visible="false"/>
<e:Image id="txt_error1" source="help_invite_fail_text1_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error400017" source="help_invite_fail_text2_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error0" source="help_invite_fail_text3_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error2" horizontalCenter="0" source="help_invite_fail_text4_png" visible="false"/>
<e:Image id="txt_error0000024" source="help_invite_fail_text1_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error0000022" source="help_invite_fail_text2_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_error0000023" source="help_invite_fail_text3_png" horizontalCenter="0" visible="false"/>
<e:Image id="txt_errorxxxx" horizontalCenter="0" source="help_invite_fail_text4_png" visible="false"/>
</e:Group>
<e:Image id="closeBtn" source="help_closebtn1_png" x="613" y="238"/>
</e:Skin>
\ No newline at end of file
......@@ -392,7 +392,7 @@ export default class MapScene extends Scene {
if (!window['development']) {
RES.getResAsync(`inviterulepanel_json`);
}
}, 5 * 1000);
}, 10 * 1000);
loadFireworks();
......
......@@ -3,10 +3,14 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import { gotoNextLevel } from "../gotoNextLevel";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
export default class HelpBloodPanel extends Panel {
netCallback;
code;
mv1;
mv2;
start(data) {
this.netCallback = data.netCallback;
this.code = data.code;
......@@ -16,6 +20,57 @@ export default class HelpBloodPanel extends Panel {
this['helpbtn'].once(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
this['txt_standby'].visible = true;
this['helpbtn'].visible = true;
loadSvga(getResPath() + 'resource/assets/svgas/blood_success.svga', this).then((mv: egret.DisplayObject) => {
mv.touchEnabled = false;
mv.visible = false;
this.mv1 = mv;
this.mv1.y = -250;
this.tostandby1();
this.mv1.addEventListener(egret.Event.ENTER_FRAME, () => {
if (this.mv1.currentFrame == this.mv1_end)
this.mv1.gotoAndPlay(this.mv1_start);
if (this.mv1.currentFrame == 420) {
this.mv1_start = 421;
this.mv1_end = this.mv1.totalFrames;
}
}, this);
});
loadSvga(getResPath() + 'resource/assets/svgas/blood_fail.svga', this).then((mv: egret.DisplayObject) => {
mv.touchEnabled = false;
mv.visible = true;
this.mv2 = mv;
this.mv2.y = -250;
this.tostandby2();
this.mv2.addEventListener(egret.Event.ENTER_FRAME, () => {
if (this.mv2.currentFrame == this.mv2_end)
this.mv2.gotoAndPlay(this.mv2_start);
if (this.mv2.currentFrame == 420) {
this.mv2_start = 421;
this.mv2_end = this.mv2.totalFrames;
}
}, this);
});
}
mv1_start;
mv1_end;
mv2_start;
mv2_end;
tostandby1() {
this.mv1_start = 1;
this.mv1_end = 180;
}
toAction1() {
this.mv1.gotoAndPlay(181);
}
toAction2() {
this.mv2.gotoAndPlay(181);
}
tostandby2() {
this.mv2_start = 1;
this.mv2_end = 180;
}
onclick_gobtn() {
......@@ -27,17 +82,21 @@ export default class HelpBloodPanel extends Panel {
onClick() {
this['helpbtn'].visible = false;
this['gobtn'].visible = true;
this.mv1.visible = false;
this.mv2.visible = false;
NetManager.ins.showLog(getlogItem(88));
NetManager.ins.clickLog(getlogItem(87));
NetManager.ins.doHelpNew((s, res) => {
this.netCallback();
this['txt_standby'].visible = false;
// doHelpFlag = true;
if (s) {
this.mv1.visible = true;
this['txt_success'].visible = true;
// showToast("助力成功!一起闯关赢现金吧")
this.toAction1();
} else {
this.toAction2();
this.mv2.visible = true;
var codeMsgs = {//具体code还没给
"2002002016": "不可以给自己助力哦~",//
"2002002036": "已经给好友助力过了哦~",
......
......@@ -4,6 +4,8 @@ import { getlogItem } from "../../Main";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import { gotoNextLevel } from "../gotoNextLevel";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
export default class HelpInvitePanel extends Panel {
netCallback;
......@@ -13,11 +15,14 @@ export default class HelpInvitePanel extends Panel {
this.code = data.code;
// NetManager.ins.showLog(getlogItem(87));
this['go1btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['go2btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['gobtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['helpbtn'].once(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
this['txt_standby'].visible = true;
this['helpbtn'].visible = true;
loadSvga(getResPath() + 'resource/assets/svgas/invitebg.svga', this).then((mv: egret.DisplayObject) => {
this['g1'].addChild(mv)
});
}
onclick_gobtn() {
......
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";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { gotoNextLevel } from "../gotoNextLevel";
import { DataManager } from "../../../libs/tw/manager/DataManager";
export default class HelpScratchPanel extends Panel {
netCallback;
......@@ -13,12 +11,17 @@ export default class HelpScratchPanel extends Panel {
this.code = data.code;
// NetManager.ins.showLog(getlogItem(87));
this['gobtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['closeBtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_closeBtn, this);
this['go2btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['go1btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['helpbtn'].once(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
this['txt_standby'].visible = true;
this['helpbtn'].visible = true;
}
onclick_closeBtn() {
this.hidePanel();
}
onclick_gobtn() {
// NetManager.ins.clickLog(getlogItem(88));
this.hidePanel();
......@@ -27,28 +30,46 @@ export default class HelpScratchPanel extends Panel {
onClick() {
this['helpbtn'].visible = false;
this['gobtn'].visible = true;
const _code = this.code.slice(8);
NetManager.ins.scratchDoHelp((success, res) => {
this.netCallback();
switch (true) {
case (res.code == "0000024"):
showToast("今日刮卡次数已达到上线限哦~");
break;
case (res.code == "0000022"):
showToast("不可以给自己刮哦~");
break;
case (res.code == "0000023"):
showToast("已经给好友刮过了哦~");
break;
default:
break;
}
if (!success) {
return;
this['txt_standby'].visible = false;
if (success) {
this['go1btn'].visible = true;
this['txt_success'].visible = true;
} else {
this['go2btn'].visible = true;
var codeMsgs = {
"0000024": "今日刮卡次数已达到上线限哦~",
"0000022": "不可以给自己刮哦~",
"0000023": "已经给好友刮过了哦~",
}
if (res && codeMsgs[res.code] && this[`txt_error${res.code}`]) {
this[`txt_error${res.code}`].visible = true;
} else {
showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败");
}
}
showToast("助力成功,参与闯关赢现金"/*"帮刮成功!"*/);
// switch (true) {
// case (res.code == "0000024"):
// showToast("今日刮卡次数已达到上线限哦~");
// break;
// case (res.code == "0000022"):
// showToast("不可以给自己刮哦~");
// break;
// case (res.code == "0000023"):
// showToast("已经给好友刮过了哦~");
// break;
// default:
// break;
// }
// if (!success) {
// return;
// }
// showToast("助力成功,参与闯关赢现金"/*"帮刮成功!"*/);
}, _code);
}
......
{
"success": false,
"success": true,
"code": "2002002036",
"desc": "OK",
"timestamp": 1571052938097,
......
{
"success":true,
"code":null,
"success":0,
"code":"0000023",
"desc":null,
"timestamp":1566199822308,
"data":""
......
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