const DEFAULT_CHANNEL = "c1"; const DEFAULT_TEMP_LABEL = "发布日期:2024-07-28,版本:3.1.31"; const DEFAULT_LABEL = { android: DEFAULT_TEMP_LABEL, ios: "版本自动更新", webapp: "版本自动更新", windows: "暂未上线", tv: "暂未上线", macos: DEFAULT_TEMP_LABEL, }; const DLURLS = { android: { major: [{ id: "android-lanzout", label: "", title: "Android版" }], minor: [{ id: "android-hk", label: "", title: "Android版" }], }, webapp: { major: [{ id: "pwa-lanzout", label: "", title: "iOS轻量版" }], minor: [{ id: "pwa-lanzout-1", label: "", title: "ios轻量版" }], }, windows: { major: [{ id: "win-lanzout", label: "", title: "Windows版" }], }, tv: { major: [{ id: "tv-lanzout", label: "", title: "TV 版本" }], // minor: [{ id: "tvd-lanzout", label: "", title: "TV Android4低版本" }], }, }; const DLA = { isApple: function () { var u = navigator.userAgent.toLowerCase(); return /iphone|ipad|ipod|ios/i.test(u); }, isAndroid: function () { var u = navigator.userAgent.toLowerCase(); return /android/i.test(u); }, getTypeKey: function (type) { return type && type === "webapp" ? "i" : "a"; }, dlchanel: function () { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const channelValue = urlParams.get("_c"); return channelValue ? channelValue : DEFAULT_CHANNEL; }, dlpackage: function (ostype) { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); return urlParams.get(this.getTypeKey(ostype)); }, adlh: function (item) { let html = []; Object.keys(item).forEach(ostype => { let majorArr = item[ostype].major; let minorArr = item[ostype].minor; for (const idx in majorArr) { html.push(this.dlHtmlItem(majorArr[idx], ostype, true)); } for (const idx in minorArr) { html.push(this.dlHtmlItem(minorArr[idx], ostype, false)); } }) return html; }, dlHtmlItem: function (item, ostype, isMajor = true) { let url = window.location.href; let cc = DLA.dlchanel(); let configItem = DLCONFIG[cc] || DLCONFIG.main(); if (configItem) { url = configItem[item.id]; } let sysIcon = 'img'; let guideBtnCls = 'guide-btn hidden'; if (ostype == "android") { guideBtnCls = "guide-btn android-guide-btn"; sysIcon = "img img_android"; } else if (ostype == "ios") { guideBtnCls = "guide-btn ios-guide-btn"; sysIcon = "img img_ios"; } else if (ostype == "webapp") { guideBtnCls = "guide-btn ios-guide-btn"; sysIcon = "img img_webapp"; } else if (ostype == "windows") { guideBtnCls = "guide-btn pc-guide-btn"; sysIcon = "img img_windows"; } else if (ostype == "macos") { guideBtnCls = "guide-btn pc-guide-btn"; sysIcon = "img img_macos"; } else if (ostype == "tv") { guideBtnCls = "guide-btn tv-guide-btn"; sysIcon = "img img_tv"; } else { } return `