index.df533808.js 8.0 KB

1
  1. import{d as b,aV as S,r as g,$ as D,m as d,c as a,F as i,q as c,B as p,a5 as A,be as y,k as N,o as L,bl as M,p as V,bz as Z,bA as K,f as k}from"./index.ffe80dbe.js";import{h as v}from"./html2canvas.esm.3d083717.js";import{o as C,O as E}from"./index.a0fac207.js";import{I as r}from"./index.7e972106.js";const R="_saveShareImage_1dnid_1",G="_previewSection_1dnid_16",q="_topImage_1dnid_23",x="_shareContaienr_1dnid_29",U="_orchestraContainer_1dnid_38",z="_schoolName_1dnid_42",Y="_schoolLogo_1dnid_48",J="_shareType_1dnid_68",W="_qrcodeSection_1dnid_77",X="_memo_1dnid_85",j="_endTime_1dnid_97",Q="_btnGroup_1dnid_105",H="_icon_1dnid_112",P="_btn_1dnid_105";var o={saveShareImage:R,previewSection:G,topImage:q,shareContaienr:x,orchestraContainer:U,schoolName:z,schoolLogo:Y,shareType:J,qrcodeSection:W,memo:X,endTime:j,btnGroup:Q,icon:H,btn:P},O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABMCAMAAADwSaEZAAAAilBMVEUAAAD////////////+/v7////+/v7////////////////////////+/v7////////////////////////////////////9/f3////////////////////////////////+/v7////+/v7////////////////////////////////9/f3////+/v4G95Y1AAAALXRSTlMACTZV8QX86k7KKSUN+c+lcEgc4Na8m5I1Mi0T8+3awb+3sYp5Z1tDPCIZhYJUHFgjAAABR0lEQVRYw+3V15KDIBiG4d8ERGNJjy3Z9LrL/d/epgzjEfqhHGV4D5F5BkZQcrlcLhcev+cDXcXMiBqNmWxKZA/YmviyLRaglgTyp9gefYkkYgQbS6wTYHEGYiGA3SXYGsDyejo7Di+rRKt57dhAqhbvw1kIG1gSfQYCG9hejcwtYJkaWVrAxmoktYCpIx5ZeZsreuVtrWByPyA+TWVfTKXuvBWsVo9RfFvawZJAfVD6bDNcbl6X9Erv+KEHlo6ewJ8vcvXQ23bG5tXncj5JVRx2xFiN1FULI6zllzGbd8EmmgmRMMdWpKvcmGIhJ22BKXalhhaGWEUNHQyxiBpKDbFf0neThlgyGeq6CAMMCMUKGOPt2Ay1GAEJENshWAZiZwR7MMj64YQU+IDFSsKaivZ1lYQWn8J106p2Z05Gedo4uVwu15f3D+OJ24iJRosgAAAAAElFTkSuQmCC",$="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABMCAMAAADwSaEZAAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA/fnsCBD06NLazbkW46eVj2A4CwXVycSim4AxKCHdroiEeWdUShluPhzui3VyW0K9tX3v38nzcAAAAfJJREFUWMPt1dmWojAUBdATBkFBUMBZy3meuqrP/39bVzehRRdE0HpkP90sQibuJahUKpVKCaOz19A1alZj0B7jHZvhB9M6ZxcvMlsaH2lHE6+4NpnFuqC8o2AOP0JJfeb7ZaCUFlWmKGNFyfbqTIje1JLhEcWZ8iWxBKIpY7UrEHbkgwCFzRlr4NtaNvr4dpKNLooydMY+0lv+TE/DHQpaM9F3MelQGoYIdEqDFz6lsAT/0+KhLMefzRcoyGG++mKMyXr7NV+0AwMF2PlDrTDym5Q0px3hmTpzDMKdI5jWPBlQ6zKT1jZago/sEZQ8ZhFt186eAypbZlm4HWYSSyhMRNavIuoyh1iVzA0xHiZn7hxkZDkyhw8u8gWCj6abmqzXEKYdF5uJsFegHnw+WicL+wIQx/7teDXV0owG79UMO0kFE5t6vDIXZtJvCYXNB+90TUFJ79Zk9LuXRPSgsu8wzRtRqQElc8qUwY5KdTzxyZv+iEpdPNHkjWMKqvSh9m9jljxjHR2qXKDmk82tAYxXp1lrFs6poBtQs5rLdJe9xnxnqI2XEe7MFIkRoSTDzt3kBKVt6sxUC/CCfeZoeoCXhIOMO2CCV617fODhDUFfp1T7m9GHCG8ZXxaz1rA9Alxf4xU/ZuK18IP2qFQqlUoBfwBY2/iSCspkkQAAAABJRU5ErkJggg==",B="./assets/teacher-top_bg.aed1eb2a.png",f="./assets/manage-top_bg.d67ca762.png",F="./assets/logo@2x.f7671d6b.png",te=b({name:"save-share-image",setup(){const u=S(),e=g({type:u.query.type,paramValue:2,schoolName:"",schoolId:"",url:null,schoolLogo:"",loading:!1}),n=g({saveLoading:!1,image:null,shareLoading:!1}),w=async()=>{if(!n.saveLoading)if(n.saveLoading=!0,n.image)h();else{const t=document.getElementById("preview-container");v(t,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async s=>{const l=s.toDataURL("image/png");n.image=l,h()}).catch(()=>{y(),n.saveLoading=!1})}},T=()=>{if(!n.shareLoading)if(n.shareLoading=!0,n.image)m();else{const t=document.getElementById("preview-container");v(t,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async s=>{const l=s.toDataURL("image/png");n.image=l,m()}).catch(()=>{y(),n.shareLoading=!1})}},m=()=>{const t=n.image;setTimeout(()=>{n.shareLoading=!1},100),t&&N({api:"shareTripartite",content:{title:"",desc:"",image:t,video:"",type:"image",shareType:"wechat"}},s=>{s&&s.content&&L(s.content.message||(s.content.status?"\u5206\u4EAB\u6210\u529F":"\u5206\u4EAB\u5931\u8D25"))})},h=async()=>{var s;M({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{n.saveLoading=!1},100);const t=await V({api:"savePicture",content:{base64:n.image}});((s=t==null?void 0:t.content)==null?void 0:s.status)==="success"?Z("\u4FDD\u5B58\u6210\u529F"):K("\u4FDD\u5B58\u5931\u8D25")},_=async()=>{try{const t=(k.user.data.schoolInfos||[]).map(l=>l.id).join(","),s=await d.get(`/api-school/school/detail/${t}`,{});e.schoolName=s.data.name,e.schoolId=s.data.id,e.schoolLogo=s.data.logo?s.data.logo+"@base@tag=imgScale&w=570?t="+ +new Date:"",e.type==="teacher"?e.url=location.origin+"/orchestra-school/#/companion-teacher-register?id="+s.data.id+"&name="+s.data.name+"&t="+ +new Date:e.type==="manage"&&(e.url=location.origin+"/orchestra-school/#/manage-teacher-register?id="+s.data.id+"&name="+s.data.name+"&t="+ +new Date)}catch{}},I=async()=>{try{const t=await d.get("/api-school/orchestra/detail/"+u.query.id);e.schoolName=t.data.name,e.schoolId=t.data.id,e.schoolLogo=t.data.schoolLogo+"@base@tag=imgScale&w=570?t="+ +new Date,e.url=window.location.origin+"/orchestra-student/#/preApply?id="+u.query.id}catch{}};return D(async()=>{e.type==="teacher"?document.title="\u4E50\u56E2\u4F34\u5B66\u6307\u5BFC\u6CE8\u518C":e.type==="manage"?document.title="\u4E50\u56E2\u7BA1\u7406\u8001\u5E08\u6CE8\u518C":e.type==="orchestra"&&(document.title="\u4E50\u56E2\u62A5\u540D");try{const{data:t}=await d.get("/api-school/open/paramConfig/queryByParamName",{requestType:"form",params:{paramName:"qr_code_expire_hours"}});e.paramValue=t.paramValue}catch{}e.type==="orchestra"?I():_()}),()=>a("div",{class:[o.saveShareImage]},[e.type==="teacher"&&a(r,{src:B,class:o.topImage},null),e.type==="manage"&&a(r,{src:f,class:o.topImage},null),e.type==="orchestra"&&a(r,{src:C,class:o.topImage},null),a("div",{class:[o.shareContaienr,e.type==="orchestra"&&o.orchestraContainer]},[e.type!=="orchestra"?a(i,null,[a("img",{class:[o.schoolLogo],src:e.schoolLogo||F,crossorigin:"anonymous",style:{objectFit:"cover"}},null),a("div",{class:o.schoolName},[e.schoolName]),a("div",{class:o.shareType},[c("\u9080\u8BF7\u60A8\u6210\u4E3A"),a("span",null,[e.type==="teacher"&&"\u4E50\u56E2\u4F34\u5B66\u6307\u5BFC",e.type==="manage"&&"\u4E50\u56E2\u7BA1\u7406\u8001\u5E08"])])]):a(i,null,[a("div",{class:o.schoolName},[c("\u4E50\u56E2\u62A5\u540D")]),a("div",{class:o.shareType},[e.schoolName])]),a("div",{class:o.qrcodeSection},[a(E,{text:e.url,logoSize:"small",size:"100%"},null)]),a("div",{class:o.memo},[c("\u626B\u63CF\u4E0A\u65B9\u4E8C\u7EF4\u7801\u5B8C\u6210\u8D44\u6599\u586B\u5199")]),e.type!=="orchestra"&&a("div",{class:o.endTime},[c("\u4E8C\u7EF4\u7801\u5C06\u5728"),a("span",null,[e.paramValue,c("\u5C0F\u65F6\u540E")]),c("\u5931\u6548\uFF0C\u8BF7\u53CA\u65F6\u767B\u8BB0")])]),a("div",{class:o.btnGroup},[a(p,{class:o.btn,round:!0,block:!0,onClick:w},{default:()=>[a(A,{name:O,class:o.icon},null),c("\u4FDD\u5B58\u56FE\u7247")]}),a(p,{class:o.btn,round:!0,block:!0,onClick:T},{default:()=>[a(A,{name:$,class:o.icon},null),c("\u5206\u4EAB\u5230\u5FAE\u4FE1")]})]),!e.loading&&a("div",{class:[o.saveShareImage,o.previewSection],id:"preview-container"},[e.type==="teacher"&&a(r,{src:B,class:o.topImage},null),e.type==="manage"&&a(r,{src:f,class:o.topImage},null),e.type==="orchestra"&&a(r,{src:C,class:o.topImage},null),a("div",{class:[o.shareContaienr,e.type==="orchestra"&&o.orchestraContainer]},[e.type!=="orchestra"?a(i,null,[a("img",{class:[o.schoolLogo],src:e.schoolLogo||F,crossorigin:"anonymous",style:{objectFit:"cover"}},null),a("div",{class:o.schoolName},[e.schoolName]),a("div",{class:o.shareType},[c("\u9080\u8BF7\u60A8\u6210\u4E3A"),a("span",null,[e.type==="teacher"&&"\u4E50\u56E2\u4F34\u5B66\u6307\u5BFC",e.type==="manage"&&"\u4E50\u56E2\u7BA1\u7406\u8001\u5E08"])])]):a(i,null,[a("div",{class:o.schoolName},[c("\u4E50\u56E2\u62A5\u540D")]),a("div",{class:o.shareType},[e.schoolName])]),a("div",{class:o.qrcodeSection},[a(E,{text:e.url,logoSize:"small",size:"100%"},null)]),a("div",{class:o.memo},[c("\u626B\u63CF\u4E0A\u65B9\u4E8C\u7EF4\u7801\u5B8C\u6210\u8D44\u6599\u586B\u5199")]),e.type!=="orchestra"&&a("div",{class:o.endTime},[c("\u4E8C\u7EF4\u7801\u5C06\u5728"),a("span",null,[e.paramValue,c("\u5C0F\u65F6\u540E")]),c("\u5931\u6548\uFF0C\u8BF7\u53CA\u65F6\u767B\u8BB0")])])])])}});export{te as default};