Pārlūkot izejas kodu

1.修改显示bug

slambb 3 gadi atpakaļ
vecāks
revīzija
df265685c6

+ 14 - 13
assets/Prefabs/UI/lease/LeaseInfo.prefab

@@ -578,7 +578,7 @@
         "__id__": 21
       }
     ],
-    "_active": true,
+    "_active": false,
     "_level": 0,
     "_components": [
       {
@@ -741,7 +741,7 @@
       "__id__": 14
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 0,
     "_components": [
       {
@@ -1003,7 +1003,7 @@
     "_N$target": {
       "__id__": 14
     },
-    "_N$isChecked": true,
+    "_N$isChecked": false,
     "toggleGroup": null,
     "checkMark": {
       "__id__": 19
@@ -1084,7 +1084,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -11.139,
+      "x": -82.542,
       "y": 3,
       "z": 0
     },
@@ -1217,7 +1217,7 @@
       "__id__": 27
     },
     "_children": [],
-    "_active": false,
+    "_active": true,
     "_level": 0,
     "_components": [
       {
@@ -1479,7 +1479,7 @@
     "_N$target": {
       "__id__": 27
     },
-    "_N$isChecked": false,
+    "_N$isChecked": true,
     "toggleGroup": null,
     "checkMark": {
       "__id__": 32
@@ -1560,7 +1560,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 57.26,
+      "x": 0.63,
       "y": 3,
       "z": 0
     },
@@ -2140,7 +2140,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 141.5,
+      "width": 99.23,
       "height": 47.88
     },
     "_anchorPoint": {
@@ -2186,8 +2186,8 @@
       }
     ],
     "_useOriginalSize": false,
-    "_string": "600CNT",
-    "_N$string": "600CNT",
+    "_string": "0CNT",
+    "_N$string": "0CNT",
     "_fontSize": 38,
     "_lineHeight": 38,
     "_enableWrapText": true,
@@ -3222,8 +3222,8 @@
       }
     ],
     "_useOriginalSize": false,
-    "_string": "可用与种植农作用,购买种子\n播种到土地,等农作物成熟后\n收获到仓库,售卖之后可获得\n神农贝。",
-    "_N$string": "可用与种植农作用,购买种子\n播种到土地,等农作物成熟后\n收获到仓库,售卖之后可获得\n神农贝。",
+    "_string": "可用于种植农作物,购买种子\n播种到土地,等农作物成熟后\n收获到仓库,售卖之后可获得\n神农贝。",
+    "_N$string": "可用于种植农作物,购买种子\n播种到土地,等农作物成熟后\n收获到仓库,售卖之后可获得\n神农贝。",
     "_fontSize": 24,
     "_lineHeight": 24,
     "_enableWrapText": true,
@@ -4021,7 +4021,7 @@
     },
     "_enabled": true,
     "inputInviteValue": "",
-    "toggleInputValue": "1",
+    "toggleInputValue": "2",
     "totalPriceLabel": {
       "__id__": 59
     },
@@ -4045,6 +4045,7 @@
       "__id__": 93
     },
     "leaseFarmlandInfoNode": null,
+    "AutoGetLandData": null,
     "_id": ""
   },
   {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 331 - 238
assets/Prefabs/UI/store/StoreContainer.prefab


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 296 - 784
assets/Scene/MyCityScene - 004.fire


+ 41 - 26
assets/Script/Lease/LeaseInfo.js

@@ -14,7 +14,7 @@ cc.Class({
 
         //1 对应3个月,2对应1年,3对应5年
         toggleInputValue: {
-            default: '1',
+            default: '2',
             visible: false
         },
         totalPriceLabel: {
@@ -69,7 +69,9 @@ cc.Class({
             serializable: true,
             visible: false,
             toolTip: "操作的土地对象,初始化时候传入"
-        }
+        },
+        //轮询土地状态
+        AutoGetLandData: null,
     },
 
     // LIFE-CYCLE CALLBACKS:
@@ -96,8 +98,12 @@ cc.Class({
 
         var numberTemp = new RegExp("^[A-Za-z0-9]+$");
         if (numberTemp.test(value)) {
-            if (Number(value) >= 1) {
+            if (Number(value) >= 1 && Number(value) <= 100) {
                 this.inputInviteValue = Number(value);
+            } else if (Number(value) > 100) {
+                //限制只能输入100
+                this.inputInviteValue = 100;
+                this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
             } else {
                 this.inputInviteValue = 1;
                 this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
@@ -153,36 +159,45 @@ cc.Class({
         let _self = this;
         //cntAmount,payType,itemType,callback
         let _configLandInfo = this.leaseFarmlandInfoNode.getComponent("LeaseFarmlandInfo").configLandInfo
-        let payType = 0;
-        switch (this.toggleInputValue) {
-            case "1":
-                payType = 1;
-                break;
-            case "2":
-                payType = 5;
-                break;
-            case "3":
-                payType = 6;
-                break;
-            default:
-                console.error("this.toggleInputValue 不是1 2 3!", this.toggleInputValue);
-                break;
-        }
-        if(0 === payType){
-            console.log('选择租赁日错误:' + this.totalPriceValue + " == " + payType);
-        }
 
-        GlobalD.GameData.payCNT(this.totalPriceValue, payType, _configLandInfo.id, (data) => {
-            console.log("土地支付:", this.totalPriceValue, "== playType=", 1, ",item_type==", _configLandInfo.id);
+        //租赁的itemType 要处理一下
+        let _itemType = this.toggleInputValue + "or" + _configLandInfo.id;
+
+        GlobalD.GameData.payCNT(this.totalPriceValue, 1, _itemType, (data) => {
+            console.log("土地支付:", this.totalPriceValue, "== playType=", 1, ",item_type==", _itemType);
             console.log("支付data:", data);
             const [err, tx] = data;
 
             if (err === null) {
                 // TODO 成功, 支付为链上操作,需要提供回调接口给这边服务端确认交易成功后修改购买订单结果
                 console.log(tx) // 交易hash,唯一标识符
-                //解锁土地操作
-                this.leaseFarmlandInfoNode.getComponent("LeaseFarmlandInfo").onUnlockLand();
-                this.onClose();
+
+                //todo 如果是土地租赁,轮询土地状态 
+                if (this.AutoGetLandData) {
+                    this.unschedule(this.AutoGetLandData);
+                    this.AutoGetLandData = null;
+                }
+                this.AutoGetLandData = () => {
+                    GlobalD.GameData.getLandState({
+                        landId: _configLandInfo.id,
+                        callback: (res, value) => {
+                            console.log("轮询土地数据:" + JSON.stringify(value.msg));
+                            if (0 === value.code) {
+                                this.unschedule(this.AutoGetLandData);
+                                console.log("轮询到土地购买成功!");
+                                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "土地购买成功!", 5);
+                                //解锁土地操作
+                            
+                                let _landData = value.data;
+                                this.leaseFarmlandInfoNode.getComponent("LeaseFarmlandInfo").setLeaseLandInfo(_landData);
+                               
+
+                                this.onClose();
+                            }
+                        }
+                    });
+                };
+                this.schedule(this.AutoGetLandData, 5);
             } else {
                 console.log(err)
             }

+ 6 - 6
assets/Script/Network/dapp.js

@@ -18,11 +18,11 @@ cc.Class({
             let dapp = GlobalD.dapp = new Dapp()
             try {
                 const isTestNet = window['isTestNet'];
-                console.log('-----------开始初始化dapp!-----------');
-                console.log('isTestNet:' + window['isTestNet']);
+                // console.log('-----------开始初始化dapp!-----------');
+                // console.log('isTestNet:' + window['isTestNet']);
                 console.log('host:     ' + window['dappHost']);
-                console.log('dappWss:   ' + window['dappWss']);
-                console.log('-----------以上是相关设置-----------');
+                // console.log('dappWss:   ' + window['dappWss']);
+                // console.log('-----------以上是相关设置-----------');
                 await dapp.init(isTestNet)
                 console.log("用户当前钱包地址:" + dapp.getAddress()) // 初始化成功,得到用户当前钱包地址
                 dapp.onAccountChanged((account) => {
@@ -50,7 +50,7 @@ cc.Class({
                 const { err, res } = await dapp.userInfo()
                 if (err === null) {
                     // 返回成功,见下面消息体
-                    console.log(res)
+                    // console.log(res)
                     GlobalD.Dapp.UserInfo = res;
                     // GameNet.getInstance().init(res.id, (data) => {
                     //     console.log('GameNet:' + data);
@@ -76,7 +76,7 @@ cc.Class({
 
                     utils.post(utils.api.loginTokenAndVerification, dappLoginData, (res, value) => {
                         // console.log("loginTokenAndVerification========>", _temp);
-                        console.log(res, value);
+                        // console.log(res, value);
                         if (value.code == 0) {
                             /** 登录成功获取token */
                             utils.setToken(value.data.token);

+ 2 - 0
assets/Script/Network/netUtils.ts

@@ -42,6 +42,8 @@ var utils = {
         mallSeed: 'comMallSeed/getMallSeed',
         //仓库种子和果实
         getSeedAndFruit :'comPlayerGoods/getSeedAndFruit', 
+        //背包的种子数量
+        getSeedState:'comPlayerGoods/getSeedState',
         //收取果实
         addFruit:'comPlayerGoods/addFruit',
         //出售果实

+ 35 - 12
assets/Script/UI/BuildingView.js

@@ -119,25 +119,46 @@ cc.Class({
         //默认设置第一个节点为 最上面
         this.EvnBtn.setSiblingIndex(10);
 
+        this.onUpdateList();
+
+    },
+
+    onUpdateList() {
+        //先判断container下面是否存在Seed
+        // this.Seed.destroyAllChildren;
+        // console.log("this.Seed.children:", this.Seed.children);
+        let _children = this.Seed.children;
+        for (let i = _children.length - 1; i > 0; i--) {
+            _children[i].destroy();
+        }
+        // console.log("this.Seed.children2:", this.Seed.children);
 
         //获取种子和果实
         GlobalD.GameData.getWarehouseSeedAndFruit((res, vaule) => {
             this.mySeedList = vaule.data.seed;
             this.myFruitList = vaule.data.fruit;
 
-            console.log(this.mySeedList, this.myFruitList);
+            // console.log(this.mySeedList, this.myFruitList);
             for (let i = 0; i < this.mySeedList.length; i++) {
                 //没有种子数量不显示 todo 看看后续需不需要处理删除
                 if (this.mySeedList[i].amount < 1) continue;
 
                 let _seed = cc.instantiate(this.seedPrefab);
                 _seed.parent = this.Seed;
+                // if(0 == i){
+                //     this.Building40 = _seed;
+                // }
                 let _seedScript = _seed.getComponent("Content_Button");
+                _seedScript.Name = this.mySeedList[i].name;
+                _seedScript.Price = '';
+                _seedScript.SNB = this.mySeedList[i].priceSnb;
+                _seedScript.Synopsis = "成熟期:" + this.mySeedList[i].maturity + "天";
+
                 //设置一个生成点
                 let _spawnScript = _seed.getComponent("Content_seed");
                 _spawnScript.SpawnPoint = cc.find("Canvas/SpawnParent/SpawnPoint");
                 _spawnScript.goodsSeedInfo = this.mySeedList[i];//这里传递一个生成的种子信息过去
-               
+
                 _seedScript.NumLabel.string = this.mySeedList[i].amount;
                 _seedScript.NameLabel.string = this.mySeedList[i].name;
                 switch (this.mySeedList[i].picture) {
@@ -178,8 +199,8 @@ cc.Class({
                 }
                 //获取一下种子图片
                 _spawnScript.seedSpriteFrame = _seedScript.bgSprite.spriteFrame;
-                
-           
+
+
 
             }
             for (let i = 0; i < this.myFruitList.length; i++) {
@@ -229,6 +250,7 @@ cc.Class({
             }
         });
     },
+
     //切换建筑的面板
     onSwitchBuildingContent(event, index) {
 
@@ -267,7 +289,7 @@ cc.Class({
             this.EvnBtn.y = -20;
             this.EvnBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Env_Sprite;
             this.Env.active = true;
-            this.SelectedFrame.parent = this.Building00;
+            // this.SelectedFrame.parent = this.Building00;
             this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.Building00.getComponent('Content_Button').Name, this.Building00.getComponent('Content_Button').Price, this.Building00.getComponent('Content_Button').Synopsis);
 
             //设置节点顺序
@@ -279,7 +301,7 @@ cc.Class({
             this.LabourBtn.y = -20;
             this.LabourBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Labour_Sprite;
             this.Labour.active = true;
-            this.SelectedFrame.parent = this.Building10;
+            // this.SelectedFrame.parent = this.Building10;
             this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.Building10.getComponent('Content_Button').Name, this.Building10.getComponent('Content_Button').Price, this.Building10.getComponent('Content_Button').Synopsis);
 
             this.LabourBtn.setSiblingIndex(10);
@@ -290,7 +312,7 @@ cc.Class({
             this.ShopBtn.y = -20;
             this.ShopBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Shop_Sprite;
             this.Shop.active = true;
-            this.SelectedFrame.parent = this.Building20;
+            // this.SelectedFrame.parent = this.Building20;
             this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.Building20.getComponent('Content_Button').Name, this.Building20.getComponent('Content_Button').Price, this.Building20.getComponent('Content_Button').Synopsis);
 
             this.ShopBtn.setSiblingIndex(10);
@@ -302,7 +324,7 @@ cc.Class({
             this.SpeBuildingBtn.y = -20;
             this.SpeBuildingBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Spe_Sprite;
             this.SpeBuilding.active = true;
-            this.SelectedFrame.parent = this.Building30;
+            // this.SelectedFrame.parent = this.Building30;
             this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.Building30.getComponent('Content_Button').Name, this.Building30.getComponent('Content_Button').Price, this.Building30.getComponent('Content_Button').Synopsis);
 
             this.SpeBuildingBtn.setSiblingIndex(10);
@@ -313,11 +335,12 @@ cc.Class({
             this.SeedBtn.y = -20;
             this.SeedBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Seed_Sprite;
             this.Seed.active = true;
-            this.SelectedFrame.parent = this.Building40;
+            // this.SelectedFrame.parent = this.Building40;
 
             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);
+                let Synopsis = "成熟期:" + this.mySeedList[0].maturity + "天";
+                // this.mySeedList[0].priceSnb
+                this.ManageUI.getComponent('ManageUI').onSetButtonInfo(this.mySeedList[0].name, "", Synopsis);
             }
 
             this.SeedBtn.setSiblingIndex(10);
@@ -328,7 +351,7 @@ cc.Class({
             this.FruitBtn.y = -20;
             this.FruitBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Fruit_Sprite;
             this.Fruit.active = true;
-            this.SelectedFrame.parent = this.Building50;
+            // this.SelectedFrame.parent = this.Building50;
 
             if (this.myFruitList.length > 0) {
                 let Synopsis = "这是个" + this.myFruitList[0].name + "果实!";

+ 14 - 12
assets/Script/UI/ManageBuildings.js

@@ -486,7 +486,7 @@ cc.Class({
         }
         let _configLand = GlobalD.ConfigLand;
         let _userLeaseLand = GlobalD.UserLeaseLand;
-        console.log(_configLand, _userLeaseLand);
+        // console.log(_configLand, _userLeaseLand);
         // console.log(this.node.getComponent("ManageUI"));
         let _buildingView = this.node.getComponent("ManageUI").BuildView.getComponent('BuildingView');
 
@@ -541,23 +541,25 @@ cc.Class({
                         }
 
                         //拿到土地的成熟期来判断
-                        let _currentDay = date.datedifference(date.formatTime(new Date()), _leaseLandInfo.plantStart);
-                        let _ratio = _currentDay / _leaseLandInfo.seedInfo.maturity;
+                        // let _plantStart = Date.parse(_leaseLandInfo.plantStart.replace(/-/g, '/'))
+                        // let _currentDay = _plantStart.getTime() - new Date().getTime(); //date.datedifference(date.formatTime(new Date()), _leaseLandInfo.plantStart);
+                        //种植日期加成熟期
+                        let _endMilli = date.addDayTranMillisecond(_leaseLandInfo.plantStart, _leaseLandInfo.seedInfo.maturity);
+                        let _currentMilli = new Date().getTime();
+                        let _ratio = _currentMilli / _endMilli;
                         if (_ratio <= 0.3) {
                             _workingBuilding.onSetGrow(1, _spriteFrame);
                             //测试,后面删除
                             // leaseFarmlandInfoScript.onShowHarvest();
-                        } else if (_ratio <= 0.7) {
+                        } else if (_ratio < 1) {
                             _workingBuilding.onSetGrow(2, _spriteFrame);
                         } else {
                             //成熟阶段
                             _workingBuilding.onSetGrow(3, _spriteFrame);
-                            if (_currentDay >= _leaseLandInfo.seedInfo.maturity) {
-                                //todo,如果时间小的,走收获,收获成果实
-                                console.log("土地:", _userLeaseLand[j].configLandId, "已经成熟,可以操作收取果实了!!", _currentDay);
-                                //todo 土地可收获状态
-                                leaseFarmlandInfoScript.onShowHarvest();
-                            }
+                            //todo,如果时间小的,走收获,收获成果实
+                            // console.log("土地:", _userLeaseLand[j].configLandId, "已经成熟,可以操作收取果实了!!");
+                            //todo 土地可收获状态
+                            leaseFarmlandInfoScript.onShowHarvest();
                         }
                     }
 
@@ -593,7 +595,7 @@ cc.Class({
         let BuildingJSON = Object.assign([], GlobalD.GameData.GameData_buildings);
         //拿到数据后,清空 GlobalD.GameData.GameData_buildings 数据,下面再添加上去
         GlobalD.GameData.GameData_buildings.length = 0;
-        cc.log('BuildingJSON', BuildingJSON);
+        // cc.log('BuildingJSON', BuildingJSON);
         // if (BuildingJSON.length == 0) {
         //     //初始化默认房子
         //     this.SpawnDefaultHouse();
@@ -660,7 +662,7 @@ cc.Class({
             GlobalD.game.addBuilding(buildingsInfo);
         }
 
-        console.log("GlobalD.GameData.GameData_buildings:", GlobalD.GameData.GameData_buildings);
+        // console.log("GlobalD.GameData.GameData_buildings:", GlobalD.GameData.GameData_buildings);
     },
     onGetHousingPrefabFromName(HouseName) {
         let housing = null;

+ 11 - 7
assets/Script/UI/ManageSeedNode.js

@@ -186,13 +186,17 @@ cc.Class({
                 // GlobalD.game.MuinusBuilding(this.seedName);
                 //刷新本地列表对象,数量减去1
                 // console.log(this.upTarget);
-                let NumLabel = this.upTarget.getComponent("Content_Button").NumLabel.getComponent(cc.Label);
-                if (parseInt(NumLabel.string) <= 1) {
-                    //这里只隐藏
-                    this.upTarget.active = false;
-                } else {
-                    NumLabel.string = parseInt(NumLabel.string) - 1;
-                }
+                // let NumLabel = this.upTarget.getComponent("Content_Button").NumLabel.getComponent(cc.Label);
+                // if (parseInt(NumLabel.string) <= leaseLandInfo.leaseMultiple) {
+                //     //这里只隐藏
+                //     this.upTarget.active = false;
+                // } else {
+                //     NumLabel.string = parseInt(NumLabel.string) - leaseLandInfo.leaseMultiple;
+                // }
+                //
+                var BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView").getComponent("BuildingView");
+                BuildingView.onUpdateList();
+
                 //把种子的信息存储到当前的土地 plantInfo 上;
                 _leaseFarmlandInfo.plantInfo = value.data.seedInfo;
                 _leaseFarmlandInfo.updateLandState();

+ 130 - 66
assets/Script/UI/StoreView.js

@@ -2,7 +2,7 @@ cc.Class({
     extends: cc.Component,
 
     properties: {
-        
+
         Seed: {
             default: null,
             type: cc.Node,
@@ -19,9 +19,9 @@ cc.Class({
             default: null,
             type: cc.Node,
         },
-        
+
         SelectedFrame: cc.Node,
- 
+
         //Building40: cc.Node,
         ManageUI: cc.Node,
         //四个按钮对应的sprite
@@ -36,7 +36,7 @@ cc.Class({
 
         //商城的列表
         mySeedList: [],
-    
+
         seedPrefab: cc.Prefab,
 
         seedSpriteFrame: {
@@ -48,8 +48,8 @@ cc.Class({
             default: [],
             type: [cc.Node]
         },
-        snbAmount:0,
-        cntAmount:0,
+        snbAmount: 0,
+        cntAmount: 0,
         ExchangePopView: {
             default: null,
             type: cc.Node,
@@ -58,12 +58,25 @@ cc.Class({
             default: null,
             type: cc.Node,
         },
-        buySeedIndex:-1,
-        
+        buySeedIndex: -1,
+
         snbAmountLabel: {
-            default: null,
+            default: [],
             type: [cc.Label]
         },
+        //拿到仓库列表的节点
+        buildingView: {
+            default: null,
+            type: cc.Node,
+        },
+        myWareHouseSeedList: null,
+        //轮询种子列表状态
+        AutoGetSeedsData: null,
+
+        bottomLabel: {
+            default: null,
+            type: cc.Node,
+        },
     },
     HiddenAll() {
         if (this.Seed.active)
@@ -72,26 +85,31 @@ cc.Class({
             this.Exchange.active = false;
     },
     start() {
+        //获取到仓库列表的脚本
+        this.buildingViewScript = this.buildingView.getComponent("BuildingView");
         //默认设置第一个节点为 最上面
         this.SeedBtn.setSiblingIndex(10);
-        console.log('SNB=======',GlobalD.GameData.SNB)
+        console.log('SNB=======', GlobalD.GameData.SNB)
         this.snbAmountLabel.string = GlobalD.GameData.SNB;
-
+        //这里也初始化获取一个数据
+        GlobalD.GameData.getWarehouseSeedAndFruit((res, vaule) => {
+            this.myWareHouseSeedList = vaule.data.seed;
+        });
         //获取种子和果实
         GlobalD.GameData.getMallSeed((res, vaule) => {
-            console.log('vaule111111111=',vaule)
+            console.log('vaule111111111=', vaule)
             this.mySeedList = vaule.data;
-            
-        
+
+
             for (let i = 0; i < this.mySeedList.length; i++) {
                 //没有种子数量不显示 todo 看看后续需不需要处理删除
                 if (this.mySeedList[i].amount < 1) continue;
 
                 let _seed = cc.instantiate(this.seedPrefab);
 
-               // _seed.getChildByName("buy_button").active = true;
-               // _seed.getChildByName("Name").active = false;
-               // _seed.getChildByName("Name").getChildByName("Num").getComponent(cc.Label).strng = '';//'x'+this.mySeedList[i].amount;
+                // _seed.getChildByName("buy_button").active = true;
+                // _seed.getChildByName("Name").active = false;
+                // _seed.getChildByName("Name").getChildByName("Num").getComponent(cc.Label).strng = '';//'x'+this.mySeedList[i].amount;
 
                 this.seedNodeArry.push(_seed);
                 _seed.parent = this.Seed;
@@ -150,25 +168,25 @@ cc.Class({
 
         this.HiddenAll();
         //面板设置index
-        
+
         //种子
         if ('0' == index) {
             this.SeedBtn.y = -20;
             this.SeedBtn.getComponent(cc.Sprite).spriteFrame = this.Selecteded_Seed_Sprite;
             this.Seed.active = true;
 
-            if(this.seedNodeArry.length!=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);
+            this.bottomLabel.active = false;
         }
         //兑换
         else if ('1' == index) {
@@ -178,6 +196,8 @@ cc.Class({
 
             this.ExchangeBtn.setSiblingIndex(10);
             this.ExchangeBtn.setContentSize(86, 88);
+
+            this.bottomLabel.active = true;
         }
     },
     switch: function () {
@@ -190,66 +210,110 @@ cc.Class({
             node.setSiblingIndex(dst);
         }
     },
-    SNBExchangeToCNT()
-    {
-       GlobalD.GameData.onSnbToCnt(this.snbAmount, (res, vaule) => {
-           this.ExchangePopView.active = false;
-           console.log('vaulet=',vaule)
-           console.log('res=',res)
-       });
+    SNBExchangeToCNT() {
+        GlobalD.GameData.onSnbToCnt(this.snbAmount, (data) => {
+            this.ExchangePopView.active = false;
+            console.log('data=', data)
+            // console.log('res=', res)
+        });
     },
-    onPayCNTPopView(myIndex)
-    {
+    onPayCNTPopView(myIndex) {
         this.buySeedIndex = myIndex;
         this.PayCNTPopView.active = true;
-       // console.log('this.mySeedList[this.buySeedIndex] =',this.mySeedList[this.buySeedIndex])
+        // console.log('this.mySeedList[this.buySeedIndex] =',this.mySeedList[this.buySeedIndex])
         this.PayCNTPopView.getChildByName("BG").getChildByName("BG1_sprite_splash").getChildByName("NameLabel").getChildByName("label").getComponent(cc.Label).string = this.mySeedList[this.buySeedIndex].name;
         this.PayCNTPopView.getChildByName("BG").getChildByName("BG1_sprite_splash").getChildByName("PriceLabel").getChildByName("label").getComponent(cc.Label).string = this.mySeedList[this.buySeedIndex].priceCnt + ' CNT';
         this.PayCNTPopView.getChildByName("BG").getChildByName("BG1_sprite_splash").getChildByName("MutureDurLabel").getChildByName("label").getComponent(cc.Label).string = this.mySeedList[this.buySeedIndex].maturity;
     },
-    PayCNT()
-    {
-        console.log('this.cntAmount=',this.cntAmount)
-        console.log('this.cntAmount price=', this.cntAmount*parseInt(this.mySeedList[this.buySeedIndex].priceCnt))
-       
-        GlobalD.GameData.payCNT(this.cntAmount*parseInt(this.mySeedList[this.buySeedIndex].priceCnt), 4, this.mySeedList[this.buySeedIndex].id, (res, vaule) => {
-            console.log('PayCNT1 res= ',res);
-            console.log('PayCNT2 vaule= ',vaule);
-
-            this.PayCNTPopView.active = false;
+    PayCNT() {
+        console.log('this.cntAmount=', this.cntAmount)
+        console.log('this.cntAmount price=', this.cntAmount * parseInt(this.mySeedList[this.buySeedIndex].priceCnt))
+
+        //购买种子也要使用轮询
+
+        let currentAmount = 0;
+
+        for (let i = 0; i < this.myWareHouseSeedList.length; i++) {
+            if (this.myWareHouseSeedList[i].id == this.mySeedList[this.buySeedIndex].id) {
+                currentAmount = this.myWareHouseSeedList[i].amount;
+            }
+        }
+        //当前背包的数量
+        console.log("currentAmount:", {
+            seedId: this.mySeedList[this.buySeedIndex].id,
+            currentAmount: currentAmount //把当前背包的数据传进去
+        });
+
+        GlobalD.GameData.payCNT(this.cntAmount * parseInt(this.mySeedList[this.buySeedIndex].priceCnt), 4, this.mySeedList[this.buySeedIndex].id + "", (data) => {
+            const [err, tx] = data;
+            if (err === null) {
+                // TODO 成功, 支付为链上操作,需要提供回调接口给这边服务端确认交易成功后修改购买订单结果
+                console.log(tx) // 交易hash,唯一标识符
+                //todo 种子
+                if (this.AutoGetSeedsData) {
+                    this.unschedule(this.AutoGetSeedsData);
+                    this.AutoGetSeedsData = null;
+                }
+                this.AutoGetSeedsData = () => {
+                    // getSeedCount ++;
+                    GlobalD.GameData.onGetSeedState(
+                        {
+                            seedId: this.mySeedList[this.buySeedIndex].id,
+                            currentAmount: currentAmount //把当前背包的数据传进去
+                        },
+                        (res, value) => {
+                            console.log("轮询种子:" + JSON.stringify(value));
+                            if (0 === value.code) {
+                                this.unschedule(this.AutoGetSeedsData);
+                                console.log("轮询种子购买成功");
+                                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "种子购买成功!", 5);
+
+                                this.PayCNTPopView.active = false;
+
+                                //直接重新初始化一下列表,
+                                this.buildingViewScript.onUpdateList();
+                            }
+                        });
+                };
+                this.schedule(this.AutoGetSeedsData, 5);
+            } else {
+                console.log(err)
+                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), err, 5);
+            }
+
         });
     },
-   //onEditDidBegan: function(editbox, customEventData) {
-   //    // 这里 editbox 是一个 cc.EditBox 对象
-   //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
-   //},
-   //// 假设这个回调是给 editingDidEnded 事件的
-   //onEditDidEnded: function(editbox, customEventData) {
-   //    // 这里 editbox 是一个 cc.EditBox 对象
-   //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
-   //},
-   //// 假设这个回调是给 textChanged 事件的
-   //onTextChanged: function(text, editbox, customEventData) {
-   //    // 这里的 text 表示 修改完后的 EditBox 的文本内容
-   //    // 这里 editbox 是一个 cc.EditBox 对象
-   //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
-   //    this.snbAmount = parseInt(text);
-   //},
-   //// 假设这个回调是给 editingReturn 事件的
-   //onEditingReturn: function(editbox,  customEventData) {
-   //    // 这里 editbox 是一个 cc.EditBox 对象
-   //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
-   //}
+    //onEditDidBegan: function(editbox, customEventData) {
+    //    // 这里 editbox 是一个 cc.EditBox 对象
+    //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
+    //},
+    //// 假设这个回调是给 editingDidEnded 事件的
+    //onEditDidEnded: function(editbox, customEventData) {
+    //    // 这里 editbox 是一个 cc.EditBox 对象
+    //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
+    //},
+    //// 假设这个回调是给 textChanged 事件的
+    //onTextChanged: function(text, editbox, customEventData) {
+    //    // 这里的 text 表示 修改完后的 EditBox 的文本内容
+    //    // 这里 editbox 是一个 cc.EditBox 对象
+    //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
+    //    this.snbAmount = parseInt(text);
+    //},
+    //// 假设这个回调是给 editingReturn 事件的
+    //onEditingReturn: function(editbox,  customEventData) {
+    //    // 这里 editbox 是一个 cc.EditBox 对象
+    //    // 这里的 customEventData 参数就等于你之前设置的 "foobar"
+    //}
     // 假设这个回调是给 textChanged 事件的
-    onTextChanged1: function(text, editbox, customEventData) {
+    onTextChanged1: function (text, editbox, customEventData) {
         // 这里的 text 表示 修改完后的 EditBox 的文本内容
         // 这里 editbox 是一个 cc.EditBox 对象
         // 这里的 customEventData 参数就等于你之前设置的 "foobar"
         this.cntAmount = parseInt(text);
-        
+
     },
     // 假设这个回调是给 textChanged 事件的
-    onTextChanged2: function(text, editbox, customEventData) {
+    onTextChanged2: function (text, editbox, customEventData) {
         // 这里的 text 表示 修改完后的 EditBox 的文本内容
         // 这里 editbox 是一个 cc.EditBox 对象
         // 这里的 customEventData 参数就等于你之前设置的 "foobar"

+ 12 - 1
assets/Script/Unit/date.js

@@ -97,6 +97,15 @@ const dateAddDate=(dateStr,dayCount) => {
     return [year, month, day].map(formatNumber).join('/')  + ' ' + [hour, minute, second].map(formatNumber).join(':');
 }
 
+
+const addDayTranMillisecond=(dateStr,dayCount) => {
+    var tempDate=new Date(dateStr.replace(/-/g,"/"));//把日期字符串转换成日期格式
+    var resultDate=new Date((tempDate/1000+(86400*dayCount))*1000);//增加n天后的日期
+    //将日期转化为字符串格式
+    return resultDate.getTime();
+}
+
+
 const dayAndHour = (sDate1, sDate2) => { //sDate1和sDate2是2006-12-18格式 
 	var dateSpan,
 		tempDate,
@@ -122,5 +131,7 @@ export default {
 	getWeightDate,
 	
 	dateAddDate,
-	dayAndHour
+	dayAndHour,
+
+	addDayTranMillisecond
 }

+ 5 - 2
assets/Script/adpp/ManageDapp.js

@@ -76,6 +76,7 @@ cc.Class({
             type: cc.SpriteFrame,
             serializable: true,
         },
+
         mayorTitle: {
             default: '任职镇长',
             serializable: true,
@@ -174,7 +175,8 @@ cc.Class({
                     title: this.villageTitle, content: this.villageContent, confirmText: '申请', callback: () => {
                         this._becomeVillageChief();
                         this.villageAndMayorNode.active = false;
-                    }
+                    },
+                    type:"village"
                 });
                 break;
             case 1:
@@ -183,7 +185,8 @@ cc.Class({
                     title: this.mayorTitle, content: this.mayorContent, confirmText: '任职', callback: () => {
                         this._applyMayor();
                         this.villageAndMayorNode.active = false;
-                    }
+                    },
+                    type:"mayor"
                 });
                 break;
             case 2:

+ 23 - 2
assets/Script/adpp/villageAndMayor.js

@@ -10,6 +10,11 @@ cc.Class({
             type: cc.Node,
             serializable: true,
         },
+        infoButton: {
+            default: null,
+            type: cc.Node,
+            serializable: true,
+        },
         content: {
             default: null,
             type: cc.Label,
@@ -24,7 +29,18 @@ cc.Class({
             type: cc.Label,
             serializable: true,
         },
-
+        villageInfoTitleText:{
+            default: null,
+            tip: "村长面板文字图片",
+            type: cc.SpriteFrame,
+            serializable: true,
+        },
+        villageInfoButton:{
+            default: null,
+            tip: "村长按钮图片",
+            type: cc.SpriteFrame,
+            serializable: true,
+        },
       
     },
 
@@ -33,12 +49,17 @@ cc.Class({
      */
     setVillageAndMayorInfo(context) {
         //let { title, content, confirmText, callback } = context;
-        let {content, confirmText, callback } = context;
+        let {content, confirmText, callback ,type} = context;
         this.node.active = true;
         this.callback = callback;
         //this.title.string = title;
         this.content.string = content;
         // this.confirmLabel.string = confirmText;
+        // console.log(type);
+        if(type == "village"){
+            this.title.getComponent(cc.Sprite).spriteFrame = this.villageInfoTitleText;
+            this.infoButton.getComponent(cc.Sprite).spriteFrame = this.villageInfoButton;
+        }
     },
 
     onConfirm(e) {

+ 4 - 0
assets/Script/build/LeaseFarmlandInfo.js

@@ -304,6 +304,10 @@ cc.Class({
                     this.midSliderNode.active = false
                     let _workingBuilding = this.node.getComponent("WorkingBuilding");
                     _workingBuilding.onSetGrow(0, null);
+
+                    //更新仓库列表
+                    let BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView").getComponent("BuildingView");
+                    BuildingView.onUpdateList();
                     // "收获成功!"
                     GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "收获成功!", 2, () => {
                         console.log("finish toast!");

+ 59 - 41
assets/Script/public/GameData.js

@@ -67,6 +67,9 @@ cc.Class({
 
 
         toast: null,
+        scheduleObj: null,
+        toastCallback: null,
+        isStart: true
 
     },
     onLoad() {
@@ -98,7 +101,7 @@ cc.Class({
             try {
                 GlobalD.dapp.cntBalance().then((cntBalance) => {
                     //会延迟返回
-                    console.log("获取cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
+                    // console.log("获取cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
                     GlobalD.GameData.SetCNT(cntBalance);
                 });
             } catch (err) {
@@ -190,7 +193,7 @@ cc.Class({
 
     },
     InitNextworkData() {
-        console.log("this.readData", this.readData);
+        // console.log("this.readData", this.readData);
         this.Golden = this.readData.Golden;
         this.Diamond = this.readData.Diamond;
         this.shareGive = this.readData.shareGive;
@@ -731,7 +734,7 @@ cc.Class({
                 GlobalD.game.AllHighwayStylesAndIndex.push(_AllHighwayAIndex[i]);
 
             }
-            console.log("end");
+            // console.log("end");
         } else {
             //如果用户没有存储数据
             //根据InitPoint 的数据,创建初始化的地图数据 的初始化数据
@@ -974,7 +977,8 @@ cc.Class({
         })
     },
     //获取用户已租赁土地的状态
-    getLandState() {
+    getLandState(context) {
+        let { landId, callback } = context;
         // {
         //     "id": 1,
         //     "configLandId": 1,
@@ -990,8 +994,8 @@ cc.Class({
         //     "createTime": "2022-01-10 21:25:30",
         //     "updateTime": "2022-01-10 21:25:33"
         // }
-        utils.get(utils.api.landState, { landId: 1 }, (res, vaule) => {
-
+        utils.get(utils.api.landState, { landId: landId }, (res, vaule) => {
+            callback(res, vaule);
         })
     },
     //获取商城种子
@@ -1072,6 +1076,13 @@ cc.Class({
             callback(res, vaule);
         })
     },
+    //获取种子状态
+    onGetSeedState(data, callback) {
+        utils.get(utils.api.getSeedState, data, (res, vaule) => {
+            callback(res, vaule);
+        })
+    },
+
     //种植种子
     // data:{landId:1,seedId:1}
     onPlant(data, callback) {
@@ -1102,40 +1113,34 @@ cc.Class({
     },
 
     //神农呗购买种子
-    onBuySeedsWithSNB(snbAmount,seedId,callback){
-        utils.post(utils.api.snbBuySeeds, {payAmount:snbAmount,seedId:seedId}, (res, vaule) => {
+    onBuySeedsWithSNB(snbAmount, seedId, callback) {
+        utils.post(utils.api.snbBuySeeds, { payAmount: snbAmount, seedId: seedId }, (res, vaule) => {
             callback(res, vaule);
         })
     },
 
-    //用cnt购买种子,种子的payType类型是 4
-    onBuySeedsWithCNT(cntAmount, seedId, callback) {
-        this.payCNT(cntAmount, 4, seedId, callback);
-    },
-
-
     /**
      * 支付cnt操作
      * @param {*} amount // 需支付金额
      * @param {*} payType 支付类型,1购买土地租凭, 2自然灾害防护,3野兽防护
-     * @param {*} itemType 操作物品的id
+     * @param {*} itemType 操作物品的id 字符串
      */
     payCNT(cntAmount, payType, itemType, callback) {
-        console.log("购买金额:"+cntAmount+"购买类型PlayType:"+payType+"购买物品的id:"+itemType);
+        console.log("购买金额:" + cntAmount + "购买类型PlayType:" + payType + "购买物品的id:" + itemType);
         if (!GlobalD.dapp) {
             console.warn("GlobalD.dapp未初始化,不能payCNT!");
             return;
         }
         //
         if (GlobalD.GameData.GetCNT() < cntAmount) {
-            console.log("cnt 不足,GetCNT:"+ GlobalD.GameData.GetCNT()+"消费的cntAmount"+cntAmount);
+            console.log("cnt 不足,GetCNT:" + GlobalD.GameData.GetCNT() + "消费的cntAmount" + cntAmount);
             GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "CNT不足!", 2, () => {
-                console.log("finish toast!");
+                console.log("finish toast! CNT不足!");
             });
             return;
         }
-        GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "支付处理中...", 10, () => {
-            console.log("finish toast!");
+        GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "支付处理中...", 20, () => {
+            console.log("finish toast!支付处理中...");
         });
 
         GlobalD.dapp.payCnt(cntAmount, payType, itemType).then((data) => {
@@ -1146,13 +1151,14 @@ cc.Class({
 
                 GlobalD.dapp.cntBalance().then((cntBalance) => {
                     //会延迟返回
-                    console.log("更新cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
+                    // console.log("更新cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
                     GlobalD.GameData.SetCNT(cntBalance);
                 });
-
-                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "支付成功!", 2, () => {
-                    console.log("finish toast!");
+                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "支付成功!", 5, () => {
+                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "区块确认中,请耐心等待!", 120);
                 });
+
+
             } else {
                 console.log(err)
                 GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), err, 2, () => {
@@ -1195,12 +1201,20 @@ cc.Class({
 
                 GlobalD.dapp.cntBalance().then((cntBalance) => {
                     //会延迟返回
-                    console.log("更新cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
+                    // console.log("更新cnt:" + cntBalance) // string, 精度18,需要自行处理省略几位小数
                     GlobalD.GameData.SetCNT(cntBalance);
                 });
 
+
+                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "区块确认中,请耐心等待!", 2, () => {
+                    console.log("finish toast!");
+                });
+
             } else {
                 console.log(err)
+                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), err, 2, () => {
+                    console.log("finish toast!");
+                });
             }
 
             if (callback) {
@@ -1225,34 +1239,38 @@ cc.Class({
         });
     },
 
+    updateToast() {
+        if (this.toastEndTime <= 0 && this.isStart) {
+            this.toast.active = false
+            if (this.toastCallback != null && this.toastCallback != undefined) {
+                this.toastCallback();
+                console.log(this.toastCallback);
+            }
+            this.isStart = false;
+        } else {
+            this.toastEndTime--;
+        }
+    },
 
     showToast(parent, content, time, callback) {
+        this.toastCallback = callback;
+        this.isStart = true;
         if (this.toast) {
             this.toast.active = true;
+            this.toast.parent = parent;
             let DetailLabel = this.toast.getChildByName('DetailLabel');
             DetailLabel.getComponent(cc.Label).string = content;
-            this.unschedule(this.scheduleObj);
-            this.scheduleObj = null;
-
-            this.scheduleObj = this.scheduleOnce(() => {
-                if (callback) {
-                    callback();
-                }
-                this.toast.active = false;
-            }, time);
+            this.toastEndTime = time;
         } else {
             cc.loader.loadRes("prefab/gameToast", function (err, texture) {
                 this.toast = cc.instantiate(texture);
                 this.toast.parent = parent;
                 let DetailLabel = this.toast.getChildByName('DetailLabel');
                 DetailLabel.getComponent(cc.Label).string = content;
-
-                this.scheduleObj = this.scheduleOnce(() => {
-                    if (callback) {
-                        callback();
-                    }
-                    this.toast.active = false;
-                }, time);
+                this.toastEndTime = time;
+                this.scheduleObj = this.schedule(() => {
+                    this.updateToast();
+                }, 1);
             }.bind(this));
         }
     }

+ 1 - 1
assets/Script/public/ManageAI.js

@@ -318,7 +318,7 @@ cc.Class({
     //读取的内存数据生成AI
     onSpawnWorkerAIFromStoredData() {
         let characterArray = GlobalD.GameData.GetWorkerCharacterInfoArray();
-        console.log(characterArray);
+        // console.log(characterArray);
         for (let i = 0; i < characterArray.length; i++) {
             //生成点
             let spawnPos = characterArray[i].startTilePos;

BIN
assets/UI/Inauguration/villageButton.png


+ 34 - 0
assets/UI/Inauguration/villageButton.png.meta

@@ -0,0 +1,34 @@
+{
+  "ver": "2.3.3",
+  "uuid": "275486b8-3b5a-4f1d-afdb-ad1afe317904",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "platformSettings": {},
+  "subMetas": {
+    "villageButton": {
+      "ver": "1.0.4",
+      "uuid": "f3591f54-814c-475c-b2ef-c0d1f9d04f11",
+      "rawTextureUuid": "275486b8-3b5a-4f1d-afdb-ad1afe317904",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 113,
+      "height": 60,
+      "rawWidth": 113,
+      "rawHeight": 60,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/UI/Inauguration/villageTitle.png


+ 34 - 0
assets/UI/Inauguration/villageTitle.png.meta

@@ -0,0 +1,34 @@
+{
+  "ver": "2.3.3",
+  "uuid": "e58a6dce-48a5-4eed-9013-c684966dfcd8",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "platformSettings": {},
+  "subMetas": {
+    "villageTitle": {
+      "ver": "1.0.4",
+      "uuid": "6d4b9c78-6553-4db4-8d4d-4db8d23798a4",
+      "rawTextureUuid": "e58a6dce-48a5-4eed-9013-c684966dfcd8",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 213,
+      "height": 88,
+      "rawWidth": 213,
+      "rawHeight": 88,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/login/PlayButton.png


+ 4 - 4
assets/resources/login/PlayButton.png.meta

@@ -20,10 +20,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 316,
-      "height": 114,
-      "rawWidth": 316,
-      "rawHeight": 114,
+      "width": 269,
+      "height": 97,
+      "rawWidth": 269,
+      "rawHeight": 97,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/login/shennongStartBgNew.png


+ 1 - 1
assets/resources/login/shennongStartBgNew.png.meta

@@ -11,7 +11,7 @@
   "subMetas": {
     "shennongStartBgNew": {
       "ver": "1.0.4",
-      "uuid": "0e4f6c70-c999-4425-ba1f-7d37c9dfbe0e",
+      "uuid": "ed99838d-a569-490e-8c0f-a3ec29a5ab67",
       "rawTextureUuid": "3976aa96-4c0d-44e6-be6b-2dcf825e5576",
       "trimType": "auto",
       "trimThreshold": 1,

BIN
assets/resources/login/title.png


+ 34 - 0
assets/resources/login/title.png.meta

@@ -0,0 +1,34 @@
+{
+  "ver": "2.3.3",
+  "uuid": "0dd7a9ff-a771-4db3-83b4-73eebd8352ee",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "platformSettings": {},
+  "subMetas": {
+    "title": {
+      "ver": "1.0.4",
+      "uuid": "174b0e77-29be-44e3-83cc-11a9eaf38200",
+      "rawTextureUuid": "0dd7a9ff-a771-4db3-83b4-73eebd8352ee",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": -0.5,
+      "offsetY": 5,
+      "trimX": 1,
+      "trimY": 0,
+      "width": 572,
+      "height": 264,
+      "rawWidth": 575,
+      "rawHeight": 274,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 114 - 8
assets/resources/prefab/login.prefab

@@ -25,13 +25,16 @@
       },
       {
         "__id__": 8
+      },
+      {
+        "__id__": 11
       }
     ],
     "_active": true,
     "_level": 1,
     "_components": [],
     "_prefab": {
-      "__id__": 11
+      "__id__": 14
     },
     "_opacity": 255,
     "_color": {
@@ -151,7 +154,7 @@
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "0e4f6c70-c999-4425-ba1f-7d37c9dfbe0e"
+      "__uuid__": "ed99838d-a569-490e-8c0f-a3ec29a5ab67"
     },
     "_type": 0,
     "_sizeMode": 0,
@@ -180,13 +183,13 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "info1",
+    "_name": "title",
     "_objFlags": 0,
     "_parent": {
       "__id__": 1
     },
     "_children": [],
-    "_active": false,
+    "_active": true,
     "_level": 2,
     "_components": [
       {
@@ -204,6 +207,109 @@
       "b": 255,
       "a": 255
     },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 572,
+      "height": 264
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 298.996,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "174b0e77-29be-44e3-83cc-11a9eaf38200"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "addf6c20-2433-4468-8174-d663309c773c"
+    },
+    "fileId": "8cjgHXzphDz5no3IDNbB8D",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "info1",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": false,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 9
+      }
+    ],
+    "_prefab": {
+      "__id__": 10
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 372,
@@ -243,7 +349,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 8
     },
     "_enabled": true,
     "_materials": [
@@ -291,11 +397,11 @@
     "_level": 2,
     "_components": [
       {
-        "__id__": 9
+        "__id__": 12
       }
     ],
     "_prefab": {
-      "__id__": 10
+      "__id__": 13
     },
     "_opacity": 255,
     "_color": {
@@ -344,7 +450,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 8
+      "__id__": 11
     },
     "_enabled": true,
     "_materials": [

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels