Commit babfb93a authored by GuanHua's avatar GuanHua

fix: 修改在线求购接口筛选参数

parent 8a0f5775
......@@ -52,7 +52,7 @@
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
"god": "0.2.4",
"god": "^0.2.4",
"immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.8",
"lingxi-design-ui": "^1.1.16",
......@@ -92,8 +92,8 @@
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"god-upload-scp": "^1.2.0",
"god-yapi2ts": "1.9.0",
"god-upload-scp": "1.0.1",
"god-yapi2ts": "^1.0.0",
"gulp": "^4.0.2",
"gulp-git": "^2.10.1",
"http-proxy-middleware": "^1.0.5",
......
......@@ -58,7 +58,11 @@ export enum LAYOUT_TYPE {
/**
* 店铺列表
*/
shopList = 'shopList'
shopList = 'shopList',
/**
* 在线求购
*/
purchaseOnline = 'purchaseOnline'
}
// 本地环境跳过权限校验
......@@ -84,6 +88,10 @@ export enum FILTER_TYPE {
*/
category = 'category',
/**
* 分类名称
*/
categoryName = 'categoryName',
/**
* 会员品类
*/
customerCategory = 'customerCategory',
......
......@@ -67,6 +67,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
*/
switch (layoutType) {
case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.purchaseOnline:
getCategoryListFn = PublicApi.getSearchShopEnterpriseGetCategoryTree
break
case LAYOUT_TYPE.shop:
......@@ -216,6 +217,13 @@ const Category: React.FC<CategoryPropsType> = (props) => {
title: typeof title === 'string' ? title : name
})
break
case LAYOUT_TYPE.purchaseOnline:
onFilter({
type: FILTER_TYPE.categoryName,
key: typeof title === 'string' ? title : name,
title: typeof title === 'string' ? title : name
})
break
default:
onFilter({
type: FILTER_TYPE.customerCategory,
......
......@@ -14,8 +14,7 @@ interface UseAreaPropsType {
memberId?: number;
}
interface useAreaType {
interface UseAreaType {
/**
* 省份名称
*/
......@@ -42,16 +41,16 @@ interface useAreaType {
const UseArea: React.FC<UseAreaPropsType> = (props) => {
const { layoutType = LAYOUT_TYPE.mall, shopId, memberId } = props
const { onFilter, filterList } = props.FilterStore
const [areaList, setAreaList] = useState<useAreaType[]>([])
const [areaList, setAreaList] = useState<UseAreaType[]>([])
const [selectCity, setSelectCity] = useState<string[]>([])
useEffect(() => {
if (isEmpty(filterList)) {
setSelectCity([])
} else {
let initKeys = []
const initKeys = []
if (layoutType !== LAYOUT_TYPE.shopList) {
for (let item of filterList) {
for (const item of filterList) {
if (item.type === FILTER_TYPE.province) {
initKeys.push(item.key)
} else if (item.type === FILTER_TYPE.city) {
......@@ -65,11 +64,12 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
useEffect(() => {
let getAreaFn
let param: any = {}
const param: any = {}
let headers = {}
switch (layoutType) {
case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.shopList:
case LAYOUT_TYPE.purchaseOnline:
getAreaFn = PublicApi.getSearchShopEnterpriseGetArea
break
case LAYOUT_TYPE.shop:
......@@ -106,12 +106,12 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
}, [layoutType])
const initAreaData = (data: GetSearchShopEnterpriseGetAreaResponse) => {
if (!!data) {
if (data) {
return data.map(item => {
return {
label: item.provinceName,
value: item.provinceCode,
children: !!item.cityList ? item.cityList.map(childItem => {
children: item.cityList ? item.cityList.map(childItem => {
return {
label: childItem.cityName,
value: childItem.cityCode,
......@@ -171,7 +171,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
const getProvinceText = (code: string) => {
let result = ""
for (let item of areaList) {
for (const item of areaList) {
if (item.value === code) {
result = item.label
}
......
import React, { useState, useEffect } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons'
import Filter from '../components/Filter'
import { FILTER_TYPE } from '@/constants'
import { FILTER_TYPE, LAYOUT_TYPE } from '@/constants'
import cx from 'classnames'
import SearchNoResult from '../components/SearchNoResult'
import { Pagination, message } from 'antd'
......@@ -10,7 +10,6 @@ import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import isEmpty from 'lodash/isEmpty'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { GetOrderRequisitionFormOnlineShoppingListResponseDetail } from '@/services/OrderApi'
import styles from './index.less'
......@@ -178,7 +177,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
<div className={styles.purchaseOnline}>
<div className={styles.mall_container}>
<div className={styles.commodity_container}>
<Filter filterConfig={filterConfig} {...props} />
<Filter filterConfig={filterConfig} {...props} layoutType={LAYOUT_TYPE.purchaseOnline} />
<div className={styles.commodity_main}>
<div className={styles.tool_bar}>
<div className={styles.tool_bar_left}>
......
This diff is collapsed.
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