|
|
@@ -92,7 +92,7 @@ cc.Class({
|
|
|
},
|
|
|
onLoad() {
|
|
|
cc.game.setFrameRate(30)
|
|
|
- cc.director.preloadScene('Login', function () { }.bind(this))
|
|
|
+ cc.director.preloadScene('Login', function () {}.bind(this))
|
|
|
if (this.EditorialBuildings) {
|
|
|
this._thisEditBuildingsParent = this.EditorialBuildings.parent
|
|
|
this._Cancellation = this.EditorialBuildings.getChildByName(
|
|
|
@@ -209,8 +209,8 @@ cc.Class({
|
|
|
.getChildByName('PriceBG')
|
|
|
.getChildByName('label')
|
|
|
.getComponent(cc.Label).string = this.FormatMoney(
|
|
|
- AConfig.BuildingUnlockMoneyArray[i]
|
|
|
- )
|
|
|
+ AConfig.BuildingUnlockMoneyArray[i]
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
// *********** todo *************
|
|
|
@@ -234,7 +234,7 @@ cc.Class({
|
|
|
if (0 === value.code) {
|
|
|
//没有兑换过和没有租赁过
|
|
|
if (!value.data.isExchange && !value.data.isLeased) {
|
|
|
- this.DiamondGapViewShow();
|
|
|
+ this.DiamondGapViewShow()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -545,7 +545,7 @@ cc.Class({
|
|
|
//商城界面
|
|
|
if (this.StoreView.active) this.onSetTouchStatus(this.StoreView, false)
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//底部菜单栏
|
|
|
onBottomMenuView(isActive) {
|
|
|
if (this.BottomView) {
|
|
|
@@ -577,7 +577,7 @@ cc.Class({
|
|
|
this.BuildingInfoView.active = false
|
|
|
},
|
|
|
//进入编辑模式,
|
|
|
- onEnterEditing() { },
|
|
|
+ onEnterEditing() {},
|
|
|
onSetTouchStatus(target, isActive) {
|
|
|
target.active = isActive
|
|
|
if (this.UITouch) {
|
|
|
@@ -592,30 +592,46 @@ cc.Class({
|
|
|
this.inviteNode.getComponent('inviteInfo').onOpenInviteInfo()
|
|
|
},
|
|
|
|
|
|
-
|
|
|
//点击钻石兑换
|
|
|
onButtonEvent_Exchange() {
|
|
|
+ this.onSetTouchStatus(this.DiamondGapView, true)
|
|
|
//判断钻石数量是否大于等于3万个
|
|
|
if (GlobalD.GameData.GetDiamond() < 30000) {
|
|
|
- GlobalD.GameData.showToast(
|
|
|
- cc.find('Canvas/UICamera'),
|
|
|
- '钻石数量不够,累积到30000个钻石即可免费兑换一包辣椒种子。',
|
|
|
- 2
|
|
|
- )
|
|
|
+ this.ExchangeBtn.interactable = true
|
|
|
+ // GlobalD.GameData.showToast(
|
|
|
+ // cc.find('Canvas/UICamera'),
|
|
|
+ // '钻石数量不够,累积到30000个钻石即可免费兑换一包辣椒种子。',
|
|
|
+ // 2
|
|
|
+ // )
|
|
|
return
|
|
|
+ } else {
|
|
|
+ this.ExchangeBtn.interactable = true
|
|
|
}
|
|
|
- let diamonAmount = 30000;
|
|
|
+ },
|
|
|
+ //点击取消钻石兑换
|
|
|
+ onButtonEvent_ExchangeCancel() {
|
|
|
+ this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
+ },
|
|
|
+
|
|
|
+ //点击确认钻石兑换辣椒种子
|
|
|
+ onButtonEvent_ExchangeChili() {
|
|
|
+ let diamonAmount = 30000
|
|
|
//调用兑换接口
|
|
|
GlobalD.GameData.exchangeSeed(diamonAmount, (res, value) => {
|
|
|
//兑换成功
|
|
|
if (0 === value.code) {
|
|
|
- var BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView").getComponent("BuildingView");
|
|
|
- BuildingView.onUpdateList();
|
|
|
+ var BuildingView = cc
|
|
|
+ .find('Canvas/UICamera/BuildingContainer/BuildingView')
|
|
|
+ .getComponent('BuildingView')
|
|
|
+ BuildingView.onUpdateList()
|
|
|
|
|
|
- this.onSetTouchStatus(this.DiamondSeedsView, true);
|
|
|
+ this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
+ this.onSetTouchStatus(this.DiamondSeedsView, true)
|
|
|
} else {
|
|
|
//兑换失败
|
|
|
GlobalD.GameData.showToast(cc.find('Canvas/UICamera'), value.msg, 2)
|
|
|
+ this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
+ this.onSetTouchStatus(this.DiamondSeedsView, true)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -960,7 +976,7 @@ cc.Class({
|
|
|
20,
|
|
|
-470,
|
|
|
task.taskCursorName[4],
|
|
|
- function (nodePrefabs) { }.bind(this)
|
|
|
+ function (nodePrefabs) {}.bind(this)
|
|
|
)
|
|
|
}
|
|
|
},
|