pages-user-qrcode-share.9bbe273d.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,a3 as c,l as o,j as n,A as r,t as d,u as h,v as p,ay as u,i as f,x as m,az as w,I as y,m as g,aA as x}from"./index-62b9c5f7.js";import{u as I,_}from"./s-layout.bd46477b.js";import{_ as v}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.222ee99b.js";import"./useGoods.8978594e.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:""}),$=x();async function b(){c.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://letcgo.com/#/pages/index/user?linkId="+k.linkId,poster:{type:"user"}},await I(j,$)}())}))}const A=()=>{["WechatOfficialAccount","H5"].includes(a.$platform.name)?a.$helper.toast("请长按图片保存"):u({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 c=f,u=m,x=w,I=y,v=o(g("s-layout"),_);return t(),l(v,{title:"我的二维码/分享页",class:"set-userinfo-wrap"},{default:i((()=>[n(c,{class:"ss-flex-col ss-col-center ss-row-center"},{default:i((()=>[""===j.src?(t(),l(c,{key:0,class:"poster-title ss-flex ss-row-center",style:r({height:j.height+"px",width:j.width+"px"})},{default:i((()=>[d(" 海报加载中... ")])),_:1},8,["style"])):(t(),l(u,{key:1,class:"poster-img ss-m-20",src:j.src,style:r({height:j.height+"px",width:j.width+"px"}),"show-menu-by-longpress":!0},null,8,["src","style"])),n(x,{class:"hideCanvas","canvas-id":j.canvasId,id:j.canvasId,style:r({height:j.height+"px",width:j.width+"px"})},null,8,["canvas-id","id","style"])])),_:1}),n(c,{class:"modal-footer ss-flex ss-p-x-20"},{default:i((()=>[n(I,{class:"confirm-btn",onClick:A},{default:i((()=>[d(h((["wechatOfficialAccount","H5"].includes(p(a).$platform.name),"长按图片保存")),1)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-a25c9bbc"]]);export{k as default};