(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/community/poster/poster"],{"0e2b":function(t,e,i){},"57d95":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var a=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__map(t.styleList,(function(e,i){var n=t.__get_orig(e),a=t.config.activity_poster_style.indexOf(e.value.toString());return{$orig:n,g0:a}})));t.$mp.data=Object.assign({},{$root:{l0:i}})},o=[]},8582:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2f62");function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function o(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var r={name:"goods",data:function(){return{styleList:[{label:"样式一",value:1},{label:"样式二",value:2},{label:"样式三",value:3},{label:"样式四",value:4}],bg:"",typeList:[],selectForm:null,config:{color:[],activity_poster_style:[]},address:"",info:{},activity:{},middleman:{},rpx:1,canvas:null,canvas2:null,ctx:null,activity_id:0,middleman_id:0}},computed:o(o({cStyle:function(){var e="";return console.log(t.getSystemInfoSync().windowHeight),t.getSystemInfoSync().windowHeight>672&&(e+="margin: 17% auto;"),this.selectForm&&1==this.selectForm.type?e+="background-color:".concat(this.selectForm.color,";"):this.selectForm&&3==this.selectForm.type&&(e+="background-image:url(".concat(this.config.image_bg,");")),e}},(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"})),(0,n.mapState)({community:function(t){return t.mallConfig.__wxapp_img.community}})),onLoad:function(t){this.$commonLoad.onload(t);var e=this;e.$showLoading({text:"加载中"}),e.activity_id=t.activity_id,e.middleman_id=t.middleman_id,e.loadData()},methods:{loadData:function(){var e=this;e.$request({url:e.$api.community.poster,data:{activity_id:e.activity_id,middleman_id:e.middleman_id}}).then((function(i){if(e.$hideLoading(),0===i.code)switch(e.config=i.data.config,e.info=i.data.info,e.middleman=i.data.middleman,e.activity=i.data.activity,e.activity.goods_list=e.activity.goods_list.slice(0,6),5==e.activity.goods_list.length&&e.activity.goods_list.push(""),e.address=e.middleman.city+e.middleman.district,e.middleman.city!=e.middleman.province&&(e.address=e.middleman.province+e.address),e.typeList=[{label:"纯色",value:1},{label:"背景图",value:3}],e.selectForm={color:e.config["color"][0],style:e.config["activity_poster_style"][0],type:3},e.config["activity_poster_style"][0]){case"1":e.bg=e.community.style1;break;case"2":e.bg=e.community.style2;break;case"3":e.bg=e.community.style3;break;case"4":e.bg=e.community.style4;break}else t.showToast({title:i.msg,icon:"none"})}))},changeStyle:function(t){var e=this;switch(e.selectForm.style=t,e.selectForm.style){case 1:e.bg=e.community.style1;break;case 2:e.bg=e.community.style2;break;case 3:e.bg=e.community.style3;break;case 4:e.bg=e.community.style4;break}},changeType:function(t){var e=this;e.selectForm.type=t},changeColor:function(t){var e=this;e.selectForm.color=t},submitSave:function(){var e=this;this.$showLoading({text:"生成中"});var i=this.selectForm;i.activity_id=this.activity_id,i.middleman_id=this.middleman_id,this.$request({url:this.$api.community.poster_share,data:this.selectForm}).then((function(i){e.$hideLoading();var n=i.code,a=i.data,o=i.msg;if(0===n){var c=a.pic_url;e.$utils.batchSave(c,"image").then((function(){t.showToast({title:"保存成功"})}))}else t.showToast({title:o,icon:"none"})})).catch((function(){e.$hideLoading()}))}}};e.default=r}).call(this,i("543d")["default"])},bd3b:function(t,e,i){"use strict";i.r(e);var n=i("57d95"),a=i("ec1d");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("eb74");var c,r=i("f0c5"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"7cc108b5",null,!1,n["a"],c);e["default"]=s.exports},c56a:function(t,e,i){"use strict";(function(t){i("2d0a");n(i("66fd"));var e=n(i("bd3b"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},eb74:function(t,e,i){"use strict";var n=i("0e2b"),a=i.n(n);a.a},ec1d:function(t,e,i){"use strict";i.r(e);var n=i("8582"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a}},[["c56a","common/runtime","common/vendor"]]]);