app-ad.js 2.9 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/app-ad/app-ad"],{"23f4":function(t,n,e){"use strict";var i=e("a58b"),a=e.n(i);a.a},"2a63":function(t,n,e){"use strict";e.r(n);var i=e("8ed1"),a=e("fe1d");for(var o in a)"default"!==o&&function(t){e.d(n,t,(function(){return a[t]}))}(o);e("23f4");var d,r=e("f0c5"),c=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"b01a8b4a",null,!1,i["a"],d);n["default"]=c.exports},"8ed1":function(t,n,e){"use strict";var i;e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return o})),e.d(n,"a",(function(){return i}));var a=function(){var t=this,n=t.$createElement;t._self._c},o=[]},a58b:function(t,n,e){},c1a7:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e={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,interstitialAd:null}},created:function(){this.init()},methods:{onAdLoad:function(){},onAdPlay:function(){},onAdClose:function(){},onAdError:function(){},init:function(){switch(this.type){case"rewarded-video":this.initRewardedVideoAd();break;case"interstitial":this.initInterstitialAd();break;default:break}},initRewardedVideoAd:function(){var t=this;wx.createRewardedVideoAd&&(this.rewardedVideoAd=wx.createRewardedVideoAd({adUnitId:this.unitId}),this.rewardedVideoAd.onClose((function(n){n&&n.isEnded&&t.getUserCoupon()})))},initInterstitialAd:function(){wx.createInterstitialAd&&(this.interstitialAd=wx.createInterstitialAd({adUnitId:this.unitId}))},showRewardedVideoAd:function(){var n=this;this.rewardedVideoAd.show().catch((function(){n.rewardedVideoAd.load().then((function(){return n.rewardedVideoAd.show()})).catch((function(n){t.showToast({title:n.errMsg,icon:"none"})}))}))},showInterstitialAd:function(){this.interstitialAd.show().catch((function(n){t.showToast({title:n.errMsg,icon:"none"})}))},getUserCoupon:function(){var n=this;this.$request({url:this.couponUrl,method:"POST",data:Object.assign({},this.couponParams)}).then((function(e){0===e.code?n.$store.dispatch("page/actionSetCoupon",{list:e.data.list,type:"award"}):t.showToast({title:e.msg,icon:"none"})}))}}};n.default=e}).call(this,e("543d")["default"])},fe1d:function(t,n,e){"use strict";e.r(n);var i=e("c1a7"),a=e.n(i);for(var o in i)"default"!==o&&function(t){e.d(n,t,(function(){return i[t]}))}(o);n["default"]=a.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/page-component/app-ad/app-ad-create-component',
  4. {
  5. 'components/page-component/app-ad/app-ad-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("2a63"))
  7. })
  8. },
  9. [['components/page-component/app-ad/app-ad-create-component']]
  10. ]);