Просмотр исходного кода

新增 武将许愿接口 prayGeneral

zhengniehua 5 лет назад
Родитель
Сommit
aacd927d01

+ 58 - 58
tower_sanguo/assets/resources/module/drawRecruit/drawWish.prefab

@@ -528,16 +528,16 @@
         "__id__": 25
       },
       {
-        "__id__": 33
+        "__id__": 32
       },
       {
-        "__id__": 43
+        "__id__": 42
       },
       {
-        "__id__": 46
+        "__id__": 45
       },
       {
-        "__id__": 50
+        "__id__": 49
       },
       {
         "__id__": 58
@@ -997,7 +997,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 32
+      "__id__": 31
     },
     "_opacity": 255,
     "_color": {
@@ -1199,11 +1199,7 @@
     "_grayMaterial": null,
     "duration": 0.1,
     "zoomScale": 1.2,
-    "clickEvents": [
-      {
-        "__id__": 31
-      }
-    ],
+    "clickEvents": [],
     "_N$interactable": true,
     "_N$enableAutoGrayEffect": false,
     "_N$transition": 0,
@@ -1260,16 +1256,6 @@
     "_id": ""
   },
   {
-    "__type__": "cc.ClickEvent",
-    "target": {
-      "__id__": 1
-    },
-    "component": "",
-    "_componentId": "23952w10H9AVoJzYhG6B5M5",
-    "handler": "click_WishBtn",
-    "customEventData": ""
-  },
-  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -1289,20 +1275,20 @@
     },
     "_children": [
       {
-        "__id__": 34
+        "__id__": 33
       },
       {
-        "__id__": 37
+        "__id__": 36
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 41
+        "__id__": 40
       }
     ],
     "_prefab": {
-      "__id__": 42
+      "__id__": 41
     },
     "_opacity": 255,
     "_color": {
@@ -1356,17 +1342,17 @@
     "_name": "txt_name",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 33
+      "__id__": 32
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 35
+        "__id__": 34
       }
     ],
     "_prefab": {
-      "__id__": 36
+      "__id__": 35
     },
     "_opacity": 255,
     "_color": {
@@ -1420,7 +1406,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 34
+      "__id__": 33
     },
     "_enabled": true,
     "_materials": [
@@ -1465,20 +1451,20 @@
     "_name": "tip_rate",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 33
+      "__id__": 32
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 37
       },
       {
-        "__id__": 39
+        "__id__": 38
       }
     ],
     "_prefab": {
-      "__id__": 40
+      "__id__": 39
     },
     "_opacity": 255,
     "_color": {
@@ -1532,7 +1518,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 37
+      "__id__": 36
     },
     "_enabled": true,
     "_materials": [
@@ -1566,7 +1552,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 37
+      "__id__": 36
     },
     "_enabled": true,
     "_color": {
@@ -1600,7 +1586,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 33
+      "__id__": 32
     },
     "_enabled": true,
     "_layoutSize": {
@@ -1649,11 +1635,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 44
+        "__id__": 43
       }
     ],
     "_prefab": {
-      "__id__": 45
+      "__id__": 44
     },
     "_opacity": 255,
     "_color": {
@@ -1707,7 +1693,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 43
+      "__id__": 42
     },
     "_enabled": true,
     "_materials": [
@@ -1754,14 +1740,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 47
+        "__id__": 46
       },
       {
-        "__id__": 48
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 48
     },
     "_opacity": 255,
     "_color": {
@@ -1815,7 +1801,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 46
+      "__id__": 45
     },
     "_enabled": true,
     "_materials": [
@@ -1849,7 +1835,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 46
+      "__id__": 45
     },
     "_enabled": true,
     "_color": {
@@ -1887,16 +1873,16 @@
     },
     "_children": [
       {
-        "__id__": 51
+        "__id__": 50
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 55
+        "__id__": 54
       },
       {
-        "__id__": 56
+        "__id__": 55
       }
     ],
     "_prefab": {
@@ -1954,20 +1940,20 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 50
+      "__id__": 49
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 52
+        "__id__": 51
       },
       {
-        "__id__": 53
+        "__id__": 52
       }
     ],
     "_prefab": {
-      "__id__": 54
+      "__id__": 53
     },
     "_opacity": 255,
     "_color": {
@@ -2021,7 +2007,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 51
+      "__id__": 50
     },
     "_enabled": true,
     "_materials": [
@@ -2055,7 +2041,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 51
+      "__id__": 50
     },
     "_enabled": true,
     "_color": {
@@ -2084,7 +2070,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 50
+      "__id__": 49
     },
     "_enabled": true,
     "_materials": [
@@ -2116,14 +2102,18 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 50
+      "__id__": 49
     },
     "_enabled": true,
     "_normalMaterial": null,
     "_grayMaterial": null,
     "duration": 0.1,
     "zoomScale": 1.2,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 56
+      }
+    ],
     "_N$interactable": true,
     "_N$enableAutoGrayEffect": false,
     "_N$transition": 0,
@@ -2180,6 +2170,16 @@
     "_id": ""
   },
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "23952w10H9AVoJzYhG6B5M5",
+    "handler": "click_AdSureBtn",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -4509,13 +4509,13 @@
     "close_effect": 0,
     "close_toPoint": "",
     "img_wish": {
-      "__id__": 44
+      "__id__": 43
     },
     "txt_name": {
-      "__id__": 35
+      "__id__": 34
     },
     "txt_rate": {
-      "__id__": 47
+      "__id__": 46
     },
     "content": {
       "__id__": 60

Разница между файлами не показана из-за своего большого размера
+ 112 - 126
tower_sanguo/assets/scenes/Test_Znh.fire


+ 2 - 0
tower_sanguo/assets/scripts/module/drawRecruit/DrawResultUI.ts

@@ -6,4 +6,6 @@ const {ccclass, property} = cc._decorator;
 export default class DrawResultUI extends BaseUI {    
     protected static prefabUrl = "module/drawRecruit/drawResult";
     protected static className = "DrawResultUI";
+
+    
 }

+ 9 - 2
tower_sanguo/assets/scripts/module/drawRecruit/DrawWishUI.ts

@@ -58,13 +58,13 @@ export default class DrawWishUI extends BaseUI {
         for (let i = 0; i < tempGenerals.length; i++) {
             let grl = tempGenerals[i];
             console.log("Color: " + grl.color + " Star: " + grl.star + " Camp: " + grl.camp);
-            if (grl.status == 3) {
+            //if (grl.status == 3) {
                 let tempscr = cc.instantiate(this.wishItem.node).getComponent(WishItem);
                 tempscr.Init(grl);
                 tempscr.node.active = true;
                 this.content.addChild(tempscr.node);
                 this.wishItemMap.set(grl.id, tempscr);
-            }
+            //}
         }
 
         //心愿武将接口
@@ -96,6 +96,13 @@ export default class DrawWishUI extends BaseUI {
         console.log("you click wishui wish btn");
     }
 
+    click_AdSureBtn() {
+        console.log("GeneralBag: ",GameController.gameData.player.generals_bag);
+        GameController.http.prayGeneral((data) => {
+            console.log("-->Data: ", data);
+        }, { generalId: 112005 });
+    }
+
     onDestroy() {
         XXEvent.off("UpdateDrawWishState", this.updateDrawWishState, this);
     }

+ 19 - 4
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -24,7 +24,7 @@ export default class HttpCommand {
             this.serverUrl = 'https://xiyou-test.duiweize.com/';
         }
         this.serverUrl = 'http://172.16.15.97:9092/';//李扬
-        this.serverUrl = 'http://172.16.15.91:9092/';//悍国
+        //this.serverUrl = 'http://172.16.15.91:9092/';//悍国
     }
 
     httpM: any;
@@ -48,7 +48,7 @@ export default class HttpCommand {
     connectTest(callback) {
         GameController.commonData.ranKey = Utils.randomString()
         let data = {
-            "mac": "a5:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",
+            "mac": "a5:65:e2:1c:b0:25,f6:60:e4:1a:b7:27",
             "psk": GameController.commonData.ranKey,
             "appId": GameController.commonData.appid
         }
@@ -289,6 +289,18 @@ export default class HttpCommand {
         this.httpM.sendRequest(HTTPTYPE.addItem, 'POST', str, callback);
     }
 
+    //--------------------------ZNH------------------------
+
+    /** 武将许愿
+     * @param callback 回调
+    */
+    prayGeneral(callback,data) {
+        this.sendData(HTTPTYPE.prayGeneral, data, callback);
+    }
+
+
+    //--------------------------ZNH------------------------
+
     /**
      * 获取邀请人uin
      * @param sendReport 
@@ -397,6 +409,9 @@ export enum HTTPTYPE {
     reduceTimeInvestProject = 'invest/reduceTimeInvestProject',
 
     updateADLog = 'updateADLog',
+    // ZNH
+    /** 武将许愿*/
+    prayGeneral = 'general/prayGeneral',
 }
 
 
@@ -406,6 +421,6 @@ export interface UpdatePlayerProps {
     proptype: number,    //需要更新的属性
     propvalue: number,   //更新后的属性
 
-    propType:number,//服务器不根据文档改字段名字,仅用于发送给服务器
-    propValue:number,//服务器不根据文档改字段名字,仅用于发送给服务器
+    propType: number,//服务器不根据文档改字段名字,仅用于发送给服务器
+    propValue: number,//服务器不根据文档改字段名字,仅用于发送给服务器
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов