Commit 8f4e2230 authored by GuanHua's avatar GuanHua

fix: 店铺列表的信用排序问题

parent c81985ca
......@@ -192,6 +192,14 @@ export enum FILTER_TYPE {
*/
creditSortLowToHigh = 'creditSortLowToHigh',
/**
* 店铺信用从高到低
*/
shopCreditSortHighToLow = 'shopCreditSortHighToLow',
/**
* 店铺信用从低到高
*/
shopCreditSortLowToHigh = 'shopCreditSortLowToHigh',
/**
* 时间排序
*/
dateSort = 'dateSort',
......
/*
* 活跃店铺
* @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} />
......
......@@ -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.creditSortHighToLow)) {
if (filterList.some(item => item.type === FILTER_TYPE.shopCreditSortHighToLow)) {
onFilter({
key: null,
title: '信用从高到低',
type: FILTER_TYPE.creditSortHighToLow,
type: FILTER_TYPE.shopCreditSortHighToLow,
})
onFilter({
key: 'creditSortLowToHigh',
key: 'shopCreditSortLowToHigh',
title: '信用从低到高',
type: FILTER_TYPE.creditSortLowToHigh,
type: FILTER_TYPE.shopCreditSortLowToHigh,
})
} else if (filterList.some(item => item.type === FILTER_TYPE.creditSortLowToHigh)) {
} else if (filterList.some(item => item.type === FILTER_TYPE.shopCreditSortLowToHigh)) {
onFilter({
key: null,
title: '信用从低到高',
type: FILTER_TYPE.creditSortLowToHigh,
type: FILTER_TYPE.shopCreditSortLowToHigh,
})
onFilter({
key: 'creditSortHighToLow',
key: 'shopCreditSortHighToLow',
title: '信用从高到低',
type: FILTER_TYPE.creditSortHighToLow,
type: FILTER_TYPE.shopCreditSortHighToLow,
})
} else {
onFilter({
key: 'creditSortHighToLow',
key: 'shopCreditSortHighToLow',
title: '信用从高到低',
type: FILTER_TYPE.creditSortHighToLow,
type: FILTER_TYPE.shopCreditSortHighToLow,
})
}
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.creditSortLowToHigh) ? styles.active : '')} />
<CaretDownOutlined className={cx(styles.icon, filterList.some(item => item.type === FILTER_TYPE.creditSortHighToLow) ? styles.active : '')} />
<CaretUpOutlined className={cx(styles.icon, filterList.some(item => item.type === FILTER_TYPE.shopCreditSortLowToHigh) ? styles.active : '')} />
<CaretDownOutlined className={cx(styles.icon, filterList.some(item => item.type === FILTER_TYPE.shopCreditSortHighToLow) ? styles.active : '')} />
</div>
</div>
</div>
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment