diff --git a/src/bilibiliclient/user/user.ts b/src/bilibiliclient/user/user.ts index cb0b6d6..ec6dc3c 100644 --- a/src/bilibiliclient/user/user.ts +++ b/src/bilibiliclient/user/user.ts @@ -17,6 +17,34 @@ export const BilibiliClientUserMethods = { return response.data.data }, + // 获取单个用户投稿的视频的代表作 + async getUserMasterPieceByUID(this: any, uid: String) { + const url = `https://api.bilibili.com/x/space/masterpiece`; + const response = await this.getRequest(`${url}?vmid=${uid}`); + + return response.data.data + }, + + // 获取用户投稿列表(分页) + async getUserVideosByUID(this: any, uid: String, pn: Number, ps: Number = 5) { + const url = `https://api.bilibili.com/x/space/wbi/arc/search`; + const response = await this.getRequestWbi(url, { + mid: uid, + pn, + ps + }); + + return response.data.data + }, + + // 获取用户空间动态列表 + async getUserDynamicListByUID(this: any, uid: String) { + const url = `https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space`; + const response = await this.getRequest(`${url}?host_mid=${uid}`); + + return response.data.data + }, + // 获取单个用户的导航栏状态数 async getUserNavnumByUID(this: any, uid: String) { const url = `https://api.bilibili.com/x/space/navnum`; diff --git a/src/components/User/User.ux b/src/components/User/User.ux index 6009f74..8207d01 100644 --- a/src/components/User/User.ux +++ b/src/components/User/User.ux @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/i18n/en.json b/src/i18n/en.json index 1a375e1..237096a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -126,7 +126,10 @@ } }, "user": { - "title": "User" + "title": "User", + "videos": "Videos", + "dynamices": "Dynamic", + "nocontent": "There is no content to show at present." }, "sessionood": { "title": "Some problems have occurred", diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 432de40..50b5583 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -131,7 +131,13 @@ } }, "user": { - "title": "用户主页" + "title": "用户主页", + "videos": "TA的视频", + "dynamices": "TA的动态", + "nocontent": "暂无可展示内容", + "uservideos": { + "title": "用户投稿" + } }, "sessionood": { "title": "遇到了一些问题", diff --git a/src/manifest.json b/src/manifest.json index 52afd9a..a09e9bc 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -163,6 +163,12 @@ }, "pages/error/sessionood": { "component": "sessionood" + }, + "pages/user/userdynamic": { + "component": "userdynamic" + }, + "pages/user/uservideos": { + "component": "uservideos" } } } diff --git a/src/pages/search/search/search.ux b/src/pages/search/search/search.ux index 7b4e0d4..b16b1bc 100644 --- a/src/pages/search/search/search.ux +++ b/src/pages/search/search/search.ux @@ -4,20 +4,22 @@