Commit babfb93a authored by GuanHua's avatar GuanHua

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

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