You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
5.2 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["agent/pages/poster/channel"],{"1dcf":function(e,t,r){"use strict";(function(e){var n=r("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("7eb4")),i=n(r("34cf")),a=n(r("7ca3")),c=n(r("ee10")),s=r("8f59");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,a.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p={components:{},props:{},data:function(){return{options:{},confirmText:"保存图片至相册",src:""}},computed:(0,s.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},configInfo:function(e){return e.config.configInfo},userInfo:function(e){return e.user.userInfo}}),onLoad:function(e){var t=this;return(0,c.default)(o.default.mark((function r(){var n;return o.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.options=e,t.$util.showLoading(),r.next=4,t.getConfigInfo();case 4:t.$util.setNavigationBarColor({bg:t.primaryColor}),n=t,setTimeout((function(){n.renderToCanvas()}),1e3);case 7:case"end":return r.stop()}}),r)})))()},methods:f(f({},(0,s.mapActions)(["getConfigInfo"])),{},{renderToCanvas:function(){var e=this;return(0,c.default)(o.default.mark((function t(){var r,n,i,a,c,s,u,f,p,l,d;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r=e,n=r.options.type,i=void 0===n?0:n,1!=i){t.next=8;break}return t.next=5,e.$api.salesman.salesmanQr();case 5:t.t0=t.sent,t.next=11;break;case 8:return t.next=10,e.$api.agent.agentInviteQr({type:1});case 10:t.t0=t.sent;case 11:a=t.t0,c=e.configInfo.channel_poster,s=void 0===c?"":c,u=s||"https://lbqny.migugu.com/admin/anmo/mine/channel-share.png",f=e.userInfo,p=f.nickName,l=f.avatarUrl,"0rpx","97rpx",d={css:{width:"750rpx",height:"1280rpx"},views:[{type:"image",src:u,css:{width:"750rpx",height:"1140rpx",objectFit:"cover",top:"0rpx",left:"0rpx",position:"absolute"}},{type:"view",css:{background:"#fff",width:"750rpx",height:"140rpx",bottom:"0rpx",left:"0rpx",position:"absolute"},views:[{type:"image",src:l,css:{position:"absolute",width:"94rpx",height:"94rpx",objectFit:"cover",borderRadius:"50rpx",bottom:"23rpx",left:"20rpx"}},{type:"text",text:p,css:{position:"absolute",bottom:"70rpx",left:"130rpx",width:"350rpx",fontSize:"32rpx",fontWeight:"400",color:"#000"}},{type:"text",text:"邀请您成为TA的渠道商,扫描二维码立即加入吧!",css:{position:"absolute",bottom:"25rpx",left:"130rpx",width:"750rpx",fontSize:"26rpx",color:"#999999"}}]},{type:"image",src:a,css:{position:"absolute",width:"200rpx",height:"200rpx",bottom:"337rpx",left:"53rpx",background:"#ffffff",borderRadius:"97rpx"}},{type:"text",text:"扫一扫",css:{position:"absolute",bottom:"290rpx",left:"53rpx",width:"200rpx",fontSize:"26rpx",color:"#999999",textAlign:"center"}}]},e.$refs.painter.render(d),e.$refs.painter.canvasToTempFilePathSync({fileType:"jpg",quality:1,success:function(t){r.$util.hideAll(),e.src=t.tempFilePath}});case 20:case"end":return t.stop()}}),t)})))()},previewImage:function(){var t=this.src;e.previewImage({current:t,urls:[t]})},saveImage:function(){var t=this;return(0,c.default)(o.default.mark((function r(){var n,a,c,s;return o.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,t.$util.checkAuth({type:"writePhotosAlbum"});case 2:return n=t.src,r.next=5,e.saveImageToPhotosAlbum({filePath:n});case 5:if(a=r.sent,c=(0,i.default)(a,2),s=c[0],c[1],!s){r.next=11;break}return r.abrupt("return");case 11:e.showToast({icon:"none",title:"保存成功"});case 12:case"end":return r.stop()}}),r)})))()},toPreviewSave:function(){this.saveImage()}})};t.default=p}).call(this,r("df3c")["default"])},"325d":function(e,t,r){"use strict";r.r(t);var n=r("dca5"),o=r("96d6");for(var i in o)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(i);r("a437");var a=r("828b"),c=Object(a["a"])(o["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=c.exports},8877:function(e,t,r){},"96d6":function(e,t,r){"use strict";r.r(t);var n=r("1dcf"),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},a437:function(e,t,r){"use strict";var n=r("8877"),o=r.n(n);o.a},dca5:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return n}));var n={lPainter:function(){return Promise.all([r.e("common/vendor"),r.e("uni_modules/lime-painter/components/l-painter/l-painter")]).then(r.bind(null,"577c"))}},o=function(){var e=this.$createElement;this._self._c},i=[]},edea:function(e,t,r){"use strict";(function(e,t){var n=r("47a9");r("7043");n(r("3240"));var o=n(r("325d"));e.__webpack_require_UNI_MP_PLUGIN__=r,t(o.default)}).call(this,r("3223")["default"],r("df3c")["createPage"])}},[["edea","common/runtime","common/vendor"]]]);