3506b5d7-d278-482c-b52f-cd49775be9bf.js 99 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421
  1. "use strict";
  2. cc._RF.push(module, '3506bXX0nhILLUvzUl3W+m/', 'CommonConfig');
  3. // common-plugin/Scripts/CommonConfig.ts
  4. "use strict";
  5. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  6. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  7. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  8. 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;
  9. return c > 3 && r && Object.defineProperty(target, key, r), r;
  10. };
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. 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;
  13. var YZ_Constant_1 = require("./YZ_Constant");
  14. var PlatUtils_1 = require("./PlatUtils");
  15. var Utils_1 = require("./Utils");
  16. var YZ_LocalStorage_1 = require("./YZ_LocalStorage");
  17. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  18. var BannerIdInfo = /** @class */ (function () {
  19. function BannerIdInfo() {
  20. this.location = YZ_Constant_1.BannerLocation.None;
  21. this.bannerId = "";
  22. }
  23. __decorate([
  24. property({ type: cc.Enum(YZ_Constant_1.BannerLocation), displayName: "广告条位置" })
  25. ], BannerIdInfo.prototype, "location", void 0);
  26. __decorate([
  27. property({ displayName: "广告条ID" })
  28. ], BannerIdInfo.prototype, "bannerId", void 0);
  29. BannerIdInfo = __decorate([
  30. ccclass("BannerIdInfo")
  31. ], BannerIdInfo);
  32. return BannerIdInfo;
  33. }());
  34. exports.BannerIdInfo = BannerIdInfo;
  35. ;
  36. var NativeBannerInfo = /** @class */ (function () {
  37. function NativeBannerInfo() {
  38. /**
  39. * 广告条的位置
  40. * 1:Home-首页
  41. * 2:Level-选关
  42. * 3:Skin-皮肤
  43. * 4:Game-游戏
  44. * 5:Pause-暂停
  45. * 6:Over-结算
  46. */
  47. this.location = YZ_Constant_1.BannerLocation.None;
  48. /**
  49. * 是否显示结算大banner
  50. */
  51. this.show_st_banner = "false";
  52. /**
  53. * 默认原生banner关闭按钮大小,默认为60
  54. */
  55. this.banner_close_but_size = 40;
  56. /**
  57. * 默认banner关闭按钮透明度 默认为120
  58. */
  59. this.banner_close_but_alpha = 120;
  60. /**
  61. * 默认banner关闭按钮高度 默认为220
  62. */
  63. this.banner_show_height = 160;
  64. /**
  65. * 默认banner关闭按钮点击区域默认为80
  66. */
  67. this.banner_close_but_range = 40;
  68. /**
  69. * 默认原生banner关闭按钮,是否显示。默认为显示:"true"
  70. */
  71. this.banner_close_but_show = "true";
  72. /**
  73. * 结算前banner整体缩放,默认为1
  74. */
  75. this.st_banner_scale = 1;
  76. /**
  77. * 结算前banner下载按钮的图片地址
  78. */
  79. this.st_banner_down_btn_image = "";
  80. /**
  81. * 结算前banner下载按钮显示类型,默认不配置,则不显示,配置后则显示,值为2:显示循环播放放大缩小效果,
  82. */
  83. this.st_banner_down_but_show = 0;
  84. /**
  85. * 结算前banner,下载按钮距离广告顶部间距,默认贴紧广告顶部值是-111
  86. */
  87. this.st_banner_down_but_margin_top = 0;
  88. /**
  89. * 结算前banner,关闭按钮点击区域大小
  90. */
  91. this.st_banner_close_but_range = 55;
  92. /**
  93. * 结算前banner,关闭按钮图片大小
  94. */
  95. this.st_banner_close_but_size = 55;
  96. /**
  97. * 结算前banner关闭按钮,是否显示。默认为显示:"true"
  98. */
  99. this.st_banner_close_but_show = "true";
  100. /**
  101. * 结算前banner距离底部的距离
  102. */
  103. this.st_banner_bottom = 0;
  104. /**
  105. * 结算前banner关闭按钮透明度
  106. * 0-255
  107. */
  108. this.st_banner_close_but_alpha = 255;
  109. /**
  110. * banner点击后是不是需要刷新数据
  111. */
  112. this.banner_click_refresh = "true";
  113. /**
  114. * 自动刷新时间,单位:秒,默认为:-1 不刷新
  115. */
  116. this.auto_refresh = -1;
  117. /**
  118. * 样式
  119. * -1 :默认、0:单图片缩放、1:单图片和自定义宽高、2:默认样式自定义宽高
  120. */
  121. this.st_banner_style = -1;
  122. /**
  123. * 结算banner样式-宽,默认:821 单位:像素
  124. */
  125. this.st_banner_width = -1;
  126. /**
  127. * 结算banner样式-高:默认:589 单位:像素
  128. */
  129. this.st_banner_height = -1;
  130. /**
  131. * 结算banner是否显示备用广告
  132. * 默认:1 显示,-1 为不显示
  133. */
  134. this.st_banner_show_back_up = 1;
  135. /**
  136. * 是否显示banner
  137. * 默认:1 显示, -1为不显示;
  138. */
  139. this.is_show_banner = 1;
  140. //显示互推banner
  141. this.is_show_rec = -1;
  142. //延迟显示时间
  143. this.delay_show_time = 0;
  144. //关闭按钮间隔多少次触发广告跳转
  145. this.banner_close_showAd_interval = 0;
  146. //普通原生Banner背景透明遮罩透明度 大于0则显示当前值的透明遮罩层
  147. this.bg_mask_opacity = 0;
  148. //结算原生banner背景透明遮罩透明度 大于0则显示当前值的透明遮罩层
  149. this.st_banner_bg_mask_opacity = 0;
  150. // 对齐方式:bottom top
  151. this._alignType = "bottom";
  152. }
  153. /**
  154. * 初始化
  155. * @param location 位置
  156. * @param info 配置
  157. */
  158. NativeBannerInfo.prototype.init = function (location, info) {
  159. this.location = location;
  160. this.banner_close_but_alpha = info.banner_close_but_alpha ? info.banner_close_but_alpha : this.banner_close_but_alpha;
  161. this.banner_close_but_range = info.banner_close_but_range ? info.banner_close_but_range : this.banner_close_but_range;
  162. this.banner_close_but_size = info.banner_close_but_size ? info.banner_close_but_size : this.banner_close_but_size;
  163. this.banner_show_height = info.banner_show_height ? info.banner_show_height : this.banner_show_height;
  164. this.banner_close_but_show = info.banner_close_but_show ? info.banner_close_but_show : this.banner_close_but_show;
  165. this.bg_mask_opacity = info.bg_mask_opacity ? info.bg_mask_opacity : this.bg_mask_opacity;
  166. this.st_banner_close_but_range = info.st_banner_close_but_range ? info.st_banner_close_but_range : this.st_banner_close_but_range;
  167. this.st_banner_close_but_size = info.st_banner_close_but_size ? info.st_banner_close_but_size : this.st_banner_close_but_size;
  168. this.st_banner_down_btn_image = info.st_banner_down_btn_image ? info.st_banner_down_btn_image : this.st_banner_down_btn_image;
  169. 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;
  170. this.st_banner_down_but_show = info.st_banner_down_but_show ? info.st_banner_down_but_show : this.st_banner_down_but_show;
  171. this.st_banner_scale = info.st_banner_scale ? info.st_banner_scale : this.st_banner_scale;
  172. this.show_st_banner = info.show_st_banner ? info.show_st_banner : this.show_st_banner;
  173. this.st_banner_close_but_show = info.st_banner_close_but_show ? info.st_banner_close_but_show : this.st_banner_close_but_show;
  174. this.st_banner_bottom = info.st_banner_bottom ? info.st_banner_bottom : this.st_banner_bottom;
  175. this.st_banner_close_but_alpha = info.st_banner_close_but_alpha ? info.st_banner_close_but_alpha : this.st_banner_close_but_alpha;
  176. this.banner_click_refresh = info.banner_click_refresh ? info.banner_click_refresh : this.banner_click_refresh;
  177. this.auto_refresh = info.auto_refresh ? info.auto_refresh : this.auto_refresh;
  178. this.st_banner_style = info.st_banner_style ? info.st_banner_style : this.st_banner_style;
  179. this.st_banner_width = info.st_banner_width ? info.st_banner_width : this.st_banner_width;
  180. this.st_banner_height = info.st_banner_height ? info.st_banner_height : this.st_banner_height;
  181. this.st_banner_show_back_up = info.st_banner_show_back_up ? info.st_banner_show_back_up : this.st_banner_show_back_up;
  182. this.is_show_banner = info.is_show_banner ? info.is_show_banner : this.is_show_banner;
  183. this.is_show_rec = info.is_show_rec ? info.is_show_rec : this.is_show_rec;
  184. this.delay_show_time = info.delay_show_time ? info.delay_show_time : this.delay_show_time;
  185. this.st_banner_bg_mask_opacity = info.st_banner_bg_mask_opacity ? info.st_banner_bg_mask_opacity : this.st_banner_bg_mask_opacity;
  186. this._alignType = info.align_type ? info.align_type : this._alignType;
  187. this.banner_close_showAd_interval = info.banner_close_showAd_interval ? info.banner_close_showAd_interval : this.banner_close_showAd_interval;
  188. };
  189. NativeBannerInfo.prototype.toStrong = function () {
  190. 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;
  191. };
  192. NativeBannerInfo = __decorate([
  193. ccclass("NativeBannerInfo")
  194. ], NativeBannerInfo);
  195. return NativeBannerInfo;
  196. }());
  197. exports.NativeBannerInfo = NativeBannerInfo;
  198. var CustomAdInfo = /** @class */ (function () {
  199. function CustomAdInfo() {
  200. /**
  201. * 广告条的位置
  202. * 1:Home-首页
  203. * 2:Level-选关
  204. * 3:Skin-皮肤
  205. * 4:Game-游戏
  206. * 5:Pause-暂停
  207. * 6:Over-结算
  208. * 其中选项没有的话,可以自定义
  209. */
  210. this.location = YZ_Constant_1.BannerLocation.None;
  211. /**
  212. * 是否显示结算大banner
  213. */
  214. this.is_show_ad = "true";
  215. /**
  216. * 距离顶部的距离
  217. */
  218. this.top = -1;
  219. /**
  220. * 距离左边的距离
  221. */
  222. this.left = -1;
  223. /**
  224. * 距离右边的距离
  225. */
  226. this.right = -1;
  227. /**
  228. * 距离底部的距离
  229. */
  230. this.bottom = -1;
  231. /**
  232. * 广告ID
  233. */
  234. this.id = "";
  235. /**
  236. * 刷新时间
  237. */
  238. this.refresh_time = -1;
  239. /**
  240. * 广告宽度
  241. */
  242. this.width = 0;
  243. /**
  244. * 广告高度
  245. */
  246. this.height = 0;
  247. /**
  248. * 显示成功后是否隐藏banner
  249. */
  250. this.hide_banner = "false";
  251. /**
  252. * 是否居中显示
  253. * about:左右居中
  254. * updown:上下
  255. * all:上下和左右居中
  256. */
  257. this.is_center = "false";
  258. /**
  259. * 改变位置的时候是否刷新广告
  260. */
  261. this.change_location_refresh_ad = "true";
  262. //当前obj对象
  263. this.customAdObj = null;
  264. }
  265. /**
  266. * 初始化
  267. * @param location 位置
  268. * @param info 配置
  269. */
  270. CustomAdInfo.prototype.init = function (location, info) {
  271. this.location = location;
  272. this.top = "top" in info ? info.top : -1;
  273. this.right = "right" in info ? info.right : -1;
  274. this.left = "left" in info ? info.left : -1;
  275. this.bottom = "bottom" in info ? info.bottom : -1;
  276. this.id = "id" in info ? info.id : "";
  277. this.refresh_time = "refresh_time" in info ? info.refresh_time : -1;
  278. this.is_show_ad = "is_show_ad" in info ? info.is_show_ad : "true";
  279. this.width = "width" in info ? info.width : 0;
  280. this.height = "height" in info ? info.height : 0;
  281. this.hide_banner = "hide_banner" in info ? info.hide_banner : "false";
  282. this.change_location_refresh_ad = "change_location_refresh_ad" in info ? info.change_location_refresh_ad : "false";
  283. this.is_center = "is_center" in info ? info.is_center : "all";
  284. };
  285. CustomAdInfo.prototype.toStrong = function () {
  286. 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;
  287. };
  288. CustomAdInfo = __decorate([
  289. ccclass("CustomAdInfo")
  290. ], CustomAdInfo);
  291. return CustomAdInfo;
  292. }());
  293. exports.CustomAdInfo = CustomAdInfo;
  294. var WechatConfig = /** @class */ (function () {
  295. function WechatConfig() {
  296. this.appID = "";
  297. this.bannerIds = [];
  298. this.videoId = "";
  299. this.insertId = "";
  300. this.jumpId = "";
  301. this.appBoxId = "";
  302. this.boxId = "";
  303. this.bannerBoxId = "";
  304. this.customAdInfos = [];
  305. this.isAttributed = false;
  306. this.version = "";
  307. this.nativeBannerId = "";
  308. this.nativeInsertIds = "";
  309. }
  310. /**
  311. * 根据位置获取bannerId
  312. * @param location BannerLocation
  313. */
  314. WechatConfig.prototype.getBannerId = function (location) {
  315. for (var i = 0; i < this.bannerIds.length; i++) {
  316. if (this.bannerIds[i].location == location) {
  317. return this.bannerIds[i].bannerId;
  318. }
  319. }
  320. if (this.bannerIds.length > 0) {
  321. return this.bannerIds[0].bannerId;
  322. }
  323. return "";
  324. };
  325. /**
  326. * 设定原生模版配置
  327. * @param location 位置
  328. * @param bannerInfo 配置
  329. */
  330. WechatConfig.prototype.setCustomAdInfo = function (location, custInfo) {
  331. var nativeCustomAd = new CustomAdInfo();
  332. nativeCustomAd.init(location, custInfo);
  333. this.customAdInfos.push(nativeCustomAd);
  334. };
  335. /**
  336. * 根据位置获取原生模版配置
  337. * @param location BannerLocation
  338. */
  339. WechatConfig.prototype.getCustomAdInfoInfo = function (location) {
  340. Utils_1.utils.showLog("根据位置获取原生模版配置>>location=", location);
  341. for (var i = 0; i < this.customAdInfos.length; i++) {
  342. if (this.customAdInfos[i].location == location) {
  343. Utils_1.utils.showLog("根据位置获取原生模版配置>>info=", this.customAdInfos[i].toStrong());
  344. return this.customAdInfos[i];
  345. }
  346. }
  347. return null;
  348. };
  349. /**
  350. * 设定bannerId
  351. * @param location BannerLocation
  352. * @param bannerId
  353. */
  354. WechatConfig.prototype.setBannerId = function (location, bannerId) {
  355. for (var i = 0; i < this.bannerIds.length; i++) {
  356. if (this.bannerIds[i].location == location) {
  357. this.bannerIds[i].bannerId = bannerId;
  358. return;
  359. }
  360. }
  361. };
  362. WechatConfig = __decorate([
  363. ccclass("WechatConfig")
  364. ], WechatConfig);
  365. return WechatConfig;
  366. }());
  367. exports.WechatConfig = WechatConfig;
  368. var QQConfig = /** @class */ (function () {
  369. function QQConfig() {
  370. this.QQ = true;
  371. this.appID = "";
  372. this.bannerId = "";
  373. this.insertId = "";
  374. this.videoId = "";
  375. this.boxId = "";
  376. this.version = "";
  377. this.bannerBoxId = "";
  378. }
  379. QQConfig = __decorate([
  380. ccclass("QQConfig")
  381. ], QQConfig);
  382. return QQConfig;
  383. }());
  384. exports.QQConfig = QQConfig;
  385. var OppoConfig = /** @class */ (function () {
  386. function OppoConfig() {
  387. this.appID = "";
  388. this.channel = "oppo";
  389. this.bannerId = "";
  390. this.insertId = "";
  391. this.videoId = "";
  392. this.nativeBannerIds = [];
  393. this.nativeTryGameIds = [];
  394. this.nativeInsertIds = [];
  395. this.nativeSingleAdIds = [];
  396. this.packageName = "";
  397. this.nativeBannerInfos = [];
  398. this.recGameBannerId = "";
  399. this.recPortalId = "";
  400. this.version = "";
  401. this.recGameDrawerId = "";
  402. this.umengId = ""; //友盟ID
  403. this.intersitialAdConfigs = []; //插屏ID配置
  404. this.bannerAdConfigs = []; //Banner配置
  405. }
  406. /**
  407. * 根据位置获取原生banner配置
  408. * @param location BannerLocation
  409. */
  410. OppoConfig.prototype.getNativeBannerInfo = function (location) {
  411. Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
  412. for (var i = 0; i < this.nativeBannerInfos.length; i++) {
  413. if (this.nativeBannerInfos[i].location == location) {
  414. Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
  415. return this.nativeBannerInfos[i];
  416. }
  417. }
  418. return new NativeBannerInfo();
  419. };
  420. /**
  421. * 设定原生banner配置
  422. * @param location 位置
  423. * @param bannerInfo 配置
  424. */
  425. OppoConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
  426. var nativeBannerInfo = new NativeBannerInfo();
  427. nativeBannerInfo.init(location, bannerInfo);
  428. this.nativeBannerInfos.push(nativeBannerInfo);
  429. };
  430. OppoConfig = __decorate([
  431. ccclass("OppoConfig")
  432. ], OppoConfig);
  433. return OppoConfig;
  434. }());
  435. exports.OppoConfig = OppoConfig;
  436. var VivoConfig = /** @class */ (function () {
  437. function VivoConfig() {
  438. this.showAd = true;
  439. this.appID = "";
  440. this.bannerId = "";
  441. this.insertId = "";
  442. this.videoId = "";
  443. this.nativeTryGameIds = [];
  444. this.nativeBannerIds = [];
  445. this.nativeInsertIds = [];
  446. this.nativeBannerInfos = [];
  447. this.customAdInfos = [];
  448. this.nativeSingleAdIds = [];
  449. this.recGameBannerId = "";
  450. this.recPortalId = "";
  451. this.version = "";
  452. this.umengId = ""; //友盟ID
  453. }
  454. /**
  455. * 根据位置获取原生banner配置
  456. * @param location BannerLocation
  457. */
  458. VivoConfig.prototype.getNativeBannerInfo = function (location) {
  459. Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
  460. for (var i = 0; i < this.nativeBannerInfos.length; i++) {
  461. if (this.nativeBannerInfos[i].location == location) {
  462. Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
  463. return this.nativeBannerInfos[i];
  464. }
  465. }
  466. return new NativeBannerInfo();
  467. };
  468. /**
  469. * 根据位置获取原生模版配置
  470. * @param location BannerLocation
  471. */
  472. VivoConfig.prototype.getCustomAdInfoInfo = function (location) {
  473. Utils_1.utils.showLog("根据位置获取原生模版配置>>location=", location);
  474. for (var i = 0; i < this.customAdInfos.length; i++) {
  475. if (this.customAdInfos[i].location == location) {
  476. Utils_1.utils.showLog("根据位置获取原生模版配置>>info=", this.customAdInfos[i].toStrong());
  477. return this.customAdInfos[i];
  478. }
  479. }
  480. return new CustomAdInfo();
  481. };
  482. /**
  483. * 设定原生banner配置
  484. * @param location 位置
  485. * @param bannerInfo 配置
  486. */
  487. VivoConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
  488. var nativeBannerInfo = new NativeBannerInfo();
  489. nativeBannerInfo.init(location, bannerInfo);
  490. this.nativeBannerInfos.push(nativeBannerInfo);
  491. };
  492. /**
  493. * 设定原生模版配置
  494. * @param location 位置
  495. * @param bannerInfo 配置
  496. */
  497. VivoConfig.prototype.setCustomAdInfo = function (location, custInfo) {
  498. var nativeCustomAd = new CustomAdInfo();
  499. nativeCustomAd.init(location, custInfo);
  500. this.customAdInfos.push(nativeCustomAd);
  501. };
  502. VivoConfig = __decorate([
  503. ccclass("VivoConfig")
  504. ], VivoConfig);
  505. return VivoConfig;
  506. }());
  507. exports.VivoConfig = VivoConfig;
  508. var YzRedBagInfo = /** @class */ (function () {
  509. function YzRedBagInfo() {
  510. this._progress = 0; //当前进度
  511. this._totalProgress = 5; //总进度
  512. this._balance = 0.00; //余额
  513. this._totalMoeny = 0;
  514. this._lastOpenFreeRedBagTime = "";
  515. this._progressInfos = null;
  516. this._lastOpenLevel = "-1";
  517. this._freeRedBagCount = 0; //现金红包次数
  518. this.withdrawaMoneys = [5, 20, 45, 50];
  519. if (PlatUtils_1.default.IsTest) {
  520. this._progressInfos = [
  521. {
  522. level: 0,
  523. min_money: 0.1,
  524. max_money: 5,
  525. type: 1
  526. },
  527. {
  528. level: 4,
  529. min_money: 0.1,
  530. max_money: 3,
  531. type: 3
  532. },
  533. {
  534. level: 5,
  535. min_money: 0.001,
  536. max_money: 0.005,
  537. type: 2
  538. }
  539. ];
  540. }
  541. 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;
  542. 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;
  543. 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;
  544. 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;
  545. 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) : "";
  546. 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";
  547. }
  548. Object.defineProperty(YzRedBagInfo.prototype, "freeRedBagCount", {
  549. get: function () {
  550. return this._freeRedBagCount;
  551. },
  552. set: function (value) {
  553. this._freeRedBagCount = value;
  554. },
  555. enumerable: false,
  556. configurable: true
  557. });
  558. Object.defineProperty(YzRedBagInfo.prototype, "lastOpenLevel", {
  559. get: function () {
  560. return this._lastOpenLevel;
  561. },
  562. set: function (value) {
  563. this._lastOpenLevel = value;
  564. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_LAST_OPEN_LEVEL, value);
  565. },
  566. enumerable: false,
  567. configurable: true
  568. });
  569. Object.defineProperty(YzRedBagInfo.prototype, "progress", {
  570. get: function () {
  571. return this._progress;
  572. },
  573. set: function (value) {
  574. this._progress = value;
  575. if (this._progress > this._totalProgress) {
  576. this._progress = this._totalProgress;
  577. }
  578. else {
  579. Utils_1.utils._rewardRedBagPanelShowCount = -1;
  580. }
  581. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_PROGRESS, this._progress + '');
  582. cc.game.emit("YZ_RED_BAG_PROGRESS_CHANGE");
  583. },
  584. enumerable: false,
  585. configurable: true
  586. });
  587. Object.defineProperty(YzRedBagInfo.prototype, "totalProgress", {
  588. get: function () {
  589. return this._totalProgress;
  590. },
  591. set: function (value) {
  592. this._totalProgress = value;
  593. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_PROGRESS, value + '');
  594. },
  595. enumerable: false,
  596. configurable: true
  597. });
  598. Object.defineProperty(YzRedBagInfo.prototype, "totalMoney", {
  599. get: function () {
  600. return this._totalMoeny;
  601. },
  602. set: function (value) {
  603. this._totalMoeny = value;
  604. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_TOTAL_MONEY, value + '');
  605. },
  606. enumerable: false,
  607. configurable: true
  608. });
  609. Object.defineProperty(YzRedBagInfo.prototype, "progressInfos", {
  610. get: function () {
  611. return this._progressInfos;
  612. },
  613. set: function (values) {
  614. this._progressInfos = values;
  615. },
  616. enumerable: false,
  617. configurable: true
  618. });
  619. Object.defineProperty(YzRedBagInfo.prototype, "curProgressInfo", {
  620. get: function () {
  621. if (this._progressInfos && this._progressInfos.length > 0) {
  622. if (parseInt(this.lastOpenLevel) > 0 && parseInt(this.lastOpenLevel) >= Utils_1.utils.currentLevel) {
  623. return this._progressInfos[this._progressInfos.length - 1];
  624. }
  625. var temp = this.lastOpenLevel ? this._progressInfos[0] : this._progressInfos[1];
  626. for (var i = 0; i < this._progressInfos.length; i++) {
  627. //@ts-ignore
  628. if (Utils_1.utils.currentLevel <= this._progressInfos[i].level) {
  629. temp = this._progressInfos[i];
  630. break;
  631. }
  632. }
  633. console.log("curInfo " + JSON.stringify(temp));
  634. return temp;
  635. }
  636. return null;
  637. },
  638. enumerable: false,
  639. configurable: true
  640. });
  641. Object.defineProperty(YzRedBagInfo.prototype, "balance", {
  642. get: function () {
  643. return this._balance;
  644. },
  645. set: function (value) {
  646. this._balance = value;
  647. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_RED_BAG_BALANCE, value + '');
  648. cc.game.emit("YZ_RED_BAG_BALANCE_CHANGE");
  649. },
  650. enumerable: false,
  651. configurable: true
  652. });
  653. Object.defineProperty(YzRedBagInfo.prototype, "lastOpenFreeRedBagTime", {
  654. get: function () {
  655. return this._lastOpenFreeRedBagTime;
  656. },
  657. set: function (value) {
  658. this._lastOpenFreeRedBagTime = value;
  659. YZ_LocalStorage_1.default.setItem(YZ_Constant_1.default.ST_FREE_RED_BAG_TIME, value + '');
  660. },
  661. enumerable: false,
  662. configurable: true
  663. });
  664. Object.defineProperty(YzRedBagInfo.prototype, "isFreeRedBag", {
  665. /**
  666. * 今天是否有免费的红包
  667. */
  668. get: function () {
  669. cc.log("是否有免费红包:" + new Date().toDateString() != this._lastOpenFreeRedBagTime);
  670. return new Date().toDateString() != this._lastOpenFreeRedBagTime;
  671. },
  672. enumerable: false,
  673. configurable: true
  674. });
  675. YzRedBagInfo = __decorate([
  676. ccclass("YzRedBagInfo")
  677. ], YzRedBagInfo);
  678. return YzRedBagInfo;
  679. }());
  680. exports.YzRedBagInfo = YzRedBagInfo;
  681. var HuaWeiConfig = /** @class */ (function () {
  682. function HuaWeiConfig() {
  683. this.appID = "";
  684. this.bannerId = "";
  685. this.insertId = "";
  686. this.videoId = "";
  687. this.nativeSplashId = "";
  688. this.nativeTryGameIds = [];
  689. this.nativeBannerIds = [];
  690. this.nativeInsertIds = [];
  691. this.nativeBannerInfos = [];
  692. this.version = "";
  693. this.umengId = "";
  694. }
  695. /**
  696. * 根据位置获取原生banner配置
  697. * @param location BannerLocation
  698. */
  699. HuaWeiConfig.prototype.getNativeBannerInfo = function (location) {
  700. Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
  701. for (var i = 0; i < this.nativeBannerInfos.length; i++) {
  702. if (this.nativeBannerInfos[i].location == location) {
  703. Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
  704. return this.nativeBannerInfos[i];
  705. }
  706. }
  707. return new NativeBannerInfo();
  708. };
  709. /**
  710. * 设定原生banner配置
  711. * @param location 位置
  712. * @param bannerInfo 配置
  713. */
  714. HuaWeiConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
  715. var nativeBannerInfo = new NativeBannerInfo();
  716. nativeBannerInfo.init(location, bannerInfo);
  717. this.nativeBannerInfos.push(nativeBannerInfo);
  718. };
  719. HuaWeiConfig = __decorate([
  720. ccclass("HuaWeiConfig")
  721. ], HuaWeiConfig);
  722. return HuaWeiConfig;
  723. }());
  724. exports.HuaWeiConfig = HuaWeiConfig;
  725. var NativeAndroidConfig = /** @class */ (function () {
  726. function NativeAndroidConfig() {
  727. this.appID = "";
  728. this.channel = "";
  729. this.version = "";
  730. }
  731. NativeAndroidConfig = __decorate([
  732. ccclass("NativeAndroidConfig")
  733. ], NativeAndroidConfig);
  734. return NativeAndroidConfig;
  735. }());
  736. exports.NativeAndroidConfig = NativeAndroidConfig;
  737. var BaiduConfig = /** @class */ (function () {
  738. function BaiduConfig() {
  739. this.appID = "";
  740. this.appSID = "";
  741. this.bannerId = "";
  742. this.videoId = "";
  743. this.version = "";
  744. }
  745. BaiduConfig = __decorate([
  746. ccclass("BaiduConfig")
  747. ], BaiduConfig);
  748. return BaiduConfig;
  749. }());
  750. exports.BaiduConfig = BaiduConfig;
  751. var WiFiConfig = /** @class */ (function () {
  752. function WiFiConfig() {
  753. this.appID = "";
  754. this.bannerId = "";
  755. this.videoId = "";
  756. this.version = "";
  757. }
  758. WiFiConfig = __decorate([
  759. ccclass("WiFiConfig")
  760. ], WiFiConfig);
  761. return WiFiConfig;
  762. }());
  763. exports.WiFiConfig = WiFiConfig;
  764. var KwaiConfig = /** @class */ (function () {
  765. function KwaiConfig() {
  766. this.appID = "";
  767. this.videoId = "";
  768. this.insertId = "";
  769. this.version = "";
  770. }
  771. KwaiConfig = __decorate([
  772. ccclass("KwaiConfig")
  773. ], KwaiConfig);
  774. return KwaiConfig;
  775. }());
  776. exports.KwaiConfig = KwaiConfig;
  777. var HagoConfig = /** @class */ (function () {
  778. function HagoConfig() {
  779. this.appID = "";
  780. this.videoId = "";
  781. this.version = "";
  782. }
  783. HagoConfig = __decorate([
  784. ccclass("HagoConfig")
  785. ], HagoConfig);
  786. return HagoConfig;
  787. }());
  788. exports.HagoConfig = HagoConfig;
  789. var NativeIosConfig = /** @class */ (function () {
  790. function NativeIosConfig() {
  791. this.appID = "";
  792. this.bannerId = "";
  793. this.insertId = "";
  794. this.videoId = "";
  795. this.version = "";
  796. }
  797. NativeIosConfig = __decorate([
  798. ccclass("NativeIosConfig")
  799. ], NativeIosConfig);
  800. return NativeIosConfig;
  801. }());
  802. exports.NativeIosConfig = NativeIosConfig;
  803. var DouyinConfig = /** @class */ (function () {
  804. function DouyinConfig() {
  805. this.Douyin = true;
  806. this.appID = "";
  807. this.bannerId = "";
  808. this.insertId = "";
  809. this.videoId = "";
  810. this.version = "";
  811. }
  812. DouyinConfig = __decorate([
  813. ccclass("DouyinConfig")
  814. ], DouyinConfig);
  815. return DouyinConfig;
  816. }());
  817. exports.DouyinConfig = DouyinConfig;
  818. var QTTConfig = /** @class */ (function () {
  819. function QTTConfig() {
  820. this.QuTouTiao = true;
  821. this.showAd = true;
  822. this.gamename = "";
  823. this.appID = "";
  824. this.appKey = "";
  825. }
  826. QTTConfig = __decorate([
  827. ccclass("QuTouTiaoConfig")
  828. ], QTTConfig);
  829. return QTTConfig;
  830. }());
  831. exports.QTTConfig = QTTConfig;
  832. var UCConfig = /** @class */ (function () {
  833. function UCConfig() {
  834. this.appID = "";
  835. this.appKey = "";
  836. this.version = "";
  837. }
  838. UCConfig = __decorate([
  839. ccclass("UCConfig")
  840. ], UCConfig);
  841. return UCConfig;
  842. }());
  843. exports.UCConfig = UCConfig;
  844. var CocosConfig = /** @class */ (function () {
  845. function CocosConfig() {
  846. this.appID = "";
  847. this.appKey = "";
  848. this.appSecret = "";
  849. this.bannerId = "";
  850. this.videoId = "";
  851. this.insertId = "";
  852. }
  853. CocosConfig = __decorate([
  854. ccclass("CocosConfig")
  855. ], CocosConfig);
  856. return CocosConfig;
  857. }());
  858. exports.CocosConfig = CocosConfig;
  859. var XiaoMiConfig = /** @class */ (function () {
  860. function XiaoMiConfig() {
  861. this.appID = "";
  862. this.bannerId = "";
  863. this.videoId = "";
  864. this.insertId = "";
  865. this.nativeSplashId = "";
  866. this.nativeTryGameIds = [];
  867. this.nativeBannerIds = [];
  868. this.nativeInsertIds = [];
  869. this.nativeBannerInfos = [];
  870. this.version = "";
  871. }
  872. /**
  873. * 根据位置获取原生banner配置
  874. * @param location BannerLocation
  875. */
  876. XiaoMiConfig.prototype.getNativeBannerInfo = function (location) {
  877. Utils_1.utils.showLog("根据位置获取原生banner配置>>location=", location);
  878. for (var i = 0; i < this.nativeBannerInfos.length; i++) {
  879. if (this.nativeBannerInfos[i].location == location) {
  880. Utils_1.utils.showLog("根据位置获取原生banner配置>>info=", this.nativeBannerInfos[i].toStrong());
  881. return this.nativeBannerInfos[i];
  882. }
  883. }
  884. return new NativeBannerInfo();
  885. };
  886. /**
  887. * 设定原生banner配置
  888. * @param location 位置
  889. * @param bannerInfo 配置
  890. */
  891. XiaoMiConfig.prototype.setNativeBannerInfo = function (location, bannerInfo) {
  892. var nativeBannerInfo = new NativeBannerInfo();
  893. nativeBannerInfo.init(location, bannerInfo);
  894. this.nativeBannerInfos.push(nativeBannerInfo);
  895. };
  896. XiaoMiConfig = __decorate([
  897. ccclass("XiaoMiConfig")
  898. ], XiaoMiConfig);
  899. return XiaoMiConfig;
  900. }());
  901. exports.XiaoMiConfig = XiaoMiConfig;
  902. var BiliConfig = /** @class */ (function () {
  903. function BiliConfig() {
  904. this.appID = "";
  905. this.bannerId = "";
  906. this.videoId = "";
  907. }
  908. BiliConfig = __decorate([
  909. ccclass("BiliConfig")
  910. ], BiliConfig);
  911. return BiliConfig;
  912. }());
  913. exports.BiliConfig = BiliConfig;
  914. var FaceBookConfig = /** @class */ (function () {
  915. function FaceBookConfig() {
  916. this.appID = "";
  917. this.bannerId = "";
  918. this.insertId = "";
  919. this.videoId = "";
  920. this.version = "";
  921. }
  922. FaceBookConfig = __decorate([
  923. ccclass("FaceBookConfig")
  924. ], FaceBookConfig);
  925. return FaceBookConfig;
  926. }());
  927. exports.FaceBookConfig = FaceBookConfig;
  928. var OtherConfig = /** @class */ (function () {
  929. function OtherConfig() {
  930. this.shareTitle = "";
  931. this.shareImgUrl = "";
  932. this.shareIcon = "";
  933. this.shareDesc = "";
  934. this.localConfig = null;
  935. this.logoutView = null;
  936. this.nativeBanner = null;
  937. this.nativeInsert = null;
  938. this.nativeSplashView = null;
  939. this.recommendGamesBanner = null;
  940. this.recommendGamesBar = null;
  941. this.tryGamesWidget = null;
  942. this.moreGamesWidget = null;
  943. this.recordWidget = null;
  944. this.shortcutWidget = null;
  945. // @property({ type: cc.Prefab, tooltip: "游戏盒子,将Common/Prefabs/GameBox拖到此处 " })
  946. this.gameBox = null;
  947. this.crossWidget6 = null;
  948. // @property({ type: cc.Prefab, tooltip: "激励插屏推广组件,将Common/Prefabs/RewardInsert拖到此处" })
  949. this.rewardInsert = null;
  950. this.statementRecomment = null;
  951. this.singleNativeAd = null;
  952. this.shareRecordPanel = null;
  953. // @property({ type: cc.Prefab, tooltip: "原生退出游戏弹窗,将Common/Prefabs/GameExitDialog拖到此处" })
  954. this.gameExitDialog = null;
  955. this.rewardBoxPanel = null;
  956. this.rewardTurnTablePanel = null;
  957. this.rewardShortCutPanel = null;
  958. this.nativeTryGameWidget = null;
  959. this.beforGameOverRecGamesPanel = null;
  960. // @property({ type: cc.Prefab, tooltip: "红包提现框,将Common/Prefabs/WithdrawalWidget拖到此处", displayName: "红包提现框挂件" })
  961. this.withdrawalWidget = null;
  962. // @property({ type: cc.Prefab, tooltip: "红包提现弹窗,将Common/Prefabs/WithdrawalPanel拖到此处", displayName: "红包提现弹窗" })
  963. this.withdrawalPanel = null;
  964. // @property({ type: cc.Prefab, tooltip: "红包进度挂件,将Common/Prefabs/RedBagProgressWidget拖到此处", displayName: "红包进度挂件" })
  965. this.redBagProgressWidget = null;
  966. // @property({ type: cc.Prefab, tooltip: "拆红包弹窗,将Common/Prefabs/OpenRedBagPanel拖到此处", displayName: "拆红包弹窗" })
  967. this.openRedBagPanel = null;
  968. // @property({ type: cc.Prefab, tooltip: "恭喜获得红包弹窗,将Common/Prefabs/RewardRedBagPanel拖到此处", displayName: "恭喜获得红包弹窗" })
  969. this.rewardRedBagPanel = null;
  970. this.rewardLuckBoxPanel = null;
  971. this.verticalRecommentPanel = null;
  972. this.privacyWidget = null;
  973. this.privacyPanel = null;
  974. this.handPrefab = null;
  975. this.yzRealNameAuthPanel = null;
  976. this.yzCustomAdPanel = null;
  977. this.yzLoginPanel = null;
  978. //游玩统计SDK:ID
  979. this.yw_app_id = "";
  980. }
  981. __decorate([
  982. property({ type: cc.JsonAsset, displayName: "本地配置文件", tooltip: "将Common/Config/下面的配置文件拖放到此处" })
  983. ], OtherConfig.prototype, "localConfig", void 0);
  984. __decorate([
  985. property({ type: cc.Prefab, displayName: "日志输出组件", tooltip: "将Common/Prefabs/LogoutView拖放到此处" })
  986. ], OtherConfig.prototype, "logoutView", void 0);
  987. __decorate([
  988. property({ type: cc.Prefab, tooltip: "原生广告条组件,将Common/Prefabs/NativeBanner拖到此处", displayName: "原生广告条组件" })
  989. ], OtherConfig.prototype, "nativeBanner", void 0);
  990. __decorate([
  991. property({ type: cc.Prefab, tooltip: "原生插屏组件,将Common/Prefabs/NativeInsert拖到此处", displayName: "原生插屏组件" })
  992. ], OtherConfig.prototype, "nativeInsert", void 0);
  993. __decorate([
  994. property({ type: cc.Prefab, tooltip: "原生插屏组件,将Common/Prefabs/nativeSplashView拖到此处", displayName: "原生开屏组件" })
  995. ], OtherConfig.prototype, "nativeSplashView", void 0);
  996. __decorate([
  997. property({ type: cc.Prefab, tooltip: "底部推荐游戏广告Banner, 将Common/Prefabs/RecommendGamesBanner拖到此处" })
  998. ], OtherConfig.prototype, "recommendGamesBanner", void 0);
  999. __decorate([
  1000. property({ type: cc.Prefab, tooltip: "推荐游戏横条,将Common/Prefabs/RecommendGamesBar拖到此处" })
  1001. ], OtherConfig.prototype, "recommendGamesBar", void 0);
  1002. __decorate([
  1003. property({ type: cc.Prefab, tooltip: "推荐游戏圆形挂件,将Common/Prefabs/TryGamesWidget拖到此处" })
  1004. ], OtherConfig.prototype, "tryGamesWidget", void 0);
  1005. __decorate([
  1006. property({ type: cc.Prefab, tooltip: "侧边更多游戏面板挂件,将Common/Prefabs/MoreGamesWidget拖到此处" })
  1007. ], OtherConfig.prototype, "moreGamesWidget", void 0);
  1008. __decorate([
  1009. property({ type: cc.Prefab, tooltip: "录屏按钮组件,将Common/Prefabs/RecordWidget拖到此处" })
  1010. ], OtherConfig.prototype, "recordWidget", void 0);
  1011. __decorate([
  1012. property({ type: cc.Prefab, tooltip: "快捷方式按钮,将Common/Prefabs/ShortcutWidget拖到此处 " })
  1013. ], OtherConfig.prototype, "shortcutWidget", void 0);
  1014. __decorate([
  1015. property({ type: cc.Prefab, tooltip: "6元素交叉推广组件,将Common/Prefabs/CrossWidget6拖到此处" })
  1016. ], OtherConfig.prototype, "crossWidget6", void 0);
  1017. __decorate([
  1018. property({ type: cc.Prefab, tooltip: "结算页面推广组件,将Common/Prefabs/StatementRecomment拖到此处" })
  1019. ], OtherConfig.prototype, "statementRecomment", void 0);
  1020. __decorate([
  1021. property({ type: cc.Prefab, tooltip: "单个原生广告,将Common/Prefabs/SingleNativeAd拖到此处" })
  1022. ], OtherConfig.prototype, "singleNativeAd", void 0);
  1023. __decorate([
  1024. property({ type: cc.Prefab, tooltip: "分享录屏弹窗,将Common/Prefabs/ShareRecordPanel拖到此处" })
  1025. ], OtherConfig.prototype, "shareRecordPanel", void 0);
  1026. __decorate([
  1027. property({ type: cc.Prefab, tooltip: "五倍奖励宝箱弹窗,将Common/Prefabs/RewardBoxPanel拖到此处" })
  1028. ], OtherConfig.prototype, "rewardBoxPanel", void 0);
  1029. __decorate([
  1030. property({ type: cc.Prefab, tooltip: "奖励转盘抽奖弹窗,将Common/Prefabs/RewardTurntablePanel拖到此处" })
  1031. ], OtherConfig.prototype, "rewardTurnTablePanel", void 0);
  1032. __decorate([
  1033. property({ type: cc.Prefab, tooltip: "添加桌面激励弹窗,将Common/Prefabs/RewardShortCutPanel拖到此处" })
  1034. ], OtherConfig.prototype, "rewardShortCutPanel", void 0);
  1035. __decorate([
  1036. property({ type: cc.Prefab, tooltip: "原生抖动试玩,将Common/Prefabs/NativeTryGameWidget拖到此处", displayName: "原生抖动组件" })
  1037. ], OtherConfig.prototype, "nativeTryGameWidget", void 0);
  1038. __decorate([
  1039. property({ type: cc.Prefab, tooltip: "结算前互推面板,将Common/Prefabs/BeforGameOverRecGamesPanel拖到此处", displayName: "结算前互推面板" })
  1040. ], OtherConfig.prototype, "beforGameOverRecGamesPanel", void 0);
  1041. __decorate([
  1042. property({ type: cc.Prefab, tooltip: "幸运宝箱弹窗,将Common/Prefabs/RewardLuckBoxPanel拖到此处", displayName: "幸运宝箱弹窗" })
  1043. ], OtherConfig.prototype, "rewardLuckBoxPanel", void 0);
  1044. __decorate([
  1045. property({ type: cc.Prefab, tooltip: "竖状互推窗口,将Common/Prefabs/VerticalRecommentPanel拖到此处", displayName: "竖状互推窗口" })
  1046. ], OtherConfig.prototype, "verticalRecommentPanel", void 0);
  1047. __decorate([
  1048. property({ type: cc.Prefab, tooltip: "隐私协议挂件,将Common/Prefabs/PrivacyWidget拖到此处", displayName: "隐私协议挂件" })
  1049. ], OtherConfig.prototype, "privacyWidget", void 0);
  1050. __decorate([
  1051. property({ type: cc.Prefab, tooltip: "隐私协议弹窗,将Common/Prefabs/PrivacyPanel拖到此处", displayName: "隐私协议弹窗" })
  1052. ], OtherConfig.prototype, "privacyPanel", void 0);
  1053. __decorate([
  1054. property({ type: cc.Prefab, tooltip: "指引的手势,将Common/Prefabs/HandPrefab拖到此处", displayName: "指引的手势" })
  1055. ], OtherConfig.prototype, "handPrefab", void 0);
  1056. __decorate([
  1057. property({ type: cc.Prefab, tooltip: "实名制认证弹窗,将Common/Prefabs/YzRealNameAuthPanel拖到此处", displayName: "实名制认证弹窗" })
  1058. ], OtherConfig.prototype, "yzRealNameAuthPanel", void 0);
  1059. __decorate([
  1060. property({ type: cc.Prefab, tooltip: "模版广告推荐弹窗,将Common/Prefabs/YzCustomAdPanel拖到此处", displayName: "模版广告推荐弹窗" })
  1061. ], OtherConfig.prototype, "yzCustomAdPanel", void 0);
  1062. __decorate([
  1063. property({ type: cc.Prefab, tooltip: "登录弹窗,将Common/Prefabs/YzLoginPanel拖到此处", displayName: "登录弹窗" })
  1064. ], OtherConfig.prototype, "yzLoginPanel", void 0);
  1065. OtherConfig = __decorate([
  1066. ccclass("OtherConfig")
  1067. ], OtherConfig);
  1068. return OtherConfig;
  1069. }());
  1070. exports.OtherConfig = OtherConfig;
  1071. var CommonConfig = /** @class */ (function () {
  1072. function CommonConfig() {
  1073. this.wechatconfig = new WechatConfig();
  1074. this.oppoconfig = new OppoConfig();
  1075. this.vivoconfig = new VivoConfig();
  1076. this.nativeAndroidConfig = new NativeAndroidConfig();
  1077. this.baiduconfig = new BaiduConfig();
  1078. this.douyinconfig = new DouyinConfig();
  1079. this.wifiConfig = new WiFiConfig();
  1080. this.qqconfig = new QQConfig();
  1081. this.qttconfig = new QTTConfig();
  1082. this.xiaomiConfig = new XiaoMiConfig();
  1083. this.ucConfig = new UCConfig();
  1084. this.cocosConfig = new CocosConfig();
  1085. this.biliConfig = new BiliConfig();
  1086. this.kwaiConfig = new KwaiConfig();
  1087. this.nativeIoSConfig = new NativeIosConfig();
  1088. this.hagoConfig = new HagoConfig();
  1089. this.huaweiConfig = new HuaWeiConfig();
  1090. this.faceBookConfig = new FaceBookConfig();
  1091. this.otherconfig = new OtherConfig();
  1092. }
  1093. CommonConfig.prototype.init = function (data) {
  1094. this._init_other(data);
  1095. if (PlatUtils_1.default.IsWechat) {
  1096. return this._init_wechat(data);
  1097. }
  1098. else if (PlatUtils_1.default.IsOPPO) {
  1099. return this._init_oppo(data);
  1100. }
  1101. else if (PlatUtils_1.default.IsVIVO) {
  1102. return this._init_vivo(data);
  1103. }
  1104. else if (PlatUtils_1.default.IsDouyin) {
  1105. return this._init_douyin(data);
  1106. }
  1107. else if (PlatUtils_1.default.IsQQ) {
  1108. return this._init_qq(data);
  1109. }
  1110. else if (PlatUtils_1.default.IsBaidu) {
  1111. return this._init_baidu(data);
  1112. }
  1113. else if (PlatUtils_1.default.IsQTT) {
  1114. return this._init_qtt(data);
  1115. }
  1116. else if (PlatUtils_1.default.IsXiaoMi) {
  1117. return this._init_xiaomi(data);
  1118. }
  1119. else if (PlatUtils_1.default.ISUC) {
  1120. return this._init_uc(data);
  1121. }
  1122. else if (PlatUtils_1.default.ISCocos) {
  1123. return this._init_cocos(data);
  1124. }
  1125. else if (PlatUtils_1.default.IsNativeAndroid) {
  1126. return this._init_native_android();
  1127. ;
  1128. }
  1129. else if (PlatUtils_1.default.IsNativeIOS) {
  1130. return this._init_native_ios(data);
  1131. ;
  1132. }
  1133. else if (PlatUtils_1.default.IsBili) {
  1134. return this._init_bili(data);
  1135. ;
  1136. }
  1137. else if (PlatUtils_1.default.IsKwai) {
  1138. return this._init_kwai(data);
  1139. ;
  1140. }
  1141. else if (PlatUtils_1.default.IsWiFi) {
  1142. return this._init_wifi(data);
  1143. ;
  1144. }
  1145. else if (PlatUtils_1.default.IsHago) {
  1146. return this._init_hago(data);
  1147. ;
  1148. }
  1149. else if (PlatUtils_1.default.IsHuaWei) {
  1150. return this._init_huawei(data);
  1151. ;
  1152. }
  1153. else if (PlatUtils_1.default.IsFaceBook) {
  1154. return this._init_facebook(data);
  1155. ;
  1156. }
  1157. else {
  1158. return true;
  1159. }
  1160. };
  1161. CommonConfig.prototype._init_other = function (data) {
  1162. if (!data)
  1163. return false;
  1164. var configObj = JSON.parse(data);
  1165. if (configObj) {
  1166. if (configObj.other) {
  1167. if (configObj.other.yw_app_id) {
  1168. this.otherconfig.yw_app_id = configObj.other.yw_app_id;
  1169. }
  1170. else {
  1171. Utils_1.utils.showLog("warn:" + "本地配置数据不包含‘yw_app_id’字段!");
  1172. }
  1173. }
  1174. }
  1175. };
  1176. CommonConfig.prototype._init_wechat = function (data) {
  1177. if (!data)
  1178. return false;
  1179. Utils_1.utils.showLog("本地配置数据:", data);
  1180. var configObj = JSON.parse(data);
  1181. if (configObj) {
  1182. if (configObj.wechat) {
  1183. if (configObj.wechat.app_id) {
  1184. this.wechatconfig.appID = configObj.wechat.app_id;
  1185. }
  1186. else {
  1187. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1188. return false;
  1189. }
  1190. if (configObj.wechat.intersititia_pos_id) {
  1191. this.wechatconfig.insertId = configObj.wechat.intersititia_pos_id;
  1192. }
  1193. else {
  1194. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1195. return false;
  1196. }
  1197. if (configObj.wechat.video_pos_id) {
  1198. this.wechatconfig.videoId = configObj.wechat.video_pos_id;
  1199. }
  1200. else {
  1201. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1202. return false;
  1203. }
  1204. if (configObj.wechat.app_box_pos_id) {
  1205. this.wechatconfig.appBoxId = configObj.wechat.app_box_pos_id;
  1206. }
  1207. else {
  1208. Utils_1.utils.showLog("本地配置数据不包含‘app_box_pos_id’字段!");
  1209. // return false;
  1210. }
  1211. if (configObj.wechat.version) {
  1212. this.wechatconfig.version = configObj.wechat.version;
  1213. }
  1214. else {
  1215. Utils_1.utils.showLog("本地配置数据不包含‘version’字段!");
  1216. }
  1217. if (configObj.wechat.is_attributed) {
  1218. this.wechatconfig.isAttributed = configObj.wechat.is_attributed;
  1219. }
  1220. if (configObj.wechat.banner_pos_id) {
  1221. for (var key in configObj.wechat.banner_pos_id) {
  1222. var bannerInfo = new BannerIdInfo();
  1223. bannerInfo.location = this._bannerLocationStringToEnum(key);
  1224. bannerInfo.bannerId = configObj.wechat.banner_pos_id[key];
  1225. this.wechatconfig.bannerIds.push(bannerInfo);
  1226. }
  1227. }
  1228. else {
  1229. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1230. return false;
  1231. }
  1232. if (configObj.wechat.shares) {
  1233. if (configObj.wechat.shares.sy_title) {
  1234. this.otherconfig.shareTitle = configObj.wechat.shares.sy_title;
  1235. }
  1236. else {
  1237. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
  1238. return false;
  1239. }
  1240. if (configObj.wechat.shares.sy_img) {
  1241. this.otherconfig.shareImgUrl = configObj.wechat.shares.sy_img;
  1242. }
  1243. else {
  1244. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
  1245. return false;
  1246. }
  1247. }
  1248. else {
  1249. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  1250. return false;
  1251. }
  1252. if (configObj.wechat.banner_box_pos_id) {
  1253. this.wechatconfig.bannerBoxId = configObj.wechat.banner_box_pos_id;
  1254. }
  1255. else {
  1256. Utils_1.utils.showLog("error" + "本地配置中不包含 ‘banner_box_pos_id’ 字段");
  1257. }
  1258. if (configObj.wechat.native_banner_pos_id) {
  1259. this.wechatconfig.nativeBannerId = configObj.wechat.native_banner_pos_id;
  1260. }
  1261. else {
  1262. Utils_1.utils.showLog("error" + "本地配置中不包含 native_banner_pos_id 字段");
  1263. }
  1264. if (configObj.wechat.native_intersititial_pos_id) {
  1265. this.wechatconfig.nativeInsertIds = configObj.wechat.native_intersititial_pos_id;
  1266. }
  1267. else {
  1268. Utils_1.utils.showLog("error" + "本地配置中不包含 native_intersititial_pos_id 字段");
  1269. }
  1270. }
  1271. else {
  1272. Utils_1.utils.showLog("error" + "本地配置数据不包含‘wechat’字段!");
  1273. return false;
  1274. }
  1275. }
  1276. else {
  1277. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1278. return false;
  1279. }
  1280. return true;
  1281. };
  1282. CommonConfig.prototype._init_oppo = function (data) {
  1283. if (!data)
  1284. return false;
  1285. Utils_1.utils.showLog("本地配置数据:", data);
  1286. var configObj = JSON.parse(data);
  1287. if (configObj) {
  1288. if (configObj.oppo) {
  1289. if (configObj.oppo.app_id) {
  1290. this.oppoconfig.appID = configObj.oppo.app_id;
  1291. }
  1292. else {
  1293. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1294. return false;
  1295. }
  1296. if (configObj.oppo.package_name) {
  1297. this.oppoconfig.packageName = configObj.oppo.package_name;
  1298. }
  1299. else {
  1300. Utils_1.utils.showLog("error" + "本地配置数据不包含‘package_name’字段!");
  1301. return false;
  1302. }
  1303. if (configObj.oppo.banner_pos_id) {
  1304. this.oppoconfig.bannerId = configObj.oppo.banner_pos_id;
  1305. }
  1306. // else {
  1307. // utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1308. // return false;
  1309. // }
  1310. if (configObj.oppo.rec_game_drawer_id) {
  1311. this.oppoconfig.recGameDrawerId = configObj.oppo.rec_game_drawer_id;
  1312. }
  1313. else {
  1314. Utils_1.utils.showLog("error" + "rec_game_drawer_id");
  1315. }
  1316. // if (configObj.oppo.intersititia_pos_id) {
  1317. // this.oppoconfig.insertId = configObj.oppo.intersititia_pos_id;
  1318. // } else {
  1319. // utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1320. // // return false;
  1321. // }
  1322. if (configObj.oppo.video_pos_id) {
  1323. this.oppoconfig.videoId = configObj.oppo.video_pos_id;
  1324. }
  1325. else {
  1326. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1327. return false;
  1328. }
  1329. if (configObj.oppo.native_banner_pos_id) {
  1330. this.oppoconfig.nativeBannerIds = configObj.oppo.native_banner_pos_id;
  1331. }
  1332. // else {
  1333. // utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
  1334. // return false;
  1335. // }
  1336. if (configObj.oppo.native_trygame_pos_id) {
  1337. this.oppoconfig.nativeTryGameIds = configObj.oppo.native_trygame_pos_id;
  1338. }
  1339. else {
  1340. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
  1341. // return false;
  1342. }
  1343. if (configObj.oppo.intersitial_configs) {
  1344. this.oppoconfig.intersitialAdConfigs = configObj.oppo.intersitial_configs;
  1345. }
  1346. else {
  1347. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersitial_configs’字段!");
  1348. return false;
  1349. }
  1350. if (configObj.oppo.banner_configs) {
  1351. this.oppoconfig.bannerAdConfigs = configObj.oppo.banner_configs;
  1352. }
  1353. else {
  1354. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_configs’字段!");
  1355. return false;
  1356. }
  1357. // if (configObj.oppo.native_intersititial_pos_id) {
  1358. // this.oppoconfig.nativeInsertIds = configObj.oppo.native_intersititial_pos_id;
  1359. // } else {
  1360. // utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
  1361. // return false;
  1362. // }
  1363. if (configObj.oppo.native_single_pos_id) {
  1364. this.oppoconfig.nativeSingleAdIds = configObj.oppo.native_single_pos_id;
  1365. }
  1366. else {
  1367. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_single_pos_id’字段!");
  1368. return false;
  1369. }
  1370. if (configObj.oppo.rec_portal_id) {
  1371. this.oppoconfig.recPortalId = configObj.oppo.rec_portal_id;
  1372. }
  1373. else {
  1374. Utils_1.utils.showLog("error" + "本地配置数据不包含‘rec_portal_id’字段!");
  1375. }
  1376. if (configObj.oppo.rec_game_banner_id) {
  1377. this.oppoconfig.recGameBannerId = configObj.oppo.rec_game_banner_id;
  1378. }
  1379. else {
  1380. Utils_1.utils.showLog("error" + "本地配置数据不包含‘rec_game_banner_id’字段!");
  1381. }
  1382. if (configObj.oppo.version) {
  1383. //@ts-ignore
  1384. if (window.new_version) {
  1385. //@ts-ignore
  1386. this.oppoconfig.version = window.new_version;
  1387. Utils_1.utils.showLog("获取到注入的版本号:" + this.oppoconfig.version);
  1388. }
  1389. else {
  1390. this.oppoconfig.version = configObj.oppo.version;
  1391. }
  1392. }
  1393. else {
  1394. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  1395. return false;
  1396. }
  1397. if (configObj.oppo.umeng_id) {
  1398. this.oppoconfig.umengId = configObj.oppo.umeng_id;
  1399. }
  1400. else {
  1401. Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段!");
  1402. }
  1403. }
  1404. else {
  1405. Utils_1.utils.showLog("error" + "本地配置数据不包含‘oppo’字段!");
  1406. return false;
  1407. }
  1408. }
  1409. else {
  1410. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1411. return false;
  1412. }
  1413. return true;
  1414. };
  1415. CommonConfig.prototype._init_vivo = function (data) {
  1416. if (!data)
  1417. return false;
  1418. Utils_1.utils.showLog("本地配置数据:", data);
  1419. var configObj = JSON.parse(data);
  1420. if (configObj) {
  1421. if (configObj.vivo) {
  1422. if (configObj.vivo.app_id) {
  1423. this.vivoconfig.appID = configObj.vivo.app_id;
  1424. }
  1425. else {
  1426. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1427. return false;
  1428. }
  1429. if (configObj.vivo.intersititia_pos_id) {
  1430. this.vivoconfig.insertId = configObj.vivo.intersititia_pos_id;
  1431. }
  1432. else {
  1433. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1434. return false;
  1435. }
  1436. if (configObj.vivo.video_pos_id) {
  1437. this.vivoconfig.videoId = configObj.vivo.video_pos_id;
  1438. }
  1439. else {
  1440. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1441. return false;
  1442. }
  1443. if (configObj.vivo.banner_pos_id) {
  1444. this.vivoconfig.bannerId = configObj.vivo.banner_pos_id;
  1445. }
  1446. else {
  1447. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1448. return false;
  1449. }
  1450. if (configObj.vivo.native_banner_pos_id) {
  1451. this.vivoconfig.nativeBannerIds = configObj.vivo.native_banner_pos_id;
  1452. }
  1453. else {
  1454. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
  1455. return false;
  1456. }
  1457. if (configObj.vivo.native_trygame_pos_id) {
  1458. this.vivoconfig.nativeTryGameIds = configObj.vivo.native_trygame_pos_id;
  1459. }
  1460. else {
  1461. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
  1462. // return false;
  1463. }
  1464. if (configObj.vivo.native_intersititial_pos_id) {
  1465. this.vivoconfig.nativeInsertIds = configObj.vivo.native_intersititial_pos_id;
  1466. }
  1467. else {
  1468. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
  1469. return false;
  1470. }
  1471. if (configObj.vivo.rec_portal_id) {
  1472. this.vivoconfig.recPortalId = configObj.vivo.rec_portal_id;
  1473. }
  1474. else {
  1475. Utils_1.utils.showLog("warn" + "本地配置数据不包含‘rec_portal_id’字段!");
  1476. }
  1477. if (configObj.vivo.rec_game_banner_id) {
  1478. this.vivoconfig.recGameBannerId = configObj.vivo.rec_game_banner_id;
  1479. }
  1480. else {
  1481. Utils_1.utils.showLog("warn" + "本地配置数据不包含‘rec_game_banner_id’字段!");
  1482. }
  1483. if (configObj.vivo.native_single_pos_id) {
  1484. this.vivoconfig.nativeSingleAdIds = configObj.vivo.native_single_pos_id;
  1485. }
  1486. else {
  1487. Utils_1.utils.showLog("warn" + "本地配置数据不包含‘native_single_pos_id’字段!");
  1488. }
  1489. if (configObj.vivo.umeng_id) {
  1490. this.vivoconfig.umengId = configObj.vivo.umeng_id;
  1491. }
  1492. else {
  1493. Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段,不启用友盟统计!");
  1494. }
  1495. if (configObj.vivo.version) {
  1496. this.vivoconfig.version = configObj.vivo.version;
  1497. }
  1498. else {
  1499. Utils_1.utils.showLog("warn:" + "本地配置数据不包含‘version’字段!");
  1500. }
  1501. }
  1502. else {
  1503. Utils_1.utils.showLog("error" + "本地配置数据不包含‘vivo’字段!");
  1504. return false;
  1505. }
  1506. }
  1507. else {
  1508. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1509. return false;
  1510. }
  1511. return true;
  1512. };
  1513. CommonConfig.prototype._init_baidu = function (data) {
  1514. if (!data)
  1515. return false;
  1516. Utils_1.utils.showLog("本地配置数据:", data);
  1517. var configObj = JSON.parse(data);
  1518. if (configObj) {
  1519. if (configObj.baidu) {
  1520. if (configObj.baidu.app_id) {
  1521. this.baiduconfig.appID = configObj.baidu.app_id;
  1522. }
  1523. else {
  1524. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1525. return false;
  1526. }
  1527. if (configObj.baidu.app_sid) {
  1528. this.baiduconfig.appSID = configObj.baidu.app_sid;
  1529. }
  1530. else {
  1531. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_sid’字段!");
  1532. }
  1533. if (configObj.baidu.video_pos_id) {
  1534. this.baiduconfig.videoId = configObj.baidu.video_pos_id;
  1535. }
  1536. else {
  1537. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1538. return false;
  1539. }
  1540. if (configObj.baidu.banner_pos_id) {
  1541. this.baiduconfig.bannerId = configObj.baidu.banner_pos_id;
  1542. }
  1543. else {
  1544. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1545. return false;
  1546. }
  1547. if (configObj.baidu.version) {
  1548. this.baiduconfig.version = configObj.baidu.version;
  1549. }
  1550. else {
  1551. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  1552. return false;
  1553. }
  1554. if (configObj.baidu.shares) {
  1555. if (configObj.baidu.shares.sy_title) {
  1556. this.otherconfig.shareTitle = configObj.baidu.shares.sy_title;
  1557. }
  1558. else {
  1559. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
  1560. return false;
  1561. }
  1562. if (configObj.baidu.shares.sy_img) {
  1563. this.otherconfig.shareImgUrl = configObj.baidu.shares.sy_img;
  1564. }
  1565. else {
  1566. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
  1567. return false;
  1568. }
  1569. }
  1570. else {
  1571. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  1572. return false;
  1573. }
  1574. }
  1575. else {
  1576. Utils_1.utils.showLog("error" + "本地配置数据不包含‘baidu’字段!");
  1577. return false;
  1578. }
  1579. }
  1580. else {
  1581. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1582. return false;
  1583. }
  1584. return true;
  1585. };
  1586. CommonConfig.prototype._init_wifi = function (data) {
  1587. if (!data)
  1588. return false;
  1589. Utils_1.utils.showLog("本地配置数据:", data);
  1590. var configObj = JSON.parse(data);
  1591. if (configObj) {
  1592. if (configObj.wifi) {
  1593. if (configObj.wifi.app_id) {
  1594. this.wifiConfig.appID = configObj.wifi.app_id;
  1595. }
  1596. else {
  1597. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1598. return false;
  1599. }
  1600. if (configObj.wifi.version) {
  1601. this.wifiConfig.version = configObj.wifi.version;
  1602. }
  1603. else {
  1604. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  1605. return false;
  1606. }
  1607. }
  1608. else {
  1609. Utils_1.utils.showLog("error" + "本地配置数据不包含‘baidu’字段!");
  1610. return false;
  1611. }
  1612. }
  1613. else {
  1614. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1615. return false;
  1616. }
  1617. return true;
  1618. };
  1619. CommonConfig.prototype._init_douyin = function (data) {
  1620. if (!data)
  1621. return false;
  1622. var configObj = JSON.parse(data);
  1623. if (configObj) {
  1624. if (configObj.toutiao) {
  1625. if (configObj.toutiao.app_id) {
  1626. this.douyinconfig.appID = configObj.toutiao.app_id;
  1627. }
  1628. else {
  1629. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1630. return false;
  1631. }
  1632. if (configObj.toutiao.banner_pos_id) {
  1633. this.douyinconfig.bannerId = configObj.toutiao.banner_pos_id;
  1634. }
  1635. else {
  1636. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1637. return false;
  1638. }
  1639. if (configObj.toutiao.video_pos_id) {
  1640. this.douyinconfig.videoId = configObj.toutiao.video_pos_id;
  1641. }
  1642. else {
  1643. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1644. return false;
  1645. }
  1646. if (configObj.toutiao.intersititia_pos_id) {
  1647. this.douyinconfig.insertId = configObj.toutiao.intersititia_pos_id;
  1648. }
  1649. else {
  1650. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1651. return false;
  1652. }
  1653. if (configObj.toutiao.version) {
  1654. this.douyinconfig.version = configObj.toutiao.version;
  1655. }
  1656. else {
  1657. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  1658. return false;
  1659. }
  1660. if (configObj.toutiao.shares) {
  1661. if (configObj.toutiao.shares.sy_title) {
  1662. this.otherconfig.shareTitle = configObj.toutiao.shares.sy_title;
  1663. }
  1664. else {
  1665. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
  1666. return false;
  1667. }
  1668. if (configObj.toutiao.shares.sy_img) {
  1669. this.otherconfig.shareImgUrl = configObj.toutiao.shares.sy_img;
  1670. }
  1671. else {
  1672. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
  1673. return false;
  1674. }
  1675. }
  1676. else {
  1677. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  1678. return false;
  1679. }
  1680. }
  1681. }
  1682. else {
  1683. Utils_1.utils.showLog("warn:" + "本地配置数据不是合法的json数据!");
  1684. return false;
  1685. }
  1686. return true;
  1687. };
  1688. CommonConfig.prototype._init_qq = function (data) {
  1689. if (!data)
  1690. return false;
  1691. Utils_1.utils.showLog("本地配置数据:", data);
  1692. var configObj = JSON.parse(data);
  1693. if (configObj) {
  1694. if (configObj.qq) {
  1695. if (configObj.qq.app_id) {
  1696. this.qqconfig.appID = configObj.qq.app_id;
  1697. }
  1698. else {
  1699. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘app_id’字段!");
  1700. return false;
  1701. }
  1702. if (configObj.qq.video_pos_id) {
  1703. this.qqconfig.videoId = configObj.qq.video_pos_id;
  1704. }
  1705. else {
  1706. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1707. return false;
  1708. }
  1709. if (configObj.qq.banner_pos_id) {
  1710. this.qqconfig.bannerId = configObj.qq.banner_pos_id;
  1711. }
  1712. else {
  1713. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1714. return false;
  1715. }
  1716. if (configObj.qq.intersititia_pos_id) {
  1717. this.qqconfig.insertId = configObj.qq.intersititia_pos_id;
  1718. }
  1719. else {
  1720. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1721. return false;
  1722. }
  1723. if (configObj.qq.box_pos_id) {
  1724. this.qqconfig.boxId = configObj.qq.box_pos_id;
  1725. }
  1726. else {
  1727. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘box_pos_id’字段!");
  1728. return false;
  1729. }
  1730. if (configObj.qq.banner_box_pos_id) {
  1731. this.qqconfig.bannerBoxId = configObj.qq.banner_box_pos_id;
  1732. }
  1733. else {
  1734. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘banner_box_pos_id’字段!");
  1735. return false;
  1736. }
  1737. if (configObj.qq.shares) {
  1738. if (configObj.qq.shares.sy_title) {
  1739. this.otherconfig.shareTitle = configObj.qq.shares.sy_title;
  1740. }
  1741. else {
  1742. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
  1743. return false;
  1744. }
  1745. if (configObj.qq.shares.sy_img) {
  1746. this.otherconfig.shareImgUrl = configObj.qq.shares.sy_img;
  1747. }
  1748. else {
  1749. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
  1750. return false;
  1751. }
  1752. }
  1753. else {
  1754. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘shares’字段!");
  1755. return false;
  1756. }
  1757. if (configObj.qq.version) {
  1758. this.qqconfig.version = configObj.qq.version;
  1759. }
  1760. else {
  1761. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘version’字段!");
  1762. return false;
  1763. }
  1764. }
  1765. else {
  1766. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘qq’字段!");
  1767. return false;
  1768. }
  1769. }
  1770. else {
  1771. Utils_1.utils.showMsg("error" + "本地配置数据不是合法的json数据!");
  1772. return false;
  1773. }
  1774. return true;
  1775. };
  1776. /**
  1777. * 初始化趣头条
  1778. * 这里只输出配置不做任何处理
  1779. * @param data 数据
  1780. */
  1781. CommonConfig.prototype._init_qtt = function (data) {
  1782. if (!data)
  1783. return false;
  1784. Utils_1.utils.showLog("本地配置数据:", data);
  1785. var configObj = JSON.parse(data);
  1786. if (configObj) {
  1787. if (configObj.qutoutiao) {
  1788. if (configObj.qutoutiao.app_id) {
  1789. this.qttconfig.appID = configObj.qutoutiao.app_id;
  1790. Utils_1.utils.showLog("this.qttconfig.appID:", this.qttconfig.appID);
  1791. Utils_1.utils.showLog("configObj.qutoutiao.app_id:", configObj.qutoutiao.app_id);
  1792. }
  1793. else {
  1794. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1795. return false;
  1796. }
  1797. if (configObj.qutoutiao.app_key) {
  1798. this.qttconfig.appKey = configObj.qutoutiao.app_key;
  1799. }
  1800. else {
  1801. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_key’字段!");
  1802. return false;
  1803. }
  1804. if (configObj.qutoutiao.game_name) {
  1805. this.qttconfig.gamename = configObj.qutoutiao.game_name;
  1806. }
  1807. else {
  1808. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_key’字段!");
  1809. return false;
  1810. }
  1811. }
  1812. }
  1813. return true;
  1814. };
  1815. CommonConfig.prototype._bannerLocationStringToEnum = function (str) {
  1816. switch (str) {
  1817. case "home": {
  1818. return YZ_Constant_1.BannerLocation.Home;
  1819. }
  1820. case "game": {
  1821. return YZ_Constant_1.BannerLocation.Game;
  1822. }
  1823. case "level": {
  1824. return YZ_Constant_1.BannerLocation.Level;
  1825. }
  1826. case "skin": {
  1827. return YZ_Constant_1.BannerLocation.Skin;
  1828. }
  1829. case "pause": {
  1830. return YZ_Constant_1.BannerLocation.Pause;
  1831. }
  1832. case "over": {
  1833. return YZ_Constant_1.BannerLocation.Over;
  1834. }
  1835. default:
  1836. return YZ_Constant_1.BannerLocation.None;
  1837. }
  1838. };
  1839. /**
  1840. * 初始化小米
  1841. * @param data 配置
  1842. */
  1843. CommonConfig.prototype._init_xiaomi = function (data) {
  1844. if (!data)
  1845. return false;
  1846. Utils_1.utils.showLog("本地配置数据:", data);
  1847. var configObj = JSON.parse(data);
  1848. if (configObj) {
  1849. if (configObj.xiaomi) {
  1850. if (configObj.xiaomi.app_id) {
  1851. this.xiaomiConfig.appID = configObj.xiaomi.app_id;
  1852. }
  1853. else {
  1854. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1855. return false;
  1856. }
  1857. if (configObj.xiaomi.intersititia_pos_id) {
  1858. this.xiaomiConfig.insertId = configObj.xiaomi.intersititia_pos_id;
  1859. }
  1860. else {
  1861. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  1862. return false;
  1863. }
  1864. if (configObj.xiaomi.video_pos_id) {
  1865. this.xiaomiConfig.videoId = configObj.xiaomi.video_pos_id;
  1866. }
  1867. else {
  1868. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1869. return false;
  1870. }
  1871. if (configObj.xiaomi.banner_pos_id) {
  1872. this.xiaomiConfig.bannerId = configObj.xiaomi.banner_pos_id;
  1873. }
  1874. else {
  1875. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1876. return false;
  1877. }
  1878. if (configObj.xiaomi.native_banner_pos_id) {
  1879. this.xiaomiConfig.nativeBannerIds = configObj.xiaomi.native_banner_pos_id;
  1880. }
  1881. else {
  1882. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
  1883. return false;
  1884. }
  1885. if (configObj.xiaomi.native_trygame_pos_id) {
  1886. this.xiaomiConfig.nativeTryGameIds = configObj.xiaomi.native_trygame_pos_id;
  1887. }
  1888. else {
  1889. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
  1890. // return false;
  1891. }
  1892. if (configObj.xiaomi.native_intersititial_pos_id) {
  1893. this.xiaomiConfig.nativeInsertIds = configObj.xiaomi.native_intersititial_pos_id;
  1894. }
  1895. else {
  1896. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
  1897. return false;
  1898. }
  1899. }
  1900. else {
  1901. Utils_1.utils.showLog("error" + "本地配置数据不包含‘xiaomi’字段!");
  1902. return false;
  1903. }
  1904. }
  1905. else {
  1906. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1907. return false;
  1908. }
  1909. return true;
  1910. };
  1911. /**
  1912. * 初始化uc
  1913. * @param data 配置
  1914. */
  1915. CommonConfig.prototype._init_uc = function (data) {
  1916. if (!data)
  1917. return false;
  1918. Utils_1.utils.showLog("本地配置数据:", data);
  1919. var configObj = JSON.parse(data);
  1920. if (configObj) {
  1921. if (configObj.uc) {
  1922. if (configObj.uc.app_id) {
  1923. this.ucConfig.appID = configObj.uc.app_id;
  1924. }
  1925. else {
  1926. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1927. return false;
  1928. }
  1929. if (configObj.uc.version) {
  1930. this.ucConfig.version = configObj.uc.version;
  1931. }
  1932. else {
  1933. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  1934. return false;
  1935. }
  1936. if (configObj.uc.shares) {
  1937. if (configObj.uc.shares.sy_title) {
  1938. this.otherconfig.shareTitle = configObj.uc.shares.sy_title;
  1939. }
  1940. else {
  1941. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
  1942. return false;
  1943. }
  1944. if (configObj.uc.shares.sy_img) {
  1945. this.otherconfig.shareImgUrl = configObj.uc.shares.sy_img;
  1946. }
  1947. else {
  1948. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
  1949. return false;
  1950. }
  1951. }
  1952. else {
  1953. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  1954. return false;
  1955. }
  1956. }
  1957. else {
  1958. Utils_1.utils.showLog("error" + "本地配置数据不包含‘uc’字段!");
  1959. return false;
  1960. }
  1961. }
  1962. else {
  1963. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  1964. return false;
  1965. }
  1966. return true;
  1967. };
  1968. /**
  1969. * 初始化uc
  1970. * @param data 配置
  1971. */
  1972. CommonConfig.prototype._init_cocos = function (data) {
  1973. if (!data)
  1974. return false;
  1975. Utils_1.utils.showLog("本地配置数据:", data);
  1976. var configObj = JSON.parse(data);
  1977. if (configObj) {
  1978. if (configObj.cocos) {
  1979. if (configObj.cocos.app_id) {
  1980. this.cocosConfig.appID = configObj.cocos.app_id;
  1981. }
  1982. else {
  1983. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  1984. return false;
  1985. }
  1986. if (configObj.cocos.video_pos_id) {
  1987. this.cocosConfig.videoId = configObj.cocos.video_pos_id;
  1988. }
  1989. else {
  1990. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  1991. return false;
  1992. }
  1993. if (configObj.cocos.banner_pos_id) {
  1994. this.cocosConfig.bannerId = configObj.cocos.banner_pos_id;
  1995. }
  1996. else {
  1997. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  1998. return false;
  1999. }
  2000. if (configObj.cocos.intersititia_pos_id) {
  2001. this.cocosConfig.insertId = configObj.cocos.intersititia_pos_id;
  2002. }
  2003. else {
  2004. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  2005. return false;
  2006. }
  2007. if (configObj.cocos.shares) {
  2008. if (configObj.cocos.shares.sy_title) {
  2009. this.otherconfig.shareTitle = configObj.cocos.shares.sy_title;
  2010. }
  2011. else {
  2012. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareTitle’字段!");
  2013. return false;
  2014. }
  2015. if (configObj.cocos.shares.sy_img) {
  2016. this.otherconfig.shareImgUrl = configObj.cocos.shares.sy_img;
  2017. }
  2018. else {
  2019. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.shareImgUrl’字段!");
  2020. return false;
  2021. }
  2022. }
  2023. else {
  2024. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  2025. return false;
  2026. }
  2027. }
  2028. else {
  2029. Utils_1.utils.showLog("error" + "本地配置数据不包含‘cocos’字段!");
  2030. return false;
  2031. }
  2032. }
  2033. else {
  2034. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2035. return false;
  2036. }
  2037. return true;
  2038. };
  2039. /**
  2040. * 初始化原生安卓平台
  2041. * @param data 配置
  2042. */
  2043. CommonConfig.prototype._init_native_android = function () {
  2044. if (!Utils_1.utils.Tool_Native) {
  2045. return false;
  2046. }
  2047. var data = Utils_1.utils.Tool_Native.getNativeData();
  2048. Utils_1.utils.showLog("原生安卓平台本地配置数据:", data);
  2049. if (!data) {
  2050. Utils_1.utils.showLog("error : 安卓本地配置数据配置错误!");
  2051. return false;
  2052. }
  2053. var configObj = JSON.parse(data);
  2054. if (configObj) {
  2055. if (configObj.app_id) {
  2056. this.nativeAndroidConfig.appID = configObj.app_id;
  2057. }
  2058. else {
  2059. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2060. return false;
  2061. }
  2062. if (configObj.version) {
  2063. this.nativeAndroidConfig.version = configObj.version;
  2064. }
  2065. else {
  2066. Utils_1.utils.showMsg("error" + "本地配置数据不包含‘version’字段!");
  2067. return false;
  2068. }
  2069. if (configObj.channel) {
  2070. this.nativeAndroidConfig.channel = configObj.channel;
  2071. Utils_1.utils.showLog("原生平台渠道号 channel=" + configObj.channel);
  2072. }
  2073. else {
  2074. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2075. return false;
  2076. }
  2077. }
  2078. else {
  2079. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2080. return false;
  2081. }
  2082. return true;
  2083. };
  2084. /**
  2085. * 初始化原生IOS
  2086. */
  2087. CommonConfig.prototype._init_native_ios = function (data) {
  2088. if (!data)
  2089. return false;
  2090. Utils_1.utils.showLog("本地配置数据:", data);
  2091. var configObj = JSON.parse(data);
  2092. if (configObj) {
  2093. if (configObj.ios.app_id) {
  2094. this.nativeIoSConfig.appID = configObj.ios.app_id;
  2095. }
  2096. else {
  2097. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2098. return false;
  2099. }
  2100. if (configObj.ios.video_pos_id) {
  2101. this.nativeIoSConfig.videoId = configObj.ios.video_pos_id;
  2102. }
  2103. else {
  2104. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  2105. return false;
  2106. }
  2107. if (configObj.ios.version) {
  2108. this.nativeIoSConfig.version = configObj.ios.version;
  2109. }
  2110. else {
  2111. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  2112. return false;
  2113. }
  2114. if (configObj.ios.banner_pos_id) {
  2115. this.nativeIoSConfig.bannerId = configObj.ios.banner_pos_id;
  2116. }
  2117. else {
  2118. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  2119. return false;
  2120. }
  2121. if (configObj.ios.intersititia_pos_id) {
  2122. this.nativeIoSConfig.insertId = configObj.ios.intersititia_pos_id;
  2123. }
  2124. else {
  2125. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  2126. return false;
  2127. }
  2128. }
  2129. else {
  2130. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2131. return false;
  2132. }
  2133. return true;
  2134. };
  2135. /**
  2136. * 初始化bili
  2137. * @param data 配置
  2138. */
  2139. CommonConfig.prototype._init_bili = function (data) {
  2140. if (!data)
  2141. return false;
  2142. Utils_1.utils.showLog("本地配置数据:", data);
  2143. var configObj = JSON.parse(data);
  2144. if (configObj) {
  2145. if (configObj.bili.shares.sy_title) {
  2146. this.otherconfig.shareTitle = configObj.bili.shares.sy_title;
  2147. }
  2148. else {
  2149. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
  2150. return false;
  2151. }
  2152. if (configObj.bili.shares.sy_img) {
  2153. this.otherconfig.shareImgUrl = configObj.bili.shares.sy_img;
  2154. }
  2155. else {
  2156. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
  2157. return false;
  2158. }
  2159. }
  2160. else {
  2161. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2162. return false;
  2163. }
  2164. return true;
  2165. };
  2166. /**
  2167. * 初始化快手
  2168. * @param data 配置
  2169. */
  2170. CommonConfig.prototype._init_kwai = function (data) {
  2171. if (!data)
  2172. return false;
  2173. Utils_1.utils.showLog("本地配置数据:", data);
  2174. var configObj = JSON.parse(data);
  2175. if (configObj) {
  2176. if (configObj.kwai.app_id) {
  2177. this.kwaiConfig.appID = configObj.kwai.app_id;
  2178. }
  2179. else {
  2180. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2181. return false;
  2182. }
  2183. if (configObj.kwai.video_pos_id) {
  2184. this.kwaiConfig.videoId = configObj.kwai.video_pos_id;
  2185. }
  2186. else {
  2187. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  2188. return false;
  2189. }
  2190. if (configObj.kwai.intersititia_pos_id) {
  2191. this.kwaiConfig.insertId = configObj.kwai.intersititia_pos_id;
  2192. }
  2193. else {
  2194. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  2195. }
  2196. if (configObj.kwai.version) {
  2197. this.kwaiConfig.version = configObj.kwai.version;
  2198. }
  2199. else {
  2200. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  2201. return false;
  2202. }
  2203. if (configObj.kwai.shares) {
  2204. if (configObj.kwai.shares.sy_title) {
  2205. this.otherconfig.shareTitle = configObj.kwai.shares.sy_title;
  2206. }
  2207. else {
  2208. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_title’字段!");
  2209. return false;
  2210. }
  2211. if (configObj.kwai.shares.sy_img) {
  2212. this.otherconfig.shareImgUrl = configObj.kwai.shares.sy_img;
  2213. }
  2214. else {
  2215. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_img’字段!");
  2216. return false;
  2217. }
  2218. if (configObj.kwai.shares.sy_icon) {
  2219. this.otherconfig.shareIcon = configObj.kwai.shares.sy_icon;
  2220. }
  2221. else {
  2222. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_icon");
  2223. return false;
  2224. }
  2225. if (configObj.kwai.shares.sy_desc) {
  2226. this.otherconfig.shareDesc = configObj.kwai.shares.sy_desc;
  2227. }
  2228. else {
  2229. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares.sy_desc’字段!");
  2230. return false;
  2231. }
  2232. }
  2233. else {
  2234. Utils_1.utils.showLog("error" + "本地配置数据不包含‘shares’字段!");
  2235. return false;
  2236. }
  2237. }
  2238. else {
  2239. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2240. return false;
  2241. }
  2242. return true;
  2243. };
  2244. /**
  2245. * 初始化facebook
  2246. * @param data 配置
  2247. */
  2248. CommonConfig.prototype._init_facebook = function (data) {
  2249. if (!data)
  2250. return false;
  2251. Utils_1.utils.showLog("本地配置数据:", data);
  2252. var configObj = JSON.parse(data);
  2253. if (configObj) {
  2254. if (configObj.faceBook.app_id) {
  2255. this.faceBookConfig.appID = configObj.faceBook.app_id;
  2256. }
  2257. else {
  2258. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2259. return false;
  2260. }
  2261. if (configObj.faceBook.video_pos_id) {
  2262. this.faceBookConfig.videoId = configObj.faceBook.video_pos_id;
  2263. }
  2264. else {
  2265. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  2266. return false;
  2267. }
  2268. if (configObj.faceBook.intersititia_pos_id) {
  2269. this.faceBookConfig.insertId = configObj.faceBook.intersititia_pos_id;
  2270. }
  2271. else {
  2272. Utils_1.utils.showLog("error" + "本地配置数据不包含‘intersititia_pos_id’字段!");
  2273. return false;
  2274. }
  2275. if (configObj.faceBook.banner_pos_id) {
  2276. this.faceBookConfig.bannerId = configObj.faceBook.banner_pos_id;
  2277. }
  2278. else {
  2279. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  2280. return false;
  2281. }
  2282. if (configObj.faceBook.version) {
  2283. this.faceBookConfig.version = configObj.faceBook.version;
  2284. }
  2285. else {
  2286. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  2287. return false;
  2288. }
  2289. }
  2290. else {
  2291. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2292. return false;
  2293. }
  2294. Utils_1.utils.showLog("success" + "本地配置数据验证完成!");
  2295. return true;
  2296. };
  2297. /**
  2298. * 初始化Hago
  2299. * @param data 配置
  2300. */
  2301. CommonConfig.prototype._init_hago = function (data) {
  2302. if (!data)
  2303. return false;
  2304. Utils_1.utils.showLog("本地配置数据:", data);
  2305. var configObj = JSON.parse(data);
  2306. if (configObj) {
  2307. if (configObj.hago.app_id) {
  2308. this.hagoConfig.appID = configObj.hago.app_id;
  2309. }
  2310. else {
  2311. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2312. return false;
  2313. }
  2314. if (configObj.hago.video_pos_id) {
  2315. this.hagoConfig.videoId = configObj.hago.video_pos_id;
  2316. }
  2317. else {
  2318. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  2319. return false;
  2320. }
  2321. if (configObj.hago.version) {
  2322. this.hagoConfig.version = configObj.hago.version;
  2323. }
  2324. else {
  2325. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  2326. return false;
  2327. }
  2328. }
  2329. else {
  2330. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2331. return false;
  2332. }
  2333. return true;
  2334. };
  2335. /**
  2336. * 初始化Huawei
  2337. * @param data 配置
  2338. */
  2339. CommonConfig.prototype._init_huawei = function (data) {
  2340. if (!data)
  2341. return false;
  2342. Utils_1.utils.showLog("本地配置数据:", data);
  2343. var configObj = JSON.parse(data);
  2344. if (configObj) {
  2345. if (configObj.huawei.app_id) {
  2346. this.huaweiConfig.appID = configObj.huawei.app_id;
  2347. }
  2348. else {
  2349. Utils_1.utils.showLog("error" + "本地配置数据不包含‘app_id’字段!");
  2350. return false;
  2351. }
  2352. if (configObj.huawei.video_pos_id) {
  2353. this.huaweiConfig.videoId = configObj.huawei.video_pos_id;
  2354. }
  2355. else {
  2356. Utils_1.utils.showLog("error" + "本地配置数据不包含‘video_pos_id’字段!");
  2357. return false;
  2358. }
  2359. if (configObj.huawei.banner_pos_id) {
  2360. this.huaweiConfig.bannerId = configObj.huawei.banner_pos_id;
  2361. }
  2362. else {
  2363. Utils_1.utils.showLog("error" + "本地配置数据不包含‘banner_pos_id’字段!");
  2364. return false;
  2365. }
  2366. if (configObj.huawei.native_banner_pos_id) {
  2367. this.huaweiConfig.nativeBannerIds = configObj.huawei.native_banner_pos_id;
  2368. }
  2369. else {
  2370. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_banner_pos_id’字段!");
  2371. }
  2372. if (configObj.huawei.native_intersititial_pos_id) {
  2373. this.huaweiConfig.nativeInsertIds = configObj.huawei.native_intersititial_pos_id;
  2374. }
  2375. else {
  2376. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_intersititial_pos_id’字段!");
  2377. }
  2378. if (configObj.huawei.native_trygame_pos_id) {
  2379. this.huaweiConfig.nativeTryGameIds = configObj.huawei.native_trygame_pos_id;
  2380. }
  2381. else {
  2382. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_trygame_pos_id’字段!");
  2383. }
  2384. if (configObj.huawei.native_splash_id) {
  2385. this.huaweiConfig.nativeSplashId = configObj.huawei.native_splash_id;
  2386. }
  2387. else {
  2388. Utils_1.utils.showLog("error" + "本地配置数据不包含‘native_splash_id’字段!");
  2389. }
  2390. if (configObj.huawei.umeng_id) {
  2391. this.huaweiConfig.umengId = configObj.huawei.umeng_id;
  2392. }
  2393. else {
  2394. Utils_1.utils.showLog("error" + "本地配置数据不包含‘umeng_id’字段,不启用友盟统计!");
  2395. }
  2396. if (configObj.huawei.version) {
  2397. this.huaweiConfig.version = configObj.huawei.version;
  2398. }
  2399. else {
  2400. Utils_1.utils.showLog("error" + "本地配置数据不包含‘version’字段!");
  2401. return false;
  2402. }
  2403. }
  2404. else {
  2405. Utils_1.utils.showLog("error" + "本地配置数据不是合法的json数据!");
  2406. return false;
  2407. }
  2408. return true;
  2409. };
  2410. __decorate([
  2411. property({ type: OtherConfig, tooltip: "其他配置", displayName: "其他配置" })
  2412. ], CommonConfig.prototype, "otherconfig", void 0);
  2413. CommonConfig = __decorate([
  2414. ccclass("CommonConfig")
  2415. ], CommonConfig);
  2416. return CommonConfig;
  2417. }());
  2418. exports.default = CommonConfig;
  2419. cc._RF.pop();