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AAC,SAAS,CAAC,CAAC;iBAChD;gBACD,cAAc;gBACd,MAAM,CAAC,OAAO,EAAE,CAAC;aAClB;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;aACvB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mDAAmD;IAC5C,mCAAW,GAAlB;QAAA,iBAkBC;QAjBC,IAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,MAAM,GAAQ;YAChB,OAAO,EAAE,UAAC,GAAG;gBACX,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;gBAC1C,IAAI,GAAG,EAAE;oBACP,KAAI,CAAC,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC;oBAC9B,IAAI,KAAI,CAAC,eAAe,EAAE;wBACxB,KAAI,CAAC,eAAe,CAAC,KAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;qBAChD;iBACF;YACH,CAAC;YACD,IAAI,EAAE;gBACJ,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YACnC,CAAC;YACD,QAAQ,EAAE,cAAO,CAAC;SACnB,CAAC;QACF,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IA5Hc,uBAAS,GAAkB,IAAI,CAAC;IA6HjD,oBAAC;CA9HD,AA8HC,IAAA;AA9HY,sCAAa","file":"","sourceRoot":"/","sourcesContent":["// wxAPI: https://developers.weixin.qq.com/minigame/dev/api/\n// import { _decorator, screen} from 'cc';\nconst { ccclass, property } = cc._decorator;\n\nexport class WechatManager {\n private static _instance: WechatManager = null; \n // 用户信息: 昵称,头像,语言等\n private _userInfo;\n // 头像回调\n private _avatarCallBack = null;\n\n static get instance() {\n if (this._instance) {\n return this._instance;\n }\n this._instance = new WechatManager();\n return this._instance;\n }\n\n // 获取标记权限\n public initAutoSetting(callBack) {\n this._avatarCallBack = callBack;\n // 避开ts语法检测\n // const wx = window['wx'];\n // 获取请求过的权限标记\n let object: any = {\n // 成功回调 \n success: (res) => {\n // 是否授权用户信息\n const autoSetting = res.authSetting;\n if (autoSetting[\"scope.userInfo\"]) {\n // 已授权\n this.getUserInfo();\n } else {\n // 未授权\n this.creatUserInfoButton();\n }\n },\n // 失败回调\n fail() {\n console.log(\"wx.getSetting获<67><E88EB7>
|