Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
8f4e2230
Commit
8f4e2230
authored
Dec 30, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 店铺列表的信用排序问题
parent
c81985ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
16 deletions
+30
-16
index.ts
src/constants/index.ts
+8
-0
index.tsx
...xMall/components/Filter/components/ActiveStores/index.tsx
+3
-3
index.tsx
src/pages/lxMall/shopList/index.tsx
+13
-13
index.ts
src/store/filter/index.ts
+6
-0
No files found.
src/constants/index.ts
View file @
8f4e2230
...
...
@@ -192,6 +192,14 @@ export enum FILTER_TYPE {
*/
creditSortLowToHigh
=
'creditSortLowToHigh'
,
/**
* 店铺信用从高到低
*/
shopCreditSortHighToLow
=
'shopCreditSortHighToLow'
,
/**
* 店铺信用从低到高
*/
shopCreditSortLowToHigh
=
'shopCreditSortLowToHigh'
,
/**
* 时间排序
*/
dateSort
=
'dateSort'
,
...
...
src/pages/lxMall/components/Filter/components/ActiveStores/index.tsx
View file @
8f4e2230
/*
* 活跃店铺
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-11-04 10:23:59
*/
...
...
@@ -40,7 +40,7 @@ const ActiveStores: React.FC<ActiveStoresPropsType> = (props) => {
<
div
className=
{
styles
.
active_stores_list
}
>
{
shopList
&&
shopList
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
active_stores_list_item
}
>
<
div
className=
{
styles
.
active_stores_list_item
}
key=
{
item
.
memberShopId
}
>
<
div
className=
{
styles
.
active_stores_rank
}
>
0
{
index
+
1
}
</
div
>
<
div
className=
{
styles
.
active_stores_logo
}
>
<
ImageBox
width=
{
36
}
height=
{
36
}
imgUrl=
{
item
.
memberLogo
}
/>
...
...
src/pages/lxMall/shopList/index.tsx
View file @
8f4e2230
...
...
@@ -28,7 +28,6 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
shopList
,
setShopList
]
=
useState
<
GetTemplateWebMemberShopWebMemberShopListResponseDetail
[]
>
([])
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
//FILTER_TYPE.activeStores,
const
filterConfig
=
[
FILTER_TYPE
.
category
,
FILTER_TYPE
.
useArea
,
FILTER_TYPE
.
activeStores
,
FILTER_TYPE
.
newJoin
]
useEffect
(()
=>
{
...
...
@@ -37,6 +36,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
},
[
filterParam
,
search
])
useEffect
(()
=>
{
console
.
log
(
JSON
.
stringify
(
filterList
),
"filterList"
)
if
(
!
isEmpty
(
filterList
)
||
filterUpdate
)
{
handleFilterChange
(
filterList
)
}
...
...
@@ -96,33 +96,33 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
/**
* 判断当前筛选项是否含有信用排序的筛选
*/
if
(
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
c
reditSortHighToLow
))
{
if
(
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
shopC
reditSortHighToLow
))
{
onFilter
({
key
:
null
,
title
:
'信用从高到低'
,
type
:
FILTER_TYPE
.
c
reditSortHighToLow
,
type
:
FILTER_TYPE
.
shopC
reditSortHighToLow
,
})
onFilter
({
key
:
'
c
reditSortLowToHigh'
,
key
:
'
shopC
reditSortLowToHigh'
,
title
:
'信用从低到高'
,
type
:
FILTER_TYPE
.
c
reditSortLowToHigh
,
type
:
FILTER_TYPE
.
shopC
reditSortLowToHigh
,
})
}
else
if
(
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
c
reditSortLowToHigh
))
{
}
else
if
(
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
shopC
reditSortLowToHigh
))
{
onFilter
({
key
:
null
,
title
:
'信用从低到高'
,
type
:
FILTER_TYPE
.
c
reditSortLowToHigh
,
type
:
FILTER_TYPE
.
shopC
reditSortLowToHigh
,
})
onFilter
({
key
:
'
c
reditSortHighToLow'
,
key
:
'
shopC
reditSortHighToLow'
,
title
:
'信用从高到低'
,
type
:
FILTER_TYPE
.
c
reditSortHighToLow
,
type
:
FILTER_TYPE
.
shopC
reditSortHighToLow
,
})
}
else
{
onFilter
({
key
:
'
c
reditSortHighToLow'
,
key
:
'
shopC
reditSortHighToLow'
,
title
:
'信用从高到低'
,
type
:
FILTER_TYPE
.
c
reditSortHighToLow
,
type
:
FILTER_TYPE
.
shopC
reditSortHighToLow
,
})
}
break
...
...
@@ -155,8 +155,8 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
<
div
className=
{
styles
.
tool_bar_filter_item
}
onClick=
{
()
=>
handleSort
(
FILTER_TYPE
.
creditSort
)
}
>
<
span
>
信用
</
span
>
<
div
className=
{
styles
.
price_filter_box
}
>
<
CaretUpOutlined
className=
{
cx
(
styles
.
icon
,
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
c
reditSortLowToHigh
)
?
styles
.
active
:
''
)
}
/>
<
CaretDownOutlined
className=
{
cx
(
styles
.
icon
,
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
c
reditSortHighToLow
)
?
styles
.
active
:
''
)
}
/>
<
CaretUpOutlined
className=
{
cx
(
styles
.
icon
,
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
shopC
reditSortLowToHigh
)
?
styles
.
active
:
''
)
}
/>
<
CaretDownOutlined
className=
{
cx
(
styles
.
icon
,
filterList
.
some
(
item
=>
item
.
type
===
FILTER_TYPE
.
shopC
reditSortHighToLow
)
?
styles
.
active
:
''
)
}
/>
</
div
>
</
div
>
</
div
>
...
...
src/store/filter/index.ts
View file @
8f4e2230
...
...
@@ -205,6 +205,12 @@ class FilterStore {
case
FILTER_TYPE
.
creditSortHighToLow
:
tempFilterParam
.
sortCredit
=
2
break
case
FILTER_TYPE
.
shopCreditSortLowToHigh
:
tempFilterParam
.
sortCreditPoint
=
'ASC'
break
case
FILTER_TYPE
.
shopCreditSortHighToLow
:
tempFilterParam
.
sortCreditPoint
=
'DESC'
break
case
FILTER_TYPE
.
dateSortLowToHigh
:
tempFilterParam
.
sortTime
=
1
break
...
...
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