Commit 4e30504f authored by 邱旭's avatar 邱旭

1

parent b669348b
...@@ -349,6 +349,8 @@ export default class MainBase extends eui.UILayer { ...@@ -349,6 +349,8 @@ export default class MainBase extends eui.UILayer {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga'); loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga'); loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga');
loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga'); loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga');
RES.getResAsync('FZY4JW_TTF');
RES.getResAsync('FZY3JW_1_TTF');
} }
catch (e) { catch (e) {
console.error(e); console.error(e);
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
"name": "friendshare" "name": "friendshare"
}, },
{ {
"keys": "scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png,scratch_card_90_png,scratch_card_96_png,scratch_card_94_png,scratch_card_98_png,scratch_user1_png,scratch_card_bg_png,scratch_card_92_png,scratch_user2_png", "keys": "scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png,scratch_card_90_png,scratch_card_96_png,scratch_card_94_png,scratch_card_98_png,scratch_user1_png,scratch_card_bg_png,scratch_card_92_png,scratch_user2_png,scratch_mask_png",
"name": "scratch" "name": "scratch"
}, },
{ {
...@@ -2917,6 +2917,11 @@ ...@@ -2917,6 +2917,11 @@
"url": "assets/common/FZY4JW.TTF", "url": "assets/common/FZY4JW.TTF",
"type": "bin", "type": "bin",
"name": "FZY4JW_TTF" "name": "FZY4JW_TTF"
},
{
"url": "assets/scratch/scratch_mask.png",
"type": "image",
"name": "scratch_mask_png"
} }
] ]
} }
\ No newline at end of file
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
<e:Image id="hammer" source="bag_icon2_png" horizontalCenter="-6" verticalCenter="0.5" visible="false"/> <e:Image id="hammer" source="bag_icon2_png" horizontalCenter="-6" verticalCenter="0.5" visible="false"/>
<e:Image id="boom" source="bag_icon1_png" horizontalCenter="0" verticalCenter="0" visible="false"/> <e:Image id="boom" source="bag_icon1_png" horizontalCenter="0" verticalCenter="0" visible="false"/>
<e:Image id="change" source="bag_icon3_png" horizontalCenter="0" verticalCenter="0" visible="false"/> <e:Image id="change" source="bag_icon3_png" horizontalCenter="0" verticalCenter="0" visible="false"/>
<e:Label id="nums" text="15" textColor="0xc33700" right="10" bottom="10"/> <e:Label id="nums" text="15" textColor="0xc33700" right="10" bottom="10" fontFamily="FZY3JW"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -4,11 +4,10 @@ ...@@ -4,11 +4,10 @@
<w:Config id="16dd8f58b77" visible="false"/> <w:Config id="16dd8f58b77" visible="false"/>
<e:Image id="light2" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/> <e:Image id="light2" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/>
<e:Image id="light1" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/> <e:Image id="light1" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296" source="scratchbg2_png"/>
<e:Group id="con" y="58.03"/> <e:Group id="con" y="53.03"/>
<e:Label id="numLabel" text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0" verticalAlign="middle" textAlign="center" fontFamily="z2"/> <e:Label id="numLabel" text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="27" horizontalCenter="0" verticalAlign="middle" textAlign="center" fontFamily="FZY3JW"/>
<e:Image y="414" horizontalCenter="0" source="scratch_card_bg_png"/> <e:Image y="414" horizontalCenter="0" source="scratch_card_bg_png"/>
<e:Image id="prizeImg" y="435" source="" width="510" height="228" horizontalCenter="0"/> <e:Image id="prizeImg" y="435" source="" width="510" height="228" horizontalCenter="0"/>
<e:Image id="scratch_progress" y="414" horizontalCenter="0" x="10" source="scratch_card_90_png"/>
<e:Button id="closeBtn" label="" x="605" y="219.33"> <e:Button id="closeBtn" label="" x="605" y="219.33">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing"> <e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
...@@ -26,7 +25,7 @@ ...@@ -26,7 +25,7 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="895.33" size="28" textColor="0xffffff" horizontalCenter="0.5" fontFamily="z2" bold="true"/> <e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="895.33" size="28" textColor="0xffffff" horizontalCenter="0.5" fontFamily="FZY3JW"/>
<e:Label text="帮刮\n记录" y="805" size="28" textColor="0xFFFFFF" horizontalCenter="-248"/> <e:Label text="帮刮\n记录" y="805" size="28" textColor="0xFFFFFF" horizontalCenter="-248"/>
<e:Scroller width="487" height="90" y="783" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="32.5"> <e:Scroller width="487" height="90" y="783" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="32.5">
<e:Group anchorOffsetX="0" y="2"> <e:Group anchorOffsetX="0" y="2">
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
<e:Group id="progressGroup" x="8" verticalCenter="0"> <e:Group id="progressGroup" x="8" verticalCenter="0">
<e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/> <e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/>
<e:Rect id="progress" fillColor="0xeb1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/> <e:Rect id="progress" fillColor="0xeb1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/>
<e:Label id="progressLabel" text="仅剩90.7%" size="18" verticalCenter="2" horizontalCenter="0.5" bold="true" verticalAlign="middle" textAlign="center" fontFamily="z2"/> <e:Label id="progressLabel" text="仅剩90.7%" size="18" verticalCenter="2" horizontalCenter="0.5" bold="true" verticalAlign="middle" textAlign="center" fontFamily="FZY3JW"/>
</e:Group> </e:Group>
<e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/> <e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="StartSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16705cb4eec"/> <w:Config id="16705cb4eec"/>
<e:Label id="FZYTW3" text="1" y="1048" textColor="0x244B00" fontFamily="FZYTW3" horizontalCenter="0"/> <e:Label id="FZY3JW" text=" " y="1048" textColor="0x244B00" fontFamily="FZY3JW" horizontalCenter="0" visible="false"/>
<e:Label id="FZYTW4" text="1" y="1048" textColor="0x244B00" fontFamily="FZYTW4" horizontalCenter="0"/> <e:Label id="FZY4JW" text=" " y="1048" textColor="0x244B00" fontFamily="FZY4JW" horizontalCenter="0" visible="false"/>
<e:Component id="container1" width="20" height="20" x="0" y="0"/> <e:Component id="container1" width="20" height="20" x="0" y="0"/>
<e:Component id="container2" width="20" height="20" x="0" y="0"/> <e:Component id="container2" width="20" height="20" x="0" y="0"/>
<e:Group x="140" y="1023.94"> <e:Group x="140" y="1023.94">
......
...@@ -7,18 +7,58 @@ import ScratchRulePanel from "./ScratchRulePanel"; ...@@ -7,18 +7,58 @@ import ScratchRulePanel from "./ScratchRulePanel";
import CutTimer from "../CutTimer"; import CutTimer from "../CutTimer";
import Utils from "../Utils"; import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import GradientType = egret.GradientType;
export default class ScratchPanel extends Panel { export default class ScratchPanel extends Panel {
private cutTimer: CutTimer; private cutTimer: CutTimer;
private myShape: egret.Shape = new egret.Shape();
constructor(data) { constructor(data) {
super(); super();
this.data = data; this.data = data;
} }
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.data.completePercent) / 100 * this["prizeImg"].width){
return;
}
this.setGtaphics(x, y);
}, 20);
}
async start(data) { async start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this.initUI();
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"].width);
setTimeout(()=>{
this.setGtaphics(this["prizeImg"].x, this["prizeImg"].y + this["prizeImg"].height);
}, 500);
const scratchData = DataManager.ins.getData('hc_turnableDojoin'); const scratchData = DataManager.ins.getData('hc_turnableDojoin');
this['light1'].visible = this['light2'].visible = false; this['light1'].visible = this['light2'].visible = false;
...@@ -76,7 +116,7 @@ export default class ScratchPanel extends Panel { ...@@ -76,7 +116,7 @@ export default class ScratchPanel extends Panel {
} }
protected onSkinComplete() { protected onSkinComplete() {
this.getGameRes().then(r => this.initUI());
} }
initUI() { initUI() {
...@@ -148,24 +188,24 @@ export default class ScratchPanel extends Panel { ...@@ -148,24 +188,24 @@ export default class ScratchPanel extends Panel {
let _duration = 1000 * dProgress / 100; // 算出变化的时间 let _duration = 1000 * dProgress / 100; // 算出变化的时间
egret.Tween.get(this["progress"]).to({width: _width}, _duration); egret.Tween.get(this["progress"]).to({width: _width}, _duration);
let i = new eui.Image(); let i = new eui.Image();
if(progress >= 100) { // if(progress >= 100) {
this["scratch_progress"].visible = false; // this["scratch_progress"].visible = false;
} else if(progress >= 98 && progress < 100) { // } else if(progress >= 98 && progress < 100) {
this["scratch_progress"].visible = true; // this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_98_png"; // this["scratch_progress"].source = "scratch_card_98_png";
} else if(progress >= 96 && progress < 98) { // } else if(progress >= 96 && progress < 98) {
this["scratch_progress"].visible = true; // this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_96_png"; // this["scratch_progress"].source = "scratch_card_96_png";
} else if(progress >= 94 && progress < 96) { // } else if(progress >= 94 && progress < 96) {
this["scratch_progress"].visible = true; // this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_94_png"; // this["scratch_progress"].source = "scratch_card_94_png";
} else if(progress >= 92 && progress < 96) { // } else if(progress >= 92 && progress < 96) {
this["scratch_progress"].visible = true; // this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_92_png"; // this["scratch_progress"].source = "scratch_card_92_png";
} else if(progress < 92) { // } else if(progress < 92) {
this["scratch_progress"].visible = true; // this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_90_png"; // this["scratch_progress"].source = "scratch_card_90_png";
} // }
} }
private setWXShareTip() { private setWXShareTip() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"prizeImage": "//yun.dui88.com/images/201910/9u6nk8sjt8.jpg", "prizeImage": "//yun.dui88.com/images/201910/9u6nk8sjt8.jpg",
"currentTime": 1572405066290, "currentTime": 1572405066290,
"endTime": 1572491337000, "endTime": 1572491337000,
"completePercent": "91.0", "completePercent": "96",
"remainPercent": "9.0", "remainPercent": "9.0",
"totalNeedCount": 1, "totalNeedCount": 1,
"helpedCount": 0, "helpedCount": 0,
......
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