Commit 9a85a188 authored by wildfirecode's avatar wildfirecode

1

parent 10ce2672
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"blood2","version":5,"files":["../assets/blood2/blood2按钮 副本1.png","../assets/blood2/blood2按钮 副本.png"]} {"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"blood2","version":5,"files":["../assets/blood2/blood2按钮 副本1.png","../assets/blood2/blood2按钮 副本.png","../assets/blood2/blood2.png"]}
\ No newline at end of file \ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sign","version":5,"files":["../assets/sign/signitem.png","../assets/sign/signicon5.png","../assets/sign/signicon4.png","../assets/sign/signicon3.png","../assets/sign/signicon2.png","../assets/sign/signbtn4.png","../assets/sign/signbtn3.png","../assets/sign/signbtn2.png","../assets/sign/signbtn1.png","../assets/sign/signbg.png","../assets/sign/sign_line2.png","../assets/sign/sign_line.png","../assets/sign/sign_light.png","../assets/sign/sign_icon1.png"]}
\ No newline at end of file
...@@ -81,12 +81,8 @@ ...@@ -81,12 +81,8 @@
"name": "exchange" "name": "exchange"
}, },
{ {
"keys": "", "keys": "signitem_png,signicon5_png,signicon4_png,signicon3_png,signicon2_png,signbtn4_png,signbtn3_png,signbtn2_png,signbtn1_png,signbg_png,sign_line2_png,sign_line_png,sign_light_png,sign_icon1_png",
"name": "sign" "name": "sign"
},
{
"name": "preload",
"keys": "signicon4_png,signicon5_png,signbg_png,sign_line2_png,sign_light_png"
} }
], ],
"resources": [ "resources": [
...@@ -1811,29 +1807,29 @@ ...@@ -1811,29 +1807,29 @@
"name": "blood2_png" "name": "blood2_png"
}, },
{ {
"name": "signicon4_png", "url": "assets/sign/signicon4.png",
"type": "image", "type": "image",
"url": "assets/sign/signicon4.png" "name": "signicon4_png"
}, },
{ {
"name": "signicon5_png", "url": "assets/sign/signicon5.png",
"type": "image", "type": "image",
"url": "assets/sign/signicon5.png" "name": "signicon5_png"
}, },
{ {
"name": "signbg_png", "url": "assets/sign/signbg.png",
"type": "image", "type": "image",
"url": "assets/sign/signbg.png" "name": "signbg_png"
}, },
{ {
"name": "sign_line2_png", "url": "assets/sign/sign_line2.png",
"type": "image", "type": "image",
"url": "assets/sign/sign_line2.png" "name": "sign_line2_png"
}, },
{ {
"name": "sign_light_png", "url": "assets/sign/sign_light.png",
"type": "image", "type": "image",
"url": "assets/sign/sign_light.png" "name": "sign_light_png"
} }
] ]
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"skins": {}, "skins": {},
"autoGenerateExmlsList": true, "autoGenerateExmlsList": true,
"exmls": [ "exmls": [
"resource/skins/SignItemSkin.exml",
"resource/skins/AlertSkin.exml", "resource/skins/AlertSkin.exml",
"resource/skins/Blood2Skin.exml", "resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml", "resource/skins/BloodSkin.exml",
...@@ -34,6 +33,7 @@ ...@@ -34,6 +33,7 @@
"resource/skins/ShareSkin.exml", "resource/skins/ShareSkin.exml",
"resource/skins/ShopSkin.exml", "resource/skins/ShopSkin.exml",
"resource/skins/ShowOffSkin.exml", "resource/skins/ShowOffSkin.exml",
"resource/skins/SignItemSkin.exml",
"resource/skins/SignPrizeSkin.exml", "resource/skins/SignPrizeSkin.exml",
"resource/skins/SignSkin.exml", "resource/skins/SignSkin.exml",
"resource/skins/StarSkin.exml", "resource/skins/StarSkin.exml",
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
</e:Group> </e:Group>
<e:Group id="top" x="36" y="24"> <e:Group id="top" x="36" y="24">
<e:Image source="元宝bg_png" x="0" y="0"/> <e:Image source="元宝bg_png" x="0" y="0"/>
<e:Label id="bloodTxt" text="0/5" x="78.04" y="27.84" width="82" verticalAlign="middle" textAlign="center"/> <e:Label id="bloodTxt" text="5" x="12.71" y="22.84" width="49" verticalAlign="middle" textAlign="center" size="36"/>
<e:Label id="fullTxt" text="已满" x="76.71" y="29.84" width="82" verticalAlign="middle" textAlign="center" size="24" visible="false"/>
<e:Label id="goldTxt" text="0" x="396.04" y="27.84" width="88" verticalAlign="middle" textAlign="center"/> <e:Label id="goldTxt" text="0" x="396.04" y="27.84" width="88" verticalAlign="middle" textAlign="center"/>
<e:Button id="bloodBtn" label="" x="165.72" y="16.6"> <e:Button id="bloodBtn" label="" x="168.38" y="16.6">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/> <e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label id="countdown" text="00:00:00" x="212.88" y="30.24" anchorOffsetX="0" anchorOffsetY="0" size="28" textColor="0xff0000"/> <e:Label id="countdown" text="00:00:00" x="77.39" y="31.19" verticalAlign="middle" textAlign="center" size="22"/>
</e:Group> </e:Group>
<e:Button id="shopBtn" label="" x="615.08" y="154.01"> <e:Button id="shopBtn" label="" x="615.08" y="154.01">
<e:skinName> <e:skinName>
......
...@@ -33,14 +33,20 @@ export default class MapScene extends Scene { ...@@ -33,14 +33,20 @@ export default class MapScene extends Scene {
super.start(); super.start();
const date = new Date(); NetManager.ins.getSignInfo(() => {
date.setHours(0, 0, 0, 0);
const nowTimerStr = date.getTime() + ''; const { signInfoVO } = DataManager.ins.getData('getSignInfo');
const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId); if(signInfoVO.continueDay >=7) return;
if (oldTimerStr != nowTimerStr) { const date = new Date();
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr); date.setHours(0, 0, 0, 0);
PanelCtrl.instance.show('sign'); const nowTimerStr = date.getTime() + '';
} const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
if (oldTimerStr != nowTimerStr) {
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
PanelCtrl.instance.show('sign');
}
}, window['signActivityId']);
if (getBgOn() && MapScene['firstPlayBgTag'] == true) { if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg(); playBg();
...@@ -287,13 +293,16 @@ export default class MapScene extends Scene { ...@@ -287,13 +293,16 @@ export default class MapScene extends Scene {
const data = getHomeData(); const data = getHomeData();
if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了 if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
this._countDown.stop(); this._countDown.stop();
this['fullTxt'].visible = true;
this['countdown'].visible = false; this['countdown'].visible = false;
} else { } else {
const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000); const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000);
this._countDown.reset(left); this._countDown.reset(left);
this['countdown'].visible = true; this['countdown'].visible = true;
this['fullTxt'].visible = false;
} }
this['bloodTxt'].text = `${data.remainEnargy}/5`; this['bloodTxt'].text = `${data.remainEnargy}`;
} }
protected initEvents() { protected initEvents() {
......
...@@ -4,21 +4,22 @@ import { NetManager } from "../../libs/tw/manager/NetManager"; ...@@ -4,21 +4,22 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
// export const getSignInfo = ()=> {
// return new Promise((r) => {
// NetManager.ins.getSignInfo(() => {
// r();
// }, window['signActivityId']);
// })
// }
export default class SignPanel extends Panel { export default class SignPanel extends Panel {
getSignInfo() {
return new Promise((r) => {
NetManager.ins.getSignInfo(() => {
r();
}, window['signActivityId']);
})
}
list: eui.List; list: eui.List;
scroll: eui.Scroller; scroll: eui.Scroller;
async start(data) { async start(data) {
super.start(); super.start();
await this.getSignInfo();
console.log(DataManager.ins.getData('getSignInfo')) // console.log(DataManager.ins.getData('getSignInfo'))
const { signInfoVO } = DataManager.ins.getData('getSignInfo'); const { signInfoVO } = DataManager.ins.getData('getSignInfo');
// for (let i = 1; i <= 7; i++) { // for (let i = 1; i <= 7; i++) {
...@@ -57,7 +58,7 @@ export default class SignPanel extends Panel { ...@@ -57,7 +58,7 @@ export default class SignPanel extends Panel {
NetManager.ins.doSign((s)=>{ NetManager.ins.doSign((s)=>{
if(s) { if(s) {
item.setSinged(); item.setSinged();
showToast('签到成功~') showToast('签到成功!快去闯关吧~')
} }
}, window['signActivityId']) }, window['signActivityId'])
console.log(data); console.log(data);
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"desc": "OK", "desc": "OK",
"timestamp": 1566885811001, "timestamp": 1566885811001,
"data": { "data": {
"refectionCountdown": 0, "refectionCountdown": 10,
"remainEnargy": 4, "remainEnargy": 5,
"isGetAllTreasureBox": 0, "isGetAllTreasureBox": 0,
"wealth": 7960, "wealth": 7960,
"totalStars": 145, "totalStars": 145,
......
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