فهرست منبع

1.修改土地操作和面板显示

slambb 3 سال پیش
والد
کامیت
dfa6e8660e

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 432 - 162
assets/Prefabs/NBuildings/Labour/Labour_205_Holy_Farmland.prefab


+ 240 - 121
assets/Prefabs/UI/lease/LandInfo.prefab

@@ -21,24 +21,27 @@
         "__id__": 2
       },
       {
-        "__id__": 5
+        "__id__": 6
       },
       {
-        "__id__": 49
+        "__id__": 9
       },
       {
-        "__id__": 57
+        "__id__": 53
+      },
+      {
+        "__id__": 61
       }
     ],
     "_active": true,
     "_level": 1,
     "_components": [
       {
-        "__id__": 65
+        "__id__": 69
       }
     ],
     "_prefab": {
-      "__id__": 66
+      "__id__": 70
     },
     "_opacity": 255,
     "_color": {
@@ -66,8 +69,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
+      "x": 1.33,
+      "y": 1.33,
       "z": 1
     },
     "_eulerAngles": {
@@ -82,6 +85,122 @@
     "groupIndex": 0,
     "_id": ""
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "Mask",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 4
+      }
+    ],
+    "_prefab": {
+      "__id__": 5
+    },
+    "_opacity": 62,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 68,
+      "g": 66,
+      "b": 66,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 1000,
+      "height": 2000
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1.00075,
+      "y": 1.00075,
+      "z": 1.00075
+    },
+    "_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__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.BlockInputEvents",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "8b7c02b7-8c93-4f18-8a21-8ea7d64b433a"
+    },
+    "fileId": "ddFS8y/MtP1oi6RnEZTNLy",
+    "sync": false
+  },
   {
     "__type__": "cc.Node",
     "_name": "BG",
@@ -94,11 +213,11 @@
     "_level": 4,
     "_components": [
       {
-        "__id__": 3
+        "__id__": 7
       }
     ],
     "_prefab": {
-      "__id__": 4
+      "__id__": 8
     },
     "_opacity": 255,
     "_color": {
@@ -147,7 +266,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 2
+      "__id__": 6
     },
     "_enabled": true,
     "_materials": [
@@ -194,33 +313,33 @@
     },
     "_children": [
       {
-        "__id__": 6
+        "__id__": 10
       },
       {
-        "__id__": 14
+        "__id__": 18
       },
       {
-        "__id__": 22
+        "__id__": 26
       },
       {
-        "__id__": 30
+        "__id__": 34
       },
       {
-        "__id__": 38
+        "__id__": 42
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [
       {
-        "__id__": 46
+        "__id__": 50
       },
       {
-        "__id__": 47
+        "__id__": 51
       }
     ],
     "_prefab": {
-      "__id__": 48
+      "__id__": 52
     },
     "_opacity": 255,
     "_color": {
@@ -232,7 +351,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 300,
+      "width": 320,
       "height": 200
     },
     "_anchorPoint": {
@@ -269,21 +388,21 @@
     "_name": "1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 7
+        "__id__": 11
       },
       {
-        "__id__": 10
+        "__id__": 14
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 13
+      "__id__": 17
     },
     "_opacity": 255,
     "_color": {
@@ -305,7 +424,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 7,
+      "x": -5.213,
       "y": -30,
       "z": 0
     },
@@ -332,18 +451,18 @@
     "_name": "text1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 6
+      "__id__": 10
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 12
       }
     ],
     "_prefab": {
-      "__id__": 9
+      "__id__": 13
     },
     "_opacity": 255,
     "_color": {
@@ -392,7 +511,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 11
     },
     "_enabled": true,
     "_materials": [
@@ -433,18 +552,18 @@
     "_name": "text1_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 6
+      "__id__": 10
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 11
+        "__id__": 15
       }
     ],
     "_prefab": {
-      "__id__": 12
+      "__id__": 16
     },
     "_opacity": 255,
     "_color": {
@@ -493,7 +612,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 10
+      "__id__": 14
     },
     "_enabled": true,
     "_materials": [
@@ -545,21 +664,21 @@
     "_name": "2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 15
+        "__id__": 19
       },
       {
-        "__id__": 18
+        "__id__": 22
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 21
+      "__id__": 25
     },
     "_opacity": 255,
     "_color": {
@@ -581,7 +700,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 7,
+      "x": -5.213,
       "y": -65,
       "z": 0
     },
@@ -608,18 +727,18 @@
     "_name": "text2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 14
+      "__id__": 18
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 16
+        "__id__": 20
       }
     ],
     "_prefab": {
-      "__id__": 17
+      "__id__": 21
     },
     "_opacity": 255,
     "_color": {
@@ -668,7 +787,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 15
+      "__id__": 19
     },
     "_enabled": true,
     "_materials": [
@@ -709,18 +828,18 @@
     "_name": "text2_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 14
+      "__id__": 18
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 23
       }
     ],
     "_prefab": {
-      "__id__": 20
+      "__id__": 24
     },
     "_opacity": 255,
     "_color": {
@@ -769,7 +888,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 18
+      "__id__": 22
     },
     "_enabled": true,
     "_materials": [
@@ -821,21 +940,21 @@
     "_name": "3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 23
+        "__id__": 27
       },
       {
-        "__id__": 26
+        "__id__": 30
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 29
+      "__id__": 33
     },
     "_opacity": 255,
     "_color": {
@@ -857,7 +976,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 7,
+      "x": -5.213,
       "y": -100,
       "z": 0
     },
@@ -884,18 +1003,18 @@
     "_name": "text3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 22
+      "__id__": 26
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 28
       }
     ],
     "_prefab": {
-      "__id__": 25
+      "__id__": 29
     },
     "_opacity": 255,
     "_color": {
@@ -944,7 +1063,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 23
+      "__id__": 27
     },
     "_enabled": true,
     "_materials": [
@@ -985,18 +1104,18 @@
     "_name": "text3_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 22
+      "__id__": 26
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 27
+        "__id__": 31
       }
     ],
     "_prefab": {
-      "__id__": 28
+      "__id__": 32
     },
     "_opacity": 255,
     "_color": {
@@ -1018,7 +1137,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -19.881,
+      "x": -28.637,
       "y": 0,
       "z": 0
     },
@@ -1045,7 +1164,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 26
+      "__id__": 30
     },
     "_enabled": true,
     "_materials": [
@@ -1097,21 +1216,21 @@
     "_name": "4",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 31
+        "__id__": 35
       },
       {
-        "__id__": 34
+        "__id__": 38
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 37
+      "__id__": 41
     },
     "_opacity": 255,
     "_color": {
@@ -1133,7 +1252,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 7,
+      "x": -5.213,
       "y": -135,
       "z": 0
     },
@@ -1160,18 +1279,18 @@
     "_name": "text4",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 30
+      "__id__": 34
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 32
+        "__id__": 36
       }
     ],
     "_prefab": {
-      "__id__": 33
+      "__id__": 37
     },
     "_opacity": 255,
     "_color": {
@@ -1220,7 +1339,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 31
+      "__id__": 35
     },
     "_enabled": true,
     "_materials": [
@@ -1261,18 +1380,18 @@
     "_name": "text4_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 30
+      "__id__": 34
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 35
+        "__id__": 39
       }
     ],
     "_prefab": {
-      "__id__": 36
+      "__id__": 40
     },
     "_opacity": 255,
     "_color": {
@@ -1294,7 +1413,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -19.881,
+      "x": -27.762,
       "y": 0,
       "z": 0
     },
@@ -1321,7 +1440,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 34
+      "__id__": 38
     },
     "_enabled": true,
     "_materials": [
@@ -1373,21 +1492,21 @@
     "_name": "5",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 39
+        "__id__": 43
       },
       {
-        "__id__": 42
+        "__id__": 46
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 45
+      "__id__": 49
     },
     "_opacity": 255,
     "_color": {
@@ -1409,7 +1528,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 7,
+      "x": -5.213,
       "y": -170,
       "z": 0
     },
@@ -1436,18 +1555,18 @@
     "_name": "text5",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 38
+      "__id__": 42
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 40
+        "__id__": 44
       }
     ],
     "_prefab": {
-      "__id__": 41
+      "__id__": 45
     },
     "_opacity": 255,
     "_color": {
@@ -1496,7 +1615,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 39
+      "__id__": 43
     },
     "_enabled": true,
     "_materials": [
@@ -1537,18 +1656,18 @@
     "_name": "text5_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 38
+      "__id__": 42
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 43
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 44
+      "__id__": 48
     },
     "_opacity": 255,
     "_color": {
@@ -1597,7 +1716,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 42
+      "__id__": 46
     },
     "_enabled": true,
     "_materials": [
@@ -1649,7 +1768,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_materials": [
@@ -1681,12 +1800,12 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_layoutSize": {
       "__type__": "cc.Size",
-      "width": 300,
+      "width": 320,
       "height": 200
     },
     "_resize": 0,
@@ -1729,17 +1848,17 @@
     },
     "_children": [
       {
-        "__id__": 50
+        "__id__": 54
       },
       {
-        "__id__": 53
+        "__id__": 57
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [],
     "_prefab": {
-      "__id__": 56
+      "__id__": 60
     },
     "_opacity": 255,
     "_color": {
@@ -1762,7 +1881,7 @@
     "_position": {
       "__type__": "cc.Vec3",
       "x": 35.171,
-      "y": -98.487,
+      "y": -89.18,
       "z": 0
     },
     "_scale": {
@@ -1788,18 +1907,18 @@
     "_name": "text6",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 49
+      "__id__": 53
     },
     "_children": [],
     "_active": true,
     "_level": 6,
     "_components": [
       {
-        "__id__": 51
+        "__id__": 55
       }
     ],
     "_prefab": {
-      "__id__": 52
+      "__id__": 56
     },
     "_opacity": 255,
     "_color": {
@@ -1848,7 +1967,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 50
+      "__id__": 54
     },
     "_enabled": true,
     "_materials": [
@@ -1889,18 +2008,18 @@
     "_name": "text6_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 49
+      "__id__": 53
     },
     "_children": [],
     "_active": true,
     "_level": 6,
     "_components": [
       {
-        "__id__": 54
+        "__id__": 58
       }
     ],
     "_prefab": {
-      "__id__": 55
+      "__id__": 59
     },
     "_opacity": 255,
     "_color": {
@@ -1949,7 +2068,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 53
+      "__id__": 57
     },
     "_enabled": true,
     "_materials": [
@@ -2005,18 +2124,18 @@
     },
     "_children": [
       {
-        "__id__": 58
+        "__id__": 62
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [
       {
-        "__id__": 62
+        "__id__": 66
       }
     ],
     "_prefab": {
-      "__id__": 64
+      "__id__": 68
     },
     "_opacity": 255,
     "_color": {
@@ -2065,21 +2184,21 @@
     "_name": "Background",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 57
+      "__id__": 61
     },
     "_children": [],
     "_active": true,
     "_level": 2,
     "_components": [
       {
-        "__id__": 59
+        "__id__": 63
       },
       {
-        "__id__": 60
+        "__id__": 64
       }
     ],
     "_prefab": {
-      "__id__": 61
+      "__id__": 65
     },
     "_opacity": 255,
     "_color": {
@@ -2128,7 +2247,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 58
+      "__id__": 62
     },
     "_enabled": true,
     "_materials": [
@@ -2160,7 +2279,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 58
+      "__id__": 62
     },
     "_enabled": true,
     "alignMode": 0,
@@ -2198,14 +2317,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 61
     },
     "_enabled": true,
     "duration": 0.1,
     "zoomScale": 1.2,
     "clickEvents": [
       {
-        "__id__": 63
+        "__id__": 67
       }
     ],
     "_N$interactable": true,
@@ -2273,7 +2392,7 @@
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
     },
     "_N$target": {
-      "__id__": 58
+      "__id__": 62
     },
     "_id": ""
   },
@@ -2283,8 +2402,8 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "44137DozfJBcJ2mWQU1P352",
-    "handler": "onBindInviteInfo",
+    "_componentId": "5697fyiQiJFyog3L7KK2Hx7",
+    "handler": "onclose",
     "customEventData": ""
   },
   {
@@ -2307,22 +2426,22 @@
     },
     "_enabled": true,
     "price": {
-      "__id__": 11
+      "__id__": 15
     },
     "date": {
-      "__id__": 19
+      "__id__": 23
     },
     "startTime": {
-      "__id__": 27
+      "__id__": 31
     },
     "endTime": {
-      "__id__": 35
+      "__id__": 39
     },
     "multiple": {
-      "__id__": 43
+      "__id__": 47
     },
     "describe": {
-      "__id__": 54
+      "__id__": 58
     },
     "_id": ""
   },

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 250 - 128
assets/Prefabs/UI/lease/LeaseInfo.prefab


+ 214 - 95
assets/Prefabs/UI/lease/PlantInfo.prefab

@@ -21,24 +21,27 @@
         "__id__": 2
       },
       {
-        "__id__": 5
+        "__id__": 6
       },
       {
-        "__id__": 41
+        "__id__": 9
       },
       {
-        "__id__": 49
+        "__id__": 45
+      },
+      {
+        "__id__": 53
       }
     ],
     "_active": true,
     "_level": 1,
     "_components": [
       {
-        "__id__": 57
+        "__id__": 61
       }
     ],
     "_prefab": {
-      "__id__": 58
+      "__id__": 62
     },
     "_opacity": 255,
     "_color": {
@@ -66,8 +69,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
+      "x": 1.33,
+      "y": 1.33,
       "z": 1
     },
     "_eulerAngles": {
@@ -82,6 +85,122 @@
     "groupIndex": 0,
     "_id": ""
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "Mask",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 4
+      }
+    ],
+    "_prefab": {
+      "__id__": 5
+    },
+    "_opacity": 62,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 68,
+      "g": 66,
+      "b": 66,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 1000,
+      "height": 2000
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1.00075,
+      "y": 1.00075,
+      "z": 1.00075
+    },
+    "_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__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.BlockInputEvents",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "ff60e2cb-959f-4250-93e7-95c5223b0176"
+    },
+    "fileId": "63I+0CU/lKkpZGUFuXDCCL",
+    "sync": false
+  },
   {
     "__type__": "cc.Node",
     "_name": "BG",
@@ -94,11 +213,11 @@
     "_level": 4,
     "_components": [
       {
-        "__id__": 3
+        "__id__": 7
       }
     ],
     "_prefab": {
-      "__id__": 4
+      "__id__": 8
     },
     "_opacity": 255,
     "_color": {
@@ -147,7 +266,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 2
+      "__id__": 6
     },
     "_enabled": true,
     "_materials": [
@@ -194,30 +313,30 @@
     },
     "_children": [
       {
-        "__id__": 6
+        "__id__": 10
       },
       {
-        "__id__": 14
+        "__id__": 18
       },
       {
-        "__id__": 22
+        "__id__": 26
       },
       {
-        "__id__": 30
+        "__id__": 34
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 42
       },
       {
-        "__id__": 39
+        "__id__": 43
       }
     ],
     "_prefab": {
-      "__id__": 40
+      "__id__": 44
     },
     "_opacity": 255,
     "_color": {
@@ -266,21 +385,21 @@
     "_name": "1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 7
+        "__id__": 11
       },
       {
-        "__id__": 10
+        "__id__": 14
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 13
+      "__id__": 17
     },
     "_opacity": 255,
     "_color": {
@@ -329,18 +448,18 @@
     "_name": "text1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 6
+      "__id__": 10
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 12
       }
     ],
     "_prefab": {
-      "__id__": 9
+      "__id__": 13
     },
     "_opacity": 255,
     "_color": {
@@ -389,7 +508,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 11
     },
     "_enabled": true,
     "_materials": [
@@ -430,18 +549,18 @@
     "_name": "text1_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 6
+      "__id__": 10
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 11
+        "__id__": 15
       }
     ],
     "_prefab": {
-      "__id__": 12
+      "__id__": 16
     },
     "_opacity": 255,
     "_color": {
@@ -490,7 +609,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 10
+      "__id__": 14
     },
     "_enabled": true,
     "_materials": [
@@ -542,21 +661,21 @@
     "_name": "2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 15
+        "__id__": 19
       },
       {
-        "__id__": 18
+        "__id__": 22
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 21
+      "__id__": 25
     },
     "_opacity": 255,
     "_color": {
@@ -605,18 +724,18 @@
     "_name": "text2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 14
+      "__id__": 18
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 16
+        "__id__": 20
       }
     ],
     "_prefab": {
-      "__id__": 17
+      "__id__": 21
     },
     "_opacity": 255,
     "_color": {
@@ -665,7 +784,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 15
+      "__id__": 19
     },
     "_enabled": true,
     "_materials": [
@@ -706,18 +825,18 @@
     "_name": "text2_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 14
+      "__id__": 18
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 23
       }
     ],
     "_prefab": {
-      "__id__": 20
+      "__id__": 24
     },
     "_opacity": 255,
     "_color": {
@@ -766,7 +885,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 18
+      "__id__": 22
     },
     "_enabled": true,
     "_materials": [
@@ -818,21 +937,21 @@
     "_name": "3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 23
+        "__id__": 27
       },
       {
-        "__id__": 26
+        "__id__": 30
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 29
+      "__id__": 33
     },
     "_opacity": 255,
     "_color": {
@@ -881,18 +1000,18 @@
     "_name": "text3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 22
+      "__id__": 26
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 28
       }
     ],
     "_prefab": {
-      "__id__": 25
+      "__id__": 29
     },
     "_opacity": 255,
     "_color": {
@@ -941,7 +1060,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 23
+      "__id__": 27
     },
     "_enabled": true,
     "_materials": [
@@ -982,18 +1101,18 @@
     "_name": "text3_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 22
+      "__id__": 26
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 27
+        "__id__": 31
       }
     ],
     "_prefab": {
-      "__id__": 28
+      "__id__": 32
     },
     "_opacity": 255,
     "_color": {
@@ -1042,7 +1161,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 26
+      "__id__": 30
     },
     "_enabled": true,
     "_materials": [
@@ -1094,21 +1213,21 @@
     "_name": "4",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 9
     },
     "_children": [
       {
-        "__id__": 31
+        "__id__": 35
       },
       {
-        "__id__": 34
+        "__id__": 38
       }
     ],
     "_active": true,
     "_level": 6,
     "_components": [],
     "_prefab": {
-      "__id__": 37
+      "__id__": 41
     },
     "_opacity": 255,
     "_color": {
@@ -1157,18 +1276,18 @@
     "_name": "text4",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 30
+      "__id__": 34
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 32
+        "__id__": 36
       }
     ],
     "_prefab": {
-      "__id__": 33
+      "__id__": 37
     },
     "_opacity": 255,
     "_color": {
@@ -1217,7 +1336,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 31
+      "__id__": 35
     },
     "_enabled": true,
     "_materials": [
@@ -1258,18 +1377,18 @@
     "_name": "text4_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 30
+      "__id__": 34
     },
     "_children": [],
     "_active": true,
     "_level": 7,
     "_components": [
       {
-        "__id__": 35
+        "__id__": 39
       }
     ],
     "_prefab": {
-      "__id__": 36
+      "__id__": 40
     },
     "_opacity": 255,
     "_color": {
@@ -1318,7 +1437,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 34
+      "__id__": 38
     },
     "_enabled": true,
     "_materials": [
@@ -1370,7 +1489,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_materials": [
@@ -1402,7 +1521,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_layoutSize": {
@@ -1450,17 +1569,17 @@
     },
     "_children": [
       {
-        "__id__": 42
+        "__id__": 46
       },
       {
-        "__id__": 45
+        "__id__": 49
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [],
     "_prefab": {
-      "__id__": 48
+      "__id__": 52
     },
     "_opacity": 255,
     "_color": {
@@ -1509,18 +1628,18 @@
     "_name": "text3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 41
+      "__id__": 45
     },
     "_children": [],
     "_active": true,
     "_level": 6,
     "_components": [
       {
-        "__id__": 43
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 44
+      "__id__": 48
     },
     "_opacity": 255,
     "_color": {
@@ -1569,7 +1688,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 42
+      "__id__": 46
     },
     "_enabled": true,
     "_materials": [
@@ -1610,18 +1729,18 @@
     "_name": "text3_value",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 41
+      "__id__": 45
     },
     "_children": [],
     "_active": true,
     "_level": 6,
     "_components": [
       {
-        "__id__": 46
+        "__id__": 50
       }
     ],
     "_prefab": {
-      "__id__": 47
+      "__id__": 51
     },
     "_opacity": 255,
     "_color": {
@@ -1670,7 +1789,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 45
+      "__id__": 49
     },
     "_enabled": true,
     "_materials": [
@@ -1726,18 +1845,18 @@
     },
     "_children": [
       {
-        "__id__": 50
+        "__id__": 54
       }
     ],
     "_active": true,
     "_level": 5,
     "_components": [
       {
-        "__id__": 54
+        "__id__": 58
       }
     ],
     "_prefab": {
-      "__id__": 56
+      "__id__": 60
     },
     "_opacity": 255,
     "_color": {
@@ -1786,21 +1905,21 @@
     "_name": "Background",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 49
+      "__id__": 53
     },
     "_children": [],
     "_active": true,
     "_level": 2,
     "_components": [
       {
-        "__id__": 51
+        "__id__": 55
       },
       {
-        "__id__": 52
+        "__id__": 56
       }
     ],
     "_prefab": {
-      "__id__": 53
+      "__id__": 57
     },
     "_opacity": 255,
     "_color": {
@@ -1849,7 +1968,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 50
+      "__id__": 54
     },
     "_enabled": true,
     "_materials": [
@@ -1881,7 +2000,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 50
+      "__id__": 54
     },
     "_enabled": true,
     "alignMode": 0,
@@ -1919,14 +2038,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 49
+      "__id__": 53
     },
     "_enabled": true,
     "duration": 0.1,
     "zoomScale": 1.2,
     "clickEvents": [
       {
-        "__id__": 55
+        "__id__": 59
       }
     ],
     "_N$interactable": true,
@@ -1994,7 +2113,7 @@
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
     },
     "_N$target": {
-      "__id__": 50
+      "__id__": 54
     },
     "_id": ""
   },
@@ -2028,19 +2147,19 @@
     },
     "_enabled": true,
     "price": {
-      "__id__": 11
+      "__id__": 15
     },
     "maturity": {
-      "__id__": 19
+      "__id__": 23
     },
     "plantStart": {
-      "__id__": 27
+      "__id__": 31
     },
     "harvestQuantity": {
-      "__id__": 35
+      "__id__": 39
     },
     "describe": {
-      "__id__": 46
+      "__id__": 50
     },
     "_id": ""
   },

+ 3 - 3
assets/Script/Lease/LandInfo.js

@@ -53,13 +53,13 @@ cc.Class({
     setInfo(price,date,start,end,multiple,describe){
         this.price.string = price;
         this.date.string = date;
-        this.start.string = start;
-        this.end.string = end;
+        this.startTime.string = start;
+        this.endTime.string = end;
         this.multiple.string = multiple;
         this.describe.string = describe;
     },
 
     onclose(){
-        
+        this.node.destroy();
     }
 });

+ 118 - 15
assets/Script/Lease/LeaseInfo.js

@@ -8,7 +8,22 @@ cc.Class({
     properties: {
 
         inputInviteValue: {
-            default: '',
+            default: 1,
+            visible: false
+        },
+
+        //1 对应3个月,2对应1年,3对应5年
+        toggleInputValue: {
+            default: '1',
+            visible: false
+        },
+        totalPriceLabel: {
+            default: null,
+            type: cc.Label,
+            serializable: true
+        },
+        totalPriceValue: {
+            default: 0,
             visible: false
         },
 
@@ -22,6 +37,38 @@ cc.Class({
             default: null,
             type: cc.Node,
             serializable: true
+        },
+
+        toggle1: {
+            default: null,
+            type: cc.Toggle,
+            serializable: true
+        },
+
+        toggle2: {
+            default: null,
+            type: cc.Toggle,
+            serializable: true
+        },
+
+        toggle3: {
+            default: null,
+            type: cc.Toggle,
+            serializable: true
+        },
+
+        //这个显示的时候,拦截输入
+        blockInput: {
+            default: null,
+            type: cc.Node,
+            serializable: true
+        },
+        leaseFarmlandInfoNode: {
+            default: null,
+            type: cc.Node,
+            serializable: true,
+            visible:false,
+            toolTip:"操作的土地对象,初始化时候传入"
         }
     },
 
@@ -29,9 +76,9 @@ cc.Class({
 
     // onLoad () {},
 
-    start() {
+    // start() {
 
-    },
+    // },
 
     onOpenInfo() {
         this.node.active = true;
@@ -40,33 +87,91 @@ cc.Class({
 
     //初始化时候需要初始化一次默认值
     onToggleInput(value, evnentData) {
-        console.log(value.isChecked, evnentData);
+        // console.log(value.isChecked, evnentData);
+        this.toggleInputValue = evnentData;
+        this._updatePrice();
     },
 
     inputLeaseValue(value, e) {
 
         var numberTemp = new RegExp("^[A-Za-z0-9]+$");
         if (numberTemp.test(value)) {
-            this.inputInviteValue = Number(value);
-            console.log(this.inputInviteValue);
+            if(Number(value)>=1){
+                this.inputInviteValue = Number(value);
+            }else{
+                this.inputInviteValue = 1;
+                this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
+            }
         } else {
-            this.inputInviteValue = '';
+            this.inputInviteValue = 1;
             this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
-            console.log("请输入整数的倍数",this.inputInviteValue);
+            console.log("请输入整数的倍数", this.inputInviteValue);
             // gameToast.getInstance().show(this.ToastParent, "请输入整数的倍数", 2, () => {
             //     console.log("finish toast!");
             // }, this);
         }
+        this._updatePrice();
+    },
+
+    _updatePrice() {
+        //this.inputInviteValue 默认是1倍
+        // console.log( this.inputInviteValue);
+        switch (this.toggleInputValue) {
+            case "1":
+                this.totalPriceValue = 700 * this.inputInviteValue;
+                this.totalPriceLabel.string = this.totalPriceValue + "CNT";
+                break;
+            case "2":
+                this.totalPriceValue = 2500 * this.inputInviteValue;
+                this.totalPriceLabel.string = this.totalPriceValue + "CNT";
+                break;
+            case "3":
+                this.totalPriceValue = 5000 * this.inputInviteValue;
+                this.totalPriceLabel.string = this.totalPriceValue + "CNT";
+                break;
+            default:
+                console.error("this.toggleInputValue 不是1 2 3!", this.toggleInputValue);
+                break;
+        }
 
     },
 
+    /**
+     * 显示面板时候,设置一下初始化数据
+     */
+    onInitLeaseInfo(multiple){
+        //这里处理倍数
+        this.inputInviteValue = multiple;
+        this.inputContainer.getComponent(cc.EditBox).string = this.inputInviteValue;
+        this._updatePrice();
+    },
+  
+    //租赁支付
     onLeaseInfo() {
-        console.log('inputInviteValue:' + this.inputInviteValue);
+        console.log('支付总额:' + this.totalPriceValue);
         if (!GlobalD.dapp) {
             console.error("onBindInviteInfo warn,dapp未初始化!");
             return;
         }
         let _self = this;
+        //cntAmount,payType,itemType,callback
+        Global.game.payCNT(this.totalPriceValue, 1, this.toggleInputValue, (data) => {
+            console.log("土地支付", this.totalPriceValue, "==", 1, "==", this.toggleInputValue);
+            console.log("支付data:", data);
+            gameToast.getInstance().show(this.ToastParent, "支付成功!", 3, () => {
+                console.log("finish toast!");
+            }, this);
+            if (err === null) {
+                // TODO 成功, 支付为链上操作,需要提供回调接口给这边服务端确认交易成功后修改购买订单结果
+                console.log(tx) // 交易hash,唯一标识符
+
+                //解锁土地操作
+                this.leaseFarmlandInfoNode.getComponent("LeaseFarmlandInfo").onUnlockLand();
+
+            } else {
+                console.log(err)
+            }
+        });
         // GlobalD.dapp.bindParent(_self.inputInviteValue).then((data) => {
         //     if (data.err === null) {
         //         // 返回成功,见下面消息体
@@ -77,9 +182,7 @@ cc.Class({
         //         //如果存在父节点,隐藏输入框
         //         _self.inputContainer.active = false;
 
-        //         gameToast.getInstance().show(_self.ToastParent, "绑定成功!", 3, () => {
-        //             console.log("finish toast!");
-        //         }, _self);
+
         //     } else {
         //         //TODO 服务错误
         //         console.log(data.err)
@@ -91,8 +194,8 @@ cc.Class({
     },
 
     onClose() {
-        this.node.active = false;
-    }
-
+        this.node.destroy();
+    },
+    
 
 });

+ 1 - 1
assets/Script/Lease/PlantInfo.js

@@ -52,6 +52,6 @@ cc.Class({
     },
 
     onclose(){
-
+        this.node.destroy();
     }
 });

+ 17 - 0
assets/Script/Network/dapp.js

@@ -106,6 +106,15 @@ cc.Class({
                                     console.warn("未能读取到config土地?");
                                 }
                             })
+                         
+                            utils.get(utils.api.userLandList, {}, (res, value) => {
+                                if(0 === value.code){
+                                    GlobalD.UserLeaseLand = value.data;
+                                }else{
+                                    console.warn("读取到用户的土地错误?");
+                                }
+                            })
+                            
 
                         } else {
                             console.log(res, value);
@@ -188,6 +197,14 @@ cc.Class({
                     }
                 })
 
+                utils.get(utils.api.userLandList, {}, (res, value) => {
+                    if(0 === value.code){
+                        GlobalD.UserLeaseLand = value.data;
+                    }else{
+                        console.warn("读取到用户的土地错误?");
+                    }
+                })
+
             } else {
                 console.log(res, value);
             }

+ 20 - 4
assets/Script/UI/ManageBuildings.js

@@ -408,11 +408,11 @@ cc.Class({
             buildingsInfo.buildInfo.isItSaleable = GlobalD.GameData.GetWoodTradeState() > 0 ? true : false;// GlobalD.GameData.GetWoodTradeState();
         }
 
-      
+
         //设置一下,可查看信息
         if (reGameStates.BuildType.Housing !== buildingsInfo.buildInfo.buildType
             && reGameStates.BuildType.Special !== buildingsInfo.buildInfo.buildType
-              /** 神农小镇固定土地关闭 基本的房屋信息,另外设置其他信息 */
+            /** 神农小镇固定土地关闭 基本的房屋信息,另外设置其他信息 */
             && reGameStates.BuildType.HolyFarmland !== buildingsInfo.buildInfo.buildType
         ) {
 
@@ -474,11 +474,16 @@ cc.Class({
     spawnConfigLand() {
 
         if (GlobalD.ConfigLand == null) {
-            console.error("GlobalD.ConfigLand 为初始化设置!");
+            console.error("GlobalD.ConfigLand 未初始化设置!");
+            return;
+        }
+        if (GlobalD.UserLeaseLand == null) {
+            console.error("GlobalD.UserLeaseLand 未初始化设置!");
             return;
         }
         let _configLand = GlobalD.ConfigLand;
-        console.log(_configLand);
+        let _userLeaseLand = GlobalD.UserLeaseLand;
+        console.log(_configLand, _userLeaseLand);
         for (let i = 0; i < _configLand.length; i++) {
             //生成默认土地
             //农田
@@ -487,6 +492,17 @@ cc.Class({
             var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(cc.v2(_configLand[i].posX, _configLand[i].posY));
             housingTemp_farmland.setPosition(endPos.x, endPos.y);
 
+            for (let j = 0; j < _userLeaseLand.length; j++) {
+                let leaseFarmlandInfoScript = housingTemp_farmland.getComponent("LeaseFarmlandInfo");
+                //记录config的土地信息
+                leaseFarmlandInfoScript.setConfigLandInfo(_configLand[i]);
+                //记录已经租赁的信息
+                if(_userLeaseLand[j].configLandId == _configLand[i].id){
+                    leaseFarmlandInfoScript.setLeaseLandInfo(_userLeaseLand[j]);
+                }
+            }
+          
+
             let buildingsInfo_farmland = housingTemp_farmland.getComponent("buildingsInfo");
             //id用时间戳来记录
             buildingsInfo_farmland.buildInfo.id = _configLand[i].id;//对应的id

+ 10 - 6
assets/Script/UI/component/slider_progress.js

@@ -18,18 +18,18 @@ cc.Class({
     // LIFE-CYCLE CALLBACKS:
 
     onLoad () {
-        let slider = this.getComponent(cc.Slider);
-        let progressbar = this.getComponent(cc.ProgressBar);
+        this.slider = this.getComponent(cc.Slider);
+        this.progressbar = this.getComponent(cc.ProgressBar);
 
-        if(slider == null || progressbar == null){
+        if(this.slider == null || this.progressbar == null){
             return;
         }
 
-        progressbar.progress = slider.progress;
+        this.progressbar.progress = this.slider.progress;
 
         let self = this;
-        slider.node.on('slide', function(event){
-            progressbar.progress = slider.progress;
+        this.slider.node.on('slide', function(event){
+            this.progressbar.progress = this.slider.progress;
         }, this);
 
     },
@@ -38,5 +38,9 @@ cc.Class({
 
     },
 
+    onSetProcgress(value){
+        this.progressbar.progress = this.slider.progress = value;
+    }
+
     // update (dt) {},
 });

+ 89 - 0
assets/Script/Unit/date.js

@@ -0,0 +1,89 @@
+const formatTime = date => {
+	const year = date.getFullYear()
+	const month = date.getMonth() + 1
+	const day = date.getDate()
+	const hour = date.getHours()
+	const minute = date.getMinutes()
+	const second = date.getSeconds()
+
+	return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+const formatNumber = n => {
+	n = n.toString()
+	return n[1] ? n : '0' + n
+}
+
+const formatDate = date => {
+	const year = date.getFullYear()
+	const month = date.getMonth() + 1
+	const day = date.getDate()
+	const hour = date.getHours()
+	const minute = date.getMinutes()
+	const second = date.getSeconds()
+
+	return [year, month, day].map(formatNumber).join('/')
+}
+
+//计算相差天数
+const datedifference = (sDate1, sDate2) => { //sDate1和sDate2是2006-12-18格式 
+	var dateSpan,
+		tempDate,
+		iDays;
+	sDate1 = Date.parse(sDate1.replace(/-/g, '/'));
+	sDate2 = Date.parse(sDate2.replace(/-/g, '/'));
+	dateSpan = sDate2 - sDate1;
+	dateSpan = Math.abs(dateSpan);
+	iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
+	return iDays
+};
+
+const getDays =(date1, date2)=> {
+    const dateTime = 1000 * 60 * 60 * 24; //每一天的毫秒数
+    const minusDays = Math.floor(((date2.getTime() - date1.getTime()) / dateTime));//计算出两个日期的天数差
+    return Math.abs(minusDays);
+}
+
+/**
+ * [dateAddDays 从某个日期增加n天后的日期]
+ * @param  {[string]} dateStr  [日期字符串]
+ * @param  {[int]} dayCount [增加的天数]
+ * @return {[string]}[增加n天后的日期字符串]
+ */
+const dateAddDays=(dateStr,dayCount) => {
+    var tempDate=new Date(dateStr.replace(/-/g,"/"));//把日期字符串转换成日期格式
+    var resultDate=new Date((tempDate/1000+(86400*dayCount))*1000);//增加n天后的日期
+    var resultDateStr=resultDate.getFullYear()+"-"+(resultDate.getMonth()+1)+"-"+(resultDate.getDate());//将日期转化为字符串格式
+    return resultDateStr;
+}
+
+/**
+ * 根据newDate 来获取加的日期
+ */
+const addDaysFromNewDate=(tempDate,dayCount) => {
+    var resultDate=new Date((tempDate/1000+(86400*dayCount))*1000);//增加n天后的日期
+ //    var resultDateStr=resultDate.getFullYear()+"/"+(resultDate.getMonth()+1)+"/"+(resultDate.getDate());//将日期转化为字符串格式
+	// return resultDateStr;
+	
+	const year = resultDate.getFullYear();
+	const month = resultDate.getMonth() + 1;
+	const day = resultDate.getDate();
+	
+	return [year, month, day].map(formatNumber).join('/')
+	
+}
+
+const getWeightDate = date => {
+	var timearr = date.replace(" ", ":").replace(/\:/g, "-").split("-");
+	var timestr = "" + timearr[1] + "/" + timearr[2]
+	return timestr 
+}
+
+export default {
+	formatTime,
+	formatDate,
+	datedifference,
+	getDays,
+	dateAddDays,
+	addDaysFromNewDate,
+	getWeightDate
+}

+ 9 - 0
assets/Script/Unit/date.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "e38d82dd-a769-42ba-932f-f8634e073eb0",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 27 - 0
assets/Script/public/GameData.js

@@ -1066,5 +1066,32 @@ cc.Class({
         utils.get(utils.api.getSeedAndFruit, {}, (res, vaule) => {
 
         })
+    },
+
+
+    /**
+     * 支付cnt操作
+     * @param {*} amount // 需支付金额
+     * @param {*} payType 支付类型,1购买土地租凭, 2自然灾害防护,3野兽防护
+     * @param {*} itemType 操作物品的id
+     */
+    payCNT(cntAmount,payType,itemType,callback) {
+        if(!GlobalD.dapp){
+            console.warn("GlobalD.dapp未初始化,不能payCNT!");
+            return;
+        }
+        GlobalD.dapp.payCnt(cntAmount, payType,itemType).then((data) => {
+            const [err, tx] = data;
+            if (err === null) {
+                // TODO 成功, 支付为链上操作,需要提供回调接口给这边服务端确认交易成功后修改购买订单结果
+                console.log(tx) // 交易hash,唯一标识符
+            } else {
+                console.log(err)
+            }
+
+            if(callback){
+                callback(data);
+            }
+        });
     }
 });

+ 2 - 0
assets/Script/public/Globals.js

@@ -13,6 +13,8 @@ window.GlobalD = {
      * 新增的土地配置
      */
     ConfigLand:null,
+    //用户已租赁的土地
+    UserLeaseLand:null,
 
     //保存数据的脚本
     GameData: null,

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است