提交 4e343ba3 作者: 曹云

改-飞手培训-详情-页面布局,样式修改

上级 876ef145
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from 'react'
import Layout from "~/components/layout"; import Layout from '~/components/layout'
import { Box } from "./styled"; import { Box } from './styled'
import { Button } from "antd"; import { Button, Tabs } from 'antd'
import { useRouter } from "next/router"; import { useRouter } from 'next/router'
import { ParsedUrlQuery } from "querystring"; import { ParsedUrlQuery } from 'querystring'
import type { TabsProps } from 'antd'
interface RouterDetail { interface RouterDetail {
videoUrl:string | '', videoUrl: string | ''
curriculumName:string curriculumName: string
curriculumDesc: string
} }
export default function FlyingDetail() { const contentStyle: React.CSSProperties = {
width: '100%',
}
const router = useRouter(); export default function FlyingDetail() {
const [detail,setDetail] =useState<ParsedUrlQuery | RouterDetail>() const router = useRouter()
useEffect(()=>{ const [detail, setDetail] = useState<ParsedUrlQuery | RouterDetail>()
useEffect(() => {
setDetail(router.query) setDetail(router.query)
},[router]) }, [router])
const onChange = (key: string) => {
console.log(key)
}
const items: TabsProps['items'] = [
{
key: '1',
label: `介绍`,
children: (
<div className="body">
<div className="top">
<div className="title">课程简介</div>
<div className="content">{detail?.curriculumDesc}</div>
</div>
{/* <div className="bottom">详情</div> */}
</div>
),
},
]
return ( return (
<Layout> <Layout contentStyle={contentStyle}>
<Box> <Box>
<div className="box-top"> <div className="box">
<div className="left">{detail?.curriculumName}</div> <div className="box-body">
<video
className="body-video"
controls
src={detail?.videoUrl as string}
/>
</div>
<div className="box-bottom">
<div className="left">
<div className="top">{detail?.curriculumName}</div>
<div className="bottom">免费</div>
</div>
<div className="right"> <div className="right">
{/* <Button {/* <Button
type="primary" type="primary"
...@@ -34,10 +68,16 @@ export default function FlyingDetail() { ...@@ -34,10 +68,16 @@ export default function FlyingDetail() {
</Button> */} </Button> */}
</div> </div>
</div> </div>
<div className="box-body"> </div>
<video className="body-video" controls src={detail?.videoUrl as string} /> <div className="detail">
<Tabs
className="tabs"
defaultActiveKey="1"
items={items}
onChange={onChange}
/>
</div> </div>
</Box> </Box>
</Layout> </Layout>
); )
} }
import styled from "styled-components"; import styled from 'styled-components'
export default function Style() { export default function Style() {
return <></>; return <></>
} }
export const Box = styled.div` export const Box = styled.div`
box-sizing: border-box; box-sizing: border-box;
.box-top { .box {
background-color: #fff;
height: 586px;
padding-top: 20px;
.box-body {
margin: 0 auto;
display: flex;
width: 1200px;
height: 470px;
/* background: #111111; */
.body-video {
width: 1200px;
height: 470px;
}
/* .right-box {
width: 362px;
height: 470px;
background: #1b2128;
.tabs {
color: #fff;
}
} */
}
.box-bottom {
margin: 0 auto;
width: 1200px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10px 0; padding: 16px 0 38px 0;
.left { .left {
height: 25px; height: 50px;
font-size: 20px; .top {
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; font-size: 24px;
font-weight: bold; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000; color: #000000;
line-height: 25px; margin-bottom: 10px;
}
.bottom {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ff552d;
}
} }
.right { .right {
.btn { .btn {
...@@ -35,14 +68,41 @@ export const Box = styled.div` ...@@ -35,14 +68,41 @@ export const Box = styled.div`
} }
} }
} }
.box-body { }
margin-top: 20px; .detail {
width: 1200px; margin: 0 auto;
height: 675px;
background: #111111;
.body-video {
width: 1200px; width: 1200px;
height: 675px; height: 420px;
background: #ffffff;
box-shadow: 0px 2px 6px 0px rgba(183, 188, 197, 0.1);
border-radius: 12px;
margin-top: 16px;
padding: 20px;
.tabs {
.body {
.top {
.title {
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
}
.content {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #27323f;
margin-top: 10px;
}
}
.bottom {
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
margin-top: 29px;
}
}
} }
} }
`; `
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论