(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-coupon/diy-coupon"],{"33e2":function(t,o,n){},"37a5":function(t,o,n){"use strict";var e=n("33e2"),u=n.n(e);u.a},"37b3":function(t,o,n){"use strict";var e=n("91db"),u=n.n(e);u.a},"49e5":function(t,o,n){"use strict";(function(t){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var e=u(n("4c22"));function u(t){return t&&t.__esModule?t:{default:t}}var i={components:{},name:"diy-coupon",props:{value:{type:Object,default:function(){return{}}}},mixins:[e.default],data:function(){return{token:"",couponList:[],isHave:!0,couponBtnSwitch:!1,isSuccess:!1}},created:function(){this.getCanReceiveCouponQuery()},methods:{couponTap:function(t,o){0==t.useState?this.receiveCoupon(t,o):this.toGoodsList(t)},getCanReceiveCouponQuery:function(){var t=this,o={page:1,page_size:this.value.couponCount};"diy"==this.value.sources&&(o.coupon_type_id_arr=this.value.couponIds.toString()),this.$api.sendRequest({url:"/coupon/api/coupon/typepagelists",data:o,success:function(o){var n=o.data;null!=n&&(t.couponList=n.list,t.couponList.forEach((function(t){t.useState=0})))}})},receiveCoupon:function(o,n){var e=this;if(!this.couponBtnSwitch){this.couponBtnSwitch=!0;var u=t.getStorageSync("token");""!=u?this.$api.sendRequest({url:"/coupon/api/coupon/receive",data:{coupon_type_id:o.coupon_type_id,get_type:2},success:function(t){t.data;var n=t.message;0==t.code&&(n="领取成功");var u=e.couponList;if(1==t.data.is_exist)for(var i=0;i<u.length;i++)u[i].coupon_type_id==o.coupon_type_id&&(u[i].useState=1);else for(var c=0;c<u.length;c++)u[c].coupon_type_id==o.coupon_type_id&&(u[c].useState=2);e.$util.showToast({title:n}),e.couponBtnSwitch=!1,e.$forceUpdate()},fail:function(t){e.couponBtnSwitch=!1}}):(this.$util.redirectTo("/pages/login/login/login"),this.couponBtnSwitch=!0)}},toGoodsList:function(t){1!=t.goods_type?this.$util.redirectTo("/pages/goods/list/list",{coupon:t.coupon_type_id}):this.$util.redirectTo("/pages/goods/list/list",{})}}};o.default=i}).call(this,n("543d")["default"])},"4e49":function(t,o,n){"use strict";n.r(o);var e=n("b1a8"),u=n("c6f4");for(var i in u)"default"!==i&&function(t){n.d(o,t,(function(){return u[t]}))}(i);n("37b3"),n("37a5");var c,a=n("f0c5"),s=Object(a["a"])(u["default"],e["b"],e["c"],!1,null,"1ea8d314",null,!1,e["a"],c);o["default"]=s.exports},"91db":function(t,o,n){},b1a8:function(t,o,n){"use strict";var e,u=function(){var t=this,o=t.$createElement,n=(t._self._c,t.$util.img("/upload/uniapp/coupon/coupon.png")),e=t.__map(t.couponList,(function(o,n){var e=Number(o.money),u=Number(o.discount),i=Number(o.at_least);return{$orig:t.__get_orig(o),m0:e,m1:u,m2:i}})),u=t.$util.img("/upload/uniapp/coupon/coupon_shu.png"),i=t.__map(t.couponList,(function(o,n){var e=Number(o.money),u=Number(o.discount),i=Number(o.at_least);return{$orig:t.__get_orig(o),m3:e,m4:u,m5:i}}));t.$mp.data=Object.assign({},{$root:{g0:n,l0:e,g1:u,l1:i}})},i=[];n.d(o,"b",(function(){return u})),n.d(o,"c",(function(){return i})),n.d(o,"a",(function(){return e}))},c6f4:function(t,o,n){"use strict";n.r(o);var e=n("49e5"),u=n.n(e);for(var i in e)"default"!==i&&function(t){n.d(o,t,(function(){return e[t]}))}(i);o["default"]=u.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/diy-coupon/diy-coupon-create-component',
    {
        'components/diy-coupon/diy-coupon-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("4e49"))
        })
    },
    [['components/diy-coupon/diy-coupon-create-component']]
]);
