Forráskód Böngészése

1.修复和优化部分问题

slambb 3 éve
szülő
commit
01989ab198

+ 193 - 172
assets/Prefabs/UI/listInfo/listInfoItem.prefab

@@ -37,7 +37,6 @@
       }
     ],
     "_active": true,
-    "_level": 1,
     "_components": [
       {
         "__id__": 38
@@ -64,17 +63,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -90,7 +78,19 @@
         1,
         1
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Node",
@@ -101,7 +101,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 1,
     "_components": [
       {
         "__id__": 3
@@ -128,17 +127,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -154,7 +142,19 @@
         1,
         1
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Sprite",
@@ -215,7 +215,6 @@
       }
     ],
     "_active": true,
-    "_level": 1,
     "_components": [],
     "_prefab": {
       "__id__": 14
@@ -238,17 +237,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -264,7 +252,19 @@
         0.691,
         0.691
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Node",
@@ -275,7 +275,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 6,
     "_components": [
       {
         "__id__": 7
@@ -305,17 +304,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -331,7 +319,19 @@
         1.44718,
         1.44718
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -346,7 +346,8 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "操作:",
     "_N$string": "操作:",
     "_fontSize": 20,
@@ -356,6 +357,8 @@
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -401,7 +404,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 2,
     "_components": [
       {
         "__id__": 11
@@ -423,7 +425,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 94.97,
+      "width": 85.63,
       "height": 26.8
     },
     "_anchorPoint": {
@@ -431,17 +433,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -457,7 +448,19 @@
         1.44718,
         1.44718
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -472,16 +475,19 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "白菜100个",
     "_N$string": "白菜100个",
-    "_fontSize": 20,
+    "_fontSize": 18,
     "_lineHeight": 20,
     "_enableWrapText": true,
     "_N$file": null,
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -542,7 +548,6 @@
       }
     ],
     "_active": false,
-    "_level": 2,
     "_components": [],
     "_prefab": {
       "__id__": 20
@@ -565,17 +570,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -591,7 +585,19 @@
         0.691,
         0.691
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Node",
@@ -602,7 +608,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 2,
     "_components": [
       {
         "__id__": 17
@@ -632,17 +637,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -658,7 +652,19 @@
         1.44718,
         1.44718
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -673,7 +679,8 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "白菜100个",
     "_N$string": "白菜100个",
     "_fontSize": 20,
@@ -683,6 +690,8 @@
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -746,7 +755,6 @@
       }
     ],
     "_active": true,
-    "_level": 1,
     "_components": [],
     "_prefab": {
       "__id__": 30
@@ -769,17 +777,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -795,7 +792,19 @@
         0.691,
         0.691
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Node",
@@ -806,7 +815,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 6,
     "_components": [
       {
         "__id__": 23
@@ -836,17 +844,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -862,7 +859,19 @@
         1.44718,
         1.44718
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -877,7 +886,8 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "剩余:",
     "_N$string": "剩余:",
     "_fontSize": 20,
@@ -887,6 +897,8 @@
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -932,7 +944,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 2,
     "_components": [
       {
         "__id__": 27
@@ -954,7 +965,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 134.48,
+      "width": 121.13,
       "height": 26.2
     },
     "_anchorPoint": {
@@ -962,17 +973,6 @@
       "x": 0,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -988,7 +988,19 @@
         1.44718,
         1.44718
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -1003,16 +1015,19 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "100000000000",
     "_N$string": "100000000000",
-    "_fontSize": 20,
+    "_fontSize": 18,
     "_lineHeight": 20,
     "_enableWrapText": true,
     "_N$file": null,
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -1069,7 +1084,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 1,
     "_components": [
       {
         "__id__": 32
@@ -1091,7 +1105,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 112.79,
+      "width": 101.61,
       "height": 26.2
     },
     "_anchorPoint": {
@@ -1099,17 +1113,6 @@
       "x": 1,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -1125,7 +1128,19 @@
         1,
         1
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -1140,16 +1155,19 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "+100000000",
     "_N$string": "+100000000",
-    "_fontSize": 20,
+    "_fontSize": 18,
     "_lineHeight": 20,
     "_enableWrapText": true,
     "_N$file": null,
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -1195,7 +1213,6 @@
     },
     "_children": [],
     "_active": true,
-    "_level": 1,
     "_components": [
       {
         "__id__": 36
@@ -1214,7 +1231,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 174.22,
+      "width": 165.51,
       "height": 25.2
     },
     "_anchorPoint": {
@@ -1222,17 +1239,6 @@
       "x": 1,
       "y": 1
     },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "groupIndex": 0,
-    "_id": "",
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
@@ -1248,7 +1254,19 @@
         1,
         1
       ]
-    }
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
   },
   {
     "__type__": "cc.Label",
@@ -1263,16 +1281,19 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
     "_string": "2020-01-03 1111:11",
     "_N$string": "2020-01-03 1111:11",
-    "_fontSize": 20,
+    "_fontSize": 19,
     "_lineHeight": 20,
     "_enableWrapText": true,
     "_N$file": null,
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
     "_N$verticalAlign": 1,
     "_N$fontFamily": "Arial",
@@ -1333,7 +1354,7 @@
     "asset": {
       "__uuid__": "ade27f42-95f1-4808-85c0-aec0f4c25cd8"
     },
-    "fileId": "f8kj9bJ0ZPmI5JH3OBJ3gG",
+    "fileId": "",
     "sync": false
   }
 ]

+ 3 - 2
assets/Scene/MyCityScene - 004.fire

@@ -682,7 +682,7 @@
       "array": [
         0,
         0,
-        470.2517942549502,
+        479.19621287841136,
         0,
         0,
         0,
@@ -837,7 +837,7 @@
       "array": [
         0,
         0,
-        470.2517942549502,
+        479.19621287841136,
         0,
         0,
         0,
@@ -71141,6 +71141,7 @@
         "__uuid__": "23493986-f664-442f-bee3-8e690d40d8ff"
       }
     ],
+    "isBackLimit": false,
     "_id": "74KdLGIIRPWK7A6h7BZEga"
   },
   {

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

@@ -102,7 +102,7 @@ cc.Class({
                     _loginNode.updateLoading(5, "登录验证中...");
                     utils.post(utils.api.loginTokenAndVerification, dappLoginData, (flag, value) => { //5
                         // console.log("loginTokenAndVerification========>", value, new Date());
-                        console.log(value.data.token)
+                        // console.log(value.data.token)
                         if (flag && 0 === value.code && value.flag) {
                             // console.log("login pass1:" + flag + '-' + value.code + '-' + value.msg);
                             /** 登录成功获取token */

+ 117 - 95
assets/Script/UI/ManageBuildings.js

@@ -29,7 +29,9 @@ cc.Class({
         animalPanelSpriteFrame: {
             default: [],
             type: [cc.SpriteFrame]
-        }
+        },
+
+        isBackLimit: false
     },
     // start() {
 
@@ -84,15 +86,20 @@ cc.Class({
      * 回到用户自己的农场
      */
     onBackSelfFarmland() {
+        if (this.isBackLimit) return;
+        this.isBackLimit = true;
+        GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "返回农场中..", 10);
         //刷新一下自己的用户信息
         GlobalD.GameData.getSelfUserLandList(() => {
+            this.isBackLimit = false;
             this.spawnConfigLand(GlobalD.UserLeaseLand, true);
-
             //显示底部菜单栏
             GlobalD.game._ManageUIScript.onBottomMenuView(true);
             //收起其他用户场景后菜单操作
             GlobalD.game._ManageUIScript.onOtherFarmerView(false);
 
+            GlobalD.GameData.hideToast();
+
         })
         //更新自己的狗
         let _dogContainerScript = cc.find("Canvas/DogContainer").getComponent("DogContainer")
@@ -150,6 +157,7 @@ cc.Class({
                         //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
                         if (_userLeaseLand[j].configLandId == leaseAnimalInfoScript.initConfigLandId) {
                             let _leaseLandInfo = _userLeaseLand[j];
+                            this.setAnimalHousing(resetLandInfo, leaseAnimalInfoScript.titleName);
                             leaseAnimalInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
                         }
                     }
@@ -229,96 +237,9 @@ cc.Class({
                 var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(_spawnPos);
 
                 housingTemp_animal.setPosition(endPos.x, endPos.y);
-                let _configLandTemp = null;
-                let _brandFarm = housingTemp_animal.getChildByName("midSliderContainer").getChildByName("brand_farm");
-                let _farmTitle = housingTemp_animal.getChildByName("infoBox").getChildByName("sliderContainer").getChildByName("farmTitle");
-                let _envBg = housingTemp_animal.getChildByName("EnvBg");
-                //根据名字切换贴图
-                switch (_tiledPosArrayAni[i].name) {
-                    //牧场区
-                    case 'pasture_01':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[6];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
-                        _configLandTemp = _configLand[24];
-                        _farmTitle.getComponent(cc.Label).string = "牧场1区";
-                        break;
-                    case 'pasture_02':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[7];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
-                        _configLandTemp = _configLand[25];
-                        _farmTitle.getComponent(cc.Label).string = "牧场2区";
-                        break;
-                    case 'pasture_03':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[8];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
-                        _configLandTemp = _configLand[26];
-                        _farmTitle.getComponent(cc.Label).string = "牧场3区";
-                        break;
-                    //养殖区
-                    case 'farm_01':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[0];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
-                        _configLandTemp = _configLand[27];
-                        _farmTitle.getComponent(cc.Label).string = "农场1区";
-                        break;
-                    case 'farm_02':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[1];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
-                        _configLandTemp = _configLand[28];
-                        _farmTitle.getComponent(cc.Label).string = "农场2区";
-                        break;
-                    case 'farm_03':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[2];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
-                        _configLandTemp = _configLand[29];
-                        _farmTitle.getComponent(cc.Label).string = "农场3区";
-                        break;
-                    //淡水区
-                    case 'freshwater_01':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[3];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
-                        _configLandTemp = _configLand[30];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "淡水1区";
-                        break;
-                    case 'freshwater_02':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[4];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
-                        _configLandTemp = _configLand[31];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "淡水2区";
-                        break;
-                    case 'freshwater_03':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[5];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
-                        _configLandTemp = _configLand[32];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "淡水3区";
-                        break;
-                    //海水区
-                    case 'seawater_01':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[9];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
-                        _configLandTemp = _configLand[33];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "海水1区";
-                        break;
-                    case 'seawater_02':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[10];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
-                        _configLandTemp = _configLand[34];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "海水2区";
-                        break;
-                    case 'seawater_03':
-                        _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[11];
-                        _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
-                        _configLandTemp = _configLand[35];
-                        _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
-                        _farmTitle.getComponent(cc.Label).string = "海水3区";
-                        break;
 
-                }
+                //修改土地sprite
+                let { _configLandTemp = null } = this.setAnimalHousing(housingTemp_animal, _tiledPosArrayAni[i].name);
 
                 if (_configLandTemp == null) {
                     console.error("_configLandTemp 错误!");
@@ -330,6 +251,7 @@ cc.Class({
                 let leaseAnimalInfoScript = housingTemp_animal.getComponent("LeaseAnimalInfo");
                 //记录一下第一次初始化时候的id
                 leaseAnimalInfoScript.initConfigLandId = _configLandTemp.id;
+                leaseAnimalInfoScript.titleName = _tiledPosArrayAni[i].name;
                 leaseAnimalInfoScript.setConfigLandInfo(_configLandTemp);
 
                 for (let j = 0; j < _userLeaseLand.length; j++) {
@@ -366,13 +288,14 @@ cc.Class({
                     }
                     //全部设置成普通的土地
                     leaseFarmlandInfoScript.onSwitchEnvBgFromLevel(0);
-                    //访问其他农场时候,全部不显示待租按钮
-                    leaseFarmlandInfoScript.onUnlockLand();
                     for (let j = 0; j < _userLeaseLand.length; j++) {
                         //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
                         if (_userLeaseLand[j].configLandId == leaseFarmlandInfoScript.initConfigLandId) {
                             let _leaseLandInfo = _userLeaseLand[j];
                             leaseFarmlandInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
+                        } else {
+                            //访问其他农场时候,全部不显示待租按钮
+                            leaseFarmlandInfoScript.onUnlockLand();
                         }
                     }
                 } else if (resetLandInfo.name == "Labour_206_Holy_Animal") {
@@ -382,13 +305,16 @@ cc.Class({
                     if (!leaseAnimalInfoScript.onGetUnlockLandState()) {
                         leaseAnimalInfoScript.onLockLand();
                     }
-                    //访问其他农场时候,全部不显示待租按钮
-                    leaseAnimalInfoScript.onUnlockLand();
                     for (let j = 0; j < _userLeaseLand.length; j++) {
                         //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
                         if (_userLeaseLand[j].configLandId == leaseAnimalInfoScript.initConfigLandId) {
                             let _leaseLandInfo = _userLeaseLand[j];
+                            // console.log("*** _leaseLandInfo =", _leaseLandInfo)
+                            this.setAnimalHousing(resetLandInfo, leaseAnimalInfoScript.titleName);
                             leaseAnimalInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
+                        } else {
+                            //访问其他农场时候,全部不显示待租按钮
+                            leaseAnimalInfoScript.onUnlockLand();
                         }
                     }
                 }
@@ -424,5 +350,101 @@ cc.Class({
             housing = 'Labour_206_Holy_Animal';
         }
         return buildingName;
+    },
+
+    setAnimalHousing(housingTemp_animal, _titleName) {
+        let _configLand = GlobalD.ConfigLand;
+        let _configLandTemp = null;
+        let _brandFarm = housingTemp_animal.getChildByName("midSliderContainer").getChildByName("brand_farm");
+        let _farmTitle = housingTemp_animal.getChildByName("infoBox").getChildByName("sliderContainer").getChildByName("farmTitle");
+        let _envBg = housingTemp_animal.getChildByName("EnvBg");
+        //根据名字切换贴图
+        switch (_titleName) {
+            //牧场区
+            case 'pasture_01':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[6];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
+                _configLandTemp = _configLand[24];
+                _farmTitle.getComponent(cc.Label).string = "牧场1区";
+                break;
+            case 'pasture_02':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[7];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
+                _configLandTemp = _configLand[25];
+                _farmTitle.getComponent(cc.Label).string = "牧场2区";
+                break;
+            case 'pasture_03':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[8];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[0];
+                _configLandTemp = _configLand[26];
+                _farmTitle.getComponent(cc.Label).string = "牧场3区";
+                break;
+            //养殖区
+            case 'farm_01':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[0];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
+                _configLandTemp = _configLand[27];
+                _farmTitle.getComponent(cc.Label).string = "农场1区";
+                break;
+            case 'farm_02':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[1];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
+                _configLandTemp = _configLand[28];
+                _farmTitle.getComponent(cc.Label).string = "农场2区";
+                break;
+            case 'farm_03':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[2];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[1];
+                _configLandTemp = _configLand[29];
+                _farmTitle.getComponent(cc.Label).string = "农场3区";
+                break;
+            //淡水区
+            case 'freshwater_01':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[3];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
+                _configLandTemp = _configLand[30];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "淡水1区";
+                break;
+            case 'freshwater_02':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[4];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
+                _configLandTemp = _configLand[31];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "淡水2区";
+                break;
+            case 'freshwater_03':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[5];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[2];
+                _configLandTemp = _configLand[32];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "淡水3区";
+                break;
+            //海水区
+            case 'seawater_01':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[9];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
+                _configLandTemp = _configLand[33];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "海水1区";
+                break;
+            case 'seawater_02':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[10];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
+                _configLandTemp = _configLand[34];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "海水2区";
+                break;
+            case 'seawater_03':
+                _envBg.getComponent(cc.Sprite).spriteFrame = this.animalSpriteFrame[11];
+                _brandFarm.getComponent(cc.Sprite).spriteFrame = this.animalPanelSpriteFrame[3];
+                _configLandTemp = _configLand[35];
+                _brandFarm.setPosition(_brandFarm.getPosition(cc.Vec2).x, 13);
+                _farmTitle.getComponent(cc.Label).string = "海水3区";
+                break;
+
+        }
+
+        return { _configLandTemp };
     }
 });

+ 6 - 1
assets/Script/UI/ManageSeedNode.js

@@ -225,7 +225,12 @@ cc.Class({
                 _leaselandInfoScript.setLeaseLandInfo(value.data, true);
                 //刷新当前灾难ui
                 GlobalD.game._ManageUIScript.onShowDisater();
-                GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "已成功种植!", 1);
+             
+                if (0 === this.mallType) {
+                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "种植成功!", 1);
+                } else {
+                    GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "养殖成功!", 1);
+                }
             } else if (706 === value.code) {
                 //土地到期,没有更新刷新的处理刷新
                 GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), value.msg, 1);

+ 7 - 2
assets/Script/UI/StoreView.js

@@ -210,8 +210,13 @@ cc.Class({
     this.snbAmountLabel.string = GlobalD.GameData.SNB
     this.luckyAmountLabel.string = GlobalD.GameData.GetLucky();
     //这里也初始化获取一个数据
-    GlobalD.GameData.getWarehouseSeedAndFruit((vaule) => {
-      this.myWareHouseSeedList = vaule.data.seed
+    GlobalD.GameData.getWarehouseSeedAndFruit((value) => {
+      function compare(arg) {
+        return function (a, b) {
+          return a[arg] - b[arg];
+        }
+      }
+      this.myWareHouseSeedList = value.data.seed.sort(compare('mallType'));
     })
     //获取种子和果实
     GlobalD.GameData.getMallSeed((vaule) => {

+ 18 - 15
assets/Script/build/LeaseAnimalInfo.js

@@ -42,12 +42,12 @@ cc.Class({
         },
 
 
-        levelLabel: {
-            default: null,
-            type: cc.Label,
-            serializable: true,
-            toolTip: "显示当前土地级别"
-        },
+        // levelLabel: {
+        //     default: null,
+        //     type: cc.Label,
+        //     serializable: true,
+        //     toolTip: "显示当前土地级别"
+        // },
 
 
         /**
@@ -90,6 +90,9 @@ cc.Class({
         //初始化时候对应的土地的id
         initConfigLandId: -1,
 
+        //生成牧场时候的对应名字
+        titleName:'',
+
         // configLandId: 1
         // createTime: "2022-01-10 21:25:30"
         // id: 1
@@ -487,15 +490,15 @@ cc.Class({
 
         // console.log(this.leaseLandInfo.configLandId,this.leaseLandInfo.landLevel);
         //设置土地等级,根据土地等级显示土地状态
-        if (this.leaseLandInfo.landLevel != null && GlobalD.ConfigLevel != null) {
-            this.onSwitchEnvBgFromLevel(this.leaseLandInfo.landLevel - 1);
-            let _configLevelArray = GlobalD.ConfigLevel;
-            for (let i = 0; i < _configLevelArray.length; i++) {
-                if (this.leaseLandInfo.landLevel == _configLevelArray[i].id) {
-                    this.levelLabel.string = _configLevelArray[i].name;
-                }
-            }
-        }
+        // if (this.leaseLandInfo.landLevel != null && GlobalD.ConfigLevel != null) {
+        //     this.onSwitchEnvBgFromLevel(this.leaseLandInfo.landLevel - 1);
+        //     let _configLevelArray = GlobalD.ConfigLevel;
+        //     for (let i = 0; i < _configLevelArray.length; i++) {
+        //         if (this.leaseLandInfo.landLevel == _configLevelArray[i].id) {
+        //             this.levelLabel.string = _configLevelArray[i].name;
+        //         }
+        //     }
+        // }
 
         /**
          * 绑定生成显示信息面板,现在土地信息

+ 4 - 3
assets/Script/public/GameData.js

@@ -523,6 +523,7 @@ cc.Class({
                 //关闭当前列表
                 GlobalD.game._ManageUIScript.onListUserInfo_Close();
 
+                this.hideToast();
                 // this.showToast(cc.find("Canvas/UICamera"), "载入成功..", 1);
                 this.hideToast();
                 if (callback)
@@ -537,9 +538,9 @@ cc.Class({
     },
     //获取用户可以偷取的列表
     onGetCanStealUserList(page, limit, callback) {
-        this.showToast(cc.find("Canvas/UICamera"), "刷新列表中..", 5);
+        this.showToast(cc.find("Canvas/UICamera"), "刷新列表中..", 10);
         utils.get(utils.api.canStealUserList, { page: page, limit: limit }, (flag, value) => {
-            this.showToast(cc.find("Canvas/UICamera"), "刷新完成!", 1);
+            this.hideToast();
             if (flag && 0 === value.code) {
                 if (callback)
                     callback(value.data);
@@ -699,7 +700,7 @@ cc.Class({
             return;
         }
         this.isOnAddFruit = true;
-        this.showToast(cc.find("Canvas/UICamera"), "偷取果实中..", 5);
+        this.showToast(cc.find("Canvas/UICamera"), "偷取收成中..", 5);
         utils.post(utils.api.stealFruit, data, (flag, value) => {
             this.isOnAddFruit = false;
             this.hideToast();