|
|
@@ -41,6 +41,11 @@ cc.Class({
|
|
|
seedSpriteFrame: {
|
|
|
default: [],
|
|
|
type: [cc.SpriteFrame]
|
|
|
+ },
|
|
|
+
|
|
|
+ seedNodeArry: {
|
|
|
+ default: [],
|
|
|
+ type: [cc.Node]
|
|
|
}
|
|
|
},
|
|
|
HiddenAll() {
|
|
|
@@ -50,16 +55,13 @@ cc.Class({
|
|
|
this.Exchange.active = false;
|
|
|
},
|
|
|
start() {
|
|
|
- this.seedNodeArry = [];
|
|
|
//默认设置第一个节点为 最上面
|
|
|
this.SeedBtn.setSiblingIndex(10);
|
|
|
-
|
|
|
+
|
|
|
//获取种子和果实
|
|
|
GlobalD.GameData.getMallSeed((res, vaule) => {
|
|
|
this.mySeedList = vaule.data.seed;
|
|
|
- //this.myFruitList = vaule.data.fruit;
|
|
|
-
|
|
|
- //console.log(this.mySeedList, this.myFruitList);
|
|
|
+
|
|
|
for (let i = 0; i < this.mySeedList.length; i++) {
|
|
|
//没有种子数量不显示 todo 看看后续需不需要处理删除
|
|
|
if (this.mySeedList[i].amount < 1) continue;
|
|
|
@@ -123,22 +125,26 @@ cc.Class({
|
|
|
//面板设置index
|
|
|
|
|
|
//种子
|
|
|
- if ('1' == index) {
|
|
|
+ if ('0' == index) {
|
|
|
this.SeedBtn.y = -20;
|
|
|
this.SeedBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Seed_Sprite;
|
|
|
this.Seed.active = true;
|
|
|
- this.SelectedFrame.parent = this.seedNodeArry[0];
|
|
|
|
|
|
+ if(this.seedNodeArry.length!=0)
|
|
|
+ {
|
|
|
+ this.SelectedFrame.parent = this.seedNodeArry[0];
|
|
|
+ }
|
|
|
+
|
|
|
//if (this.mySeedList.length > 0) {
|
|
|
// let Synopsis = "成熟期:" + this.mySeedList[0].maturity;
|
|
|
// this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.mySeedList[0].name, this.mySeedList[0].priceSnb, Synopsis);
|
|
|
//}
|
|
|
-
|
|
|
+
|
|
|
this.SeedBtn.setSiblingIndex(10);
|
|
|
this.SeedBtn.setContentSize(86, 88);
|
|
|
}
|
|
|
//兑换
|
|
|
- else if ('2' == index) {
|
|
|
+ else if ('1' == index) {
|
|
|
this.ExchangeBtn.y = -20;
|
|
|
this.ExchangeBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Exchange_Sprite;
|
|
|
this.Exchange.active = true;
|