(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-shareQrCode-index"],{"2b5b":function(e,t,a){var n=a("4a04");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var r=a("4f06").default;r("72bc5f57",n,!0,{sourceMap:!1,shadowMode:!1})},"4a04":function(e,t,a){var n=a("24fb");t=n(!1),t.push([e.i,'@charset "UTF-8";\n/* 页面左右间距 */\n/* 文字尺寸 */\n/*文字颜色*/\n/* 边框颜色 */\n/*颜色*/\n/* 图片加载中颜色 */\n/* 行为相关颜色 */\n/* 功能栏字体大小 */\n/*功能栏左侧小图标*/uni-page-body[data-v-aeca051c]{height:100%}.container[data-v-aeca051c]{width:100%;height:%?1400?%}.container .item-box[data-v-aeca051c]{width:100%;height:100%;margin:%?0?% auto;background-size:100% 100%}.container .item-box .poster-bg[data-v-aeca051c]{position:relative;height:100%;width:100%;margin:%?0?% auto}.container .item-box .qr[data-v-aeca051c]{width:100%;height:100%;position:absolute;top:9.6rem}',""]),e.exports=t},"4b2d":function(e,t,a){"use strict";a.r(t);var n=a("ae7a"),r=a("a778");for(var o in r)"default"!==o&&function(e){a.d(t,e,(function(){return r[e]}))}(o);a("c6ee");var i,c=a("f0c5"),s=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,"aeca051c",null,!1,n["a"],i);t["default"]=s.exports},a778:function(e,t,a){"use strict";a.r(t);var n=a("b6b1"),r=a.n(n);for(var o in n)"default"!==o&&function(e){a.d(t,e,(function(){return n[e]}))}(o);t["default"]=r.a},ae7a:function(e,t,a){"use strict";var n;a.d(t,"b",(function(){return r})),a.d(t,"c",(function(){return o})),a.d(t,"a",(function(){return n}));var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"container",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.handleDownloadQrIMg()}}},[e.posterDataUrl?n("img",{staticClass:"poster-bg",attrs:{src:e.posterDataUrl,width:"100%",height:"auto"}}):n("v-uni-view",{staticClass:"item-box",attrs:{id:"poster"}},[n("img",{staticClass:"poster-bg",attrs:{src:a("888b")}}),n("v-uni-canvas",{staticClass:"qr",style:{left:(e.canWeidth-134)/2+"px"},attrs:{"canvas-id":"qrCode-canvas",id:"qrCode-canvas"}})],1)],1)},o=[]},b6b1:function(e,t,a){"use strict";var n=a("4ea4");a("ace4"),a("d3b7"),a("ac1f"),a("1276"),a("5cc6"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("2954"),a("649e"),a("219c"),a("b39a"),a("72f7"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("96cf");var r=n(a("1da1")),o=n(a("5530")),i=a("26cb"),c=n(a("f4cf")),s=n(a("bbcd")),d=a("6ef7"),u={data:function(){return{url:"",src:"",posterDataUrl:"",poster:"",canHeight:0,canWeidth:0,size:180,ratio:1}},onLoad:function(){var e=this;this.loadData(),this.shareDate(),this.$nextTick((function(){var t=uni.createSelectorQuery().in(e);t.select(".container").boundingClientRect((function(t){e.ratio=t.width/750})).exec(),t.select("#qrCode-canvas").fields({size:!0},(function(t){console.log("获取画布宽高信息",t),e.canHeight=t.height,e.canWeidth=t.width})).exec()}))},computed:(0,o.default)({},(0,i.mapState)(["userInfo"])),methods:{loadData:function(){var e=this;return(0,r.default)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:a=e,a.url="http://doctortest.igxys.com/index/#/pages/index/home?spread="+a.userInfo.uid,a.createQRCode();case 3:case"end":return t.stop()}}),t)})))()},shareDate:function(){var e=this,t="http://doctortest.igxys.com/index/#/pages/index/home?spread="+e.userInfo.uid,a=(uni.getStorageSync("weichatBrowser"),{link:t,imgUrl:e.userInfo.avatar,desc:e.userInfo.nickname,title:e.userInfo.nickname+"邀请您进入麻醉服务平台",success:function(){}});console.log(a,"datadatadata"),console.log(d.shareLoad),(0,d.shareLoad)(a)},createQRCode:function(){var e=this;this.$nextTick((function(){setTimeout((function(){var t=document.getElementById("qrCode-canvas").children[0];s.default.toCanvas(t,e.url,(function(a){if(a)console.log(a,"error");else{t.style.width="140px",t.style.height="140px",t.style.padding="0px";var n=document.getElementById("poster");(0,c.default)(n).then((function(t){e.posterDataUrl=t.toDataURL()}))}}))}),500)}))},handleDownloadQrIMg:function(){console.log("sssbb");var e=this.posterDataUrl;if(window.navigator.msSaveOrOpenBlob){var t=atob(e.split(",")[1]),a=t.length,n=new Uint8Array(a);while(a--)n[a]=t.charCodeAt(a);var r=new Blob([n]);window.navigator.msSaveOrOpenBlob(r,"分享二维码.png")}else{var o=document.createElement("a");o.href=e,o.setAttribute("download","分享二维码"),o.click()}}}};t.default=u},c6ee:function(e,t,a){"use strict";var n=a("2b5b"),r=a.n(n);r.a}}]);