Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
Europa-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
32c7bbe2
authored
Jul 22, 2024
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
详情页面修改
parent
5e39c7b1
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
103 additions
and
66 deletions
components/Footer/index.tsx
components/Header/components/NavBig/index.tsx
components/Header/components/SearchH/index.tsx
components/Header/components/TopH/index.tsx
components/ListOneItem/index.tsx
hooks/useSeoTitle.tsx
next.config.mjs
pages/about/index.module.min.css → pages/about.html/index.module.min.css
pages/about/index.module.scss → pages/about.html/index.module.scss
pages/about/index.tsx → pages/about.html/index.tsx
pages/brandMap/index.module.min.css → pages/brands.html/index.module.min.css
pages/brandMap/index.module.scss → pages/brands.html/index.module.scss
pages/brandMap/index.tsx → pages/brands.html/index.tsx
pages/contact/index.module.min.css → pages/contact.html/index.module.min.css
pages/contact/index.module.scss → pages/contact.html/index.module.scss
pages/contact/index.tsx → pages/contact.html/index.tsx
pages/index/components/HomeFloor1.tsx
pages/index/components/HomeFloor2.tsx
pages/index/components/HomeFloor3.tsx
pages/detail/[sku_id].tsx → pages/item/[sku_id].tsx
pages/detail/components/DetailHead.tsx → pages/item/components/DetailHead.tsx
pages/detail/components/DetailSection.tsx → pages/item/components/DetailSection.tsx
pages/detail/index.module.min.css → pages/item/index.module.min.css
pages/detail/index.module.scss → pages/item/index.module.scss
pages/classMap/index.module.min.css → pages/list.html/index.module.min.css
pages/classMap/index.module.scss → pages/list.html/index.module.scss
pages/classMap/index.tsx → pages/list.html/index.tsx
pages/category/[class_id].tsx → pages/list/[class_id].tsx
pages/category/index.module.min.css → pages/list/index.module.min.css
pages/category/index.module.scss → pages/list/index.module.scss
pages/notice/FilterDate.tsx → pages/notice.html/FilterDate.tsx
pages/notice/index.module.min.css → pages/notice.html/index.module.min.css
pages/notice/index.module.scss → pages/notice.html/index.module.scss
pages/notice/index.tsx → pages/notice.html/index.tsx
pages/search/index.tsx → pages/search/[keyword].tsx
server/getDetailData.tsx
types/detailTypes.tsx
components/Footer/index.tsx
View file @
32c7bbe2
...
@@ -10,9 +10,9 @@ const Footer = () => {
...
@@ -10,9 +10,9 @@ const Footer = () => {
<
div
className=
{
`${footerCss.cons} boxsiz row bothSide`
}
>
<
div
className=
{
`${footerCss.cons} boxsiz row bothSide`
}
>
<
img
src=
'/images/qq.png'
alt=
''
className=
{
`${footerCss.img} `
}
/>
<
img
src=
'/images/qq.png'
alt=
''
className=
{
`${footerCss.img} `
}
/>
<
div
className=
{
`${footerCss.navlink} cons boxsiz row bothSide`
}
>
<
div
className=
{
`${footerCss.navlink} cons boxsiz row bothSide`
}
>
<
Link
href=
'/brand
Map
'
>
品牌馆
</
Link
>
<
Link
href=
'/brand
s.html
'
>
品牌馆
</
Link
>
<
Link
href=
'/about'
>
关于我们
</
Link
>
<
Link
href=
'/about
.html
'
>
关于我们
</
Link
>
<
Link
href=
'/contact'
>
联系我们
</
Link
>
<
Link
href=
'/contact
.html
'
>
联系我们
</
Link
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
footerCss
.
footerBot
}
>
<
div
className=
{
footerCss
.
footerBot
}
>
...
...
components/Header/components/NavBig/index.tsx
View file @
32c7bbe2
...
@@ -15,13 +15,13 @@ const NavBig = (props: ResponseTypeCateList) => {
...
@@ -15,13 +15,13 @@ const NavBig = (props: ResponseTypeCateList) => {
url
:
'/'
,
url
:
'/'
,
name
:
'首页'
name
:
'首页'
},
{
},
{
url
:
'/brand
Map
'
,
url
:
'/brand
s.html
'
,
name
:
'品牌馆'
name
:
'品牌馆'
},
{
},
{
url
:
'/about'
,
url
:
'/about
.html
'
,
name
:
'关于我们'
name
:
'关于我们'
},
{
},
{
url
:
'/contact'
,
url
:
'/contact
.html
'
,
name
:
'联系我们'
name
:
'联系我们'
}]
}]
...
@@ -34,7 +34,7 @@ const NavBig = (props: ResponseTypeCateList) => {
...
@@ -34,7 +34,7 @@ const NavBig = (props: ResponseTypeCateList) => {
<
div
className=
{
styles
.
mvNavBig
}
>
<
div
className=
{
styles
.
mvNavBig
}
>
<
div
className=
{
`${styles.navbox} row`
}
>
<
div
className=
{
`${styles.navbox} row`
}
>
<
div
className=
{
styles
.
classBoxs
}
>
<
div
className=
{
styles
.
classBoxs
}
>
<
Link
className=
{
styles
.
titleLc
}
href=
'/
classMap
'
>
查看全部
</
Link
>
<
Link
className=
{
styles
.
titleLc
}
href=
'/
list.html
'
>
查看全部
</
Link
>
<
div
className=
{
router
.
pathname
===
'/'
?
`${styles.boxOneLeft} ${styles.indexPages}`
:
`${styles.boxOneLeft}`
}
>
<
div
className=
{
router
.
pathname
===
'/'
?
`${styles.boxOneLeft} ${styles.indexPages}`
:
`${styles.boxOneLeft}`
}
>
<
div
className=
{
styles
.
classleftcons
}
>
<
div
className=
{
styles
.
classleftcons
}
>
{
{
...
@@ -42,7 +42,7 @@ const NavBig = (props: ResponseTypeCateList) => {
...
@@ -42,7 +42,7 @@ const NavBig = (props: ResponseTypeCateList) => {
return
(
return
(
<
div
className=
{
styles
.
oneClassGroup
}
key=
{
item
.
goods_type_id
}
>
<
div
className=
{
styles
.
oneClassGroup
}
key=
{
item
.
goods_type_id
}
>
<
div
className=
{
styles
.
oneClassLink
}
>
<
div
className=
{
styles
.
oneClassLink
}
>
<
Link
className=
{
styles
.
spann
}
href=
{
`/
category
/${item.goods_type_id}`
}
>
<
Link
className=
{
styles
.
spann
}
href=
{
`/
list
/${item.goods_type_id}`
}
>
<
span
><
i
className=
'icon iconfont icon-sanjiaoxing'
></
i
></
span
>
<
span
><
i
className=
'icon iconfont icon-sanjiaoxing'
></
i
></
span
>
{
item
.
goods_type_name
}
{
item
.
goods_type_name
}
</
Link
>
</
Link
>
...
@@ -52,12 +52,12 @@ const NavBig = (props: ResponseTypeCateList) => {
...
@@ -52,12 +52,12 @@ const NavBig = (props: ResponseTypeCateList) => {
<
div
className=
{
styles
.
classconsjk
}
>
<
div
className=
{
styles
.
classconsjk
}
>
<
div
className=
{
styles
.
twoClassGroup
}
>
<
div
className=
{
styles
.
twoClassGroup
}
>
<
Link
href=
{
`/
category
/${item.goods_type_id}`
}
key=
{
item
.
goods_type_id
}
className=
{
styles
.
twoClassLink
}
>
{
item
.
goods_type_name
}
</
Link
>
<
Link
href=
{
`/
list
/${item.goods_type_id}`
}
key=
{
item
.
goods_type_id
}
className=
{
styles
.
twoClassLink
}
>
{
item
.
goods_type_name
}
</
Link
>
<
div
className=
{
`${styles.threeClassGroup} row`
}
>
<
div
className=
{
`${styles.threeClassGroup} row`
}
>
{
{
(
item
.
child
||
[]).
map
((
itemChild
,
index
)
=>
{
(
item
.
child
||
[]).
map
((
itemChild
,
index
)
=>
{
return
(
return
(
<
Link
key=
{
itemChild
.
goods_type_id
+
index
}
className=
{
styles
.
threeClassLink
}
href=
{
`/
category
/${item.goods_type_id}_${itemChild.goods_type_id}`
}
>
{
itemChild
.
goods_type_name
}
</
Link
>
<
Link
key=
{
itemChild
.
goods_type_id
+
index
}
className=
{
styles
.
threeClassLink
}
href=
{
`/
list
/${item.goods_type_id}_${itemChild.goods_type_id}`
}
>
{
itemChild
.
goods_type_name
}
</
Link
>
)
)
})
})
...
...
components/Header/components/SearchH/index.tsx
View file @
32c7bbe2
...
@@ -12,11 +12,12 @@ const SearchH = () => {
...
@@ -12,11 +12,12 @@ const SearchH = () => {
const
{
query
}
=
router
const
{
query
}
=
router
let
keywords
=
''
let
keywords
=
''
let
nums
=
''
;
let
nums
=
''
;
if
(
router
.
pathname
===
'/search'
){
if
(
router
.
pathname
===
'/search/[keyword]'
){
keywords
=
String
(
query
.
keyword
)
||
''
keywords
=
String
(
query
.
keyword
)
||
''
nums
=
String
(
query
.
num
)
||
''
if
(
query
.
num
){
nums
=
String
(
query
.
num
)
||
''
}
}
}
const
[
key
,
setKey
]
=
useState
<
string
>
(
keywords
)
const
[
key
,
setKey
]
=
useState
<
string
>
(
keywords
)
const
[
num
,
setNum
]
=
useState
<
string
>
(
nums
)
const
[
num
,
setNum
]
=
useState
<
string
>
(
nums
)
...
@@ -30,7 +31,12 @@ const SearchH = () => {
...
@@ -30,7 +31,12 @@ const SearchH = () => {
message
(
"请输入至少2个字符"
)
message
(
"请输入至少2个字符"
)
return
return
}
}
router
.
push
(
`/search?keyword=
${
key
}
&num=
${
num
}
`
)
if
(
num
){
router
.
push
(
`/search/
${
key
}
.html?num=
${
num
}
`
)
}
else
{
router
.
push
(
`/search/
${
key
}
.html`
)
}
}
}
const
changeNum
=
((
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
changeNum
=
((
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
...
...
components/Header/components/TopH/index.tsx
View file @
32c7bbe2
...
@@ -13,11 +13,11 @@ const TopH=()=>{
...
@@ -13,11 +13,11 @@ const TopH=()=>{
<
div
className=
{
`${styles.con} row bothSide verCenter`
}
>
<
div
className=
{
`${styles.con} row bothSide verCenter`
}
>
<
div
></
div
>
<
div
></
div
>
<
div
className=
'row verCenter'
>
<
div
className=
'row verCenter'
>
<
Link
href=
'/about'
>
关于我们
</
Link
>
<
Link
href=
'/about
.html
'
>
关于我们
</
Link
>
<
span
className=
{
styles
.
line
}
></
span
>
<
span
className=
{
styles
.
line
}
></
span
>
<
Link
href=
'/contact'
>
联系我们
</
Link
>
<
Link
href=
'/contact
.html
'
>
联系我们
</
Link
>
<
span
className=
{
styles
.
line
}
></
span
>
<
span
className=
{
styles
.
line
}
></
span
>
<
Link
href=
'/notice'
>
公告
</
Link
>
<
Link
href=
'/notice
.html
'
>
公告
</
Link
>
<
span
className=
{
styles
.
rqq
}
><
QqIcon
/></
span
>
<
span
className=
{
styles
.
rqq
}
><
QqIcon
/></
span
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
components/ListOneItem/index.tsx
View file @
32c7bbe2
...
@@ -15,7 +15,7 @@ const ListOneItem = (props:dataListItemType) => {
...
@@ -15,7 +15,7 @@ const ListOneItem = (props:dataListItemType) => {
<
div
className=
{
styles
.
listGroupOneItem
}
>
<
div
className=
{
styles
.
listGroupOneItem
}
>
<
div
className=
{
`${styles.cons} row`
}
>
<
div
className=
{
`${styles.cons} row`
}
>
<
div
className=
{
styles
.
item
}
>
<
div
className=
{
styles
.
item
}
>
<
Link
href=
{
`/
detail/${itemInfo.goods_id}
`
}
><
img
<
Link
href=
{
`/
item/${itemInfo.goods_id}.html
`
}
><
img
src=
{
itemInfo
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
src=
{
itemInfo
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
className=
{
styles
.
goodsImg
}
alt=
""
className=
{
styles
.
goodsImg
}
alt=
""
onError=
{
(
e
)
=>
{
onError=
{
(
e
)
=>
{
...
@@ -25,7 +25,7 @@ const ListOneItem = (props:dataListItemType) => {
...
@@ -25,7 +25,7 @@ const ListOneItem = (props:dataListItemType) => {
</
Link
>
</
Link
>
</
div
>
</
div
>
<
div
className=
{
`${styles.item} ${styles.w198}`
}
>
<
div
className=
{
`${styles.item} ${styles.w198}`
}
>
<
Link
className=
{
styles
.
goodsName
}
href=
{
`/detail/${itemInfo.goods_id}
`
}
>
{
itemInfo
.
goods_name
}
</
Link
>
<
Link
className=
{
styles
.
goodsName
}
replace
href=
{
`/item/${itemInfo.goods_id}.html
`
}
>
{
itemInfo
.
goods_name
}
</
Link
>
<
p
>
品牌:
{
itemInfo
.
brand_name
}
</
p
>
<
p
>
品牌:
{
itemInfo
.
brand_name
}
</
p
>
<
p
>
参数:
{
itemInfo
.
class_name
}
</
p
>
<
p
>
参数:
{
itemInfo
.
class_name
}
</
p
>
</
div
>
</
div
>
...
...
hooks/useSeoTitle.tsx
View file @
32c7bbe2
...
@@ -6,30 +6,20 @@ export const useSeoTitle = () => {
...
@@ -6,30 +6,20 @@ export const useSeoTitle = () => {
let
titlestr
=
'404'
let
titlestr
=
'404'
const
titleKeywords
:
any
=
{
const
titleKeywords
:
any
=
{
'/'
:
{
title
:
'首页'
},
'/'
:
{
title
:
'首页'
},
'/search'
:
{
title
:
'搜索结果'
},
'/search
/[keyword]
'
:
{
title
:
'搜索结果'
},
'/
detail
'
:
{
title
:
'商品详情'
},
'/
item/[sku_id]
'
:
{
title
:
'商品详情'
},
'/brand
Map
'
:
{
title
:
'品牌馆'
},
'/brand
s.html
'
:
{
title
:
'品牌馆'
},
'/
Brand
'
:
{
title
:
'品牌结果'
},
'/
brand/[brand_id]
'
:
{
title
:
'品牌结果'
},
'/
classMap
'
:
{
title
:
'分类地图'
},
'/
list.html
'
:
{
title
:
'分类地图'
},
'/
category
'
:
{
title
:
'分类结果'
},
'/
list/[class_id]
'
:
{
title
:
'分类结果'
},
'/about'
:
{
title
:
'关于我们'
},
'/about
.html
'
:
{
title
:
'关于我们'
},
'/contact'
:
{
title
:
'联系我们'
},
'/contact
.html
'
:
{
title
:
'联系我们'
},
'/notice'
:
{
title
:
'公告'
},
'/notice
.html
'
:
{
title
:
'公告'
},
}
}
if
(
Object
.
keys
(
titleKeywords
).
indexOf
(
router
.
pathname
)
!==
-
1
)
{
if
(
Object
.
keys
(
titleKeywords
).
indexOf
(
router
.
pathname
)
!==
-
1
)
{
titlestr
=
titleKeywords
[
router
.
pathname
][
'title'
]
titlestr
=
titleKeywords
[
router
.
pathname
][
'title'
]
}
}
if
(
router
.
pathname
.
indexOf
(
'/detail/'
)
!==-
1
){
titlestr
=
'商品详情'
}
if
(
router
.
pathname
.
indexOf
(
'/brand/'
)
!==-
1
){
titlestr
=
'品牌结果'
}
if
(
router
.
pathname
.
indexOf
(
'/category/'
)
!==-
1
){
titlestr
=
'分类结果'
}
return
(
return
(
<
Head
>
<
Head
>
<
title
>
{
`麒麟电子商城-${titlestr}`
}
</
title
>
<
title
>
{
`麒麟电子商城-${titlestr}`
}
</
title
>
...
...
next.config.mjs
View file @
32c7bbe2
...
@@ -6,11 +6,26 @@ const nextConfig = {
...
@@ -6,11 +6,26 @@ const nextConfig = {
reactStrictMode: false, // 关闭 React 严格模式
reactStrictMode: false, // 关闭 React 严格模式
// 配置代理
// 配置代理
async rewrites() {
async rewrites() {
return [{
return [
{
source: '/api/:path*',
source: '/api/:path*',
destination: 'http://erpweb.liexindev.net/api/:path*',
destination: 'http://erpweb.liexindev.net/api/:path*',
}, ];
},
{
source: '/brand/:brand_id.html',
destination: '/brand/:brand_id',
},
{
source: '/item/:sku_id.html',
destination: '/item/:sku_id',
},
{
source: '/search/:keyword.html',
destination: '/search/:keyword',
},
];
},
},
async headers() {
async headers() {
return [
return [
{
{
...
...
pages/about/index.module.min.css
→
pages/about
.html
/index.module.min.css
View file @
32c7bbe2
File moved
pages/about/index.module.scss
→
pages/about
.html
/index.module.scss
View file @
32c7bbe2
File moved
pages/about/index.tsx
→
pages/about
.html
/index.tsx
View file @
32c7bbe2
File moved
pages/brand
Map
/index.module.min.css
→
pages/brand
s.html
/index.module.min.css
View file @
32c7bbe2
File moved
pages/brand
Map
/index.module.scss
→
pages/brand
s.html
/index.module.scss
View file @
32c7bbe2
File moved
pages/brand
Map
/index.tsx
→
pages/brand
s.html
/index.tsx
View file @
32c7bbe2
...
@@ -32,7 +32,7 @@ const BrandMap = (props: { cateList: ResponseTypeCateList, brandMapData: brandMa
...
@@ -32,7 +32,7 @@ const BrandMap = (props: { cateList: ResponseTypeCateList, brandMapData: brandMa
{
{
more_brand_list
.
map
((
item
,
index
)
=>
{
more_brand_list
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Link
href=
{
`/brand/${item.goods_brand_id}`
}
className=
{
styles
.
item
}
key=
{
index
+
String
(
item
.
goods_brand_id
)
}
>
<
Link
href=
{
`/brand/${item.goods_brand_id}
.html
`
}
className=
{
styles
.
item
}
key=
{
index
+
String
(
item
.
goods_brand_id
)
}
>
<
img
src=
{
item
.
brand_logo
}
alt=
{
item
.
brand_name
}
/>
<
img
src=
{
item
.
brand_logo
}
alt=
{
item
.
brand_name
}
/>
</
Link
>
</
Link
>
)
)
...
@@ -51,7 +51,7 @@ const BrandMap = (props: { cateList: ResponseTypeCateList, brandMapData: brandMa
...
@@ -51,7 +51,7 @@ const BrandMap = (props: { cateList: ResponseTypeCateList, brandMapData: brandMa
{
{
popular_brand_list
.
map
((
item
,
index
)
=>
{
popular_brand_list
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Link
href=
{
`/brand/${item.goods_brand_id}`
}
className=
{
styles
.
item
}
key=
{
index
+
String
(
item
.
goods_brand_id
)
}
>
<
Link
href=
{
`/brand/${item.goods_brand_id}
.html
`
}
className=
{
styles
.
item
}
key=
{
index
+
String
(
item
.
goods_brand_id
)
}
>
<
img
src=
{
item
.
brand_logo
}
alt=
{
item
.
brand_name
}
/>
<
img
src=
{
item
.
brand_logo
}
alt=
{
item
.
brand_name
}
/>
</
Link
>
</
Link
>
)
)
...
...
pages/contact/index.module.min.css
→
pages/contact
.html
/index.module.min.css
View file @
32c7bbe2
File moved
pages/contact/index.module.scss
→
pages/contact
.html
/index.module.scss
View file @
32c7bbe2
File moved
pages/contact/index.tsx
→
pages/contact
.html
/index.tsx
View file @
32c7bbe2
File moved
pages/index/components/HomeFloor1.tsx
View file @
32c7bbe2
...
@@ -13,7 +13,7 @@ const HomeFloor1 = (props: ResponseTypeHome) => {
...
@@ -13,7 +13,7 @@ const HomeFloor1 = (props: ResponseTypeHome) => {
{
{
on_sale_list
.
map
(
item
=>
{
on_sale_list
.
map
(
item
=>
{
return
(
return
(
<
Link
href=
{
`/
detail/${item.sku_id}
`
}
key=
{
item
.
sku_id
}
className=
{
`${styles.item} boxsiz row bothSide`
}
>
<
Link
href=
{
`/
item/${item.sku_id}.html
`
}
key=
{
item
.
sku_id
}
className=
{
`${styles.item} boxsiz row bothSide`
}
>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
div
className=
{
`${styles.rt} boxsiz `
}
>
<
div
className=
{
`${styles.rt} boxsiz `
}
>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
...
...
pages/index/components/HomeFloor2.tsx
View file @
32c7bbe2
...
@@ -14,7 +14,7 @@ const HomeFloor2 = (props: ResponseTypeHome) => {
...
@@ -14,7 +14,7 @@ const HomeFloor2 = (props: ResponseTypeHome) => {
{
{
recommend_goods_list
.
map
(
item
=>
{
recommend_goods_list
.
map
(
item
=>
{
return
(
return
(
<
Link
href=
{
`/
detail/${item.sku_id}
`
}
className=
{
`${styles.item} boxsiz`
}
key=
{
item
.
sku_id
}
>
<
Link
href=
{
`/
item/${item.sku_id}.html
`
}
className=
{
`${styles.item} boxsiz`
}
key=
{
item
.
sku_id
}
>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
<
div
className=
'row bothSide'
>
<
div
className=
'row bothSide'
>
...
...
pages/index/components/HomeFloor3.tsx
View file @
32c7bbe2
...
@@ -10,13 +10,13 @@ const HomeFloor3 = (props: ResponseTypeHome) => {
...
@@ -10,13 +10,13 @@ const HomeFloor3 = (props: ResponseTypeHome) => {
<
div
className=
{
`${styles.floor3} boxsiz w1226`
}
>
<
div
className=
{
`${styles.floor3} boxsiz w1226`
}
>
<
div
className=
{
`${styles.title} row bothSide verCenter`
}
>
<
div
className=
{
`${styles.title} row bothSide verCenter`
}
>
<
span
>
推荐品牌
</
span
>
<
span
>
推荐品牌
</
span
>
<
Link
href=
'/brand
Map
'
className=
{
styles
.
more
}
>
更多
<
i
className=
"icon iconfont icon-xiangyou1"
></
i
></
Link
>
<
Link
href=
'/brand
s.html
'
className=
{
styles
.
more
}
>
更多
<
i
className=
"icon iconfont icon-xiangyou1"
></
i
></
Link
>
</
div
>
</
div
>
<
div
className=
{
`${styles.itembox} row bothSide boxsiz`
}
>
<
div
className=
{
`${styles.itembox} row bothSide boxsiz`
}
>
{
{
recommend_brand_list
.
map
(
item
=>
{
recommend_brand_list
.
map
(
item
=>
{
return
(
return
(
<
Link
href=
{
`/brand/${item.goods_brand_id}`
}
className=
{
styles
.
item
}
key=
{
item
.
goods_brand_id
}
>
<
Link
href=
{
`/brand/${item.goods_brand_id}
.html
`
}
className=
{
styles
.
item
}
key=
{
item
.
goods_brand_id
}
>
<
img
src=
{
item
.
brand_logo
}
alt=
""
/>
<
img
src=
{
item
.
brand_logo
}
alt=
""
/>
</
Link
>
</
Link
>
)
)
...
...
pages/
detail
/[sku_id].tsx
→
pages/
item
/[sku_id].tsx
View file @
32c7bbe2
...
@@ -12,16 +12,16 @@ import Header from "@/components/Header";
...
@@ -12,16 +12,16 @@ import Header from "@/components/Header";
import
{
GetServerSideProps
}
from
'next'
;
import
{
GetServerSideProps
}
from
'next'
;
import
{
getDetailData
}
from
"@/server/getDetailData"
;
import
{
getDetailData
}
from
"@/server/getDetailData"
;
import
type
{
ResponseTypeCateList
}
from
'@/components/Header/components/NavBig/types'
import
type
{
ResponseTypeCateList
}
from
'@/components/Header/components/NavBig/types'
import
Link
from
'next/link'
;
export
const
getServerSideProps
:
GetServerSideProps
=
async
(
context
)
=>
{
export
const
getServerSideProps
:
GetServerSideProps
=
async
(
context
)
=>
{
const
{
query
}
=
context
;
const
{
query
}
=
context
;
return
getDetailData
(
query
.
sku_id
)
return
getDetailData
(
String
(
query
.
sku_id
))
}
}
const
Page
=
(
props
:
{
cateList
:
ResponseTypeCateList
,
detailInfoData
:
DetailResponseType
})
=>
{
const
Page
=
(
props
:
{
cateList
:
ResponseTypeCateList
,
detailInfoData
:
DetailResponseType
})
=>
{
const
detailData
=
props
.
detailInfoData
const
detailData
=
props
.
detailInfoData
const
sku_info
:
skuInfoResponseType
=
detailData
.
data
?.
sku_info
const
sku_info
:
skuInfoResponseType
=
detailData
.
data
?.
sku_info
return
(
return
(
...
@@ -34,7 +34,23 @@ const Page = (props: { cateList: ResponseTypeCateList, detailInfoData: DetailRes
...
@@ -34,7 +34,23 @@ const Page = (props: { cateList: ResponseTypeCateList, detailInfoData: DetailRes
{
{
sku_info
?
sku_info
?
<>
<>
<
BreadNav
>
<
strong
>
{
detailData
.
data
?.
sku_info
?.
sku_name
}
</
strong
></
BreadNav
>
<
BreadNav
>
{
sku_info
.
cate_1
&&
<>
<
Link
href=
{
`/list/${sku_info.class_id1}`
}
>
{
sku_info
.
cate_1
}
</
Link
>
<
i
className=
"icon iconfont icon-xiangyou1"
></
i
>
</>
}
{
sku_info
.
cate_2
&&
<>
<
Link
href=
{
`/list/${sku_info.class_id1}_${sku_info.class_id2}`
}
>
{
sku_info
.
cate_2
}
</
Link
>
<
i
className=
"icon iconfont icon-xiangyou1"
></
i
>
</>
}
<
strong
>
{
detailData
.
data
?.
sku_info
?.
sku_name
}
</
strong
>
</
BreadNav
>
<
DetailHead
{
...
sku_info
}
/>
<
DetailHead
{
...
sku_info
}
/>
<
DetailSection
{
...
detailData
}
/>
<
DetailSection
{
...
detailData
}
/>
</>
</>
...
...
pages/
detail
/components/DetailHead.tsx
→
pages/
item
/components/DetailHead.tsx
View file @
32c7bbe2
...
@@ -9,7 +9,6 @@ const DetailHead = (props: skuInfoResponseType) => {
...
@@ -9,7 +9,6 @@ const DetailHead = (props: skuInfoResponseType) => {
const
sku_info
=
props
!
const
sku_info
=
props
!
return
(
return
(
<>
<>
<
div
className=
{
`${styles.detailHeaders} w1226 row bothSide boxsiz`
}
>
<
div
className=
{
`${styles.detailHeaders} w1226 row bothSide boxsiz`
}
>
...
@@ -21,7 +20,11 @@ const DetailHead = (props: skuInfoResponseType) => {
...
@@ -21,7 +20,11 @@ const DetailHead = (props: skuInfoResponseType) => {
<
p
>
品牌:
{
sku_info
.
brand_name
}
</
p
>
<
p
>
品牌:
{
sku_info
.
brand_name
}
</
p
>
<
p
>
商品类别:低压差线性稳压(LDO)
</
p
>
<
p
>
商品类别:低压差线性稳压(LDO)
</
p
>
<
p
>
封装规格:
{
sku_info
.
encap
}
</
p
>
<
p
>
封装规格:
{
sku_info
.
encap
}
</
p
>
<
p
>
描述:
{
sku_info
.
remark
}
</
p
>
{
sku_info
.
remark
&&
<
p
>
描述:
{
sku_info
.
remark
}
</
p
>
}
</
div
>
</
div
>
<
div
className=
{
`${styles.handle} row bothSide verCenter`
}
>
<
div
className=
{
`${styles.handle} row bothSide verCenter`
}
>
<
QqIcon
/>
<
QqIcon
/>
...
@@ -46,7 +49,7 @@ const DetailHead = (props: skuInfoResponseType) => {
...
@@ -46,7 +49,7 @@ const DetailHead = (props: skuInfoResponseType) => {
(
sku_info
.
ladder_price
||
[]).
map
((
item
,
index
)
=>
{
(
sku_info
.
ladder_price
||
[]).
map
((
item
,
index
)
=>
{
return
(
return
(
<
p
className=
'row'
key=
{
index
}
>
<
p
className=
'row'
key=
{
index
}
>
<
span
className=
{
styles
.
items
}
>
{
item
.
purchase
}
+
</
span
>
<
span
className=
{
styles
.
items
}
>
{
item
.
purchase
s
}
+
</
span
>
<
span
className=
{
`${styles.items} row`
}
><
span
>
¥
{
item
.
price_cn
||
0
}
</
span
><
span
>
$
{
item
.
price_us
||
0
}
</
span
></
span
>
<
span
className=
{
`${styles.items} row`
}
><
span
>
¥
{
item
.
price_cn
||
0
}
</
span
><
span
>
$
{
item
.
price_us
||
0
}
</
span
></
span
>
</
p
>
</
p
>
)
)
...
...
pages/
detail
/components/DetailSection.tsx
→
pages/
item
/components/DetailSection.tsx
View file @
32c7bbe2
...
@@ -45,7 +45,7 @@ const DetailSection = (props: DetailResponseType) => {
...
@@ -45,7 +45,7 @@ const DetailSection = (props: DetailResponseType) => {
{
{
other_sku_list
.
map
(
item
=>
{
other_sku_list
.
map
(
item
=>
{
return
(
return
(
<
Link
href=
{
`/
detail/${item.sku_id}
`
}
className=
{
`${styles.item} boxsiz`
}
key=
{
item
.
sku_id
}
>
<
Link
href=
{
`/
item/${item.sku_id}.html
`
}
className=
{
`${styles.item} boxsiz`
}
key=
{
item
.
sku_id
}
>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
img
src=
{
item
.
goods_images
||
'http://static.ichunt.com//dist/res/home/images/goods_default.png'
}
alt=
""
/>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
<
div
className=
{
styles
.
gos
}
>
{
item
.
sku_name
}
</
div
>
<
div
className=
'row bothSide'
>
<
div
className=
'row bothSide'
>
...
...
pages/
detail
/index.module.min.css
→
pages/
item
/index.module.min.css
View file @
32c7bbe2
File moved
pages/
detail
/index.module.scss
→
pages/
item
/index.module.scss
View file @
32c7bbe2
File moved
pages/
classMap
/index.module.min.css
→
pages/
list.html
/index.module.min.css
View file @
32c7bbe2
File moved
pages/
classMap
/index.module.scss
→
pages/
list.html
/index.module.scss
View file @
32c7bbe2
File moved
pages/
classMap
/index.tsx
→
pages/
list.html
/index.tsx
View file @
32c7bbe2
...
@@ -28,12 +28,12 @@ const Page = (props: { cateList: ResponseTypeCateList, classMapData: classMapRes
...
@@ -28,12 +28,12 @@ const Page = (props: { cateList: ResponseTypeCateList, classMapData: classMapRes
list
.
map
((
item
,
index
)
=>
{
list
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
div
className=
{
`${styles.itembox} boxsiz`
}
key=
{
String
(
item
.
goods_type_id
)
+
index
}
>
<
div
className=
{
`${styles.itembox} boxsiz`
}
key=
{
String
(
item
.
goods_type_id
)
+
index
}
>
<
Link
href=
{
`/
category
/${item.goods_type_id}`
}
className=
{
styles
.
itemtitle
}
>
{
item
.
goods_type_name
}
</
Link
>
<
Link
href=
{
`/
list
/${item.goods_type_id}`
}
className=
{
styles
.
itemtitle
}
>
{
item
.
goods_type_name
}
</
Link
>
<
div
className=
{
`${styles.itemcons} flex`
}
>
<
div
className=
{
`${styles.itemcons} flex`
}
>
{
{
(
item
.
child
||
[]).
map
((
itemChild
,
indexChild
)
=>
{
(
item
.
child
||
[]).
map
((
itemChild
,
indexChild
)
=>
{
return
(
return
(
<
Link
key=
{
String
(
itemChild
.
goods_type_id
)
+
indexChild
}
href=
{
`/
category
/${item.goods_type_id}_${itemChild.goods_type_id}`
}
className=
{
styles
.
itemlink
}
>
{
itemChild
.
goods_type_name
}
</
Link
>
<
Link
key=
{
String
(
itemChild
.
goods_type_id
)
+
indexChild
}
href=
{
`/
list
/${item.goods_type_id}_${itemChild.goods_type_id}`
}
className=
{
styles
.
itemlink
}
>
{
itemChild
.
goods_type_name
}
</
Link
>
)
)
})
})
}
}
...
...
pages/
category
/[class_id].tsx
→
pages/
list
/[class_id].tsx
View file @
32c7bbe2
File moved
pages/
category
/index.module.min.css
→
pages/
list
/index.module.min.css
View file @
32c7bbe2
File moved
pages/
category
/index.module.scss
→
pages/
list
/index.module.scss
View file @
32c7bbe2
File moved
pages/notice/FilterDate.tsx
→
pages/notice
.html
/FilterDate.tsx
View file @
32c7bbe2
File moved
pages/notice/index.module.min.css
→
pages/notice
.html
/index.module.min.css
View file @
32c7bbe2
File moved
pages/notice/index.module.scss
→
pages/notice
.html
/index.module.scss
View file @
32c7bbe2
File moved
pages/notice/index.tsx
→
pages/notice
.html
/index.tsx
View file @
32c7bbe2
File moved
pages/search/
index
.tsx
→
pages/search/
[keyword]
.tsx
View file @
32c7bbe2
...
@@ -34,7 +34,6 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -34,7 +34,6 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
const
num
=
router
.
query
.
num
||
''
;
const
num
=
router
.
query
.
num
||
''
;
const
{
request
:
getListRequest
}
=
useRequest
<
ResponseTypeSearch
>
({
manual
:
true
})
const
{
request
:
getListRequest
}
=
useRequest
<
ResponseTypeSearch
>
({
manual
:
true
})
const
initSupplierList
=
useRef
<
supplierDataType
[]
>
([])
//初始化数据
const
initSupplierList
=
useRef
<
supplierDataType
[]
>
([])
//初始化数据
...
@@ -44,7 +43,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -44,7 +43,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
initSupplierList
.
current
=
[]
initSupplierList
.
current
=
[]
requestCount
.
current
=
0
requestCount
.
current
=
0
supplierIdS
.
forEach
(
supplier_id
=>
{
supplierIdS
.
forEach
(
supplier_id
=>
{
getListRequest
({
url
:
'/api/search/goodsSearch'
,
method
:
'post'
,
data
:
{
keyword
:
keyword
,
num
:
num
,
supplier_id
:
supplier_id
}
}).
then
((
res
)
=>
{
getListRequest
({
url
:
'/api/search/goodsSearch'
,
method
:
'post'
,
data
:
{
keyword
:
keyword
,
num
:
num
,
supplier_id
:
supplier_id
,
page
:
1
,
page_size
:
10
}
}).
then
((
res
)
=>
{
requestCount
.
current
=
requestCount
.
current
+
1
requestCount
.
current
=
requestCount
.
current
+
1
if
(
res
?.
code
===
0
)
{
if
(
res
?.
code
===
0
)
{
initSupplierList
.
current
=
[...
initSupplierList
.
current
,
...(
res
.
data
||
[])]
initSupplierList
.
current
=
[...
initSupplierList
.
current
,
...(
res
.
data
||
[])]
...
@@ -108,14 +107,16 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -108,14 +107,16 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
<
Header
{
...
props
.
cateList
}
/>
<
Header
{
...
props
.
cateList
}
/>
<
BreadNav
><
strong
>
"
{
keyword
}
"
的型号搜索结果
</
strong
></
BreadNav
>
<
BreadNav
><
strong
>
"
{
keyword
}
"
的型号搜索结果
</
strong
></
BreadNav
>
<
div
className=
{
`${styles.mvSearchPage} w1226`
}
>
<
div
className=
{
`${styles.mvSearchPage} w1226`
}
>
<
div
className=
{
styles
.
shiftBox
}
>
{
initSupplierList
.
current
.
length
>
0
&&
<
div
className=
{
styles
.
shiftBox
}
>
<
div
className=
{
`${styles.shiftGroup} row`
}
>
<
div
className=
{
`${styles.shiftGroup} row`
}
>
<
span
>
品牌:
</
span
>
<
span
>
品牌:
</
span
>
<
div
className=
{
brandListAll
?
`${styles.itemBox} row`
:
`${styles.itemBox} row ${styles.overflowheight}`
}
ref=
{
brandListRef
}
>
<
div
className=
{
brandListAll
?
`${styles.itemBox} row`
:
`${styles.itemBox} row ${styles.overflowheight}`
}
ref=
{
brandListRef
}
>
{
{
brandsR
.
map
(
item
=>
{
brandsR
.
map
(
item
=>
{
return
(
return
(
<
div
key=
{
item
.
id
}
onClick=
{
()
=>
{
updateBrandAndClass
(
1
,
item
.
id
)
}
}
className=
{
item
.
checked
?
`${styles.item} act`
:
`${styles.item}`
}
>
{
item
.
value
}
</
div
>
<
div
key=
{
item
.
id
+
Math
.
random
()
}
onClick=
{
()
=>
{
updateBrandAndClass
(
1
,
item
.
id
)
}
}
className=
{
item
.
checked
?
`${styles.item} act`
:
`${styles.item}`
}
>
{
item
.
value
}
</
div
>
)
)
})
})
}
}
...
@@ -134,7 +135,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -134,7 +135,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
{
{
classsR
.
map
(
item
=>
{
classsR
.
map
(
item
=>
{
return
(
return
(
<
div
onClick=
{
()
=>
{
updateBrandAndClass
(
2
,
item
.
id
)
}
}
key=
{
item
.
id
}
className=
{
item
.
checked
?
`${styles.item} act`
:
`${styles.item}`
}
>
{
item
.
value
}
</
div
>
<
div
onClick=
{
()
=>
{
updateBrandAndClass
(
2
,
item
.
id
)
}
}
key=
{
item
.
id
+
Math
.
random
()
}
className=
{
item
.
checked
?
`${styles.item} act`
:
`${styles.item}`
}
>
{
item
.
value
}
</
div
>
)
)
})
})
}
}
...
@@ -147,6 +148,8 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -147,6 +148,8 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
}
<
div
className=
{
styles
.
databox
}
>
<
div
className=
{
styles
.
databox
}
>
<
ListSort
sortObj=
{
sortObj
}
setSortObj=
{
setSortObj
}
/>
<
ListSort
sortObj=
{
sortObj
}
setSortObj=
{
setSortObj
}
/>
{
{
...
@@ -160,7 +163,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
...
@@ -160,7 +163,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
{
{
item
.
data
.
map
(
child
=>
{
item
.
data
.
map
(
child
=>
{
return
(
return
(
<
ListOneItem
key=
{
child
.
goods_id
}
{
...
child
}
/>
<
ListOneItem
key=
{
child
.
goods_id
+
Math
.
random
()
}
{
...
child
}
/>
)
)
})
})
}
}
...
...
server/getDetailData.tsx
View file @
32c7bbe2
import
{
API_URL
}
from
'../configReact'
import
{
API_URL
}
from
'../configReact'
export
async
function
getDetailData
(
sku_id
?:
string
|
string
[]
|
undefined
)
{
export
async
function
getDetailData
(
sku_id
?:
string
)
{
// 数据获取逻辑
// 数据获取逻辑
// 在这里进行异步数据获取
// 在这里进行异步数据获取
const
res
=
await
fetch
(
API_URL
+
'/api/home/getCateList'
);
const
res
=
await
fetch
(
API_URL
+
'/api/home/getCateList'
);
const
res2
=
await
fetch
(
API_URL
+
'/api/goodsSku/getGoodsSkuDetail?sku_id='
+
sku_id
);
const
res2
=
await
fetch
(
API_URL
+
'/api/goodsSku/getGoodsSkuDetail?sku_id='
+
sku_id
?.
split
(
"."
)[
0
]
);
const
[
cateList
,
detailInfoData
]
=
await
Promise
.
all
([
const
[
cateList
,
detailInfoData
]
=
await
Promise
.
all
([
res
.
json
(),
res
.
json
(),
res2
.
json
()
res2
.
json
()
...
...
types/detailTypes.tsx
View file @
32c7bbe2
...
@@ -19,6 +19,10 @@ export type skuInfoResponseType = {
...
@@ -19,6 +19,10 @@ export type skuInfoResponseType = {
encap
:
string
,
encap
:
string
,
batch_sn
:
string
,
batch_sn
:
string
,
remark
:
string
,
remark
:
string
,
cate_1
:
string
,
cate_2
:
string
,
class_id1
?:
string
,
class_id2
?:
string
,
goods_type_name
:
string
,
goods_type_name
:
string
,
moq
:
number
,
moq
:
number
,
multiple
:
number
,
multiple
:
number
,
...
@@ -30,7 +34,7 @@ export type skuInfoResponseType = {
...
@@ -30,7 +34,7 @@ export type skuInfoResponseType = {
ladder_price
:
Array
<
{
ladder_price
:
Array
<
{
price_cn
:
number
,
price_cn
:
number
,
price_us
:
number
,
price_us
:
number
,
purchase
:
number
purchase
s
:
number
}
>
}
>
}
|
undefined
|
null
}
|
undefined
|
null
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment