(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/gift/share/share"],{"53d1":function(t,e,n){},"5b42":function(t,e,n){"use strict";n.r(e);var i=n("e875"),r=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a},"61ed":function(t,e,n){"use strict";var i=n("53d1"),r=n.n(i);r.a},abe8:function(t,e,n){"use strict";n.r(e);var i=n("e7ba"),r=n("5b42");for(var o in r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);n("61ed");var a,u=n("f0c5"),c=Object(u["a"])(r["default"],i["b"],i["c"],!1,null,"5d5c0420",null,!1,i["a"],a);e["default"]=c.exports},e096:function(t,e,n){"use strict";(function(t){n("b8bc");i(n("66fd"));var e=i(n("abe8"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},e7ba:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},e875:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("a34a")),r=n("2f62");function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e,n,i,r,o,a){try{var u=t[o](a),c=u.value}catch(s){return void n(s)}u.done?e(c):Promise.resolve(c).then(i,r)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){s(o,i,r,a,u,"next",t)}function u(t){s(o,i,r,a,u,"throw",t)}a(void 0)}))}}var d=function(){n.e("plugins/gift/components/announcement/share-gift-text").then(function(){return resolve(n("e6f0"))}.bind(null,n)).catch(n.oe)},l=function(){n.e("plugins/gift/components/share/gift-content").then(function(){return resolve(n("ddf1"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/page-component/app-share-qr-code-poster/app-share-qr-code-poster").then(function(){return resolve(n("b12d"))}.bind(null,n)).catch(n.oe)},g={name:"share",data:function(){return{gift_id:-1,gift_detail:{},share:!1,url:"",loading:!1,is_play:!1,innerAudioContext:""}},onLoad:function(e){if(JSON.parse(e.pay_data).gift_id){this.gift_id=JSON.parse(e.pay_data).gift_id,this.request(JSON.parse(e.pay_data).gift_id),this.$storage.removeStorageSync("GIFT_CART");var n=this;this.innerAudioContext=t.createInnerAudioContext(),this.innerAudioContext.autoplay=!0,this.innerAudioContext.onEnded((function(t){n.is_play=!1}))}else t.redirectTo({url:"/plugins/gift/index/index"})},onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/gift/index/index",imageUrl:0===this.gift_detail.is_big_gift?this.gift_detail.list.sendOrder[0].detail[0].goods.goodsWarehouse.cover_pic:this.big_gift_pic,params:{gift_id:this.gift_id},title:this.gift_detail.list.bless_word})},methods:{request:function(e){var n=this;return f(i.default.mark((function r(){var o;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n.$utils.showLoading(),i.next=3,n.$request({url:n.$api.gift.gift,method:"get",data:{gift_id:e}});case 3:o=i.sent,n.$utils.hideLoading(),0===o.code?(n.url="".concat(n.$api.gift.poster,"&gift_id=").concat(e),n.gift_detail=o.data,n.loading=!0):t.showModal({title:"提示",content:o.msg});case 6:case"end":return i.stop()}}),r)})))()},setShare:function(){this.share=!0},play:function(t,e){this.is_play=t,t?(this.innerAudioContext.src=e,this.innerAudioContext.play()):this.innerAudioContext.stop()}},computed:u({},(0,r.mapState)("gift",{theme:function(t){return t.theme},big_gift_pic:function(t){return t.big_gift_pic}})),onHide:function(){this.is_play=!1,this.innerAudioContext.stop()},components:{"share-gift-text":d,"gift-content":l,"app-share-qr-code-poster":p}};e.default=g}).call(this,n("543d")["default"])}},[["e096","common/runtime","common/vendor"]]]);