Commit 7d8ab54b authored by wjf's avatar wjf

l

parent 1b269d69
This diff is collapsed.
This diff is collapsed.
......@@ -49,7 +49,7 @@
"name": "lotteryScene"
},
{
"keys": "cur_light_1.png,cur_light_2.png,guide_fox.png,guide_hand.png,guide_light.png,guide_tip.png,map_avatar_bg.png,map_bg1.jpg,map_bg2.jpg,map_bg3.jpg,map_check_disable.png,map_check_disable_prize.png,map_check_enable.png,map_check_enable_cur.png,map_creditsBg.png,map_energyAdd.png,map_energyBg.png,map_prizeBox.png,map_prizeBtn.png,map_ruleBtn.png,map_star_disable.png,map_star_enable.png,map_taskBtn.png,map_推车.png,map_狐狸气球.png,water1.png,water2.png",
"keys": "appointCountBg.png,cur_light_1.png,cur_light_2.png,guide_fox.png,guide_hand.png,guide_light.png,guide_tip.png,loopMsgBg.png,map_avatar_bg.png,map_bg1.jpg,map_bg2.jpg,map_bg3.jpg,map_check_disable.png,map_check_disable_prize.png,map_check_enable.png,map_check_enable_cur.png,map_creditsBg.png,map_energyAdd.png,map_energyBg.png,map_prizeBox.png,map_prizeBtn.png,map_ruleBtn.png,map_star_disable.png,map_star_enable.png,map_taskBtn.png,map_推车.png,map_狐狸气球.png,remindIcon.png,water1.png,water2.png",
"name": "map"
},
{
......
......@@ -4319,19 +4319,30 @@ export const ResJson = {
}
},
{
"keys": "cur_light_1.png,cur_light_2.png,guide_fox.png,guide_hand.png,guide_light.png,guide_tip.png,map_avatar_bg.png,map_bg1.jpg,map_bg2.jpg,map_bg3.jpg,map_check_disable.png,map_check_disable_prize.png,map_check_enable.png,map_check_enable_cur.png,map_creditsBg.png,map_energyAdd.png,map_energyBg.png,map_prizeBox.png,map_prizeBtn.png,map_ruleBtn.png,map_star_disable.png,map_star_enable.png,map_taskBtn.png,map_推车.png,map_狐狸气球.png,water1.png,water2.png",
"keys": "appointCountBg.png,cur_light_1.png,cur_light_2.png,guide_fox.png,guide_hand.png,guide_light.png,guide_tip.png,loopMsgBg.png,map_avatar_bg.png,map_bg1.jpg,map_bg2.jpg,map_bg3.jpg,map_check_disable.png,map_check_disable_prize.png,map_check_enable.png,map_check_enable_cur.png,map_creditsBg.png,map_energyAdd.png,map_energyBg.png,map_prizeBox.png,map_prizeBtn.png,map_ruleBtn.png,map_star_disable.png,map_star_enable.png,map_taskBtn.png,map_推车.png,map_狐狸气球.png,remindIcon.png,water1.png,water2.png",
"name": "map",
"atlas": {
"appointCountBg.png": {
"x": 258,
"y": 471,
"w": 259,
"h": 45,
"ox": 0,
"oy": 0,
"sw": 259,
"sh": 45,
"ro": true
},
"cur_light_1.png": {
"x": 220,
"y": 206,
"x": 258,
"y": 732,
"w": 187,
"h": 115,
"ox": 0,
"oy": 0,
"sw": 197,
"sh": 123,
"ro": true
"ro": false
},
"cur_light_2.png": {
"x": 132,
......@@ -4345,8 +4356,8 @@ export const ResJson = {
"ro": true
},
"guide_fox.png": {
"x": 275,
"y": 793,
"x": 305,
"y": 471,
"w": 202,
"h": 219,
"ox": 0,
......@@ -4356,8 +4367,8 @@ export const ResJson = {
"ro": false
},
"guide_hand.png": {
"x": 573,
"y": 113,
"x": 509,
"y": 406,
"w": 90,
"h": 91,
"ox": 0,
......@@ -4367,8 +4378,8 @@ export const ResJson = {
"ro": false
},
"guide_light.png": {
"x": 380,
"y": 156,
"x": 424,
"y": 428,
"w": 40,
"h": 40,
"ox": 0,
......@@ -4388,9 +4399,20 @@ export const ResJson = {
"sh": 166,
"ro": true
},
"loopMsgBg.png": {
"x": 170,
"y": 484,
"w": 369,
"h": 86,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 86,
"ro": true
},
"map_avatar_bg.png": {
"x": 481,
"y": 289,
"x": 483,
"y": 300,
"w": 95,
"h": 104,
"ox": 0,
......@@ -4400,8 +4422,8 @@ export const ResJson = {
"ro": false
},
"map_check_disable.png": {
"x": 481,
"y": 178,
"x": 469,
"y": 189,
"w": 109,
"h": 90,
"ox": 0,
......@@ -4411,8 +4433,8 @@ export const ResJson = {
"ro": true
},
"map_check_disable_prize.png": {
"x": 511,
"y": 2,
"x": 488,
"y": 846,
"w": 109,
"h": 104,
"ox": 0,
......@@ -4422,52 +4444,52 @@ export const ResJson = {
"ro": true
},
"map_check_enable.png": {
"x": 220,
"y": 395,
"x": 614,
"y": 2,
"w": 103,
"h": 82,
"ox": 1,
"oy": 16,
"sw": 109,
"sh": 104,
"ro": false
"ro": true
},
"map_check_enable_cur.png": {
"x": 170,
"y": 793,
"x": 561,
"y": 189,
"w": 103,
"h": 82,
"ox": 2,
"oy": 15,
"sw": 109,
"sh": 104,
"ro": false
"ro": true
},
"map_creditsBg.png": {
"x": 325,
"y": 395,
"x": 469,
"y": 2,
"w": 185,
"h": 71,
"ox": 0,
"oy": 0,
"sw": 185,
"sh": 71,
"ro": false
"ro": true
},
"map_energyAdd.png": {
"x": 235,
"y": 877,
"x": 305,
"y": 692,
"w": 35,
"h": 33,
"ox": 0,
"oy": 0,
"sw": 35,
"sh": 33,
"ro": false
"ro": true
},
"map_energyBg.png": {
"x": 337,
"y": 206,
"x": 542,
"y": 2,
"w": 185,
"h": 70,
"ox": 0,
......@@ -4478,18 +4500,18 @@ export const ResJson = {
},
"map_prizeBox.png": {
"x": 220,
"y": 2,
"y": 311,
"w": 158,
"h": 202,
"ox": 0,
"oy": 0,
"sw": 158,
"sh": 202,
"ro": false
"ro": true
},
"map_prizeBtn.png": {
"x": 409,
"y": 198,
"x": 447,
"y": 692,
"w": 152,
"h": 70,
"ox": 0,
......@@ -4499,8 +4521,8 @@ export const ResJson = {
"ro": true
},
"map_ruleBtn.png": {
"x": 380,
"y": 2,
"x": 416,
"y": 849,
"w": 152,
"h": 70,
"ox": 0,
......@@ -4510,26 +4532,26 @@ export const ResJson = {
"ro": true
},
"map_star_disable.png": {
"x": 235,
"y": 939,
"x": 367,
"y": 692,
"w": 25,
"h": 24,
"ox": 0,
"oy": 0,
"sw": 25,
"sh": 24,
"ro": false
"ro": true
},
"map_star_enable.png": {
"x": 235,
"y": 912,
"x": 340,
"y": 692,
"w": 26,
"h": 25,
"ox": 0,
"oy": 0,
"sw": 26,
"sh": 25,
"ro": false
"ro": true
},
"map_taskBtn.png": {
"x": 2,
......@@ -4543,8 +4565,8 @@ export const ResJson = {
"ro": true
},
"map_推车.png": {
"x": 170,
"y": 484,
"x": 220,
"y": 2,
"w": 247,
"h": 307,
"ox": 0,
......@@ -4564,9 +4586,20 @@ export const ResJson = {
"sh": 480,
"ro": false
},
"remindIcon.png": {
"x": 235,
"y": 855,
"w": 179,
"h": 166,
"ox": 0,
"oy": 0,
"sw": 179,
"sh": 166,
"ro": false
},
"water1.png": {
"x": 452,
"y": 119,
"x": 488,
"y": 957,
"w": 57,
"h": 101,
"ox": 0,
......@@ -4576,8 +4609,8 @@ export const ResJson = {
"ro": true
},
"water2.png": {
"x": 452,
"y": 2,
"x": 424,
"y": 311,
"w": 57,
"h": 115,
"ox": 0,
......@@ -8409,5 +8442,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1597303204/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1597903646/resource/"
}
\ No newline at end of file
......@@ -84,6 +84,11 @@ export enum TbNetName {
///////////////////前端调用接口都加个mine
/**
* 获取120名通关的人数
*/
getAppointCount = "mine.getAppointCount",
////带用户操作,和index.js特殊操作的
/**
* 用户授权
......
import { Panel } from "../../module/views/Panel";
import { GDispatcher } from "../Main";
export class FreePowerPanel extends Panel {
get groupNames() { return ["FreePowerPanel"] }
get skinName() { return "FreePowerPanel" }
acceptBtn:FYGE.Button;
closeBtn:FYGE.Button;
acceptBtn: FYGE.Button;
closeBtn: FYGE.Button;
get closeBtns(){
return [this.closeBtn,this.acceptBtn]
get closeBtns() {
return [this.closeBtn, this.acceptBtn]
}
hidePanel() {
super.hidePanel();
//显示倒计时
GDispatcher.dispatchEvent("showRemindIcon")
}
}
This diff is collapsed.
......@@ -16,6 +16,8 @@ import { LotteryScene } from "../LotteryScene";
import { GDispatcher } from "../../Main";
import { G_EVENT } from "../../common/G_EVENT";
import Tween = FYGE.Tween;
import { layers } from "../../../module/views/layers";
import { LoopMsg } from "./LoopMsg";
export default class MapUI extends Container {
public energyBox: EnergyBox = null;
......@@ -58,7 +60,7 @@ export default class MapUI extends Container {
console.log('我的奖品');
sendTbNet(
TbNetName.navigateTo,
{url: '/pages/myPrize/myPrize'},
{ url: '/pages/myPrize/myPrize' },
() => {
},
true
......@@ -100,6 +102,37 @@ export default class MapUI extends Container {
this.energyBox = this.addChild(new EnergyBox({}));
this.creditsBox = this.addChild(new CreditsBox({}));
this.prizeBox = this.addChild(new PrizeBox({}));
//显示120关通关人数
sendTbNet(TbNetName.getAppointCount).then((res) => {
if (!res.success) return;
this.addChild(new class extends Sprite {
constructor() {
super(RES.getRes("appointCountBg.png"));
this.addChild(Tools.getText(
`${res.data}人已解锁120关`,
26,
"#ffffff",
TEXT_ALIGN.CENTER, 259,
0, 10
))
}
})
.position.set(this.prizeBox.x - 51, this.prizeBox.y + 202 + 40)
})
//轮播的中奖
this.addChild(new LoopMsg()).position.set(0, layers.stageHeight - 100 - 86)
//是否显示下一次领取免费体力的icon;
var remindIcon = this.addChild(new RemindIcon());
remindIcon.position.set(560, layers.stageHeight - 166 - 82);
if (!Tools.gameData.loginAddPower) {
remindIcon.visible = true;
} else {
remindIcon.visible = false;
//不需要考虑移除,因为这种情况,免费体力弹框必出,关闭后必触发
GDispatcher.once("showRemindIcon", () => { remindIcon.visible = true; }, this)
}
}
public updateUI() {
......@@ -108,6 +141,49 @@ export default class MapUI extends Container {
}
}
/**
* 提示下次领奖的时间倒计时
*/
class RemindIcon extends Sprite {
constructor() {
super(RES.getRes("remindIcon.png"));
//文案
var txt = this.addChild(Tools.getText(
"",
24,
"#ffffff",
TEXT_ALIGN.CENTER,
130,
(179 - 130) / 2, 122
))
var zeroTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
this.addEventListener(FYGE.Event.ENTER_FRAME, () => {
var now = Date.now();
if (now > zeroTime) {
this.visible = false;
return
}
//转时分秒
txt.text = this.getShiFenMiaoByTimeStamp(zeroTime - now);
}, this)
}
/**
* 转换成 1:2:33
* @param timeStamp
*/
getShiFenMiaoByTimeStamp(timeStamp: number): string {
var hours: any = Math.floor((timeStamp % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes: any = Math.floor((timeStamp % (1000 * 60 * 60)) / (1000 * 60));
var seconds: any = Math.floor((timeStamp % (1000 * 60)) / 1000);
hours = hours < 10 ? ('0' + hours) : hours;
minutes = minutes < 10 ? ('0' + minutes) : minutes;
seconds = seconds < 10 /*&& seconds >= 1*/ ? ('0' + seconds) : seconds;
return hours + ":" + minutes + ":" + seconds;
}
}
/**
* 能量
*/
......@@ -243,7 +319,7 @@ class PrizeBox extends Button {
this["frames"] = null
// s.scale.x = s.scale.y = 0.9
Tween.removeTweens(this);
Tween.get(this).to({scaleX: 1, scaleY: 1}, 50);
Tween.get(this).to({ scaleX: 1, scaleY: 1 }, 50);
}
} else {
// @ts-ignore
......@@ -254,7 +330,7 @@ class PrizeBox extends Button {
this["frames"] = this["framesOri"]
// s.scale.x = s.scale.y = 1
Tween.removeTweens(this);
Tween.get(this).to({scaleX: 1.2, scaleY: 1.2}, 50);
Tween.get(this).to({ scaleX: 1.2, scaleY: 1.2 }, 50);
}
}
}
......@@ -344,7 +420,7 @@ class PrizeBox extends Button {
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${lowerLevel}`]);
this.addEventListener(FYGE.MouseEvent.CLICK, () => {
Tools.btnDelay(this);
changeScene(LotteryScene, {level: lowerLevel})
changeScene(LotteryScene, { level: lowerLevel })
}, this)
}
}
......
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