提交 b08dd55b 作者: 18928357778

改-设备租赁-样式调整

上级 fe95c198
...@@ -3,10 +3,10 @@ import {useRouter} from 'next/router'; ...@@ -3,10 +3,10 @@ import {useRouter} from 'next/router';
import Layout from "~/components/layout"; import Layout from "~/components/layout";
import {Box} from './styled'; import {Box} from './styled';
import ImagePreview from './components/picture-preview'; import ImagePreview from './components/picture-preview';
import { Button , Image as AImage , Divider } from 'antd'; import { Button , Image as AImage , Divider , Select} from 'antd';
import Image from 'next/image'; import Image from 'next/image';
import errImg from "~/assets/errImg"; import errImg from "~/assets/errImg";
import api,{GetWebDeviceDetailResult} from './api'; import api,{GetWebDeviceDetailResult,GetWebDeviceWareSkuById} from './api';
export default function EquipmentLeasingDetail() { export default function EquipmentLeasingDetail() {
const router = useRouter(); const router = useRouter();
...@@ -14,6 +14,7 @@ export default function EquipmentLeasingDetail() { ...@@ -14,6 +14,7 @@ export default function EquipmentLeasingDetail() {
const [id, setId] = useState<number | null>(null); const [id, setId] = useState<number | null>(null);
const [detail,setDetail] = useState<GetWebDeviceDetailResult | null>() const [detail,setDetail] = useState<GetWebDeviceDetailResult | null>()
const [wareSkuList,setWareSkuList] = useState<GetWebDeviceWareSkuById[] | undefined>()
useEffect(()=>{ useEffect(()=>{
setId(Number(router.query.id)) setId(Number(router.query.id))
...@@ -28,6 +29,16 @@ export default function EquipmentLeasingDetail() { ...@@ -28,6 +29,16 @@ export default function EquipmentLeasingDetail() {
.then((res) => { .then((res) => {
setDetail(res.result || null); setDetail(res.result || null);
}); });
api
.listWareSkuById({
id:id
})
.then((res) => {
res.result?.map(item=>{
return item
})
setWareSkuList(res.result || undefined);
});
} }
},[id]) },[id])
...@@ -48,7 +59,28 @@ export default function EquipmentLeasingDetail() { ...@@ -48,7 +59,28 @@ export default function EquipmentLeasingDetail() {
<span className='menoy-left'>¥{detail?.minRent}</span> <span className='menoy-left'>¥{detail?.minRent}</span>
<span className='menoy-right'>/天起</span> <span className='menoy-right'>/天起</span>
</div> </div>
<div className='classification'></div> <div className='classification'>
<div className='top'>
<div className='left'>
<span className='label'>选择</span>
<span className='value'>商品分类</span>
</div>
<div className='right'>
<Select
defaultActiveFirstOption
defaultValue={wareSkuList}
style={{ width: 120 }}
bordered={false}
options={wareSkuList}
fieldNames={{label:"skuTitle",value:"id"}}
/>
</div>
</div>
<div className='bottom'>
<span className='label'>发货</span>
<span className='value'>顺丰到付</span>
</div>
</div>
<div className='botton-btn'> <div className='botton-btn'>
<Button className='btn-left' size='small' type="primary">成为渠道商</Button> <Button className='btn-left' size='small' type="primary">成为渠道商</Button>
<Button className='btn-right' size='small' type="primary">立即租赁</Button> <Button className='btn-right' size='small' type="primary">立即租赁</Button>
......
...@@ -34,9 +34,36 @@ export interface GetWebDeviceDetailResult { ...@@ -34,9 +34,36 @@ export interface GetWebDeviceDetailResult {
wareDetailContent: string | TrustedHTML wareDetailContent: string | TrustedHTML
} }
export interface PriceList {
id: number,
wareInfoId: number,
skuInfoId: number,
rentPrice: number,
minDay: number,
maxDay: number,
createTime: null
}
export interface GetWebDeviceWareSkuById {
id: number,
wareInfoId: number,
skuTitle: string,
rentPrice: number | null,
rentDeposit: number,
stockNum: number,
saleNum: number,
createTime: string,
updateTime: null,
skuPriceDTOList: Array<PriceList>,
}
export default { export default {
//web-设备租赁-详情 //web-设备租赁-详情
listDetailDeviceInfo: (params: GetWebDeviceDetailParams): Promise<Response<GetWebDeviceDetailResult>> => { listDetailDeviceInfo: (params: GetWebDeviceDetailParams): Promise<Response<GetWebDeviceDetailResult>> => {
return request('/pms/webDevice/detail', 'get', params) return request('/pms/webDevice/detail', 'get', params)
},
//web-设备租赁-商品
listWareSkuById: (params: GetWebDeviceDetailParams): Promise<Response<GetWebDeviceWareSkuById[]>> => {
return request('/pms/appDevice/listWareSkuById', 'get', params)
} }
} }
\ No newline at end of file
...@@ -58,7 +58,33 @@ export const Box = styled.div` ...@@ -58,7 +58,33 @@ export const Box = styled.div`
margin-top: 28px; margin-top: 28px;
width: 300px; width: 300px;
height: 50px; height: 50px;
background-color: pink; .label{
height: 21px;
font-size: 16px;
font-family: MicrosoftYaHei;
color: #9A9A9A;
line-height: 21px;
margin-right: 36px;
}
.value{
height: 21px;
font-size: 16px;
font-family: MicrosoftYaHei;
color: #151515;
line-height: 21px;
}
.top{
display: flex;
justify-content: space-between;
align-items: center;
.left{
}
.right{
}
}
.bottom{
margin-top: 5px;
}
} }
.botton-btn{ .botton-btn{
margin-top: 30px; margin-top: 30px;
......
...@@ -69,7 +69,7 @@ export default function EquipmentLeasing(props: Props) { ...@@ -69,7 +69,7 @@ export default function EquipmentLeasing(props: Props) {
const [abort, setAbort] = useState<AbortController | null>(null); //请求中断 const [abort, setAbort] = useState<AbortController | null>(null); //请求中断
const [pageParams, setPageParams] = useState({ const [pageParams, setPageParams] = useState({
pageNo: 1, pageNo: 1,
pageSize: 16, pageSize: 15,
}); //分页器对象 }); //分页器对象
const onPageChange = (page: number, pageSize: number) => { const onPageChange = (page: number, pageSize: number) => {
...@@ -141,7 +141,7 @@ export default function EquipmentLeasing(props: Props) { ...@@ -141,7 +141,7 @@ export default function EquipmentLeasing(props: Props) {
></Filter> ></Filter>
<div style={{ paddingTop: 13 }}> <div style={{ paddingTop: 13 }}>
<ContentBox <ContentBox
boxIndex={4} boxIndex={5}
leftcontentstyle={{ leftcontentstyle={{
width: "916px", width: "916px",
margin: { top: 0, right: "12px", bottom: "12px", left: 0 }, margin: { top: 0, right: "12px", bottom: "12px", left: 0 },
......
...@@ -16,10 +16,12 @@ export const Box = styled.div` ...@@ -16,10 +16,12 @@ export const Box = styled.div`
cursor: pointer; cursor: pointer;
transition: all 0.5s; transition: all 0.5s;
&-top { &-top {
display: flex;
justify-content: center;
align-items: center;
height: 145px; height: 145px;
background: #ffffff; background: #ffffff;
border-radius: 6px 6px 0px 0px; border-radius: 6px 6px 0px 0px;
padding: 19px 52px 10px 52px;
&-image { &-image {
width: 116px; width: 116px;
height: 116px; height: 116px;
...@@ -29,7 +31,6 @@ export const Box = styled.div` ...@@ -29,7 +31,6 @@ export const Box = styled.div`
&-bottom { &-bottom {
padding: 10px 13px 14px 18px; padding: 10px 13px 14px 18px;
&-title { &-title {
width: 189px;
height: 24px; height: 24px;
font-size: 14px; font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI; font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
...@@ -73,5 +74,6 @@ export const Box = styled.div` ...@@ -73,5 +74,6 @@ export const Box = styled.div`
} }
.pagination-page { .pagination-page {
text-align: right; text-align: right;
margin-top: 150px;
} }
`; `;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论