(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon/give/give"],{"0d9c":function(e,t,o){"use strict";o.r(t);var n=o("ba5b"),i=o.n(n);for(var r in n)"default"!==r&&function(e){o.d(t,e,(function(){return n[e]}))}(r);t["default"]=i.a},4983:function(e,t,o){"use strict";(function(e){o("b8bc");n(o("66fd"));var t=n(o("5ab1"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,o("543d")["createPage"])},"5ab1":function(e,t,o){"use strict";o.r(t);var n=o("a5f7"),i=o("0d9c");for(var r in i)"default"!==r&&function(e){o.d(t,e,(function(){return i[e]}))}(r);o("ec68");var c,u=o("f0c5"),a=Object(u["a"])(i["default"],n["b"],n["c"],!1,null,"7a7df176",null,!1,n["a"],c);t["default"]=a.exports},a5f7:function(e,t,o){"use strict";var n;o.d(t,"b",(function(){return i})),o.d(t,"c",(function(){return r})),o.d(t,"a",(function(){return n}));var i=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.shareShow=!0})},r=[]},ba5b:function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o("2f62"),i=r(o("99c8"));function r(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){a(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function a(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var s=function(){o.e("components/page-component/app-related-suggestion-product/app-related-suggestion-product").then(function(){return resolve(o("3d12"))}.bind(null,o)).catch(o.oe)},d=function(){o.e("components/page-component/app-share-qr-code-poster/app-share-qr-code-poster").then(function(){return resolve(o("b12d"))}.bind(null,o)).catch(o.oe)},p={name:"give",components:{AppRelatedSuggestionProduct:s,appShareQrCode:d},data:function(){return{recommendGoodsList:null,shareShow:!1,modal:{show:!1,msg:"",is_show_back:!1},coupon:null,user_id:0,img_finish_receiving:null}},computed:u(u(u({},(0,n.mapState)({couponImg:function(e){return e.mallConfig.__wxapp_img.coupon}})),(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"})),{},{contentStyle:function(){var e="";return this.coupon?(e=1===this.coupon.status?"background-image: url("+this.coupon.receive_coupon_bg+")":"background-image: url("+this.coupon.coupon_bg+")",e):""}}),onLoad:function(e){"undefined"!==typeof e.user_id&&(this.user_id=e.user_id),this.getList(e.coupon_id),this.loadRecommendGoodsList()},methods:{getList:function(e){var t=this;this.$showLoading(),this.$request({url:this.$api.coupon.give,data:{coupon_id:e,user_id:this.user_id}}).then((function(e){t.$hideLoading(),t.img_finish_receiving=e.data.img_finish_receiving,0==e.code?t.coupon=e.data:t.modal={show:!0,msg:e.msg,is_show_back:!0}})).catch((function(e){t.$hideLoading()}))},loadRecommendGoodsList:function(){var e=this;this.$request({url:this.$api.goods.new_recommend,method:"get",data:{type:"order_pay"}}).then((function(t){0===t.code&&(e.recommendGoodsList=t.data.list)})).catch((function(e){}))},btnClick:function(){this.modal.is_show_back?(0,i.default)({open_type:"redirect",url:"/pages/index/index"}):this.modal.show=!1},receive:function(){var e=this;this.$showLoading(),this.$request({url:this.$api.coupon.receive,method:"get",data:{coupon_id:this.coupon.id}}).then((function(t){e.$hideLoading(),0===t.code?e.getList(e.coupon.id):e.modal={show:!0,msg:t.msg,is_show_back:!1}}))},toGoods:function(){e.redirectTo({url:this.coupon.page_url})}},onShareAppMessage:function(e){return this.$shareAppMessage({title:this.coupon.app_share_title,imageUrl:this.coupon.app_share_pic?this.coupon.app_share_pic:this.couponImg.img_coupon_2,path:"/pages/coupon/give/give",params:{coupon_id:this.coupon.id}})}};t.default=p}).call(this,o("543d")["default"])},e339:function(e,t,o){},ec68:function(e,t,o){"use strict";var n=o("e339"),i=o.n(n);i.a}},[["4983","common/runtime","common/vendor"]]]);