样式修改完成,待测试
This commit is contained in:
+16
-8
@@ -140,6 +140,7 @@
|
||||
<button class="gotop" id="backTop" type="button" onclick="window.scrollTo({ top: 0, behavior: 'smooth' })">↑</button>
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var updateData = {
|
||||
idCardFrontId: "",
|
||||
idCardBackId: "",
|
||||
@@ -148,7 +149,7 @@
|
||||
var expertIntroMinLength = 80;
|
||||
|
||||
layui.use(["layer", "jquery"], function () {
|
||||
var $ = layui.$;
|
||||
$ = layui.$;
|
||||
|
||||
CommonUtil.loadPageConfig({ ads: false, links: false });
|
||||
renderLoginState();
|
||||
@@ -204,13 +205,20 @@
|
||||
CommonUtil.getCurrentUserDetail(function (data) {
|
||||
if (!data) return;
|
||||
$("#currentUsername").text(data.nickName || data.username || data.phoneNumber || "用户");
|
||||
var isExpert =
|
||||
data.expert === true ||
|
||||
data.regularExpert === true ||
|
||||
data.isExpert === 1 ||
|
||||
data.isExpert === "1";
|
||||
if (isExpert) {
|
||||
$("#applyBtn").text("已申请").prop("disabled", true);
|
||||
var expertState = CommonUtil.getExpertState
|
||||
? CommonUtil.getExpertState(data)
|
||||
: {
|
||||
isExpert:
|
||||
data.expert === true ||
|
||||
data.regularExpert === true ||
|
||||
data.isExpert === 1 ||
|
||||
data.isExpert === "1",
|
||||
isApplying: false,
|
||||
};
|
||||
if (expertState.isExpert || expertState.isApplying) {
|
||||
$("#applyBtn")
|
||||
.text(expertState.isExpert ? "已是专家" : "申请审核中")
|
||||
.prop("disabled", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title id="page-title">神彩算 - 免费文章收藏</title>
|
||||
<script>
|
||||
window.location.replace("mianfeishoucang.html?tab=free");
|
||||
</script>
|
||||
<script src="../public/css/layui/layui.js"></script>
|
||||
<script src="../config.js"></script>
|
||||
<script src="../utils/ApiClient.js"></script>
|
||||
|
||||
+36
-2
@@ -851,9 +851,43 @@
|
||||
if (!item) return false;
|
||||
const articleId = getArticleId(item);
|
||||
if (articleId && purchasedArticleIds.has(String(articleId))) return true;
|
||||
return getArticlePurchaseKeys(item).some(function (key) {
|
||||
const purchasedByKey = getArticlePurchaseKeys(item).some(function (key) {
|
||||
return purchasedArticleKeys.has(key);
|
||||
});
|
||||
if (purchasedByKey) return true;
|
||||
|
||||
return (
|
||||
item.isBuy === 1 ||
|
||||
item.isBuy === 2 ||
|
||||
item.isBuy === true ||
|
||||
item.isBuy === "1" ||
|
||||
item.isBuy === "2" ||
|
||||
item.buyStatus === 1 ||
|
||||
item.buyStatus === "1" ||
|
||||
item.purchased === true ||
|
||||
item.purchased === 1 ||
|
||||
item.purchased === "1" ||
|
||||
item.isPurchased === true ||
|
||||
item.isPurchased === 1 ||
|
||||
item.isPurchased === "1" ||
|
||||
item.bought === true ||
|
||||
item.bought === 1 ||
|
||||
item.bought === "1" ||
|
||||
item.unlocked === true ||
|
||||
item.unlocked === 1 ||
|
||||
item.unlocked === "1" ||
|
||||
item.canView === true ||
|
||||
item.canView === 1 ||
|
||||
item.canView === "1" ||
|
||||
item.payStatus === 1 ||
|
||||
item.payStatus === "1" ||
|
||||
item.subscribed === true ||
|
||||
item.subscribed === 1 ||
|
||||
item.subscribed === "1" ||
|
||||
item.subscribed === "true" ||
|
||||
item.subscribeStatus === 1 ||
|
||||
item.subscribeStatus === "1"
|
||||
);
|
||||
}
|
||||
|
||||
function canShowArticleRecommend(
|
||||
@@ -1836,7 +1870,7 @@
|
||||
const params = {
|
||||
menuId: getArticleMenuId(item),
|
||||
expertId: getArticleExpertId(item),
|
||||
accountType: Number(accountType) || 1,
|
||||
accountType: Number(item.accountType || accountType) || 1,
|
||||
issue: getArticleIssue(item),
|
||||
count: 1,
|
||||
walletType:
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -563,7 +563,6 @@
|
||||
status === "success" ||
|
||||
status === "paid" ||
|
||||
status === "2" ||
|
||||
status === "1" ||
|
||||
Number(data.status) === 2 ||
|
||||
Number(data.payStatus) === 2
|
||||
);
|
||||
|
||||
+9
-4
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">大乐透走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -216,9 +217,12 @@
|
||||
backSet[n] = true;
|
||||
});
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "dlt" }) + "</td>";
|
||||
|
||||
for (var i = 1; i <= FRONT_MAX; i++) {
|
||||
if (frontSet[i]) {
|
||||
@@ -339,7 +343,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "cjdlt" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<script src="../public/css/layui/layui.js"></script>
|
||||
<script src="../config.js"></script>
|
||||
<script src="../utils/ApiClient.js"></script>
|
||||
<script src="../utils/PublishPermission.js"></script>
|
||||
<script src="../utils/DateUtil.js"></script>
|
||||
<script src="../utils/CommonUtil.js"></script>
|
||||
<link rel="stylesheet" href="../public/css/layui/css/layui.css" />
|
||||
@@ -185,7 +186,6 @@
|
||||
canFree: false,
|
||||
canPaid: false,
|
||||
};
|
||||
var REQUIRED_DAILY_FREE_ARTICLES = 2;
|
||||
var FREE_TITLE_MIN_LENGTH = 15;
|
||||
var FREE_TITLE_MAX_LENGTH = 30;
|
||||
|
||||
@@ -298,146 +298,14 @@
|
||||
return res && (res.code === 0 || res.code === 200);
|
||||
}
|
||||
|
||||
function isTruthy(value) {
|
||||
return (
|
||||
value === true ||
|
||||
value === 1 ||
|
||||
value === "1" ||
|
||||
String(value).toLowerCase() === "true"
|
||||
);
|
||||
}
|
||||
|
||||
function padDatePart(value) {
|
||||
return String(value).padStart(2, "0");
|
||||
}
|
||||
|
||||
function formatLocalDate(date) {
|
||||
return (
|
||||
date.getFullYear() +
|
||||
"-" +
|
||||
padDatePart(date.getMonth() + 1) +
|
||||
"-" +
|
||||
padDatePart(date.getDate())
|
||||
);
|
||||
}
|
||||
|
||||
function getArticleDateText(value) {
|
||||
if (!value) return "";
|
||||
if (typeof value === "number") {
|
||||
var numericDate = new Date(value);
|
||||
return isNaN(numericDate.getTime())
|
||||
? ""
|
||||
: formatLocalDate(numericDate);
|
||||
}
|
||||
|
||||
var text = String(value).trim();
|
||||
var match = text.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})/);
|
||||
if (match) {
|
||||
return (
|
||||
match[1] + "-" + padDatePart(match[2]) + "-" + padDatePart(match[3])
|
||||
);
|
||||
}
|
||||
|
||||
var parsedDate = new Date(text.replace(/-/g, "/"));
|
||||
return isNaN(parsedDate.getTime()) ? "" : formatLocalDate(parsedDate);
|
||||
}
|
||||
|
||||
function isPublishedFreeArticle(item) {
|
||||
if (!item) return false;
|
||||
|
||||
var statusText = String(
|
||||
item.statusText ||
|
||||
item.auditStatusText ||
|
||||
item.publishStatusText ||
|
||||
item.stateText ||
|
||||
"",
|
||||
).toLowerCase();
|
||||
if (/已发布|审核通过|通过|published|approved|pass/.test(statusText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var status =
|
||||
item.status != null
|
||||
? item.status
|
||||
: item.auditStatus != null
|
||||
? item.auditStatus
|
||||
: item.publishStatus;
|
||||
return status === true || status === 1 || status === "1";
|
||||
}
|
||||
|
||||
function getTodayPublishedFreeCount(rows) {
|
||||
var today = formatLocalDate(new Date());
|
||||
return ApiClient.asArray(rows).filter(function (item) {
|
||||
var articleDate = getArticleDateText(
|
||||
item.createTime ||
|
||||
item.create_time ||
|
||||
item.publishTime ||
|
||||
item.publish_time ||
|
||||
item.auditTime ||
|
||||
item.audit_time ||
|
||||
item.updateTime ||
|
||||
item.update_time ||
|
||||
item.createdAt,
|
||||
);
|
||||
return articleDate === today && isPublishedFreeArticle(item);
|
||||
}).length;
|
||||
}
|
||||
|
||||
function loadTodayPublishedFreeCount() {
|
||||
return ApiClient.get(ApiClient.API.mineFreeArticleList, {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
})
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res)) return 0;
|
||||
var data = res.data || res;
|
||||
var rows = ApiClient.asArray(
|
||||
data.rows || data.records || data.list || data.data || data,
|
||||
);
|
||||
return getTodayPublishedFreeCount(rows);
|
||||
})
|
||||
.catch(function () {
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
function parsePublishPermission(userData) {
|
||||
var status = String(
|
||||
userData.expertStatus || userData.expert_status || "",
|
||||
).toLowerCase();
|
||||
var isIntern = /实习|intern|trial/.test(status);
|
||||
var isRegularByStatus = /正式|regular|formal/.test(status);
|
||||
var hasExpertIdentity =
|
||||
isTruthy(userData.is_expert) ||
|
||||
isTruthy(userData.isExpert) ||
|
||||
isTruthy(userData.expert) ||
|
||||
isTruthy(userData.is_regular_expert) ||
|
||||
isTruthy(userData.isRegularExpert) ||
|
||||
isTruthy(userData.regularExpert) ||
|
||||
isIntern ||
|
||||
isRegularByStatus;
|
||||
var isRegularExpert =
|
||||
isTruthy(userData.is_regular_expert) ||
|
||||
isTruthy(userData.isRegularExpert) ||
|
||||
isTruthy(userData.regularExpert) ||
|
||||
isRegularByStatus;
|
||||
|
||||
return {
|
||||
hasExpertIdentity: hasExpertIdentity,
|
||||
isRegularExpert: hasExpertIdentity && isRegularExpert,
|
||||
canFree: hasExpertIdentity,
|
||||
canPaid: false,
|
||||
todayFreeArticleCount: 0,
|
||||
paidReason: isRegularExpert
|
||||
? "今天需先发布2篇审核通过的免费文章后,才能发布付费文章"
|
||||
: "正式专家才能发布付费文章",
|
||||
};
|
||||
}
|
||||
|
||||
function loadPublishPermission() {
|
||||
return ApiClient.get(ApiClient.API.mineSummary)
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res) || !res.data) {
|
||||
if (
|
||||
!ApiClient.isSuccess(res) ||
|
||||
!res.data ||
|
||||
!window.PublishPermission
|
||||
) {
|
||||
return {
|
||||
hasExpertIdentity: false,
|
||||
isRegularExpert: false,
|
||||
@@ -448,19 +316,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
var permission = parsePublishPermission(res.data);
|
||||
if (!permission.canFree || !permission.isRegularExpert) return permission;
|
||||
|
||||
return loadTodayPublishedFreeCount().then(function (count) {
|
||||
permission.todayFreeArticleCount = count;
|
||||
permission.canPaid = count >= REQUIRED_DAILY_FREE_ARTICLES;
|
||||
permission.paidReason = permission.canPaid
|
||||
? ""
|
||||
: "今天需先发布2篇审核通过的免费文章后,才能发布付费文章(当前" +
|
||||
count +
|
||||
"篇)。";
|
||||
return permission;
|
||||
});
|
||||
return PublishPermission.parseSummary(res.data);
|
||||
})
|
||||
.catch(function () {
|
||||
return {
|
||||
@@ -479,7 +335,7 @@
|
||||
publishPermission = permission;
|
||||
return {
|
||||
canPaid: permission.canPaid,
|
||||
reason: permission.paidReason,
|
||||
reason: permission.reason || permission.paidReason,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
+9
-4
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">福彩3D走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -207,9 +208,12 @@
|
||||
var parsed = parseCode(item.openCode);
|
||||
var type = getType(parsed.hundred, parsed.ten, parsed.unit);
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "position" }) + "</td>";
|
||||
|
||||
// Type columns
|
||||
var typeNames = ["baozi", "zu3", "zu6"];
|
||||
@@ -396,7 +400,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "fc3d" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
<script src="../public/js/lay-config.js"></script>
|
||||
<script src="../config.js"></script>
|
||||
<script src="../utils/ApiClient.js"></script>
|
||||
<script src="../utils/PublishPermission.js"></script>
|
||||
<script src="../utils/DateUtil.js"></script>
|
||||
<script src="../utils/CommonUtil.js"></script>
|
||||
<script src="../public/js/jquery.js"></script>
|
||||
|
||||
+10
-7
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">快乐8走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +78,6 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="2" class="col-issue">期号</td>
|
||||
<td rowspan="2" class="col-code">开奖号</td>
|
||||
<td colspan="40" class="zone-g1">1-40</td>
|
||||
<td colspan="40" class="zone-g2">41-80</td>
|
||||
</tr>
|
||||
@@ -198,13 +198,15 @@
|
||||
hitSet[n] = true;
|
||||
});
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
|
||||
for (var i = 1; i <= NUM_MAX; i++) {
|
||||
if (hitSet[i]) {
|
||||
var cls = i <= 40 ? "hit-num" : "hit-num g2";
|
||||
var cls = "hit-num";
|
||||
html +=
|
||||
'<td><span class="' +
|
||||
cls +
|
||||
@@ -292,7 +294,7 @@
|
||||
html +=
|
||||
'<tr class="' +
|
||||
cls +
|
||||
'"><td colspan="2" class="stat-label">' +
|
||||
'"><td colspan="1" class="stat-label">' +
|
||||
labels[li] +
|
||||
"</td>";
|
||||
for (var i = 1; i <= NUM_MAX; i++)
|
||||
@@ -305,7 +307,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "kl8" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+22
-8
@@ -305,6 +305,26 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
function getLoginRedirectUrl() {
|
||||
const redirect = new URLSearchParams(window.location.search).get("redirect");
|
||||
return (
|
||||
redirect ||
|
||||
(typeof CommonUtil !== "undefined"
|
||||
? CommonUtil.siteHref("/index.html")
|
||||
: "index.html")
|
||||
);
|
||||
}
|
||||
|
||||
function redirectAfterLogin() {
|
||||
window.location.href = getLoginRedirectUrl();
|
||||
}
|
||||
|
||||
function bindReferralThenRedirect() {
|
||||
AuthPageUtil.bindPendingReferralInviteCode()
|
||||
.then(redirectAfterLogin)
|
||||
.catch(redirectAfterLogin);
|
||||
}
|
||||
|
||||
function submitLogin() {
|
||||
const payload = Object.assign(
|
||||
{
|
||||
@@ -331,14 +351,7 @@
|
||||
layerInstance.msg(
|
||||
"登录成功,即将跳转到首页",
|
||||
{ icon: 1, time: 1200 },
|
||||
function () {
|
||||
const redirect = new URLSearchParams(window.location.search).get("redirect");
|
||||
window.location.href =
|
||||
redirect ||
|
||||
(typeof CommonUtil !== "undefined"
|
||||
? CommonUtil.siteHref("/index.html")
|
||||
: "index.html");
|
||||
},
|
||||
bindReferralThenRedirect,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -363,6 +376,7 @@
|
||||
|
||||
layui.use(["layer", "jquery"], function () {
|
||||
layerInstance = layui.layer;
|
||||
AuthPageUtil.captureReferralInviteFromUrl();
|
||||
loadVerifyConfig().then(refreshCaptcha);
|
||||
$("#loginForm").on("submit", function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
+25
-5
@@ -9,6 +9,7 @@
|
||||
<script src="../utils/ApiClient.js"></script>
|
||||
<script src="../utils/DateUtil.js"></script>
|
||||
<script src="../utils/CommonUtil.js"></script>
|
||||
<script src="../public/js/purify.min.js"></script>
|
||||
<link rel="stylesheet" href="../public/css/layui/css/layui.css" />
|
||||
<link rel="stylesheet" href="../public/css/public.css" />
|
||||
<link rel="stylesheet" href="../public/css/mianfei.css" />
|
||||
@@ -176,7 +177,11 @@
|
||||
const $ = layui.$;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const pathMatch = window.location.pathname.match(/\/mianfei\/([^/]+)\.html$/);
|
||||
const articleId = urlParams.get("id") || (pathMatch ? decodeURIComponent(pathMatch[1]) : "");
|
||||
const htmlPathMatch = window.location.pathname.match(/(?:^|\/)mianfei\.html\/([^/?#]+)/i);
|
||||
const articleId =
|
||||
urlParams.get("id") ||
|
||||
(pathMatch ? decodeURIComponent(pathMatch[1]) : "") ||
|
||||
(htmlPathMatch ? decodeURIComponent(htmlPathMatch[1]) : "");
|
||||
let isLiked = false;
|
||||
let isCollected = false;
|
||||
let articleData = null;
|
||||
@@ -269,7 +274,11 @@
|
||||
|
||||
function renderArticle(data) {
|
||||
$("#articleTitle").text(data.title || "无标题");
|
||||
$("#articleAuthor").text(data.issuer || data.nickName || data.author || data.createUserName || "佚名");
|
||||
$("#articleAuthor").text(
|
||||
typeof CommonUtil.getFreeArticleIssuer === "function"
|
||||
? CommonUtil.getFreeArticleIssuer(data)
|
||||
: data.issuer || data.nickName || data.author || data.createUserName || "佚名",
|
||||
);
|
||||
$("#articleTime").text(data.updateTime || data.createTime || data.publishTime || "--");
|
||||
$("#articleContent").html(scopeArticleContent(data.content || ""));
|
||||
document.title = "神彩算 - " + (data.title || "免费文章详情");
|
||||
@@ -289,6 +298,10 @@
|
||||
return '<p class="cxz-content-empty">暂无内容</p>';
|
||||
}
|
||||
|
||||
if (typeof DOMPurify !== "undefined") {
|
||||
html = DOMPurify.sanitize(html);
|
||||
}
|
||||
|
||||
var scopedStyles = [];
|
||||
html = html.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, function (_, css) {
|
||||
scopedStyles.push(prefixContentCss(css));
|
||||
@@ -357,7 +370,10 @@
|
||||
}
|
||||
|
||||
function loadRelatedArticles() {
|
||||
ApiClient.get(ApiClient.API.freeArticleRelated(articleId))
|
||||
ApiClient.get(ApiClient.API.freeArticleRelated(articleId), {
|
||||
limit: 12,
|
||||
articleCount: 12,
|
||||
})
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res)) return;
|
||||
var data = ApiClient.pickData(res, {}) || {};
|
||||
@@ -370,14 +386,17 @@
|
||||
renderFreeArticleList("#freeRelatedList", rows.filter(function (item) {
|
||||
var id = item && (item.id || item.articleId || item.freeArticleId);
|
||||
return id && String(id) !== String(articleId);
|
||||
}).slice(0, 8));
|
||||
}).slice(0, 12));
|
||||
})
|
||||
.catch(function () {});
|
||||
loadFreeArticleLatest();
|
||||
}
|
||||
|
||||
function loadFreeArticleLatest() {
|
||||
ApiClient.get(ApiClient.API.freeArticleLatest, { articleCount: 8 })
|
||||
ApiClient.get(ApiClient.API.freeArticleLatest, {
|
||||
limit: 12,
|
||||
articleCount: 12,
|
||||
})
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res)) return;
|
||||
renderFreeArticleList("#freeLatestList", ApiClient.asArray(ApiClient.pickData(res, [])));
|
||||
@@ -394,6 +413,7 @@
|
||||
return;
|
||||
}
|
||||
$.each(list, function (_, item) {
|
||||
if (_ >= 12) return false;
|
||||
var id = item.id || item.articleId || item.freeArticleId;
|
||||
if (!id) return;
|
||||
var title = item.title || item.articleTitle || item.name || "无标题";
|
||||
|
||||
+78
-21
@@ -110,7 +110,7 @@
|
||||
<script>
|
||||
const $ = layui.$;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
let menuId = urlParams.get("id") || "";
|
||||
let menuId = urlParams.get("id") || urlParams.get("code") || "";
|
||||
let currentPage = 1;
|
||||
const pageSize = 15;
|
||||
let lotteryMenus = [];
|
||||
@@ -153,16 +153,15 @@
|
||||
|
||||
function resolveCurrentMenuId() {
|
||||
if (!lotteryMenus.length) return;
|
||||
if (
|
||||
menuId &&
|
||||
lotteryMenus.some(function (item) {
|
||||
return sameLotteryKey(item, menuId);
|
||||
})
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
menuId = String((lotteryMenus[0] && lotteryMenus[0].id) || "");
|
||||
const matched = menuId
|
||||
? lotteryMenus.find(function (item) {
|
||||
return sameLotteryKey(item, menuId);
|
||||
})
|
||||
: null;
|
||||
const current = matched || lotteryMenus[0];
|
||||
menuId = String(
|
||||
(current && (current.id || current.menuId || current.code || current.suoxie)) || "",
|
||||
);
|
||||
}
|
||||
|
||||
function renderLotteryTabs() {
|
||||
@@ -184,9 +183,10 @@
|
||||
$tabs.empty();
|
||||
$.each(lotteryMenus, function (_, item) {
|
||||
const id = item.id || item.menuId || item.code || item.suoxie || "";
|
||||
const linkKey = item.code || item.suoxie || item.lotteryCode || id;
|
||||
$tabs.append(
|
||||
'<a href="mianfeilist.html?id=' +
|
||||
encodeURIComponent(id) +
|
||||
encodeURIComponent(linkKey) +
|
||||
'" class="cxz-lottery-tab" data-id="' +
|
||||
escapeHtml(id) +
|
||||
'">' +
|
||||
@@ -244,6 +244,44 @@
|
||||
);
|
||||
}
|
||||
|
||||
function currentRequestMenuId() {
|
||||
const menu = currentMenuInfo();
|
||||
return String((menu && (menu.id || menu.menuId)) || "");
|
||||
}
|
||||
|
||||
function getArticlePageData(res) {
|
||||
const data = ApiClient.pickData(res, {}) || {};
|
||||
const records = ApiClient.asArray(
|
||||
data.records || data.rows || data.list || data.data || data,
|
||||
);
|
||||
const total =
|
||||
Number(data.total) ||
|
||||
Number(data.totalRow) ||
|
||||
Number(data.totalCount) ||
|
||||
Number(data.count) ||
|
||||
Number(res && res.total) ||
|
||||
records.length;
|
||||
return {
|
||||
records: records,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeArticle(article, group) {
|
||||
article = article || {};
|
||||
group = group || {};
|
||||
return Object.assign({}, article, {
|
||||
id: article.id || article.articleId || article.freeArticleId || "",
|
||||
title: article.title || article.articleTitle || article.name || "无标题",
|
||||
dateText:
|
||||
article.dateText ||
|
||||
article.updateTime ||
|
||||
article.createTime ||
|
||||
article.publishTime ||
|
||||
group.dateText,
|
||||
});
|
||||
}
|
||||
|
||||
// Load articles
|
||||
function loadArticles() {
|
||||
if (!menuId) {
|
||||
@@ -253,16 +291,26 @@
|
||||
renderPagination(0);
|
||||
return;
|
||||
}
|
||||
const requestMenuId = currentRequestMenuId();
|
||||
if (!requestMenuId) {
|
||||
renderFallbackArticles();
|
||||
return;
|
||||
}
|
||||
ApiClient.get(ApiClient.API.freeArticleList, {
|
||||
menuId: menuId,
|
||||
menuId: requestMenuId,
|
||||
pageNum: currentPage,
|
||||
pageSize: pageSize,
|
||||
}).then(function (res) {
|
||||
if (ApiClient.isSuccess(res) && ApiClient.pickData(res, null)) {
|
||||
const data = ApiClient.pickData(res, {}) || {};
|
||||
const list = data.records || data.rows || data.list || ApiClient.asArray(data);
|
||||
renderArticles(list);
|
||||
renderPagination(data.totalRow || data.total || data.count || list.length || 0);
|
||||
const pageData = getArticlePageData(res);
|
||||
if (pageData.records.length || pageData.total) {
|
||||
renderArticles(pageData.records.map(function (item) {
|
||||
return normalizeArticle(item, currentFallbackGroup());
|
||||
}));
|
||||
renderPagination(pageData.total);
|
||||
} else {
|
||||
renderFallbackArticles();
|
||||
}
|
||||
} else {
|
||||
renderFallbackArticles();
|
||||
}
|
||||
@@ -273,7 +321,9 @@
|
||||
|
||||
function renderFallbackArticles() {
|
||||
const group = currentFallbackGroup();
|
||||
const allArticles = ApiClient.asArray(group && group.articles);
|
||||
const allArticles = ApiClient.asArray(group && group.articles).map(function (item) {
|
||||
return normalizeArticle(item, group);
|
||||
});
|
||||
const startIndex = (currentPage - 1) * pageSize;
|
||||
const records = allArticles.slice(startIndex, startIndex + pageSize);
|
||||
renderArticles(records);
|
||||
@@ -291,13 +341,16 @@
|
||||
}
|
||||
$.each(list, function (i, item) {
|
||||
let displayDate = "";
|
||||
if (item.createTime) displayDate = item.createTime.substring(0, 10);
|
||||
const article = normalizeArticle(item);
|
||||
const dateText = article.dateText || "";
|
||||
const title = article.title || "无标题";
|
||||
if (dateText) displayDate = String(dateText).substring(0, 10);
|
||||
$container.append(
|
||||
'<div class="cxz-article-item">' +
|
||||
'<a href="' +
|
||||
CommonUtil.freeArticleHref(item.id || "") +
|
||||
CommonUtil.freeArticleHref(article.id || "") +
|
||||
'" target="_blank">' +
|
||||
escapeHtml(item.title || "无标题") +
|
||||
escapeHtml(title) +
|
||||
"</a>" +
|
||||
'<span class="cxz-article-date">' +
|
||||
escapeHtml(displayDate) +
|
||||
@@ -308,6 +361,10 @@
|
||||
}
|
||||
|
||||
function renderPagination(total) {
|
||||
$("#pagination").empty();
|
||||
if (!total || total <= pageSize) {
|
||||
return;
|
||||
}
|
||||
layui.laypage.render({
|
||||
elem: "pagination",
|
||||
count: total,
|
||||
|
||||
+9
-4
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">排列三走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -207,9 +208,12 @@
|
||||
var parsed = parseCode(item.openCode);
|
||||
var type = getType(parsed.hundred, parsed.ten, parsed.unit);
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "position" }) + "</td>";
|
||||
|
||||
var typeNames = ["baozi", "zu3", "zu6"];
|
||||
var typeLabels = ["豹子", "组三", "组六"];
|
||||
@@ -384,7 +388,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "pl3" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+9
-4
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">排列五走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -204,9 +205,12 @@
|
||||
var item = data[r];
|
||||
var nums = parseCode(item.openCode);
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "position" }) + "</td>";
|
||||
|
||||
for (var p = 0; p < POS_COUNT; p++) {
|
||||
var val = nums[p] !== undefined ? nums[p] : -1;
|
||||
@@ -313,7 +317,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "pl5" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+21
-30
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">七乐彩走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -78,10 +79,9 @@
|
||||
<tr>
|
||||
<td rowspan="2" class="col-issue">期号</td>
|
||||
<td rowspan="2" class="col-code">开奖号</td>
|
||||
<td colspan="10" class="zone-z1">一区(01-10)</td>
|
||||
<td colspan="10" class="zone-z2">二区(11-20)</td>
|
||||
<td colspan="10" class="zone-z3">三区(21-30)</td>
|
||||
<td colspan="1" class="zone-sp">特别号</td>
|
||||
<td colspan="10" class="zone-z1">一区</td>
|
||||
<td colspan="10" class="zone-z2">二区</td>
|
||||
<td colspan="10" class="zone-z3">三区</td>
|
||||
</tr>
|
||||
<tr id="header-row"></tr>
|
||||
</thead>
|
||||
@@ -179,8 +179,6 @@
|
||||
for (var i = 1; i <= MAIN_MAX; i++) {
|
||||
html += "<td>" + (i < 10 ? "0" + i : i) + "</td>";
|
||||
}
|
||||
// Special number column
|
||||
html += "<td>特</td>";
|
||||
$("#header-row").html(html);
|
||||
}
|
||||
|
||||
@@ -213,12 +211,20 @@
|
||||
specialSet[n] = true;
|
||||
});
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "qlc" }) + "</td>";
|
||||
|
||||
for (var i = 1; i <= MAIN_MAX; i++) {
|
||||
if (mainSet[i]) {
|
||||
if (specialSet[i]) {
|
||||
html +=
|
||||
'<td><span class="hit-blue">' +
|
||||
(i < 10 ? "0" + i : i) +
|
||||
"</span></td>";
|
||||
} else if (mainSet[i]) {
|
||||
html +=
|
||||
'<td><span class="hit-main">' +
|
||||
(i < 10 ? "0" + i : i) +
|
||||
@@ -227,19 +233,8 @@
|
||||
html +=
|
||||
'<td><span class="miss-num">' +
|
||||
(i < 10 ? "0" + i : i) +
|
||||
"</span></td>";
|
||||
}
|
||||
}
|
||||
// Show special number
|
||||
if (parsed.specials.length > 0) {
|
||||
html +=
|
||||
'<td><span class="hit-special">' +
|
||||
(parsed.specials[0] < 10
|
||||
? "0" + parsed.specials[0]
|
||||
: parsed.specials[0]) +
|
||||
"</span></td>";
|
||||
} else {
|
||||
html += "<td>-</td>";
|
||||
}
|
||||
}
|
||||
html += "</tr>";
|
||||
}
|
||||
@@ -299,11 +294,8 @@
|
||||
|
||||
function buildStats(data) {
|
||||
var ms = calcStats(data, MAIN_MAX, function (d) {
|
||||
return parseCode(d.openCode).mains;
|
||||
});
|
||||
// Special number stats (1-30 range for special)
|
||||
var ss = calcStats(data, MAIN_MAX, function (d) {
|
||||
return parseCode(d.openCode).specials;
|
||||
var parsed = parseCode(d.openCode);
|
||||
return parsed.mains.concat(parsed.specials);
|
||||
});
|
||||
|
||||
var labels = [
|
||||
@@ -325,8 +317,6 @@
|
||||
"</td>";
|
||||
for (var i = 1; i <= MAIN_MAX; i++)
|
||||
stats += "<td>" + ms[keys[li]][i] + "</td>";
|
||||
// Special column stats
|
||||
stats += "<td>-</td>";
|
||||
stats += "</tr>";
|
||||
}
|
||||
return stats;
|
||||
@@ -335,7 +325,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "qlc" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+22
-12
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">七星彩走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -178,13 +179,13 @@
|
||||
var currentCount = 30;
|
||||
var allData = [];
|
||||
var hitClasses = [
|
||||
"hit-p1",
|
||||
"hit-p2",
|
||||
"hit-p3",
|
||||
"hit-p4",
|
||||
"hit-p5",
|
||||
"hit-p6",
|
||||
"hit-p7",
|
||||
"hit-red",
|
||||
"hit-red",
|
||||
"hit-red",
|
||||
"hit-red",
|
||||
"hit-red",
|
||||
"hit-red",
|
||||
"hit-blue",
|
||||
];
|
||||
var posMaxes = [9, 9, 9, 9, 9, 9, LAST_MAX]; // max value for each position
|
||||
|
||||
@@ -198,7 +199,12 @@
|
||||
}
|
||||
|
||||
function parseCode(code) {
|
||||
var nums = code.split(",").map(function (n) {
|
||||
var value = String(code || "");
|
||||
var parts = value.split(/[,+\s、,]+/).filter(Boolean);
|
||||
if (parts.length <= 1) {
|
||||
parts = value.replace(/[^\d]/g, "").split("").filter(Boolean);
|
||||
}
|
||||
var nums = parts.map(function (n) {
|
||||
return parseInt(n);
|
||||
});
|
||||
return nums;
|
||||
@@ -211,9 +217,12 @@
|
||||
var item = data[r];
|
||||
var nums = parseCode(item.openCode);
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html += '<td class="col-code">' + item.openCode + "</td>";
|
||||
html += '<td class="col-code">' + CommonUtil.renderTrendOpenCode(item.openCode, { mode: "qxc" }) + "</td>";
|
||||
|
||||
for (var p = 0; p < POS_COUNT; p++) {
|
||||
var max = posMaxes[p];
|
||||
@@ -323,7 +332,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "qxc" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+49
-9
@@ -653,8 +653,10 @@
|
||||
}
|
||||
|
||||
function getInviteCodeFromQuery() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return params.get("inviteCode") || params.get("referralCode") || "";
|
||||
return (
|
||||
AuthPageUtil.captureReferralInviteFromUrl() ||
|
||||
AuthPageUtil.getPendingReferralInviteCode()
|
||||
);
|
||||
}
|
||||
|
||||
function loadReferralBindPreview() {
|
||||
@@ -694,6 +696,49 @@
|
||||
});
|
||||
}
|
||||
|
||||
function saveRegisterTokenIfPresent(res) {
|
||||
const data = ApiClient.pickData(res) || {};
|
||||
if (!data || typeof data !== "object") return false;
|
||||
|
||||
const token = data.access_token || data.token || "";
|
||||
if (!token) return false;
|
||||
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("userInfo", JSON.stringify(data));
|
||||
sessionStorage.removeItem("authExpiredRedirecting");
|
||||
sessionStorage.removeItem("authExpiredMessage");
|
||||
return true;
|
||||
}
|
||||
|
||||
function redirectAfterRegister(hasToken) {
|
||||
if (hasToken) {
|
||||
window.location.href =
|
||||
typeof CommonUtil !== "undefined"
|
||||
? CommonUtil.siteHref("/index.html")
|
||||
: "index.html";
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = "login.html";
|
||||
}
|
||||
|
||||
function finishRegisterSuccess(res) {
|
||||
const hasToken = saveRegisterTokenIfPresent(res);
|
||||
layerInstance.msg(
|
||||
hasToken ? "注册成功,即将跳转到首页" : "注册成功,即将前往登录",
|
||||
{ icon: 1, time: 1200 },
|
||||
function () {
|
||||
AuthPageUtil.bindPendingReferralInviteCode()
|
||||
.then(function () {
|
||||
redirectAfterRegister(hasToken);
|
||||
})
|
||||
.catch(function () {
|
||||
redirectAfterRegister(hasToken);
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function register() {
|
||||
$("#registerBtn").prop("disabled", true).text("注册中...");
|
||||
ApiClient.post(ApiClient.API.authRegister, buildRegisterData(), {
|
||||
@@ -701,13 +746,7 @@
|
||||
})
|
||||
.then(function (res) {
|
||||
if (ApiClient.isSuccess(res)) {
|
||||
layerInstance.msg(
|
||||
"注册成功,即将前往登录",
|
||||
{ icon: 1, time: 1200 },
|
||||
function () {
|
||||
window.location.href = "login.html";
|
||||
},
|
||||
);
|
||||
finishRegisterSuccess(res);
|
||||
return;
|
||||
}
|
||||
layerInstance.msg((res && res.msg) || "注册失败,请稍后重试", {
|
||||
@@ -726,6 +765,7 @@
|
||||
|
||||
layui.use(["layer", "jquery"], function () {
|
||||
layerInstance = layui.layer;
|
||||
AuthPageUtil.captureReferralInviteFromUrl();
|
||||
loadVerifyConfig().then(refreshCaptcha);
|
||||
loadReferralBindPreview();
|
||||
$("#sendSmsBtn").on("click", sendSmsCode);
|
||||
|
||||
+9
-4
@@ -66,9 +66,10 @@
|
||||
<div class="page-title-bar">
|
||||
<div class="page-title">双色球走势图</div>
|
||||
<div class="qishu">
|
||||
<div class="qishu-but" data-count="10">10期</div>
|
||||
<div class="qishu-but" data-count="20">20期</div>
|
||||
<div class="qishu-but active" data-count="30">30期</div>
|
||||
<div class="qishu-but" data-count="60">60期</div>
|
||||
<div class="qishu-but" data-count="100">100期</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -215,11 +216,14 @@
|
||||
blueSet[n] = true;
|
||||
});
|
||||
|
||||
html += "<tr>";
|
||||
html +=
|
||||
r > 0 && r % 10 === 0
|
||||
? '<tr class="trend-period-separator">'
|
||||
: "<tr>";
|
||||
html += '<td class="col-issue">' + item.issue + "</td>";
|
||||
html +=
|
||||
'<td class="col-code">' +
|
||||
item.openCode.replace(/\+/g, "+") +
|
||||
CommonUtil.renderTrendOpenCode(item.openCode, { mode: "ssq" }) +
|
||||
"</td>";
|
||||
|
||||
for (var i = 1; i <= RED_MAX; i++) {
|
||||
@@ -398,7 +402,8 @@
|
||||
function loadData() {
|
||||
ApiClient.requestLegacyLotteryResultCompat({ suoxie: "ssq" }).then(function (res) {
|
||||
if (res && res.data) {
|
||||
allData = res.data;
|
||||
allData = Array.isArray(res.data) ? res.data : (res.data && (res.data.records || res.data.rows || res.data.list || res.data.data)) || [];
|
||||
if (!Array.isArray(allData)) allData = [];
|
||||
renderData(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
+5
-3
@@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -542,13 +542,15 @@
|
||||
if (!isSuccess(res)) throw new Error(res.msg || "收款码上传失败");
|
||||
const data = pickData(res) || {};
|
||||
const qrCodeFileId = fieldValue(data, ["qrCodeFileId", "qrcodeFileId", "fileId", "ossId", "id"]) || fieldValue(res, ["qrCodeFileId", "qrcodeFileId", "fileId", "ossId", "id"]);
|
||||
if (!qrCodeFileId) throw new Error("收款码上传成功,但未返回二维码文件ID");
|
||||
return { qrCodeFileId: qrCodeFileId };
|
||||
const qrcodeUrl = fieldValue(data, ["qrcodeUrl", "qrCodeUrl", "fileUrl", "url", "ossUrl"]) || fieldValue(res, ["qrcodeUrl", "qrCodeUrl", "fileUrl", "url", "ossUrl"]);
|
||||
if (!qrCodeFileId && !qrcodeUrl) throw new Error("收款码上传成功,但未返回二维码文件信息");
|
||||
return { qrCodeFileId: qrCodeFileId, qrcodeUrl: qrcodeUrl };
|
||||
});
|
||||
}
|
||||
|
||||
function appendQrcodePayload(payload, uploadData) {
|
||||
if (uploadData && uploadData.qrCodeFileId) payload.qrCodeFileId = uploadData.qrCodeFileId;
|
||||
if (uploadData && uploadData.qrcodeUrl) payload.qrcodeUrl = uploadData.qrcodeUrl;
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
+67
-33
@@ -139,28 +139,6 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wechatBindCard" id="wechat-bind-card">
|
||||
<div class="wechatBindTop">
|
||||
<div class="wechatBindIconBox">
|
||||
<img class="wechatBindIcon" src="../public/img/pay-wechat.png" alt="微信" />
|
||||
</div>
|
||||
<div class="wechatBindInfo">
|
||||
<div class="wechatBindTitle">微信账号</div>
|
||||
<div class="wechatBindDesc" id="wechat-bind-desc">正在检测绑定状态...</div>
|
||||
</div>
|
||||
<div class="wechatBindStateDot"></div>
|
||||
</div>
|
||||
<div class="wechatBindLine"></div>
|
||||
<button
|
||||
type="button"
|
||||
class="wechatBindButton"
|
||||
id="wechat-bind-button"
|
||||
onclick="openWeChatBindPopup()"
|
||||
>
|
||||
绑定微信
|
||||
</button>
|
||||
</div>
|
||||
<!-- Balance Cards -->
|
||||
<div class="uc-balance-grid">
|
||||
<div class="uc-balance-item">
|
||||
@@ -535,9 +513,24 @@
|
||||
}
|
||||
|
||||
function updateExpertActions(data) {
|
||||
var expert = isExpertUser(data);
|
||||
$("#expertApplyBtn").toggle(!expert);
|
||||
$("#publishArticleBtn").toggle(expert);
|
||||
var state = CommonUtil.getExpertState
|
||||
? CommonUtil.getExpertState(data)
|
||||
: { isExpert: isExpertUser(data), isApplying: false };
|
||||
var $applyBtn = $("#expertApplyBtn");
|
||||
var $publishBtn = $("#publishArticleBtn");
|
||||
$publishBtn.toggle(state.isExpert);
|
||||
$applyBtn.toggle(!state.isExpert);
|
||||
if (state.isExpert) {
|
||||
return;
|
||||
}
|
||||
$applyBtn
|
||||
.text(state.isApplying ? "申请审核中" : "专家申请")
|
||||
.prop("disabled", !!state.isApplying);
|
||||
if (state.isApplying) {
|
||||
$applyBtn.removeAttr("onclick");
|
||||
} else {
|
||||
$applyBtn.attr("onclick", "window.location.href = 'apply.html'");
|
||||
}
|
||||
}
|
||||
|
||||
function loadAccountInfoForWechat() {
|
||||
@@ -1379,7 +1372,7 @@
|
||||
? currentUserData.nickName || currentUserData.username || ""
|
||||
: "";
|
||||
|
||||
uploadedAvatarUrl = "";
|
||||
uploadedAvatarId = "";
|
||||
userAvatarFile = null;
|
||||
|
||||
var content =
|
||||
@@ -1422,14 +1415,14 @@
|
||||
content: content,
|
||||
end: function () {
|
||||
editProfileLayerIndex = null;
|
||||
uploadedAvatarUrl = "";
|
||||
uploadedAvatarId = "";
|
||||
userAvatarFile = null;
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var uploadedAvatarUrl = "";
|
||||
var uploadedAvatarId = "";
|
||||
var editProfileLayerIndex = null;
|
||||
var userAvatarFile = null;
|
||||
|
||||
@@ -1443,14 +1436,19 @@
|
||||
if (!input.files || !input.files[0]) return;
|
||||
|
||||
var file = input.files[0];
|
||||
if (!/^image\//.test(file.type || "")) {
|
||||
layui.layer.msg("请选择图片文件", { icon: 2 });
|
||||
if (!/^(image\/jpeg|image\/png)$/.test(file.type || "")) {
|
||||
layui.layer.msg("只支持 JPG/PNG 格式的图片", { icon: 2 });
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
if (file.size > 2 * 1024 * 1024) {
|
||||
layui.layer.msg("图片大小不能超过 2MB", { icon: 2 });
|
||||
input.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
userAvatarFile = file;
|
||||
uploadedAvatarUrl = "";
|
||||
uploadedAvatarId = "";
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
@@ -1504,31 +1502,67 @@
|
||||
if (!avatarId) {
|
||||
throw new Error("头像上传返回缺少文件编号");
|
||||
}
|
||||
uploadedAvatarUrl = avatarId;
|
||||
uploadedAvatarId = avatarId;
|
||||
return avatarId;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function validateEditProfileNickname(nickName) {
|
||||
var nicknameWidth = Array.from(nickName).reduce(function (total, char) {
|
||||
return total + (/[\u4e00-\u9fa5\uff00-\uffef]/.test(char) ? 2 : 1);
|
||||
}, 0);
|
||||
|
||||
if (nickName.length < 2 || nicknameWidth > 12) {
|
||||
layui.layer.msg("昵称长度应为2-6个汉字或2-12个英文", { icon: 2 });
|
||||
$("#editNickName").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function submitEditProfile() {
|
||||
var nickName = $("#editNickName").val().trim();
|
||||
var password = $("#editPassword").val();
|
||||
var passwordConfirm = $("#editPasswordConfirm").val();
|
||||
var currentNickName = currentUserData
|
||||
? currentUserData.nickName || currentUserData.username || ""
|
||||
: "";
|
||||
|
||||
if (!nickName) {
|
||||
layui.layer.msg("昵称不能为空", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
if (nickName !== currentNickName && !validateEditProfileNickname(nickName)) {
|
||||
return;
|
||||
}
|
||||
if ((password || passwordConfirm) && (!password || !passwordConfirm)) {
|
||||
layui.layer.msg("请输入并确认新密码", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
if (password && password !== passwordConfirm) {
|
||||
layui.layer.msg("两次密码输入不一致", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
if (password && (password.length < 6 || password.length > 20)) {
|
||||
layui.layer.msg("密码长度应为6-20位", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
|
||||
var params = { username: nickName };
|
||||
var params = {};
|
||||
if (nickName !== currentNickName) {
|
||||
params.nickName = nickName;
|
||||
}
|
||||
if (password) {
|
||||
params.password = hex_md5(password);
|
||||
}
|
||||
|
||||
if (!userAvatarFile && Object.keys(params).length === 0) {
|
||||
layui.layer.msg("暂无修改", { icon: 0 });
|
||||
return;
|
||||
}
|
||||
|
||||
var $submitBtn = $("#editProfileSubmitBtn");
|
||||
$submitBtn.prop("disabled", true).text("保存中...");
|
||||
|
||||
|
||||
+48
-44
@@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -90,6 +90,11 @@
|
||||
<div class="table-section-title">
|
||||
<i class="layui-icon layui-icon-group"></i> 下级用户列表
|
||||
</div>
|
||||
<div class="promo-filter" id="distStatusFilter">
|
||||
<button class="active" type="button" data-status="0">未转余额</button>
|
||||
<button type="button" data-status="1">已转余额</button>
|
||||
<button type="button" data-status="2">已提现</button>
|
||||
</div>
|
||||
<table id="distTable" lay-filter="distTable" lay-even></table>
|
||||
<div id="distPage"></div>
|
||||
</div>
|
||||
@@ -131,6 +136,9 @@
|
||||
var $ = layui.$;
|
||||
var table = layui.table;
|
||||
var laypage = layui.laypage;
|
||||
var currentPage = 1;
|
||||
var pageSize = 20;
|
||||
var currentStatus = 0;
|
||||
|
||||
// Load page config
|
||||
CommonUtil.loadPageConfig({ ads: false, links: false });
|
||||
@@ -206,10 +214,11 @@
|
||||
function loadDistList(pageNum) {
|
||||
currentPage = pageNum;
|
||||
ApiClient.get(
|
||||
ApiClient.API.referralInviteList,
|
||||
ApiClient.API.referralRebateList,
|
||||
{
|
||||
pageNum: pageNum,
|
||||
pageSize: pageSize,
|
||||
status: currentStatus,
|
||||
},
|
||||
{
|
||||
headers: CommonUtil.authHeaders(),
|
||||
@@ -217,8 +226,9 @@
|
||||
)
|
||||
.then(function (res) {
|
||||
if (res.code === 0 && res.data) {
|
||||
renderTable(res.data.records || []);
|
||||
renderPagination(res.data.total || 0);
|
||||
var records = ApiClient.asArray(res.data.records || res.data.rows || res.data.list || res.data);
|
||||
renderTable(records);
|
||||
renderPagination(res.data.total || res.data.totalRow || records.length || 0);
|
||||
} else {
|
||||
layer.msg(res.msg || "获取数据失败", { icon: 2 });
|
||||
}
|
||||
@@ -240,73 +250,60 @@
|
||||
elem: "#distTable",
|
||||
cols: [
|
||||
[
|
||||
{ field: "id", title: "记录ID", width: 140, align: "center" },
|
||||
{
|
||||
field: "nickName",
|
||||
title: "昵称",
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
title: "手机号",
|
||||
title: "订阅用户",
|
||||
width: 160,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
if (d.phoneNumber) {
|
||||
return d.phoneNumber.replace(
|
||||
/(\d{3})\d{4}(\d{4})/,
|
||||
"$1****$2",
|
||||
);
|
||||
}
|
||||
return "--";
|
||||
return CommonUtil.escapeHtml(d.nickName || d.userName || d.inviteeName || "--");
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "level",
|
||||
title: "层级",
|
||||
width: 100,
|
||||
field: "articleTitle",
|
||||
title: "文章/彩种",
|
||||
minWidth: 180,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.level === 1
|
||||
? '<span style="color:#102b6a;font-weight:600;">一级</span>'
|
||||
: '<span style="color:#5b2c8e;font-weight:600;">二级</span>';
|
||||
return CommonUtil.escapeHtml(d.menuName || d.articleTitle || d.title || "--");
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "createTime",
|
||||
title: "注册时间",
|
||||
width: 180,
|
||||
field: "expertName",
|
||||
title: "专家",
|
||||
width: 140,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.createTime
|
||||
? d.createTime.substring(0, 19).replace("T", " ")
|
||||
: "--";
|
||||
return CommonUtil.escapeHtml(d.nickNameExpert || d.expertName || "--");
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "totalRecharge",
|
||||
title: "累计充值",
|
||||
field: "amount",
|
||||
title: "订阅价格",
|
||||
width: 130,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return (
|
||||
'<span style="color:#f15a22;font-weight:600;">' +
|
||||
(d.totalRecharge || 0).toFixed(2) +
|
||||
"</span>"
|
||||
);
|
||||
return CommonUtil.escapeHtml(d.subscriptionPrice || d.orderAmount || d.amount || "0.00");
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "distributionIncome",
|
||||
title: "分销收益",
|
||||
field: "rebateMoney",
|
||||
title: "分销金额",
|
||||
width: 130,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return (
|
||||
'<span style="color:#fdb933;font-weight:600;">' +
|
||||
(d.distributionIncome || 0).toFixed(2) +
|
||||
"</span>"
|
||||
);
|
||||
return '<span style="color:#f15a22;font-weight:600;">' + CommonUtil.escapeHtml(d.rebateMoney || d.rebateAmount || d.money || "0.00") + "</span>";
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "status",
|
||||
title: "状态",
|
||||
width: 130,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
var statusMap = { 0: "未转余额", 1: "已转余额", 2: "已提现" };
|
||||
return CommonUtil.escapeHtml(d.statusText || statusMap[d.status] || statusMap[d.withdrawStatus] || "--");
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -333,6 +330,13 @@
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
$("#distStatusFilter").on("click", "button", function () {
|
||||
$("#distStatusFilter button").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
currentStatus = Number($(this).data("status")) || 0;
|
||||
loadDistList(1);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user