|
|
@@ -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;
|