修复粉丝/关注 TAB 的用户列表渲染
This commit is contained in:
1 parent
c6c2c0af6d
commit
84321801a6
7 files changed
+109
-72
No files matched your search
@@ -482,40 +482,43 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* User-home follow tab */
|
||||
/* User-home follow tab — Zibll parity
|
||||
* 子切换复刻 zibll inc/functions/zib-author.php:407-410(list-inline splitters
|
||||
* 居中文字链接,激活 focus-color);列表项为 .author-minicard inline-block
|
||||
* 三列卡片流(卡片规则、640px 单列均在 vendored main.css),容器居中对齐
|
||||
* zibll pane 的 text-center。 */
|
||||
.aksrt-user-home .uh-follow__subtabs {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
margin-bottom: 16px;
|
||||
margin: 10px 0 16px;
|
||||
padding: 0;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid var(--c-border, #e8e8e8);
|
||||
border-bottom: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__subtab {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
align-items: baseline;
|
||||
gap: 4px;
|
||||
padding: 6px 14px;
|
||||
border-radius: var(--radius-pill, 999px);
|
||||
font-size: 13px;
|
||||
color: var(--c-text-3, #999);
|
||||
padding: 4px 12px;
|
||||
font-size: 14px;
|
||||
text-decoration: none;
|
||||
transition: all .2s;
|
||||
transition: color .2s;
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__subtab:hover {
|
||||
color: var(--c-text-1, #333);
|
||||
background: var(--c-fill-1, #f5f5f5);
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__subtab.is-active {
|
||||
background: var(--c-primary, #1890ff);
|
||||
color: #fff;
|
||||
color: var(--focus-color, var(--color-primary, #f04494));
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__subtab-count {
|
||||
font-size: 11px;
|
||||
opacity: .7;
|
||||
font-size: 12px;
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__list {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.aksrt-user-home .uh-follow__pagination {
|
||||
|
||||
+1
-17
@@ -15,6 +15,7 @@
|
||||
})();
|
||||
var NONCE = (window.aksrtData && window.aksrtData.restNonce) || '';
|
||||
|
||||
// 初始关注状态由服务端渲染(is-following class + 文案),无需逐按钮查询。
|
||||
function initFollowButtons() {
|
||||
document.addEventListener('click', function (e) {
|
||||
var btn = e.target.closest('[data-aksrt-follow]');
|
||||
@@ -50,23 +51,6 @@
|
||||
btn.disabled = false;
|
||||
});
|
||||
});
|
||||
|
||||
// Check initial follow status for all follow buttons
|
||||
document.querySelectorAll('[data-aksrt-follow]').forEach(function (btn) {
|
||||
var targetUserId = parseInt(btn.getAttribute('data-aksrt-follow'));
|
||||
if (!targetUserId) return;
|
||||
|
||||
fetch(API_ROOT + '/follow/status?target_user_id=' + targetUserId, {
|
||||
headers: { 'X-WP-Nonce': NONCE },
|
||||
})
|
||||
.then(function (res) { return res.json(); })
|
||||
.then(function (result) {
|
||||
if (result.success && result.data) {
|
||||
updateFollowButton(btn, result.data.is_following, result.data.follower_count);
|
||||
}
|
||||
})
|
||||
.catch(function () { /* silent */ });
|
||||
});
|
||||
}
|
||||
|
||||
function updateFollowButton(btn, isFollowing, count) {
|
||||
|
||||
Reference in new issue
Block a user