pages-user-qrcode-share.fec6db1a.js 2.3 KB

1
  1. import{v as s,s as e,o as a,a as t,b as i,w as n,u as l,a5 as o,j as r,d as c,n as d,e as p,f as h,t as u,aF as _,i as f,g as m,aG as g,M as y,k as v,aH as w}from"./index-39e65128.js";import{u as x,_ as I}from"./s-layout.69eddd84.js";import{_ as k}from"./_plugin-vue_export-helper.1b428a4d.js";import"./s-layout.vue_vue_type_style_index_0_scoped_0789db2f_lang.a57fff0d.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a2d557af_lang.dec8d7d1.js";import"./s-tabbar.6c197486.js";import"./useGoods.133fe7ed.js";import"./phone-international-input.20ca2464.js";const j=k({__name:"qrcode-share",setup(k){const j=s({linkId:0}),b=s({canvasId:"canvasId",width:.9*e.$platform.device.windowWidth,height:600,src:""}),$=w();async function C(){o.getLinkId(1).then((s=>{0===s.code&&(j.linkId=s.data.linkId,async function(s){b.src="",b.shareInfo={title:"",desc:"",image:"",path:"",link:"http://192.168.3.41:8000/#/pages/index/user?linkId="+j.linkId,poster:{type:"user"}},await x(b,$)}())}))}const H=()=>{["WechatOfficialAccount","H5"].includes(e.$platform.name)?e.$helper.toast(u("share.long_press_to_save")):_({filePath:b.src,success:s=>{onClosePoster(),e.$helper.toast(u("share.save_success"))},fail:s=>{e.$helper.toast(u("share.save_failure")),console.log("图片保存失败:",s)}})};return a((async()=>{await C()})),(s,a)=>{const o=f,_=m,w=g,x=y,k=r(v("s-layout"),I);return t(),i(k,{title:l(u)("share.share"),class:"set-userinfo-wrap"},{default:n((()=>[c(o,{class:"ss-flex-col ss-col-center ss-row-center"},{default:n((()=>[""===b.src?(t(),i(o,{key:0,class:"poster-title ss-flex ss-row-center",style:d({height:b.height+"px",width:b.width+"px"})},{default:n((()=>[p(h(l(u)("share.poster_loading")),1)])),_:1},8,["style"])):(t(),i(_,{key:1,class:"poster-img ss-m-20",src:b.src,style:d({height:b.height+"px",width:b.width+"px"}),"show-menu-by-longpress":!0},null,8,["src","style"])),c(w,{class:"hideCanvas","canvas-id":b.canvasId,id:b.canvasId,style:d({height:b.height+"px",width:b.width+"px"})},null,8,["canvas-id","id","style"])])),_:1}),c(o,{class:"modal-footer ss-flex ss-p-x-20"},{default:n((()=>[c(x,{class:"confirm-btn",onClick:H},{default:n((()=>[p(h((["wechatOfficialAccount","H5"].includes(l(e).$platform.name),l(u)("share.long_press_to_save"))),1)])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-8af3a385"]]);export{j as default};