Commit 6095739c authored by wildfirecode's avatar wildfirecode

1

parent ade6577a
......@@ -2,9 +2,6 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/HelpScratchSkin.exml",
"resource/skins/HelpBloodSkin.exml",
"resource/skins/HelpInviteSkin.exml",
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
......@@ -35,6 +32,9 @@
"resource/skins/HbNoPrizeSkin.exml",
"resource/skins/HbPrizeSkin.exml",
"resource/skins/HbRuleSkin.exml",
"resource/skins/HelpBloodSkin.exml",
"resource/skins/HelpInviteSkin.exml",
"resource/skins/HelpScratchSkin.exml",
"resource/skins/IconButtonSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteItemSkin.exml",
......
<?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:Group id="g1" y="-250"> </e:Group>
<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"/>
......
......@@ -5,74 +5,96 @@ import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import { gotoNextLevel } from "../gotoNextLevel";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import { play2 } from "./svgaTool";
import wait from "../../../libs/new_tc/wait";
export default class HelpBloodPanel extends Panel {
netCallback;
code;
mv1;
mv2;
start(data) {
// mv1;
// mv2;
list: any[];
async start(data) {
this.netCallback = data.netCallback;
this.code = data.code;
NetManager.ins.showLog(getlogItem(87));
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/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);
this.list = await Promise.all([
loadSvga(getResPath() + 'resource/assets/svgas/blood_standby.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/blood_success.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/blood_fail.svga'),
]);
this.list.forEach(i => {
i.gotoAndStop(1);
this.addChild(i);
i.visible = false;
i.touchEnabled = false;
i.y = -250;
});
}
this.list[0].visible = true;
this.list[0].gotoAndPlay(1);
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);
}
this['gobtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['helpbtn'].once(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
loadSvga(getResPath() + 'resource/assets/svgas/bloodbg.svga', this['g1']);
tostandby2() {
this.mv2_start = 1;
this.mv2_end = 180;
// 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() {
NetManager.ins.clickLog(getlogItem(88));
this.hidePanel();
......@@ -80,23 +102,26 @@ 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) => {
NetManager.ins.doHelpNew(async (s, res) => {
this.netCallback();
this['txt_standby'].visible = false;
if (s) {
this.mv1.visible = true;
play2(this.list[1]);
this.list[0].visible = false;
this.list[1].visible = true;
await wait(1200);
this['helpbtn'].visible = false;
this['gobtn'].visible = true;
this['txt_standby'].visible = false;
this['txt_success'].visible = true;
this.toAction1();
} else {
this.toAction2();
this.mv2.visible = true;
this.list[2].visible = true;
play2(this.list[2]);
this['helpbtn'].visible = false;
this['gobtn'].visible = true;
this['txt_standby'].visible = false;
var codeMsgs = {//具体code还没给
"2002002016": "不可以给自己助力哦~",//
"2002002036": "已经给好友助力过了哦~",
......
//播放完之后,在一个区间循环
// export const play1 = (mv, start, end, loopStart, loopEnd) => {
// const func1 = () => {
// if (mv.currentFrame == end)
// };
// mv.gotoAndPlay(start);
// mv.addEventListener(egret.Event.ENTER_FRAME, func1, this);
// mv.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);
// }
export const play2 = (mv, start = 1, end = -1) => {
return new Promise((r) => {
if (end == -1)
end = mv.totalFrames;
const func1 = () => {
if (mv.currentFrame == end) {
mv.stop();
mv.removeEventListener(egret.Event.ENTER_FRAME, func1, this);
r();
}
};
mv.gotoAndPlay(start);
mv.addEventListener(egret.Event.ENTER_FRAME, func1, this);
})
}
\ No newline at end of file
{
"success": true,
"success": 1,
"code": "2002002036",
"desc": "OK",
"timestamp": 1571052938097,
......
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