Bläddra i källkod

点击福利礼包需要授权

kaka 5 år sedan
förälder
incheckning
285543507f
2 ändrade filer med 22 tillägg och 0 borttagningar
  1. 12 0
      assets/resources/game/prefab/game.prefab
  2. 10 0
      assets/script/game/component/BtnOpenPanel.ts

+ 12 - 0
assets/resources/game/prefab/game.prefab

@@ -860,6 +860,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redeem/RedeemNode",
+    "bool_Auth": true,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1115,6 +1116,7 @@
     },
     "_enabled": true,
     "panel_name": "module/turnable/turnable",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1373,6 +1375,7 @@
     },
     "_enabled": false,
     "panel_name": "module/invite/invite",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -1815,6 +1818,7 @@
     },
     "_enabled": true,
     "panel_name": "module/receiptNotice/receiptNotice",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2061,6 +2065,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCash/redBagCash",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2307,6 +2312,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCode/redBagCode",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 3,
     "onComplete": {
@@ -2723,6 +2729,7 @@
     },
     "_enabled": true,
     "panel_name": "module/pigBank/pigBank",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -2978,6 +2985,7 @@
     },
     "_enabled": true,
     "panel_name": "module/blessingBag/blessingBag",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -3233,6 +3241,7 @@
     },
     "_enabled": true,
     "panel_name": "module/sign/sign",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": {
@@ -4031,6 +4040,7 @@
     },
     "_enabled": true,
     "panel_name": "module/setting/setting",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],
@@ -4631,6 +4641,7 @@
     },
     "_enabled": true,
     "panel_name": "module/pigBank/pigBank",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],
@@ -5161,6 +5172,7 @@
     },
     "_enabled": true,
     "panel_name": "module/redBagCash/redBagCash",
+    "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
     "onComplete": [],

+ 10 - 0
assets/script/game/component/BtnOpenPanel.ts

@@ -1,5 +1,6 @@
 
 const { ccclass, property } = cc._decorator;
+import JsbSystem from '../../mk/system/JsbSystem';
 import { OpenActionType } from '../../mk/system/UISystem';
 /**
  * 打开指定名字的面板
@@ -10,6 +11,8 @@ export default class BtnOpenPanel extends cc.Component {
 
     @property({ displayName: '预制体路径', tooltip: '对应路径:resources/' })
     private panel_name = '';
+    @property({ displayName: '是否需要微信授权', tooltip: '授权勾选' })
+    private bool_Auth: boolean = false;
     @property({ displayName: '打开类型', tooltip: 'normal不操作,closeOther关闭其他,closeLast关闭上一个', type: cc.Enum(OpenActionType) })
     private open_type = OpenActionType.normal;
     @property({ displayName: '点击效果', tooltip: "仅支持 NONE 和 SCALE", type: cc.Enum(cc.Button.Transition) })
@@ -30,6 +33,13 @@ export default class BtnOpenPanel extends cc.Component {
 
     private async openPanel() {
         mk.audio.playEffect("button");
+        if (this.bool_Auth) {
+            if (!gData.loginData.isAuth) {
+                JsbSystem.WxAuth();
+                return;
+            }
+        }
+
         if (!this.panel_name) return;
         await mk.ui.openPanel(this.panel_name, this.open_type);
         const c_count = this.onComplete.length;