-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 添加粉丝/关注列表关注时间显示 #4352
feat: 添加粉丝/关注列表关注时间显示 #4352
Conversation
} | ||
const entry = async () => { | ||
// 非粉丝/关注页面则不启动 | ||
if (!document.URL.match(/\/\/space\.bilibili\.com\/(\d+)\/fans/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该加在 urlInclude 上
).__vue__.relationList.map(l => l.mtime) | ||
|
||
// 为所有子元素添加关注时间显示 | ||
let i = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么不用 forEach 的第二个参数, 就是 index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
艹 傻逼了,忘记还有这个参数了
let i = 0 | ||
relationList.querySelectorAll('.list-item>.content').forEach(e => { | ||
// 防止重复添加元素 | ||
if (!processed.has(e)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议弄个单独的 SCSS 文件, 给关注时间的元素加个 class, 用这个判断是否添加过
if (!processed.has(e)) { | ||
const time = subscribeTime[i] | ||
if (time !== undefined) { | ||
e.innerHTML += `<div style="color: #6d757a;position: absolute;margin-top: 5px;font-size: 8px;">关注时间:${new Date( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上条, 样式也关联在 class 上, 可以加个 desc
复用签名的样式
看截图还需要把名字和签名往上挪一挪才好看
很神秘,我测试下来似乎是在安装和卸载自动收起直播间侧栏的时候有一定概率触发这个bug,触发的时候提示是observer相关的参数问题,并且再次卸载/安装都有可能修好。我试了几遍还是没法稳定触发这个问题,等我再研究研究 PS:每次刷新也有一定概率触发,怀疑是元素没完全加载? |
试了下,在加载时立刻查找父元素和关注列表本身似乎都有可能查询失败,我把这两个都换成轮询查找了,应该没这个问题了 你在组件列表里移除原先的关注时间显示,然后通过以下链接重新安装组件试试 https://webtest.lq0.tech/subscribe-time-show-with-await-select.js 如果测试下来没问题的话我就重新发个pr修下这个bug |
正常了 |
好,一会我就推个pr |
我也没有生效 貌似安装不了了。我的也没生效。 |
我上面发的那个链接是临时测试用的,现在已经没了 |
在关注/粉丝列表中显示用户/粉丝关注的具体时间
效果图
注:分组的关注列表里不显示关注时间并不是bug,而是分组关注里b站的api确实没有返回关注时间(
还有就是我感觉现在的关注时间显示有点丑,有没有人能想出更好看一点的样式