Commit 47daebcf authored by wildfirecode's avatar wildfirecode

1

parent 2266a8f9
......@@ -25,7 +25,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="inviteBtn2" label="" x="439.08" y="621.6">
<e:Button id="inviteBtn2" label="" x="439.08" y="621.6" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="blood2去分享按钮_png" source.down="blood2去分享按钮_png" source.disabled="blood2去分享按钮_png"/>
......
......@@ -37,7 +37,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="inviteBtn2" label="" x="433" y="635">
<e:Button id="inviteBtn2" label="" x="433" y="635" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="blood去分享_png" source.down="blood去分享_png" source.disabled="blood去分享_png"/>
......
......@@ -8,7 +8,7 @@ interface IHomeData {
wealth;
remainEnargy;
nextRangeStarsNum;
askForEnergy:boolean;
askForEnergy:number;
remainProp:{type,num}[]
}
export default ():IHomeData=>{
......
......@@ -11,6 +11,7 @@ import { getlogItem } from "../Main";
import CountDown from "../mapScene/CountDown";
import { showShare } from "../shareCtrl";
import { gotoNextLevel } from "./gotoNextLevel";
import BloodPanel2 from "./BloodPanel2";
export default class BloodPanel extends Panel {
start(data) {
......@@ -30,6 +31,7 @@ export default class BloodPanel extends Panel {
NetManager.ins.showLog(getlogItem(30));
}
static MAX =3;
private _countDown:CountDown;
private updateData() {
if(this._countDown == null ) {
......@@ -38,9 +40,8 @@ export default class BloodPanel extends Panel {
const homeData = getHomeData();
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
const data = getHomeData();
this['invitTxt'].text = `(已领0/1)`;
if (data.askForEnergy){
this['invitTxt'].text = `(已领1/1)`;
this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`;
if (data.askForEnergy >= BloodPanel.MAX){
this['inviteBtn2'].visible=true;
}
if(data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
......@@ -90,15 +91,14 @@ export default class BloodPanel extends Panel {
showShare(1);
NetManager.ins.clickLog(getlogItem(4));
const data = getHomeData();
if (data.askForEnergy) {
showToast('对不起,已经索要过体力了~');
if (data.askForEnergy >= BloodPanel.MAX) {
showToast('对不起,索要体力的机会已经用完了~');
return;
}
this['inviteBtn'].enabled = false;
NetManager.ins.hc_askForEnergy((success) => {
this['inviteBtn'].enabled = true;
if (success) {
this['invitTxt'].text = `(已领1/1)`;
}
NetManager.ins.hc_home(() => {
this.updateData();
......
......@@ -10,6 +10,7 @@ import { iswx } from "../iswx";
import { getlogItem } from "../Main";
import CountDown from "../mapScene/CountDown";
import { showShare } from "../shareCtrl";
import BloodPanel from "./BloodPanel";
export default class BloodPanel2 extends Panel {
start(data) {
......@@ -34,10 +35,10 @@ this['price1Txt'].text =`${ window['price1']}个元宝=1个体力值`;
const homeData = getHomeData();
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
const data = getHomeData();
this['invitTxt'].text = `(已领0/1)`;
if (data.askForEnergy)
this['invitTxt'].text = `(已领1/1)`;
this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`;
if (data.askForEnergy >= BloodPanel.MAX){
this['inviteBtn2'].visible=true;
}
if(data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
this._countDown.stop();
......@@ -85,15 +86,15 @@ this['price1Txt'].text =`${ window['price1']}个元宝=1个体力值`;
showShare(1);
NetManager.ins.clickLog(getlogItem(4));
const data = getHomeData();
if (data.askForEnergy) {
showToast('对不起,已经索要过体力了~');
if (data.askForEnergy >= BloodPanel.MAX) {
showToast('对不起,索要体力的机会已经用完了~');
return;
}
this['inviteBtn'].enabled = false;
NetManager.ins.hc_askForEnergy((success) => {
this['inviteBtn'].enabled = true;
if (success) {
this['invitTxt'].text = `(已领1/1)`;
}
NetManager.ins.hc_home(() => {
this.updateData();
......
......@@ -46,7 +46,7 @@ const config = {
data: './happyclear/openTreasureBox.json'
},
'/customActivity/happyclear/home': {
data: './happyclear/homemax.json'
data: './happyclear/home.json'
},
'/customActivity/happyclear/getLevelInfo': {
data: './happyclear/getLevelInfo.json'
......
......@@ -23,7 +23,7 @@
}
],
"remainEnargy": 5,
"askForEnergy":false,
"askForEnergy":0,
"canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 100,
"isGetAllTreasureBox": false,
......
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