!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.qgsdk=e():n.qgsdk=e()}(window,(function(){return i={},n.m=e=[function(n,e,i){const t=i(1),o=i(2),s=i(3);i(4);var c=i(5).version;const r=i(6);n.exports={version:c,initConfig:null,channel:["wx","qq","oppo","vivo","xiaomi"],init:function(n){n&&n.channel&&n.func&&this.channel.includes(n.channel)&&(this.initConfig||(this.initConfig=n,this.bscn(this.initConfig.channel)))},login:async function(){if(this.initConfig){let n;switch(this.initConfig.channel){case"wx":o.init(),n=await o.checkSession();break;case"qq":t.init(),t.login();break;case"oppo":s.init(),s.login();break;case"vivo":r.init(),r.login();break;case"xiaomi":xiaomi.init()}return n}},getUserInfo:async function(){if(this.initConfig){let n={};switch(this.initConfig.channel){case"wx":n=o.getUserInfo();break;case"qq":n=t.getUserInfo()}return n}},bscn:function(n){switch(n){case"wx":o.wx=this.initConfig.func;break;case"qq":t.qq=this.initConfig.func}},ad:function(n){this.initConfig&&"qq"===channel&&t.createVideoAd(n)}}},function(n,e){n.exports={qq:null,videoAd:null,init:function(){this.qq},checkSession:function(){return new Promise((n,e)=>{let i=this;this.qq.checkSession({success(e){n(e)},fail(){i.login().then(e=>{n(e)})}})})},login:function(n){return new Promise((n,e)=>{this.qq.login({success:e=>{n(e.code)}})})},getUserInfo:async function(){return new Promise((n,e)=>{this.qq.getUserInfo({success:e=>{n(e)}})})},createVideoAd:async function(n){const e=this.qq.createRewardedVideoAd({adUnitId:n});e.show().catch(n=>{e.load().then(()=>e.show())}),e.onLoad(()=>{}),e.onError((n,e)=>{}),e.onClose(n=>{})},openAd:async function(){qq&&this.videoAd&&this.videoAd.load().then(()=>{this.videoAd.show()}).catch(n=>{})}}},function(n,e){n.exports={wx:null,init:function(){this.wx},checkSession:function(){return new Promise((n,e)=>{let i=this;this.wx.checkSession({success(e){"checkSession:ok"==e.errMsg&&n(e)},fail(){i.login().then(e=>{n(e)})}})})},login:function(){return new Promise((n,e)=>{this.wx.login({success:e=>{n(e.code)}})})},getUserInfo:async function(){return new Promise((n,e)=>{this.wx.getUserInfo({success:e=>{n(e)}})})}}},function(n,e,i){const t=i(0);n.exports={qg:null,init:function(){qg&&(this.qg=t.initConfig.qg)},login:function(){return new Promise((n,e)=>{this.qg.login({success:function(e){e=JSON.stringify(e.data),n(e)},fail:function(n){e(JSON.stringify(n))}})})}}},function(n,e){n.exports={request:function(n,e,i,t){}}},function(n){n.exports=JSON.parse('{"name":"quick_game_sdk","version":"1.0.4","description":"快游戏SDK","private":true,"scripts":{"start":"npm run dev","dev":"webpack --watch --env development","build":"webpack --env production","server":"webpack-dev-server --open --env development"},"keywords":["快游戏","SDK"],"author":"Mars Developer","license":"MIT","devDependencies":{"@babel/core":"^7.5.4","babel-loader":"^8.0.6","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.35.3","webpack-cli":"^3.3.5","webpack-dev-server":"^3.7.2","webpack-merge":"^4.2.1"}}')},function(n,e){n.exports={qg:null,init:function(){qg&&(this.qg=app.initConfig.qg)},login:function(){return new Promise((n,e)=>{this.qg.login({success:function(e){e=JSON.stringify(e.data),n(e)},fail:function(n){e(JSON.stringify(n))}})})}}}],n.c=i,n.d=function(e,i,t){n.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:t})},n.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},n.t=function(e,i){if(1&i&&(e=n(e)),8&i)return e;if(4&i&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var o in e)n.d(t,o,function(n){return e[n]}.bind(null,o));return t},n.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(i,"a",i),i},n.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},n.p="",n(n.s=0);function n(t){if(i[t])return i[t].exports;var o=i[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e,i}));
评论0