样式修改完成,待测试
This commit is contained in:
@@ -652,7 +652,7 @@ body {
|
||||
|
||||
.draw-card__balls--compact {
|
||||
gap: 3px;
|
||||
width: calc(22px * 10 + 3px * 9);
|
||||
width: calc(25px * 10 + 3px * 9);
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -470,8 +470,8 @@ select {
|
||||
.ball--compact {
|
||||
flex-basis: 22px;
|
||||
width: 22px;
|
||||
min-width: 22px;
|
||||
height: 22px;
|
||||
min-width: 25px;
|
||||
height: 25px;
|
||||
font-size: 11px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
+117
-4
@@ -8,7 +8,7 @@
|
||||
1. Breadcrumb Bar
|
||||
---------------------------------------------------------- */
|
||||
.breadcrumb-bar {
|
||||
max-width: 1200px;
|
||||
max-width: 1420px;
|
||||
margin: 0 auto;
|
||||
padding: 14px 20px 0;
|
||||
font-size: 13px;
|
||||
@@ -40,7 +40,7 @@
|
||||
2. Page Title Bar & Period Selector
|
||||
---------------------------------------------------------- */
|
||||
.page-title-bar {
|
||||
max-width: 1200px;
|
||||
max-width: 1420px;
|
||||
margin: 0 auto;
|
||||
padding: 10px 20px 14px;
|
||||
display: flex;
|
||||
@@ -97,7 +97,7 @@
|
||||
3. Table Wrapper & Horizontal Scroll
|
||||
---------------------------------------------------------- */
|
||||
.table-wrapper {
|
||||
max-width: 1200px;
|
||||
max-width: 1420px;
|
||||
margin: 12px auto 40px;
|
||||
padding: 0 20px;
|
||||
overflow-x: auto;
|
||||
@@ -191,6 +191,10 @@
|
||||
background: rgba(16, 43, 106, 0.05);
|
||||
}
|
||||
|
||||
.trend-table tbody tr.trend-period-separator td {
|
||||
border-top: 2px solid rgba(245, 95, 122, 0.82);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------
|
||||
5. Issue & Code Columns (sticky left)
|
||||
---------------------------------------------------------- */
|
||||
@@ -243,6 +247,56 @@
|
||||
background: none;
|
||||
}
|
||||
|
||||
.trend-open-code {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 6px;
|
||||
white-space: nowrap;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.trend-open-number {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 10px;
|
||||
height: 18px;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
|
||||
.trend-open-red,
|
||||
.trend-open-pos1,
|
||||
.trend-open-pos2,
|
||||
.trend-open-pos3,
|
||||
.trend-open-pos4,
|
||||
.trend-open-pos5 {
|
||||
color: rgb(245, 95, 122);
|
||||
}
|
||||
|
||||
.trend-open-blue {
|
||||
color: rgb(64, 137, 226);
|
||||
}
|
||||
|
||||
.trend-open-separator {
|
||||
color: var(--primary);
|
||||
font-weight: 800;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.trend-open-empty {
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------
|
||||
6. Zone Header Colors
|
||||
---------------------------------------------------------- */
|
||||
@@ -357,6 +411,65 @@
|
||||
box-shadow: 0 2px 6px rgba(241, 90, 34, 0.35);
|
||||
}
|
||||
|
||||
.NumberText {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: #c5c5c5;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.NumberText.redok,
|
||||
.typeText.redok {
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #f15a22, #e74c3c);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
|
||||
box-shadow: 0 2px 6px rgba(241, 90, 34, 0.35);
|
||||
}
|
||||
|
||||
.NumberText.blueok,
|
||||
.typeText.blueok {
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #102b6a, #3b6fd4);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
|
||||
box-shadow: 0 2px 6px rgba(16, 43, 106, 0.35);
|
||||
}
|
||||
|
||||
.trend-table .hit-hundred,
|
||||
.trend-table .hit-ten,
|
||||
.trend-table .hit-unit,
|
||||
.trend-table .hit-pos1,
|
||||
.trend-table .hit-pos2,
|
||||
.trend-table .hit-pos3,
|
||||
.trend-table .hit-pos4,
|
||||
.trend-table .hit-pos5,
|
||||
.trend-table .hit-p1,
|
||||
.trend-table .hit-p2,
|
||||
.trend-table .hit-p3,
|
||||
.trend-table .hit-p4,
|
||||
.trend-table .hit-p5,
|
||||
.trend-table .hit-p6,
|
||||
.trend-table .hit-p7,
|
||||
.trend-table .hit-num,
|
||||
.trend-table .hit-num.g2,
|
||||
.trend-table .hit-main {
|
||||
background: linear-gradient(135deg, #f15a22, #e74c3c);
|
||||
box-shadow: 0 2px 6px rgba(241, 90, 34, 0.35);
|
||||
}
|
||||
|
||||
.trend-table .hit-blue,
|
||||
.trend-table .hit-special {
|
||||
background: linear-gradient(135deg, #102b6a, #3b6fd4);
|
||||
box-shadow: 0 2px 6px rgba(16, 43, 106, 0.35);
|
||||
}
|
||||
|
||||
.hit-blue {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -1010,4 +1123,4 @@
|
||||
font-size: 9px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,6 +407,13 @@
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.uc-btn:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.65;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.uc-btn-publish {
|
||||
background: var(--bg-light);
|
||||
color: var(--primary);
|
||||
|
||||
@@ -11,7 +11,6 @@ const $ = layui.$;
|
||||
let isSubmittingPayArticle = false;
|
||||
let selections = [];
|
||||
let stepsConfig = [];
|
||||
const REQUIRED_DAILY_FREE_ARTICLES = 2;
|
||||
// 页面加载完成后获取首页信息
|
||||
layui.$(document).ready(function () {
|
||||
CommonUtil.loadPageConfig({ ads: false, links: false });
|
||||
@@ -33,149 +32,23 @@ const $ = layui.$;
|
||||
});
|
||||
});
|
||||
|
||||
// 判断布尔字段,兼容后端可能返回的 1/true/"true"。
|
||||
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") {
|
||||
const numericDate = new Date(value);
|
||||
return isNaN(numericDate.getTime())
|
||||
? ""
|
||||
: formatLocalDate(numericDate);
|
||||
}
|
||||
|
||||
const text = String(value).trim();
|
||||
const match = text.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})/);
|
||||
if (match) {
|
||||
return (
|
||||
match[1] + "-" + padDatePart(match[2]) + "-" + padDatePart(match[3])
|
||||
);
|
||||
}
|
||||
|
||||
const parsedDate = new Date(text.replace(/-/g, "/"));
|
||||
return isNaN(parsedDate.getTime()) ? "" : formatLocalDate(parsedDate);
|
||||
}
|
||||
|
||||
function isPublishedFreeArticle(item) {
|
||||
if (!item) return false;
|
||||
|
||||
const statusText = String(
|
||||
item.statusText ||
|
||||
item.auditStatusText ||
|
||||
item.publishStatusText ||
|
||||
item.stateText ||
|
||||
"",
|
||||
).toLowerCase();
|
||||
if (/已发布|审核通过|通过|published|approved|pass/.test(statusText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const status =
|
||||
item.status != null
|
||||
? item.status
|
||||
: item.auditStatus != null
|
||||
? item.auditStatus
|
||||
: item.publishStatus;
|
||||
return status === true || status === 1 || status === "1";
|
||||
}
|
||||
|
||||
function getTodayPublishedFreeCount(rows) {
|
||||
const today = formatLocalDate(new Date());
|
||||
return ApiClient.asArray(rows).filter(function (item) {
|
||||
const 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;
|
||||
|
||||
const data = res.data || res;
|
||||
const rows = ApiClient.asArray(
|
||||
data.rows || data.records || data.list || data.data || data,
|
||||
);
|
||||
return getTodayPublishedFreeCount(rows);
|
||||
})
|
||||
.catch(function () {
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
// 付费文章发布权限:专家身份 + 当天 2 篇审核通过/已发布的免费文章。
|
||||
// 付费文章发布权限以 mine/summary 返回字段为准。
|
||||
function checkPaidPublishPermission() {
|
||||
return ApiClient.get(ApiClient.API.mineSummary)
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res) || !res.data) {
|
||||
if (
|
||||
!ApiClient.isSuccess(res) ||
|
||||
!res.data ||
|
||||
!window.PublishPermission
|
||||
) {
|
||||
return { canPaid: false, reason: "暂时无法获取发布权限。" };
|
||||
}
|
||||
|
||||
const status = String(
|
||||
res.data.expertStatus || res.data.expert_status || "",
|
||||
).toLowerCase();
|
||||
const isRegularExpert =
|
||||
isTruthy(res.data.is_regular_expert) ||
|
||||
isTruthy(res.data.isRegularExpert) ||
|
||||
isTruthy(res.data.regularExpert) ||
|
||||
/正式|regular|formal/.test(status);
|
||||
const hasExpertIdentity =
|
||||
isTruthy(res.data.is_expert) ||
|
||||
isTruthy(res.data.isExpert) ||
|
||||
isTruthy(res.data.expert) ||
|
||||
isRegularExpert ||
|
||||
/实习|intern|trial|正式|regular|formal/.test(status);
|
||||
|
||||
if (!hasExpertIdentity || !isRegularExpert) {
|
||||
return { canPaid: false, reason: "正式专家才能发布付费文章。" };
|
||||
}
|
||||
|
||||
return loadTodayPublishedFreeCount().then(function (count) {
|
||||
return {
|
||||
canPaid: count >= REQUIRED_DAILY_FREE_ARTICLES,
|
||||
reason:
|
||||
count >= REQUIRED_DAILY_FREE_ARTICLES
|
||||
? ""
|
||||
: "今天需先发布2篇审核通过的免费文章后,才能发布付费文章(当前" +
|
||||
count +
|
||||
"篇)。",
|
||||
};
|
||||
});
|
||||
const permission = PublishPermission.parseSummary(res.data);
|
||||
return {
|
||||
...permission,
|
||||
reason: permission.reason || permission.paidReason,
|
||||
};
|
||||
})
|
||||
.catch(function () {
|
||||
return { canPaid: false, reason: "暂时无法获取发布权限。" };
|
||||
|
||||
Reference in New Issue
Block a user