var _=Object.defineProperty;var C=(s,e,n)=>e in s?_(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var c=(s,e,n)=>C(s,typeof e!="symbol"?e+"":e,n);import{D as v,d as w,G as E,r as p,o as k,a as g,b,l as x,_ as I,c as i,e as u,f as d,g as r,t as y,w as $,v as T,h as B,i as V,j as F,k as l}from"./index-BGEOEKbF.js";class h{constructor(){c(this,"sec",0);c(this,"defer",v());c(this,"timerID",0)}countdown(e=10){return this.defer=v(),this.sec=~~e||0,this.timer(),this.defer.promise}timer(){if(this.sec<=0)return this.defer.resolve(0);this.sec--,clearTimeout(this.timerID),this.timerID=window.setTimeout(()=>this.timer(),1e3)}cancel(){clearTimeout(this.timerID)}}const j=w({name:"IdEntrance",props:["css"],setup:()=>{const s=E.my_clound,e=+(p.currentRoute.value.query.id||0),n=p.currentRoute.value.query.sn,D=s.preview_root()+e+"/preview.jpg";k(()=>{console.log("退出 ID"),t.delay.cancel(),t.delay_open.cancel()}),g(()=>{s.user.login_data.defer.promise.then(()=>{t.login_status="yes"}).catch(()=>{t.login_status="no"})}),s.list_ready().then(()=>{t.is_my_mode=!!s.item(e)}).catch(()=>{t.is_my_mode=!1});const t=b({id:e,sn:n,login_status:"",preview_url:D,prompt:"",delay:new h,delay_open:new h,is_my_mode:!1,look:(f=0)=>{E.user.post("yjk/check_sn",{id:e,sn:t.sn}).then(()=>{t.delay_open.countdown(f/1e3).then(()=>{p.push({path:"mobile-show",query:{id:e,sn:t.sn}})})}).catch(a=>{if(t.prompt="天加云模型 id 或 密码 错误",a.sec){const m=+new Date(a.t),o=+new Date,A=+a.sec-(o-m)/1e3;t.delay.countdown(A)}})},wx_login:()=>{x.emit("wx-login",{})}});return n&&t.look(4e3),{my_clound:s,D:t,gohome:()=>{t.delay_open.cancel(),p.push("/mobile-home")}}}}),N={class:"flex-1 flex-v"},R={class:"flex-1 body v-scroll"},q={class:"mx-10 h14 text-8"},G={key:0,class:"text-left py-1"},M={key:0,class:"box mx-10 bk-e flex-v flex-stretch flex-top box-ccc"},U={class:"flex-left px-4 py-2"},z={class:"flex-left px-4 pb-2"},K={class:"bt-ccc flex-cc pa-2 bk-f"},S={key:1,class:"h14 flex-left mx-10 py-2 text-red"},H={key:2,class:"h14 flex-left mx-10 py-2 text-red"},J=["src"],L={class:"flex-1 my-10 px-10 flex-v"},O={key:4,class:"login flex-cc"},P={class:"bt-ccc bk-e pa-1"};function Q(s,e,n,D,t,f){const a=F("v-btn"),m=F("CopyRight");return l(),i("div",N,[u("div",R,[u("div",q,[e[5]||(e[5]=u("h2",{class:"text-center text-warning py-3"},"欢迎使用 天加云模型",-1)),s.D.sn?d("",!0):(l(),i("div",G,"您正在打开天加云模型，请向您的好友索取模型访问密码。")),e[6]||(e[6]=u("div",{class:"text-left py-1"},[r("天加云模型由 "),u("a",{href:"https://tianjiaad.com/w/?p=175",target:"_blank"},"天加快模软件"),r(" 生成，可以手机上方便地查看盈建科三维模型和计算结果。")],-1))]),e[10]||(e[10]=u("div",{class:"my-10"},null,-1)),s.D.id?(l(),i("div",M,[u("div",U,"天加云模型 id："+y(s.D.id),1),u("div",z,[e[7]||(e[7]=u("div",{class:"pr-2"},"访问密码：",-1)),$(u("input",{class:"tiny","onUpdate:modelValue":e[0]||(e[0]=o=>s.D.sn=o),onKeyup:e[1]||(e[1]=o=>s.D.prompt=""),size:"4"},null,544),[[T,s.D.sn]])]),u("div",K,[B(a,{color:"primary",disabled:s.D.delay.sec>0,onClick:s.D.look},{default:V(()=>e[8]||(e[8]=[r("打开")])),_:1},8,["disabled","onClick"])])])):d("",!0),s.D.delay.sec<=0?(l(),i("div",S,y(s.D.delay_open.sec&&`${s.D.delay_open.sec}秒后自动打开模型`||s.D.prompt||" "),1)):d("",!0),s.D.delay.sec>0?(l(),i("div",H,"连续密码错误, "+y(s.D.delay.sec)+" 秒后再试",1)):d("",!0),s.D.id?(l(),i("div",{key:3,class:"mx-10 bk-0 my-2 radius",onClick:e[2]||(e[2]=o=>s.D.look())},[u("img",{class:"preview-img",src:s.D.preview_url},null,8,J)])):d("",!0),u("div",L,[u("div",{class:"btn",onClick:e[3]||(e[3]=(...o)=>s.gohome&&s.gohome(...o))},"返回首页")]),s.D.login_status=="no"?(l(),i("div",O,[u("div",{class:"login-body",onClick:e[4]||(e[4]=(...o)=>s.D.wx_login&&s.D.wx_login(...o))},e[9]||(e[9]=[r("请 "),u("span",{class:"text-info"},"登录",-1),r(" 后查看")]))])):d("",!0)]),u("div",P,[e[11]||(e[11]=u("div",{class:"h12"},"天加云模型:可直接在手机里查看盈建科三维模型和计算结果",-1)),B(m,{class:"h12"})])])}const Y=I(j,[["render",Q],["__scopeId","data-v-19e0b49a"]]);export{Y as default};
