Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
79e21e7c
提交
79e21e7c
authored
1月 13, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:首页租赁跳转
上级
9ff69410
流水线
#7998
已通过 于阶段
in 5 分 11 秒
变更
9
流水线
1
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
148 行增加
和
48 行删除
+148
-48
tabView03.tsx
src/components/home-comp/home-tab/comp/tabView03.tsx
+34
-2
index.tsx
src/components/rentListItem/index.tsx
+28
-34
[second].tsx
src/pages/rent/[main]/[second].tsx
+36
-0
index.tsx
src/pages/rent/[main]/index.tsx
+36
-0
index.tsx
src/pages/rent/index.tsx
+6
-3
[second].tsx
src/pages/service/[main]/[second].tsx
+1
-2
index.tsx
src/pages/service/[main]/index.tsx
+1
-2
[id].tsx
src/pages/service/detail/[id].tsx
+5
-3
index.tsx
src/pages/service/index.tsx
+1
-2
没有找到文件。
src/components/home-comp/home-tab/comp/tabView03.tsx
浏览文件 @
79e21e7c
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Button
}
from
'antd'
;
import
{
Button
}
from
'antd'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useDispatch
}
from
'react-redux'
;
import
styled
from
'styled-components'
;
import
styled
from
'styled-components'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
{
setGlobalData
}
from
'@/store/module/globalData'
;
// 列表类型
// 列表类型
type
ListType
=
InterListType
<
ListBrandInfoType
>
;
type
ListType
=
InterListType
<
ListBrandInfoType
>
;
const
TabView03
=
()
=>
{
const
TabView03
=
()
=>
{
// 导航钩子
const
router
=
useRouter
();
// store
const
dispatch
=
useDispatch
();
// 列表数据
// 列表数据
const
[
tabList
,
setTabList
]
=
useState
<
ListType
>
([]);
const
[
tabList
,
setTabList
]
=
useState
<
ListType
>
([]);
// 获取云享商城分类
// 获取云享商城分类
...
@@ -22,6 +29,24 @@ const TabView03 = () => {
...
@@ -22,6 +29,24 @@ const TabView03 = () => {
// console.log('获取云享商城分类 --->', res);
// console.log('获取云享商城分类 --->', res);
}
}
};
};
// 跳转一级分类详情
const
handleMain
=
(
i
:
ListType
[
0
])
=>
{
dispatch
(
setGlobalData
({
loadingSpinnerVisible
:
true
,
}),
);
router
.
push
(
`/rent/
${
i
?.
id
}
`).then();
};
// 跳转二级分类详情
const handleSecond = (i: ListType[0], n: ListType[0]['modeInfoList'][0]) => {
dispatch(
setGlobalData({
loadingSpinnerVisible: true,
}),
);
router.push(`
/
rent
/
$
{
i
?.
id
}
/${n
?
.id}`
)
.then
()
;
};
// 组件挂载
// 组件挂载
useEffect
(()
=>
{
useEffect
(()
=>
{
getListBrandInfo
().
then
();
getListBrandInfo
().
then
();
...
@@ -31,11 +56,18 @@ const TabView03 = () => {
...
@@ -31,11 +56,18 @@ const TabView03 = () => {
{
tabList
.
map
((
i
,
j
)
=>
(
{
tabList
.
map
((
i
,
j
)
=>
(
<
div
key=
{
j
}
>
<
div
key=
{
j
}
>
<
div
className=
{
'tab-little flex-start'
}
>
<
div
className=
{
'tab-little flex-start'
}
>
<
div
className=
"title-name"
>
{
i
.
brandName
}
</
div
>
<
div
className=
"title-name"
onClick=
{
()
=>
handleMain
(
i
)
}
>
{
i
.
brandName
}
</
div
>
</
div
>
</
div
>
<
div
className=
"tab-list flex-start"
>
<
div
className=
"tab-list flex-start"
>
{
i
.
modeInfoList
?.
map
((
n
,
m
)
=>
(
{
i
.
modeInfoList
?.
map
((
n
,
m
)
=>
(
<
Button
type=
{
'link'
}
key=
{
m
}
className=
"list-item"
>
<
Button
type=
{
'link'
}
key=
{
m
}
className=
"list-item"
onClick=
{
()
=>
handleSecond
(
i
,
n
)
}
>
{
n
.
modeName
}
{
n
.
modeName
}
</
Button
>
</
Button
>
))
}
))
}
...
...
src/components/rentListItem/index.tsx
浏览文件 @
79e21e7c
...
@@ -6,6 +6,7 @@ import styled from 'styled-components';
...
@@ -6,6 +6,7 @@ import styled from 'styled-components';
import
{
InterListType
}
from
'@/api/interface'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
LeaseGoodsListType
}
from
'@/api/interface/home'
;
import
{
LeaseGoodsListType
}
from
'@/api/interface/home'
;
import
{
GlobalDataState
}
from
'@/store/module/globalData'
;
import
{
GlobalDataState
}
from
'@/store/module/globalData'
;
import
{
formatMoney
}
from
'@/utils/money'
;
// 商品详情类型
// 商品详情类型
type
GoodsInfoListType
=
InterListType
<
LeaseGoodsListType
>
[
0
];
type
GoodsInfoListType
=
InterListType
<
LeaseGoodsListType
>
[
0
];
...
@@ -23,13 +24,6 @@ const RentListItemView: React.FC<{
...
@@ -23,13 +24,6 @@ const RentListItemView: React.FC<{
const
handleDetail
=
()
=>
{
const
handleDetail
=
()
=>
{
// router.push(`/service/detail/${detail?.id}`).then();
// router.push(`/service/detail/${detail?.id}`).then();
};
};
// 获取商品的单位
// const getPriceUnit = () => {
// const unit = globalData?.priceUnitList?.find(
// (i) => i.id === detail?.inspectionPriceUnitId,
// );
// return unit?.unitName || '次';
// };
return
(
return
(
<
ProductItemWrap
onClick=
{
handleDetail
}
>
<
ProductItemWrap
onClick=
{
handleDetail
}
>
<
div
className=
"product-image"
>
<
div
className=
"product-image"
>
...
@@ -43,30 +37,30 @@ const RentListItemView: React.FC<{
...
@@ -43,30 +37,30 @@ const RentListItemView: React.FC<{
<
div
className=
"product-title"
>
{
detail
?.
tradeName
}
</
div
>
<
div
className=
"product-title"
>
{
detail
?.
tradeName
}
</
div
>
<
div
className=
"product-desc text-ellipsis"
>
{
detail
?.
sellingPoint
}
</
div
>
<
div
className=
"product-desc text-ellipsis"
>
{
detail
?.
sellingPoint
}
</
div
>
<
div
className=
"product-desc flex-between"
>
<
div
className=
"product-desc flex-between"
>
{
/* <div className="money"> */
}
<
div
className=
"money"
>
{
/* {detail?.price ? ( */
}
{
detail
?.
showPrice
?
(
{
/* <> */
}
<>
{
/* <span className="label">¥</span> */
}
<
span
className=
"label"
>
¥
</
span
>
{
/* <span */
}
<
span
{
/* className="num" */
}
className=
"num"
{
/* title={`${formatMoney(detail?.price)}元起每${getPriceUnit()}`} */
}
title=
{
`${formatMoney(detail?.showPrice)}元起每天`
}
{
/* > */
}
>
{
/* {formatMoney(detail?.price)} */
}
{
formatMoney
(
detail
?.
showPrice
)
}
{
/* </span> */
}
</
span
>
{
/* <div */
}
<
span
{
/* className="unit text-ellipsis" */
}
className=
"unit text-ellipsis"
{
/* title={`${formatMoney(detail?.price)}元起每${getPriceUnit()}`} */
}
title=
{
`${formatMoney(detail?.showPrice)}元起每天`
}
{
/* > */
}
>
{
/* 起/{getPriceUnit()} */
}
起/天
{
/* </div> */
}
</
span
>
{
/* </> */
}
</>
{
/* ) : ( */
}
)
:
(
{
/* <span className="label">咨询报价</span> */
}
<
span
className=
"label"
>
咨询报价
</
span
>
{
/* )} */
}
)
}
{
/* </div> */
}
</
div
>
{
/* <div className="text text-ellipsis"> */
}
<
div
className=
"text text-ellipsis"
>
{
/* 成交{Math.floor(detail.id * 3.14)}件 */
}
成交
{
Math
.
floor
(
detail
.
id
*
3.14
)
}
件
{
/* </div> */
}
</
div
>
</
div
>
</
div
>
<
div
className=
"product-store flex-start"
>
<
div
className=
"product-store flex-start"
>
<
PropertySafetyFilled
style=
{
{
color
:
'#FF552D'
}
}
/>
<
PropertySafetyFilled
style=
{
{
color
:
'#FF552D'
}
}
/>
...
@@ -86,7 +80,7 @@ const ProductItemWrap = styled.div`
...
@@ -86,7 +80,7 @@ const ProductItemWrap = styled.div`
position: relative;
position: relative;
box-sizing: border-box;
box-sizing: border-box;
width: calc((100% - (0.83rem * 5)) / 6);
width: calc((100% - (0.83rem * 5)) / 6);
height: 16rem;
height: 16
.5
rem;
border: 0.02rem solid #e3e3e3;
border: 0.02rem solid #e3e3e3;
margin: 0 0.83rem 0.83rem 0;
margin: 0 0.83rem 0.83rem 0;
padding: 0.67rem;
padding: 0.67rem;
...
@@ -120,7 +114,7 @@ const ProductItemWrap = styled.div`
...
@@ -120,7 +114,7 @@ const ProductItemWrap = styled.div`
-webkit-box-orient: vertical;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
-webkit-line-clamp: 2;
overflow: hidden;
overflow: hidden;
margin-bottom: 0.33rem;
//
margin-bottom: 0.33rem;
max-height: 2rem;
max-height: 2rem;
}
}
.product-desc {
.product-desc {
...
@@ -129,7 +123,7 @@ const ProductItemWrap = styled.div`
...
@@ -129,7 +123,7 @@ const ProductItemWrap = styled.div`
font-size: 12px;
font-size: 12px;
font-weight: 400;
font-weight: 400;
color: #999999;
color: #999999;
margin-bottom: 0.1rem;
//
margin-bottom: 0.1rem;
align-items: baseline;
align-items: baseline;
.label {
.label {
width: 60%;
width: 60%;
...
...
src/pages/rent/[main]/[second].tsx
0 → 100644
浏览文件 @
79e21e7c
import
React
from
'react'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
RentView
from
'@/pages/rent/_view'
;
import
{
wrapper
}
from
'@/store'
;
// 分类列表类型
type
CategoryListType
=
InterListType
<
ListBrandInfoType
>
;
// 每次加载页面都会执行
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
(
_store
)
=>
async
()
=>
{
// 分类数据
let
categoryList
:
CategoryListType
=
[];
// 获取各个目录及分类信息
const
getCategoryInfo
=
async
()
=>
{
const
res
=
await
HomeAPI
.
getListBrandInfo
({
pageNo
:
1
,
pageSize
:
999
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
categoryList
=
res
.
result
?.
list
||
[];
}
};
// 依次获取接口数据
await
(
async
()
=>
{
await
Promise
.
all
([
getCategoryInfo
()]);
})();
return
{
props
:
{
categoryList
}
};
},
);
const
RentSecondView
:
React
.
FC
<
{
categoryList
:
CategoryListType
;
}
>
=
(
props
)
=>
<
RentView
{
...
props
}
/>;
export
default
RentSecondView
;
src/pages/rent/[main]/index.tsx
0 → 100644
浏览文件 @
79e21e7c
import
React
from
'react'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
RentView
from
'@/pages/rent/_view'
;
import
{
wrapper
}
from
'@/store'
;
// 分类列表类型
type
CategoryListType
=
InterListType
<
ListBrandInfoType
>
;
// 每次加载页面都会执行
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
(
_store
)
=>
async
()
=>
{
// 分类数据
let
categoryList
:
CategoryListType
=
[];
// 获取各个目录及分类信息
const
getCategoryInfo
=
async
()
=>
{
const
res
=
await
HomeAPI
.
getListBrandInfo
({
pageNo
:
1
,
pageSize
:
999
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
categoryList
=
res
.
result
?.
list
||
[];
}
};
// 依次获取接口数据
await
(
async
()
=>
{
await
Promise
.
all
([
getCategoryInfo
()]);
})();
return
{
props
:
{
categoryList
}
};
},
);
const
RentMainView
:
React
.
FC
<
{
categoryList
:
CategoryListType
;
}
>
=
(
props
)
=>
<
RentView
{
...
props
}
/>;
export
default
RentMainView
;
src/pages/rent/index.tsx
浏览文件 @
79e21e7c
...
@@ -3,11 +3,13 @@ import { HomeAPI } from '@/api';
...
@@ -3,11 +3,13 @@ import { HomeAPI } from '@/api';
import
{
InterListType
}
from
'@/api/interface'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
{
ListBrandInfoType
}
from
'@/api/interface/home'
;
import
RentView
from
'@/pages/rent/_view'
;
import
RentView
from
'@/pages/rent/_view'
;
import
{
wrapper
}
from
'@/store'
;
// 分类列表类型
// 分类列表类型
type
CategoryListType
=
InterListType
<
ListBrandInfoType
>
;
type
CategoryListType
=
InterListType
<
ListBrandInfoType
>
;
// 每次加载页面都会执行
// 每次加载页面都会执行
export
async
function
getServerSideProps
()
{
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
(
_store
)
=>
async
()
=>
{
// 分类数据
// 分类数据
let
categoryList
:
CategoryListType
=
[];
let
categoryList
:
CategoryListType
=
[];
// 获取各个目录及分类信息
// 获取各个目录及分类信息
...
@@ -22,10 +24,11 @@ export async function getServerSideProps() {
...
@@ -22,10 +24,11 @@ export async function getServerSideProps() {
};
};
// 依次获取接口数据
// 依次获取接口数据
await
(
async
()
=>
{
await
(
async
()
=>
{
await
getCategoryInfo
(
);
await
Promise
.
all
([
getCategoryInfo
()]
);
})();
})();
return
{
props
:
{
categoryList
}
};
return
{
props
:
{
categoryList
}
};
}
},
);
const
RentPageView
:
React
.
FC
<
{
const
RentPageView
:
React
.
FC
<
{
categoryList
:
CategoryListType
;
categoryList
:
CategoryListType
;
}
>
=
(
props
)
=>
<
RentView
{
...
props
}
/>;
}
>
=
(
props
)
=>
<
RentView
{
...
props
}
/>;
...
...
src/pages/service/[main]/[second].tsx
浏览文件 @
79e21e7c
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
};
};
// 依次获取接口数据
// 依次获取接口数据
await
(
async
()
=>
{
await
(
async
()
=>
{
await
getIndustryListPages
();
await
Promise
.
all
([
getIndustryListPages
(),
getPriceUnitList
()]);
await
getPriceUnitList
();
})();
})();
return
{
props
:
{
categoryList
}
};
return
{
props
:
{
categoryList
}
};
},
},
...
...
src/pages/service/[main]/index.tsx
浏览文件 @
79e21e7c
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
};
};
// 依次获取接口数据
// 依次获取接口数据
await
(
async
()
=>
{
await
(
async
()
=>
{
await
getIndustryListPages
();
await
Promise
.
all
([
getIndustryListPages
(),
getPriceUnitList
()]);
await
getPriceUnitList
();
})();
})();
return
{
props
:
{
categoryList
}
};
return
{
props
:
{
categoryList
}
};
},
},
...
...
src/pages/service/detail/[id].tsx
浏览文件 @
79e21e7c
...
@@ -53,9 +53,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
...
@@ -53,9 +53,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
};
};
// 依次获取接口数据
// 依次获取接口数据
await
(
async
()
=>
{
await
(
async
()
=>
{
await
getCompanyInspection
();
await
Promise
.
all
([
await
getCompanyInfo
();
getCompanyInspection
(),
await
getPriceUnitList
();
getCompanyInspection
(),
getPriceUnitList
(),
]);
})();
})();
return
{
props
:
{
serviceDetail
,
storeDetail
}
};
return
{
props
:
{
serviceDetail
,
storeDetail
}
};
},
},
...
...
src/pages/service/index.tsx
浏览文件 @
79e21e7c
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
...
@@ -33,8 +33,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
};
};
// 依次获取接口数据
// 依次获取接口数据
await
(
async
()
=>
{
await
(
async
()
=>
{
await
getIndustryListPages
();
await
Promise
.
all
([
getIndustryListPages
(),
getPriceUnitList
()]);
await
getPriceUnitList
();
})();
})();
return
{
props
:
{
categoryList
}
};
return
{
props
:
{
categoryList
}
};
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论