修改功能,现已测试注册登录忘记密码
This commit is contained in:
@@ -228,7 +228,66 @@
|
||||
colorLight: "#ffffff",
|
||||
});
|
||||
|
||||
var DEFAULT_DOWNLOAD_INFO = {
|
||||
appName: "彩先知",
|
||||
version: "1.0.0",
|
||||
intro: "随时随地查看预测分析,不错过任何精彩推荐",
|
||||
downloadUrl: downloadUrl,
|
||||
};
|
||||
|
||||
function normalizeDownloadInfo(response) {
|
||||
var data = response && (response.data || response.result || response);
|
||||
if (!data || typeof data !== "object") return DEFAULT_DOWNLOAD_INFO;
|
||||
return {
|
||||
appName: data.appName || data.name || DEFAULT_DOWNLOAD_INFO.appName,
|
||||
version: data.version || data.versionName || DEFAULT_DOWNLOAD_INFO.version,
|
||||
intro:
|
||||
data.intro ||
|
||||
data.description ||
|
||||
data.remark ||
|
||||
DEFAULT_DOWNLOAD_INFO.intro,
|
||||
downloadUrl:
|
||||
data.downloadUrl ||
|
||||
data.apkUrl ||
|
||||
data.androidUrl ||
|
||||
data.url ||
|
||||
DEFAULT_DOWNLOAD_INFO.downloadUrl,
|
||||
iosUrl: data.iosUrl || data.iphoneUrl || data.appStoreUrl || "",
|
||||
};
|
||||
}
|
||||
|
||||
function applyDownloadInfo(info) {
|
||||
var nextInfo = $.extend({}, DEFAULT_DOWNLOAD_INFO, info || {});
|
||||
if (nextInfo.appName) {
|
||||
$(".hero-text h1").html("下载" + CommonUtil.escapeHtml(nextInfo.appName) + "<span>APP</span>");
|
||||
}
|
||||
if (nextInfo.intro) {
|
||||
$(".hero-text p").first().text(nextInfo.intro);
|
||||
}
|
||||
if (nextInfo.downloadUrl) {
|
||||
$("#androidBtn").attr("href", nextInfo.downloadUrl);
|
||||
CommonUtil.generateQRCode(nextInfo.downloadUrl, "downloadQrImg", {
|
||||
width: 180,
|
||||
height: 180,
|
||||
colorDark: "#102b6a",
|
||||
colorLight: "#ffffff",
|
||||
});
|
||||
}
|
||||
if (nextInfo.iosUrl) $("#iosBtn").attr("href", nextInfo.iosUrl);
|
||||
}
|
||||
|
||||
function loadDownloadInfo() {
|
||||
return ApiClient.post(ApiClient.API.appDownloadInfo, {}, { publicRequest: true })
|
||||
.then(function (response) {
|
||||
if (ApiClient.isSuccess(response) || response.data || response.result) {
|
||||
applyDownloadInfo(normalizeDownloadInfo(response));
|
||||
}
|
||||
})
|
||||
.catch(function () {});
|
||||
}
|
||||
|
||||
// Load download links from page config
|
||||
loadDownloadInfo();
|
||||
ApiClient.post("/api/web/index", {})
|
||||
.then(function (result) {
|
||||
if (result.data && result.data.webConfigs) {
|
||||
|
||||
Reference in New Issue
Block a user