Commit da2a36e3 authored by wildfirecode's avatar wildfirecode

1

parent f0ccd722
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/help/help_light.png"]}
\ No newline at end of file
......@@ -241,12 +241,8 @@
"name": "eleDisNew"
},
{
"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,help_card_prize_png,help_light_png,help_card_bg_png",
"name": "helpGroup"
},
{
"name": "preload",
"keys": "help_light_png"
}
],
"resources": [
......@@ -5087,9 +5083,19 @@
"name": "help_invite_btn1_png"
},
{
"name": "help_light_png",
"url": "assets/help/help_light.png",
"type": "image",
"name": "help_light_png"
},
{
"url": "assets/help/help_card_prize.png",
"type": "image",
"name": "help_card_prize_png"
},
{
"url": "assets/help/help_card_bg.png",
"type": "image",
"url": "assets/help/help_light.png"
"name": "help_card_bg_png"
}
]
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
<e:Image id="go1btn" source="help_invite_success_btn_png" horizontalCenter="0" visible="false"/>
</e:Group>
<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"/>
<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_error0000022" source="help_invite_fail_text2_png" horizontalCenter="0" visible="false"/>
......@@ -16,4 +16,6 @@
<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="350.12"/>
<e:Image source="help_card_bg_png" y="497.48" x="94"/>
<e:Image id="prizeImg" source="help_card_prize_png" x="121.5" y="517.96" width="508" height="227"/>
</e:Skin>
\ No newline at end of file
......@@ -20,6 +20,7 @@ export default class HelpBloodPanel extends Panel {
NetManager.ins.showLog(getlogItem(87));
const s = new egret.Sprite();
this.addChildAt(s,0);
s.y=-250;
this['txt_standby'].visible = true;
this['helpbtn'].visible = true;
......
......@@ -14,12 +14,14 @@ export default class HelpInvitePanel extends Panel {
this.code = data.code;
// NetManager.ins.showLog(getlogItem(87));
const s = new egret.Sprite();
this.addChildAt(s,0);
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);
s.addChild(mv);
mv.y = -180;
});
......
......@@ -11,6 +11,29 @@ export default class HelpScratchPanel extends Panel {
netCallback;
code;
list: any[];
private myShape: egret.Shape = new egret.Shape();
private pIndex = 0;
setGtaphics(x, y) {
setTimeout(() => {
if (this.pIndex % 2 == 0) { // 双数
y -= 25;
if (y <= this["prizeImg"].y) {
this.pIndex++;
}
} else { // 单数
y += 25;
if (y >= (this["prizeImg"].y + this["prizeImg"].height)) {
this.pIndex++;
}
}
x += 5;
this.myShape.graphics.lineTo(x, y);
if (x > this["prizeImg"].x + (+this.data.completePercent) / 100 * this["prizeImg"].width - 60) {
return;
}
this.setGtaphics(x, y);
}, 20);
}
async start(data) {
this.netCallback = data.netCallback;
this.code = data.code;
......@@ -50,6 +73,23 @@ export default class HelpScratchPanel extends Panel {
await play2(this.list[0]);
this['light'].visible = true;
});
this.myShape.graphics.beginFill(0xff0000, 0);
this.myShape.graphics.drawRect(this["prizeImg"].x, this["prizeImg"].y, this["prizeImg"].width, this["prizeImg"].height);
this.myShape.graphics.endFill();
this.addChild(this.myShape);
this["prizeImg"].mask = this.myShape;
this.myShape.graphics.lineStyle(130, 0xff0000, 1);
this.myShape.graphics.moveTo(this["prizeImg"].x - 30, this["prizeImg"].y + this["prizeImg"].height);
// setTimeout(() => {
// }, 2000);
}
startAni() {
this.setGtaphics(this["prizeImg"].x - 30, this["prizeImg"].y + this["prizeImg"].height);
}
onclick_closeBtn() {
......@@ -62,25 +102,24 @@ export default class HelpScratchPanel extends Panel {
}
onClick() {
this['light'].visible = false;
this['helpbtn'].visible = false;
this.list[0].visible = false;
const _code = this.code.slice(8);
NetManager.ins.scratchDoHelp(async (success, res) => {
this.netCallback();
this.startAni();
await wait(2000);
this['txt_standby'].visible = false;
this.list[0].visible = false;
this['light'].visible = false;
this['helpbtn'].visible = false;
if (success) {
this['go1btn'].visible = true;
this['txt_success'].visible = true;
this.list[1].visible = true;
await play2(this.list[1]);
this['light'].visible = true;
} else {
this['go2btn'].visible = true;
this.list[2].visible = true;
await play2(this.list[2]);
var codeMsgs = {
"0000024": "今日刮卡次数已达到上线限哦~",
"0000022": "不可以给自己刮哦~",
......@@ -91,26 +130,9 @@ export default class HelpScratchPanel extends Panel {
} else {
showToast(res && codeMsgs[res.code] ? codeMsgs[res.code] : "助力失败");
}
play2(this.list[2]);
}
// 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":0,
"success":1,
"code":"0000023",
"desc":null,
"timestamp":1566199822308,
......
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