fix(web): fix UP card layout and fan delta semantics
This commit is contained in:
1 parent
7fcd1db987
commit
f9a5478800
7 files changed
+51
-16
No files matched your search
@@ -11,8 +11,9 @@ const VIDEO_SORTS = [
|
||||
["interaction", "互动率"], ["growth", "增长"], ["growth_rate", "增速"],
|
||||
];
|
||||
const UP_SORTS = [
|
||||
["views", "总播放"], ["count", "视频数"], ["avg_views", "平均播放"],
|
||||
["interaction", "总互动"], ["avg_interaction", "平均互动"], ["latest", "最近发布"],
|
||||
["avg_views", "平均播放"], ["avg_interaction", "平均互动"],
|
||||
["interaction", "总互动"], ["latest", "最近发布"],
|
||||
["count", "视频数"], ["views", "总播放"],
|
||||
];
|
||||
const METRIC_PRIMARY = new Set(["view", "like", "coin", "favorite", "share", "reply", "danmaku"]);
|
||||
|
||||
@@ -75,7 +76,7 @@ function listHtml(data, scope, sort, startRank) {
|
||||
|
||||
export async function renderRankings(root, { query }) {
|
||||
const scope = query.get("scope") === "up" ? "up" : "video";
|
||||
const defaultSort = scope === "up" ? "views" : "heat";
|
||||
const defaultSort = scope === "up" ? "avg_views" : "heat";
|
||||
const sort = query.get("sort") || defaultSort;
|
||||
const within = query.get("within_days") || "all";
|
||||
const growthDays = query.get("growth_days") || "7";
|
||||
@@ -133,7 +134,7 @@ export async function renderRankings(root, { query }) {
|
||||
root.querySelectorAll("[data-scope]").forEach((button) => button.addEventListener("click", () => {
|
||||
replaceQuery({
|
||||
scope: button.dataset.scope,
|
||||
sort: button.dataset.scope === "up" ? "views" : "heat",
|
||||
sort: button.dataset.scope === "up" ? "avg_views" : "heat",
|
||||
page: null,
|
||||
});
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user