import{d as p,ah as u,r as c,$ as m,m as f,c as o,B as w,f as n,o as y}from"./index.8f93de0e.js";import{s as h,t as A,m as g,a as s}from"./manage-center.3e62a754.js";import{w as E}from"./wx_bg.3aff1fb2.js";import{I as r}from"./index.a2e558d4.js";var v=p({name:"download",setup(){const i=u(),t=c({wxStatus:!1,androidUrl:"",type:"student",buttonText:"\u4E0B\u8F7D\u7BA1\u4E50\u56E2\u5B66\u5458\u7AEF"}),d=()=>{if(n().weixin){t.wxStatus=!0;return}let e="",a="";location.origin.indexOf("online.lexiaoya.cn")>-1?t.type==="student"?(e="https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 ",a=t.androidUrl):t.type==="teacher"?(e="https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4",a=t.androidUrl):t.type==="manage"&&(e="https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4",a=t.androidUrl):t.type==="student"?(e="https://www.pgyer.com/2Wg2",a=t.androidUrl):t.type==="teacher"?(e="https://www.pgyer.com/v5yB",a=t.androidUrl):t.type==="manage"&&(e="https://www.pgyer.com/DGrR",a=t.androidUrl),n().ios||/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?e&&(window.location.href=e):n().huawei||/(Android)/i.test(navigator.userAgent)?window.location.href=a:y("\u8BF7\u7528\u624B\u673A\u6216\u79FB\u52A8\u8BBE\u5907\u6253\u5F00")};return m(async()=>{const e=i.query.type;t.type=e||"student";let a="android-student";e==="student"?(t.buttonText="\u4E0B\u8F7D\u7BA1\u4E50\u56E2\u5B66\u5458\u7AEF",a="android-student"):e==="teacher"?(t.buttonText="\u4E0B\u8F7D\u7BA1\u4E50\u56E2\u4F34\u5B66\u7AEF",a="android-teacher"):e==="manage"&&(t.buttonText="\u4E0B\u8F7D\u7BA1\u4E50\u56E2\u7BA1\u7406\u7AEF",a="android-school");try{const{data:l}=await f.get("/api-student/open/appVersionInfo/queryLatestByPlatform",{params:{platform:a,status:"history"}});t.androidUrl=l.downloadUrl}catch{}document.title=t.buttonText}),()=>o("div",{class:[s.downloadContainer]},[t.type!=="teacher"&&t.type!=="manage"&&o(r,{src:h},null),t.type==="teacher"&&o(r,{src:A},null),t.type==="manage"&&o(r,{src:g},null),o("div",{class:s.buttonGroup},[o(w,{round:!0,size:"large",color:"#FF8057",class:s.btn,onClick:d},{default:()=>[t.buttonText]})]),t.wxStatus&&o("div",{class:s.wxpopup,onClick:()=>{t.wxStatus=!1}},[o("img",{src:E,alt:""},null)])])}});export{v as default};
