Commit f0ccd722 authored by wildfirecode's avatar wildfirecode

1

parent 5548bfb0
...@@ -243,6 +243,10 @@ ...@@ -243,6 +243,10 @@
{ {
"keys": "help_invite2_text4_png,help_invite2_text3_png,help_invite2_text2_png,help_invite2_text_png,help_invite2_btn2_png,help_invite2_btn_png,help_invite_text_png,help_invite_success_txt_png,help_invite_success_btn_png,help_invite_fail_text4_png,help_invite_fail_text3_png,help_invite_fail_text2_png,help_invite_fail_text1_png,help_invite_fail_btn_png,help_invite_btn1_png,help_invite_bg_png,help_closebtn1_png,help_blood_success_text2_png,help_blood_success_text_png,help_blood_fail_text4_png,help_blood_fail_text3_png,help_blood_fail_text2_png,help_blood_fail_text_png,help_blood_fail_btn_png,help_blood_1_text_png,help_blood_1_btn_png", "keys": "help_invite2_text4_png,help_invite2_text3_png,help_invite2_text2_png,help_invite2_text_png,help_invite2_btn2_png,help_invite2_btn_png,help_invite_text_png,help_invite_success_txt_png,help_invite_success_btn_png,help_invite_fail_text4_png,help_invite_fail_text3_png,help_invite_fail_text2_png,help_invite_fail_text1_png,help_invite_fail_btn_png,help_invite_btn1_png,help_invite_bg_png,help_closebtn1_png,help_blood_success_text2_png,help_blood_success_text_png,help_blood_fail_text4_png,help_blood_fail_text3_png,help_blood_fail_text2_png,help_blood_fail_text_png,help_blood_fail_btn_png,help_blood_1_text_png,help_blood_1_btn_png",
"name": "helpGroup" "name": "helpGroup"
},
{
"name": "preload",
"keys": "help_light_png"
} }
], ],
"resources": [ "resources": [
...@@ -5081,6 +5085,11 @@ ...@@ -5081,6 +5085,11 @@
"url": "assets/help/help_invite_btn1.png", "url": "assets/help/help_invite_btn1.png",
"type": "image", "type": "image",
"name": "help_invite_btn1_png" "name": "help_invite_btn1_png"
},
{
"name": "help_light_png",
"type": "image",
"url": "assets/help/help_light.png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="HelpScratchSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="HelpScratchSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image y="240" horizontalCenter="0" source="help_invite_bg_png"/> <e:Image id="light" source="help_light_png" y="401.34" x="381.82" anchorOffsetX="381.82" anchorOffsetY="421.22"/>
<e:Group y="695" horizontalCenter="0"> <e:Image y="352.12" horizontalCenter="0" source="help_invite_bg_png"/>
<e:Group y="807.12" horizontalCenter="0">
<e:Image id="helpbtn" y="0" source="help_invite_btn1_png" horizontalCenter="0"/> <e:Image id="helpbtn" y="0" source="help_invite_btn1_png" horizontalCenter="0"/>
<e:Image id="go2btn" x="0" y="0" source="help_invite_fail_btn_png" 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:Image id="go1btn" source="help_invite_success_btn_png" horizontalCenter="0" visible="false"/>
</e:Group> </e:Group>
<e:Group y="294" width="100%" horizontalCenter="0"> <e:Group y="406.12" width="100%" horizontalCenter="0">
<e:Image id="txt_standby" y="0" horizontalCenter="0" source="help_invite_text_png" visible="false"/> <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_success" horizontalCenter="0" source="help_invite_success_txt_png" visible="false"/>
<e:Image id="txt_error0000024" source="help_invite_fail_text1_png" horizontalCenter="0" visible="false"/> <e:Image id="txt_error0000024" source="help_invite_fail_text1_png" horizontalCenter="0" visible="false"/>
...@@ -14,5 +15,5 @@ ...@@ -14,5 +15,5 @@
<e:Image id="txt_error0000023" source="help_invite_fail_text3_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:Image id="txt_errorxxxx" horizontalCenter="0" source="help_invite_fail_text4_png" visible="false"/>
</e:Group> </e:Group>
<e:Image id="closeBtn" source="help_closebtn1_png" x="613" y="238"/> <e:Image id="closeBtn" source="help_closebtn1_png" x="613" y="350.12"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -2,25 +2,58 @@ import Panel from "../../../libs/new_wx/components/Panel"; ...@@ -2,25 +2,58 @@ import Panel from "../../../libs/new_wx/components/Panel";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import { gotoNextLevel } from "../gotoNextLevel"; 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 HelpScratchPanel extends Panel { export default class HelpScratchPanel extends Panel {
netCallback; netCallback;
code; code;
start(data) { list: any[];
async start(data) {
this.netCallback = data.netCallback; this.netCallback = data.netCallback;
this.code = data.code; this.code = data.code;
// NetManager.ins.showLog(getlogItem(87));
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 5000);
this['light'].visible = false;
this['closeBtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_closeBtn, this); this['closeBtn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_closeBtn, this);
this['txt_standby'].visible = true;
this['helpbtn'].visible = true;
this.list = await Promise.all([
loadSvga(getResPath() + 'resource/assets/svgas/scratch_standby.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/scratch_success.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/scratch_fail.svga'),
]);
this['go2btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this); this['go2btn'].once(egret.TouchEvent.TOUCH_TAP, this.onclick_gobtn, this);
this['go1btn'].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['helpbtn'].once(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
this['txt_standby'].visible = true;
this['helpbtn'].visible = true; const w = [313, 433, 356];
const y = [180, 20, 140];
this.list.forEach((i, index) => {
i.gotoAndStop(1);
this.addChildAt(i, 1);
i.visible = false;
i.touchEnabled = false;
i.anchorOffsetX = w[index] / 2;
i.x = 750 / 2;
i.y = y[index];
});
wait(1000).then(async () => {
this.list[0].visible = true;
await play2(this.list[0]);
this['light'].visible = true;
});
} }
onclick_closeBtn() { onclick_closeBtn() {
this.hidePanel(); this.hidePanel();
} }
onclick_gobtn() { onclick_gobtn() {
// NetManager.ins.clickLog(getlogItem(88)); // NetManager.ins.clickLog(getlogItem(88));
...@@ -29,18 +62,25 @@ export default class HelpScratchPanel extends Panel { ...@@ -29,18 +62,25 @@ export default class HelpScratchPanel extends Panel {
} }
onClick() { onClick() {
this['light'].visible = false;
this['helpbtn'].visible = false; this['helpbtn'].visible = false;
this.list[0].visible = false;
const _code = this.code.slice(8); const _code = this.code.slice(8);
NetManager.ins.scratchDoHelp((success, res) => { NetManager.ins.scratchDoHelp(async (success, res) => {
this.netCallback(); this.netCallback();
this['txt_standby'].visible = false; this['txt_standby'].visible = false;
if (success) { if (success) {
this['go1btn'].visible = true; this['go1btn'].visible = true;
this['txt_success'].visible = true; this['txt_success'].visible = true;
this.list[1].visible = true;
await play2(this.list[1]);
this['light'].visible = true;
} else { } else {
this['go2btn'].visible = true; this['go2btn'].visible = true;
this.list[2].visible = true;
await play2(this.list[2]);
var codeMsgs = { var codeMsgs = {
"0000024": "今日刮卡次数已达到上线限哦~", "0000024": "今日刮卡次数已达到上线限哦~",
"0000022": "不可以给自己刮哦~", "0000022": "不可以给自己刮哦~",
...@@ -51,6 +91,7 @@ export default class HelpScratchPanel extends Panel { ...@@ -51,6 +91,7 @@ export default class HelpScratchPanel extends Panel {
} else { } else {
showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败"); showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败");
} }
} }
// switch (true) { // switch (true) {
...@@ -71,7 +112,7 @@ export default class HelpScratchPanel extends Panel { ...@@ -71,7 +112,7 @@ export default class HelpScratchPanel extends Panel {
// } // }
// showToast("助力成功,参与闯关赢现金"/*"帮刮成功!"*/); // showToast("助力成功,参与闯关赢现金"/*"帮刮成功!"*/);
}, _code); }, _code);
} }
get skinResKey() { return 'helpGroup' } get skinResKey() { return 'helpGroup' }
get skinKey() { return 'HelpScratch' } get skinKey() { return 'HelpScratch' }
......
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