|
|
@@ -80,11 +80,12 @@ cc.Class({
|
|
|
ExchangeBtn: cc.Button,
|
|
|
//钻石足够获得种子
|
|
|
DiamondSeedsView: cc.Node,
|
|
|
+ LightRotate: cc.Node,
|
|
|
DiamondSeeds_SureBtn: cc.Button,
|
|
|
|
|
|
inviteNode: cc.Node,
|
|
|
|
|
|
- listUserInfoNode:cc.Node,
|
|
|
+ listUserInfoNode: cc.Node,
|
|
|
|
|
|
//商店面的介绍模板
|
|
|
mallContent_Name: cc.Label,
|
|
|
@@ -595,15 +596,16 @@ cc.Class({
|
|
|
},
|
|
|
|
|
|
onListUserInfo_Open() {
|
|
|
- this.listUserInfoNode.getComponent('userListInfo').onOpen();
|
|
|
+ this.listUserInfoNode.getComponent('userListInfo').onOpen()
|
|
|
},
|
|
|
|
|
|
//点击钻石兑换
|
|
|
onButtonEvent_Exchange() {
|
|
|
- this.onSetTouchStatus(this.DiamondGapView, true)
|
|
|
+ this.DiamondGapView.active = true
|
|
|
+ // this.onSetTouchStatus(this.DiamondGapView, true)
|
|
|
//判断钻石数量是否大于等于3万个
|
|
|
if (GlobalD.GameData.GetDiamond() < 30000) {
|
|
|
- this.ExchangeBtn.interactable = true
|
|
|
+ this.ExchangeBtn.interactable = false
|
|
|
// GlobalD.GameData.showToast(
|
|
|
// cc.find('Canvas/UICamera'),
|
|
|
// '钻石数量不够,累积到30000个钻石即可免费兑换一包辣椒种子。',
|
|
|
@@ -616,7 +618,7 @@ cc.Class({
|
|
|
},
|
|
|
//点击取消钻石兑换
|
|
|
onButtonEvent_ExchangeCancel() {
|
|
|
- this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
+ this.DiamondGapView.active = false
|
|
|
},
|
|
|
|
|
|
//点击确认钻石兑换辣椒种子
|
|
|
@@ -624,6 +626,7 @@ cc.Class({
|
|
|
let diamonAmount = 30000
|
|
|
//调用兑换接口
|
|
|
GlobalD.GameData.exchangeSeed(diamonAmount, (value) => {
|
|
|
+ return
|
|
|
//兑换成功
|
|
|
if (0 === value.code) {
|
|
|
var BuildingView = cc
|
|
|
@@ -631,21 +634,24 @@ cc.Class({
|
|
|
.getComponent('BuildingView')
|
|
|
BuildingView.onUpdateList()
|
|
|
|
|
|
- this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
- this.onSetTouchStatus(this.DiamondSeedsView, true)
|
|
|
+ this.DiamondGapView.active = false
|
|
|
+ this.DiamondSeedsView.active = true
|
|
|
+
|
|
|
+ //光芒旋转
|
|
|
+ var rotate = cc.repeatForever(cc.rotateBy(2, -100, 0))
|
|
|
+ this.LightRotate.runAction(rotate)
|
|
|
} else {
|
|
|
//兑换失败
|
|
|
GlobalD.GameData.showToast(cc.find('Canvas/UICamera'), value.msg, 2)
|
|
|
- this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
- this.onSetTouchStatus(this.DiamondSeedsView, true)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//点击钻石兑换的确认按钮
|
|
|
onButtonEvent_DiamondSure() {
|
|
|
- this.onSetTouchStatus(this.DiamondSeedsView, false)
|
|
|
- this.onSetTouchStatus(this.DiamondGapView, false)
|
|
|
+ this.DiamondSeedsView.active = false
|
|
|
+ //停止光芒旋转
|
|
|
+ this.LightRotate.stopAllActions()
|
|
|
},
|
|
|
|
|
|
//音效设置界面
|