(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon/list/list"],{"049c":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.list,(function(e,n){var o=t.__get_orig(e),i=2==e.type?t._f("keepNumbers")(e.sub_price):null,r=2!=e.type?t._f("keepNumbers")(e.discount):null,a=e.min_price>0?t._f("keepNumbers")(e.min_price):null,c=e.discount_limit?t._f("keepNumbers")(e.discount_limit):null;return{$orig:o,f0:i,f1:r,f2:a,f3:c}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},r=[]},"0c8e":function(t,e,n){"use strict";var o=n("644a"),i=n.n(o);i.a},"5bd6":function(t,e,n){"use strict";n.r(e);var o=n("5e28"),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},"5e28":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("2f62");function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c={data:function(){return{list:[],loading:!1,page:2}},computed:r(r({},(0,o.mapState)({couponImg:function(t){return t.mallConfig.__wxapp_img.coupon}})),(0,o.mapGetters)({userInfo:"user/info"})),methods:{getList:function(){var e=this;e.$request({url:e.$api.coupon.list,method:"get"}).then((function(n){t.hideLoading(),e.$hideLoading(),0===n.code?e.list=n.data.list:t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){t.hideLoading(),e.$hideLoading()}))},getMore:function(){var e=this;t.showLoading({title:"加载中..."}),e.$request({url:e.$api.coupon.list,data:{page:e.page}}).then((function(n){t.hideLoading(),0==n.code?n.data.list.length>0&&(e.list=e.list.concat(n.data.list),e.page++):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(e){t.hideLoading()}))},toDetail:function(e){t.navigateTo({url:"/pages/coupon/details/details?id="+e})},receive:function(e){var n=this;if(n.loading)return!1;n.loading=!0,t.showLoading({title:"领取中..."}),n.$request({url:n.$api.coupon.receive,data:{coupon_id:e.id}}).then((function(o){n.loading=!1,t.hideLoading(),0===o.code?setTimeout((function(t){n.$store.dispatch("page/actionSetCoupon",{list:[Object.assign(e,o.data)],type:"receive"}),n.getList()}),200):(t.showToast({title:o.msg,icon:"none",duration:1e3}),n.getList())})).catch((function(){t.hideLoading(),n.$event.on(n.$const.EVENT_USER_LOGIN).then((function(){n.receive(e)}))}))}},onLoad:function(){this.$commonLoad.onload()},onShow:function(){this.$showLoading({text:"加载中..."}),this.getList()},filters:{keepNumbers:function(t){return Number(t)}},onReachBottom:function(){this.getMore()}};e.default=c}).call(this,n("543d")["default"])},"644a":function(t,e,n){},"7aa9":function(t,e,n){"use strict";n.r(e);var o=n("049c"),i=n("5bd6");for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("0c8e");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"679de4e8",null,!1,o["a"],a);e["default"]=u.exports},"88c3":function(t,e,n){"use strict";(function(t){n("2d0a");o(n("66fd"));var e=o(n("7aa9"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])}},[["88c3","common/runtime","common/vendor"]]]);