(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/app-exclusive-coupon/app-exclusive-coupon-two"],{"20fd":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"app-exclusive-coupon-two",props:{receiveBg:{type:String,default:function(){return""}},list:{type:Array,default:function(){return[]}},textColor:{type:String,default:function(){return"#ffffff"}},unclaimedBg:{type:String,default:function(){return""}},index:{type:Number},sign:{type:String},noneColor:{type:Boolean,default:function(){return!1}},background:String,page_id:Number,template_id:Number,is_required:Boolean,coupon_req:Boolean,couponBg:{type:String,default:"#D9BC8B"},addType:String,couponBgType:{type:String,default:function(){return"#pure"}},dIndex:{type:Array,default:function(){return[0,0]}},mIndex:{type:Array,default:function(){return[0,0]}},dType:String},data:function(){return{coupon_list:[]}},computed:{receiveTip:function(){var t="立即领取";return"integral-mall"===this.sign&&(t="立即兑换"),t},couponBgImg:function(){switch(this.coupon_list.length){case 1:return"/static/image/diy/bg_coupon_index_1.png";case 2:return"/static/image/diy/bg_coupon_index_2.png";case 3:return"/static/image/diy/bg_coupon_index_3.png";default:return"/static/image/diy/bg_coupon_index_4.png"}},couponBoxStyle:function(){var e=this;return function(n,i){var o,a,r=e.coupon_list,c=t.getSystemInfoSync().windowWidth,u=750/c;switch(r.length){case 1:o="".concat(parseInt(702/u),"px");break;case 2:o="".concat(parseInt(341/u),"px");break;case 3:o="".concat(parseInt(220/u),"px");break;default:o="".concat(parseInt(274/u),"px");break}var s={"margin-left":"".concat(20/u,"px")};return 0===i&&(s=Object.assign(s,{"margin-left":"".concat(24/u,"px")})),i===e.coupon_list.length-1&&(s=Object.assign(s,{"margin-right":"".concat(24/u,"px")})),a=n.is_receive>0?"#B4B4B4":"gradient"===e.couponBgType?"linear-gradient(to left, "+e.couponBg+","+e.$utils.colorRgba(e.couponBg,.5)+")":e.couponBg,Object.assign(s,{background:a,width:o,"min-width":r.length>3?o:"auto"})}}},methods:{flushCache:function(t){if(0==this.page_id){var e=this.$storage.getStorageSync("INDEX_MALL"),n=this.dIndex,i=this.mIndex;"module"===this.dType?e.home_pages.navs[i[0]].template.data[i[1]].data.list[n[0]].data[n[1]].data.coupon_list=t:e.home_pages.navs[n[0]].template.data[n[1]].data.coupon_list=t,this.$storage.setStorageSync("INDEX_MALL",e)}},receive:function(e){var n=this,i=this.coupon_list;if("integral-mall"!=this.sign){if(1==i[e].is_receive)return t.showToast({mask:!0,title:"已领取",icon:"none"}),!0;t.showLoading({mask:!0,title:"领取中"}),this.$request({url:this.$api.coupon.receive,data:{coupon_id:i[e].id}}).then((function(i){if(t.hideLoading(),0===i.code){0==i.data.rest&&(n.coupon_list[e].is_receive="1");var o=n.coupon_list;n.flushCache(o),n.$store.dispatch("page/actionSetCoupon",{list:[Object.assign(o[e],i.data)],type:"receive"})}else t.showToast({title:i.msg,icon:"none"})})).catch((function(){t.hideLoading()}))}else this.$jump({url:i[e].page_url,open_type:"navigate"})},loadData:function(){var t=this;this.$request({url:this.$api.index.extra,data:{type:"mall",key:"coupon",page_id:this.page_id,index:this.index}}).then((function(e){if(t.coupon_list=e.data,0===t.page_id){var n=t.$storage.getStorageSync("INDEX_MALL");n.home_pages[t.index].list=t.coupon_list,t.$storage.setStorageSync("INDEX_MALL",n)}}))}},mounted:function(){if(this.coupon_req)this.coupon_list=this.list;else if(this.is_required)this.loadData();else{var t=this.$storage.getStorageSync("INDEX_MALL");this.coupon_list=t.home_pages[this.index].list}}};e.default=n}).call(this,n("543d")["default"])},"37c4":function(t,e,n){"use strict";var i=n("e204"),o=n.n(i);o.a},"901d":function(t,e,n){"use strict";n.r(e);var i=n("20fd"),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},d601:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.coupon_list.length>0?t.__map(t.coupon_list,(function(e,n){var i=t.__get_orig(e),o=t.__get_style([t.couponBoxStyle(e,n)]);return{$orig:i,s0:o}})):null);t.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]},e204:function(t,e,n){},e88b:function(t,e,n){"use strict";n.r(e);var i=n("d601"),o=n("901d");for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n("37c4");var r,c=n("f0c5"),u=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,"686d7e7b",null,!1,i["a"],r);e["default"]=u.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/page-component/app-exclusive-coupon/app-exclusive-coupon-two-create-component',
    {
        'components/page-component/app-exclusive-coupon/app-exclusive-coupon-two-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("e88b"))
        })
    },
    [['components/page-component/app-exclusive-coupon/app-exclusive-coupon-two-create-component']]
]);
