pages-user-qrcode-share.739f6969.js 2.1 KB

1
  1. import{y as s,s as a,o as e,e as t,f as l,w as i,l as c,j as n,A as o,t as r,v as d,u as h,a8 as f,ap as p,i as u,x as m,aq as w,G as g,m as y,ar as x}from"./index-c61b0368.js";import{u as _,_ as k}from"./s-layout.2b406b0a.js";import{S as I}from"./share.c5984f7c.js";import{_ as v}from"./_plugin-vue_export-helper.1b428a4d.js";import"./form.b8ce97a9.js";const j=v({__name:"qrcode-share",setup(v){const j=s({linkId:0}),$=s({canvasId:"canvasId",width:.9*a.$platform.device.windowWidth,height:600,src:""}),b=x();async function C(){I.getLinkId(1).then((s=>{0===s.code&&(j.linkId=s.data.linkId,async function(s){$.src="",$.shareInfo={title:"",desc:"",image:"",path:"",link:"https://letcgogz.newfeifan.cn/#/pages/index/user?linkId="+j.linkId,poster:{type:"user"}},await _($,b)}())}))}const A=()=>{["WechatOfficialAccount","H5"].includes(a.$platform.name)?a.$helper.toast("请长按图片保存"):p({filePath:$.src,success:s=>{onClosePoster(),a.$helper.toast("保存成功")},fail:s=>{a.$helper.toast("保存失败"),console.log("图片保存失败:",s)}})};return e((async()=>{await C()})),(s,e)=>{const p=u,x=m,_=w,I=g,v=c(y("s-layout"),k);return t(),l(v,{title:"我的二维码/分享页",class:"set-userinfo-wrap"},{default:i((()=>[n(p,{class:"ss-flex-col ss-col-center ss-row-center"},{default:i((()=>[""===$.src?(t(),l(p,{key:0,class:"poster-title ss-flex ss-row-center",style:o({height:$.height+"px",width:$.width+"px"})},{default:i((()=>[r(" 海报加载中... ")])),_:1},8,["style"])):(t(),l(x,{key:1,class:"poster-img ss-m-20",src:$.src,style:o({height:$.height+"px",width:$.width+"px"}),"show-menu-by-longpress":!0},null,8,["src","style"])),n(_,{class:"hideCanvas","canvas-id":$.canvasId,id:$.canvasId,style:o({height:$.height+"px",width:$.width+"px"})},null,8,["canvas-id","id","style"])])),_:1}),n(p,{class:"modal-footer ss-flex ss-p-x-20"},{default:i((()=>[n(I,{class:"confirm-btn",onClick:A},{default:i((()=>[r(d(["wechatOfficialAccount","H5"].includes(h(a).$platform.name)?"长按图片保存":"保存图片"),1)])),_:1}),n(I,{class:"confirm-btn",onClick:h(f)},{default:i((()=>[r("分享")])),_:1},8,["onClick"])])),_:1})])),_:1})}}},[["__scopeId","data-v-6b4b2fc5"]]);export{j as default};