|
|
@@ -229,9 +229,9 @@ cc.Class({
|
|
|
// console.log(value);
|
|
|
if (0 === value.code) {
|
|
|
//收成后处理相关状态
|
|
|
- this.harvestNode.active = false;
|
|
|
- this.midSliderNode.active = false
|
|
|
- this._workingBuilding.onSetGrow(0, null);
|
|
|
+ this.leaseLandInfo.plant = 0;
|
|
|
+ this.leaseLandInfo.seedInfo = null;
|
|
|
+ this._resetLandInfo();
|
|
|
//更新仓库列表
|
|
|
this._buildingView.onUpdateList();
|
|
|
if (value.data.isWithered) {
|
|
|
@@ -245,19 +245,11 @@ cc.Class({
|
|
|
GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.data.msg, 2);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- this.isShowHarvest = false;
|
|
|
- this.isShowIndex = 0;
|
|
|
- if (this.timeInterval) {
|
|
|
- clearInterval(this.timeInterval);
|
|
|
- this.timeInterval = null;
|
|
|
- }
|
|
|
} else if (706 === value.code) {
|
|
|
//土地到期,没有更新刷新的处理刷新
|
|
|
GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.msg, 1);
|
|
|
//重置锁定状态显示
|
|
|
this.onLockLand();
|
|
|
-
|
|
|
} else {
|
|
|
GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.msg, 1);
|
|
|
}
|
|
|
@@ -383,28 +375,34 @@ cc.Class({
|
|
|
if (this.notLeased) {
|
|
|
this.notLeased.active = true;
|
|
|
}
|
|
|
- //清除当前租赁数据
|
|
|
+ //清除当前租赁数据
|
|
|
this.leaseLandInfo = null;
|
|
|
- this.isShowHarvest = false;
|
|
|
- this.isShowIndex = 0;
|
|
|
- if (this.timeInterval) {
|
|
|
- clearInterval(this.timeInterval);
|
|
|
- this.timeInterval = null;
|
|
|
- }
|
|
|
-
|
|
|
- //去除提示框
|
|
|
- this.upSliderNode.parent.active = false;
|
|
|
- this.midSliderNode.active = false;
|
|
|
- this.harvestNode.active = false;
|
|
|
-
|
|
|
- this.stealHarvestNode.active = false;
|
|
|
+ this._resetLandInfo();
|
|
|
|
|
|
- //重置土地图片
|
|
|
- this._workingBuilding.onSetGrow(0, null);
|
|
|
+ },
|
|
|
+ _resetLandInfo(){
|
|
|
+
|
|
|
+ this.isShowHarvest = false;
|
|
|
+ this.isShowIndex = 0;
|
|
|
+ if (this.timeInterval) {
|
|
|
+ clearInterval(this.timeInterval);
|
|
|
+ this.timeInterval = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //去除提示框
|
|
|
+ this.upSliderNode.parent.active = false;
|
|
|
+ this.midSliderNode.active = false;
|
|
|
+ this.harvestNode.active = false;
|
|
|
+
|
|
|
+ this.stealHarvestNode.active = false;
|
|
|
+
|
|
|
+ //重置土地图片
|
|
|
+ this._workingBuilding.onSetGrow(0, null);
|
|
|
+
|
|
|
+ this.onSetInfoBoxActive(false);
|
|
|
+ },
|
|
|
|
|
|
- this.onSetInfoBoxActive(false);
|
|
|
|
|
|
- },
|
|
|
//设置config的土地信息
|
|
|
setConfigLandInfo(value) {
|
|
|
this.configLandInfo = value;
|