Browse Source

Merge branch 'master' of http://120.92.132.192:23541/TDGame/TDGameClient3D

xiejing 4 years ago
parent
commit
ddfb2be61f

+ 204 - 63
assets/resources/configs/Shop.json

@@ -65,7 +65,10 @@
     {
         "id": 10701,
         "quickId": 10301,
-        "diamondPurchaseId": "10601|10401",
+        "diamondPurchaseId": [
+            "10601",
+            "10401"
+        ],
         "unsealedGunId": 10701,
         "videoId": 10102,
         "index": 10
@@ -73,7 +76,10 @@
     {
         "id": 11001,
         "quickId": 10401,
-        "diamondPurchaseId": "10701|10601",
+        "diamondPurchaseId": [
+            "10701",
+            "10601"
+        ],
         "unsealedGunId": 11001,
         "videoId": 10301,
         "index": 11
@@ -81,7 +87,10 @@
     {
         "id": 11301,
         "quickId": 10601,
-        "diamondPurchaseId": "11001|10701",
+        "diamondPurchaseId": [
+            "11001",
+            "10701"
+        ],
         "unsealedGunId": 11301,
         "videoId": 10401,
         "index": 12
@@ -89,7 +98,10 @@
     {
         "id": 11401,
         "quickId": 10701,
-        "diamondPurchaseId": "11301|11001",
+        "diamondPurchaseId": [
+            "11301",
+            "11001"
+        ],
         "unsealedGunId": 11401,
         "videoId": 10601,
         "index": 13
@@ -97,7 +109,10 @@
     {
         "id": 11501,
         "quickId": 11001,
-        "diamondPurchaseId": "11401|11301",
+        "diamondPurchaseId": [
+            "11401",
+            "11301"
+        ],
         "unsealedGunId": 11501,
         "videoId": 10701,
         "index": 14
@@ -105,7 +120,10 @@
     {
         "id": 11701,
         "quickId": 11301,
-        "diamondPurchaseId": "11501|11401",
+        "diamondPurchaseId": [
+            "11501",
+            "11401"
+        ],
         "unsealedGunId": 11701,
         "videoId": 11001,
         "index": 15
@@ -113,7 +131,10 @@
     {
         "id": 10103,
         "quickId": 11401,
-        "diamondPurchaseId": "11701|11501",
+        "diamondPurchaseId": [
+            "11701",
+            "11501"
+        ],
         "unsealedGunId": 10103,
         "videoId": 11301,
         "index": 16
@@ -121,7 +142,10 @@
     {
         "id": 10602,
         "quickId": 11501,
-        "diamondPurchaseId": "10103|11701",
+        "diamondPurchaseId": [
+            "10103",
+            "11701"
+        ],
         "unsealedGunId": 10602,
         "videoId": 11401,
         "index": 17
@@ -129,7 +153,10 @@
     {
         "id": 11201,
         "quickId": 11701,
-        "diamondPurchaseId": "10602|10103",
+        "diamondPurchaseId": [
+            "10602",
+            "10103"
+        ],
         "unsealedGunId": 11201,
         "videoId": 11501,
         "index": 18
@@ -137,7 +164,10 @@
     {
         "id": 10402,
         "quickId": 10103,
-        "diamondPurchaseId": "11201|10602",
+        "diamondPurchaseId": [
+            "11201",
+            "10602"
+        ],
         "unsealedGunId": 10402,
         "videoId": 11701,
         "index": 19
@@ -145,7 +175,10 @@
     {
         "id": 10702,
         "quickId": 10602,
-        "diamondPurchaseId": "10402|11201",
+        "diamondPurchaseId": [
+            "10402",
+            "11201"
+        ],
         "unsealedGunId": 10702,
         "videoId": 10103,
         "index": 20
@@ -153,7 +186,10 @@
     {
         "id": 11101,
         "quickId": 11201,
-        "diamondPurchaseId": "10702|10402",
+        "diamondPurchaseId": [
+            "10702",
+            "10402"
+        ],
         "unsealedGunId": 11101,
         "videoId": 10602,
         "index": 21
@@ -161,7 +197,10 @@
     {
         "id": 10302,
         "quickId": 10402,
-        "diamondPurchaseId": "11101|10702",
+        "diamondPurchaseId": [
+            "11101",
+            "10702"
+        ],
         "unsealedGunId": 10302,
         "videoId": 11201,
         "index": 22
@@ -169,7 +208,10 @@
     {
         "id": 10603,
         "quickId": 10702,
-        "diamondPurchaseId": "10302|11101",
+        "diamondPurchaseId": [
+            "10302",
+            "11101"
+        ],
         "unsealedGunId": 10603,
         "videoId": 10402,
         "index": 23
@@ -177,7 +219,10 @@
     {
         "id": 11601,
         "quickId": 11101,
-        "diamondPurchaseId": "10603|10302",
+        "diamondPurchaseId": [
+            "10603",
+            "10302"
+        ],
         "unsealedGunId": 11601,
         "videoId": 10702,
         "index": 24
@@ -185,7 +230,10 @@
     {
         "id": 11502,
         "quickId": 10302,
-        "diamondPurchaseId": "11601|10603",
+        "diamondPurchaseId": [
+            "11601",
+            "10603"
+        ],
         "unsealedGunId": 11502,
         "videoId": 11101,
         "index": 25
@@ -193,7 +241,10 @@
     {
         "id": 10202,
         "quickId": 10603,
-        "diamondPurchaseId": "11502|11601",
+        "diamondPurchaseId": [
+            "11502",
+            "11601"
+        ],
         "unsealedGunId": 10202,
         "videoId": 10302,
         "index": 26
@@ -201,7 +252,10 @@
     {
         "id": 10902,
         "quickId": 11601,
-        "diamondPurchaseId": "10202|11502",
+        "diamondPurchaseId": [
+            "10202",
+            "11502"
+        ],
         "unsealedGunId": 10902,
         "videoId": 10603,
         "index": 27
@@ -209,7 +263,10 @@
     {
         "id": 10802,
         "quickId": 11502,
-        "diamondPurchaseId": "10902|10202",
+        "diamondPurchaseId": [
+            "10902",
+            "10202"
+        ],
         "unsealedGunId": 10802,
         "videoId": 11601,
         "index": 28
@@ -217,7 +274,10 @@
     {
         "id": 10502,
         "quickId": 10202,
-        "diamondPurchaseId": "10802|10902",
+        "diamondPurchaseId": [
+            "10802",
+            "10902"
+        ],
         "unsealedGunId": 10502,
         "videoId": 11502,
         "index": 29
@@ -225,7 +285,10 @@
     {
         "id": 10703,
         "quickId": 10902,
-        "diamondPurchaseId": "10502|10802",
+        "diamondPurchaseId": [
+            "10502",
+            "10802"
+        ],
         "unsealedGunId": 10703,
         "videoId": 10202,
         "index": 30
@@ -233,7 +296,10 @@
     {
         "id": 11302,
         "quickId": 10802,
-        "diamondPurchaseId": "10703|10502",
+        "diamondPurchaseId": [
+            "10703",
+            "10502"
+        ],
         "unsealedGunId": 11302,
         "videoId": 10902,
         "index": 31
@@ -241,7 +307,10 @@
     {
         "id": 10203,
         "quickId": 10502,
-        "diamondPurchaseId": "11302|10703",
+        "diamondPurchaseId": [
+            "11302",
+            "10703"
+        ],
         "unsealedGunId": 10203,
         "videoId": 10802,
         "index": 32
@@ -249,7 +318,10 @@
     {
         "id": 11102,
         "quickId": 10703,
-        "diamondPurchaseId": "10203|11302",
+        "diamondPurchaseId": [
+            "10203",
+            "11302"
+        ],
         "unsealedGunId": 11102,
         "videoId": 10502,
         "index": 33
@@ -257,7 +329,10 @@
     {
         "id": 11801,
         "quickId": 11302,
-        "diamondPurchaseId": "11102|10203",
+        "diamondPurchaseId": [
+            "11102",
+            "10203"
+        ],
         "unsealedGunId": 11801,
         "videoId": 10703,
         "index": 34
@@ -265,7 +340,10 @@
     {
         "id": 10303,
         "quickId": 10203,
-        "diamondPurchaseId": "11801|11102",
+        "diamondPurchaseId": [
+            "11801",
+            "11102"
+        ],
         "unsealedGunId": 10303,
         "videoId": 11302,
         "index": 35
@@ -273,7 +351,10 @@
     {
         "id": 11002,
         "quickId": 11102,
-        "diamondPurchaseId": "10303|11801",
+        "diamondPurchaseId": [
+            "10303",
+            "11801"
+        ],
         "unsealedGunId": 11002,
         "videoId": 10203,
         "index": 36
@@ -281,7 +362,10 @@
     {
         "id": 10803,
         "quickId": 11801,
-        "diamondPurchaseId": "11002|10303",
+        "diamondPurchaseId": [
+            "11002",
+            "10303"
+        ],
         "unsealedGunId": 10803,
         "videoId": 11102,
         "index": 37
@@ -289,7 +373,10 @@
     {
         "id": 11202,
         "quickId": 10303,
-        "diamondPurchaseId": "10803|11002",
+        "diamondPurchaseId": [
+            "10803",
+            "11002"
+        ],
         "unsealedGunId": 11202,
         "videoId": 11801,
         "index": 38
@@ -297,7 +384,10 @@
     {
         "id": 10403,
         "quickId": 11002,
-        "diamondPurchaseId": "11202|10803",
+        "diamondPurchaseId": [
+            "11202",
+            "10803"
+        ],
         "unsealedGunId": 10403,
         "videoId": 10303,
         "index": 39
@@ -305,7 +395,10 @@
     {
         "id": 11402,
         "quickId": 10803,
-        "diamondPurchaseId": "10403|11202",
+        "diamondPurchaseId": [
+            "10403",
+            "11202"
+        ],
         "unsealedGunId": 11402,
         "videoId": 11002,
         "index": 40
@@ -313,7 +406,10 @@
     {
         "id": 11602,
         "quickId": 11202,
-        "diamondPurchaseId": "11402|10403",
+        "diamondPurchaseId": [
+            "11402",
+            "10403"
+        ],
         "unsealedGunId": 11602,
         "videoId": 10803,
         "index": 41
@@ -321,7 +417,10 @@
     {
         "id": 11901,
         "quickId": 10403,
-        "diamondPurchaseId": "11602|11402",
+        "diamondPurchaseId": [
+            "11602",
+            "11402"
+        ],
         "unsealedGunId": 11901,
         "videoId": 11202,
         "index": 42
@@ -329,7 +428,10 @@
     {
         "id": 10503,
         "quickId": 11402,
-        "diamondPurchaseId": "11901|11602",
+        "diamondPurchaseId": [
+            "11901",
+            "11602"
+        ],
         "unsealedGunId": 10503,
         "videoId": 10403,
         "index": 43
@@ -337,7 +439,10 @@
     {
         "id": 11003,
         "quickId": 11602,
-        "diamondPurchaseId": "10503|11901",
+        "diamondPurchaseId": [
+            "10503",
+            "11901"
+        ],
         "unsealedGunId": 11003,
         "videoId": 11402,
         "index": 44
@@ -345,7 +450,10 @@
     {
         "id": 11702,
         "quickId": 11901,
-        "diamondPurchaseId": "11003|10503",
+        "diamondPurchaseId": [
+            "11003",
+            "10503"
+        ],
         "unsealedGunId": 11702,
         "videoId": 11602,
         "index": 45
@@ -353,7 +461,10 @@
     {
         "id": 10903,
         "quickId": 10503,
-        "diamondPurchaseId": "11702|11003",
+        "diamondPurchaseId": [
+            "11702",
+            "11003"
+        ],
         "unsealedGunId": 10903,
         "videoId": 11901,
         "index": 46
@@ -361,7 +472,10 @@
     {
         "id": 11203,
         "quickId": 11003,
-        "diamondPurchaseId": "10903|11702",
+        "diamondPurchaseId": [
+            "10903",
+            "11702"
+        ],
         "unsealedGunId": 11203,
         "videoId": 10503,
         "index": 47
@@ -369,7 +483,10 @@
     {
         "id": 12001,
         "quickId": 11702,
-        "diamondPurchaseId": "11203|10903",
+        "diamondPurchaseId": [
+            "11203",
+            "10903"
+        ],
         "unsealedGunId": 12001,
         "videoId": 11003,
         "index": 48
@@ -377,7 +494,10 @@
     {
         "id": 11303,
         "quickId": 10903,
-        "diamondPurchaseId": "12001|11203",
+        "diamondPurchaseId": [
+            "12001",
+            "11203"
+        ],
         "unsealedGunId": 11303,
         "videoId": 11702,
         "index": 49
@@ -385,7 +505,10 @@
     {
         "id": 11103,
         "quickId": 11203,
-        "diamondPurchaseId": "11303|12001",
+        "diamondPurchaseId": [
+            "11303",
+            "12001"
+        ],
         "unsealedGunId": 11103,
         "videoId": 10903,
         "index": 50
@@ -393,7 +516,10 @@
     {
         "id": 11403,
         "quickId": 12001,
-        "diamondPurchaseId": "11103|11303",
+        "diamondPurchaseId": [
+            "11103",
+            "11303"
+        ],
         "unsealedGunId": 11403,
         "videoId": 11203,
         "index": 51
@@ -401,7 +527,10 @@
     {
         "id": 11503,
         "quickId": 11303,
-        "diamondPurchaseId": "11403|11103",
+        "diamondPurchaseId": [
+            "11403",
+            "11103"
+        ],
         "unsealedGunId": 11503,
         "videoId": 12001,
         "index": 52
@@ -409,7 +538,10 @@
     {
         "id": 11603,
         "quickId": 11103,
-        "diamondPurchaseId": "11503|11403",
+        "diamondPurchaseId": [
+            "11503",
+            "11403"
+        ],
         "unsealedGunId": 11603,
         "videoId": 11303,
         "index": 53
@@ -417,7 +549,10 @@
     {
         "id": 12002,
         "quickId": 11403,
-        "diamondPurchaseId": "11603|11503",
+        "diamondPurchaseId": [
+            "11603",
+            "11503"
+        ],
         "unsealedGunId": 12002,
         "videoId": 11103,
         "index": 54
@@ -425,7 +560,10 @@
     {
         "id": 11703,
         "quickId": 11503,
-        "diamondPurchaseId": "12002|11603",
+        "diamondPurchaseId": [
+            "12002",
+            "11603"
+        ],
         "unsealedGunId": 11703,
         "videoId": 11403,
         "index": 55
@@ -433,7 +571,10 @@
     {
         "id": 11902,
         "quickId": 11603,
-        "diamondPurchaseId": "11703|12002",
+        "diamondPurchaseId": [
+            "11703",
+            "12002"
+        ],
         "unsealedGunId": 11902,
         "videoId": 11503,
         "index": 56
@@ -441,7 +582,10 @@
     {
         "id": 11802,
         "quickId": 12002,
-        "diamondPurchaseId": "11902|11703",
+        "diamondPurchaseId": [
+            "11902",
+            "11703"
+        ],
         "unsealedGunId": 11802,
         "videoId": 11603,
         "index": 57
@@ -449,7 +593,10 @@
     {
         "id": 11903,
         "quickId": 11703,
-        "diamondPurchaseId": "11802|11902",
+        "diamondPurchaseId": [
+            "11802",
+            "11902"
+        ],
         "unsealedGunId": 11903,
         "videoId": 12002,
         "index": 58
@@ -457,7 +604,10 @@
     {
         "id": 11803,
         "quickId": 11902,
-        "diamondPurchaseId": "11903|11802",
+        "diamondPurchaseId": [
+            "11903",
+            "11802"
+        ],
         "unsealedGunId": 11803,
         "videoId": 11703,
         "index": 59
@@ -465,21 +615,12 @@
     {
         "id": 12003,
         "quickId": 11802,
-        "diamondPurchaseId": "11803|11903",
+        "diamondPurchaseId": [
+            "11803",
+            "11903"
+        ],
         "unsealedGunId": 12003,
         "videoId": 11902,
         "index": 60
-    },
-    {
-        "videoId": 11802
-    },
-    {
-        "videoId": 11903
-    },
-    {
-        "videoId": 11803
-    },
-    {
-        "videoId": 12003
     }
 ]

+ 125 - 77
assets/resources/ui/components/ShopListItemRender.prefab

@@ -35,26 +35,26 @@
         "__id__": 29
       },
       {
-        "__id__": 43
+        "__id__": 44
       },
       {
-        "__id__": 57
+        "__id__": 59
       },
       {
-        "__id__": 71
+        "__id__": 74
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 81
+        "__id__": 84
       },
       {
-        "__id__": 82
+        "__id__": 85
       }
     ],
     "_prefab": {
-      "__id__": 83
+      "__id__": 86
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -928,11 +928,11 @@
         "__id__": 40
       },
       {
-        "__id__": 41
+        "__id__": 42
       }
     ],
     "_prefab": {
-      "__id__": 42
+      "__id__": 43
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1267,7 +1267,11 @@
       "__id__": 29
     },
     "_enabled": true,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 41
+      }
+    ],
     "_interactable": true,
     "_transition": 2,
     "_normalColor": {
@@ -1317,6 +1321,16 @@
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "28650QIQf9OHqY5dQxD7SPy",
+    "handler": "VideoBuy",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.WidgetComponent",
     "_name": "GlodBuyButton<WidgetComponent>",
@@ -1369,17 +1383,14 @@
     },
     "_children": [
       {
-        "__id__": 44
+        "__id__": 45
       },
       {
-        "__id__": 48
+        "__id__": 49
       }
     ],
     "_active": true,
     "_components": [
-      {
-        "__id__": 52
-      },
       {
         "__id__": 53
       },
@@ -1388,10 +1399,13 @@
       },
       {
         "__id__": 55
+      },
+      {
+        "__id__": 57
       }
     ],
     "_prefab": {
-      "__id__": 56
+      "__id__": 58
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1426,20 +1440,20 @@
     "_name": "Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 43
+      "__id__": 44
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 45
+        "__id__": 46
       },
       {
-        "__id__": 46
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 47
+      "__id__": 48
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1474,7 +1488,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 44
+      "__id__": 45
     },
     "_enabled": true,
     "_priority": 0,
@@ -1495,7 +1509,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 44
+      "__id__": 45
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -1546,20 +1560,20 @@
     "_name": "goldIcon",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 43
+      "__id__": 44
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 49
+        "__id__": 50
       },
       {
-        "__id__": 50
+        "__id__": 51
       }
     ],
     "_prefab": {
-      "__id__": 51
+      "__id__": 52
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1594,7 +1608,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 48
+      "__id__": 49
     },
     "_enabled": true,
     "_priority": 0,
@@ -1615,7 +1629,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 48
+      "__id__": 49
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -1666,7 +1680,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
     "_priority": 0,
@@ -1687,7 +1701,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -1723,10 +1737,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 56
+      }
+    ],
     "_interactable": true,
     "_transition": 2,
     "_normalColor": {
@@ -1772,16 +1790,26 @@
     "_duration": 0.1,
     "_zoomScale": 1.2,
     "_target": {
-      "__id__": 43
+      "__id__": 44
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "28650QIQf9OHqY5dQxD7SPy",
+    "handler": "DiamondBuy",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.WidgetComponent",
     "_name": "GlodBuyButton<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
     "_alignFlags": 34,
@@ -1828,29 +1856,29 @@
     },
     "_children": [
       {
-        "__id__": 58
+        "__id__": 60
       },
       {
-        "__id__": 62
+        "__id__": 64
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 66
+        "__id__": 68
       },
       {
-        "__id__": 67
+        "__id__": 69
       },
       {
-        "__id__": 68
+        "__id__": 70
       },
       {
-        "__id__": 69
+        "__id__": 72
       }
     ],
     "_prefab": {
-      "__id__": 70
+      "__id__": 73
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1885,20 +1913,20 @@
     "_name": "Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 57
+      "__id__": 59
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 59
+        "__id__": 61
       },
       {
-        "__id__": 60
+        "__id__": 62
       }
     ],
     "_prefab": {
-      "__id__": 61
+      "__id__": 63
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1933,7 +1961,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 58
+      "__id__": 60
     },
     "_enabled": true,
     "_priority": 0,
@@ -1954,7 +1982,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 58
+      "__id__": 60
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -2005,20 +2033,20 @@
     "_name": "goldIcon",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 57
+      "__id__": 59
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 63
+        "__id__": 65
       },
       {
-        "__id__": 64
+        "__id__": 66
       }
     ],
     "_prefab": {
-      "__id__": 65
+      "__id__": 67
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -2053,7 +2081,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 62
+      "__id__": 64
     },
     "_enabled": true,
     "_priority": 0,
@@ -2074,7 +2102,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 62
+      "__id__": 64
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -2125,7 +2153,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 59
     },
     "_enabled": true,
     "_priority": 0,
@@ -2146,7 +2174,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 59
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -2182,10 +2210,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 59
     },
     "_enabled": true,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 71
+      }
+    ],
     "_interactable": true,
     "_transition": 2,
     "_normalColor": {
@@ -2231,16 +2263,26 @@
     "_duration": 0.1,
     "_zoomScale": 1.2,
     "_target": {
-      "__id__": 57
+      "__id__": 59
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "28650QIQf9OHqY5dQxD7SPy",
+    "handler": "GlodBuy",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.WidgetComponent",
     "_name": "GlodBuyButton<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 59
     },
     "_enabled": true,
     "_alignFlags": 34,
@@ -2287,23 +2329,23 @@
     },
     "_children": [
       {
-        "__id__": 72
+        "__id__": 75
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 77
+        "__id__": 80
       },
       {
-        "__id__": 78
+        "__id__": 81
       },
       {
-        "__id__": 79
+        "__id__": 82
       }
     ],
     "_prefab": {
-      "__id__": 80
+      "__id__": 83
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -2338,23 +2380,23 @@
     "_name": "Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 71
+      "__id__": 74
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 73
+        "__id__": 76
       },
       {
-        "__id__": 74
+        "__id__": 77
       },
       {
-        "__id__": 75
+        "__id__": 78
       }
     ],
     "_prefab": {
-      "__id__": 76
+      "__id__": 79
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -2389,7 +2431,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "_priority": 0,
@@ -2410,7 +2452,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -2446,7 +2488,7 @@
     "_name": "Label<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 72
+      "__id__": 75
     },
     "_enabled": true,
     "_alignFlags": 18,
@@ -2489,7 +2531,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 71
+      "__id__": 74
     },
     "_enabled": true,
     "_priority": 0,
@@ -2510,7 +2552,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 71
+      "__id__": 74
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -2546,7 +2588,7 @@
     "_name": "GlodBuyButton<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 71
+      "__id__": 74
     },
     "_enabled": true,
     "_alignFlags": 34,
@@ -2625,14 +2667,20 @@
     "freeBuyButton": {
       "__id__": 40
     },
+    "freeBuyButtonLabel": {
+      "__id__": 62
+    },
     "diamondBuyButton": {
-      "__id__": 54
+      "__id__": 55
+    },
+    "diamondBuyButtonLabel": {
+      "__id__": 47
     },
     "GlodBuyButton": {
-      "__id__": 68
+      "__id__": 70
     },
     "lockState": {
-      "__id__": 71
+      "__id__": 74
     },
     "_id": ""
   },

+ 54 - 26
assets/scripts/games/models/GameModel.ts

@@ -214,11 +214,18 @@ export class GameModel extends DataModel{
     }
 
     /**
-     * 查询快捷购买价格
+     * 查询购买价格
      * @param weapon
      */
     public GetQuickBuyPrice():number{
-        let weaponId:number=this.CurrentQuickBuyWeaponId;
+        return this.GetWeaponBuyPrice(this.CurrentQuickBuyWeaponId);
+    }
+
+    /**
+     * 查询购买价格
+     * @param weaponId 
+     */
+    public GetWeaponBuyPrice(weaponId:number):number{
         //已购买的次数
         let buyCount:number=this.GetBuyCount(weaponId);
         let weaponConfig:any=GameConfigManager.GetWeaponConfig(weaponId);
@@ -226,8 +233,8 @@ export class GameModel extends DataModel{
         let price:number=weaponConfig.consumeGold;
         //系数
         let coefficient:number=weaponConfig.coefficient;
-        if(buyCount<=0){
-            buyCount=1;
+        if(buyCount<0){
+            buyCount=0;
         }
         return Math.floor(price*Math.pow(coefficient,buyCount));
     }
@@ -246,37 +253,58 @@ export class GameModel extends DataModel{
 
     /**
      * 购买武器
+     * @param type 0 金币购买 1钻石购买 2视频购买 
+     * @param weaponId 
      */
-    public QuickBuy():void{
-        let price:number=this.GetQuickBuyPrice();
-        if(this.gold<price){
-            NoticeManager.ShowPrompt("金币不足,不能购买武器!");
-            return;
-        }
+    public BuyWeapon(type:number,weaponId:number):void{
+        let price:number;
+        let weaponConfig:any
+
         //找到空槽位
         let weaponCell:WeaponCell=this.FindWeaponEmptyCell();
         if(weaponCell==null){
             NoticeManager.ShowPrompt("没有空槽位了!");
             return;
         }
-        //扣钱
-        let currentGold:number=this.gold;
-        currentGold-=price;
-        if(currentGold<0){
-            currentGold=0;
-        }
-        this.gold=currentGold;
-        //记录购买次数
-        let weaponId:number=this.CurrentQuickBuyWeaponId;
-        let weaponConfig:any=GameConfigManager.GetWeaponConfig(weaponId);
-        let buyCount:number=this.GetBuyCount(weaponId);
-        buyCount++;
-        if(buyCount>weaponConfig.frequencyLimit){
-            buyCount=weaponConfig.frequencyLimit;
+
+        if(type==0){
+            price=this.GetWeaponBuyPrice(weaponId);
+            if(this.gold<price){
+                NoticeManager.ShowPrompt("金币不足,不能购买武器!");
+                return;
+            }
+            //扣钱
+            let currentGold:number=this.gold;
+            currentGold-=price;
+            if(currentGold<0){
+                currentGold=0;
+            }
+            this.gold=currentGold;
+            //记录购买次数
+            weaponConfig=GameConfigManager.GetWeaponConfig(weaponId);
+            let buyCount:number=this.GetBuyCount(weaponId);
+            buyCount++;
+            if(buyCount>weaponConfig.frequencyLimit){
+                buyCount=weaponConfig.frequencyLimit;
+            }
+            this.__buyHistory.set(weaponId,buyCount);
+        }else if(type==1){
+            let weaponConfig:any=GameConfigManager.GetWeaponConfig(weaponId);
+            price=weaponConfig.consumeDiamond;
+            if(this.diamond<price){
+                NoticeManager.ShowPrompt("宝石不足,不能购买武器!");
+                return;
+            }
+            //扣钱
+            let currentDiamond:number=this.gold;
+            currentDiamond-=price;
+            if(currentDiamond<0){
+                currentDiamond=0;
+            }
+            this.diamond=currentDiamond;
         }
-        this.__buyHistory.set(weaponId,buyCount);
         //发货
-        this.AddWeapon(weaponCell.cellId,this.CurrentQuickBuyWeaponId);
+        this.AddWeapon(weaponCell.cellId,weaponId);
     }
 
     /**

+ 4 - 5
assets/scripts/games/ui/fightings/weapons/WeaponBase.ts

@@ -162,19 +162,18 @@ export class WeaponBase extends EventDispatcher{
         let Pos:Vec3;
         if(this.fireKey==1){
             Pos=this.leftHand.node.position;
-            Pos.x=-0.3;
+            Pos.x=-0.4;
             this.leftHand.node.setPosition(Pos);
-            
         }else if(this.fireKey==3){
             Pos=this.rightHand.node.position;
-            Pos.x=0.3;
+            Pos.x=0.4;
             this.rightHand.node.setPosition(Pos);
         }else if(this.fireKey==2){
             Pos=this.leftHand.node.position;
-            Pos.x=-0.06;
+            Pos.x=-0.1;
             this.leftHand.node.setPosition(Pos);
             Pos=this.rightHand.node.position;
-            Pos.x=0.06;
+            Pos.x=0.1;
             this.rightHand.node.setPosition(Pos);
         }
     }

+ 1 - 1
assets/scripts/games/ui/prepares/PrepareMediator.ts

@@ -267,7 +267,7 @@ export class PrepareMediator extends GUIMediator {
             NoticeManager.ShowPrompt("金币不足");
             return;
         }
-        GameModel.single.QuickBuy();
+        GameModel.single.BuyWeapon(0,GameModel.single.CurrentQuickBuyWeaponId);
     }
 
     private ShopButtonClickHandler():void{

+ 38 - 1
assets/scripts/games/ui/shops/ShopItemRenderScript.ts

@@ -1,5 +1,6 @@
 import { _decorator, Component, Node, profiler, SpriteComponent, LabelComponent, ButtonComponent, loader, SpriteFrame } from 'cc';
 import GameConfigManager from '../../models/GameConfigManager';
+import { GameModel } from '../../models/GameModel';
 const { ccclass, property } = _decorator;
 
 @ccclass('ShopItemRenderScript')
@@ -25,11 +26,21 @@ export class ShopItemRenderScript extends Component {
     })
     freeBuyButton:ButtonComponent=null;
 
+    @property({
+        type:LabelComponent
+    })
+    freeBuyButtonLabel:LabelComponent=null;
+
     @property({
         type:ButtonComponent
     })
     diamondBuyButton:ButtonComponent=null;
 
+    @property({
+        type:LabelComponent
+    })
+    diamondBuyButtonLabel:LabelComponent=null;
+
 
     @property({
         type:ButtonComponent
@@ -61,9 +72,10 @@ export class ShopItemRenderScript extends Component {
             this.icon.spriteFrame=asset;
         })
         //等级
-        this.levelLabel.string=weaponConfig.level;
+        this.levelLabel.string=weaponConfig.level.toString();
         //名称
         this.nameLabel.string=weaponConfig.name;
+        let price:number;
         //state 0 未解锁  1 已解锁
         if(this.data.state==0){
             this.freeBuyButton.node.active=this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
@@ -74,9 +86,13 @@ export class ShopItemRenderScript extends Component {
             if(this.data.buyType==0){//金币购买
                 this.freeBuyButton.node.active=this.diamondBuyButton.node.active=false;
                 this.GlodBuyButton.node.active=true;
+                price=GameModel.single.GetWeaponBuyPrice(this.data.id);
+                this.freeBuyButtonLabel.string=price.toString();
             }else if(this.data.buyType==1){//宝石购买
                 this.freeBuyButton.node.active=this.GlodBuyButton.node.active=false;
                 this.diamondBuyButton.node.active=true;
+                price=weaponConfig.consumeDiamond;
+                this.diamondBuyButtonLabel.string=price.toString();
             }else{//广告购买
                 this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
                 this.freeBuyButton.node.active=true;
@@ -84,6 +100,27 @@ export class ShopItemRenderScript extends Component {
         }
     }
 
+    /**
+     * 金币购买
+     */
+    GlodBuy():void{
+        GameModel.single.BuyWeapon(this.data.buyType,this.data.id);
+    }
+
+    /**
+     * 钻石购买
+     */
+    DiamondBuy():void{
+        GameModel.single.BuyWeapon(this.data.buyType,this.data.id);
+    }
+
+    /**
+     * 视频购买
+     */
+    VideoBuy():void{
+        GameModel.single.BuyWeapon(this.data.buyType,this.data.id);
+    }
+
     // update (deltaTime: number) {
     //     // Your update function goes here.
     // }

+ 4 - 1
assets/scripts/games/ui/shops/ShopMediator.ts

@@ -101,6 +101,7 @@ export class ShopMediator extends GUIMediator {
             unlockLevel=-1;
         }
         let shopList:any[]=GameConfigManager.ShopList;
+        shopList.sort((a,b)=> a.index-b.index);
         let itemData:any;
         shopList.forEach(element => {
             weaponConfig=GameConfigManager.GetWeaponConfig(element.id);
@@ -117,9 +118,11 @@ export class ShopMediator extends GUIMediator {
                 itemData.buyType=0
             }else if(config.videoId==element.id){
                 itemData.buyType=2;
+            }else{
+                itemData.buyType=0;
             }
             //state 0 未解锁  1 已解锁
-            if(unlockLevel<0||weaponConfig.level<unlockLevel){
+            if(unlockLevel<0||weaponConfig.level>unlockLevel){
                 itemData.state=0;
             }else{
                 itemData.state=1;