Commit 1947d6ad authored by wildfirecode's avatar wildfirecode

1

parent 568e10bd
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
"name": "turnrule" "name": "turnrule"
}, },
{ {
"keys": "turnnoprize再来一次_png,turnnoprize离奖励只差一毫米! 再来一次吧!_png,turnnoprize奖励溜走了,再试一次吧!_png,turnnoprize继续闯关_png,turnnoprize换个姿势再来一次!_png", "keys": "turnnoprize再来一次_png,turnnoprize离奖励只差一毫米! 再来一次吧!_png,turnnoprize奖励溜走了,再试一次吧!_png,turnnoprize继续闯关_png,turnnoprize换个姿势再来一次!_png,turnnoprizebg_png",
"name": "turntablenoprize" "name": "turntablenoprize"
}, },
{ {
...@@ -173,8 +173,8 @@ ...@@ -173,8 +173,8 @@
"name": "h52" "name": "h52"
}, },
{ {
"name": "preload", "keys": "turnprize2按钮_png,turnprize2bg_png",
"keys": "turnnoprizebg_png" "name": "turntableprize2"
} }
], ],
"resources": [ "resources": [
...@@ -2719,9 +2719,19 @@ ...@@ -2719,9 +2719,19 @@
"name": "turnnoprize再来一次2_png" "name": "turnnoprize再来一次2_png"
}, },
{ {
"name": "turnnoprizebg_png", "url": "assets/turnnoprize/turnnoprizebg.png",
"type": "image", "type": "image",
"url": "assets/turnnoprize/turnnoprizebg.png" "name": "turnnoprizebg_png"
},
{
"url": "assets/turnprize2/turnprize2按钮.png",
"type": "image",
"name": "turnprize2按钮_png"
},
{
"url": "assets/turnprize2/turnprize2bg.png",
"type": "image",
"name": "turnprize2bg_png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="TurntablePrize2" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="TurntablePrize2" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16e02c1ad57"/> <w:Config id="16e02c1ad57"/>
<e:Component y="788" skinName="ADSmallSkin" horizontalCenter="0" visible="false"/> <e:Image id="light2" source="invitebg2_png" x="376" y="297" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Image id="light2" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/> <e:Image id="light1" source="invitebg2_png" x="386" y="307" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Image id="light1" source="invitebg2_png" x="386" y="327" anchorOffsetX="356" anchorOffsetY="296"/> <e:Group id="container" y="-98.45" x="-3"/>
<e:Group id="container" y="-45.45" x="-3"/> <e:Image source="turnprize2bg_png" y="159" horizontalCenter="0"/>
<e:Image source="turprizebg_png" y="161" horizontalCenter="0.5"/> <e:Image width="508" height="225" source="{data.url}" horizontalCenter="0" y="333.76"/>
<e:Image width="508" height="225" source="{data.url}" horizontalCenter="0" y="355.76"/>
<e:Button id="closeBtn" label="" y="242.88" x="615"> <e:Button id="closeBtn" label="" y="242.88" x="615">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
...@@ -15,28 +14,5 @@ ...@@ -15,28 +14,5 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group y="631.67" horizontalCenter="0.5"> <e:Image id="btn" source="turnprize2按钮_png" y="677" horizontalCenter="0"/>
<e:Button id="btn1" label="" y="0" x="9.09">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turnnoprize再来一次_png" source.down="turnnoprize再来一次_png" source.disabled="turnnoprize再来一次_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btn2" label="" y="0" x="279">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="turprize继续闯关按钮_png" source.down="turprize继续闯关按钮_png" source.disabled="turprize继续闯关按钮_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="status1" x="52" y="60" visible="false">
<e:Label text=")" x="132" y="2" size="22" touchEnabled="false"/>
<e:Label id="nums" text="(-50" x="0" y="0" size="22" textAlign="right" width="82" touchEnabled="false"/>
<e:Image source="common_yuanbao_png" x="91.99" y="1.67"/>
</e:Group>
</e:Group>
<e:Label id="satus2" text="(免费次数:1)" x="169.3" y="693.66" size="22" touchEnabled="false" visible="false"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -71,12 +71,20 @@ export default class Turntable extends Panel { ...@@ -71,12 +71,20 @@ export default class Turntable extends Panel {
// Loading.instace.show(); // Loading.instace.show();
// GDispatcher.dispatchEvent('queryPrize'); // GDispatcher.dispatchEvent('queryPrize');
//1换个姿势再来一次2 奖励溜走了3 离奖励只差一毫米 //1换个姿势再来一次2 奖励溜走了3 离奖励只差一毫米
//抽奖结束
//如果是刮刮卡类型
this.updateIcon();
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => {
// await wait(100); // await wait(100);
PanelCtrl.instance.show('TurnPrizePanel', {mv:mv }); PanelCtrl.instance.show('TurnPrize2Panel', {mv:mv });
}); });
} }
updateIcon(){
GDispatcher.dispatchEvent("updateScratchTips");
}
// 设置全部按钮是否可以点击 // 设置全部按钮是否可以点击
private setBtnTouch(touchEnabled: boolean) { private setBtnTouch(touchEnabled: boolean) {
this.start_btn.touchEnabled = touchEnabled; this.start_btn.touchEnabled = touchEnabled;
......
import Panel from "../../../libs/new_wx/components/Panel"; import Panel from "../../../libs/new_wx/components/Panel";
import { addAdComp } from "../BoxPanel"; import { addAdComp } from "../BoxPanel";
import { gotoNextLevel } from "../gotoNextLevel";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { loadSvga } from "../../loadSvga"; import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import CutTimer from "../../CutTimer";
export default class TurnPrize2Panel extends Panel { export default class TurnPrize2Panel extends Panel {
start(data) { start(data) {
...@@ -12,7 +12,21 @@ export default class TurnPrize2Panel extends Panel { ...@@ -12,7 +12,21 @@ export default class TurnPrize2Panel extends Panel {
this.showlog(); this.showlog();
this.data.url = "http://yun.duiba.com.cn/db_games/1022/111.png"; this.data.url = "http://yun.duiba.com.cn/db_games/1022/111.png";
addAdComp(84, 788, this); this['light1'].visible = this['light2'].visible = false;
addAdComp(84, 816, this);
data.mv.gotoAndPlay(10, true)
data.mv.once(egret.Event.COMPLETE, () => {
data.mv.stop(1);
this.playBgAni();
}, this);
this['container'].addChild(data.mv);
}
playBgAni() {
this['light1'].visible = this['light2'].visible = true;
const time = 7000;
egret.Tween.get(this['light1'], { loop: true }).to({ rotation: 360 }, time);
egret.Tween.get(this['light2'], { loop: true }).to({ rotation: -360 }, time);
} }
showlog() { showlog() {
...@@ -22,22 +36,41 @@ export default class TurnPrize2Panel extends Panel { ...@@ -22,22 +36,41 @@ export default class TurnPrize2Panel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn1, this) this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn1, this)
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_btn2, this)
} }
onTap_btn1() {//再来一次 onTap_btn1() {
//if 有免费次数或积分充足 console.log('onTap_btn1');
//else show toast NetManager.ins.scratchGetTaskInfo((success, res) => {
console.log('再来一次'); if (!success) {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => { return;
// await wait(100); }
PanelCtrl.instance.show('turnTable', { onceAgain: 1,mv:mv }); const status = res.data.taskStatus;
}) switch (true) {
} case (status == 0): // 当前无任务(一般icon不会出现),拦截
this.hidePanel();
onTap_btn2() { break;
gotoNextLevel() case (status == 1): // 当前任务进行中 打开任务面板
loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga').then(async (mv: any) => {
// await wait(100);
res.data.mv = mv;
PanelCtrl.instance.show('scratch', res.data)
});
// PanelCtrl.instance.show('scratch', res.data);
break;
case (status == 2): // 当前任务完成待领奖 请求领奖接口
NetManager.ins.scratchTakePrize((success, res) => {
if (!success) {
return;
}
PanelCtrl.instance.show("scratchPrize", res.data);
}, res.data.scratchCardTaskId);
break;
default:
break;
}
});
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
...@@ -10,7 +10,7 @@ export default class TurnPrizePanel extends Panel { ...@@ -10,7 +10,7 @@ export default class TurnPrizePanel extends Panel {
super.start(); super.start();
this.showlog(); this.showlog();
// this.data.url = "http://yun.duiba.com.cn/db_games/1022/111.png"; this.data.url = "http://yun.duiba.com.cn/db_games/1022/111.png";
this['light1'].visible = this['light2'].visible = false; this['light1'].visible = this['light2'].visible = false;
addAdComp(84, 788, this); addAdComp(84, 788, this);
data.mv.gotoAndPlay(10, true) data.mv.gotoAndPlay(10, true)
......
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