(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/app-ad/app-ad"],{"5fa5":function(t,e,n){},"810a":function(t,e,n){"use strict";n.r(e);var o=n("b4d76"),i=n.n(o);for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},8970:function(t,e,n){"use strict";var o,i=function(){var t=this,e=t.$createElement;t._self._c},r=[];n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}))},"9e06":function(t,e,n){"use strict";var o=n("5fa5"),i=n.n(o);i.a},b4d76:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"app-ad",props:{type:String,unitId:String,picUrl:String,videoUrl:String,theme:{type:String,default:function(){return"white"}},couponUrl:String,couponParams:Object},data:function(){return{rewardedVideoAd:null,createInterstitialAd:null}},created:function(){this.init()},methods:{onAdLoad:function(t){console.log(t)},onAdPlay:function(t){console.log(t)},onAdClose:function(t){console.log(t)},onAdError:function(t){console.error(t)},init:function(){var t=this;switch(this.type){case"":break;case"rewarded-video":t.initRewardedVideoAd();break;case"interstitial":t.initInterstitialAd();break;case"video":break;case"before-video":break;case"grid":break}},initRewardedVideoAd:function(){var t=this;wx.createRewardedVideoAd&&(this.rewardedVideoAd=wx.createRewardedVideoAd({adUnitId:this.unitId}),this.rewardedVideoAd.onLoad((function(){console.log("rewardedVideoAd load")})),this.rewardedVideoAd.onError((function(t){console.error("rewardedVideoAd error",t)})),this.rewardedVideoAd.onClose((function(e){e&&e.isEnded?(console.log("领取"),t.getUserCoupon()):console.log("rewardedVideoAd emit",e)})))},initInterstitialAd:function(){wx.createInterstitialAd&&(this.interstitialAd=wx.createInterstitialAd({adUnitId:this.unitId}),this.interstitialAd.onLoad((function(){console.log("interstitialAd load")})),this.interstitialAd.onError((function(t){console.error("interstitialAd error",t)})),this.interstitialAd.onClose((function(t){console.log("interstitialAd close",t)})))},showRewardedVideoAd:function(){var e=this;this.rewardedVideoAd.show().catch((function(n){e.rewardedVideoAd.load().then((function(){return e.rewardedVideoAd.show()})).catch((function(e){t.showToast({title:e.errMsg,icon:"none"})}))}))},showInterstitialAd:function(){this.interstitialAd.show().catch((function(e){t.showToast({title:e.errMsg,icon:"none"})}))},getUserCoupon:function(){console.log(Object.assign({},this.couponParams));var e=this;e.$request({url:e.couponUrl,method:"POST",data:Object.assign({},this.couponParams)}).then((function(n){0===n.code?e.$store.dispatch("page/actionSetCoupon",{list:n.data.list,type:"award"}):t.showToast({title:n.msg,icon:"none"})}))}}};e.default=n}).call(this,n("543d")["default"])},c4cc:function(t,e,n){"use strict";n.r(e);var o=n("8970"),i=n("810a");for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("9e06");var d,a=n("f0c5"),s=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"4f82ca55",null,!1,o["a"],d);e["default"]=s.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/page-component/app-ad/app-ad-create-component',
    {
        'components/page-component/app-ad/app-ad-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("c4cc"))
        })
    },
    [['components/page-component/app-ad/app-ad-create-component']]
]);
