@@ -83,13 +107,45 @@ const VideoInfo: FC<
{title}
-
-
-
{name}
-
{getrealtiveTime(updated_at * 1000)}
-
+
+
+

+
+
+
+
{name}
+
{getrealtiveTime(updated_at * 1000)}
+
+
+
+ {" "}
+ {getFixedNumber(like)}
+
+
+ {getFixedNumber(coin)}
+
+
+ {" "}
+ {getFixedNumber(favorite)}
+
+
+
);
};
// 1-6 todo:写完视频页面展示瀑布图
+
+export const CoinIcon: FC<{
+ height: number | string;
+ width?: number | string;
+}> = ({ height, width = height }) => (
+
+);
diff --git a/src/routers/video/video.module.less b/src/routers/video/video.module.less
index 060f8d1..47c3858 100644
--- a/src/routers/video/video.module.less
+++ b/src/routers/video/video.module.less
@@ -1,4 +1,10 @@
.video-data {
+ transition: opacity .3s linear;
+
+ *:hover+& {
+ opacity: 0;
+ }
+
position: absolute;
left: 0;
bottom: 0;
@@ -14,8 +20,8 @@
font-size: 13px;
font-weight: 400;
background-image: linear-gradient(180deg,
- rgba(0, 0, 0, 0) 0%,
- rgba(0, 0, 0, .8) 100%);
+ rgba(0, 0, 0, 0) 0%,
+ rgba(0, 0, 0, .8) 100%);
&-left {
flex: 1;
@@ -36,6 +42,10 @@
}
.video-info {
+ &>*:not(:first-child) {
+ margin-top: 5px;
+ }
+
&>p {
color: #18191c;
font-size: 15px;
@@ -49,29 +59,76 @@
}
- .video-up-info {
- a {
- font-size: 13px;
- color: rgb(148, 153, 160);
- cursor: pointer;
- transition: color .2s linear;
+ .video-up {
+ display: flex;
+ align-items: stretch;
- &:hover,
- &:active {
- color: #00aeec;
+ &>*:not(:first-child) {
+ margin-left: 5px;
+ }
+
+ &-face {
+ width: 40px;
+ height: 40px;
+
+ img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border-radius: 50%;
+ overflow: hidden;
}
+ }
+
+ &-desc {
+ font-size: 13px;
+ display: flex;
+ flex-flow: column nowrap;
+ justify-content: space-between;
+ cursor: default;
- &>span {
+ &-data {
+ display: flex;
+ flex-flow: row nowrap;
overflow: hidden;
text-overflow: ellipsis;
- word-break: break-all;
- &:not(:last-of-type):after {
- content: '·';
- margin: 0 4px;
+ &>span {
+ white-space: nowrap;
+ display: flex;
+ align-items: center;
+
+ &:not(:first-of-type) {
+ margin-left: 10px;
+ }
}
+ }
+
+
+ a {
+
+ color: rgb(148, 153, 160);
+ cursor: pointer;
+ transition: color .2s linear;
+ &:hover,
+ &:active {
+ color: #00aeec;
+ }
+
+ &>span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ word-break: break-all;
+
+ &:not(:last-of-type):after {
+ content: '·';
+ margin: 0 4px;
+ }
+
+ }
}
}
+
}
}
\ No newline at end of file
diff --git a/src/routers/video/videotype.ts b/src/routers/video/videotype.ts
index 712300d..bf86b73 100644
--- a/src/routers/video/videotype.ts
+++ b/src/routers/video/videotype.ts
@@ -23,6 +23,8 @@ export type VideoRouterImageCardType = Pick<
| "updated_at"
| "danmaku"
| "duration"
+ | "favorite"
+ | "face"
> &
Omit
;
diff --git a/src/utils/fetch/fetchtype.ts b/src/utils/fetch/fetchtype.ts
index d42885f..c28e5c6 100644
--- a/src/utils/fetch/fetchtype.ts
+++ b/src/utils/fetch/fetchtype.ts
@@ -53,7 +53,7 @@ interface RFetchVideoResResult {
*/
bvid: string;
/**
- * @description 暂时不知道是啥
+ * @description 视频AVID
*/
aid: number;
/**
@@ -62,7 +62,7 @@ interface RFetchVideoResResult {
*/
name: string;
/**
- * @description 暂时不知道是什么
+ * @description 视频作者UID
*/
mid: number;
/**
@@ -71,7 +71,7 @@ interface RFetchVideoResResult {
*/
face: string;
/**
- * @description 暂时不知道是什么
+ * @description 视频分区ID
*/
tid: number;
/**
@@ -111,7 +111,7 @@ interface RFetchVideoResResult {
*/
tag: string;
/**
- * @description 不知道是啥
+ * @description 视频上传时间
*/
pubdate: number;
/**
@@ -128,7 +128,13 @@ interface RFetchVideoResResult {
*
*/
danmaku: number;
+ /**
+ * @description 视频评论条数
+ */
reply: number;
+ /**
+ * @description 收藏数量
+ */
favorite: number;
/**
* @description 视频硬币数
diff --git a/src/utils/number/index.ts b/src/utils/number/index.ts
new file mode 100644
index 0000000..cc27b88
--- /dev/null
+++ b/src/utils/number/index.ts
@@ -0,0 +1,9 @@
+/**
+ * @description 给大数字进行缩减,如10000-》1.0w
+ */
+export default function getFixedNumber(number: number): number | string {
+ if (number > 10000) {
+ return (number / 10000).toFixed(1) + "w";
+ }
+ return number;
+}