mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🐛 修复咨询页渲染异常
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tpc-content">
|
<div class="tpc-content">
|
||||||
<div class="tpc-title" :title="card.title">{{ card.title }}</div>
|
<div class="tpc-title" :title="card.title">{{ card.title }}</div>
|
||||||
<TpAvatar :data="card.user" position="left" />
|
<TpAvatar v-if="card.user" :data="card.user" position="left" />
|
||||||
<div class="tpc-data">
|
<div class="tpc-data">
|
||||||
<div class="tpc-info-item" :title="`浏览数:${card.data.view}`">
|
<div class="tpc-info-item" :title="`浏览数:${card.data.view}`">
|
||||||
<v-icon>mdi-eye</v-icon>
|
<v-icon>mdi-eye</v-icon>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tpc-forum" v-if="card.forum.icon !== ''" :title="`频道: ${card.forum.name}`">
|
<div class="tpc-forum" v-if="card.forum" :title="`频道: ${card.forum.name}`">
|
||||||
<img :src="card.forum.icon" :alt="card.forum.name" />
|
<img :src="card.forum.icon" :alt="card.forum.name" />
|
||||||
<span>{{ card.forum.name }}</span>
|
<span>{{ card.forum.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -157,16 +157,20 @@ function getPostCover(item: TGApp.Plugins.Mys.Post.FullData): string {
|
|||||||
* @returns {TGApp.Plugins.Mys.News.RenderCard} 渲染用咨讯列表项
|
* @returns {TGApp.Plugins.Mys.News.RenderCard} 渲染用咨讯列表项
|
||||||
*/
|
*/
|
||||||
function getCommonCard(item: TGApp.Plugins.Mys.Post.FullData): TGApp.Plugins.Mys.News.RenderCard {
|
function getCommonCard(item: TGApp.Plugins.Mys.Post.FullData): TGApp.Plugins.Mys.News.RenderCard {
|
||||||
|
let forum = null;
|
||||||
|
if (item.forum !== null) {
|
||||||
|
forum = {
|
||||||
|
name: item.forum.name,
|
||||||
|
icon: item.forum.icon,
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
title: item.post.subject,
|
title: item.post.subject,
|
||||||
cover: getPostCover(item),
|
cover: getPostCover(item),
|
||||||
postId: Number(item.post.post_id),
|
postId: Number(item.post.post_id),
|
||||||
subtitle: item.post.post_id,
|
subtitle: item.post.post_id,
|
||||||
user: item.user,
|
user: item.user,
|
||||||
forum: {
|
forum: forum,
|
||||||
name: item.forum.name,
|
|
||||||
icon: item.forum.icon,
|
|
||||||
},
|
|
||||||
data: {
|
data: {
|
||||||
mark: item.stat.bookmark_num,
|
mark: item.stat.bookmark_num,
|
||||||
forward: item.stat.forward_num,
|
forward: item.stat.forward_num,
|
||||||
|
|||||||
12
src/plugins/Mys/types/News.d.ts
vendored
12
src/plugins/Mys/types/News.d.ts
vendored
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @file plugins/Mys/types/news.d.ts
|
* @file plugins/Mys/types/news.d.ts
|
||||||
* @description Mys 插件咨讯类型定义文件
|
* @description Mys 插件咨讯类型定义文件
|
||||||
* @since Beta v0.4.5
|
* @since Beta v0.5.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,14 +55,14 @@ declare namespace TGApp.Plugins.Mys.News {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 用于渲染的咨讯卡片
|
* @description 用于渲染的咨讯卡片
|
||||||
* @since Beta v0.4.0
|
* @since Beta v0.5.0
|
||||||
* @interface RenderCard
|
* @interface RenderCard
|
||||||
* @property {string} title 标题
|
* @property {string} title 标题
|
||||||
* @property {string} cover 封面图片 URL
|
* @property {string} cover 封面图片 URL
|
||||||
* @property {number} postId 帖子 ID
|
* @property {number} postId 帖子 ID
|
||||||
* @property {string} subtitle 副标题
|
* @property {string} subtitle 副标题
|
||||||
* @property {TGApp.Plugins.Mys.User.Post} user 发帖用户
|
* @property {TGApp.Plugins.Mys.User.Post|null} user 发帖用户
|
||||||
* @property forum 版块
|
* @property forum 版块,可能为 null
|
||||||
* @property {string} forum.name 版块名称
|
* @property {string} forum.name 版块名称
|
||||||
* @property {string} forum.icon 版块图标
|
* @property {string} forum.icon 版块图标
|
||||||
* @property {RenderStatus} status 活动状态,仅活动咨讯有
|
* @property {RenderStatus} status 活动状态,仅活动咨讯有
|
||||||
@@ -79,11 +79,11 @@ declare namespace TGApp.Plugins.Mys.News {
|
|||||||
cover: string;
|
cover: string;
|
||||||
postId: number;
|
postId: number;
|
||||||
subtitle: string;
|
subtitle: string;
|
||||||
user: TGApp.Plugins.Mys.User.Post;
|
user: TGApp.Plugins.Mys.User.Post | null;
|
||||||
forum: {
|
forum: {
|
||||||
name: string;
|
name: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
};
|
} | null;
|
||||||
data: {
|
data: {
|
||||||
mark: number;
|
mark: number;
|
||||||
forward: number;
|
forward: number;
|
||||||
|
|||||||
12
src/plugins/Mys/types/Post.d.ts
vendored
12
src/plugins/Mys/types/Post.d.ts
vendored
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* @file plugins/Mys/types/post.d.ts
|
* @file plugins/Mys/types/post.d.ts
|
||||||
* @description Mys 插件帖子类型定义文件
|
* @description Mys 插件帖子类型定义文件
|
||||||
* @since Beta v0.4.5
|
* @since Beta v0.5.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Mys 插件帖子类型
|
* @description Mys 插件帖子类型
|
||||||
* @since Beta v0.4.5
|
* @since Beta v0.5.0
|
||||||
* @namespace TGApp.Plugins.Mys.Post
|
* @namespace TGApp.Plugins.Mys.Post
|
||||||
* @memberof TGApp.Plugins.Mys
|
* @memberof TGApp.Plugins.Mys
|
||||||
*/
|
*/
|
||||||
@@ -27,12 +27,12 @@ declare namespace TGApp.Plugins.Mys.Post {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 帖子数据
|
* @description 帖子数据
|
||||||
* @since Beta v0.4.5
|
* @since Beta v0.5.0
|
||||||
* @interface FullData
|
* @interface FullData
|
||||||
* @property {Post} post 帖子信息
|
* @property {Post} post 帖子信息
|
||||||
* @property {Forum} forum 所属版块
|
* @property {Forum} forum 所属版块
|
||||||
* @property {Topic[]} topics 所属话题
|
* @property {Topic[]} topics 所属话题
|
||||||
* @property {TGApp.Plugins.Mys.User.Post} user 发帖人
|
* @property {TGApp.Plugins.Mys.User.Post|null} user 发帖人
|
||||||
* @property {TGApp.Plugins.Mys.User.SelfOperation} self_operation 当前用户操作
|
* @property {TGApp.Plugins.Mys.User.SelfOperation} self_operation 当前用户操作
|
||||||
* @property {Stat} stat 帖子统计
|
* @property {Stat} stat 帖子统计
|
||||||
* @property {HelpSys} help_sys 帮助系统,可能为 null
|
* @property {HelpSys} help_sys 帮助系统,可能为 null
|
||||||
@@ -54,9 +54,9 @@ declare namespace TGApp.Plugins.Mys.Post {
|
|||||||
*/
|
*/
|
||||||
interface FullData {
|
interface FullData {
|
||||||
post: Post;
|
post: Post;
|
||||||
forum: Forum;
|
forum: Forum | null;
|
||||||
topics: Topic[];
|
topics: Topic[];
|
||||||
user: TGApp.Plugins.Mys.User.Post;
|
user: TGApp.Plugins.Mys.User.Post | null;
|
||||||
self_operation: TGApp.Plugins.Mys.User.SelfOperation;
|
self_operation: TGApp.Plugins.Mys.User.SelfOperation;
|
||||||
stat: Stat;
|
stat: Stat;
|
||||||
help_sys: HelpSys | null;
|
help_sys: HelpSys | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user