提交 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
}
const contentStyle: React.CSSProperties = {
width: '100%',
} }
export default function FlyingDetail() { export default function FlyingDetail() {
const router = useRouter()
const router = useRouter(); const [detail, setDetail] = useState<ParsedUrlQuery | RouterDetail>()
const [detail,setDetail] =useState<ParsedUrlQuery | RouterDetail>() useEffect(() => {
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">
<div className="right"> <video
{/* <Button 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">
{/* <Button
type="primary" type="primary"
className="btn" className="btn"
onClick={() => onClick={() =>
...@@ -32,12 +66,18 @@ export default function FlyingDetail() { ...@@ -32,12 +66,18 @@ export default function FlyingDetail() {
> >
去考试 去考试
</Button> */} </Button> */}
</div>
</div> </div>
</div> </div>
<div className="box-body"> <div className="detail">
<video className="body-video" controls src={detail?.videoUrl as string} /> <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 {
display: flex; background-color: #fff;
justify-content: space-between; height: 586px;
align-items: center; padding-top: 20px;
padding: 10px 0; .box-body {
.left { margin: 0 auto;
height: 25px; display: flex;
font-size: 20px; width: 1200px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; height: 470px;
font-weight: bold; /* background: #111111; */
color: #000000; .body-video {
line-height: 25px; width: 1200px;
height: 470px;
}
/* .right-box {
width: 362px;
height: 470px;
background: #1b2128;
.tabs {
color: #fff;
}
} */
} }
.right { .box-bottom {
.btn { margin: 0 auto;
width: 180px; width: 1200px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0 38px 0;
.left {
height: 50px; height: 50px;
background: linear-gradient(135deg, #278eff 0%, #0052da 100%); .top {
border-radius: 6px; font-size: 24px;
font-size: 20px; font-family: PingFangSC-Medium, PingFang SC;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; font-weight: 500;
font-weight: bold; color: #000000;
color: #ffffff; margin-bottom: 10px;
&:hover { }
opacity: 0.8; .bottom {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ff552d;
}
}
.right {
.btn {
width: 180px;
height: 50px;
background: linear-gradient(135deg, #278eff 0%, #0052da 100%);
border-radius: 6px;
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ffffff;
&:hover {
opacity: 0.8;
}
} }
} }
} }
} }
.box-body { .detail {
margin-top: 20px; margin: 0 auto;
width: 1200px; width: 1200px;
height: 675px; height: 420px;
background: #111111; background: #ffffff;
.body-video { box-shadow: 0px 2px 6px 0px rgba(183, 188, 197, 0.1);
width: 1200px; border-radius: 12px;
height: 675px; 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论