| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-shareQrCode-index"],{"092f":function(t,e,a){"use strict";var n=a("20bd"),r=a.n(n);r.a},"20bd":function(t,e,a){var n=a("fdd2");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=a("4f06").default;r("f4cb40f4",n,!0,{sourceMap:!1,shadowMode:!1})},"31a2":function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return r})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"container",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleDownloadQrIMg()}}},[t.posterDataUrl?n("img",{staticClass:"poster-bg",attrs:{src:t.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:(t.canWeidth-134)/2+"px"},attrs:{"canvas-id":"qrCode-canvas",id:"qrCode-canvas"}})],1)],1)},o=[]},"4b2d":function(t,e,a){"use strict";a.r(e);var n=a("31a2"),r=a("a778");for(var o in r)"default"!==o&&function(t){a.d(e,t,(function(){return r[t]}))}(o);a("092f");var i,c=a("f0c5"),s=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,"72ffb3ec",null,!1,n["a"],i);e["default"]=s.exports},a778:function(t,e,a){"use strict";a.r(e);var n=a("b6b1"),r=a.n(n);for(var o in n)"default"!==o&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},b6b1:function(t,e,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(e,"__esModule",{value:!0}),e.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 t=this;this.loadData(),this.shareDate(),this.$nextTick((function(){var e=uni.createSelectorQuery().in(t);e.select(".container").boundingClientRect((function(e){t.ratio=e.width/750})).exec(),e.select("#qrCode-canvas").fields({size:!0},(function(e){console.log("获取画布宽高信息",e),t.canHeight=e.height,t.canWeidth=e.width})).exec()}))},computed:(0,o.default)({},(0,i.mapState)(["userInfo"])),methods:{loadData:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:a=t,a.url="http://doctortest.igxys.com/index/#/pages/index/home?spread="+a.userInfo.uid,a.createQRCode();case 3:case"end":return e.stop()}}),e)})))()},shareDate:function(){var t=this,e="http://doctortest.igxys.com/index/#/pages/index/home?spread="+t.userInfo.uid,a=(uni.getStorageSync("weichatBrowser"),{link:e,imgUrl:t.userInfo.avatar,desc:t.userInfo.nickname,title:t.userInfo.nickname+"邀请您进入共享预约平台",success:function(){}});console.log(a,"datadatadata"),console.log(d.shareLoad),(0,d.shareLoad)(a)},createQRCode:function(){var t=this;this.$nextTick((function(){setTimeout((function(){var e=document.getElementById("qrCode-canvas").children[0];s.default.toCanvas(e,t.url,(function(a){if(a)console.log(a,"error");else{e.style.width="140px",e.style.height="140px",e.style.padding="0px";var n=document.getElementById("poster");(0,c.default)(n).then((function(e){t.posterDataUrl=e.toDataURL()}))}}))}),500)}))},handleDownloadQrIMg:function(){console.log("sssbb");var t=this.posterDataUrl;if(window.navigator.msSaveOrOpenBlob){var e=atob(t.split(",")[1]),a=e.length,n=new Uint8Array(a);while(a--)n[a]=e.charCodeAt(a);var r=new Blob([n]);window.navigator.msSaveOrOpenBlob(r,"分享二维码.png")}else{var o=document.createElement("a");o.href=t,o.setAttribute("download","分享二维码"),o.click()}}}};e.default=u},fdd2:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\n/* 页面左右间距 */\n/* 文字尺寸 */\n/*文字颜色*/\n/* 边框颜色 */\n/*颜色*/\n/* 图片加载中颜色 */\n/* 行为相关颜色 */\n/* 功能栏字体大小 */\n/*功能栏左侧小图标*/uni-page-body[data-v-72ffb3ec]{height:100%}.container[data-v-72ffb3ec]{width:100%;height:%?1400?%}.container .item-box[data-v-72ffb3ec]{width:100%;height:100%;margin:%?0?% auto;background-size:100% 100%}.container .item-box .poster-bg[data-v-72ffb3ec]{position:relative;height:100%;width:100%;margin:%?0?% auto}.container .item-box .qr[data-v-72ffb3ec]{width:100%;height:100%;position:absolute;top:9.6rem}',""]),t.exports=e}}]);
|