Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
bce05ae1
提交
bce05ae1
authored
12月 08, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:样式优化
上级
8aab40f5
流水线
#7454
已通过 于阶段
in 4 分 53 秒
变更
7
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
39 行增加
和
15 行删除
+39
-15
index.tsx
src/components/home-comp/home-product/index.tsx
+12
-1
index.tsx
src/components/home-comp/home-title/index.tsx
+13
-2
index.tsx
src/components/product-comp/product-head/index.tsx
+4
-4
index.tsx
src/components/product-comp/product-store/index.tsx
+1
-1
index.tsx
src/pages/home/index.tsx
+1
-1
[id].tsx
src/pages/mall/product/[id].tsx
+7
-5
styled.tsx
src/pages/mall/product/styled.tsx
+1
-1
没有找到文件。
src/components/home-comp/home-product/index.tsx
浏览文件 @
bce05ae1
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
useRouter
}
from
'next/router'
;
import
styled
from
'styled-components'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterDataType
}
from
'@/api/interface'
;
...
...
@@ -8,6 +9,8 @@ import { RecommendGoodsType } from '@/api/interface/home';
type
ListType
=
InterDataType
<
RecommendGoodsType
>
;
const
HomeProductView
=
()
=>
{
// 路由钩子
const
router
=
useRouter
();
// 推荐商品列表
const
[
recommendGoodsList
,
setRecommendGoodsList
]
=
useState
<
ListType
[
0
][
'mallGoodsList'
]
...
...
@@ -33,6 +36,10 @@ const HomeProductView = () => {
).
salePrice
||
0
);
};
// 跳转详情
const
handleDetail
=
async
(
item
:
ListType
[
0
][
'mallGoodsList'
][
0
])
=>
{
await
router
.
push
(
`/mall/product/
${
item
.
id
}
`
);
};
// 组件挂载
useEffect
(()
=>
{
getRecommendGoodsList
().
then
();
...
...
@@ -40,7 +47,11 @@ const HomeProductView = () => {
return
(
<
HomeProductWrap
>
{
recommendGoodsList
?.
map
((
i
,
j
)
=>
(
<
div
className=
"product-item flex-start"
key=
{
j
}
>
<
div
className=
"product-item flex-start"
key=
{
j
}
onClick=
{
()
=>
handleDetail
(
i
)
}
>
<
img
className=
"item-image"
src=
{
`${i.resourcesList[0].url}?x-oss-process=image/quality,q_25`
}
...
...
src/components/home-comp/home-title/index.tsx
浏览文件 @
bce05ae1
import
React
from
'react'
;
import
{
RightOutlined
}
from
'@ant-design/icons'
;
import
{
useRouter
}
from
'next/router'
;
import
styled
from
'styled-components'
;
const
HomeTitleView
=
({
title
}:
{
title
:
string
})
=>
{
const
HomeTitleView
:
React
.
FC
<
{
title
:
string
;
path
?:
string
}
>
=
({
title
,
path
,
})
=>
{
// 路由钩子
const
router
=
useRouter
();
// 跳转详情
const
handleDetail
=
async
()
=>
{
if
(
!
path
)
return
;
await
router
.
push
(
path
);
};
return
(
<
HomeTitleWrap
>
<
HomeTitleWrap
onClick=
{
handleDetail
}
>
<
div
className=
"title-text"
>
{
title
}
</
div
>
<
div
className=
"title-more flex-start"
>
<
div
className=
"more-text"
>
更多
</
div
>
...
...
src/components/product-comp/product-head/index.tsx
浏览文件 @
bce05ae1
...
...
@@ -91,7 +91,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
useEffect
(()
=>
{
if
(
!
detail
)
return
;
getLowerSpec
();
console
.
log
(
'detail --->'
,
detail
);
//
console.log('detail --->', detail);
},
[
detail
]);
return
(
<
ProductHeadWrap
>
...
...
@@ -190,9 +190,9 @@ const ProductHeadWrap = styled.div`
box-sizing: border-box;
margin-right: 0.83rem;
display: flex;
align-items:
center
;
align-items:
flex-start
;
justify-content: flex-start;
padding:
0
1rem;
padding:
2rem 1rem 2rem
1rem;
.product-swiper {
position: relative;
width: 22rem;
...
...
@@ -204,7 +204,7 @@ const ProductHeadWrap = styled.div`
width: calc(100% - 22rem);
height: 100%;
box-sizing: border-box;
padding:
1rem 0 1rem
1rem;
padding:
0 0 0
1rem;
//background: lightblue;
.content-title {
width: 100%;
...
...
src/components/product-comp/product-store/index.tsx
浏览文件 @
bce05ae1
...
...
@@ -50,7 +50,7 @@ const ProductStoreView: React.FC<{ detail: DetailType; store: StoreType }> = ({
<
PhoneOutlined
style=
{
{
color
:
'#FF552D'
,
transform
:
'rotateY(180deg)'
}
}
/>
<
div
className=
"text"
>
进店逛逛
</
div
>
<
div
className=
"text"
>
联系方式
</
div
>
</
div
>
</
div
>
</
ProductStoreWrap
>
...
...
src/pages/home/index.tsx
浏览文件 @
bce05ae1
...
...
@@ -42,7 +42,7 @@ const HomeView = () => {
{
/* 品牌企业 */
}
<
HomeBrandView
/>
{
/* 大家都在买 */
}
<
HomeTitleView
title=
"大家都在买"
/>
<
HomeTitleView
title=
"大家都在买"
path=
"/mall"
/>
{
/* 推荐商品 */
}
<
HomeProductView
/>
{
/* 无人机服务 */
}
...
...
src/pages/mall/product/[id].tsx
浏览文件 @
bce05ae1
...
...
@@ -66,11 +66,13 @@ const MallProductView: React.FC<{
<
ProductStoreView
detail=
{
productDetail
}
store=
{
storeDetail
}
/>
</
div
>
<
div
className=
"product-title"
>
商品详情
</
div
>
<
div
className=
"product-content"
>
<
div
className=
"content-html"
dangerouslySetInnerHTML=
{
{
__html
:
productDetail
?.
goodsDetails
}
}
/>
<
div
className=
"product-richText"
>
{
productDetail
?.
goodsDetails
&&
(
<
div
className=
"content-html"
dangerouslySetInnerHTML=
{
{
__html
:
productDetail
?.
goodsDetails
}
}
/>
)
}
</
div
>
</
ProductWrap
>
</
LayoutView
>
...
...
src/pages/mall/product/styled.tsx
浏览文件 @
bce05ae1
...
...
@@ -33,7 +33,7 @@ export const ProductWrap = styled.div`
right: 40%;
}
}
.product-
conten
t {
.product-
richTex
t {
position: relative;
width: 100%;
margin-bottom: 3.5rem;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论