Skip to content

Commit

Permalink
搞定
Browse files Browse the repository at this point in the history
  • Loading branch information
yisar committed May 11, 2024
1 parent d8291d7 commit f385fb8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions fre/src/play/play.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@ export default function Post({ gv }) {
const [post, setPost] = useState({} as any)
const [videos, setVideos] = useState([])
const [play, setPlay] = useState("")
const [pv, setPv] = useState("")
const [show, setShow] = useState(false)
const [idx, setId] = useState(fp - 1)

useEffect(() => {
const p1 = getPostDetail(id)
const p2 = getPv(id)
Promise.all([p1, p2]).then(([res1, res2]) => {
setPost((res1 as any).result)
const videos = buildVideos((res1 as any).result.videos || "")
p1.then((res) => {
setPost((res as any).result)
const videos = buildVideos((res as any).result.videos || "")
setVideos(videos)
if (videos.length > 0) {
setPlay(videos[0][1])
}
setPv((res2 as any).result.pv)
// a.current.innerHTML = snarkdown((res1 as any).result.content)
})

Expand Down Expand Up @@ -57,7 +54,7 @@ export default function Post({ gv }) {
</ul>
</div>

<h1>{post.title}<span>{pv}</span>
<h1>{post.title}<span>{post.pv}</span>
</h1>
</div>
<div className="tag">
Expand Down

0 comments on commit f385fb8

Please sign in to comment.