Commit 7ad92407 authored by 邱旭's avatar 邱旭

1

parent cb6cf2a3
...@@ -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", "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_92_png,scratch_card_98_png,scratch_card_96_png,scratch_card_bg_png,scratch_card_94_png,scratch_card_90_png,scratch_user2_png,scratch_user1_png",
"name": "scratch" "name": "scratch"
}, },
{ {
...@@ -2592,6 +2592,46 @@ ...@@ -2592,6 +2592,46 @@
"url": "assets/back/backbg.png", "url": "assets/back/backbg.png",
"type": "image", "type": "image",
"name": "backbg_png" "name": "backbg_png"
},
{
"url": "assets/scratch/scratch_card_92.png",
"type": "image",
"name": "scratch_card_92_png"
},
{
"url": "assets/scratch/scratch_card_98.png",
"type": "image",
"name": "scratch_card_98_png"
},
{
"url": "assets/scratch/scratch_card_96.png",
"type": "image",
"name": "scratch_card_96_png"
},
{
"url": "assets/scratch/scratch_card_bg.png",
"type": "image",
"name": "scratch_card_bg_png"
},
{
"url": "assets/scratch/scratch_card_94.png",
"type": "image",
"name": "scratch_card_94_png"
},
{
"url": "assets/scratch/scratch_card_90.png",
"type": "image",
"name": "scratch_card_90_png"
},
{
"url": "assets/scratch/scratch_user2.png",
"type": "image",
"name": "scratch_user2_png"
},
{
"url": "assets/scratch/scratch_user1.png",
"type": "image",
"name": "scratch_user1_png"
} }
] ]
} }
\ No newline at end of file
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<e:Image y="259.33" source="scratch_bg_png" horizontalCenter="0"/> <e:Image y="259.33" source="scratch_bg_png" horizontalCenter="0"/>
<e:Group id="con" y="-67"/> <e:Group id="con" y="-67"/>
<e:Label id="numLabel" text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0" fontFamily="Lucida Family" verticalAlign="middle" textAlign="center"/> <e:Label id="numLabel" text="共2位好友帮你刮了90.3%" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0" fontFamily="Lucida Family" verticalAlign="middle" textAlign="center"/>
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source="" width="510" height="228"/> <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="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">
......
...@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel"; ...@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel";
import CutTimer from "../CutTimer"; import CutTimer from "../CutTimer";
export default class ScratchPanel extends Panel { export default class ScratchPanel extends Panel {
private invite_img: egret.Texture;
private cutTimer: CutTimer; private cutTimer: CutTimer;
constructor(data) { constructor(data) {
...@@ -89,13 +88,23 @@ export default class ScratchPanel extends Panel { ...@@ -89,13 +88,23 @@ export default class ScratchPanel extends Panel {
this.data.invitationUser = []; this.data.invitationUser = [];
} }
// 添加邀请图标
let dNum = this.data.invitationCount - this.data.invitationUser.length; let dNum = this.data.invitationCount - this.data.invitationUser.length;
for(let i = 0; i < dNum; i++) { for(let i = 0; i < dNum; i++) {
this.data.invitationUser.push({ this.data.invitationUser.push({
nickname: "nickname", nickname: "nickname",
avatar: this.invite_img, avatar: "scratch_invite_png",
}); });
} }
// 添加假用户
this.data.invitationUser.unshift({
nickname: "nickname",
avatar: "scratch_user1_png",
}, {
nickname: "nickname",
avatar: "scratch_user2_png",
});
// 添加回调函数
for(let i = 0; i < this.data.invitationUser.length; i++) { for(let i = 0; i < this.data.invitationUser.length; i++) {
this.data.invitationUser[i]['callFun'] = () => { this.data.invitationUser[i]['callFun'] = () => {
NetManager.ins.getShareCode((success, res) => { NetManager.ins.getShareCode((success, res) => {
...@@ -148,6 +157,25 @@ export default class ScratchPanel extends Panel { ...@@ -148,6 +157,25 @@ export default class ScratchPanel extends Panel {
let dProgress = Math.abs(progress - this["progress"].width / this["progressBg"].width); // 比当前进度的差值的绝对值 let dProgress = Math.abs(progress - this["progress"].width / this["progressBg"].width); // 比当前进度的差值的绝对值
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();
if(progress >= 100){
this["scratch_progress"].visible = false;
} else if(progress >= 98 && progress < 100){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_98_png";
}else if(progress >= 96 && progress < 98){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_96_png";
}else if(progress >= 94 && progress < 96){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_94_png";
}else if(progress >= 92 && progress < 96){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_92_png";
}else if(progress < 92){
this["scratch_progress"].visible = true;
this["scratch_progress"].source = "scratch_card_90_png";
}
} }
private setWXShareTip() { private setWXShareTip() {
...@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel { ...@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel {
} }
private async getGameRes() { private async getGameRes() {
this.invite_img = await RES.getResAsync("scratch_invite_png");
} }
get skinKey() { get skinKey() {
......
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