(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-coupon-poster"],{"82b4":function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return n}));var n={lPainter:r("577c").default},a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-uni-view",[r("v-uni-view",{staticClass:"hideCanvasView"},[r("l-painter",{ref:"painter",staticClass:"hideCanvas",attrs:{useCORS:!0}})],1),t.src?[r("v-uni-image",{staticClass:"code-img",attrs:{src:t.src},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.previewImage.apply(void 0,arguments)}}}),r("v-uni-view",{staticClass:"save-btn flex-center f-title c-base radius",style:{background:t.primaryColor},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toPreviewSave.apply(void 0,arguments)}}},[t._v(t._s(t.confirmText))]),r("v-uni-view",{staticClass:"space-safe"})]:t._e()],2)},i=[]},"8d9f":function(t,e,r){"use strict";r("6a54");var n=r("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(r("5de6")),i=n(r("9b1b")),o=n(r("2634")),s=n(r("2fdc")),u=r("8f59"),c={components:{},props:{},data:function(){return{confirmText:"长按上图保存图片",options:"",src:""}},computed:(0,u.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){var e=this;return(0,s.default)((0,o.default)().mark((function r(){var n;return(0,o.default)().wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.options=t,e.$util.setNavigationBarColor({bg:e.primaryColor}),e.widget=e.$refs.canvas,e.$util.showLoading(),e.$util.setNavigationBarColor({bg:e.primaryColor}),n=e,setTimeout((function(){n.canvase()}),1e3);case 7:case"end":return r.stop()}}),r)})))()},methods:(0,i.default)((0,i.default)({},(0,u.mapActions)(["user/report"])),{},{canvase:function(){var t=this;return(0,s.default)((0,o.default)().mark((function e(){var r,n,a,i,s,u,c,f,p,l;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t,n=t.userInfo,a=n.nickName,i=n.avatarUrl,s=t.$util.getPage(-1),s.qr_code,u=s.detail,c=u.share_img,a=a.substring(0,10),f=12*a.length+33,p=t.configInfo.app_name,l={css:{width:"652rpx",height:"966rpx",background:"#fff",borderRadius:"20rpx"},views:[{type:"image",src:c,css:{width:"652rpx",height:"652rpx",objectFit:"cover",position:"absolute",top:"0rpx",left:"0rpx",borderRadius:"20rpx 20rpx 0 0"}},{type:"text",text:a,css:{width:f,borderRadius:"27rpx",position:"absolute",top:"30rpx",left:"67rpx",fontSize:"26rpx",background:"#555",color:"#fff",textAlign:"center",padding:"7rpx 5rpx 12rpx 30rpx"}},{type:"image",src:i,css:{position:"absolute",width:"64rpx",height:"64rpx",objectFit:"cover",top:"23rpx",left:"33rpx",borderRadius:"32rpx",border:"3rpx solid #fff"}},{type:"text",text:p,css:{position:"absolute",bottom:"176rpx",left:"50rpx",fontSize:"28rpx",color:"#333",textAlign:"left"}},{type:"text",text:"微信扫一扫立即使用",css:{position:"absolute",bottom:"122rpx",left:"50rpx",fontSize:"28rpx",color:"#333",textAlign:"left"}},{type:"image",src:cover,css:{width:"242rpx",height:"242rpx",position:"absolute",bottom:"40rpx",right:"45rpx",borderRadius:"121rpx"}}]},t.$refs.painter.render(l),t.$refs.painter.canvasToTempFilePathSync({fileType:"jpg",quality:1,success:function(e){r.$util.hideAll(),t.src=e.tempFilePath}});case 10:case"end":return e.stop()}}),e)})))()},extraImage:function(){var t=this;return(0,s.default)((0,o.default)().mark((function e(){var r;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t.widget.canvasToTempFilePath(),r.then((function(e){t.src=e.tempFilePath}));case 2:case"end":return e.stop()}}),e)})))()},previewImage:function(){var t=this.src;uni.previewImage({current:t,urls:[t]})},saveImage:function(){var t=this;return(0,s.default)((0,o.default)().mark((function e(){var r,n,i,s;return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$util.checkAuth({type:"writePhotosAlbum"});case 2:return r=t.src,e.next=5,uni.saveImageToPhotosAlbum({filePath:r});case 5:if(n=e.sent,i=(0,a.default)(n,2),s=i[0],i[1],!s){e.next=11;break}return e.abrupt("return");case 11:uni.showToast({icon:"none",title:"保存成功"});case 12:case"end":return e.stop()}}),e)})))()},toPreviewSave:function(){this.previewImage()}})};e.default=c},9012:function(t,e,r){"use strict";r.r(e);var n=r("8d9f"),a=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},a990:function(t,e,r){var n=r("dd66");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=r("967d").default;a("4059a55d",n,!0,{sourceMap:!1,shadowMode:!1})},dd66:function(t,e,r){var n=r("c86c");e=n(!1),e.push([t.i,".code-img[data-v-6389692a]{width:%?652?%;height:%?966?%;margin:%?20?% auto;border-radius:%?20?%}.save-btn[data-v-6389692a]{width:%?490?%;height:%?80?%;margin:%?68?% auto}",""]),t.exports=e},f375:function(t,e,r){"use strict";r.r(e);var n=r("82b4"),a=r("9012");for(var i in a)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return a[t]}))}(i);r("fd81");var o=r("828b"),s=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,"6389692a",null,!1,n["a"],void 0);e["default"]=s.exports},fd81:function(t,e,r){"use strict";var n=r("a990"),a=r.n(n);a.a}}]);