Commit 5dc1400f authored by GuanHua's avatar GuanHua

Merge branch 'dev' into test

parents 8c5cd36e 115fcb15
...@@ -147,6 +147,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => { ...@@ -147,6 +147,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
getFn && getFn(param, { headers }).then(res => { getFn && getFn(param, { headers }).then(res => {
setLoading(false) setLoading(false)
if (res.code === 1000) { if (res.code === 1000) {
message.destroy()
setCommodityList(res.data.data) setCommodityList(res.data.data)
setTotalCount(res.data.totalCount) setTotalCount(res.data.totalCount)
} }
......
...@@ -2,20 +2,20 @@ import React from 'react' ...@@ -2,20 +2,20 @@ import React from 'react'
import cx from 'classnames' import cx from 'classnames'
import { Skeleton } from 'antd' import { Skeleton } from 'antd'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { GetSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi' import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import { priceFormat, numFormat } from '@/utils/numberFomat' import { priceFormat, numFormat } from '@/utils/numberFomat'
import creditIcon from '@/assets/imgs/credit_icon.png' import creditIcon from '@/assets/imgs/credit_icon.png'
import styles from './list.less' import styles from './list.less'
interface CommodityListPropsType { interface CommodityListPropsType {
showType: number; showType: number;
commodityList: GetSearchShopEnterpriseGetCommodityListResponseDetail[] commodityList: PostSearchShopEnterpriseGetCommodityListResponseDetail[]
layoutType: LAYOUT_TYPE layoutType: LAYOUT_TYPE
} }
const CommodityList: React.FC<CommodityListPropsType> = (props) => { const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const { showType, commodityList = [], layoutType = LAYOUT_TYPE.mall } = props const { showType, commodityList = [], layoutType = LAYOUT_TYPE.mall } = props
const renderPrice = (commodityItem: GetSearchShopEnterpriseGetCommodityListResponseDetail) => { const renderPrice = (commodityItem: PostSearchShopEnterpriseGetCommodityListResponseDetail) => {
switch (commodityItem.priceType) { switch (commodityItem.priceType) {
// 现货价格 // 现货价格
case 1: case 1:
......
...@@ -142,6 +142,7 @@ const CommodityDetail = (props) => { ...@@ -142,6 +142,7 @@ const CommodityDetail = (props) => {
} }
getListFn && getListFn(param, { headers }).then(res => { getListFn && getListFn(param, { headers }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
message.destroy()
setCommonCategoryCommodityList(res.data.data) setCommonCategoryCommodityList(res.data.data)
} }
}) })
...@@ -196,7 +197,7 @@ const CommodityDetail = (props) => { ...@@ -196,7 +197,7 @@ const CommodityDetail = (props) => {
/** /**
* 获取供货商的支付方式 * 获取供货商的支付方式
* @param memberId * @param memberId
*/ */
const getPayWayListByMemberId = (memberId: number) => { const getPayWayListByMemberId = (memberId: number) => {
if (!memberId) { if (!memberId) {
...@@ -950,7 +951,7 @@ const CommodityDetail = (props) => { ...@@ -950,7 +951,7 @@ const CommodityDetail = (props) => {
<div className={cx(styles.add_success_btn, styles.primary)} onClick={() => history.push(getPurchaseOrderLink())}>去结算</div> <div className={cx(styles.add_success_btn, styles.primary)} onClick={() => history.push(getPurchaseOrderLink())}>去结算</div>
<div className={styles.add_success_btn} onClick={() => setAddSuccessVisible(false)}>继续购物</div> <div className={styles.add_success_btn} onClick={() => setAddSuccessVisible(false)}>继续购物</div>
</div> </div>
<InterestedCommodity /> <InterestedCommodity dataList={commonCategoryCommodityList} {...props} />
</DialogModal> </DialogModal>
</div> </div>
) )
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
margin-top: 5px; margin-top: 5px;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 1;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
......
import React from 'react' import React, { useState, useEffect } from 'react'
import { LeftOutlined, RightOutlined } from '@ant-design/icons' import { LeftOutlined, RightOutlined } from '@ant-design/icons'
import cx from 'classnames' import cx from 'classnames'
import ImageBox from '@/components/ImageBox'
import { LAYOUT_TYPE } from '@/constants'
import { priceFormat } from '@/utils/numberFomat'
import styles from './index.less' import styles from './index.less'
import url from '*.svg'
const InterestedCommodity: React.FC = () => { interface InterestedCommodityPropsType {
dataList: any,
layoutType?: LAYOUT_TYPE
}
const InterestedCommodity: React.FC<InterestedCommodityPropsType> = (props) => {
const { dataList, layoutType } = props
const [list, setList] = useState<any>([])
const arrGroup = (array, subGroupLength) => {
let index = 0;
let newArray = [];
while (index < array.length) {
newArray.push(array.slice(index, index += subGroupLength));
}
return newArray;
}
useEffect(() => {
if (dataList) {
setList(arrGroup(dataList, 5))
}
}, [dataList])
let mockList = [] const getCommodityDetailLink = (item) => {
for (let i = 0; i < 5; i++) { let link = ""
mockList.push({ switch (layoutType) {
url: "https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1.jpg", case LAYOUT_TYPE.channel:
name: '0.8-1.0mm黑色手纹硬度适中偏软偏软偏软', link = `/channelmall/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
price: '79.00' break
}) case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
default:
link = `/shop/commodity/detail?id=${item.id}&type=${item.priceType}&shopId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
}
return link
} }
return ( return (
<div className={styles.interested_commodity}> <div className={styles.interested_commodity}>
<div className={styles.interested_commodity_title}> <div className={styles.interested_commodity_title}>
<span>您可能也感兴趣:</span> <span>您可能也感兴趣:</span>
<div className={styles.interested_commodity_pagination}> {/* <div className={styles.interested_commodity_pagination}>
<div className={cx(styles.interested_commodity_pagination_btn, styles.disabled)}><LeftOutlined /></div> <div className={cx(styles.interested_commodity_pagination_btn, styles.disabled)}><LeftOutlined /></div>
<div className={cx(styles.interested_commodity_pagination_btn)}><RightOutlined /></div> <div className={cx(styles.interested_commodity_pagination_btn)}><RightOutlined /></div>
</div> </div> */}
</div> </div>
<div className={styles.interested_commodity_list}> <div className={styles.interested_commodity_list}>
{ {
mockList.map(item => ( dataList && dataList.map((item, index) => index < 5 && (
<div className={styles.interested_commodity_list_item}> <div className={styles.interested_commodity_list_item} key={`interested_commodity_list_item_${item.id}`}>
<div className={styles.interested_commodity_list_item_imgbox}> <a href={getCommodityDetailLink(item)} target="_blank">
<div className={styles.interested_commodity_list_item_imgbox_img} style={{ backgroundImage: `url(${item.url})` }}></div> <div className={styles.interested_commodity_list_item_imgbox}>
</div> <ImageBox width={100} height={100} imgUrl={item.mainPic} direction="column" />
<div className={styles.interested_commodity_list_item_name}>{item.name}</div> </div>
<div className={styles.interested_commodity_list_item_price}> <div className={styles.interested_commodity_list_item_name}>{item.name}</div>
<i></i> <div className={styles.interested_commodity_list_item_price}>
{item.price} <i></i>
</div> {priceFormat(item.min)}
</div>
</a>
</div> </div>
)) ))
} }
</div> </div>
</div> </div>
) )
......
import React from 'react' import React, { useEffect, useState } from 'react'
import './index.less' import { PublicApi } from '@/services/api'
import ImageBox from '@/components/ImageBox'
const Recommand: React.FC = () => { import { inject, observer } from 'mobx-react'
import { message } from 'antd'
const product_list = [ import { LAYOUT_TYPE } from '@/constants'
{ import { priceFormat } from '@/utils/numberFomat'
imgUrl: 'https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg', import styles from './index.less'
name: '0.8-1.0mm黑色手折纹胎水牛皮黄牛头层自然摔纹硬度适中偏软…',
price: '19.00' interface RecommandPropsType {
}, SiteStore?: any,
{ layoutType: LAYOUT_TYPE,
imgUrl: 'https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg', categoryIds: number[], // 商品品类集合
name: '0.8-1.0mm黑色手折纹胎水牛皮黄牛头层自然摔纹硬度适中偏软…', loading: boolean,
price: '19.00' memberId?: number
}, }
{
imgUrl: 'https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg', const Recommand: React.FC<RecommandPropsType> = (props) => {
name: '0.8-1.0mm黑色手折纹胎水牛皮黄牛头层自然摔纹硬度适中偏软…', const { mallTemplateId } = props.SiteStore
price: '19.00' const { layoutType, categoryIds, loading, memberId } = props
}, const [list, setList] = useState<any>([])
{
imgUrl: 'https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg', useEffect(() => {
name: '0.8-1.0mm黑色手折纹胎水牛皮黄牛头层自然摔纹硬度适中偏软…', if (loading) {
price: '19.00' if (categoryIds && categoryIds.length > 0) {
}, getCommodityListByCategoryIds()
{ } else {
imgUrl: 'https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg', getCategoryComponents()
name: '0.8-1.0mm黑色手折纹胎水牛皮黄牛头层自然摔纹硬度适中偏软…', }
price: '19.00' }
}, [loading])
const getCommodityListByCategoryIds = async () => {
let result = []
for (let id of categoryIds) {
let resList: any = await getListById(id)
result = [...result, ...resList]
if (result && result.length >= 5) {
setList(result)
break
}
}
if (result.length <= 0) {
getCategoryComponents()
}
}
const changeDataKey = (data) => {
return data.map(item => {
item.id = item.goodsId
item.mainPic = item.goodsPicUrl
item.name = item.goodsName
item.min = item.goodsPrice
item.storeId = item.shopId
return item
})
}
const getListById = (categoryId: number) => {
return new Promise((resolve) => {
let param: any = {
current: 1,
pageSize: 5,
categoryId
}
let headers = {}
let getListFn
switch (layoutType) {
case LAYOUT_TYPE.channel:
headers = {
type: 3
}
param.channelMemberId = memberId
getListFn = PublicApi.postSearchShopChannelGetCommodityList
break
case LAYOUT_TYPE.ichannel:
headers = {
type: 4
}
param.channelMemberId = memberId
getListFn = PublicApi.postSearchShopChannelGetCommodityList
break
default:
getListFn = PublicApi.postSearchShopEnterpriseGetCommodityList
break
}
getListFn && getListFn(param, { headers }).then(res => {
if (res.code === 1000) {
message.destroy()
resolve(res.data.data)
}
})
})
}
/**
* 获取所有一级品类信息
*/
const fetchFirstCategory = () => {
return new Promise((resolve) => {
PublicApi.getTemplatePlatformFindAllFirstCategory().then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
/**
* 获取一级品类详细信息
*/
const fetchCategoryById = (categoryId) => {
return new Promise((resolve) => {
let param = {
templateId: mallTemplateId,
categoryId
}
// @ts-ignore
PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
const getCategoryComponents = async () => {
let firstCategory: any = await fetchFirstCategory()
let categoryDetail: any = await fetchCategoryById(firstCategory[0].id)
setList(changeDataKey(categoryDetail.goodsBOList))
}
const getCommodityDetailLink = (item) => {
let link = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
link = `/channelmall/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
default:
link = `/shop/commodity/detail?id=${item.id}&shopId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
} }
] return link
}
return ( return (
<div className="recommand"> <div className={styles.recommand}>
<div className="recommand_title">买家还在看</div> <div className={styles.recommand_title}>买家还在看</div>
<div className="recommand_list"> <div className={styles.recommand_list}>
{ {
product_list.map((item, index) => ( list && list.map((item, index) => index < 5 && (
<a href="/" key={`recommand_list_item_${index}`}> <a href={getCommodityDetailLink(item)} key={`recommand_list_item_${index}`} target="_blank">
<div className="recommand_list_item"> <div className={styles.recommand_list_item}>
<div className="recommand_list_item_img"> <div className={styles.recommand_list_item_img}>
<img src={item.imgUrl} /> <ImageBox width={224} height={224} imgUrl={item.mainPic} direction="column" />
</div> </div>
<div className="recommand_list_item_price"> <div className={styles.recommand_list_item_price}>
<span></span> <span></span>
{item.price} {priceFormat(item.min)}
</div> </div>
<div className="recommand_list_item_name">{item.name}</div> <div className={styles.recommand_list_item_name}>{item.name}</div>
</div> </div>
</a> </a>
)) ))
...@@ -56,4 +173,4 @@ const Recommand: React.FC = () => { ...@@ -56,4 +173,4 @@ const Recommand: React.FC = () => {
) )
} }
export default Recommand export default inject('SiteStore')(observer(Recommand))
...@@ -96,39 +96,41 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -96,39 +96,41 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
let firstCategory: any = await fetchFirstCategory() let firstCategory: any = await fetchFirstCategory()
for (let item of firstCategory) { for (let item of firstCategory) {
let categoryDetail: any = await fetchCategoryById(item.id) if (item.id) {
result.push( let categoryDetail: any = await fetchCategoryById(item.id)
<FloorLine result.push(
linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`} <FloorLine
anchor={`floorline_${item.id}`} linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
key={item.id} anchor={`floorline_${item.id}`}
title={item.name} key={item.id}
> title={item.name}
<FloorLine.Horizontal> >
<FloorLine.Category <FloorLine.Horizontal>
linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`} <FloorLine.Category
subLinkUrl={`/commodity`}
categoryAdvertPicUrl={categoryDetail.categoryAdvertPicUrl}
secondCategoryList={categoryDetail.categoryBOList}
/>
<FloorLine.Vertical>
<FloorLine.FloorHeader
shopNum={categoryDetail.shopNum}
goodsNum={categoryDetail.goodsNum}
linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`} linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
shopsLinkUrl={`/shops?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`} subLinkUrl={`/commodity`}
> categoryAdvertPicUrl={categoryDetail.categoryAdvertPicUrl}
<FloorLine.Banner advertList={categoryDetail.thirdAdvertList} /> secondCategoryList={categoryDetail.categoryBOList}
</FloorLine.FloorHeader> />
<FloorLine.Horizontal> <FloorLine.Vertical>
<FloorLine.Goods goodsList={categoryDetail.goodsBOList} linkUrl={`/shop/commodity/detail`} /> <FloorLine.FloorHeader
<FloorLine.Shops shopsList={categoryDetail.shopBOList} linkUrl={`/shop`} /> shopNum={categoryDetail.shopNum}
</FloorLine.Horizontal> goodsNum={categoryDetail.goodsNum}
</FloorLine.Vertical> linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
</FloorLine.Horizontal> shopsLinkUrl={`/shops?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
<FloorLine.Brand brandList={categoryDetail.brandBOList} linkUrl='/commodity' /> >
</FloorLine> <FloorLine.Banner advertList={categoryDetail.thirdAdvertList} />
) </FloorLine.FloorHeader>
<FloorLine.Horizontal>
<FloorLine.Goods goodsList={categoryDetail.goodsBOList} linkUrl={`/shop/commodity/detail`} />
<FloorLine.Shops shopsList={categoryDetail.shopBOList} linkUrl={`/shop`} />
</FloorLine.Horizontal>
</FloorLine.Vertical>
</FloorLine.Horizontal>
<FloorLine.Brand brandList={categoryDetail.brandBOList} linkUrl='/commodity' />
</FloorLine>
)
}
} }
setCategoryComponents(result) setCategoryComponents(result)
} }
......
...@@ -6,7 +6,7 @@ import { Pagination } from 'antd' ...@@ -6,7 +6,7 @@ import { Pagination } from 'antd'
import CommodityList from './list' import CommodityList from './list'
import SearchNoResult from '../components/SearchNoResult' import SearchNoResult from '../components/SearchNoResult'
import isEmpty from 'lodash/isEmpty' import isEmpty from 'lodash/isEmpty'
import { Spin } from 'antd' import { Spin, message } from 'antd'
import { useLocalStore, observer } from 'mobx-react' import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store' import { store } from '@/store'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -102,6 +102,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => { ...@@ -102,6 +102,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
getFn(param, { headers }).then(res => { getFn(param, { headers }).then(res => {
setLoading(false) setLoading(false)
if (res.code === 1000) { if (res.code === 1000) {
message.destroy()
setCommodityList(res.data.data) setCommodityList(res.data.data)
setTotalCount(res.data.totalCount) setTotalCount(res.data.totalCount)
} }
......
...@@ -31,12 +31,20 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -31,12 +31,20 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
const [checkedList, setCheckedList] = useState([]) const [checkedList, setCheckedList] = useState([])
const [orderList, setOrderList] = useState([]) const [orderList, setOrderList] = useState([])
const [confirmLoading, setConfirmLoading] = useState<boolean>(false) const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [categoryIds, setCategoryIds] = useState<any>()
const [loading, setLoading] = useState<boolean>(false)
let countState = true let countState = true
useEffect(() => { useEffect(() => {
fetchPurchaseList() fetchPurchaseList()
}, []) }, [])
useEffect(() => {
if (categoryIds) {
setLoading(true)
}
}, [categoryIds])
const fetchPurchaseList = (initState = false) => { const fetchPurchaseList = (initState = false) => {
let getFn let getFn
switch (layoutType) { switch (layoutType) {
...@@ -52,10 +60,26 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -52,10 +60,26 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
getFn && getFn().then(res => { getFn && getFn().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
initPurchaseList(res.data, initState) initPurchaseList(res.data, initState)
getCategoryIds(res.data)
} }
}) })
} }
/**
* 获取进货单内商品品类id集合
* @param purchaseList
*/
const getCategoryIds = (purchaseList) => {
let ids = []
for (let item of purchaseList) {
let categoryId = item.commodityUnitPrice.commodity.customerCategory.id
if (!ids.includes(categoryId)) {
ids.push(categoryId)
}
}
setCategoryIds(ids)
}
const initPurchaseList = (list: GetSearchShopPurchaseGetPurchaseListResponse, initState) => { const initPurchaseList = (list: GetSearchShopPurchaseGetPurchaseListResponse, initState) => {
let result = [] let result = []
for (let item of list) { for (let item of list) {
...@@ -691,7 +715,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -691,7 +715,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
</Affix> </Affix>
) )
} }
<Recommand /> <Recommand loading={loading} categoryIds={categoryIds} {...props} />
</div> </div>
</div> </div>
) )
......
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { Rate, Pagination, Modal } from 'antd' import { Rate, Pagination, Modal, message } from 'antd'
import { StarFilled } from '@ant-design/icons' import { StarFilled } from '@ant-design/icons'
import shop_icon from '@/assets/imgs/shop_icon.png' import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png' import credit_icon from '@/assets/imgs/credit_icon.png'
...@@ -67,10 +67,15 @@ const Shops: React.FC = () => { ...@@ -67,10 +67,15 @@ const Shops: React.FC = () => {
} }
const linkToDetail = (detail) => { const linkToDetail = (detail) => {
let el = document.createElement('a') if (detail.status === 1) {
el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`; let el = document.createElement('a')
el.target = '_blank'; el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`;
el.click() el.target = '_blank';
el.click()
} else {
message.destroy()
message.info("该店铺已冻结")
}
} }
return ( return (
......
...@@ -40,6 +40,28 @@ const getItemText = (key: number) => { ...@@ -40,6 +40,28 @@ const getItemText = (key: number) => {
return result return result
} }
const changeAttributeDate = (list) => {
if (!list) {
return []
}
let flag = false
list = list.map(item => {
delete item.customerAttributeName
if (item.customerAttributeValueList && item.customerAttributeValueList.length <= 0) {
delete item.customerAttributeValueList
delete item.customerAttributeId
flag = true
} else {
item.customerAttributeValueList = item.customerAttributeValueList.map(attrItem => {
delete attrItem.name
return attrItem
})
}
return item
})
return flag ? [] : list
}
class FilterStore { class FilterStore {
/** /**
* 筛选条件列表 * 筛选条件列表
...@@ -120,7 +142,7 @@ class FilterStore { ...@@ -120,7 +142,7 @@ class FilterStore {
for (let filterItem of newFilterList) { for (let filterItem of newFilterList) {
switch (filterItem.type) { switch (filterItem.type) {
case FILTER_TYPE.category: case FILTER_TYPE.category:
tempFilterParam.categoryId = filterItem.key[0] tempFilterParam.categoryId = Number(filterItem.key[0])
break break
case FILTER_TYPE.brand: case FILTER_TYPE.brand:
tempFilterParam.brandId = filterItem.key tempFilterParam.brandId = filterItem.key
...@@ -158,7 +180,9 @@ class FilterStore { ...@@ -158,7 +180,9 @@ class FilterStore {
tempFilterParam.orderType = 4 tempFilterParam.orderType = 4
break break
case FILTER_TYPE.attribute: case FILTER_TYPE.attribute:
tempFilterParam.customerAttributeList = filterItem.key let attributeList = JSON.parse(filterItem.key)
attributeList = changeAttributeDate(attributeList)
tempFilterParam.customerAttributeList = attributeList
break break
case FILTER_TYPE.shopArea: case FILTER_TYPE.shopArea:
tempFilterParam.areaCode = filterItem.key tempFilterParam.areaCode = filterItem.key
......
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