PageSourceSearch

https://assets.iyunbiao.com/templets/eversheet/lato-header/create-order.js

js iyunbiao.com collected 2026-10-02 06:30:50 UTC 13,870 bytes, 413 lines download raw bytes

1var _hmt = _hmt || [];
2if (window.navigator.userAgent.indexOf("Eversheet") == -1) {
3  (function () {
4    var hm = document.createElement("script");
5    hm.src = "https://hm.baidu.com/hm.js?25a1d0336e1f7e3ef910ad112b3281d1";
6    var s = document.getElementsByTagName("script")[0];
7    s.parentNode.insertBefore(hm, s);
8  })();
9  (function () {
10    var hm = document.createElement("script");
11    hm.src = "https://hm.baidu.com/hm.js?1265b8740a78148ed7e64a705b5b1b1e";
12    var s = document.getElementsByTagName("script")[0];
13    s.parentNode.insertBefore(hm, s);
14  })();
15}
16
17//云表的统计注册来源
18(function () {
19  var hm = document.createElement("script");
20  hm.src = "https://www.iyunbiao.com/templets/eversheet/js/lato-utm.js";
21  var s = document.getElementsByTagName("script")[0];
22  s.parentNode.insertBefore(hm, s);
23})();
24
25(function (w, d, t, r, u) {
26  var f, n, i;
27  (w[u] = w[u] || []),
28    (f = function () {
29      var o = { ti: "97159627", enableAutoSpaTracking: true };
30      (o.q = w[u]), (w[u] = new UET(o)), w[u].push("pageLoad");
31    }),
32    (n = d.createElement(t)),
33    (n.src = r),
34    (n.async = 1),
35    (n.onload = n.onreadystatechange =
36      function () {
37        var s = this.readyState;
38        (s && s !== "loaded" && s !== "complete") ||
39          (f(), (n.onload = n.onreadystatechange = null));
40      }),
41    (i = d.getElementsByTagName(t)[0]),
42    i.parentNode.insertBefore(n, i);
43})(window, document, "script", "//bat.bing.com/bat.js", "uetq");
44
45(function () {
46  // 右侧悬浮窗口 开始
47  function createLearn() {
48    const footer = document.createElement("div");
49    footer.classList.add("learn-info");
50    const learnTop = document.createElement("div");
51    learnTop.classList.add("learn-top");
52    // 检查 createConsult 是否存在,避免报错
53    learnTop.onclick = function () {
54      try {
55        if (typeof createConsult === "function") {
56          createConsult();
57        }
58      } catch (e) {
59        console.error("createConsult 函数调用失败:", e);
60      }
61    };
62    learnTop.innerHTML = "在线客服";
63    footer.appendChild(learnTop);
64    const learnBottom = document.createElement("div");
65    learnBottom.classList.add("learn-bottom");
66    const learnOrder = document.createElement("div");
67    learnOrder.classList.add("learn-order");
68    // 检查 createOrder 是否存在,避免报错
69    learnOrder.onclick = function () {
70      try {
71        if (typeof createOrder === "function") {
72          createOrder();
73        }
74      } catch (e) {
75        console.error("createOrder 函数调用失败:", e);
76      }
77    };
78    learnOrder.innerHTML = "预约体验";
79    learnBottom.appendChild(learnOrder);
80    const back = document.createElement("div");
81    back.classList.add("learn-to-top");
82    back.onclick = function () {
83      window.scrollTo(0, 0);
84    };
85    back.innerHTML = "返回";
86    learnBottom.appendChild(back);
87    footer.appendChild(learnBottom);
88    top_bar.appendChild(footer);
89  }
90  // 右侧悬浮窗口 结束
91
92  // 公共部分 开始
93  function headerScroll() {
94    if (
95      document.documentElement.scrollTop == 0 &&
96      document.body.scrollTop == 0
97    ) {
98      signOpen();
99      lato_header.classList.remove("header-active");
100    } else {
101      signClose();
102      lato_header.classList.add("header-active");
103    }
104  }
105  function checkIndex(isIndex) {
106    if (isIndex) {
107      window.addEventListener("scroll", headerScroll);
108    } else {
109      lato_header.classList.add("header-active");
110    }
111  }
112
113  const href = window.location.href;
114  const indexList = ["https://www.iyunbiao.com/", "https://192.168.1.195/"];
115  const isIndex = indexList.includes(href);
116  const lato_header = document.querySelector(".lato-header");
117  checkIndex(isIndex);
118
119  const top_bar = document.querySelector(".top-bar");
120  const isPC = window.navigator.userAgent.indexOf("Mobile") == -1;
121  let zoom = window.innerWidth / (isPC ? 1920 : 750);
122  if (isIndex) top_bar.style.position = "fixed";
123  if (!isPC) {
124    top_bar.classList.add("top-bar-mobile");
125
126    const header_menu = lato_header.querySelector(".header-menu");
127    header_menu.classList.add("display-none");
128
129    const header_menu_left_mobile = lato_header.querySelector(
130      ".header-menu-left-mobile"
131    );
132
133    const menu_icon = lato_header.querySelector(".menu-icon");
134    menu_icon.classList.remove("display-none");
135    menu_icon.addEventListener("click", () => {
136      // 关闭
137      if (menu_icon.classList.contains("menu-close-mobile")) {
138        menu_icon.classList.remove("menu-close-mobile");
139        header_menu.classList.add("display-none");
140        header_menu_left_mobile.classList.add("display-none");
141        lato_header.classList.remove("show-dropdown-panel");
142      } else {
143        // 展示
144        menu_icon.classList.add("menu-close-mobile");
145        header_menu.classList.remove("display-none");
146        header_menu_left_mobile.classList.remove("display-none");
147        lato_header.classList.add("show-dropdown-panel");
148        changeParent(0);
149      }
150    });
151
152    function changeParent(i, eventName) {
153      const header_parent = header_menu.querySelectorAll(".header-parent");
154      const left_a = header_menu_left_mobile.querySelectorAll("a");
155      left_a.forEach((x, y) => {
156        x.classList.remove("a-active");
157        header_parent[y].classList.add("display-none");
158        if (eventName) {
159          x.addEventListener(eventName, () => changeParent(y));
160
161          const child_a = header_parent[y].querySelectorAll(
162            "a span,.header-child a"
163          );
164          child_a.forEach((m) => m.classList.add("header-arrow"));
165        }
166      });
167      left_a[i].classList.add("a-active");
168      header_parent[i].classList.remove("display-none");
169    }
170    changeParent(0, "click");
171  } else {
172    createLearn();
173  }
174  // 公共部分 结束
175
176  // 顶部报名 开始
177  function signOpen() {
178    sign_bg.classList.remove("display-none");
179    sign_left.classList.add("display-none");
180    sign_close.classList.remove("display-none");
181  }
182  function signClose() {
183    sign_bg.classList.add("display-none");
184    sign_left.classList.remove("display-none");
185    sign_close.classList.add("display-none");
186  }
187
188  const sign_box = document.querySelector(".sign-box");
189  if (isIndex) sign_box.classList.remove("display-none");
190  const sign_bg = sign_box.querySelector(".sign-bg");
191  const sign_left = sign_box.querySelector(".sign-left");
192  const sign_open = sign_box.querySelector(".sign-open");
193  const sign_close = sign_box.querySelector(".sign-close");
194  const all_sign_up = sign_box.querySelectorAll(".sign-up");
195  sign_open.addEventListener("click", signOpen);
196  sign_close.addEventListener("click", signClose);
197  all_sign_up.forEach((element) => {
198    element.addEventListener("click", () => {
199      window.open(
200        "https://bbs.iyunbiao.com/forum.php?mod=viewthread&tid=11633"
201      );
202    });
203  });
204  // 顶部报名 结束
205})();
206
207// 用户信息相关功能
208(function () {
209  console.log("开始初始化用户信息功能");
210
211  // 初始化用户信息
212  window.initializeUserInfo = function () {
213    console.log("initializeUserInfo 函数被调用");
214    try {
215      // 不再检查 window.ybUserInfo 是否存在,每次都重新获取用户信息
216      window.ybUserInfo = {};
217      var downloadPcLink =
218        document.querySelector(
219          '.header-child a[href="https://www.iyunbiao.com/download/EversheetClientSetup.exe"]'
220        ) || document.querySelector('a[download="Eversheet.zip"]');
221      if (downloadPcLink) {
222        downloadPcLink.removeAttribute("download");
223        downloadPcLink.href = "https://www.iyunbiao.com/download/download.html";
224      }
225      var xhr = new XMLHttpRequest();
226      xhr.open(
227        "GET",
228        "https://console.iyunbiao.com/console/api/getCurrentUserInfo",
229        true
230      );
231      xhr.setRequestHeader("Accept", "application/json");
232      xhr.onreadystatechange = function () {
233        if (xhr.readyState === 4) {
234          if (xhr.status === 200) {
235            window.ybUserInfo = JSON.parse(xhr.responseText);
236            console.log("获取到用户信息:", window.ybUserInfo);
237            updateLoginStatus();
238          } else {
239            console.log("获取用户信息失败,状态码:", xhr.status);
240            updateLoginStatus();
241          }
242        }
243      };
244
245      xhr.onerror = function () {
246        console.log("获取用户信息网络错误");
247        updateLoginStatus();
248      };
249      xhr.withCredentials = true;
250      xhr.send();
251    } catch (e) {
252      console.error("initializeUserInfo 执行出错:", e);
253      updateLoginStatus();
254    }
255  };
256
257  // 更新登录状态显示
258  window.updateLoginStatus = function () {
259    console.log("updateLoginStatus 函数被调用");
260    try {
261      var logoutDiv = document.getElementById("header-logout");
262      var loginDiv = document.getElementById("header-login");
263
264      if (window.ybUserInfo && window.ybUserInfo["会员账号"]) {
265        // 用户已登录
266        console.log("用户已登录:", window.ybUserInfo["会员账号"]);
267        if (logoutDiv) logoutDiv.style.display = "none";
268        if (loginDiv) {
269          loginDiv.style.display = "block";
270          // 更新用户名
271          var userName = loginDiv.querySelector("#user-name");
272          if (userName) {
273            userName.textContent =
274              window.ybUserInfo["会员账号"] ||
275              window.ybUserInfo["昵称"] ||
276              "用户";
277          }
278        }
279      } else {
280        // 用户未登录
281        console.log("用户未登录");
282        if (logoutDiv) logoutDiv.style.display = "block";
283        if (loginDiv) loginDiv.style.display = "none";
284      }
285    } catch (e) {
286      console.error("updateLoginStatus 执行出错:", e);
287    }
288  };
289
290  // 初始化退出登录功能
291  window.initializeLogout = function () {
292    console.log("initializeLogout 函数被调用");
293    try {
294      var logoutLink = document.getElementById("logout-link");
295      if (logoutLink) {
296        logoutLink.addEventListener("click", function (e) {
297          e.preventDefault();
298          // 执行退出登录操作
299          var xhr = new XMLHttpRequest();
300          xhr.open("GET", "https://console.iyunbiao.com/console/logout", true);
301          xhr.withCredentials = true;
302          xhr.onreadystatechange = function () {
303            if (xhr.readyState === 4) {
304              // 退出登录完成后,清除本地用户信息并刷新当前页面
305              window.ybUserInfo = null;
306              updateLoginStatus();
307              window.location.reload();
308            }
309          };
310          xhr.onerror = function () {
311            // 如果请求失败,也清除本地用户信息并刷新页面
312            window.ybUserInfo = null;
313            updateLoginStatus();
314            window.location.reload();
315          };
316          xhr.send();
317        });
318      }
319    } catch (e) {
320      console.error("initializeLogout 执行出错:", e);
321    }
322  };
323
324  // 检测从登录页面返回的情况
325  function checkLoginReturn() {
326    try {
327      const urlParams = new URLSearchParams(window.location.search);
328      const loginSuccess = urlParams.get("login_success");
329      if (
330        loginSuccess === "true" ||
331        document.referrer.includes("console.iyunbiao.com")
332      ) {
333        initializeUserInfo();
334      }
335    } catch (e) {
336      console.error("checkLoginReturn 执行出错:", e);
337    }
338  }
339
340  // 初始化
341  try {
342    // 设置登录链接的重定向URL为当前页面
343    var loginLink = document.getElementById("login-link");
344    if (loginLink) {
345      var currentUrl = window.location.href;
346      var redirectUrl;
347
348      // 如果当前地址是 https://www.iyunbiao.com/,则跳转到 https://app.iyunbiao.com/home
349      if (
350        currentUrl === "https://www.iyunbiao.com/" ||
351        currentUrl === "https://www.iyunbiao.com"
352      ) {
353        redirectUrl = "https://app.iyunbiao.com/home";
354      } else {
355        // 其他页面跳转回当前页面
356        redirectUrl = currentUrl;
357      }
358
359      loginLink.href =
360        "https://console.iyunbiao.com/console/login?redirect=" +
361        encodeURIComponent(redirectUrl);
362    }
363
364    // 确保在获取用户信息前,先显示未登录状态
365    updateLoginStatus();
366
367    // 初始化用户信息
368    initializeUserInfo();
369
370    // 初始化退出登录功能
371    initializeLogout();
372
373    // 页面加载完成后再检查一次
374    window.addEventListener("load", function () {
375      console.log("window.load 事件触发,再次初始化");
376      initializeUserInfo();
377      initializeLogout();
378    });
379
380    // 后退返回时
381    window.addEventListener("pageshow", function (event) {
382      if (event.persisted) {
383        initializeUserInfo();
384        initializeLogout();
385      }
386    });
387
388    // 定期检查登录状态(每30秒检查一次)
389    setInterval(function () {
390      try {
391        initializeUserInfo();
392      } catch (e) {
393        console.error("定期检查登录状态出错:", e);
394      }
395    }, 30000);
396
397    // 页面可见性变化时检查登录状态
398    document.addEventListener("visibilitychange", function () {
399      if (!document.hidden) {
400        try {
401          initializeUserInfo();
402        } catch (e) {
403          console.error("页面可见性变化时检查登录状态出错:", e);
404        }
405      }
406    });
407
408    // 检查登录返回
409    checkLoginReturn();
410  } catch (e) {
411    console.error("初始化过程出错:", e);
412  }
413})();

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.