PageSourceSearch

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

js mechrevo.com collected 2026-10-02 11:06:38 UTC 5,205 bytes, 59 lines download raw bytes

1import{u as F,_ as V,a as L,b as Y,c as $,d as G,e as N,f as U,g as O,h as z}from"./1uTAKOxz.js";import{_ as R}from"./CbBh4sUL.js";import{_ as q}from"./sBjZkOV6.js";import{_ as J}from"./CKGOmlzf.js";import{_ as K}from"./x695gxN7.js";import{u as Q}from"./7wDI_HF0.js";import{u as W}from"./DbA58H3q.js";import{h as X,i as Z,j as ee,u as oe,c as d,f as t,F as P,b as o,a as s,w as b,l as te,m as se,o as v}from"./CBVuVATE.js";import{_ as ne}from"./DlAUqK2U.js";import"./C-s4FLFn.js";import"./DpgSet8m.js";import"./C13c8upd.js";const ae={class:"home-page"},ie={class:"discover-section"},re={class:"service-section"},ce={__name:"index-for-redirect",async setup(le){let a,g;const{isMobile:h}=Q(),l=W(),{homeBanners:i,homeActivities:m,homeProducts:r,homeVideos:c,homeServices:u,homeProductSeries:p,fetchAllHomeData:x}=F(),H=[{id:"game",image:"/product-assets/images/series-game.png",title:"游戏本系列",subtitle:"",link:"/series/game"},{id:"thin",image:"/product-assets/images/series-thin.png",title:"轻薄本系列",subtitle:"",link:"/series/thin"},{id:"desktop",image:"/product-assets/images/series-desktop.png",title:"台式机系列",subtitle:"",link:"/series/desktop"}],{data:n}=([a,g]=X(async()=>te("homePageData",async()=>{const{getCachedData:_}=se();return await _("cache:home:index:v2",async()=>(await x(),{banners:i.value,activities:m.value,products:r.value,videos:c.value,services:u.value,series:p.value}),3600)},{server:!0,lazy:!0})),a=await a,g(),a);n.value&&(i.value=n.value.banners||[],m.value=n.value.activities||[],r.value=n.value.products||[],c.value=n.value.videos||[],u.value=n.value.services||[],p.value=n.value.series||[]);const f=()=>{{const e=(window.scrollY||window.pageYOffset)<=0;
1l.setHeaderTransparent(e)}};return Z(()=>{h.value||(l.setHeaderTransparent(!0),window.addEventListener("scroll",f,{passive:!0}))}),ee(()=>{l.setHeaderTransparent(!1),window.removeEventListener("scroll",f)}),oe({script:[{innerHTML:`
2        // 页面特定的内联脚本
3(function() {
4  // 1. 检查当前页面路径
5  if (window.location.pathname !== '/') {
6    console.log('非根路径页面,跳过IP检测');
7    return;
8  }
9  
10  console.log('页面初始化脚本 - IP地理位置检测');
11  
12  // 2. 发起API请求
13  fetch('https://gwapi.mechrevo.com/api/v1/client/home/location', {
14    method: 'GET',
15    headers: {
16      'Content-Type': 'application/json'
17    }
18  })
19  .then(response => {
20    // 3. 检查HTTP响应状态
21    if (!response.ok) {
22      throw new Error(\`HTTP错误! 状态码: \${response.status}\`);
23    }
24    return response.json();
25  })
26  .then(data => {
27    console.log('API响应数据:', data);
28    
29    // 4. 检查API响应状态
30    if (data.status !== 'SUCCESS') {
31      console.warn('API返回状态非SUCCESS:', data.status);
32      return;
33    }
34    
35    // 5. 判断是否为国内IP
36    const isDomesticIP = data.result && 
37                        data.result.location && 
38                        data.result.location.province && 
39                        data.result.location.province.length > 0 &&
40                        data.result.location.city && 
41                        data.result.location.city.length > 0;
42    
43    // 6. 根据IP地区进行跳转
44    if (isDomesticIP) {
45      console.log('检测到国内IP,跳转到 /cn');
46      window.location.href = '/cn';
47    } else {
48      console.log('检测到非国内IP,跳转到 /en');
49      window.location.href = '/en';
50    }
51  })
52  .catch(error => {
53    // 7. 错误处理
54    console.error('IP检测失败:', error);
55    // 可以根据需求添加默认跳转逻辑,例如:
56    // window.location.href = '/en'; // 默认跳转到英文版
57  });
58})();
59      `,type:"text/javascript",tagPosition:"bodyClose"}]}),(_,e)=>{const S=V,y=L,I=Y,w=R,k=q,C=J,T=$,A=G,M=N,D=U,B=O,E=z,j=K;return v(),d("div",ae,[t(h)?(v(),d(P,{key:1},[o(T,{banners:t(i)},null,8,["banners"]),o(A,{activities:t(m)},null,8,["activities"]),o(M,{products:t(r)},null,8,["products"]),o(D,{videos:t(c)},null,8,["videos"]),o(B,{services:t(u)},null,8,["services"]),o(E,{series:t(p)},null,8,["series"]),o(j)],64)):(v(),d(P,{key:0},[o(S,{banners:t(i)},null,8,["banners"]),o(y,{products:t(r)},null,8,["products"]),o(I,{videos:t(c),style:{"padding-top":"180px"}},null,8,["videos"]),s("div",ie,[e[1]||(e[1]=s("h2",{class:"discover-title"},"探索精彩",-1)),e[2]||(e[2]=s("p",{class:"discover-subtitle"},"即刻掌握品牌最新资讯",-1)),o(w,{to:"/news",class:"discover-image-wrapper"},{default:b(()=>[...e[0]||(e[0]=[s("img",{src:"https://glbfs.mechrevo.com/website/static/images/home-discover.jpg",alt:"探索精彩",class:"discover-image"},null,-1)])]),_:1})]),o(k,{title:"了解不同系列的产品",subtitle:"更受年轻人喜爱的中国品牌",items:H,style:{padding:"120px 0 0"}}),s("div",re,[e[4]||(e[4]=s("h2",{class:"service-title"},"售后服务",-1)),e[5]||(e[5]=s("p",{class:"service-subtitle"},null,-1)),o(w,{to:"/service",class:"service-image-wrapper"},{default:b(()=>[...e[3]||(e[3]=[s("img",{src:"https://glbfs.mechrevo.com/website/static/images/home-service.jpg",alt:"售后服务",class:"service-image"},null,-1)])]),_:1})]),o(C)],64))])}}},xe=ne(ce,[["__scopeId","data-v-faacf681"]]);export{xe as default};

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.