index.82d8b8f4.js 1.7 KB

1
  1. import{h as u}from"./html2canvas.esm.3d083717.js";import{d as f,ag as v,r as g,c as e,aj as m,a5 as w,F as p,bj as _,bp as b,p as k,bC as h,bD as L,f as Q,e as y}from"./index.1c621181.js";import{I as t}from"./index.4c221cbe.js";const B="_btnHeader_ruvwe_1",C="_iconBack_ruvwe_6",I="_followAccount_ruvwe_13",T="_content2_ruvwe_33",A="_saveQrcode_ruvwe_36",H="_followQrcode_ruvwe_44";var o={btnHeader:B,iconBack:C,followAccount:I,content2:T,saveQrcode:A,followQrcode:H},x="./assets/content1.352a4b32.png",j="./assets/content2.f6b3efac.png",F="./assets/qrcode.fa941852.jpg",D=f({name:"follow-account",setup(){const r=v(),a=g({saveLoading:!1,image:null,shareLoading:!1}),l=async()=>{if(!a.saveLoading)if(a.saveLoading=!0,a.image)c();else{const s=document.getElementById("preview-container");u(s,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async n=>{const d=n.toDataURL("image/png");a.image=d,c()}).catch(()=>{_(),a.saveLoading=!1})}},c=async()=>{var n;b({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{a.saveLoading=!1},100);const s=await k({api:"savePicture",content:{base64:a.image}});((n=s==null?void 0:s.content)==null?void 0:n.status)==="success"?h("\u4FDD\u5B58\u6210\u529F"):L("\u4FDD\u5B58\u5931\u8D25")},i=()=>{Q().isApp?y({api:"goBack"}):r.back()};return()=>e(p,null,[e("div",{class:o.followAccount},[e(m,{background:"transparent",style:"position: fixed; width: 100%;z-index: 999;top: 0;left: 0;"},{content:()=>e("div",{class:o.btnHeader,onClick:i},[e(w,{name:"arrow-left",class:o.iconBack},null)])}),e(t,{src:x,class:o.content1},null),e(t,{src:j,class:o.content2},null),e("div",{class:o.saveQrcode,onClick:l},null),e("div",{id:"preview-container",class:o.followQrcode},[e(t,{src:F},null)])])])}});export{D as default};