pages-user-qrcode-share.0cd81169.js 2.0 KB

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