123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421 |
- "use strict";
- cc._RF.push(module, '3506bXX0nhILLUvzUl3W+m/', 'CommonConfig');
- // common-plugin/Scripts/CommonConfig.ts
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.OtherConfig = exports.FaceBookConfig = exports.BiliConfig = exports.XiaoMiConfig = exports.CocosConfig = exports.UCConfig = exports.QTTConfig = exports.DouyinConfig = exports.NativeIosConfig = exports.HagoConfig = exports.KwaiConfig = exports.WiFiConfig = exports.BaiduConfig = exports.NativeAndroidConfig = exports.HuaWeiConfig = exports.YzRedBagInfo = exports.VivoConfig = exports.OppoConfig = exports.QQConfig = exports.WechatConfig = exports.CustomAdInfo = exports.NativeBannerInfo = exports.BannerIdInfo = void 0;
- var YZ_Constant_1 = require("./YZ_Constant");
- var PlatUtils_1 = require("./PlatUtils");
- var Utils_1 = require("./Utils");
- var YZ_LocalStorage_1 = require("./YZ_LocalStorage");
- var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
- var BannerIdInfo = /** @class */ (function () {
- function BannerIdInfo() {
- this.location = YZ_Constant_1.BannerLocation.None;
- this.bannerId = "";
- }
- __decorate([
- property({ type: cc.Enum(YZ_Constant_1.BannerLocation), displayName: "广告条位置" })
- ], BannerIdInfo.prototype, "location", void 0);
- __decorate([
- property({ displayName: "广告条ID" })
- ], BannerIdInfo.prototype, "bannerId", void 0);
- BannerIdInfo = __decorate([
- ccclass("BannerIdInfo")
- ], BannerIdInfo);
- return BannerIdInfo;
- }());
- exports.BannerIdInfo = BannerIdInfo;
- ;
- var NativeBannerInfo = /** @class */ (function () {
- function NativeBannerInfo() {
- /**
- * 广告条的位置
- * 1:Home-首页
- * 2:Level-选关
- * 3:Skin-皮肤
- * 4:Game-游戏
- * 5:Pause-暂停
- * 6:Over-结算
- */
- this.location = YZ_Constant_1.BannerLocation.None;
- /**
- * 是否显示结算大banner
- */
- this.show_st_banner = "false";
- /**
- * 默认原生banner关闭按钮大小,默认为60
- */
- this.banner_close_but_size = 40;
- /**
- * 默认banner关闭按钮透明度 默认为120
- */
- this.banner_close_but_alpha = 120;
- /**
- * 默认banner关闭按钮高度 默认为220
- */
- this.banner_show_height = 160;
- /**
- * 默认banner关闭按钮点击区域默认为80
- */
- this.banner_close_but_range = 40;
- /**
- * 默认原生banner关闭按钮,是否显示。默认为显示:"true"
- */
- this.banner_close_but_show = "true";
- /**
- * 结算前banner整体缩放,默认为1
- */
- this.st_banner_scale = 1;
- /**
- * 结算前banner下载按钮的图片地址
- */
- this.st_banner_down_btn_image = "";
- /**
- * 结算前banner下载按钮显示类型,默认不配置,则不显示,配置后则显示,值为2:显示循环播放放大缩小效果,
- */
- this.st_banner_down_but_show = 0;
- /**
- * 结算前banner,下载按钮距离广告顶部间距,默认贴紧广告顶部值是-111
- */
- this.st_banner_down_but_margin_top = 0;
- /**
- * 结算前banner,关闭按钮点击区域大小
- */
- this.st_banner_close_but_range = 55;
- /**
- * 结算前banner,关闭按钮图片大小
- */
- this.st_banner_close_but_size = 55;
- /**
- * 结算前banner关闭按钮,是否显示。默认为显示:"true"
- */
- this.st_banner_close_but_show = "true";
- /**
- * 结算前banner距离底部的距离
- */
- this.st_banner_bottom = 0;
- /**
- * 结算前banner关闭按钮透明度
- * 0-255
- */
- this.st_banner_close_but_alpha = 255;
- /**
- * banner点击后是不是需要刷新数据
- */
- this.banner_click_refresh = "true";
- /**
- * 自动刷新时间,单位:秒,默认为:-1 不刷新
- */
- this.auto_refresh = -1;
- /**
- * 样式
- * -1 :默认、0:单图片缩放、1:单图片和自定义宽高、2:默认样式自定义宽高
- */
- this.st_banner_style = -1;
- /**
- * 结算banner样式-宽,默认:821 单位:像素
- */
- this.st_banner_width = -1;
- /**
- * 结算banner样式-高:默认:589 单位:像素
- */
- this.st_banner_height = -1;
- /**
- * 结算banner是否显示备用广告
- * 默认:1 显示,-1 为不显示
- */
- this.st_banner_show_back_up = 1;
- /**
- * 是否显示banner
- * 默认:1 显示, -1为不显示;
- */
- this.is_show_banner = 1;
- //显示互推banner
- this.is_show_rec = -1;
- //延迟显示时间
- this.delay_show_time = 0;
- //关闭按钮间隔多少次触发广告跳转
- this.banner_close_showAd_interval = 0;
- //普通原生Banner背景透明遮罩透明度 大于0则显示当前值的透明遮罩层
- this.bg_mask_opacity = 0;
- //结算原生banner背景透明遮罩透明度 大于0则显示当前值的透明遮罩层
- this.st_banner_bg_mask_opacity = 0;
- // 对齐方式:bottom top
- this._alignType = "bottom";
- }
- /**
- * 初始化
- * @param location 位置
- * @param info 配置
- */
- NativeBannerInfo.prototype.init = function (location, info) {
- this.location = location;
- this.banner_close_but_alpha = info.banner_close_but_alpha ? info.banner_close_but_alpha : this.banner_close_but_alpha;
- this.banner_close_but_range = info.banner_close_but_range ? info.banner_close_but_range : this.banner_close_but_range;
- this.banner_close_but_size = info.banner_close_but_size ? info.banner_close_but_size : this.banner_close_but_size;
- this.banner_show_height = info.banner_show_height ? info.banner_show_height : this.banner_show_height;
- this.banner_close_but_show = info.banner_close_but_show ? info.banner_close_but_show : this.banner_close_but_show;
- this.bg_mask_opacity = info.bg_mask_opacity ? info.bg_mask_opacity : this.bg_mask_opacity;
- this.st_banner_close_but_range = info.st_banner_close_but_range ? info.st_banner_close_but_range : this.st_banner_close_but_range;
- this.st_banner_close_but_size = info.st_banner_close_but_size ? info.st_banner_close_but_size : this.st_banner_close_but_size;
- this.st_banner_down_btn_image = info.st_banner_down_btn_image ? info.st_banner_down_btn_image : this.st_banner_down_btn_image;
- this.st_banner_down_but_margin_top = info.st_banner_down_but_margin_top ? info.st_banner_down_but_margin_top : this.st_banner_down_but_margin_top;
- this.st_banner_down_but_show = info.st_banner_down_but_show ? info.st_banner_down_but_show : this.st_banner_down_but_show;
- this.st_banner_scale = info.st_banner_scale ? info.st_banner_scale : this.st_banner_scale;
- this.show_st_banner = info.show_st_banner ? info.show_st_banner : this.show_st_banner;
- this.st_banner_close_but_show = info.st_banner_close_but_show ? info.st_banner_close_but_show : this.st_banner_close_but_show;
- this.st_banner_bottom = info.st_banner_bottom ? info.st_banner_bottom : this.st_banner_bottom;
- this.st_banner_close_but_alpha = info.st_banner_close_but_alpha ? info.st_banner_close_but_alpha : this.st_banner_close_but_alpha;
- this.banner_click_refresh = info.banner_click_refresh ? info.banner_click_refresh : this.banner_click_refresh;
- this.auto_refresh = info.auto_refresh ? info.auto_refresh : this.auto_refresh;
- this.st_banner_style = info.st_banner_style ? info.st_banner_style : this.st_banner_style;
- this.st_banner_width = info.st_banner_width ? info.st_banner_width : this.st_banner_width;
- this.st_banner_height = info.st_banner_height ? info.st_banner_height : this.st_banner_height;
- this.st_banner_show_back_up = info.st_banner_show_back_up ? info.st_banner_show_back_up : this.st_banner_show_back_up;
- this.is_show_banner = info.is_show_banner ? info.is_show_banner : this.is_show_banner;
- this.is_show_rec = info.is_show_rec ? info.is_show_rec : this.is_show_rec;
- this.delay_show_time = info.delay_show_time ? info.delay_show_time : this.delay_show_time;
- this.st_banner_bg_mask_opacity = info.st_banner_bg_mask_opacity ? info.st_banner_bg_mask_opacity : this.st_banner_bg_mask_opacity;
- this._alignType = info.align_type ? info.align_type : this._alignType;
- this.banner_close_showAd_interval = info.banner_close_showAd_interval ? info.banner_close_showAd_interval : this.banner_close_showAd_interval;
- };
- NativeBannerInfo.prototype.toStrong = function () {
- return "location=" + this.location + "&is_show_banner=" + this.is_show_banner + "&banner_close_but_show=" + this.banner_close_but_show + "&banner_close_but_alpha=" + this.banner_close_but_alpha + "&banner_close_but_range=" + this.banner_close_but_range + "&banner_close_but_size=" + this.banner_close_but_size + "&banner_show_height=" + this.banner_show_height + "&st_banner_close_but_range=" + this.st_banner_close_but_range + "&st_banner_close_but_size=" + this.st_banner_close_but_size + "&st_banner_down_btn_image=" + this.st_banner_down_btn_image + "&st_banner_down_but_margin_top=" + this.st_banner_down_but_margin_top + "&st_banner_down_but_show=" + this.st_banner_down_but_show + "&st_banner_scale=" + this.st_banner_scale + "&show_st_banner=" + this.show_st_banner + "&st_banner_close_but_show=" + this.st_banner_close_but_show + "&st_banner_bottom=" + this.st_banner_bottom + "&st_banner_close_but_alpha=" + this.st_banner_close_but_alpha + "&banner_click_refresh=" + this.banner_click_refresh + "&auto_refresh=" + this.auto_refresh + "&st_banner_style=" + this.st_banner_style + "&st_banner_width=" + this.st_banner_width + "&st_banner_height=" + this.st_banner_height + "&st_banner_show_back_up=" + this.st_banner_show_back_up + "&is_show_rec=" + this.is_show_rec;
- };
- NativeBannerInfo = __decorate([
- ccclass("NativeBannerInfo")
- ], NativeBannerInfo);
- return NativeBannerInfo;
- }());
- exports.NativeBannerInfo = NativeBannerInfo;
- var CustomAdInfo = /** @class */ (function () {
- function CustomAdInfo() {
- /**
- * 广告条的位置
- * 1:Home-首页
- * 2:Level-选关
- * 3:Skin-皮肤
- * 4:Game-游戏
- * 5:Pause-暂停
- * 6:Over-结算
- * 其中选项没有的话,可以自定义
- */
- this.location = YZ_Constant_1.BannerLocation.None;
- /**
- * 是否显示结算大banner
- */
- this.is_show_ad = "true";
- /**
- * 距离顶部的距离
- */
- this.top = -1;
- /**
- * 距离左边的距离
- */
- this.left = -1;
- /**
- * 距离右边的距离
- */
- this.right = -1;
- /**
- * 距离底部的距离
- */
- this.bottom = -1;
- /**
- * 广告ID
- */
- this.id = "";
- /**
- * 刷新时间
- */
- this.refresh_time = -1;
- /**
- * 广告宽度
- */
- this.width = 0;
- /**
- * 广告高度
- */
- this.height = 0;
- /**
- * 显示成功后是否隐藏banner
- */
- this.hide_banner = "false";
- /**
- * 是否居中显示
- * about:左右居中
- * updown:上下
- * all:上下和左右居中
- */
- this.is_center = "false";
- /**
- * 改变位置的时候是否刷新广告
- */
- this.change_location_refresh_ad = "true";
- //当前obj对象
- this.customAdObj = null;
- }
- /**
- * 初始化
- * @param location 位置
- * @param info 配置
- */
- CustomAdInfo.prototype.init = function (location, info) {
- this.location = location;
- this.top = "top" in info ? info.top : -1;
- this.right = "right" in info ? info.right : -1;
- this.left = "left" in info ? info.left : -1;
- this.bottom = "bottom" in info ? info.bottom : -1;
- this.id = "id" in info ? info.id : "";
- this.refresh_time = "refresh_time" in info ? info.refresh_time : -1;
- this.is_show_ad = "is_show_ad" in info ? info.is_show_ad : "true";
- this.width = "width" in info ? info.width : 0;
- this.height = "height" in info ? info.height : 0;
- this.hide_banner = "hide_banner" in info ? info.hide_banner : "false";
- this.change_location_refresh_ad = "change_location_refresh_ad" in info ? info.change_location_refresh_ad : "false";
- this.is_center = "is_center" in info ? info.is_center : "all";
- };
- CustomAdInfo.prototype.toStrong = function () {
- return "customAdInfo>>>>#location=" + this.location + "#top=" + this.top + "#left=" + this.left + "#right=" + this.right + "#bottom=" + this.bottom + "#refreshTime=" + this.refresh_time + "#id=" + this.id + "#width=" + this.width + "#height=" + this.height + "#is_center=" + this.is_center;
- };
- CustomAdInfo = __decorate([
- ccclass("CustomAdInfo")
- ], CustomAdInfo);
- return CustomAdInfo;
- }());
- exports.CustomAdInfo = CustomAdInfo;
- var WechatConfig = /** @class */ (function () {
- function WechatConfig() {
- this.appID = "";
- this.bannerIds = [];
- this.videoId = "";
- this.insertId = "";
- this.jumpId = "";
- this.appBoxId = "";
- this.boxId = "";
- this.bannerBoxId = "";
- this.customAdInfos = [];
- this.isAttributed = false;
- this.version = "";
- this.nativeBannerId = "";
- this.nativeInsertIds = "";
- }
- /**
- * 根据位置获取bannerId
- * @param location BannerLocation
- */
- WechatConfig.prototype.getBannerId = function (location) {
- for (var i = 0; i < this.bannerIds.length; i++) {
- if (this.bannerIds[i].location == location) {
- return this.bannerIds[i].bannerId;
- }
- }
- if (this.bannerIds.length > 0) {
- return this.bannerIds[0].bannerId;
- }
- return "";
- };
- /**
- * 设定原生模版配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- WechatConfig.prototype.setCustomAdInfo = function (location, custInfo) {
- var nativeCustomAd = new CustomAdInfo();
- nativeCustomAd.init(location, custInfo);
- this.customAdInfos.push(nativeCustomAd);
- };
- /**
- * 根据位置获取原生模版配置
- * @param location BannerLocation
- */
- WechatConfig.prototype.getCustomAdInfoInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生模版配置>>location=", location);
- for (var i = 0; i < this.customAdInfos.length; i++) {
- if (this.customAdInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生模版配置>>info=", this.customAdInfos[i].toStrong());
- return this.customAdInfos[i];
- }
- }
- return null;
- };
- /**
- * 设定bannerId
- * @param location BannerLocation
- * @param bannerId
- */
- WechatConfig.prototype.setBannerId = function (location, bannerId) {
- for (var i = 0; i < this.bannerIds.length; i++) {
- if (this.bannerIds[i].location == location) {
- this.bannerIds[i].bannerId = bannerId;
- return;
- }
- }
- };
- WechatConfig = __decorate([
- ccclass("WechatConfig")
- ], WechatConfig);
- return WechatConfig;
- }());
- exports.WechatConfig = WechatConfig;
- var QQConfig = /** @class */ (function () {
- function QQConfig() {
- this.QQ = true;
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.boxId = "";
- this.version = "";
- this.bannerBoxId = "";
- }
- QQConfig = __decorate([
- ccclass("QQConfig")
- ], QQConfig);
- return QQConfig;
- }());
- exports.QQConfig = QQConfig;
- var OppoConfig = /** @class */ (function () {
- function OppoConfig() {
- this.appID = "";
- this.channel = "oppo";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.nativeBannerIds = [];
- this.nativeTryGameIds = [];
- this.nativeInsertIds = [];
- this.nativeSingleAdIds = [];
- this.packageName = "";
- this.nativeBannerInfos = [];
- this.recGameBannerId = "";
- this.recPortalId = "";
- this.version = "";
- this.recGameDrawerId = "";
- this.umengId = ""; //友盟ID
- this.intersitialAdConfigs = []; //插屏ID配置
- this.bannerAdConfigs = []; //Banner配置
- }
- /**
- * 根据位置获取原生banner配置
- * @param location BannerLocation
- */
- OppoConfig.prototype.getNativeBannerInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
- for (var i = 0; i < this.nativeBannerInfos.length; i++) {
- if (this.nativeBannerInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
- return this.nativeBannerInfos[i];
- }
- }
- return new NativeBannerInfo();
- };
- /**
- * 设定原生banner配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- OppoConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
- var nativeBannerInfo = new NativeBannerInfo();
- nativeBannerInfo.init(location, bannerInfo);
- this.nativeBannerInfos.push(nativeBannerInfo);
- };
- OppoConfig = __decorate([
- ccclass("OppoConfig")
- ], OppoConfig);
- return OppoConfig;
- }());
- exports.OppoConfig = OppoConfig;
- var VivoConfig = /** @class */ (function () {
- function VivoConfig() {
- this.showAd = true;
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.nativeTryGameIds = [];
- this.nativeBannerIds = [];
- this.nativeInsertIds = [];
- this.nativeBannerInfos = [];
- this.customAdInfos = [];
- this.nativeSingleAdIds = [];
- this.recGameBannerId = "";
- this.recPortalId = "";
- this.version = "";
- this.umengId = ""; //友盟ID
- }
- /**
- * 根据位置获取原生banner配置
- * @param location BannerLocation
- */
- VivoConfig.prototype.getNativeBannerInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
- for (var i = 0; i < this.nativeBannerInfos.length; i++) {
- if (this.nativeBannerInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
- return this.nativeBannerInfos[i];
- }
- }
- return new NativeBannerInfo();
- };
- /**
- * 根据位置获取原生模版配置
- * @param location BannerLocation
- */
- VivoConfig.prototype.getCustomAdInfoInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生模版配置>>location=", location);
- for (var i = 0; i < this.customAdInfos.length; i++) {
- if (this.customAdInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生模版配置>>info=", this.customAdInfos[i].toStrong());
- return this.customAdInfos[i];
- }
- }
- return new CustomAdInfo();
- };
- /**
- * 设定原生banner配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- VivoConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
- var nativeBannerInfo = new NativeBannerInfo();
- nativeBannerInfo.init(location, bannerInfo);
- this.nativeBannerInfos.push(nativeBannerInfo);
- };
- /**
- * 设定原生模版配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- VivoConfig.prototype.setCustomAdInfo = function (location, custInfo) {
- var nativeCustomAd = new CustomAdInfo();
- nativeCustomAd.init(location, custInfo);
- this.customAdInfos.push(nativeCustomAd);
- };
- VivoConfig = __decorate([
- ccclass("VivoConfig")
- ], VivoConfig);
- return VivoConfig;
- }());
- exports.VivoConfig = VivoConfig;
- var YzRedBagInfo = /** @class */ (function () {
- function YzRedBagInfo() {
- this._progress = 0; //当前进度
- this._totalProgress = 5; //总进度
- this._balance = 0.00; //余额
- this._totalMoeny = 0;
- this._lastOpenFreeRedBagTime = "";
- this._progressInfos = null;
- this._lastOpenLevel = "-1";
- this._freeRedBagCount = 0; //现金红包次数
- this.withdrawaMoneys = [5, 20, 45, 50];
- if (PlatUtils_1.default.IsTest) {
- this._progressInfos = [
- {
- level: 0,
- min_money: 0.1,
- max_money: 5,
- type: 1
- },
- {
- level: 4,
- min_money: 0.1,
- max_money: 3,
- type: 3
- },
- {
- level: 5,
- min_money: 0.001,
- max_money: 0.005,
- type: 2
- }
- ];
- }
- this._progress = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_PROGRESS) ? YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_PROGRESS) : 0;
- this._totalProgress = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_PROGRESS) ? YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_PROGRESS) : 5;
- this._balance = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_BALANCE) ? parseFloat(YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_BALANCE)) : 0.00;
- this._totalMoeny = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_MONEY) ? parseFloat(YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_MONEY)) : 0.00;
- this._lastOpenFreeRedBagTime = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_FREE_RED_BAG_TIME) ? YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_FREE_RED_BAG_TIME) : "";
- this._lastOpenLevel = YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_LAST_OPEN_LEVEL) ? YZ_LocalStorage_1.default.getItem(YZ_Constant_1.default.ST_LAST_OPEN_LEVEL) : "-1";
- }
- Object.defineProperty(YzRedBagInfo.prototype, "freeRedBagCount", {
- get: function () {
- return this._freeRedBagCount;
- },
- set: function (value) {
- this._freeRedBagCount = value;
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "lastOpenLevel", {
- get: function () {
- return this._lastOpenLevel;
- },
- set: function (value) {
- this._lastOpenLevel = value;
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_LAST_OPEN_LEVEL, value);
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "progress", {
- get: function () {
- return this._progress;
- },
- set: function (value) {
- this._progress = value;
- if (this._progress > this._totalProgress) {
- this._progress = this._totalProgress;
- }
- else {
- Utils_1.utils._rewardRedBagPanelShowCount = -1;
- }
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_PROGRESS, this._progress + '');
- cc.game.emit("YZ_RED_BAG_PROGRESS_CHANGE");
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "totalProgress", {
- get: function () {
- return this._totalProgress;
- },
- set: function (value) {
- this._totalProgress = value;
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_PROGRESS, value + '');
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "totalMoney", {
- get: function () {
- return this._totalMoeny;
- },
- set: function (value) {
- this._totalMoeny = value;
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_MONEY, value + '');
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "progressInfos", {
- get: function () {
- return this._progressInfos;
- },
- set: function (values) {
- this._progressInfos = values;
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "curProgressInfo", {
- get: function () {
- if (this._progressInfos && this._progressInfos.length > 0) {
- if (parseInt(this.lastOpenLevel) > 0 && parseInt(this.lastOpenLevel) >= Utils_1.utils.currentLevel) {
- return this._progressInfos[this._progressInfos.length - 1];
- }
- var temp = this.lastOpenLevel ? this._progressInfos[0] : this._progressInfos[1];
- for (var i = 0; i < this._progressInfos.length; i++) {
- //@ts-ignore
- if (Utils_1.utils.currentLevel <= this._progressInfos[i].level) {
- temp = this._progressInfos[i];
- break;
- }
- }
- console.log("curInfo " + JSON.stringify(temp));
- return temp;
- }
- return null;
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "balance", {
- get: function () {
- return this._balance;
- },
- set: function (value) {
- this._balance = value;
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_BALANCE, value + '');
- cc.game.emit("YZ_RED_BAG_BALANCE_CHANGE");
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "lastOpenFreeRedBagTime", {
- get: function () {
- return this._lastOpenFreeRedBagTime;
- },
- set: function (value) {
- this._lastOpenFreeRedBagTime = value;
- YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_FREE_RED_BAG_TIME, value + '');
- },
- enumerable: false,
- configurable: true
- });
- Object.defineProperty(YzRedBagInfo.prototype, "isFreeRedBag", {
- /**
- * 今天是否有免费的红包
- */
- get: function () {
- cc.log("是否有免费红包:" + new Date().toDateString() != this._lastOpenFreeRedBagTime);
- return new Date().toDateString() != this._lastOpenFreeRedBagTime;
- },
- enumerable: false,
- configurable: true
- });
- YzRedBagInfo = __decorate([
- ccclass("YzRedBagInfo")
- ], YzRedBagInfo);
- return YzRedBagInfo;
- }());
- exports.YzRedBagInfo = YzRedBagInfo;
- var HuaWeiConfig = /** @class */ (function () {
- function HuaWeiConfig() {
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.nativeSplashId = "";
- this.nativeTryGameIds = [];
- this.nativeBannerIds = [];
- this.nativeInsertIds = [];
- this.nativeBannerInfos = [];
- this.version = "";
- this.umengId = "";
- }
- /**
- * 根据位置获取原生banner配置
- * @param location BannerLocation
- */
- HuaWeiConfig.prototype.getNativeBannerInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
- for (var i = 0; i < this.nativeBannerInfos.length; i++) {
- if (this.nativeBannerInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
- return this.nativeBannerInfos[i];
- }
- }
- return new NativeBannerInfo();
- };
- /**
- * 设定原生banner配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- HuaWeiConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
- var nativeBannerInfo = new NativeBannerInfo();
- nativeBannerInfo.init(location, bannerInfo);
- this.nativeBannerInfos.push(nativeBannerInfo);
- };
- HuaWeiConfig = __decorate([
- ccclass("HuaWeiConfig")
- ], HuaWeiConfig);
- return HuaWeiConfig;
- }());
- exports.HuaWeiConfig = HuaWeiConfig;
- var NativeAndroidConfig = /** @class */ (function () {
- function NativeAndroidConfig() {
- this.appID = "";
- this.channel = "";
- this.version = "";
- }
- NativeAndroidConfig = __decorate([
- ccclass("NativeAndroidConfig")
- ], NativeAndroidConfig);
- return NativeAndroidConfig;
- }());
- exports.NativeAndroidConfig = NativeAndroidConfig;
- var BaiduConfig = /** @class */ (function () {
- function BaiduConfig() {
- this.appID = "";
- this.appSID = "";
- this.bannerId = "";
- this.videoId = "";
- this.version = "";
- }
- BaiduConfig = __decorate([
- ccclass("BaiduConfig")
- ], BaiduConfig);
- return BaiduConfig;
- }());
- exports.BaiduConfig = BaiduConfig;
- var WiFiConfig = /** @class */ (function () {
- function WiFiConfig() {
- this.appID = "";
- this.bannerId = "";
- this.videoId = "";
- this.version = "";
- }
- WiFiConfig = __decorate([
- ccclass("WiFiConfig")
- ], WiFiConfig);
- return WiFiConfig;
- }());
- exports.WiFiConfig = WiFiConfig;
- var KwaiConfig = /** @class */ (function () {
- function KwaiConfig() {
- this.appID = "";
- this.videoId = "";
- this.insertId = "";
- this.version = "";
- }
- KwaiConfig = __decorate([
- ccclass("KwaiConfig")
- ], KwaiConfig);
- return KwaiConfig;
- }());
- exports.KwaiConfig = KwaiConfig;
- var HagoConfig = /** @class */ (function () {
- function HagoConfig() {
- this.appID = "";
- this.videoId = "";
- this.version = "";
- }
- HagoConfig = __decorate([
- ccclass("HagoConfig")
- ], HagoConfig);
- return HagoConfig;
- }());
- exports.HagoConfig = HagoConfig;
- var NativeIosConfig = /** @class */ (function () {
- function NativeIosConfig() {
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.version = "";
- }
- NativeIosConfig = __decorate([
- ccclass("NativeIosConfig")
- ], NativeIosConfig);
- return NativeIosConfig;
- }());
- exports.NativeIosConfig = NativeIosConfig;
- var DouyinConfig = /** @class */ (function () {
- function DouyinConfig() {
- this.Douyin = true;
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.version = "";
- }
- DouyinConfig = __decorate([
- ccclass("DouyinConfig")
- ], DouyinConfig);
- return DouyinConfig;
- }());
- exports.DouyinConfig = DouyinConfig;
- var QTTConfig = /** @class */ (function () {
- function QTTConfig() {
- this.QuTouTiao = true;
- this.showAd = true;
- this.gamename = "";
- this.appID = "";
- this.appKey = "";
- }
- QTTConfig = __decorate([
- ccclass("QuTouTiaoConfig")
- ], QTTConfig);
- return QTTConfig;
- }());
- exports.QTTConfig = QTTConfig;
- var UCConfig = /** @class */ (function () {
- function UCConfig() {
- this.appID = "";
- this.appKey = "";
- this.version = "";
- }
- UCConfig = __decorate([
- ccclass("UCConfig")
- ], UCConfig);
- return UCConfig;
- }());
- exports.UCConfig = UCConfig;
- var CocosConfig = /** @class */ (function () {
- function CocosConfig() {
- this.appID = "";
- this.appKey = "";
- this.appSecret = "";
- this.bannerId = "";
- this.videoId = "";
- this.insertId = "";
- }
- CocosConfig = __decorate([
- ccclass("CocosConfig")
- ], CocosConfig);
- return CocosConfig;
- }());
- exports.CocosConfig = CocosConfig;
- var XiaoMiConfig = /** @class */ (function () {
- function XiaoMiConfig() {
- this.appID = "";
- this.bannerId = "";
- this.videoId = "";
- this.insertId = "";
- this.nativeSplashId = "";
- this.nativeTryGameIds = [];
- this.nativeBannerIds = [];
- this.nativeInsertIds = [];
- this.nativeBannerInfos = [];
- this.version = "";
- }
- /**
- * 根据位置获取原生banner配置
- * @param location BannerLocation
- */
- XiaoMiConfig.prototype.getNativeBannerInfo = function (location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
- for (var i = 0; i < this.nativeBannerInfos.length; i++) {
- if (this.nativeBannerInfos[i].location == location) {
- Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
- return this.nativeBannerInfos[i];
- }
- }
- return new NativeBannerInfo();
- };
- /**
- * 设定原生banner配置
- * @param location 位置
- * @param bannerInfo 配置
- */
- XiaoMiConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
- var nativeBannerInfo = new NativeBannerInfo();
- nativeBannerInfo.init(location, bannerInfo);
- this.nativeBannerInfos.push(nativeBannerInfo);
- };
- XiaoMiConfig = __decorate([
- ccclass("XiaoMiConfig")
- ], XiaoMiConfig);
- return XiaoMiConfig;
- }());
- exports.XiaoMiConfig = XiaoMiConfig;
- var BiliConfig = /** @class */ (function () {
- function BiliConfig() {
- this.appID = "";
- this.bannerId = "";
- this.videoId = "";
- }
- BiliConfig = __decorate([
- ccclass("BiliConfig")
- ], BiliConfig);
- return BiliConfig;
- }());
- exports.BiliConfig = BiliConfig;
- var FaceBookConfig = /** @class */ (function () {
- function FaceBookConfig() {
- this.appID = "";
- this.bannerId = "";
- this.insertId = "";
- this.videoId = "";
- this.version = "";
- }
- FaceBookConfig = __decorate([
- ccclass("FaceBookConfig")
- ], FaceBookConfig);
- return FaceBookConfig;
- }());
- exports.FaceBookConfig = FaceBookConfig;
- var OtherConfig = /** @class */ (function () {
- function OtherConfig() {
- this.shareTitle = "";
- this.shareImgUrl = "";
- this.shareIcon = "";
- this.shareDesc = "";
- this.localConfig = null;
- this.logoutView = null;
- this.nativeBanner = null;
- this.nativeInsert = null;
- this.nativeSplashView = null;
- this.recommendGamesBanner = null;
- this.recommendGamesBar = null;
- this.tryGamesWidget = null;
- this.moreGamesWidget = null;
- this.recordWidget = null;
- this.shortcutWidget = null;
- // @property({ type: cc.Prefab, tooltip: "游戏盒子,将Common/Prefabs/GameBox拖到此处 " })
- this.gameBox = null;
- this.crossWidget6 = null;
- // @property({ type: cc.Prefab, tooltip: "激励插屏推广组件,将Common/Prefabs/RewardInsert拖到此处" })
- this.rewardInsert = null;
- this.statementRecomment = null;
- this.singleNativeAd = null;
- this.shareRecordPanel = null;
- // @property({ type: cc.Prefab, tooltip: "原生退出游戏弹窗,将Common/Prefabs/GameExitDialog拖到此处" })
- this.gameExitDialog = null;
- this.rewardBoxPanel = null;
- this.rewardTurnTablePanel = null;
- this.rewardShortCutPanel = null;
- this.nativeTryGameWidget = null;
- this.beforGameOverRecGamesPanel = null;
- // @property({ type: cc.Prefab, tooltip: "红包提现框,将Common/Prefabs/WithdrawalWidget拖到此处", displayName: "红包提现框挂件" })
- this.withdrawalWidget = null;
- // @property({ type: cc.Prefab, tooltip: "红包提现弹窗,将Common/Prefabs/WithdrawalPanel拖到此处", displayName: "红包提现弹窗" })
- this.withdrawalPanel = null;
- // @property({ type: cc.Prefab, tooltip: "红包进度挂件,将Common/Prefabs/RedBagProgressWidget拖到此处", displayName: "红包进度挂件" })
- this.redBagProgressWidget = null;
- // @property({ type: cc.Prefab, tooltip: "拆红包弹窗,将Common/Prefabs/OpenRedBagPanel拖到此处", displayName: "拆红包弹窗" })
- this.openRedBagPanel = null;
- // @property({ type: cc.Prefab, tooltip: "恭喜获得红包弹窗,将Common/Prefabs/RewardRedBagPanel拖到此处", displayName: "恭喜获得红包弹窗" })
- this.rewardRedBagPanel = null;
- this.rewardLuckBoxPanel = null;
- this.verticalRecommentPanel = null;
- this.privacyWidget = null;
- this.privacyPanel = null;
- this.handPrefab = null;
- this.yzRealNameAuthPanel = null;
- this.yzCustomAdPanel = null;
- this.yzLoginPanel = null;
- //游玩统计SDK:ID
- this.yw_app_id = "";
- }
- __decorate([
- property({ type: cc.JsonAsset, displayName: "本地配置文件", tooltip: "将Common/Config/下面的配置文件拖放到此处" })
- ], OtherConfig.prototype, "localConfig", void 0);
- __decorate([
- property({ type: cc.Prefab, displayName: "日志输出组件", tooltip: "将Common/Prefabs/LogoutView拖放到此处" })
- ], OtherConfig.prototype, "logoutView", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "原生广告条组件,将Common/Prefabs/NativeBanner拖到此处", displayName: "原生广告条组件" })
- ], OtherConfig.prototype, "nativeBanner", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "原生插屏组件,将Common/Prefabs/NativeInsert拖到此处", displayName: "原生插屏组件" })
- ], OtherConfig.prototype, "nativeInsert", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "原生插屏组件,将Common/Prefabs/nativeSplashView拖到此处", displayName: "原生开屏组件" })
- ], OtherConfig.prototype, "nativeSplashView", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "底部推荐游戏广告Banner, 将Common/Prefabs/RecommendGamesBanner拖到此处" })
- ], OtherConfig.prototype, "recommendGamesBanner", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "推荐游戏横条,将Common/Prefabs/RecommendGamesBar拖到此处" })
- ], OtherConfig.prototype, "recommendGamesBar", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "推荐游戏圆形挂件,将Common/Prefabs/TryGamesWidget拖到此处" })
- ], OtherConfig.prototype, "tryGamesWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "侧边更多游戏面板挂件,将Common/Prefabs/MoreGamesWidget拖到此处" })
- ], OtherConfig.prototype, "moreGamesWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "录屏按钮组件,将Common/Prefabs/RecordWidget拖到此处" })
- ], OtherConfig.prototype, "recordWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "快捷方式按钮,将Common/Prefabs/ShortcutWidget拖到此处 " })
- ], OtherConfig.prototype, "shortcutWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "6元素交叉推广组件,将Common/Prefabs/CrossWidget6拖到此处" })
- ], OtherConfig.prototype, "crossWidget6", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "结算页面推广组件,将Common/Prefabs/StatementRecomment拖到此处" })
- ], OtherConfig.prototype, "statementRecomment", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "单个原生广告,将Common/Prefabs/SingleNativeAd拖到此处" })
- ], OtherConfig.prototype, "singleNativeAd", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "分享录屏弹窗,将Common/Prefabs/ShareRecordPanel拖到此处" })
- ], OtherConfig.prototype, "shareRecordPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "五倍奖励宝箱弹窗,将Common/Prefabs/RewardBoxPanel拖到此处" })
- ], OtherConfig.prototype, "rewardBoxPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "奖励转盘抽奖弹窗,将Common/Prefabs/RewardTurntablePanel拖到此处" })
- ], OtherConfig.prototype, "rewardTurnTablePanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "添加桌面激励弹窗,将Common/Prefabs/RewardShortCutPanel拖到此处" })
- ], OtherConfig.prototype, "rewardShortCutPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "原生抖动试玩,将Common/Prefabs/NativeTryGameWidget拖到此处", displayName: "原生抖动组件" })
- ], OtherConfig.prototype, "nativeTryGameWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "结算前互推面板,将Common/Prefabs/BeforGameOverRecGamesPanel拖到此处", displayName: "结算前互推面板" })
- ], OtherConfig.prototype, "beforGameOverRecGamesPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "幸运宝箱弹窗,将Common/Prefabs/RewardLuckBoxPanel拖到此处", displayName: "幸运宝箱弹窗" })
- ], OtherConfig.prototype, "rewardLuckBoxPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "竖状互推窗口,将Common/Prefabs/VerticalRecommentPanel拖到此处", displayName: "竖状互推窗口" })
- ], OtherConfig.prototype, "verticalRecommentPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "隐私协议挂件,将Common/Prefabs/PrivacyWidget拖到此处", displayName: "隐私协议挂件" })
- ], OtherConfig.prototype, "privacyWidget", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "隐私协议弹窗,将Common/Prefabs/PrivacyPanel拖到此处", displayName: "隐私协议弹窗" })
- ], OtherConfig.prototype, "privacyPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "指引的手势,将Common/Prefabs/HandPrefab拖到此处", displayName: "指引的手势" })
- ], OtherConfig.prototype, "handPrefab", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "实名制认证弹窗,将Common/Prefabs/YzRealNameAuthPanel拖到此处", displayName: "实名制认证弹窗" })
- ], OtherConfig.prototype, "yzRealNameAuthPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "模版广告推荐弹窗,将Common/Prefabs/YzCustomAdPanel拖到此处", displayName: "模版广告推荐弹窗" })
- ], OtherConfig.prototype, "yzCustomAdPanel", void 0);
- __decorate([
- property({ type: cc.Prefab, tooltip: "登录弹窗,将Common/Prefabs/YzLoginPanel拖到此处", displayName: "登录弹窗" })
- ], OtherConfig.prototype, "yzLoginPanel", void 0);
- OtherConfig = __decorate([
- ccclass("OtherConfig")
- ], OtherConfig);
- return OtherConfig;
- }());
- exports.OtherConfig = OtherConfig;
- var CommonConfig = /** @class */ (function () {
- function CommonConfig() {
- this.wechatconfig = new WechatConfig();
- this.oppoconfig = new OppoConfig();
- this.vivoconfig = new VivoConfig();
- this.nativeAndroidConfig = new NativeAndroidConfig();
- this.baiduconfig = new BaiduConfig();
- this.douyinconfig = new DouyinConfig();
- this.wifiConfig = new WiFiConfig();
- this.qqconfig = new QQConfig();
- this.qttconfig = new QTTConfig();
- this.xiaomiConfig = new XiaoMiConfig();
- this.ucConfig = new UCConfig();
- this.cocosConfig = new CocosConfig();
- this.biliConfig = new BiliConfig();
- this.kwaiConfig = new KwaiConfig();
- this.nativeIoSConfig = new NativeIosConfig();
- this.hagoConfig = new HagoConfig();
- this.huaweiConfig = new HuaWeiConfig();
- this.faceBookConfig = new FaceBookConfig();
- this.otherconfig = new OtherConfig();
- }
- CommonConfig.prototype.init = function (data) {
- this._init_other(data);
- if (PlatUtils_1.default.IsWechat) {
- return this._init_wechat(data);
- }
- else if (PlatUtils_1.default.IsOPPO) {
- return this._init_oppo(data);
- }
- else if (PlatUtils_1.default.IsVIVO) {
- return this._init_vivo(data);
- }
- else if (PlatUtils_1.default.IsDouyin) {
- return this._init_douyin(data);
- }
- else if (PlatUtils_1.default.IsQQ) {
- return this._init_qq(data);
- }
- else if (PlatUtils_1.default.IsBaidu) {
- return this._init_baidu(data);
- }
- else if (PlatUtils_1.default.IsQTT) {
- return this._init_qtt(data);
- }
- else if (PlatUtils_1.default.IsXiaoMi) {
- return this._init_xiaomi(data);
- }
- else if (PlatUtils_1.default.ISUC) {
- return this._init_uc(data);
- }
- else if (PlatUtils_1.default.ISCocos) {
- return this._init_cocos(data);
- }
- else if (PlatUtils_1.default.IsNativeAndroid) {
- return this._init_native_android();
- ;
- }
- else if (PlatUtils_1.default.IsNativeIOS) {
- return this._init_native_ios(data);
- ;
- }
- else if (PlatUtils_1.default.IsBili) {
- return this._init_bili(data);
- ;
- }
- else if (PlatUtils_1.default.IsKwai) {
- return this._init_kwai(data);
- ;
- }
- else if (PlatUtils_1.default.IsWiFi) {
- return this._init_wifi(data);
- ;
- }
- else if (PlatUtils_1.default.IsHago) {
- return this._init_hago(data);
- ;
- }
- else if (PlatUtils_1.default.IsHuaWei) {
- return this._init_huawei(data);
- ;
- }
- else if (PlatUtils_1.default.IsFaceBook) {
- return this._init_facebook(data);
- ;
- }
- else {
- return true;
- }
- };
- CommonConfig.prototype._init_other = function (data) {
- if (!data)
- return false;
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.other) {
- if (configObj.other.yw_app_id) {
- this.otherconfig.yw_app_id = configObj.other.yw_app_id;
- }
- else {
- Utils_1.utils.showLog("warn:" + "本地配置数据不包含‘yw_app_id’字段!");
- }
- }
- }
- };
- CommonConfig.prototype._init_wechat = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.wechat) {
- if (configObj.wechat.app_id) {
- this.wechatconfig.appID = configObj.wechat.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.wechat.intersititia_pos_id) {
- this.wechatconfig.insertId = configObj.wechat.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.wechat.video_pos_id) {
- this.wechatconfig.videoId = configObj.wechat.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.wechat.app_box_pos_id) {
- this.wechatconfig.appBoxId = configObj.wechat.app_box_pos_id;
- }
- else {
- Utils_1.utils.showLog("本地配置数据不包含‘app_box_pos_id’字段!");
- // return false;
- }
- if (configObj.wechat.version) {
- this.wechatconfig.version = configObj.wechat.version;
- }
- else {
- Utils_1.utils.showLog("本地配置数据不包含‘version’字段!");
- }
- if (configObj.wechat.is_attributed) {
- this.wechatconfig.isAttributed = configObj.wechat.is_attributed;
- }
- if (configObj.wechat.banner_pos_id) {
- for (var key in configObj.wechat.banner_pos_id) {
- var bannerInfo = new BannerIdInfo();
- bannerInfo.location = this._bannerLocationStringToEnum(key);
- bannerInfo.bannerId = configObj.wechat.banner_pos_id[key];
- this.wechatconfig.bannerIds.push(bannerInfo);
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.wechat.shares) {
- if (configObj.wechat.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.wechat.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
- return false;
- }
- if (configObj.wechat.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.wechat.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- if (configObj.wechat.banner_box_pos_id) {
- this.wechatconfig.bannerBoxId = configObj.wechat.banner_box_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置中不包含 ‘banner_box_pos_id’ 字段");
- }
- if (configObj.wechat.native_banner_pos_id) {
- this.wechatconfig.nativeBannerId = configObj.wechat.native_banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置中不包含 native_banner_pos_id 字段");
- }
- if (configObj.wechat.native_intersititial_pos_id) {
- this.wechatconfig.nativeInsertIds = configObj.wechat.native_intersititial_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置中不包含 native_intersititial_pos_id 字段");
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘wechat’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_oppo = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.oppo) {
- if (configObj.oppo.app_id) {
- this.oppoconfig.appID = configObj.oppo.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.oppo.package_name) {
- this.oppoconfig.packageName = configObj.oppo.package_name;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘package_name’字段!");
- return false;
- }
- if (configObj.oppo.banner_pos_id) {
- this.oppoconfig.bannerId = configObj.oppo.banner_pos_id;
- }
- // else {
- // utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- // return false;
- // }
- if (configObj.oppo.rec_game_drawer_id) {
- this.oppoconfig.recGameDrawerId = configObj.oppo.rec_game_drawer_id;
- }
- else {
- Utils_1.utils.showLog("error" + "rec_game_drawer_id");
- }
- // if (configObj.oppo.intersititia_pos_id) {
- // this.oppoconfig.insertId = configObj.oppo.intersititia_pos_id;
- // } else {
- // utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- // // return false;
- // }
- if (configObj.oppo.video_pos_id) {
- this.oppoconfig.videoId = configObj.oppo.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.oppo.native_banner_pos_id) {
- this.oppoconfig.nativeBannerIds = configObj.oppo.native_banner_pos_id;
- }
- // else {
- // utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
- // return false;
- // }
- if (configObj.oppo.native_trygame_pos_id) {
- this.oppoconfig.nativeTryGameIds = configObj.oppo.native_trygame_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
- // return false;
- }
- if (configObj.oppo.intersitial_configs) {
- this.oppoconfig.intersitialAdConfigs = configObj.oppo.intersitial_configs;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersitial_configs’字段!");
- return false;
- }
- if (configObj.oppo.banner_configs) {
- this.oppoconfig.bannerAdConfigs = configObj.oppo.banner_configs;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_configs’字段!");
- return false;
- }
- // if (configObj.oppo.native_intersititial_pos_id) {
- // this.oppoconfig.nativeInsertIds = configObj.oppo.native_intersititial_pos_id;
- // } else {
- // utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
- // return false;
- // }
- if (configObj.oppo.native_single_pos_id) {
- this.oppoconfig.nativeSingleAdIds = configObj.oppo.native_single_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_single_pos_id’字段!");
- return false;
- }
- if (configObj.oppo.rec_portal_id) {
- this.oppoconfig.recPortalId = configObj.oppo.rec_portal_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘rec_portal_id’字段!");
- }
- if (configObj.oppo.rec_game_banner_id) {
- this.oppoconfig.recGameBannerId = configObj.oppo.rec_game_banner_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘rec_game_banner_id’字段!");
- }
- if (configObj.oppo.version) {
- //@ts-ignore
- if (window.new_version) {
- //@ts-ignore
- this.oppoconfig.version = window.new_version;
- Utils_1.utils.showLog("获取到注入的版本号:" + this.oppoconfig.version);
- }
- else {
- this.oppoconfig.version = configObj.oppo.version;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.oppo.umeng_id) {
- this.oppoconfig.umengId = configObj.oppo.umeng_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段!");
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘oppo’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_vivo = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.vivo) {
- if (configObj.vivo.app_id) {
- this.vivoconfig.appID = configObj.vivo.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.vivo.intersititia_pos_id) {
- this.vivoconfig.insertId = configObj.vivo.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.vivo.video_pos_id) {
- this.vivoconfig.videoId = configObj.vivo.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.vivo.banner_pos_id) {
- this.vivoconfig.bannerId = configObj.vivo.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.vivo.native_banner_pos_id) {
- this.vivoconfig.nativeBannerIds = configObj.vivo.native_banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
- return false;
- }
- if (configObj.vivo.native_trygame_pos_id) {
- this.vivoconfig.nativeTryGameIds = configObj.vivo.native_trygame_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
- // return false;
- }
- if (configObj.vivo.native_intersititial_pos_id) {
- this.vivoconfig.nativeInsertIds = configObj.vivo.native_intersititial_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
- return false;
- }
- if (configObj.vivo.rec_portal_id) {
- this.vivoconfig.recPortalId = configObj.vivo.rec_portal_id;
- }
- else {
- Utils_1.utils.showLog("warn" + "本地配置数据不包含‘rec_portal_id’字段!");
- }
- if (configObj.vivo.rec_game_banner_id) {
- this.vivoconfig.recGameBannerId = configObj.vivo.rec_game_banner_id;
- }
- else {
- Utils_1.utils.showLog("warn" + "本地配置数据不包含‘rec_game_banner_id’字段!");
- }
- if (configObj.vivo.native_single_pos_id) {
- this.vivoconfig.nativeSingleAdIds = configObj.vivo.native_single_pos_id;
- }
- else {
- Utils_1.utils.showLog("warn" + "本地配置数据不包含‘native_single_pos_id’字段!");
- }
- if (configObj.vivo.umeng_id) {
- this.vivoconfig.umengId = configObj.vivo.umeng_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段,不启用友盟统计!");
- }
- if (configObj.vivo.version) {
- this.vivoconfig.version = configObj.vivo.version;
- }
- else {
- Utils_1.utils.showLog("warn:" + "本地配置数据不包含‘version’字段!");
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘vivo’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_baidu = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.baidu) {
- if (configObj.baidu.app_id) {
- this.baiduconfig.appID = configObj.baidu.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.baidu.app_sid) {
- this.baiduconfig.appSID = configObj.baidu.app_sid;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_sid’字段!");
- }
- if (configObj.baidu.video_pos_id) {
- this.baiduconfig.videoId = configObj.baidu.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.baidu.banner_pos_id) {
- this.baiduconfig.bannerId = configObj.baidu.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.baidu.version) {
- this.baiduconfig.version = configObj.baidu.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.baidu.shares) {
- if (configObj.baidu.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.baidu.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
- return false;
- }
- if (configObj.baidu.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.baidu.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘baidu’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_wifi = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.wifi) {
- if (configObj.wifi.app_id) {
- this.wifiConfig.appID = configObj.wifi.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.wifi.version) {
- this.wifiConfig.version = configObj.wifi.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘baidu’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_douyin = function (data) {
- if (!data)
- return false;
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.toutiao) {
- if (configObj.toutiao.app_id) {
- this.douyinconfig.appID = configObj.toutiao.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.toutiao.banner_pos_id) {
- this.douyinconfig.bannerId = configObj.toutiao.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.toutiao.video_pos_id) {
- this.douyinconfig.videoId = configObj.toutiao.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.toutiao.intersititia_pos_id) {
- this.douyinconfig.insertId = configObj.toutiao.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.toutiao.version) {
- this.douyinconfig.version = configObj.toutiao.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.toutiao.shares) {
- if (configObj.toutiao.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.toutiao.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
- return false;
- }
- if (configObj.toutiao.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.toutiao.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- }
- }
- else {
- Utils_1.utils.showLog("warn:" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- CommonConfig.prototype._init_qq = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.qq) {
- if (configObj.qq.app_id) {
- this.qqconfig.appID = configObj.qq.app_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.qq.video_pos_id) {
- this.qqconfig.videoId = configObj.qq.video_pos_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.qq.banner_pos_id) {
- this.qqconfig.bannerId = configObj.qq.banner_pos_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.qq.intersititia_pos_id) {
- this.qqconfig.insertId = configObj.qq.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.qq.box_pos_id) {
- this.qqconfig.boxId = configObj.qq.box_pos_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘box_pos_id’字段!");
- return false;
- }
- if (configObj.qq.banner_box_pos_id) {
- this.qqconfig.bannerBoxId = configObj.qq.banner_box_pos_id;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘banner_box_pos_id’字段!");
- return false;
- }
- if (configObj.qq.shares) {
- if (configObj.qq.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.qq.shares.sy_title;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
- return false;
- }
- if (configObj.qq.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.qq.shares.sy_img;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- if (configObj.qq.version) {
- this.qqconfig.version = configObj.qq.version;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘qq’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化趣头条
- * 这里只输出配置不做任何处理
- * @param data 数据
- */
- CommonConfig.prototype._init_qtt = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.qutoutiao) {
- if (configObj.qutoutiao.app_id) {
- this.qttconfig.appID = configObj.qutoutiao.app_id;
- Utils_1.utils.showLog("this.qttconfig.appID:", this.qttconfig.appID);
- Utils_1.utils.showLog("configObj.qutoutiao.app_id:", configObj.qutoutiao.app_id);
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.qutoutiao.app_key) {
- this.qttconfig.appKey = configObj.qutoutiao.app_key;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_key’字段!");
- return false;
- }
- if (configObj.qutoutiao.game_name) {
- this.qttconfig.gamename = configObj.qutoutiao.game_name;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_key’字段!");
- return false;
- }
- }
- }
- return true;
- };
- CommonConfig.prototype._bannerLocationStringToEnum = function (str) {
- switch (str) {
- case "home": {
- return YZ_Constant_1.BannerLocation.Home;
- }
- case "game": {
- return YZ_Constant_1.BannerLocation.Game;
- }
- case "level": {
- return YZ_Constant_1.BannerLocation.Level;
- }
- case "skin": {
- return YZ_Constant_1.BannerLocation.Skin;
- }
- case "pause": {
- return YZ_Constant_1.BannerLocation.Pause;
- }
- case "over": {
- return YZ_Constant_1.BannerLocation.Over;
- }
- default:
- return YZ_Constant_1.BannerLocation.None;
- }
- };
- /**
- * 初始化小米
- * @param data 配置
- */
- CommonConfig.prototype._init_xiaomi = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.xiaomi) {
- if (configObj.xiaomi.app_id) {
- this.xiaomiConfig.appID = configObj.xiaomi.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.xiaomi.intersititia_pos_id) {
- this.xiaomiConfig.insertId = configObj.xiaomi.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.xiaomi.video_pos_id) {
- this.xiaomiConfig.videoId = configObj.xiaomi.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.xiaomi.banner_pos_id) {
- this.xiaomiConfig.bannerId = configObj.xiaomi.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.xiaomi.native_banner_pos_id) {
- this.xiaomiConfig.nativeBannerIds = configObj.xiaomi.native_banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
- return false;
- }
- if (configObj.xiaomi.native_trygame_pos_id) {
- this.xiaomiConfig.nativeTryGameIds = configObj.xiaomi.native_trygame_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
- // return false;
- }
- if (configObj.xiaomi.native_intersititial_pos_id) {
- this.xiaomiConfig.nativeInsertIds = configObj.xiaomi.native_intersititial_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘xiaomi’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化uc
- * @param data 配置
- */
- CommonConfig.prototype._init_uc = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.uc) {
- if (configObj.uc.app_id) {
- this.ucConfig.appID = configObj.uc.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.uc.version) {
- this.ucConfig.version = configObj.uc.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.uc.shares) {
- if (configObj.uc.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.uc.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
- return false;
- }
- if (configObj.uc.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.uc.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘uc’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化uc
- * @param data 配置
- */
- CommonConfig.prototype._init_cocos = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.cocos) {
- if (configObj.cocos.app_id) {
- this.cocosConfig.appID = configObj.cocos.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.cocos.video_pos_id) {
- this.cocosConfig.videoId = configObj.cocos.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.cocos.banner_pos_id) {
- this.cocosConfig.bannerId = configObj.cocos.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.cocos.intersititia_pos_id) {
- this.cocosConfig.insertId = configObj.cocos.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.cocos.shares) {
- if (configObj.cocos.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.cocos.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
- return false;
- }
- if (configObj.cocos.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.cocos.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘cocos’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化原生安卓平台
- * @param data 配置
- */
- CommonConfig.prototype._init_native_android = function () {
- if (!Utils_1.utils.Tool_Native) {
- return false;
- }
- var data = Utils_1.utils.Tool_Native.getNativeData();
- Utils_1.utils.showLog("原生安卓平台本地配置数据:", data);
- if (!data) {
- Utils_1.utils.showLog("error : 安卓本地配置数据配置错误!");
- return false;
- }
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.app_id) {
- this.nativeAndroidConfig.appID = configObj.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.version) {
- this.nativeAndroidConfig.version = configObj.version;
- }
- else {
- Utils_1.utils.showMsg("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.channel) {
- this.nativeAndroidConfig.channel = configObj.channel;
- Utils_1.utils.showLog("原生平台渠道号 channel=" + configObj.channel);
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化原生IOS
- */
- CommonConfig.prototype._init_native_ios = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.ios.app_id) {
- this.nativeIoSConfig.appID = configObj.ios.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.ios.video_pos_id) {
- this.nativeIoSConfig.videoId = configObj.ios.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.ios.version) {
- this.nativeIoSConfig.version = configObj.ios.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.ios.banner_pos_id) {
- this.nativeIoSConfig.bannerId = configObj.ios.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.ios.intersititia_pos_id) {
- this.nativeIoSConfig.insertId = configObj.ios.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化bili
- * @param data 配置
- */
- CommonConfig.prototype._init_bili = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.bili.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.bili.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
- return false;
- }
- if (configObj.bili.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.bili.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化快手
- * @param data 配置
- */
- CommonConfig.prototype._init_kwai = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.kwai.app_id) {
- this.kwaiConfig.appID = configObj.kwai.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.kwai.video_pos_id) {
- this.kwaiConfig.videoId = configObj.kwai.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.kwai.intersititia_pos_id) {
- this.kwaiConfig.insertId = configObj.kwai.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- }
- if (configObj.kwai.version) {
- this.kwaiConfig.version = configObj.kwai.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- if (configObj.kwai.shares) {
- if (configObj.kwai.shares.sy_title) {
- this.otherconfig.shareTitle = configObj.kwai.shares.sy_title;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
- return false;
- }
- if (configObj.kwai.shares.sy_img) {
- this.otherconfig.shareImgUrl = configObj.kwai.shares.sy_img;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
- return false;
- }
- if (configObj.kwai.shares.sy_icon) {
- this.otherconfig.shareIcon = configObj.kwai.shares.sy_icon;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_icon");
- return false;
- }
- if (configObj.kwai.shares.sy_desc) {
- this.otherconfig.shareDesc = configObj.kwai.shares.sy_desc;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_desc’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化facebook
- * @param data 配置
- */
- CommonConfig.prototype._init_facebook = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.faceBook.app_id) {
- this.faceBookConfig.appID = configObj.faceBook.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.faceBook.video_pos_id) {
- this.faceBookConfig.videoId = configObj.faceBook.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.faceBook.intersititia_pos_id) {
- this.faceBookConfig.insertId = configObj.faceBook.intersititia_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
- return false;
- }
- if (configObj.faceBook.banner_pos_id) {
- this.faceBookConfig.bannerId = configObj.faceBook.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.faceBook.version) {
- this.faceBookConfig.version = configObj.faceBook.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- Utils_1.utils.showLog("success" + "本地配置数据验证完成!");
- return true;
- };
- /**
- * 初始化Hago
- * @param data 配置
- */
- CommonConfig.prototype._init_hago = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.hago.app_id) {
- this.hagoConfig.appID = configObj.hago.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.hago.video_pos_id) {
- this.hagoConfig.videoId = configObj.hago.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.hago.version) {
- this.hagoConfig.version = configObj.hago.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- /**
- * 初始化Huawei
- * @param data 配置
- */
- CommonConfig.prototype._init_huawei = function (data) {
- if (!data)
- return false;
- Utils_1.utils.showLog("本地配置数据:", data);
- var configObj = JSON.parse(data);
- if (configObj) {
- if (configObj.huawei.app_id) {
- this.huaweiConfig.appID = configObj.huawei.app_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
- return false;
- }
- if (configObj.huawei.video_pos_id) {
- this.huaweiConfig.videoId = configObj.huawei.video_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
- return false;
- }
- if (configObj.huawei.banner_pos_id) {
- this.huaweiConfig.bannerId = configObj.huawei.banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
- return false;
- }
- if (configObj.huawei.native_banner_pos_id) {
- this.huaweiConfig.nativeBannerIds = configObj.huawei.native_banner_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
- }
- if (configObj.huawei.native_intersititial_pos_id) {
- this.huaweiConfig.nativeInsertIds = configObj.huawei.native_intersititial_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
- }
- if (configObj.huawei.native_trygame_pos_id) {
- this.huaweiConfig.nativeTryGameIds = configObj.huawei.native_trygame_pos_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
- }
- if (configObj.huawei.native_splash_id) {
- this.huaweiConfig.nativeSplashId = configObj.huawei.native_splash_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_splash_id’字段!");
- }
- if (configObj.huawei.umeng_id) {
- this.huaweiConfig.umengId = configObj.huawei.umeng_id;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段,不启用友盟统计!");
- }
- if (configObj.huawei.version) {
- this.huaweiConfig.version = configObj.huawei.version;
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
- return false;
- }
- }
- else {
- Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
- return false;
- }
- return true;
- };
- __decorate([
- property({ type: OtherConfig, tooltip: "其他配置", displayName: "其他配置" })
- ], CommonConfig.prototype, "otherconfig", void 0);
- CommonConfig = __decorate([
- ccclass("CommonConfig")
- ], CommonConfig);
- return CommonConfig;
- }());
- exports.default = CommonConfig;
- cc._RF.pop();
|