class index { constructor() { this.appUpdateInfo = {}; this.iosDownApkUrl = "http://47.114.153.249/page/home.html"; this.checkUpdateUrl = "http://47.114.153.249:3000/api/json/updateVersion"; this.goToReg(); this.getVersion(); } goToReg() { // 如果地址栏有 objectId,表示代理分享出来的链接,先删除下载区域 if (this.GetQueryString("objectId") != null) { $(".app_download").remove() } if (this.GetQueryString("objectId") == null) { $(".h5_version").remove() } else { $(".h5_version_r").click(() => { if (this.GetQueryString("objectId") == null) { location.href = "../page/reg.html" } else { location.href = `../page/reg.html?objectId=${this.GetQueryString("objectId")}` } }) } } getVersion() { $.ajax({ type: "GET", url: this.checkUpdateUrl, success: (res) => { this.appUpdateInfo = res; // 设置app版本 $(".version_num").text(this.appUpdateInfo.version); // 设置按钮文字 this.downloadApp() == "ios" ? $(".down_button").append(` H5 访问 `) : $(".down_button").append(` 下载并安装 `); // 点击安装事件 this.downloadApp() == "ios" ? $(".down_button").click(() => location.href = this.iosDownApkUrl) : $(".down_button").click(() => location.href = this.appUpdateInfo.downUrl); // 生成二维码 $(".app_download").length != 0 ? this.CreatedQrcode() : '' // 新版本特性 this.appUpdateInfo.updateMsg.forEach((v,i) => { $(".update").append(`