Browse Source

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

xiejing 4 years ago
parent
commit
8fe6a0081d

+ 81 - 60
assets/resources/configs/Shop.json

@@ -1,464 +1,485 @@
 [
     {
         "id": 10101,
-        "needId": 10101,
         "quickId": 10101,
+        "unsealedGunId": 10101,
+        "videoId": 10101,
         "index": 1
     },
     {
         "id": 10201,
-        "needId": 10501,
         "quickId": 10101,
+        "unsealedGunId": 10201,
+        "videoId": 10101,
         "index": 2
     },
     {
         "id": 10501,
-        "needId": 10901,
         "quickId": 10101,
+        "unsealedGunId": 10501,
+        "videoId": 10101,
         "index": 3
     },
     {
         "id": 10801,
-        "needId": 10301,
         "quickId": 10101,
+        "unsealedGunId": 10801,
+        "videoId": 10101,
         "index": 4
     },
     {
         "id": 10901,
-        "needId": 10401,
         "quickId": 10201,
+        "unsealedGunId": 10901,
+        "videoId": 10101,
         "index": 5
     },
     {
         "id": 10102,
-        "needId": 10601,
         "quickId": 10501,
+        "unsealedGunId": 10102,
+        "videoId": 10201,
         "index": 6
     },
     {
         "id": 10301,
-        "needId": 10701,
         "quickId": 10801,
+        "unsealedGunId": 10301,
+        "videoId": 10501,
         "index": 7
     },
     {
         "id": 10401,
-        "needId": 11001,
         "quickId": 10901,
+        "unsealedGunId": 10401,
+        "videoId": 10801,
         "index": 8
     },
     {
         "id": 10601,
-        "needId": 11301,
         "quickId": 10102,
+        "unsealedGunId": 10601,
+        "videoId": 10901,
         "index": 9
     },
     {
         "id": 10701,
-        "needId": 11401,
         "quickId": 10301,
         "diamondPurchaseId": "10601|10401",
         "unsealedGunId": 10701,
+        "videoId": 10102,
         "index": 10
     },
     {
         "id": 11001,
-        "needId": 11501,
         "quickId": 10401,
         "diamondPurchaseId": "10701|10601",
         "unsealedGunId": 11001,
+        "videoId": 10301,
         "index": 11
     },
     {
         "id": 11301,
-        "needId": 11701,
         "quickId": 10601,
         "diamondPurchaseId": "11001|10701",
         "unsealedGunId": 11301,
+        "videoId": 10401,
         "index": 12
     },
     {
         "id": 11401,
-        "needId": 10103,
         "quickId": 10701,
         "diamondPurchaseId": "11301|11001",
         "unsealedGunId": 11401,
+        "videoId": 10601,
         "index": 13
     },
     {
         "id": 11501,
-        "needId": 10602,
         "quickId": 11001,
         "diamondPurchaseId": "11401|11301",
         "unsealedGunId": 11501,
+        "videoId": 10701,
         "index": 14
     },
     {
         "id": 11701,
-        "needId": 11201,
         "quickId": 11301,
         "diamondPurchaseId": "11501|11401",
         "unsealedGunId": 11701,
+        "videoId": 11001,
         "index": 15
     },
     {
         "id": 10103,
-        "needId": 10402,
         "quickId": 11401,
         "diamondPurchaseId": "11701|11501",
         "unsealedGunId": 10103,
+        "videoId": 11301,
         "index": 16
     },
     {
         "id": 10602,
-        "needId": 10702,
         "quickId": 11501,
         "diamondPurchaseId": "10103|11701",
         "unsealedGunId": 10602,
+        "videoId": 11401,
         "index": 17
     },
     {
         "id": 11201,
-        "needId": 11101,
         "quickId": 11701,
         "diamondPurchaseId": "10602|10103",
         "unsealedGunId": 11201,
+        "videoId": 11501,
         "index": 18
     },
     {
         "id": 10402,
-        "needId": 10302,
         "quickId": 10103,
         "diamondPurchaseId": "11201|10602",
         "unsealedGunId": 10402,
+        "videoId": 11701,
         "index": 19
     },
     {
         "id": 10702,
-        "needId": 10603,
         "quickId": 10602,
         "diamondPurchaseId": "10402|11201",
         "unsealedGunId": 10702,
+        "videoId": 10103,
         "index": 20
     },
     {
         "id": 11101,
-        "needId": 11601,
         "quickId": 11201,
         "diamondPurchaseId": "10702|10402",
         "unsealedGunId": 11101,
+        "videoId": 10602,
         "index": 21
     },
     {
         "id": 10302,
-        "needId": 11502,
         "quickId": 10402,
         "diamondPurchaseId": "11101|10702",
         "unsealedGunId": 10302,
+        "videoId": 11201,
         "index": 22
     },
     {
         "id": 10603,
-        "needId": 10202,
         "quickId": 10702,
         "diamondPurchaseId": "10302|11101",
         "unsealedGunId": 10603,
+        "videoId": 10402,
         "index": 23
     },
     {
         "id": 11601,
-        "needId": 10902,
         "quickId": 11101,
         "diamondPurchaseId": "10603|10302",
         "unsealedGunId": 11601,
+        "videoId": 10702,
         "index": 24
     },
     {
         "id": 11502,
-        "needId": 10802,
         "quickId": 10302,
         "diamondPurchaseId": "11601|10603",
         "unsealedGunId": 11502,
+        "videoId": 11101,
         "index": 25
     },
     {
         "id": 10202,
-        "needId": 10502,
         "quickId": 10603,
         "diamondPurchaseId": "11502|11601",
         "unsealedGunId": 10202,
+        "videoId": 10302,
         "index": 26
     },
     {
         "id": 10902,
-        "needId": 10703,
         "quickId": 11601,
         "diamondPurchaseId": "10202|11502",
         "unsealedGunId": 10902,
+        "videoId": 10603,
         "index": 27
     },
     {
         "id": 10802,
-        "needId": 11302,
         "quickId": 11502,
         "diamondPurchaseId": "10902|10202",
         "unsealedGunId": 10802,
+        "videoId": 11601,
         "index": 28
     },
     {
         "id": 10502,
-        "needId": 10203,
         "quickId": 10202,
         "diamondPurchaseId": "10802|10902",
         "unsealedGunId": 10502,
+        "videoId": 11502,
         "index": 29
     },
     {
         "id": 10703,
-        "needId": 11102,
         "quickId": 10902,
         "diamondPurchaseId": "10502|10802",
         "unsealedGunId": 10703,
+        "videoId": 10202,
         "index": 30
     },
     {
         "id": 11302,
-        "needId": 11801,
         "quickId": 10802,
         "diamondPurchaseId": "10703|10502",
         "unsealedGunId": 11302,
+        "videoId": 10902,
         "index": 31
     },
     {
         "id": 10203,
-        "needId": 10303,
         "quickId": 10502,
         "diamondPurchaseId": "11302|10703",
         "unsealedGunId": 10203,
+        "videoId": 10802,
         "index": 32
     },
     {
         "id": 11102,
-        "needId": 11002,
         "quickId": 10703,
         "diamondPurchaseId": "10203|11302",
         "unsealedGunId": 11102,
+        "videoId": 10502,
         "index": 33
     },
     {
         "id": 11801,
-        "needId": 10803,
         "quickId": 11302,
         "diamondPurchaseId": "11102|10203",
         "unsealedGunId": 11801,
+        "videoId": 10703,
         "index": 34
     },
     {
         "id": 10303,
-        "needId": 11202,
         "quickId": 10203,
         "diamondPurchaseId": "11801|11102",
         "unsealedGunId": 10303,
+        "videoId": 11302,
         "index": 35
     },
     {
         "id": 11002,
-        "needId": 10403,
         "quickId": 11102,
         "diamondPurchaseId": "10303|11801",
         "unsealedGunId": 11002,
+        "videoId": 10203,
         "index": 36
     },
     {
         "id": 10803,
-        "needId": 11402,
         "quickId": 11801,
         "diamondPurchaseId": "11002|10303",
         "unsealedGunId": 10803,
+        "videoId": 11102,
         "index": 37
     },
     {
         "id": 11202,
-        "needId": 11602,
         "quickId": 10303,
         "diamondPurchaseId": "10803|11002",
         "unsealedGunId": 11202,
+        "videoId": 11801,
         "index": 38
     },
     {
         "id": 10403,
-        "needId": 11901,
         "quickId": 11002,
         "diamondPurchaseId": "11202|10803",
         "unsealedGunId": 10403,
+        "videoId": 10303,
         "index": 39
     },
     {
         "id": 11402,
-        "needId": 10503,
         "quickId": 10803,
         "diamondPurchaseId": "10403|11202",
         "unsealedGunId": 11402,
+        "videoId": 11002,
         "index": 40
     },
     {
         "id": 11602,
-        "needId": 11003,
         "quickId": 11202,
         "diamondPurchaseId": "11402|10403",
         "unsealedGunId": 11602,
+        "videoId": 10803,
         "index": 41
     },
     {
         "id": 11901,
-        "needId": 11702,
         "quickId": 10403,
         "diamondPurchaseId": "11602|11402",
         "unsealedGunId": 11901,
+        "videoId": 11202,
         "index": 42
     },
     {
         "id": 10503,
-        "needId": 10903,
         "quickId": 11402,
         "diamondPurchaseId": "11901|11602",
         "unsealedGunId": 10503,
+        "videoId": 10403,
         "index": 43
     },
     {
         "id": 11003,
-        "needId": 11203,
         "quickId": 11602,
         "diamondPurchaseId": "10503|11901",
         "unsealedGunId": 11003,
+        "videoId": 11402,
         "index": 44
     },
     {
         "id": 11702,
-        "needId": 12001,
         "quickId": 11901,
         "diamondPurchaseId": "11003|10503",
         "unsealedGunId": 11702,
+        "videoId": 11602,
         "index": 45
     },
     {
         "id": 10903,
-        "needId": 11303,
         "quickId": 10503,
         "diamondPurchaseId": "11702|11003",
         "unsealedGunId": 10903,
+        "videoId": 11901,
         "index": 46
     },
     {
         "id": 11203,
-        "needId": 11103,
         "quickId": 11003,
         "diamondPurchaseId": "10903|11702",
         "unsealedGunId": 11203,
+        "videoId": 10503,
         "index": 47
     },
     {
         "id": 12001,
-        "needId": 11403,
         "quickId": 11702,
         "diamondPurchaseId": "11203|10903",
         "unsealedGunId": 12001,
+        "videoId": 11003,
         "index": 48
     },
     {
         "id": 11303,
-        "needId": 11503,
         "quickId": 10903,
         "diamondPurchaseId": "12001|11203",
         "unsealedGunId": 11303,
+        "videoId": 11702,
         "index": 49
     },
     {
         "id": 11103,
-        "needId": 11603,
         "quickId": 11203,
         "diamondPurchaseId": "11303|12001",
         "unsealedGunId": 11103,
+        "videoId": 10903,
         "index": 50
     },
     {
         "id": 11403,
-        "needId": 12002,
         "quickId": 12001,
         "diamondPurchaseId": "11103|11303",
         "unsealedGunId": 11403,
+        "videoId": 11203,
         "index": 51
     },
     {
         "id": 11503,
-        "needId": 11703,
         "quickId": 11303,
         "diamondPurchaseId": "11403|11103",
         "unsealedGunId": 11503,
+        "videoId": 12001,
         "index": 52
     },
     {
         "id": 11603,
-        "needId": 11902,
         "quickId": 11103,
         "diamondPurchaseId": "11503|11403",
         "unsealedGunId": 11603,
+        "videoId": 11303,
         "index": 53
     },
     {
         "id": 12002,
-        "needId": 11802,
         "quickId": 11403,
         "diamondPurchaseId": "11603|11503",
         "unsealedGunId": 12002,
+        "videoId": 11103,
         "index": 54
     },
     {
         "id": 11703,
-        "needId": 11903,
         "quickId": 11503,
         "diamondPurchaseId": "12002|11603",
         "unsealedGunId": 11703,
+        "videoId": 11403,
         "index": 55
     },
     {
         "id": 11902,
-        "needId": 11803,
         "quickId": 11603,
         "diamondPurchaseId": "11703|12002",
         "unsealedGunId": 11902,
+        "videoId": 11503,
         "index": 56
     },
     {
         "id": 11802,
-        "needId": 12003,
         "quickId": 12002,
         "diamondPurchaseId": "11902|11703",
         "unsealedGunId": 11802,
+        "videoId": 11603,
         "index": 57
     },
     {
         "id": 11903,
-        "needId": 12003,
         "quickId": 11703,
         "diamondPurchaseId": "11802|11902",
         "unsealedGunId": 11903,
+        "videoId": 12002,
         "index": 58
     },
     {
         "id": 11803,
-        "needId": 12003,
         "quickId": 11902,
         "diamondPurchaseId": "11903|11802",
         "unsealedGunId": 11803,
+        "videoId": 11703,
         "index": 59
     },
     {
         "id": 12003,
-        "needId": 12003,
         "quickId": 11802,
         "diamondPurchaseId": "11803|11903",
         "unsealedGunId": 12003,
+        "videoId": 11902,
         "index": 60
+    },
+    {
+        "videoId": 11802
+    },
+    {
+        "videoId": 11903
+    },
+    {
+        "videoId": 11803
+    },
+    {
+        "videoId": 12003
     }
 ]

+ 333 - 3
assets/resources/ui/components/ShopListItemRender.prefab

@@ -39,19 +39,22 @@
       },
       {
         "__id__": 57
+      },
+      {
+        "__id__": 71
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 71
+        "__id__": 81
       },
       {
-        "__id__": 72
+        "__id__": 82
       }
     ],
     "_prefab": {
-      "__id__": 73
+      "__id__": 83
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -2275,6 +2278,312 @@
       "serializable": false
     }
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "LockState",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [
+      {
+        "__id__": 72
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 77
+      },
+      {
+        "__id__": 78
+      },
+      {
+        "__id__": 79
+      }
+    ],
+    "_prefab": {
+      "__id__": 80
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 227.5,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 71
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 73
+      },
+      {
+        "__id__": 74
+      },
+      {
+        "__id__": 75
+      }
+    ],
+    "_prefab": {
+      "__id__": 76
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransformComponent",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 72
+    },
+    "_enabled": true,
+    "_priority": 0,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.LabelComponent",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 72
+    },
+    "_enabled": true,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 156,
+      "g": 156,
+      "b": 156,
+      "a": 255
+    },
+    "_sharedMaterial": null,
+    "_useOriginalSize": true,
+    "_string": "未解锁",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 30,
+    "_fontSize": 30,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_cacheMode": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.WidgetComponent",
+    "_name": "Label<WidgetComponent>",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 72
+    },
+    "_enabled": true,
+    "_alignFlags": 18,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "85chJ26XFNhY5qoTNiHIYX",
+    "sync": false,
+    "_synced": {
+      "default": false,
+      "serializable": false
+    }
+  },
+  {
+    "__type__": "cc.UITransformComponent",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 71
+    },
+    "_enabled": true,
+    "_priority": 0,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 271,
+      "height": 120
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.SpriteComponent",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 71
+    },
+    "_enabled": true,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_sharedMaterial": null,
+    "_spriteFrame": {
+      "__uuid__": "de2a68fd-64a1-43eb-bfb7-07e8100ada89@f9941"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.WidgetComponent",
+    "_name": "GlodBuyButton<WidgetComponent>",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 71
+    },
+    "_enabled": true,
+    "_alignFlags": 34,
+    "_target": null,
+    "_left": 0,
+    "_right": 12,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c2AA0zSkdENaq6lW/lctYd",
+    "sync": false,
+    "_synced": {
+      "default": false,
+      "serializable": false
+    }
+  },
   {
     "__type__": "cc.UITransformComponent",
     "_name": "",
@@ -2304,6 +2613,27 @@
       "__id__": 1
     },
     "_enabled": true,
+    "icon": {
+      "__id__": 14
+    },
+    "levelLabel": {
+      "__id__": 20
+    },
+    "nameLabel": {
+      "__id__": 27
+    },
+    "freeBuyButton": {
+      "__id__": 40
+    },
+    "diamondBuyButton": {
+      "__id__": 54
+    },
+    "GlodBuyButton": {
+      "__id__": 68
+    },
+    "lockState": {
+      "__id__": 71
+    },
     "_id": ""
   },
   {

+ 67 - 7
assets/scripts/games/ui/shops/ShopItemRenderScript.ts

@@ -1,14 +1,47 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Component, Node, profiler, SpriteComponent, LabelComponent, ButtonComponent, loader, SpriteFrame } from 'cc';
+import GameConfigManager from '../../models/GameConfigManager';
 const { ccclass, property } = _decorator;
 
 @ccclass('ShopItemRenderScript')
 export class ShopItemRenderScript extends Component {
-    /* class member could be defined like this */
-    // dummy = '';
+    
+    @property({
+        type:SpriteComponent
+    })
+    icon:SpriteComponent=null;
+
+    @property({
+        type:LabelComponent
+    })
+    levelLabel:LabelComponent=null;
+
+    @property({
+        type:LabelComponent
+    })
+    nameLabel:LabelComponent=null;
+
+    @property({
+        type:ButtonComponent
+    })
+    freeBuyButton:ButtonComponent=null;
+
+    @property({
+        type:ButtonComponent
+    })
+    diamondBuyButton:ButtonComponent=null;
+
+
+    @property({
+        type:ButtonComponent
+    })
+    GlodBuyButton:ButtonComponent=null;
+
+
+    @property({
+        type:Node
+    })
+    lockState:Node=null;
 
-    /* use `property` decorator if your want the member to be serializable */
-    // @property
-    // serializableDummy = 0;
     
     private data:any;
 
@@ -18,10 +51,37 @@ export class ShopItemRenderScript extends Component {
 
     UpdateItemRender(data:any):void{
         this.data=data;
+        this.RefreshItem();
     }
 
     private RefreshItem():void{
-
+        let weaponConfig:any=GameConfigManager.GetWeaponConfig(this.data.id);
+        //图标
+        loader.loadRes(weaponConfig.icon+"/spriteFrame",SpriteFrame,(err:Error,asset:SpriteFrame)=>{
+            this.icon.spriteFrame=asset;
+        })
+        //等级
+        this.levelLabel.string=weaponConfig.level;
+        //名称
+        this.nameLabel.string=weaponConfig.name;
+        //state 0 未解锁  1 已解锁
+        if(this.data.state==0){
+            this.freeBuyButton.node.active=this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
+            this.lockState.active=true;
+        }else{
+            this.lockState.active=false;
+            //buyType 购买方式 0金币购买  1宝石购买 2看广告购买
+            if(this.data.buyType==0){//金币购买
+                this.freeBuyButton.node.active=this.diamondBuyButton.node.active=false;
+                this.GlodBuyButton.node.active=true;
+            }else if(this.data.buyType==1){//宝石购买
+                this.freeBuyButton.node.active=this.GlodBuyButton.node.active=false;
+                this.diamondBuyButton.node.active=true;
+            }else{//广告购买
+                this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
+                this.freeBuyButton.node.active=true;
+            }
+        }
     }
 
     // update (deltaTime: number) {

+ 10 - 6
assets/scripts/games/ui/shops/ShopMediator.ts

@@ -108,17 +108,21 @@ export class ShopMediator extends GUIMediator {
                 id:element.id,
                 index:element.index
             }
-            //buyType 购买方式 0金币购买  1宝石购买
-            if(config.diamondPurchaseId==undefined||config.diamondPurchaseId.indexOf(element.id)<0){
+            //buyType 购买方式 0金币购买  1宝石购买 2 视频购买
+            if(config.diamondPurchaseId==undefined){
                 itemData.buyType=0;
-            }else{
+            }else if(config.diamondPurchaseId.indexOf(element.id)>=0){
                 itemData.buyType=1;
+            }else if(config.videoId==undefined){
+                itemData.buyType=0
+            }else if(config.videoId==element.id){
+                itemData.buyType=2;
             }
             //state 0 未解锁  1 已解锁
-            if(unlockLevel<0||weaponConfig.level>=unlockLevel){
-                itemData.state=1;
-            }else{
+            if(unlockLevel<0||weaponConfig.level<unlockLevel){
                 itemData.state=0;
+            }else{
+                itemData.state=1;
             }
             result.push(itemData);
         });