新增用户主页(无功能)
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
export const BilibiliClientUserMethods = {
|
||||
// 获取单个用户的信息
|
||||
async getUserInfoByUID(this: any, uid: String) {
|
||||
const url = `https://api.bilibili.com/x/space/wbi/acc/info`;
|
||||
const response = await this.getRequestWbi(url, {
|
||||
mid: uid
|
||||
})
|
||||
|
||||
return response.data.data
|
||||
},
|
||||
|
||||
// 根据UID批量获取用户信息
|
||||
async getMultiUserInfoByUID(this: any, uids: Array<String>) {
|
||||
const url = "https://api.bilibili.com/x/polymer/pc-electron/v1/user/cards";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="reply">
|
||||
<div class="userinfo" onclick="ShowTools({{reply}})">
|
||||
<image class="userimg" style="lines: 1" src="{{reply.member.avatar}}@44w_44h" alt="/common/fullgray.png"></image>
|
||||
<div style="flex-direction: column; justify-content: center">
|
||||
<div class="userinfo">
|
||||
<image class="userimg" onclick="OpenUser(reply.member.mid)" style="lines: 1" src="{{reply.member.avatar}}@44w_44h" alt="/common/fullgray.png"></image>
|
||||
<div style="flex-direction: column; justify-content: center" onclick="ShowTools(reply)">
|
||||
<div class="rowbar">
|
||||
<text class="username" style="margin-left: 10px">{{ reply.member.uname }}</text>
|
||||
<image style="width: 24px; height: 14px; object-fit: contain; margin-left: 6px"
|
||||
@@ -34,8 +34,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from "@system.router"
|
||||
export default {
|
||||
props: ["reply", "secmode"],
|
||||
OpenUser(id) {
|
||||
router.push({
|
||||
uri: "pages/user",
|
||||
params: {
|
||||
uid: id
|
||||
}
|
||||
})
|
||||
},
|
||||
ShowTools(reply) {
|
||||
this.$emit("showTools", {
|
||||
reply: reply
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
.profdiv {
|
||||
width: 176px;
|
||||
/* 设置为与 profpendantimg 一致 */
|
||||
height: 176px;
|
||||
/* 设置为与 profpendantimg 一致 */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.profimg {
|
||||
width: 106px;
|
||||
height: 106px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.profpendantimg {
|
||||
width: 176px;
|
||||
height: 176px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.vipname {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
color: #ff7da8;
|
||||
}
|
||||
|
||||
.tagbar {
|
||||
flex-direction: row;
|
||||
width: 40%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tagimg {
|
||||
height: 30px;
|
||||
object-fit: contain;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div style="flex-direction: column; align-items: center">
|
||||
<div class="profdiv">
|
||||
<image src="{{accountInfo.face}}@106w_106h" alt="/common/fullgray.png" class="profimg"></image>
|
||||
<image src="{{accountInfo.pendant.image}}@176w_176h" alt="/common/alphaimg.png" class="profpendantimg"></image>
|
||||
</div>
|
||||
<text class="{{name_text_class}}">{{ name }}</text>
|
||||
<div class="tagbar" style="margin-top: 5px">
|
||||
<image class="tagimg" src="/common/bililevel/lv{{level}}.png" style="height: 20px"></image>
|
||||
<image class="tagimg" if="{{is_vip}}" style="margin-left: 10px"
|
||||
src="/common/bilivip/{{accountInfo.vip_label.label_theme}}.png"></image>
|
||||
<image class="tagimg" if="{{is_senior_member}}" style="margin-left: 10px" src="/common/senior_member.png">
|
||||
</image>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ["accountInfo"],
|
||||
data: {
|
||||
name_text_class: "name",
|
||||
is_vip: false,
|
||||
is_senior_member: false,
|
||||
name: "",
|
||||
level: ""
|
||||
},
|
||||
UpdateShow() {
|
||||
try{
|
||||
this.is_vip = !!this.accountInfo.vip_pay_type
|
||||
this.name_text_class = this.is_vip ? "vipname" : this.name_text_class
|
||||
|
||||
this.is_senior_member = !!this.accountInfo.is_senior_member
|
||||
|
||||
|
||||
console.log(this.accountInfo.level_info?.current_level)
|
||||
console.log(this.accountInfo.level)
|
||||
this.level = this.accountInfo.level_info?.current_level || this.accountInfo.level
|
||||
|
||||
this.name = this.accountInfo.uname || this.accountInfo.name
|
||||
}
|
||||
catch(error){
|
||||
global.logger.error("Error when updating show:", error.toString())
|
||||
}
|
||||
},
|
||||
onInit() {
|
||||
this.UpdateShow()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import "@less/global.less";
|
||||
@import "./UserInfo.less";
|
||||
</style>
|
||||
@@ -121,6 +121,9 @@
|
||||
},
|
||||
"pages/app/features/settings/opensoftware": {
|
||||
"component": "opensoftware"
|
||||
},
|
||||
"pages/user": {
|
||||
"component": "user"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,3 @@
|
||||
.profdiv {
|
||||
width: 176px;
|
||||
/* 设置为与 profpendantimg 一致 */
|
||||
height: 176px;
|
||||
/* 设置为与 profpendantimg 一致 */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.profimg {
|
||||
width: 106px;
|
||||
height: 106px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.profpendantimg {
|
||||
width: 176px;
|
||||
height: 176px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.vipname {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
color: #ff7da8;
|
||||
}
|
||||
|
||||
.tagbar {
|
||||
flex-direction: row;
|
||||
width: 40%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tagimg {
|
||||
height: 30px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.btnbase {
|
||||
width: 314px;
|
||||
height: 93px;
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
<import name="switch-bar" src="@components/SwitchBar/SwitchBar.ux"></import>
|
||||
<import name="user-info" src="@components/UserInfo/UserInfo.ux"></import>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<switch-bar title="mypage.title"></switch-bar>
|
||||
<div class="profdiv">
|
||||
<image src="{{accountInfo.face}}@106w_106h" alt="/common/fullgray.png" class="profimg"></image>
|
||||
<image src="{{accountInfo.pendant.image}}@176w_176h" alt="/common/alphaimg.png" class="profpendantimg"></image>
|
||||
</div>
|
||||
<text class="{{name_text_class}}">{{ accountInfo.uname }}</text>
|
||||
<div class="tagbar" style="margin-top: 5px">
|
||||
<image class="tagimg" src="/common/bililevel/lv{{accountInfo.level_info.current_level}}.png" style="height: 20px">
|
||||
</image>
|
||||
<image class="tagimg" if="{{is_vip}}" style="margin-left: 10px"
|
||||
src="/common/bilivip/{{accountInfo.vip_label.label_theme}}.png"></image>
|
||||
<image class="tagimg" if="{{is_senior_member}}" style="margin-left: 10px" src="/common/senior_member.png"></image>
|
||||
</div>
|
||||
<user-info account-info="{{accountInfo}}"></user-info>
|
||||
<div class="btnbase" style="margin-top: 40px" @click="GoMyFavFolders()">
|
||||
<image class="btnimg" src="/common/mypage_star.png"></image>
|
||||
<text class="btntext">{{ $t("mypage.favourite") }}</text>
|
||||
@@ -44,9 +34,6 @@ import router from "@system.router"
|
||||
import prompt from "@system.prompt"
|
||||
export default {
|
||||
private: {
|
||||
name_text_class: "name",
|
||||
is_vip: false,
|
||||
is_senior_member: false,
|
||||
accountInfo: {}
|
||||
},
|
||||
GoHistory(){
|
||||
@@ -72,18 +59,8 @@ export default {
|
||||
message: "该功能还在开发中"
|
||||
})
|
||||
},
|
||||
UpdateShow() {
|
||||
if (this.accountInfo.vip_pay_type) {
|
||||
this.is_vip = true
|
||||
this.name_text_class = "vipname"
|
||||
}
|
||||
if (this.accountInfo.is_senior_member) {
|
||||
this.is_senior_member = true
|
||||
}
|
||||
},
|
||||
onInit() {
|
||||
this.accountInfo = global.biliclient.accountInfo
|
||||
this.UpdateShow()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
}
|
||||
|
||||
.user {
|
||||
margin-top: 10px;
|
||||
height: 119px;
|
||||
border-radius: 33px;
|
||||
background-color: #222222;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.replylist {
|
||||
width: 77%;
|
||||
height: 75%;
|
||||
height: 77%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<import name="title-bar" src="@components/TitleBar/TitleBar.ux"></import>
|
||||
<import name="user-info" src="@components/UserInfo/UserInfo.ux"></import>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<title-bar title="user.title"></title-bar>
|
||||
<user-info account-info="{{user}}" if="{{loaded}}"></user-info>
|
||||
<image style="position: absolute; margin-top: 245px" if="{{anims.show_loading}}" src="{{anims.loading_src.value}}"></image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
public: {
|
||||
uid: 1
|
||||
},
|
||||
private: {
|
||||
user: {},
|
||||
anims: {
|
||||
show_loading: false
|
||||
},
|
||||
loaded: false
|
||||
},
|
||||
async LoadUserInfo(){
|
||||
this.anims.loading.start()
|
||||
this.user = await global.biliclient.getUserInfoByUID(this.uid)
|
||||
this.anims.loading.stop()
|
||||
this.anims.show_loading = false
|
||||
this.loaded = true
|
||||
},
|
||||
onInit(){
|
||||
global.animengine.defaults.loading.CreateLoadingAnimation(this)
|
||||
this.LoadUserInfo()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '@less/global.less';
|
||||
@import './user.less';
|
||||
</style>
|
||||
+6
-1
@@ -1,3 +1,4 @@
|
||||
import dayjs from "dayjs"
|
||||
import { fetch } from "./tsimports"
|
||||
|
||||
const TRACKER_URL: string = "https://tracker.hyperbili.astralsight.space/trackreport"
|
||||
@@ -36,7 +37,7 @@ interface TIUPStartupPayload {
|
||||
interface TIUPRouterPayload {
|
||||
currentPage: string,
|
||||
nextPage: string,
|
||||
routerStack: string
|
||||
routerStack: Array<String>
|
||||
}
|
||||
|
||||
interface TIUPLoginPayload {
|
||||
@@ -81,3 +82,7 @@ function uploadTrack(event: TIUPEvents, payload) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
uploadTrack(TIUPEvents.ON_STARTUP, {
|
||||
startTime: dayjs().format()
|
||||
})
|
||||
Reference in New Issue
Block a user