mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
👽️ 适应米社返回数据变更
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
<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 v-if="card.user" :data="card.user" position="left" />
|
<TpAvatar v-if="card.user" :data="card.user" position="left" />
|
||||||
<div class="tpc-data">
|
<div class="tpc-data" v-if="card.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>
|
||||||
<span>{{ card.data.view }}</span>
|
<span>{{ card.data.view }}</span>
|
||||||
@@ -158,12 +158,22 @@ function getPostCover(item: TGApp.Plugins.Mys.Post.FullData): string {
|
|||||||
*/
|
*/
|
||||||
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;
|
let forum = null;
|
||||||
|
let data = null;
|
||||||
if (item.forum !== null) {
|
if (item.forum !== null) {
|
||||||
forum = {
|
forum = {
|
||||||
name: item.forum.name,
|
name: item.forum.name,
|
||||||
icon: item.forum.icon,
|
icon: item.forum.icon,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (item.stat !== null) {
|
||||||
|
data = {
|
||||||
|
mark: item.stat.bookmark_num,
|
||||||
|
forward: item.stat.forward_num,
|
||||||
|
like: item.stat.like_num,
|
||||||
|
reply: item.stat.reply_num,
|
||||||
|
view: item.stat.view_num,
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
title: item.post.subject,
|
title: item.post.subject,
|
||||||
cover: getPostCover(item),
|
cover: getPostCover(item),
|
||||||
@@ -171,13 +181,7 @@ function getCommonCard(item: TGApp.Plugins.Mys.Post.FullData): TGApp.Plugins.Mys
|
|||||||
subtitle: item.post.post_id,
|
subtitle: item.post.post_id,
|
||||||
user: item.user,
|
user: item.user,
|
||||||
forum: forum,
|
forum: forum,
|
||||||
data: {
|
data: data,
|
||||||
mark: item.stat.bookmark_num,
|
|
||||||
forward: item.stat.forward_num,
|
|
||||||
like: item.stat.like_num,
|
|
||||||
reply: item.stat.reply_num,
|
|
||||||
view: item.stat.view_num,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
src/plugins/Mys/types/News.d.ts
vendored
6
src/plugins/Mys/types/News.d.ts
vendored
@@ -61,12 +61,12 @@ declare namespace TGApp.Plugins.Mys.News {
|
|||||||
* @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|null} user 发帖用户
|
* @property {TGApp.Plugins.Mys.User.Post|null} user 发帖用户,可能为 null
|
||||||
* @property forum 版块,可能为 null
|
* @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 活动状态,仅活动咨讯有
|
||||||
* @property data 帖子统计
|
* @property data 帖子统计,可能为 null
|
||||||
* @property {number} data.mark 帖子收藏数
|
* @property {number} data.mark 帖子收藏数
|
||||||
* @property {number} data.forward 帖子转发数
|
* @property {number} data.forward 帖子转发数
|
||||||
* @property {number} data.like 帖子点赞数
|
* @property {number} data.like 帖子点赞数
|
||||||
@@ -90,7 +90,7 @@ declare namespace TGApp.Plugins.Mys.News {
|
|||||||
like: number;
|
like: number;
|
||||||
reply: number;
|
reply: number;
|
||||||
view: number;
|
view: number;
|
||||||
};
|
} | null;
|
||||||
status?: RenderStatus;
|
status?: RenderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
src/plugins/Mys/types/Post.d.ts
vendored
8
src/plugins/Mys/types/Post.d.ts
vendored
@@ -30,11 +30,11 @@ declare namespace TGApp.Plugins.Mys.Post {
|
|||||||
* @since Beta v0.5.0
|
* @since Beta v0.5.0
|
||||||
* @interface FullData
|
* @interface FullData
|
||||||
* @property {Post} post 帖子信息
|
* @property {Post} post 帖子信息
|
||||||
* @property {Forum} forum 所属版块
|
* @property {Forum|null} forum 所属版块,可能为 null
|
||||||
* @property {Topic[]} topics 所属话题
|
* @property {Topic[]} topics 所属话题
|
||||||
* @property {TGApp.Plugins.Mys.User.Post|null} user 发帖人
|
* @property {TGApp.Plugins.Mys.User.Post|null} user 发帖人,可能为 null
|
||||||
* @property {TGApp.Plugins.Mys.User.SelfOperation} self_operation 当前用户操作
|
* @property {TGApp.Plugins.Mys.User.SelfOperation} self_operation 当前用户操作
|
||||||
* @property {Stat} stat 帖子统计
|
* @property {Stat|null} stat 帖子统计,可能为 null
|
||||||
* @property {HelpSys} help_sys 帮助系统,可能为 null
|
* @property {HelpSys} help_sys 帮助系统,可能为 null
|
||||||
* @property {Image} cover 封面图,可能为 null
|
* @property {Image} cover 封面图,可能为 null
|
||||||
* @property {Image[]} image_list 图片列表
|
* @property {Image[]} image_list 图片列表
|
||||||
@@ -58,7 +58,7 @@ declare namespace TGApp.Plugins.Mys.Post {
|
|||||||
topics: Topic[];
|
topics: Topic[];
|
||||||
user: TGApp.Plugins.Mys.User.Post | null;
|
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 | null;
|
||||||
help_sys: HelpSys | null;
|
help_sys: HelpSys | null;
|
||||||
cover: Image | null;
|
cover: Image | null;
|
||||||
image_list: Image[];
|
image_list: Image[];
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ export async function parseLink(
|
|||||||
await emit("active_deep_link", "router?path=/news/2/news");
|
await emit("active_deep_link", "router?path=/news/2/news");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (link === "mihoyobbs://homeForum?game_id=8&tab_type=2") {
|
||||||
|
await emit("active_deep_link", "router?path=/news/8/news");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user