Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Jan 26, 2025
1 parent 757e9fc commit 26ce141
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
29 changes: 17 additions & 12 deletions packages/index/src/components/comment/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

.video-comment-edit {
display: flex;
margin: 0em 0 1.5em;
margin: 0em 0 0.5em;
align-items: flex-end;
padding-left: 50px;
// padding-left: 50px;
position: relative;

// &:hover {
Expand All @@ -25,15 +25,15 @@
// }
// }

&__avatar {
position: absolute;
left: 0;
top: 0;
width: 45px;
height: 45px;
border-radius: 50%;
background-color: #f4f4f4;
}
// &__avatar {
// position: absolute;
// left: 0;
// top: 0;
// width: 45px;
// height: 45px;
// border-radius: 50%;
// background-color: #f4f4f4;
// }

&__input {
margin-right: 0.5em;
Expand All @@ -45,7 +45,7 @@
border-radius: 6px;
color: var(--text1);
width: 100%;
height: 100px;
height: 120px;
transition: 0.2s;
padding: 10px 10px;
outline: none;
Expand Down Expand Up @@ -76,6 +76,11 @@
text-align: center;
}

.comment-biu {
margin-bottom: 1em;
width: 100%;
}

.comment-item {
padding: 1em 0 0.6em;
position: relative;
Expand Down
16 changes: 8 additions & 8 deletions packages/index/src/components/comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Comment = ({ comments, onFocus, onBlur, postId, player, setMetaInfo }: Com
<h4>评论</h4>
</div>
<div className="video-comment-edit">
<img className="video-comment-edit__avatar" src={'/ic_launcher_round.png'} alt="" />
{/* <img className="video-comment-edit__avatar" src={'/ic_launcher_round.png'} alt="" /> */}
<textarea
className="video-comment-edit__input"
placeholder="留下评论..."
Expand All @@ -58,14 +58,14 @@ const Comment = ({ comments, onFocus, onBlur, postId, player, setMetaInfo }: Com
onFocus={(e) => onFocus?.(e)}
onBlur={(e) => onBlur?.(e)}
></textarea>
<button
disabled={!comment || isLoading}
className="button is-primary video-comment-edit__button"
onClick={doComment}
>
评论
</button>
</div>
<button
disabled={!comment || isLoading}
className="comment-biu button is-primary video-comment-edit__button"
onClick={doComment}
>
评论
</button>
<div className="comment-list">
{comments ? (
comments.length > 0 ? (
Expand Down
4 changes: 2 additions & 2 deletions packages/index/src/mock/video/9.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"ID": 24,
"Episode": 1,
"Cover": "",
"Title": "",
"Cover": "https://p.upyun.com/demo/tmp/jjJWPHMZ.webp",
"Title": "秒速5厘米",
"TitleJapanese": "",
"TitleRomanji": "",
"VideoUrl": "http://ggkkmuup9wuugp6ep8d.exp.bcevod.com/mda-pe61j6kh7ifgqjuy/mda-pe61j6kh7ifgqjuy.mp4?Expires=1721446584&AccessKeyId=0h1d8rwzxC7ZtcyO&Signature=d90780aee70d8c1526b1d2d84bd76067",
Expand Down
9 changes: 5 additions & 4 deletions packages/index/src/pages/player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default function PlayerPage({ id }: any) {
const [metaInfo, setMetaInfo] = useState<{ like: number; comment?: any[] }>({ like: 0 })

useEffect(() => {
Promise.all([oaii.get('/biu?post_id=' + id), oaii.get('/like?post_id=' + id)]).then(([comment, like]) => {
setMetaInfo({ comment, like })
})
// axios.get(`/post/${id}`)
import(`../../mock/post/${id}.json`)
.catch(() => {
Expand Down Expand Up @@ -61,6 +64,8 @@ export default function PlayerPage({ id }: any) {
if (!res.data) return
;(res.data as R.Video[]).sort((a, b) => a.Episode - b.Episode)
setVideo(res.data)
console.log(res.data)

player.current?.context.playlist.changeSourceList(
res.data.map((it) => {
return {
Expand Down Expand Up @@ -103,10 +108,6 @@ export default function PlayerPage({ id }: any) {
setVideo(it.Episodes)
player.current?.context.playlist.changeSourceList(it.Episodes)
})

Promise.all([oaii.get('/biu?post_id=' + id), oaii.get('/like?post_id=' + id)]).then(([comment, like]) => {
setMetaInfo({ comment, like })
})
}, [isAdp])

useEffect(() => {
Expand Down

0 comments on commit 26ce141

Please sign in to comment.