瀏覽代碼

bug修复

薛鸿潇 5 年之前
父節點
當前提交
3badd04a63

+ 13 - 84
assets/resources/module/setting/rule.prefab

@@ -30,14 +30,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 37
+        "__id__": 36
       },
       {
-        "__id__": 38
+        "__id__": 37
       }
     ],
     "_prefab": {
-      "__id__": 39
+      "__id__": 38
     },
     "_opacity": 255,
     "_color": {
@@ -733,14 +733,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 34
+        "__id__": 33
       },
       {
-        "__id__": 35
+        "__id__": 34
       }
     ],
     "_prefab": {
-      "__id__": 36
+      "__id__": 35
     },
     "_opacity": 255,
     "_color": {
@@ -1029,7 +1029,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 33
+      "__id__": 32
     },
     "_opacity": 255,
     "_color": {
@@ -1186,88 +1186,19 @@
     "sync": false
   },
   {
-    "__type__": "cc.Button",
+    "__type__": "cdc50kCRVVBa5gcp4XXxVO+",
     "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 27
     },
     "_enabled": true,
-    "_normalMaterial": null,
-    "_grayMaterial": null,
-    "duration": 0.1,
-    "zoomScale": 1.2,
-    "clickEvents": [
-      {
-        "__id__": 32
-      }
-    ],
-    "_N$interactable": true,
-    "_N$enableAutoGrayEffect": false,
-    "_N$transition": 3,
-    "transition": 3,
-    "_N$normalColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "_N$hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$disabledColor": {
-      "__type__": "cc.Color",
-      "r": 124,
-      "g": 124,
-      "b": 124,
-      "a": 255
-    },
-    "_N$normalSprite": null,
-    "_N$pressedSprite": null,
-    "pressedSprite": null,
-    "_N$hoverSprite": null,
-    "hoverSprite": null,
-    "_N$disabledSprite": null,
-    "_N$target": {
-      "__id__": 27
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.ClickEvent",
-    "target": {
+    "node_panel": {
       "__id__": 1
     },
-    "component": "",
-    "_componentId": "3785cT9t0BKM73CkHfOQdMj",
-    "handler": "close",
-    "customEventData": ""
+    "transition_type": 3,
+    "onComplete": [],
+    "_id": ""
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -1364,9 +1295,7 @@
     "lbl_content": {
       "__id__": 9
     },
-    "btn_close": {
-      "__id__": 31
-    },
+    "btn_close": null,
     "_id": ""
   },
   {

+ 10 - 123
assets/resources/module/setting/setting.prefab

@@ -2412,77 +2412,21 @@
     "_id": ""
   },
   {
-    "__type__": "cc.Button",
+    "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
     "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 61
     },
     "_enabled": true,
-    "_normalMaterial": null,
-    "_grayMaterial": null,
-    "duration": 0.1,
-    "zoomScale": 1.2,
-    "clickEvents": [
+    "panel_name": "module/setting/rule",
+    "open_type": 0,
+    "transition_type": 3,
+    "onComplete": [
       {
         "__id__": 64
       }
     ],
-    "_N$interactable": true,
-    "_N$enableAutoGrayEffect": false,
-    "_N$transition": 0,
-    "transition": 0,
-    "_N$normalColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "_N$hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$disabledColor": {
-      "__type__": "cc.Color",
-      "r": 124,
-      "g": 124,
-      "b": 124,
-      "a": 255
-    },
-    "_N$normalSprite": null,
-    "_N$pressedSprite": null,
-    "pressedSprite": null,
-    "_N$hoverSprite": null,
-    "hoverSprite": null,
-    "_N$disabledSprite": null,
-    "_N$target": {
-      "__id__": 61
-    },
     "_id": ""
   },
   {
@@ -2714,77 +2658,21 @@
     "_id": ""
   },
   {
-    "__type__": "cc.Button",
+    "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
     "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 69
     },
     "_enabled": true,
-    "_normalMaterial": null,
-    "_grayMaterial": null,
-    "duration": 0.1,
-    "zoomScale": 1.2,
-    "clickEvents": [
+    "panel_name": "module/setting/rule",
+    "open_type": 0,
+    "transition_type": 3,
+    "onComplete": [
       {
         "__id__": 72
       }
     ],
-    "_N$interactable": true,
-    "_N$enableAutoGrayEffect": false,
-    "_N$transition": 0,
-    "transition": 0,
-    "_N$normalColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "pressedColor": {
-      "__type__": "cc.Color",
-      "r": 211,
-      "g": 211,
-      "b": 211,
-      "a": 255
-    },
-    "_N$hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$disabledColor": {
-      "__type__": "cc.Color",
-      "r": 124,
-      "g": 124,
-      "b": 124,
-      "a": 255
-    },
-    "_N$normalSprite": null,
-    "_N$pressedSprite": null,
-    "pressedSprite": null,
-    "_N$hoverSprite": null,
-    "hoverSprite": null,
-    "_N$disabledSprite": null,
-    "_N$target": {
-      "__id__": 69
-    },
     "_id": ""
   },
   {
@@ -3089,7 +2977,6 @@
     "lbl_version": {
       "__id__": 78
     },
-    "node_rule": null,
     "_id": ""
   },
   {

+ 3 - 0
assets/script/game/data/GData.ts

@@ -20,6 +20,7 @@ import { RedBagCashData } from "./module/RedBagCashData";
 import RedCodeData from "./module/RedCodeData";
 import RedeemData from "./module/RedeemData";
 import { MoreGameData } from "./module/MoreGameData";
+import { SettingData } from "./module/SettingData";
 
 /**
  * 数据集合全局类
@@ -57,6 +58,7 @@ class GData {
     public redBagCash: RedBagCashData;
     /** 红包提现(常规提现) */
     public cashNormal: CashNormalData;
+    public setting: SettingData;
     /** 更多游戏 */
     public moreGame: MoreGameData;
     public blessingBag: BlessingBagData;
@@ -84,6 +86,7 @@ class GData {
         this.receiptNotice = new ReceiptNoticeData();
         this.redBagCash = new RedBagCashData();
         this.cashNormal = new CashNormalData();
+        this.setting = new SettingData();
         this.moreGame = new MoreGameData();
         this.blessingBag = new BlessingBagData();
         this.cashPro = new CashProData();

+ 1 - 1
assets/script/game/data/GameData.ts

@@ -56,7 +56,7 @@ export class GameData {
         data = {};
         response = await mk.http.sendData('user/adShowConfig', data);
         if (response.errcode != 0) {
-            return;
+            // return;
         }
         this.adShowConfig = response.data;
         mk.console.logSingle("user/adShowConfig", response.data);

+ 10 - 0
assets/script/game/data/module/SettingData.ts

@@ -4,5 +4,15 @@
  */
 
 export class SettingData {
+    public init_rule_tyle: boolean = null;
 
+    private _rule_type: number = 0;
+    /** 规则类型 */
+    set rule_type(value: number) {
+        this._rule_type = value;
+        this.init_rule_tyle = true;
+    }
+    get rule_type() {
+        return this._rule_type;
+    }
 }

+ 11 - 6
assets/script/game/module/setting/Rule.ts

@@ -17,12 +17,21 @@ export default class Rule extends cc.Component {
 
     }
 
+    update() {
+        if (gData.setting.init_rule_tyle) {
+            this.setContent(gData.setting.rule_type)
+        }
+    }
+
+    lateUpdate() {
+        gData.setting.init_rule_tyle = false;
+    }
     /**
      * 
      * @param type 0服务协议  1隐私协议
      */
-    public setContent(type: string = "0") {
-        let arr = type == "0" ? gData.loginData.rule_data : gData.loginData.privacy_data;
+    public setContent(type: number = 0) {
+        let arr = !type ? gData.loginData.rule_data : gData.loginData.privacy_data;
         let str = "";
         for (let i = 0; i < arr.length; i++) {
             str += arr[i] + "\n";
@@ -30,8 +39,4 @@ export default class Rule extends cc.Component {
         this.lbl_content.string = str;
         this.scrollView.scrollToTop();
     }
-
-    private close() {
-        this.node.active = false;
-    }
 }

+ 2 - 5
assets/script/game/module/setting/Setting.ts

@@ -66,11 +66,8 @@ export default class Setting extends cc.Component {
 
     }
 
-    async clickRule(e, data) {
-        if (!this.node_rule) this.node_rule = await mk.ui.openPanel('module/setting/rule');
-        let sc = this.node_rule.getComponent(Rule) as Rule;
-        sc.setContent(data);
-        this.node_rule.active = true;
+    async clickRule(data) {
+        gData.setting.rule_type = parseInt(data);
     }
 
     update() {