Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
a955d0d5
提交
a955d0d5
authored
5月 19, 2023
作者:
曹云
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.mmcuav.cn:8222/root/sharefly-web-nextjs
into caoyun
上级
e24a6d20
c0c325ce
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
162 行增加
和
104 行删除
+162
-104
request.ts
api/request.ts
+1
-1
index.ts
components/filter/api/index.ts
+9
-44
index.tsx
components/filter/compoents/regionItem/index.tsx
+34
-23
index.tsx
components/filter/index.tsx
+3
-1
next.config.js
next.config.js
+12
-0
index.ts
pages/mall/api/index.ts
+42
-0
index.module.scss
pages/mall/index.module.scss
+27
-22
index.page.tsx
pages/mall/index.page.tsx
+34
-13
没有找到文件。
api/request.ts
浏览文件 @
a955d0d5
...
@@ -18,7 +18,7 @@ export default function request(url: string, method: String = 'get', data?: any)
...
@@ -18,7 +18,7 @@ export default function request(url: string, method: String = 'get', data?: any)
params
.
append
(
key
,
data
[
key
]);
params
.
append
(
key
,
data
[
key
]);
})
})
url
+=
params
;
url
+=
'?'
+
params
;
}
}
break
;
break
;
...
...
components/filter/api/index.ts
浏览文件 @
a955d0d5
...
@@ -5,51 +5,15 @@ export interface FilterOptionResp {
...
@@ -5,51 +5,15 @@ export interface FilterOptionResp {
name
:
string
name
:
string
}
}
export
default
{
export
interface
RegionResp
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
"childInfo"
:
RegionResp
[]
|
null
,
return
request
(
'/pms/webProductMall/category'
);
"id"
:
number
,
},
"level"
:
number
,
brand
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
"name"
:
string
,
return
request
(
'/pms/webDevice/brand'
);
"pid"
:
number
},
model
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/model'
);
},
part
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/parts'
);
},
quality
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/quality'
);
},
region
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/getSecondDistrictInfo'
);
},
}
//商城接口
export
const
mallApi
=
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/category'
);
},
brand
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/brand'
);
},
model
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/model'
);
},
part
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/parts'
);
},
quality
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/quality'
);
},
region
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webDevice/getSecondDistrictInfo'
);
},
}
}
//设备租赁接口
export
default
{
export
const
leasingApi
=
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
category
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/category'
);
return
request
(
'/pms/webProductMall/category'
);
},
},
...
@@ -65,7 +29,7 @@ export const leasingApi = {
...
@@ -65,7 +29,7 @@ export const leasingApi = {
quality
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
quality
:
():
Promise
<
Response
<
Array
<
FilterOptionResp
>>>
=>
{
return
request
(
'/pms/webProductMall/quality'
);
return
request
(
'/pms/webProductMall/quality'
);
},
},
region
:
():
Promise
<
Response
<
Array
<
FilterOpt
ionResp
>>>
=>
{
region
:
():
Promise
<
Response
<
Array
<
Reg
ionResp
>>>
=>
{
return
request
(
'/pms/webDevice/getSecondDistrictInfo'
);
return
request
(
'/pms/webDevice/getSecondDistrictInfo'
);
},
},
}
}
\ No newline at end of file
components/filter/compoents/regionItem/index.tsx
浏览文件 @
a955d0d5
import
{
Space
,
Select
}
from
'antd'
;
import
{
Space
,
Select
}
from
"antd"
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
useState
}
from
"react"
;
import
styles
from
'../../index.module.scss'
;
import
styles
from
"../../index.module.scss"
;
import
api
from
'../../api'
;
import
api
,
{
RegionResp
}
from
"../../api"
;
export
default
function
RegionItem
(){
type
Props
=
{
const
[
productList
,
setProductList
]
=
useState
(
Array
<
{}
>
);
onChange
:
(
item
:
RegionResp
)
=>
void
;
};
export
default
function
RegionItem
(
props
:
Props
)
{
const
[
provinceList
,
setProvinceList
]
=
useState
<
RegionResp
[]
>
([]);
const
[
cityList
,
setCityList
]
=
useState
<
RegionResp
[]
>
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
setProductList
([{},
{},
{},
{},
{},
{}]);
api
.
region
().
then
((
res
)
=>
{
setProvinceList
(
res
?.
result
||
[]);
});
},
[]);
},
[]);
const
onProvinceChange
=
(
value
:
string
)
=>
{
const
onProvinceChange
=
(
value
:
number
,
item
:
any
)
=>
{
console
.
log
(
"省"
,
value
);
console
.
log
(
"省"
,
value
,
item
);
setCityList
(
item
.
childInfo
||
[]);
props
.
onChange
(
item
);
};
};
const
onCityChange
=
(
value
:
string
)
=>
{
const
onCityChange
=
(
value
:
number
,
item
:
any
)
=>
{
console
.
log
(
"市"
,
value
);
console
.
log
(
"市"
,
value
);
props
.
onChange
(
item
);
};
};
return
(
return
(
<
div
className=
{
styles
.
filterItem
}
>
<
div
className=
{
styles
.
filterItem
}
>
...
@@ -27,27 +36,29 @@ export default function RegionItem(){
...
@@ -27,27 +36,29 @@ export default function RegionItem(){
popupMatchSelectWidth=
{
false
}
popupMatchSelectWidth=
{
false
}
placeholder=
"选择省"
placeholder=
"选择省"
onChange=
{
onProvinceChange
}
onChange=
{
onProvinceChange
}
options=
{
[
options=
{
provinceList
.
map
((
item
)
=>
{
{
value
:
"jack"
,
label
:
"Jack"
},
return
{
{
value
:
"lucy"
,
label
:
"Lucy"
},
...
item
,
{
value
:
"Yiminghe"
,
label
:
"yiminghe"
},
value
:
item
.
id
,
{
value
:
"disabled"
,
label
:
"Disabled"
,
disabled
:
true
},
label
:
item
.
name
,
]
}
};
})
}
/>
/>
<
Select
<
Select
bordered=
{
false
}
bordered=
{
false
}
popupMatchSelectWidth=
{
false
}
popupMatchSelectWidth=
{
false
}
placeholder=
"选择市"
placeholder=
"选择市"
onChange=
{
onCityChange
}
onChange=
{
onCityChange
}
options=
{
[
options=
{
cityList
.
map
((
item
)
=>
{
{
value
:
"jack"
,
label
:
"Jack"
},
return
{
{
value
:
"lucy"
,
label
:
"Lucy"
},
...
item
,
{
value
:
"Yiminghe"
,
label
:
"yiminghe"
},
value
:
item
.
id
,
{
value
:
"disabled"
,
label
:
"Disabled"
,
disabled
:
true
},
label
:
item
.
name
,
]
}
};
})
}
/>
/>
</
Space
>
</
Space
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
}
}
components/filter/index.tsx
浏览文件 @
a955d0d5
...
@@ -47,7 +47,9 @@ export default function Filter(props: Props) {
...
@@ -47,7 +47,9 @@ export default function Filter(props: Props) {
marginBottom
:
18
,
marginBottom
:
18
,
}
}
}
}
>
>
<
RegionItem
></
RegionItem
>
<
RegionItem
onChange=
{
(
item
:
FilterOptionResp
)
=>
onChange
(
item
,
"region"
)
}
></
RegionItem
>
</
div
>
</
div
>
)
}
)
}
<
div
className=
{
styles
.
filterWrap
}
>
<
div
className=
{
styles
.
filterWrap
}
>
...
...
next.config.js
浏览文件 @
a955d0d5
...
@@ -19,6 +19,18 @@ const nextConfig = {
...
@@ -19,6 +19,18 @@ const nextConfig = {
},
},
];
];
},
},
images
:
{
remotePatterns
:
[
{
protocol
:
"http"
,
hostname
:
"**"
,
},
{
protocol
:
"https"
,
hostname
:
"**"
,
},
],
},
pageExtensions
:
[
"page.tsx"
,
"page.ts"
,
"page.jsx"
,
"page.js"
],
pageExtensions
:
[
"page.tsx"
,
"page.ts"
,
"page.jsx"
,
"page.js"
],
};
};
...
...
pages/mall/api/index.ts
0 → 100644
浏览文件 @
a955d0d5
import
request
,
{
Response
}
from
'~/api/request'
;
export
interface
ListPageGoodsInfoParams
{
"brandId"
?:
number
,
"districtId"
?:
number
,
"modelId"
?:
number
,
"pageNo"
:
number
,
"pageSize"
:
number
,
"partsId"
?:
number
,
"productCategoryId"
?:
number
,
"qualityId"
?:
number
}
export
interface
Goods
{
"createTime"
:
string
,
"directoryId"
:
number
,
"directoryName"
:
string
,
"goodsName"
:
string
,
"goodsOneLevelTypeName"
:
string
,
"goodsTwoLevelTypeName"
:
string
,
"id"
:
number
,
"imgUrl"
:
string
,
"isCoupons"
:
number
,
"status"
:
number
}
export
interface
ListPageGoodsInfoResp
{
"pageNo"
:
1
,
"pageSize"
:
10
,
"list"
:
Array
<
Goods
>
,
"totalCount"
:
0
,
"totalPage"
:
0
}
export
default
{
//web-商品信息-分页
listPageGoodsInfo
:
(
params
:
ListPageGoodsInfoParams
):
Promise
<
Response
<
ListPageGoodsInfoResp
>>
=>
{
return
request
(
'/pms/webProductMall/listPageGoodsInfo'
,
'post'
,
params
)
}
}
\ No newline at end of file
pages/mall/index.module.scss
浏览文件 @
a955d0d5
@import
"~/styles/mixins.scss"
;
.productList
{
.productList
{
.title
{
.title
{
padding
:
20px
10px
18px
;
padding
:
20px
10px
18px
;
...
@@ -6,37 +8,47 @@
...
@@ -6,37 +8,47 @@
.main
{
.main
{
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
.ad
{
.adList
{
display
:
flex
;
flex-shrink
:
0
;
flex-shrink
:
0
;
width
:
260px
;
flex-direction
:
column
;
height
:
420px
;
gap
:
12px
;
margin-left
:
16px
;
background-color
:
gray
;
.ad
{
width
:
270px
;
height
:
422px
;
background-color
:
#d8d8d8
;
}
}
}
}
}
.listWrap
{
.listWrap
{
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
margin-left
:
-14px
;
gap
:
12px
;
height
:
fit-content
;
.item
{
.item
{
cursor
:
pointer
;
cursor
:
pointer
;
width
:
220px
;
width
:
220px
;
height
:
326
px
;
height
:
205
px
;
background
:
#ffffff
;
background
:
#ffffff
;
border-radius
:
6px
;
border-radius
:
6px
;
margin-bottom
:
15px
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
space-between
;
justify-content
:
space-between
;
padding-bottom
:
18px
;
padding
:
19px
0
18px
;
margin-left
:
14px
;
.img
{
.img
Box
{
width
:
100%
;
width
:
100%
;
height
:
220px
;
text-align
:
center
;
.img
{
width
:
116px
;
height
:
116px
;
}
}
}
.title
{
.title
{
...
@@ -45,21 +57,15 @@
...
@@ -45,21 +57,15 @@
font-family
:
MicrosoftYaHeiUI-Bold
,
MicrosoftYaHeiUI
;
font-family
:
MicrosoftYaHeiUI-Bold
,
MicrosoftYaHeiUI
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#333333
;
color
:
#333333
;
line-height
:
24px
;
@include
ellipsis
(
1
);
height
:
48px
;
display
:
-
webkit-box
;
/* 使用弹性盒子布局 */
-webkit-line-clamp
:
2
;
/* 显示行数 */
-webkit-box-orient
:
vertical
;
/* 垂直排列 */
overflow
:
hidden
;
/* 隐藏溢出部分 */
text-overflow
:
ellipsis
;
/* 使用省略号代替溢出部分 */
}
}
.sellCount
{
.sellCount
{
font-size
:
1
4
px
;
font-size
:
1
2
px
;
font-family
:
MicrosoftYaHei
;
font-family
:
MicrosoftYaHei
;
color
:
#ff552d
;
color
:
#ff552d
;
padding-left
:
20px
;
padding-left
:
20px
;
}
}
}
}
}
}
}
}
\ No newline at end of file
pages/mall/index.page.tsx
浏览文件 @
a955d0d5
...
@@ -3,27 +3,39 @@ import { Button, Select, Space, Tag } from "antd";
...
@@ -3,27 +3,39 @@ import { Button, Select, Space, Tag } from "antd";
import
Layout
from
"~/components/layout"
;
import
Layout
from
"~/components/layout"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useRouter
}
from
"next/router"
;
import
Image
from
'next/image'
;
import
Image
from
"next/image"
;
import
Filter
,
{
FilterResult
}
from
"~/components/filter"
;
import
Filter
,
{
FilterResult
}
from
"~/components/filter"
;
import
{
FilterOptionResp
,
mallApi
}
from
"~/components/filter
/api"
;
import
api
,
{
Goods
}
from
".
/api"
;
// 此函数在构建时被调用
// 此函数在构建时被调用
export
async
function
getServerSideProps
()
{
export
async
function
getServerSideProps
()
{
return
{
return
{
props
:
{
props
:
{},
},
};
};
}
}
type
Props
=
{
type
Props
=
{};
};
export
default
function
Mall
(
props
:
Props
)
{
export
default
function
Mall
(
props
:
Props
)
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
productList
,
setProductList
]
=
useState
(
Array
<
{}
>
);
const
[
productList
,
setProductList
]
=
useState
(
Array
<
Goods
>
);
const
[
filterResult
,
setFilterResult
]
=
useState
<
FilterResult
>
({});
useEffect
(()
=>
{
api
.
listPageGoodsInfo
({
brandId
:
1
,
pageNo
:
1
,
pageSize
:
10
,
})
.
then
((
res
)
=>
{
setProductList
(
res
.
result
?.
list
||
[]);
});
},
[]);
const
onFilterChange
=
(
filterResult
:
FilterResult
)
=>
{
const
onFilterChange
=
(
filterResult
:
FilterResult
)
=>
{
console
.
log
(
'filterResult'
,
filterResult
)
console
.
log
(
"filterResult"
,
filterResult
);
}
}
;
return
(
return
(
<
Layout
>
<
Layout
>
<
div
className=
"page"
style=
{
{
paddingTop
:
"18px"
}
}
>
<
div
className=
"page"
style=
{
{
paddingTop
:
"18px"
}
}
>
...
@@ -43,16 +55,25 @@ export default function Mall(props: Props) {
...
@@ -43,16 +55,25 @@ export default function Mall(props: Props) {
className=
{
styles
.
item
}
className=
{
styles
.
item
}
onClick=
{
()
=>
router
.
push
(
"/mall/detail/1"
)
}
onClick=
{
()
=>
router
.
push
(
"/mall/detail/1"
)
}
>
>
<
Image
alt=
""
src=
""
className=
{
styles
.
img
}
></
Image
>
<
div
className=
{
styles
.
imgBox
}
>
<
div
className=
{
styles
.
title
}
>
<
Image
入云龙ll 1550入云龙ll 1550入云龙ll 1550入云龙ll 1550
alt=
""
src=
{
item
.
imgUrl
}
className=
{
styles
.
img
}
width=
{
116
}
height=
{
116
}
></
Image
>
</
div
>
</
div
>
<
div
className=
{
styles
.
title
}
>
{
item
.
goodsName
}
</
div
>
<
div
className=
{
styles
.
sellCount
}
>
半年售12987
</
div
>
<
div
className=
{
styles
.
sellCount
}
>
半年售12987
</
div
>
</
li
>
</
li
>
);
);
})
}
})
}
</
ul
>
</
ul
>
<
div
className=
{
styles
.
ad
}
></
div
>
<
div
className=
{
styles
.
adList
}
>
<
div
className=
{
styles
.
ad
}
></
div
>
<
div
className=
{
styles
.
ad
}
></
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论