Commit 3e5bc83b authored by Edwise's avatar Edwise 🍷

搞定精力值上限与精力值根据后端改变

parent 45ea2a0a
...@@ -12,11 +12,13 @@ ...@@ -12,11 +12,13 @@
"sence": 1, "sence": 1,
"catName": "哈哈哈", "catName": "哈哈哈",
"senceTips":["1说话说话说话说话说话说话说话说话说话说话说话","2说话说话说话说话说话说话说话说话说话说话说话说话","3说话说话说话说话说话说话说话说话说话说话说话说话"], "senceTips":["1说话说话说话说话说话说话说话说话说话说话说话","2说话说话说话说话说话说话说话说话说话说话说话说话","3说话说话说话说话说话说话说话说话说话说话说话说话"],
"energyMax":50, "energyMax":20,
"experienceMax":1000, "experienceMax":1000,
"senceGuide":true, "senceGuide":true,
"updateTime":1607507495319, "updateTime":1607507495319,
"lastEnergyTime":1607507395319, "lastEnergyTime":1607507395319,
"serverTime":1607507495319 "serverTime":1607507495319,
"recoveryTime":1200000,
"limitEnergyCount":5
} }
} }
...@@ -2324,6 +2324,7 @@ var Ins = (function () { ...@@ -2324,6 +2324,7 @@ var Ins = (function () {
return minutes + "分" + seconds + "秒"; return minutes + "分" + seconds + "秒";
}; };
Ins.recoverEnergy = 10 * 60 * 1000; Ins.recoverEnergy = 10 * 60 * 1000;
Ins.canGetSalmon = true;
Ins.salmonArr = []; Ins.salmonArr = [];
return Ins; return Ins;
}()); }());
...@@ -3146,6 +3147,10 @@ var Salmon = (function (_super) { ...@@ -3146,6 +3147,10 @@ var Salmon = (function (_super) {
this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this); this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this);
}; };
Salmon.prototype.getEnegry = function () { Salmon.prototype.getEnegry = function () {
if (!Ins_1.Ins.canGetSalmon)
return;
Ins_1.Ins.canGetSalmon = false;
Ins_1.Ins.showLoading();
var that = this; var that = this;
that.mouseEnable = false; that.mouseEnable = false;
console.log("收取精力值:", that.salmonCnt); console.log("收取精力值:", that.salmonCnt);
...@@ -3159,6 +3164,7 @@ var Salmon = (function (_super) { ...@@ -3159,6 +3164,7 @@ var Salmon = (function (_super) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } }); FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
} }
else { else {
Ins_1.Ins.canGetSalmon = true;
that.mouseEnable = true; that.mouseEnable = true;
Ins_1.Ins.showToast(r && r.message); Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading(); Ins_1.Ins.hideLoading();
...@@ -3166,6 +3172,7 @@ var Salmon = (function (_super) { ...@@ -3166,6 +3172,7 @@ var Salmon = (function (_super) {
}); });
}; };
Salmon.prototype.getSalmonAnim = function () { Salmon.prototype.getSalmonAnim = function () {
Ins_1.Ins.canGetSalmon = true;
console.log("开始三文鱼动效"); console.log("开始三文鱼动效");
var index = Ins_1.Ins.salmonArr.indexOf(this); var index = Ins_1.Ins.salmonArr.indexOf(this);
Ins_1.Ins.salmonArr.splice(index, 1); Ins_1.Ins.salmonArr.splice(index, 1);
...@@ -47412,38 +47419,47 @@ var MainScene = (function (_super) { ...@@ -47412,38 +47419,47 @@ var MainScene = (function (_super) {
that.initSceneEle(); that.initSceneEle();
}; };
MainScene.prototype.initSceneEle = function () { MainScene.prototype.initSceneEle = function () {
var that = this; try {
console.log(that.y); var that = this;
that.mouseChildren = true; console.log(that.y);
Ins_1.Ins.salmonArr = []; that.mouseChildren = true;
Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence; Ins_1.Ins.canGetSalmon = true;
console.log("当前场景", Ins_1.Ins.curScene); Ins_1.Ins.salmonArr = [];
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"]; Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence;
that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]); Ins_1.Ins.recoverEnergy = Ins_1.Ins.userInfo.recoveryTime || 20 * 60 * 1000;
that.addChild(that.sceneBg); console.log("当前场景", Ins_1.Ins.curScene);
that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1; that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1; that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]);
that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } }); that.addChild(that.sceneBg);
that.addChild(that.mainUi); that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1;
that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460); that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1;
that.addChild(that.outTips); that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } });
that.outTips.visible = false; that.addChild(that.mainUi);
that.initTlBtnGroup(); that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460);
that.initCat(); that.addChild(that.outTips);
that.initEnergy(); that.outTips.visible = false;
that.energyUp1(); that.initTlBtnGroup();
that.initMxqBtnGroup(); that.initCat();
that.setSceneTips(1); that.initEnergy();
console.log("初始化结束"); that.energyUp1();
that.updateEnergy(); that.initMxqBtnGroup();
that.salmonGroup = new FYGE.Sprite(); that.setSceneTips(1);
that.addChild(that.salmonGroup); console.log("初始化结束");
that.salmonGroup.mouseChildren = true; that.updateEnergy();
setTimeout(function () { that.salmonGroup = new FYGE.Sprite();
that.initDialog(); that.addChild(that.salmonGroup);
that.coinAnimGroup = new FYGE.Sprite(); that.salmonGroup.mouseChildren = true;
that.addChild(that.coinAnimGroup); setTimeout(function () {
}, 100); that.initDialog();
that.coinAnimGroup = new FYGE.Sprite();
that.addChild(that.coinAnimGroup);
}, 100);
}
catch (_a) {
(function (e) {
console.log("fgggg----->", e);
});
}
}; };
MainScene.prototype.initDialog = function () { MainScene.prototype.initDialog = function () {
this.dialogGroup = new FYGE.Sprite(); this.dialogGroup = new FYGE.Sprite();
...@@ -47586,7 +47602,8 @@ var MainScene = (function (_super) { ...@@ -47586,7 +47602,8 @@ var MainScene = (function (_super) {
that.energyGroup.addChild(that.energyDeco); that.energyGroup.addChild(that.energyDeco);
that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60); that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60);
that.energyGroup.addChild(that.energyDialog); that.energyGroup.addChild(that.energyDialog);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "每10分钟恢复1点精力" }); var recoverTime = Math.floor(Ins_1.Ins.recoverEnergy / 1000 / 60);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "\u6BCF" + recoverTime + "\u5206\u949F\u6062\u590D1\u70B9\u7CBE\u529B" });
that.energyDialog.addChild(that.energyDialogLabel); that.energyDialog.addChild(that.energyDialogLabel);
that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5; that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5;
that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6; that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6;
...@@ -47609,14 +47626,15 @@ var MainScene = (function (_super) { ...@@ -47609,14 +47626,15 @@ var MainScene = (function (_super) {
that.maxEnergy = Ins_1.Ins.userInfo.energyMax; that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg); FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco); FYGE.Tween.removeTweens(that.energyDeco);
var scaleX = (that.energy / that.maxEnergy) > 1 ? 1 : (that.energy / that.maxEnergy);
if (that.firstSetEnergy) { if (that.firstSetEnergy) {
that.firstSetEnergy = false; that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy); that.energyImg.scaleX = scaleX;
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2; that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
} }
else { else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyImg).to({ scaleX: scaleX }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * scaleX - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
} }
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy; that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2; that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
...@@ -47851,7 +47869,10 @@ var MainScene = (function (_super) { ...@@ -47851,7 +47869,10 @@ var MainScene = (function (_super) {
if (list.length >= Ins_1.Ins.salmonArr.length) { if (list.length >= Ins_1.Ins.salmonArr.length) {
var flagIndex = 0; var flagIndex = 0;
var canSetIndexArr = []; var canSetIndexArr = [];
while (flagIndex < 8) { var maxEnergy = Ins_1.Ins.userInfo.energyMax;
var limitEnergy = Ins_1.Ins.userInfo.limitEnergyCount || 5;
var salmonMaxCnt = list.length >= 8 ? list.length : Math.ceil(maxEnergy / limitEnergy);
while (flagIndex < salmonMaxCnt) {
if (!this.salmonFlag[flagIndex]) { if (!this.salmonFlag[flagIndex]) {
canSetIndexArr.push({ index: flagIndex }); canSetIndexArr.push({ index: flagIndex });
} }
This diff is collapsed.
...@@ -2326,6 +2326,7 @@ var Ins = (function () { ...@@ -2326,6 +2326,7 @@ var Ins = (function () {
return minutes + "分" + seconds + "秒"; return minutes + "分" + seconds + "秒";
}; };
Ins.recoverEnergy = 10 * 60 * 1000; Ins.recoverEnergy = 10 * 60 * 1000;
Ins.canGetSalmon = true;
Ins.salmonArr = []; Ins.salmonArr = [];
return Ins; return Ins;
}()); }());
...@@ -3148,6 +3149,10 @@ var Salmon = (function (_super) { ...@@ -3148,6 +3149,10 @@ var Salmon = (function (_super) {
this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this); this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this);
}; };
Salmon.prototype.getEnegry = function () { Salmon.prototype.getEnegry = function () {
if (!Ins_1.Ins.canGetSalmon)
return;
Ins_1.Ins.canGetSalmon = false;
Ins_1.Ins.showLoading();
var that = this; var that = this;
that.mouseEnable = false; that.mouseEnable = false;
console.log("收取精力值:", that.salmonCnt); console.log("收取精力值:", that.salmonCnt);
...@@ -3161,6 +3166,7 @@ var Salmon = (function (_super) { ...@@ -3161,6 +3166,7 @@ var Salmon = (function (_super) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } }); FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
} }
else { else {
Ins_1.Ins.canGetSalmon = true;
that.mouseEnable = true; that.mouseEnable = true;
Ins_1.Ins.showToast(r && r.message); Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading(); Ins_1.Ins.hideLoading();
...@@ -3168,6 +3174,7 @@ var Salmon = (function (_super) { ...@@ -3168,6 +3174,7 @@ var Salmon = (function (_super) {
}); });
}; };
Salmon.prototype.getSalmonAnim = function () { Salmon.prototype.getSalmonAnim = function () {
Ins_1.Ins.canGetSalmon = true;
console.log("开始三文鱼动效"); console.log("开始三文鱼动效");
var index = Ins_1.Ins.salmonArr.indexOf(this); var index = Ins_1.Ins.salmonArr.indexOf(this);
Ins_1.Ins.salmonArr.splice(index, 1); Ins_1.Ins.salmonArr.splice(index, 1);
...@@ -47414,38 +47421,47 @@ var MainScene = (function (_super) { ...@@ -47414,38 +47421,47 @@ var MainScene = (function (_super) {
that.initSceneEle(); that.initSceneEle();
}; };
MainScene.prototype.initSceneEle = function () { MainScene.prototype.initSceneEle = function () {
var that = this; try {
console.log(that.y); var that = this;
that.mouseChildren = true; console.log(that.y);
Ins_1.Ins.salmonArr = []; that.mouseChildren = true;
Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence; Ins_1.Ins.canGetSalmon = true;
console.log("当前场景", Ins_1.Ins.curScene); Ins_1.Ins.salmonArr = [];
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"]; Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence;
that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]); Ins_1.Ins.recoverEnergy = Ins_1.Ins.userInfo.recoveryTime || 20 * 60 * 1000;
that.addChild(that.sceneBg); console.log("当前场景", Ins_1.Ins.curScene);
that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1; that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1; that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]);
that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } }); that.addChild(that.sceneBg);
that.addChild(that.mainUi); that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1;
that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460); that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1;
that.addChild(that.outTips); that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } });
that.outTips.visible = false; that.addChild(that.mainUi);
that.initTlBtnGroup(); that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460);
that.initCat(); that.addChild(that.outTips);
that.initEnergy(); that.outTips.visible = false;
that.energyUp1(); that.initTlBtnGroup();
that.initMxqBtnGroup(); that.initCat();
that.setSceneTips(1); that.initEnergy();
console.log("初始化结束"); that.energyUp1();
that.updateEnergy(); that.initMxqBtnGroup();
that.salmonGroup = new FYGE.Sprite(); that.setSceneTips(1);
that.addChild(that.salmonGroup); console.log("初始化结束");
that.salmonGroup.mouseChildren = true; that.updateEnergy();
setTimeout(function () { that.salmonGroup = new FYGE.Sprite();
that.initDialog(); that.addChild(that.salmonGroup);
that.coinAnimGroup = new FYGE.Sprite(); that.salmonGroup.mouseChildren = true;
that.addChild(that.coinAnimGroup); setTimeout(function () {
}, 100); that.initDialog();
that.coinAnimGroup = new FYGE.Sprite();
that.addChild(that.coinAnimGroup);
}, 100);
}
catch (_a) {
(function (e) {
console.log("fgggg----->", e);
});
}
}; };
MainScene.prototype.initDialog = function () { MainScene.prototype.initDialog = function () {
this.dialogGroup = new FYGE.Sprite(); this.dialogGroup = new FYGE.Sprite();
...@@ -47588,7 +47604,8 @@ var MainScene = (function (_super) { ...@@ -47588,7 +47604,8 @@ var MainScene = (function (_super) {
that.energyGroup.addChild(that.energyDeco); that.energyGroup.addChild(that.energyDeco);
that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60); that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60);
that.energyGroup.addChild(that.energyDialog); that.energyGroup.addChild(that.energyDialog);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "每10分钟恢复1点精力" }); var recoverTime = Math.floor(Ins_1.Ins.recoverEnergy / 1000 / 60);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "\u6BCF" + recoverTime + "\u5206\u949F\u6062\u590D1\u70B9\u7CBE\u529B" });
that.energyDialog.addChild(that.energyDialogLabel); that.energyDialog.addChild(that.energyDialogLabel);
that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5; that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5;
that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6; that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6;
...@@ -47611,14 +47628,15 @@ var MainScene = (function (_super) { ...@@ -47611,14 +47628,15 @@ var MainScene = (function (_super) {
that.maxEnergy = Ins_1.Ins.userInfo.energyMax; that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg); FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco); FYGE.Tween.removeTweens(that.energyDeco);
var scaleX = (that.energy / that.maxEnergy) > 1 ? 1 : (that.energy / that.maxEnergy);
if (that.firstSetEnergy) { if (that.firstSetEnergy) {
that.firstSetEnergy = false; that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy); that.energyImg.scaleX = scaleX;
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2; that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
} }
else { else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyImg).to({ scaleX: scaleX }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * scaleX - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
} }
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy; that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2; that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
...@@ -47853,7 +47871,10 @@ var MainScene = (function (_super) { ...@@ -47853,7 +47871,10 @@ var MainScene = (function (_super) {
if (list.length >= Ins_1.Ins.salmonArr.length) { if (list.length >= Ins_1.Ins.salmonArr.length) {
var flagIndex = 0; var flagIndex = 0;
var canSetIndexArr = []; var canSetIndexArr = [];
while (flagIndex < 8) { var maxEnergy = Ins_1.Ins.userInfo.energyMax;
var limitEnergy = Ins_1.Ins.userInfo.limitEnergyCount || 5;
var salmonMaxCnt = list.length >= 8 ? list.length : Math.ceil(maxEnergy / limitEnergy);
while (flagIndex < salmonMaxCnt) {
if (!this.salmonFlag[flagIndex]) { if (!this.salmonFlag[flagIndex]) {
canSetIndexArr.push({ index: flagIndex }); canSetIndexArr.push({ index: flagIndex });
} }
...@@ -22,6 +22,9 @@ export class Ins { ...@@ -22,6 +22,9 @@ export class Ins {
/**多长时间恢复精力(ms) */ /**多长时间恢复精力(ms) */
public static recoverEnergy:number = 10*60*1000; public static recoverEnergy:number = 10*60*1000;
/**可以收取三文鱼 */
public static canGetSalmon = true;
/**当前游戏中的三文鱼 */ /**当前游戏中的三文鱼 */
public static salmonArr:Salmon[] = []; public static salmonArr:Salmon[] = [];
...@@ -43,7 +46,9 @@ export class Ins { ...@@ -43,7 +46,9 @@ export class Ins {
"senceGuide":boolean, "senceGuide":boolean,
"lastEnergyTime":number, "lastEnergyTime":number,
"updateTime":number, "updateTime":number,
"serverTime":number "serverTime":number,
"recoveryTime":number,
"limitEnergyCount":number
} }
public static senceInfo: { public static senceInfo: {
......
...@@ -73,6 +73,9 @@ export class Salmon extends Module{ ...@@ -73,6 +73,9 @@ export class Salmon extends Module{
/**收取精力 */ /**收取精力 */
getEnegry(){ getEnegry(){
if(!Ins.canGetSalmon) return;
Ins.canGetSalmon = false;
Ins.showLoading();
var that = this; var that = this;
that.mouseEnable = false; that.mouseEnable = false;
console.log("收取精力值:",that.salmonCnt); console.log("收取精力值:",that.salmonCnt);
...@@ -85,6 +88,7 @@ export class Salmon extends Module{ ...@@ -85,6 +88,7 @@ export class Salmon extends Module{
that.mouseEnable = true; that.mouseEnable = true;
FYGE.GDispatcher.dispatchEvent(MSG.UPDATE_ENERGY,{call:()=>{that.getSalmonAnim()}}); FYGE.GDispatcher.dispatchEvent(MSG.UPDATE_ENERGY,{call:()=>{that.getSalmonAnim()}});
}else{ }else{
Ins.canGetSalmon = true;
that.mouseEnable = true; that.mouseEnable = true;
Ins.showToast(r&&r.message); Ins.showToast(r&&r.message);
Ins.hideLoading(); Ins.hideLoading();
...@@ -94,6 +98,7 @@ export class Salmon extends Module{ ...@@ -94,6 +98,7 @@ export class Salmon extends Module{
/**收取三文鱼时候的动效 */ /**收取三文鱼时候的动效 */
getSalmonAnim(){ getSalmonAnim(){
Ins.canGetSalmon = true;
console.log("开始三文鱼动效") console.log("开始三文鱼动效")
let index = Ins.salmonArr.indexOf(this); let index = Ins.salmonArr.indexOf(this);
Ins.salmonArr.splice(index,1); Ins.salmonArr.splice(index,1);
......
...@@ -100,50 +100,59 @@ export class MainScene extends Scene { ...@@ -100,50 +100,59 @@ export class MainScene extends Scene {
/**初始化场景元素 */ /**初始化场景元素 */
initSceneEle() { initSceneEle() {
var that = this; try {
var that = this;
console.log(that.y);
that.mouseChildren = true;
Ins.canGetSalmon = true;
Ins.salmonArr = [];
Ins.curScene = Ins.senceInfo.sence;
Ins.recoverEnergy = Ins.userInfo.recoveryTime||20*60*1000;
console.log("当前场景", Ins.curScene);
//0:教室,1:操场,2:寝室
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
//生成默认场景,后面要改成根据接口值判断
that.sceneBg = Ins.initSprite(that.bgUUID[Ins.curScene == 4 ? 2 : Ins.curScene - 1]);
that.addChild(that.sceneBg);
that.x = (Ins.stageW - that.sceneBg.width) >> 1;
that.y = (Ins.stageH - that.sceneBg.height) >> 1;
that.mainUi = new MainSceneBtnUi({ uiType: Ins.curScene == 4 ? 3 : Ins.curScene, callF: () => { that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene) } });
that.addChild(that.mainUi);
that.outTips = Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins.stageW - 388) * 0.5, 460);
that.addChild(that.outTips);
that.outTips.visible = false;
that.initTlBtnGroup();
that.initCat();
that.initEnergy();
that.energyUp1();
that.initMxqBtnGroup();
that.setSceneTips(1);
console.log("初始化结束")
that.updateEnergy();
that.salmonGroup = new FYGE.Sprite();
that.addChild(that.salmonGroup);
that.salmonGroup.mouseChildren = true;
setTimeout(() => {
that.initDialog();
that.coinAnimGroup = new FYGE.Sprite();
that.addChild(that.coinAnimGroup);
}, 100)
// that.initSalmon();
// that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene);
// var a = Ins.initLabel({text:"ergergergergerg",x:300,y:800});
// this.addChildAt(a,999);
} catch {
(e) => {
console.log("fgggg----->", e)
}
}
console.log(that.y);
that.mouseChildren = true;
Ins.salmonArr = [];
Ins.curScene = Ins.senceInfo.sence;
console.log("当前场景", Ins.curScene);
//0:教室,1:操场,2:寝室
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
//生成默认场景,后面要改成根据接口值判断
that.sceneBg = Ins.initSprite(that.bgUUID[Ins.curScene == 4 ? 2 : Ins.curScene - 1]);
that.addChild(that.sceneBg);
that.x = (Ins.stageW - that.sceneBg.width) >> 1;
that.y = (Ins.stageH - that.sceneBg.height) >> 1;
that.mainUi = new MainSceneBtnUi({ uiType: Ins.curScene == 4 ? 3 : Ins.curScene, callF: () => { that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene) } });
that.addChild(that.mainUi);
that.outTips = Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins.stageW - 388) * 0.5, 460);
that.addChild(that.outTips);
that.outTips.visible = false;
that.initTlBtnGroup();
that.initCat();
that.initEnergy();
that.energyUp1();
that.initMxqBtnGroup();
that.setSceneTips(1);
console.log("初始化结束")
that.updateEnergy();
that.salmonGroup = new FYGE.Sprite();
that.addChild(that.salmonGroup);
that.salmonGroup.mouseChildren = true;
setTimeout(() => {
that.initDialog();
that.coinAnimGroup = new FYGE.Sprite();
that.addChild(that.coinAnimGroup);
}, 100)
// that.initSalmon();
// that.initGuide(Ins.curScene > 3 ? 3 : Ins.curScene);
// var a = Ins.initLabel({text:"ergergergergerg",x:300,y:800});
// this.addChildAt(a,999);
} }
/**初始化对话框 */ /**初始化对话框 */
...@@ -321,7 +330,8 @@ export class MainScene extends Scene { ...@@ -321,7 +330,8 @@ export class MainScene extends Scene {
that.energyGroup.addChild(that.energyDeco); that.energyGroup.addChild(that.energyDeco);
that.energyDialog = Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60); that.energyDialog = Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60);
that.energyGroup.addChild(that.energyDialog); that.energyGroup.addChild(that.energyDialog);
that.energyDialogLabel = Ins.initLabel({ size: 26, text: "每10分钟恢复1点精力" }); let recoverTime = Math.floor(Ins.recoverEnergy/1000/60);
that.energyDialogLabel = Ins.initLabel({ size: 26, text: `每${recoverTime}分钟恢复1点精力` });
that.energyDialog.addChild(that.energyDialogLabel); that.energyDialog.addChild(that.energyDialogLabel);
that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5; that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5;
that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6; that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6;
...@@ -347,13 +357,14 @@ export class MainScene extends Scene { ...@@ -347,13 +357,14 @@ export class MainScene extends Scene {
that.maxEnergy = Ins.userInfo.energyMax; that.maxEnergy = Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg); FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco); FYGE.Tween.removeTweens(that.energyDeco);
let scaleX = (that.energy / that.maxEnergy)>1?1:(that.energy / that.maxEnergy);
if (that.firstSetEnergy) { if (that.firstSetEnergy) {
that.firstSetEnergy = false; that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy); that.energyImg.scaleX = scaleX
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2; that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
} else { } else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyImg).to({ scaleX: scaleX }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * scaleX - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
} }
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy; that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2 that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2
...@@ -416,13 +427,13 @@ export class MainScene extends Scene { ...@@ -416,13 +427,13 @@ export class MainScene extends Scene {
if (s) { if (s) {
that.recoverEnergyTime = Ins.recoverEnergy; that.recoverEnergyTime = Ins.recoverEnergy;
console.log("设置恢复时间", that.recoverEnergyTime) console.log("设置恢复时间", that.recoverEnergyTime)
let energyList = r.data.energyList; let energyList = r.data.energyList;
that.initSalmon(energyList); that.initSalmon(energyList);
// if (r.data.energy != Ins.userInfo.energy) { // if (r.data.energy != Ins.userInfo.energy) {
Ins.userInfo.energy = r.data.energy; Ins.userInfo.energy = r.data.energy;
// that.recoverEnergyTime = Ins.recoverEnergy; // that.recoverEnergyTime = Ins.recoverEnergy;
// console.log("设置恢复时间",that.recoverEnergyTime) // console.log("设置恢复时间",that.recoverEnergyTime)
that.setEnergy(); that.setEnergy();
return; return;
// } else { // } else {
// if (r.data.energy != Ins.userInfo.energyMax) { // if (r.data.energy != Ins.userInfo.energyMax) {
...@@ -620,7 +631,10 @@ export class MainScene extends Scene { ...@@ -620,7 +631,10 @@ export class MainScene extends Scene {
let flagIndex = 0; let flagIndex = 0;
//可以放置的空的三文鱼索引 //可以放置的空的三文鱼索引
let canSetIndexArr = []; let canSetIndexArr = [];
while (flagIndex < 8) { let maxEnergy = Ins.userInfo.energyMax;
let limitEnergy = Ins.userInfo.limitEnergyCount||5;
let salmonMaxCnt = list.length >= 8 ? list.length : Math.ceil(maxEnergy / limitEnergy)
while (flagIndex < salmonMaxCnt) {
if (!this.salmonFlag[flagIndex]) { if (!this.salmonFlag[flagIndex]) {
canSetIndexArr.push({ index: flagIndex }); canSetIndexArr.push({ index: flagIndex });
} }
......
...@@ -2326,6 +2326,7 @@ var Ins = (function () { ...@@ -2326,6 +2326,7 @@ var Ins = (function () {
return minutes + "分" + seconds + "秒"; return minutes + "分" + seconds + "秒";
}; };
Ins.recoverEnergy = 10 * 60 * 1000; Ins.recoverEnergy = 10 * 60 * 1000;
Ins.canGetSalmon = true;
Ins.salmonArr = []; Ins.salmonArr = [];
return Ins; return Ins;
}()); }());
...@@ -3148,6 +3149,10 @@ var Salmon = (function (_super) { ...@@ -3148,6 +3149,10 @@ var Salmon = (function (_super) {
this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this); this.removeEventListener(FYGE.MouseEvent.CLICK, this.getEnegry, this);
}; };
Salmon.prototype.getEnegry = function () { Salmon.prototype.getEnegry = function () {
if (!Ins_1.Ins.canGetSalmon)
return;
Ins_1.Ins.canGetSalmon = false;
Ins_1.Ins.showLoading();
var that = this; var that = this;
that.mouseEnable = false; that.mouseEnable = false;
console.log("收取精力值:", that.salmonCnt); console.log("收取精力值:", that.salmonCnt);
...@@ -3161,6 +3166,7 @@ var Salmon = (function (_super) { ...@@ -3161,6 +3166,7 @@ var Salmon = (function (_super) {
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } }); FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.UPDATE_ENERGY, { call: function () { that.getSalmonAnim(); } });
} }
else { else {
Ins_1.Ins.canGetSalmon = true;
that.mouseEnable = true; that.mouseEnable = true;
Ins_1.Ins.showToast(r && r.message); Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading(); Ins_1.Ins.hideLoading();
...@@ -3168,6 +3174,7 @@ var Salmon = (function (_super) { ...@@ -3168,6 +3174,7 @@ var Salmon = (function (_super) {
}); });
}; };
Salmon.prototype.getSalmonAnim = function () { Salmon.prototype.getSalmonAnim = function () {
Ins_1.Ins.canGetSalmon = true;
console.log("开始三文鱼动效"); console.log("开始三文鱼动效");
var index = Ins_1.Ins.salmonArr.indexOf(this); var index = Ins_1.Ins.salmonArr.indexOf(this);
Ins_1.Ins.salmonArr.splice(index, 1); Ins_1.Ins.salmonArr.splice(index, 1);
...@@ -47414,38 +47421,47 @@ var MainScene = (function (_super) { ...@@ -47414,38 +47421,47 @@ var MainScene = (function (_super) {
that.initSceneEle(); that.initSceneEle();
}; };
MainScene.prototype.initSceneEle = function () { MainScene.prototype.initSceneEle = function () {
var that = this; try {
console.log(that.y); var that = this;
that.mouseChildren = true; console.log(that.y);
Ins_1.Ins.salmonArr = []; that.mouseChildren = true;
Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence; Ins_1.Ins.canGetSalmon = true;
console.log("当前场景", Ins_1.Ins.curScene); Ins_1.Ins.salmonArr = [];
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"]; Ins_1.Ins.curScene = Ins_1.Ins.senceInfo.sence;
that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]); Ins_1.Ins.recoverEnergy = Ins_1.Ins.userInfo.recoveryTime || 20 * 60 * 1000;
that.addChild(that.sceneBg); console.log("当前场景", Ins_1.Ins.curScene);
that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1; that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1; that.sceneBg = Ins_1.Ins.initSprite(that.bgUUID[Ins_1.Ins.curScene == 4 ? 2 : Ins_1.Ins.curScene - 1]);
that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } }); that.addChild(that.sceneBg);
that.addChild(that.mainUi); that.x = (Ins_1.Ins.stageW - that.sceneBg.width) >> 1;
that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460); that.y = (Ins_1.Ins.stageH - that.sceneBg.height) >> 1;
that.addChild(that.outTips); that.mainUi = new mainSceneBtnUi_1.MainSceneBtnUi({ uiType: Ins_1.Ins.curScene == 4 ? 3 : Ins_1.Ins.curScene, callF: function () { that.initGuide(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene); } });
that.outTips.visible = false; that.addChild(that.mainUi);
that.initTlBtnGroup(); that.outTips = Ins_1.Ins.initSprite("25abb1fa-58a8-4fed-a962-ab7fb7eed528", (Ins_1.Ins.stageW - 388) * 0.5, 460);
that.initCat(); that.addChild(that.outTips);
that.initEnergy(); that.outTips.visible = false;
that.energyUp1(); that.initTlBtnGroup();
that.initMxqBtnGroup(); that.initCat();
that.setSceneTips(1); that.initEnergy();
console.log("初始化结束"); that.energyUp1();
that.updateEnergy(); that.initMxqBtnGroup();
that.salmonGroup = new FYGE.Sprite(); that.setSceneTips(1);
that.addChild(that.salmonGroup); console.log("初始化结束");
that.salmonGroup.mouseChildren = true; that.updateEnergy();
setTimeout(function () { that.salmonGroup = new FYGE.Sprite();
that.initDialog(); that.addChild(that.salmonGroup);
that.coinAnimGroup = new FYGE.Sprite(); that.salmonGroup.mouseChildren = true;
that.addChild(that.coinAnimGroup); setTimeout(function () {
}, 100); that.initDialog();
that.coinAnimGroup = new FYGE.Sprite();
that.addChild(that.coinAnimGroup);
}, 100);
}
catch (_a) {
(function (e) {
console.log("fgggg----->", e);
});
}
}; };
MainScene.prototype.initDialog = function () { MainScene.prototype.initDialog = function () {
this.dialogGroup = new FYGE.Sprite(); this.dialogGroup = new FYGE.Sprite();
...@@ -47588,7 +47604,8 @@ var MainScene = (function (_super) { ...@@ -47588,7 +47604,8 @@ var MainScene = (function (_super) {
that.energyGroup.addChild(that.energyDeco); that.energyGroup.addChild(that.energyDeco);
that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60); that.energyDialog = Ins_1.Ins.initSprite("69009eb9-4593-4a43-a9d7-a6356ebd6d04", 174, -60);
that.energyGroup.addChild(that.energyDialog); that.energyGroup.addChild(that.energyDialog);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "每10分钟恢复1点精力" }); var recoverTime = Math.floor(Ins_1.Ins.recoverEnergy / 1000 / 60);
that.energyDialogLabel = Ins_1.Ins.initLabel({ size: 26, text: "\u6BCF" + recoverTime + "\u5206\u949F\u6062\u590D1\u70B9\u7CBE\u529B" });
that.energyDialog.addChild(that.energyDialogLabel); that.energyDialog.addChild(that.energyDialogLabel);
that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5; that.energyDialogLabel.x = (that.energyDialog.width - that.energyDialogLabel.textWidth) * 0.5;
that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6; that.energyDialogLabel.y = (that.energyDialog.height - that.energyDialogLabel.textHeight) * 0.5 - 6;
...@@ -47611,14 +47628,15 @@ var MainScene = (function (_super) { ...@@ -47611,14 +47628,15 @@ var MainScene = (function (_super) {
that.maxEnergy = Ins_1.Ins.userInfo.energyMax; that.maxEnergy = Ins_1.Ins.userInfo.energyMax;
FYGE.Tween.removeTweens(that.energyImg); FYGE.Tween.removeTweens(that.energyImg);
FYGE.Tween.removeTweens(that.energyDeco); FYGE.Tween.removeTweens(that.energyDeco);
var scaleX = (that.energy / that.maxEnergy) > 1 ? 1 : (that.energy / that.maxEnergy);
if (that.firstSetEnergy) { if (that.firstSetEnergy) {
that.firstSetEnergy = false; that.firstSetEnergy = false;
that.energyImg.scaleX = (that.energy / that.maxEnergy); that.energyImg.scaleX = scaleX;
that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2; that.energyDeco.x = that.energyImgW * that.energyImg.scaleX - that.energyDeco.width * 0.2;
} }
else { else {
FYGE.Tween.get(that.energyImg).to({ scaleX: (that.energy / that.maxEnergy) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyImg).to({ scaleX: scaleX }, 1000, FYGE.Ease.quadOut);
FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * (that.energy / that.maxEnergy) - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut); FYGE.Tween.get(that.energyDeco).to({ x: (that.energyImgW * scaleX - that.energyDeco.width * 0.2) }, 1000, FYGE.Ease.quadOut);
} }
that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy; that.energyLabel.text = "精力" + that.energy + "/" + that.maxEnergy;
that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2; that.energyLabel.x = (that.energyGroup.width - that.energyLabel.textWidth) / 2;
...@@ -47853,7 +47871,10 @@ var MainScene = (function (_super) { ...@@ -47853,7 +47871,10 @@ var MainScene = (function (_super) {
if (list.length >= Ins_1.Ins.salmonArr.length) { if (list.length >= Ins_1.Ins.salmonArr.length) {
var flagIndex = 0; var flagIndex = 0;
var canSetIndexArr = []; var canSetIndexArr = [];
while (flagIndex < 8) { var maxEnergy = Ins_1.Ins.userInfo.energyMax;
var limitEnergy = Ins_1.Ins.userInfo.limitEnergyCount || 5;
var salmonMaxCnt = list.length >= 8 ? list.length : Math.ceil(maxEnergy / limitEnergy);
while (flagIndex < salmonMaxCnt) {
if (!this.salmonFlag[flagIndex]) { if (!this.salmonFlag[flagIndex]) {
canSetIndexArr.push({ index: flagIndex }); canSetIndexArr.push({ index: flagIndex });
} }
...@@ -367,11 +367,11 @@ Page({ ...@@ -367,11 +367,11 @@ Page({
if (success) { if (success) {
my.hideLoading(); my.hideLoading();
app.openId = data.openId; app.openId = data.openId;
if(data.customValue != 1){ if(data.loadValue != 1){
this.initCanvas(); this.initCanvas();
} }
this.setData({ this.setData({
customValue:data.customValue customValue:data.loadValue
}) })
this.getActivityBaseInfoById(); this.getActivityBaseInfoById();
} }
......
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