PageSourceSearch

https://www.mechrevo.com/en/_nuxt/Dz5qLvyY.js

js mechrevo.com collected 2026-10-02 11:05:26 UTC 35,007 bytes, 1 lines download raw bytes

1import{_ as Be}from"./CbBh4sUL.js";import{y as ie,x as v,n as _e,cb as Fe,cc as He,H as U,cd as Ue,K as Qe,o as n,c as i,a as e,G as me,C as Y,ac as Re,k as x,d as A,t as M,g as re,F as ee,D as le,R as ae,j as ye,A as ve,b as T,w as D,f as o,r as he,$ as Ae,af as be,v as we,Y as Ke,N as te,U as Ee,s as X,L as ze,a3 as je,h as Ge,l as We,m as Xe,i as Me,q as Ie,_ as Ye,O as De,ca as Je,P as Ze}from"./CBVuVATE.js";import{I as de}from"./C-s4FLFn.js";import{_ as oe}from"./DlAUqK2U.js";import{s as Ce}from"./DpgSet8m.js";import{o as es}from"./pb_TXfmz.js";import{u as ss}from"./DbA58H3q.js";import{C as ts}from"./ea6Sv6Me.js";import{R as os,A as ns}from"./DvYT0MWW.js";const Pe={getLinks(u){return ie.get("/links",u)},getLinksTree(u,l){return ie.get("/links/tree",{params:{category1:u,category2:l}})},getLinkDetail(u){return ie.get(`/links/${u}`)}},ls=()=>{const u=v([]),l=v([]),b=v(!1);return{topMenus:u,bottomMenus:l,loading:b,fetchTopMenus:async()=>{try{b.value=!0;const t=await Pe.getLinksTree("global","top_menu");return u.value=t.objects||[],u.value}catch(t){return console.error("获取顶部菜单失败:",t),[]}finally{b.value=!1}},fetchBottomMenus:async()=>{try{b.value=!0;const t=await Pe.getLinksTree("global","bottom_menu");return l.value=t.objects||[],l.value}catch(t){return console.error("获取底部菜单失败:",t),[]}finally{b.value=!1}}}};function Ve(){const u=_e(),l={QRCODE:"qrcode",SMS:"sms"},b={PHONE:1,CODE:2},k=v(l.QRCODE),m=v(b.PHONE),t=v(""),a=v(""),h=v(""),_=v(!1),w=v(0),I=v("");let P=null;const s=U(()=>/^1[3-9]\d{9}$/.test(t.value)),S=U(()=>a.value.length===6),p=U(()=>w.value>0?`${w.value}秒后重试`:"获取验证码"),$=(L=60)=>{w.value=L,P=Ce(()=>{w.value--,w.value<=0&&f()},1e3)},f=()=>{P&&(clearInterval(P),P=null),w.value=0},y=async()=>{if(!s.value)throw new Error("请输入正确的手机号");if(!h.value)throw new Error("请完成滑块验证");if(w.value>0)throw new Error("请稍后再试");_.value=!0;try{const L=await He(t.value,h.value);return L.result&&L.result.code&&(I.value=L.result.code),$(60),L}finally{_.value=!1}},R=async()=>{await y(),m.value=b.CODE},J=()=>{m.value=b.PHONE,a.value=""},ne=async()=>{if(!s.value)throw new Error("请输入正确的手机号");if(!S.value)throw new Error("请输入6位验证码");_.value=!0;try{return await u.loginWithPhone(t.value,a.value),Z(),!0}finally{_.value=!1}},Z=()=>{m.value=b.PHONE,t.value="",a.value="",h.value="",I.value="",Q.value=!1,f()},V=v(null),K=v(""),W=v(""),z=v(!1),Q=v(!1);let N=null;const F=async()=>{_.value=!0;try{const L=await Fe();return V.value=L.qrCodeDataURL,K.value=L.scene,W.value=L.expireTime,console.log("get qrcode",K.value,W.value),B(),L}finally{_.value=!1}},B=()=>{z.value||(z.value=!0,N=Ce(async()=>{try{const L=await Ue(K.value);if(L===null)return;if(L&&L.token)return Q.value=!0,C(),u.setToken(L.token),await u.fetchUserInfo(),!0}catch(L){console.error("轮询登录状态失败:",L),C()}},2e3))},C=()=>{N&&(clearInterval(N),N=null),z.value=!1};return{LOGIN_TYPE:l,LOGIN_STEP:b,loginType:k,currentStep:m,phone:t,code:a,captchaToken:h,loading:_,countdown:w,devSmsCode:I,qrcodeData:V,qrcodeScene:K,qrcodeExpireTime:W,qrcodePolling:z,qrcodeLoginSuccess:Q,isPhoneValid:s,isCodeComplete:S,countdownText:p,sendSmsCode:y,nextStep:R,prevStep:J,login:ne,reset:Z,cleanup:()=>{f(),C()},getLoginQrcode:F,refreshQrcode:async()=>{C(),await F()},switchLoginType:L=>{k.value=L,L===l.QRCODE?F():C()}}}const as={name:"dragVerify",components:{Icon:Qe},props:{isPassing:{type:Boolean,default:!1},width:{type:Number,default:250},height:{type:Number,default:40},text:{type:String,default:"swiping to the right side"},successText:{type:String,default:"success"},background:{type:String,default:"#eee"},progressBarBg:{type:String,default:"#76c61d"},completedBg:{type:String,default:"#76c61d"},circle:{type:Boolean,default:!1},radius:{type:String,default:"4px"},handlerIcon:{type:String,default:"mdi-light:chevron-double-right"},successIcon:{type:String,default:"mdi-light:check-circle"},handlerBg:{type:String,default:"#fff"},textSize:{type:String,default:"14px"},textColor:{type:String,default:"#333"}},mounted:function(){const u=this.$refs.dragVerify;u.style.setProperty("--textColor",this.textColor),u.style.setProperty("--width",Math.floor(this.width/2)+"px"),u.style.setProperty("--pwidth",-Math.floor(this.width/2)+"px"),console.log(this.$slots)},computed:{handlerStyle:function(){return{width:this.height+"px",height:this.height+"px",background:this.handlerBg}},message:function(){return this.isPassing?this.successText:this.text},dragVerifyStyle:function(){return{width:this.width+"px",height:this.height+"px",lineHeight:this.height+"px",background:this.background,borderRadius:this.circle?this.height/2+"px":this.radius}},progressBarStyle:function(){return{background:this.progressBarBg,height:this.height+"px",borderRadius:this.circle?this.height/2+"px 0 0 "+this.height/2+"px":this.radius}},textStyle:function(){return{height:this.height+"px",width:this.width+"px",fontSize:this.textSize}}},data(){return{isMoving:!1,x:0,isOk:!1,currentIcon:this.handlerIcon}},methods:{dragStart:function(u){this.isPassing||(this.isMoving=!0,this.x=u.pageX||u.touches[0].pageX),this.$emit("handlerMove")},dragMoving:function(u){if(this.isMoving&&!this.isPassing){var l=(u.pageX||u.touches[0].pageX)-this.x,b=this.$refs.handler;l>0&&l<=this.width-this.height?(b.style.left=l+"px",this.$refs.progressBar.style.width=l+this.height/2+"px"):l>this.width-this.height&&(b.style.left=this.width-this.height+"px",this.$refs.progressBar.style.width=this.width-this.height/2+"px",this.passVerify())}},dragFinish:function(u){if(this.isMoving&&!this.isPassing){var l=(u.pageX||u.changedTouches[0].pageX)-this.x;if(l<this.width-this.height){this.isOk=!0;var b=this;setTimeout(function(){b.$refs.handler.style.left="0",b.$refs.progressBar.style.width="0",b.isOk=!1},500),this.$emit("passfail")}else{var k=this.$refs.handler;k.style.left=this.width-this.height+"px",this.$refs.progressBar.style.width=this.width-this.height/2+"px",this.passVerify()}this.isMoving=!1}},passVerify:function(){this.$emit("update:isPassing",!0),this.isMoving=!1,this.currentIcon=this.successIcon,this.$refs.progressBar.style.background=this.completedBg,this.$refs.message.style["-webkit-text-fill-color"]="unset",this.$refs.message.style.animation="slidetounlock2 3s infinite",this.$refs.message.style.color="#fff",this.$emit("passcallback")},reset:function(){this.isMoving=!1,this.x=0,this.isOk=!1,this.currentIcon=this.handlerIcon;var u=this.$refs.handler,l=this.$refs.message;u.style.left="0",this.$refs.progressBar.style.width="0",l.style["-webkit-text-fill-color"]="transparent",l.style.animation="slidetounlock 3s infinite",l.style.color=this.background,this.$emit("update:isPassing",!1)}}};function is(u,l,b,k,m,t){const a=de;return n(),i("div",{ref:"dragVerify",class:"drag_verify",style:me(t.dragVerifyStyle),onMousemove:l[2]||(l[2]=(...h)=>t.dragMoving&&t.dragMoving(...h)),onMouseup:l[3]||(l[3]=(...h)=>t.dragFinish&&t.dragFinish(...h)),onMouseleave:l[4]||(l[4]=(...h)=>t.dragFinish&&t.dragFinish(...h)),onTouchmove:l[5]||(l[5]=(...h)=>t.dragMoving&&t.dragMoving(...h)),onTouchend:l[6]||(l[6]=(...h)=>t.dragFinish&&t.dragFinish(...h))},[e("div",{class:Y(["dv_progress_bar",{goFirst2:m.isOk}]),ref:"progressBar",style:me(t.progressBarStyle)},null,6),e("div",{class:"dv_text",style:me(t.textStyle),ref:"message"},[u.$slots.textBefore?Re(u.$slots,"textBefore",{key:0},void 0,!0):x("",!0),A(" "+M(t.message)+" ",1),u.$slots.textAfter?Re(u.$slots,"textAfter",{key:1},void 0,!0):x("",!0)],4),e("div",{class:Y(["dv_handler dv_handler_bg",{goFirst:m.isOk}]),onMousedown:l[0]||(l[0]=(...h)=>t.dragStart&&t.dragStart(...h)),onTouchstart:l[1]||(l[1]=(...h)=>t.dragStart&&t.dragStart(...h)),ref:"handler",style:me(t.handlerStyle)}
1,[m.currentIcon?(n(),re(a,{key:0,icon:m.currentIcon,width:"24px",height:"24px",class:"handler-icon"},null,8,["icon"])):x("",!0)],38)],36)}const rs=oe(as,[["render",is],["__scopeId","data-v-df479fcf"]]),us={class:"code-input"},cs={class:"code-boxes"},ds=["value","onInput","onKeydown"],vs={__name:"CodeInput",props:{modelValue:{type:String,default:""},length:{type:Number,default:6}},emits:["update:modelValue","complete"],setup(u,{expose:l,emit:b}){const k=u,m=b,t=v([]),a=U(()=>{const s=k.modelValue.split("");for(;s.length<k.length;)s.push("");return s.slice(0,k.length)}),h=(s,S)=>{const $=S.target.value.replace(/\D/g,"");if($){const f=[...a.value];f[s]=$[0];const y=f.join("");m("update:modelValue",y),s<k.length-1?ae(()=>{t.value[s+1]?.focus()}):(S.target.blur(),y.length===k.length&&m("complete",y))}else{const f=[...a.value];f[s]="",m("update:modelValue",f.join(""))}},_=(s,S)=>{if(S.key==="Backspace"){if(!a.value[s]&&s>0){const p=[...a.value];p[s-1]="",m("update:modelValue",p.join("")),ae(()=>{t.value[s-1]?.focus()})}else if(a.value[s]){const p=[...a.value];p[s]="",m("update:modelValue",p.join(""))}}else S.key==="ArrowLeft"&&s>0?t.value[s-1]?.focus():S.key==="ArrowRight"&&s<k.length-1&&t.value[s+1]?.focus()},w=s=>{s.preventDefault();const p=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,k.length);if(p){m("update:modelValue",p);const $=Math.min(p.length,k.length)-1;ae(()=>{t.value[$]?.focus()}),p.length===k.length&&m("complete",p)}},I=()=>{const s=a.value.findIndex(p=>!p),S=s>=0?s:0;ae(()=>{t.value[S]?.focus()})};return l({focusFirst:I,clear:()=>{m("update:modelValue",""),I()}}),(s,S)=>(n(),i("div",us,[e("div",cs,[(n(!0),i(ee,null,le(a.value,(p,$)=>(n(),i("input",{key:$,ref_for:!0,ref:f=>t.value[$]=f,type:"text",inputmode:"numeric",maxlength:"1",value:p,onInput:f=>h($,f),onKeydown:f=>_($,f),onPaste:w,class:Y(["code-box",{filled:p}])},null,42,ds))),128))])]))}},Oe=oe(vs,[["__scopeId","data-v-563c0797"]]),hs={key:0,class:"login-fullscreen-overlay"},ps={class:"login-content"},fs={class:"login-box"},gs={class:"login-box-body"},ms={class:"login-tabs"},ys={key:0,class:"qrcode-login"},bs={class:"qrcode-container"},_s={key:0,class:"qrcode-loading"},ws={key:1,class:"qrcode-wrapper"},ks=["src"],Ss={key:0,class:"qrcode-mask qrcode-success"},xs={key:1,class:"qrcode-mask"},$s={key:2,class:"qrcode-error"},Cs={key:1,class:"sms-login"},Ms={key:0,class:"step-phone"},Is={class:"form-group"},Ls={class:"phone-input-wrapper"},Ts={class:"form-group"},Rs={class:"form-group"},Ps={class:"checkbox-wrapper"},Bs=["disabled"],Es={key:1,class:"step-code"},Ds={class:"code-tip"},Vs={class:"form-group"},Os={class:"code-actions"},qs=["disabled"],Ns={key:0,class:"dev-tip"},Fs=["disabled"],Hs={__name:"LoginModal",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","success"],setup(u,{emit:l}){const b=u,k=l,m=v(null),t=v(null),a=v(!1),h=v(!1),{LOGIN_TYPE:_,LOGIN_STEP:w,loginType:I,currentStep:P,phone:s,code:S,captchaToken:p,loading:$,countdown:f,devSmsCode:y,qrcodeData:R,qrcodePolling:J,qrcodeLoginSuccess:ne,isPhoneValid:Z,isCodeComplete:V,countdownText:K,nextStep:W,prevStep:z,login:Q,reset:N,cleanup:F,getLoginQrcode:B,refreshQrcode:C,switchLoginType:se}=Ve();let O=null;const pe=()=>{O&&clearInterval(O),O=Ce(()=>{_e().isLoggedIn&&I.value===_.QRCODE&&(clearInterval(O),O=null,k("success"),ce(),X.success("登录成功"),setTimeout(()=>{window.location.reload()},500))},500)};ye(()=>{F(),O&&clearInterval(O)});const L=()=>{p.value=`captcha_${Date.now()}_${Math.random().toString(36).substr(2,9)}`},ue=H=>{se(H)},fe=async()=>{try{await C()}catch{X.error("刷新二维码失败")}},ge=async()=>{try{await W(),setTimeout(()=>{t.value?.focusFirst()},100)}catch(H){X.error(H.response?.data?.error||"发送验证码失败")}},ke=()=>{z(),m.value?.reset(),a.value=!1},Se=async()=>{try{await W()}catch(H){X.error(H.response?.data?.error||"发送验证码失败")}},E=async()=>{try{await Q(),k("success"),ce(),X.success("登录成功"),setTimeout(()=>{window.location.reload()},500)}catch(H){X.error(H.response?.data?.error||"登录失败")}},ce=()=>{k("update:visible",!1)};return ve(()=>b.visible,H=>{H?I.value===_.QRCODE&&(B(),pe()):(O&&(clearInterval(O),O=null),setTimeout(()=>{N(),a.value=!1,h.value=!1},300))}),ye(()=>{F(),O&&clearInterval(O)}),(H,g)=>(n(),re(Ee,{to:"body"},[T(te,{name:"modal"},{default:D(()=>[u.visible?(n(),i("div",hs,[e("div",ps,[g[16]||(g[16]=e("div",{class:"logo-section"},[e("img",{src:"https://glbfs.mechrevo.com/website/static/images/logo-white-full.png",alt:"机械革命",class:"logo-white"})],-1)),e("div",fs,[e("div",{class:"login-box-header"},[g[6]||(g[6]=e("h2",{class:"login-title"},"登录机械革命账号",-1)),e("button",{class:"close-btn",onClick:ce},"×")]),e("div",gs,[e("div",ms,[e("div",{class:Y(["tab-item",{active:o(I)===o(_).QRCODE}]),onClick:g[0]||(g[0]=j=>ue(o(_).QRCODE))}," 微信登录 ",2),e("div",{class:Y(["tab-item",{active:o(I)===o(_).SMS}]),onClick:g[1]||(g[1]=j=>ue(o(_).SMS))}," 短信登录 ",2)]),o(I)===o(_).QRCODE?(n(),i("div",ys,[e("div",bs,[o($)?(n(),i("div",_s,[...g[7]||(g[7]=[e("div",{class:"loading-spinner"},null,-1),e("p",null,"加载中...",-1)])])):o(R)?(n(),i("div",ws,[e("img",{src:o(R),alt:"登录二维码",class:"qrcode-image"},null,8,ks),o(ne)?(n(),i("div",Ss,[...g[8]||(g[8]=[e("div",{class:"success-icon"},"✓",-1),e("p",null,"登录成功",-1)])])):o(J)?x("",!0):(n(),i("div",xs,[g[9]||(g[9]=e("p",null,"二维码已过期",-1)),e("button",{class:"btn-refresh",onClick:fe}
1," 刷新二维码 ")]))])):(n(),i("div",$s,[g[10]||(g[10]=e("p",null,"二维码加载失败",-1)),e("button",{class:"btn-refresh",onClick:fe}," 重新加载 ")]))]),g[11]||(g[11]=e("div",{class:"qrcode-tips"},[e("p",{class:"tip-title"},"使用微信扫一扫登录"),e("p",{class:"tip-desc"},"若继续,则表示同意隐私政策和使用条款。")],-1))])):x("",!0),o(I)===o(_).SMS?(n(),i("div",Cs,[o(P)===o(w).PHONE?(n(),i("div",Ms,[e("div",Is,[e("div",Ls,[g[12]||(g[12]=e("span",{class:"phone-prefix"},"+86",-1)),he(e("input",{"onUpdate:modelValue":g[2]||(g[2]=j=>be(s)?s.value=j:null),type:"tel",placeholder:"请输入手机号",maxlength:"11",class:"form-input",onKeyup:Ae(ge,["enter"])},null,544),[[we,o(s)]])])]),e("div",Ts,[T(rs,{ref_key:"dragVerifyRef",ref:m,width:480,height:46,isPassing:a.value,"onUpdate:isPassing":g[3]||(g[3]=j=>a.value=j),text:"请按住滑块,拖到最右边","success-text":"验证成功","handler-icon":"mdi-light:chevron-double-right","success-icon":"mdi-light:check-circle",onPasscallback:L,style:{border:"solid 1px #dcdfe6"}},null,8,["isPassing"])]),e("div",Rs,[e("label",Ps,[he(e("input",{type:"checkbox","onUpdate:modelValue":g[4]||(g[4]=j=>h.value=j)},null,512),[[Ke,h.value]]),g[13]||(g[13]=e("span",null,[A("同意并愿意遵守机械革命"),e("a",{href:"/service.html",target:"_blank"},"隐私政策和使用条款"),A("。")],-1))])]),e("button",{class:"btn-primary btn-block",disabled:!o(Z)||!a.value||!h.value||o($),onClick:ge},M(o($)?"发送中...":"下一步"),9,Bs)])):x("",!0),o(P)===o(w).CODE?(n(),i("div",Es,[e("p",Ds,[g[14]||(g[14]=A(" 验证码已经发送至",-1)),e("strong",null,M(o(s)),1)]),e("div",Vs,[T(Oe,{ref_key:"codeInputRef",ref:t,modelValue:o(S),"onUpdate:modelValue":g[5]||(g[5]=j=>be(S)?S.value=j:null),onComplete:E},null,8,["modelValue"])]),e("div",Os,[e("button",{class:"btn-text",disabled:o(f)>0,onClick:Se},M(o(K)==="获取验证码"?"重新发送":o(K)),9,qs)]),o(y)?(n(),i("div",Ns,[e("p",null,[g[15]||(g[15]=A("开发环境验证码:",-1)),e("strong",null,M(o(y)),1)])])):x("",!0),e("button",{class:"btn-primary btn-block",disabled:!o(V)||o($),onClick:E},M(o($)?"登录中...":"登录"),9,Fs),e("button",{class:"btn-text-link",onClick:ke}," 返回修改手机号 ")])):x("",!0)])):x("",!0)])])])])):x("",!0)]),_:1})]))}},Us=oe(Hs,[["__scopeId","data-v-d37bb392"]]),Qs=""+new URL("logo-white.D88PIZJc.png",import.meta.url).href,As=""+new URL("logo.DxK4HwXo.png",import.meta.url).href,Ks={key:0,class:"pc-header-placeholder"},zs={class:"container"},js={class:"header-content"},Gs=["src"],Ws={class:"nav-menu-wrapper"},Xs=["onMouseenter"],Ys={key:1,class:"nav-item"},Js={class:"search-input-icon"},Zs={class:"header-actions"},et={class:"language-select-btn"},st={key:0,class:"language-dropdown"},tt={class:"container"},ot={class:"search-results-layout"},nt={class:"search-results-content"},lt={class:"search-results-inner"},at=["onClick"],it={key:0,class:"result-icon"},rt=["src","alt"],ut={key:1,class:"result-image-placeholder"},ct={class:"result-info"},dt={class:"result-name"},vt={class:"result-type"},ht={key:1,class:"search-no-results"},pt={key:2,class:"search-loading"},ft={class:"container"},gt={class:"sub-menu-inner"},mt={class:"sub-menu-content-wrapper"},yt={key:0,class:"sub-menu-image-wrapper"},bt=["src","alt"],_t=["src","alt"],wt=["src","alt"],kt={class:"sub-menu-content"},St={class:"sub-menu-title"},xt={key:0,class:"sub-menu-subtitle"},$t={__name:"Header",props:{transparent:{type:Boolean,default:!1}},async setup(u){let l,b;const k=u,m=ze(),t=je(),a=_e(),h=v(!1),_=v(!1),w=v(null),I=v(!1),P=r=>r==="/"?{position:"fixed",forceShowSubMenu:!1}:r.startsWith("/series/")?{position:"relative",forceShowSubMenu:!0}:r.startsWith("/products/")?{position:"relative",forceShowSubMenu:!1}:{position:"relative",forceShowSubMenu:!1},s=U(()=>P(t.path)),S=U(()=>{const r=[];return s.value.position==="fixed"?r.push("is-fixed"):r.push("is-relative"),s.value.forceShowSubMenu&&r.push("has-forced-submenu"),r}),p=v(!1),$=v(""),f=v([]),y=v(!1),R=v(!1),J=v(null),ne=v(null),Z=v(null);let V=null;const K=U(()=>!(!k.transparent||I.value||p.value)),W=U(()=>K.value?Qs:As),{data:z}=([l,b]=Ge(async()=>We("top-menus",async()=>{const{getCachedData:r}=Xe();return await r("cache:menu:top:v2",async()=>{const{fetchTopMenus:c}=ls();return await c()},3600)},{server:!0,lazy:!0})),l=await l,b(),l),Q=U(()=>z.value||[]),N=U(()=>w.value?Q.value.find(r=>r.id===w.value):null);Me(async()=>{a&&(a.initFromStorage(),console.log("Header mounted - isLoggedIn:",a.isLoggedIn,"userInfo:",a.userInfo)),console.log("Top menus loaded:",z.value),document.addEventListener("click",O)});const F=U(()=>{const r=t.path;if(r.startsWith("/series/")){for(const c of Q.value)if(c.children&&c.children.length>0&&c.children.some(G=>G.url&&r.startsWith(G.url)))return c.id}if(r.startsWith("/products/")){for(const c of Q.value)if(c.children&&c.children.length>0&&c.children.some(G=>G.url&&G.url.startsWith("/products/")))return c.id}return null});ve(()=>[s.value.forceShowSubMenu,F.value,Q.value.length],()=>{s.value.forceShowSubMenu&&F.value?(w.value=F.value,console.log("强制显示二级菜单,菜单 ID: ",w.value)):s.value.forceShowSubMenu||w.value&&!g.value&&!I.value&&(w.value=null)},{immediate:!0}),a&&ve(()=>a.isLoggedIn,r=>{console.log("Header - isLoggedIn changed:",r,"userInfo:",a.userInfo)},{immediate:!0});const B=()=>{p.value=!1,$.value="",f.value=[],R.value=!1,y.value=!1,V&&(clearTimeout(V),V=null)},C=()=>{I.value=!0},se=()=>{I.value=!1},O=r=>{if(!p.value)return;const c=J.value,q=Z.value;r.target.closest(".search-btn")||c&&c.contains(r.target)||q&&q.contains(r.target)||B()},pe=()=>{V&&clearTimeout(V);const r=$.value.trim();if(r.length<2){f.value=[],R.value=!1,y.value=!1;return}y.value=!0,R.value=!0,V=setTimeout(async()=>{await fe(r)},500)},L=[{keywords:["售后"],path:"/service",name:"After-Sales Service"},{keywords:["驱动"],path:"https://gwqd.mechrevo.com/service/",name:"Driver Download"},{keywords:["保修"],path:"/service#service-policy",name:"Warranty Service Policy"},{keywords:["服务"],path:"/service",name:"Support & Service"},{keywords:["投诉"],action:"openCustomerService",name:"Online Customer Service"}],ue=r=>{const c=r.toLowerCase(),q=[],G=new Set;for(const d of L){const xe=d.keywords.some(Te=>c.includes(Te.toLowerCase())||Te.toLowerCase().includes(c)),$e=d.path||d.action;xe&&!G.has($e)&&(q.push({type:"special",id:$e,name:d.name,path:d.path,action:d.action}),G.add($e))}return q},fe=async r=>{try{const c=ue(r),q=await ie.get("/home/search",{params:{keyword:r,limit:10}});f.value=[...c,...q.objects||[]]}catch(c){console.error("搜索失败:",c);const q=ue(r);f.value=q}finally{y.value=!1}},ge=r=>({display_product:"",special:"快捷入口"})[r]||"",ke=r=>{r.type==="special"?r.action==="openCustomerService"?es():r.path&&(r.path.startsWith("http")?window.open(r.path,"_blank"):m.push(r.path)):r.type==="display_product"&&m.push(`/products/${r.slug}`),B()},Se=async()=>{a&&(h.value=!1,console.log("Login success - isLoggedIn:",a.isLoggedIn,"userInfo:",a.userInfo),await ae(),await a.fetchUserInfo(),console.log("After fetchUserInfo - isLoggedIn:",a.isLoggedIn,"userInfo:",a.userInfo),De("/user/devices"))};let E=null;const ce=r=>{E&&(clearTimeout(E),E=null),r&&r.children&&r.children.length>
10?w.value=r.id:r&&(w.value=null)},H=()=>{s.value.forceShowSubMenu||(E=setTimeout(()=>{g.value||(w.value=null)},200))},g=v(!1),j=()=>{E&&(clearTimeout(E),E=null),g.value=!0},qe=()=>{s.value.forceShowSubMenu||(g.value=!1,E=setTimeout(()=>{w.value=null},100))},Ne=()=>{E&&(clearTimeout(E),E=null),g.value=!1,w.value=null},Le=r=>{r!=="en"&&r==="cn"&&(window.location.href="/cn")};return ye(()=>{E&&(clearTimeout(E),E=null),V&&(clearTimeout(V),V=null),document.removeEventListener("click",O)}),(r,c)=>{const q=Be,G=Ye;return n(),i(ee,null,[!u.transparent&&s.value.position==="fixed"?(n(),i("div",Ks)):x("",!0),e("header",{class:Y(["pc-header header-component",[{"is-transparent":K.value},...S.value]]),onMouseenter:C,onMouseleave:se},[e("div",zs,[e("div",js,[T(q,{to:"/",class:"logo"},{default:D(()=>[e("img",{src:W.value,alt:"机械革命"},null,8,Gs)]),_:1}),e("div",Ws,[e("nav",{class:Y(["nav-menu",{"is-hidden":p.value}]),onMouseleave:H},[(n(!0),i(ee,null,le(Q.value,d=>(n(),i("div",{key:d.id,class:"nav-item-wrapper",onMouseenter:xe=>ce(d)},[d.url?(n(),re(q,{key:0,to:d.url,class:"nav-item","active-class":"active"},{default:D(()=>[A(M(d.title),1)]),_:2},1032,["to"])):(n(),i("span",Ys,M(d.title),1))],40,Xs))),128))],34),e("div",{ref_key:"searchBoxRef",ref:J,class:Y(["search-box",{"is-active":p.value}])},[e("span",Js,[T(de,{name:"https://glbfs.mechrevo.com/website/static/svgicons/find.svg",size:"18px"})]),he(e("input",{ref_key:"searchInputRef",ref:ne,"onUpdate:modelValue":c[0]||(c[0]=d=>$.value=d),type:"text",class:"search-input",placeholder:"Search products...",onInput:pe},null,544),[[we,$.value]]),e("button",{class:"search-close-btn",onClick:Ie(B,["stop"])},[T(de,{name:"https://glbfs.mechrevo.com/website/static/svgicons/close.svg",size:"16px"})])],2)]),e("div",Zs,[e("div",{class:"language-select",onMouseenter:c[3]||(c[3]=d=>_.value=!0),onMouseleave:c[4]||(c[4]=d=>_.value=!1)},[e("button",et,[T(de,{name:"https://glbfs.mechrevo.com/website/static/svgicons/global.svg",size:"16px"}),c[9]||(c[9]=e("span",null,"Global",-1))]),T(te,{name:"dropdown"},{default:D(()=>[_.value?(n(),i("div",st,[e("button",{class:"dropdown-item",onClick:c[1]||(c[1]=d=>Le("en"))},[...c[10]||(c[10]=[e("span",null,"English",-1)])]),e("button",{class:"dropdown-item",onClick:c[2]||(c[2]=d=>Le("cn"))},[...c[11]||(c[11]=[e("span",null,"中文",-1)])])])):x("",!0)]),_:1})],32),x("",!0)])])]),T(te,{name:"search-dropdown"},{default:D(()=>[R.value&&(f.value.length>0||$.value.trim().length>=2&&!y.value||y.value)?(n(),i("div",{key:0,ref_key:"searchResultsRef",ref:Z,class:"search-results-wrapper"},[e("div",tt,[e("div",ot,[c[19]||(c[19]=e("div",{class:"search-results-spacer"},null,-1)),e("div",nt,[e("div",lt,[f.value.length>0?(n(!0),i(ee,{key:0},le(f.value,d=>(n(),i("div",{key:`${d.type}-${d.id}`,class:Y(["search-result-item",{"is-special":d.type==="special"}]),onClick:xe=>ke(d)},[d.type==="special"?(n(),i("div",it,[T(de,{name:"https://glbfs.mechrevo.com/website/static/svgicons/find.svg",size:"16px",color:"#999999"})])):(n(),i(ee,{key:1},[d.main_image_urls?.thumb?(n(),i("img",{key:0,src:d.main_image_urls.thumb,alt:d.name,class:"result-image"},null,8,rt)):(n(),i("div",ut))],64)),e("div",ct,[e("div",dt,M(d.name),1),e("div",vt,M(ge(d.type)),1)])],10,at))),128)):f.value.length===0&&$.value.trim().length>=2&&!y.value?(n(),i("div",ht,[...c[17]||(c[17]=[e("div",{class:"no-results-text"},"没有符合的结果",-1)])])):y.value?(n(),i("div",pt,[...c[18]||(c[18]=[e("div",{class:"loading-text"},"搜索中...",-1)])])):x("",!0)])]),c[20]||(c[20]=e("div",{class:"search-results-actions-spacer"},null,-1))])])],512)):x("",!0)]),_:1}),T(te,{name:"dropdown"},{default:D(()=>[w.value&&N.value&&N.value.children&&N.value.children.length>0?(n(),i("div",{key:0,class:"sub-menu-wrapper",onMouseenter:j,onMouseleave:qe},[e("div",ft,[e("div",gt,[e("div",mt,[(n(!0),i(ee,null,le(N.value.children,d=>(n(),re(q,{key:d.id,to:d.url||"#",class:"sub-menu-item",onClick:Ne},{default:D(()=>[d.main_image_urls?.thumb&&d.hover_image_urls?.thumb?(n(),i("div",yt,[e("img",{src:d.main_image_urls.thumb,alt:d.title,class:"sub-menu
1-image sub-menu-image-default"},null,8,bt),e("img",{src:d.hover_image_urls.thumb,alt:d.title,class:"sub-menu-image sub-menu-image-hover"},null,8,_t)])):d.main_image_urls?.thumb?(n(),i("img",{key:1,src:d.main_image_urls.thumb,alt:d.title,class:"sub-menu-image"},null,8,wt)):x("",!0),e("div",kt,[e("div",St,M(d.title),1),d.sub_title?(n(),i("div",xt,M(d.sub_title),1)):x("",!0)])]),_:2},1032,["to"]))),128))])])])],32)):x("",!0)]),_:1}),T(G,null,{default:D(()=>[T(Us,{visible:h.value,"onUpdate:visible":c[8]||(c[8]=d=>h.value=d),onSuccess:Se},null,8,["visible"])]),_:1})],34)],64)}}},Io=oe($t,[["__scopeId","data-v-7472dca8"]]),Ct={class:"modal-header"},Mt={class:"modal-title"},It={class:"modal-body"},Lt={key:0,class:"step-phone"},Tt={class:"form-group"},Rt={class:"form-group"},Pt={key:0,class:"dev-tip"},Bt=["disabled"],Et={key:1,class:"step-code"},Dt={class:"code-tip"},Vt={class:"form-group"},Ot={class:"code-actions"},qt=["disabled"],Nt={key:0,class:"dev-tip"},Ft=["disabled"],Ht={__name:"LoginModal",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","success"],setup(u,{emit:l}){const b=u,k=l,m=v(null),t=v(null),{LOGIN_STEP:a,currentStep:h,phone:_,code:w,captchaToken:I,loading:P,countdown:s,devSmsCode:S,isPhoneValid:p,isCodeComplete:$,countdownText:f,nextStep:y,prevStep:R,login:J,reset:ne,cleanup:Z}=Ve(),V=U(()=>h.value===a.PHONE?"登录 / 注册":"输入验证码"),K=B=>{I.value=B},W=async()=>{try{await y(),setTimeout(()=>{t.value?.focusFirst()},100)}catch(B){X.error(B.message||"发送验证码失败")}},z=()=>{R(),m.value?.reset()},Q=async()=>{try{await y()}catch(B){X.error(B.message||"发送验证码失败")}},N=async()=>{try{await J(),k("success"),F()}catch(B){X.error(B.message||"登录失败")}},F=()=>{k("update:visible",!1)};return ve(()=>b.visible,B=>{B||setTimeout(()=>{ne()},300)}),ye(()=>{Z()}),(B,C)=>(n(),re(Ee,{to:"body"},[T(te,{name:"slide-up"},{default:D(()=>[u.visible?(n(),i("div",{key:0,class:"mobile-modal-overlay",onClick:F},[e("div",{class:"mobile-modal-container",onClick:C[2]||(C[2]=Ie(()=>{},["stop"]))},[e("div",Ct,[e("h2",Mt,M(V.value),1),e("button",{class:"modal-close",onClick:F},"×")]),e("div",It,[o(h)===o(a).PHONE?(n(),i("div",Lt,[e("div",Tt,[C[3]||(C[3]=e("label",null,"手机号",-1)),he(e("input",{"onUpdate:modelValue":C[0]||(C[0]=se=>be(_)?_.value=se:null),type:"tel",placeholder:"请输入手机号",maxlength:"11",class:"form-input"},null,512),[[we,o(_)]])]),e("div",Rt,[C[4]||(C[4]=e("label",null,"滑块验证",-1)),T(ts,{ref_key:"captchaRef",ref:m,onVerified:K},null,512)]),o(S)?(n(),i("div",Pt,[e("p",null,[C[5]||(C[5]=A("开发环境验证码:",-1)),e("strong",null,M(o(S)),1)])])):x("",!0),e("button",{class:"btn-primary btn-block",disabled:!o(p)||!o(I)||o(P),onClick:W},M(o(P)?"发送中...":"下一步"),9,Bt)])):x("",!0),o(h)===o(a).CODE?(n(),i("div",Et,[e("p",Dt,[C[6]||(C[6]=A("验证码已发送至 ",-1)),e("strong",null,M(o(_)),1)]),e("div",Vt,[C[7]||(C[7]=e("label",null,"验证码",-1)),T(Oe,{ref_key:"codeInputRef",ref:t,modelValue:o(w),"onUpdate:modelValue":C[1]||(C[1]=se=>be(w)?w.value=se:null),onComplete:N},null,8,["modelValue"])]),e("div",Ot,[e("button",{class:"btn-text",disabled:o(s)>0,onClick:Q},M(o(f)),9,qt)]),o(S)?(n(),i("div",Nt,[e("p",null,[C[8]||(C[8]=A("开发环境验证码:",-1)),e("strong",null,M(o(S)),1)])])):x("",!0),e("button",{class:"btn-primary btn-block",disabled:!o($)||o(P),onClick:N},M(o(P)?"登录中...":"登录"),9,Ft),e("button",{class:"btn-text btn-block",onClick:z}," 返回修改手机号 ")])):x("",!0)])])])):x("",!0)]),_:1})]))}},Ut=oe(Ht,[["__scopeId","data-v-fa246740"]]),Qt={class:"mobile-header header-component"},At={class:"header-content"},Kt={class:"user-avatar-small"},zt={key:0,class:"mobile-menu"},jt={class:"menu-content"},Gt={class:"nav-menu"},Wt={class:"user-sheet-header"},Xt={class:"user-info-section"},Yt={class:"user-avatar-large"},Jt={class:"user-text"},Zt={class:"user-nickname"},eo={class:"user-phone"},so={class:"user-sheet-menu"},to={__name:"Header",setup(u){const l=_e(),b=ss(),{isMenuOpen:k}=Je(b),m=v(!1),t=v(!1),a=[{label:"首页",path:"/"},{label:"产品",path:"/products"},{label:"解决方案",path:"/solutions"},{label:"下载",path:"/downloads"},{label:"售后服务",path:"/service"}];Me(()=>{l.initFromStorage()});const h=()=>{b.toggleMenu()},_=()=>{b.closeMenu()},w=async()=>{m.value=!1,await ae(),De("/user/account")},I=async()=>{confirm("确定要退出登录吗?")&&(t.value=!1,await l.logout())};return(P,s)=>{const S=Be;return n(),i("header",Qt,[e("div",At,[e("button",{class:"menu-btn",onClick:h},[...s[6]||(s[6]=[e("span",{class:"menu-icon"},null,-1)])]),T(S,{to:"/",class:"logo"},{default:D(()=>[...s[7]||(s[7]=[e("span",{class:"logo-text"},"机械革命",-1)])]),_:1}),o(l).isLoggedIn?(n(),i("button",{key:0,class:"user-icon-btn",onClick:s[0]||(s[0]=p=>t.value=!0)},[e("span",Kt,M(o(l).userInfo?.nick_name?.[0]||"用"),1)])):(n(),i("button",{key:1,class:"login-btn-mobile",onClick:s[1]||(s[1]=p=>m.value=!0)}," 登录 "))]),T(te,{name:"slide"},{default:D(()=>[o(k)?(n(),i("div",zt,[e("div",{class:"menu-overlay",onClick:_}),e("div",jt,[e("div",{class:"menu-header"},[e("button",{class:"close-btn",onClick:_},"×")]),e("nav",Gt,[(n(),i(ee,null,le(a,p=>T(S,{key:p.path,to:p.path,class:"nav-item",onClick:_},{default:D(()=>[A(M(p.label),1)]),_:2},1032,["to"])),64))])])])):x("",!0)]),_:1}),T(te,{name:"slide-up"},{default:D(()=>[t.value?(n(),i("div",{key:0,class:"user-sheet-overlay",onClick:s[4]||(s[4]=p=>t.value=!1)},[e("div",{class:"user-sheet",onClick:s[3]||(s[3]=Ie(()=>{},["stop"]))},[e("div",Wt,[e("div",Xt,[e("div",Yt,M(o(l).userInfo?.nick_name?.[0]||"用"),1),e("div",Jt,[e("div",Zt,M(o(l).userInfo?.nick_name||"用户"),1),e("div",eo,M(o(l).userInfo?.phone||""),1)])])]),e("div",so,[T(S,{to:"/user/account",class:"sheet-item",onClick:s[2]||(s[2]=p=>t.value=!1)},{default:D(()=>[...s[8]||(s[8]=[e("span",null,"个人中心",-1),e("span",{class:"arrow"},"›",-1)])]),_:1}),e("button",{class:"sheet-item",onClick:I},[...s[9]||(s[9]=[e("span",null,"退出登录",-1),e("span",{class:"arrow"},"›",-1)])])])])])):x("",!0)]),_:1}),T(Ut,{visible:m.value,"onUpdate:visible":s[5]||(s[5]=p=>m.value=p),onSuccess:w},null,8,["visible"])])}}},Lo=oe(to,[["__scopeId","data-v-523705bb"]]),oo={submitReview(u){return ie.post("/website_reviews",u)}
1,getReviewAspects(){return ie.get("/website_reviews/aspects")}},no={key:0,class:"review-popover"},lo={class:"review-content"},ao={key:0,class:"rating-section"},io={class:"title"},ro={class:"stars"},uo=["onClick"],co=["fill"],vo={key:1,class:"content-section"},ho=["disabled"],po={key:2,class:"success-message"},fo={__name:"ReviewPopover",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(u,{emit:l}){const b=u,k=l,m=v([{value:"website",label:"官网体验(页面浏览/设计)"},{value:"service",label:"服务体验(售后/客服)"},{value:"product",label:"产品体验(产品/配套软件)"}]),t=v(""),a=v(0),h=v(""),_=v(!1),w=v(!1),I=U(()=>{const f=m.value.find(y=>y.value===t.value);return f?f.label:""}),P=U(()=>t.value&&a.value>0);function s(){k("close")}function S(f){a.value=f}async function p(){if(!(!P.value||_.value)){_.value=!0;try{const f={aspect:t.value,rating:a.value,content:h.value},y=await oo.submitReview(f);console.log("提交评价成功:",y),w.value=!0,setTimeout(()=>{w.value=!1,$(),s()},2e3)}catch(f){console.error("提交评价失败:",f),X.error("提交失败,请稍后重试:"+(f.message||"未知错误"))}finally{_.value=!1}}}function $(){t.value="",a.value=0,h.value="",w.value=!1}return ve(()=>b.visible,f=>{f||setTimeout($,300)}),(f,y)=>u.visible?(n(),i("div",no,[e("div",lo,[e("button",{class:"close-btn",onClick:s},[...y[2]||(y[2]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),y[5]||(y[5]=e("h3",{class:"title"},[A("您要评价哪个方面:"),e("span",{class:"required"},"*")],-1)),T(o(ns),{value:t.value,"onUpdate:value":y[0]||(y[0]=R=>t.value=R),class:"aspect-options"},{default:D(()=>[(n(!0),i(ee,null,le(m.value,R=>(n(),re(o(os),{key:R.value,value:R.value,class:"aspect-option"},{default:D(()=>[A(M(R.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),t.value?(n(),i("div",ao,[e("h3",io,[A('请对"'+M(I.value)+'"进行评价:',1),y[3]||(y[3]=e("span",{class:"required"},"*",-1))]),e("div",ro,[(n(),i(ee,null,le(5,R=>e("button",{key:R,class:Y(["star",{active:R<=a.value}]),onClick:J=>S(R),type:"button"},[(n(),i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:R<=a.value?"#FFD700":"#E0E0E0",stroke:"none"},[...y[4]||(y[4]=[e("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])],8,co))],10,uo)),64))])])):x("",!0),t.value&&a.value>0?(n(),i("div",vo,[he(e("textarea",{"onUpdate:modelValue":y[1]||(y[1]=R=>h.value=R),class:"content-textarea",placeholder:"请输入您的评价内容(可选)",rows:"4"},null,512),[[we,h.value]])])):x("",!0),e("button",{class:"submit-btn",disabled:!P.value||_.value,onClick:p},M(_.value?"提交中...":"提交"),9,ho),w.value?(n(),i("div",po," 感谢您的评价! ")):x("",!0)])])):x("",!0)}},go=oe(fo,[["__scopeId","data-v-80ce6b9f"]]),mo={class:"floating-buttons"},yo={__name:"FloatingButtons",setup(u){const l=v(!1),b=v(!1);function k(){l.value=window.scrollY>window.innerHeight}function m(){window.scrollTo({top:0,behavior:"smooth"})}return Me(()=>{window.addEventListener("scroll",k),k()}),Ze(()=>{window.removeEventListener("scroll",k)}),(t,a)=>(n(),i("div",mo,[T(te,{name:"fade"},{default:D(()=>[l.value?(n(),i("button",{key:0,class:"floating-btn scroll-top-btn",onClick:m,title:"返回顶部"},[...a[1]||(a[1]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"18 15 12 9 6 15"})],-1)])])):x("",!0)]),_:1}),T(go,{visible:b.value,onClose:a[0]||(a[0]=h=>b.value=!1)},null,8,["visible"])]))}},To=oe(yo,[["__scopeId","data-v-252aecf1"]]);export{To as F,Io as _,Lo as a,ls as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.