Commit f495d88b authored by GuanHua's avatar GuanHua

fix:保存常用筛选没有保存到属性的问题

parent 619f156d
......@@ -29,4 +29,8 @@
margin-left: 4px;
}
}
}
.modal_confirm {
width: 420px !important;
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ const ToolBar: React.FC = () => {
Modal.confirm({
content: "是否确认离开模板装修页面?",
okText: "确认",
className: styles.modal_confirm,
cancelText: "取消",
onOk: () => {
history.goBack()
......
......@@ -41,7 +41,8 @@ export const headerConfig = {
"3": {
"componentName": "ShopHeader",
"props": {
"shopInfo": {}
"shopInfo": {},
"logoUrl": ""
},
},
}
......
......@@ -9,6 +9,7 @@ import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdver
import { menuData } from './defaultMenu'
import Loading from './loading'
import { PublicApi } from '@/services/api'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface ShopEditPropsType {
......@@ -131,8 +132,12 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
//店铺信息
const shopInfo = await fetchShopInfo()
headerConfig[headerConfig.key].props.shopInfo = shopInfo
AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo
const shopList = GlobalConfig.web.shopInfo
let webMallInfo = shopList.filter(item => item.environment === 1 && item.type === 1)[0]
headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl
topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name
AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo
let initIndex = 100
let floorLineConfig: any = {}
let floorLineKeys: any = []
......
......@@ -201,6 +201,7 @@
.modal_confirm {
position: relative;
width: 520px !important;
:global {
.ant-modal-body {
......
......@@ -326,7 +326,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
filterList.length > 0 && (
<div className={styles.filter_bar_left}>
{
userInfo && (
(userInfo && layoutType === LAYOUT_TYPE.mall) && (
<>
<div className={styles.filter_bar_left_text} onClick={() => handleSaveFilter()}>保存为常用筛选</div>
<div className={styles.filter_bar_left_split}></div>
......@@ -369,6 +369,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
className={styles.modal_confirm}
confirmLoading={confirmLoading}
visible={modalVisible}
width={520}
onOk={() => handleSaveConfirm()}
onCancel={() => setModalVisible(false)}
>
......
......@@ -12,7 +12,6 @@ const CommonlyUsed: React.FC = () => {
const { commonlyUseFilter, getCommonlyUsedFilterList, deleteCommonlyUsedFilterItem, useCommonlyFilter } = FilterStore
useEffect(() => {
console.log(!isEmpty(commonlyUseFilter), JSON.parse(JSON.stringify(commonlyUseFilter)), "!isEmpty(commonlyUseFilter)")
if (isEmpty(commonlyUseFilter)) {
getCommonlyUsedFilterList()
}
......
......@@ -40,11 +40,20 @@ const getItemText = (key: number) => {
return result
}
const changeAttributeDate = (list) => {
const changeAttributeDate = (list, change = false) => {
if (!list) {
return []
}
let result = list.filter(item => item.customerAttributeValueList.length > 0)
if (change) {
result = result.map(item => {
return {
id: item.customerAttributeId,
name: item.customerAttributeName,
customerAttributeValueList: item.customerAttributeValueList
}
})
}
return result
}
......@@ -221,6 +230,11 @@ class FilterStore {
tempFilterParam.cityCode = filterItem.key
tempFilterParam.cityName = filterItem.title
break
case FILTER_TYPE.attribute:
let attributeList = filterItem.key
attributeList = changeAttributeDate(attributeList, true)
tempFilterParam.customerAttributeList = attributeList
break
default:
break
}
......@@ -337,6 +351,22 @@ class FilterStore {
key: data.priceType
})
}
if (data.customerAttributeList) {
let newCustomerAttributeList = data.customerAttributeList.map(item => {
return {
customerAttributeId: item.id,
customerAttributeName: item.name,
customerAttributeValueList: item.customerAttributeValueList
}
})
tempFilter.push({
type: FILTER_TYPE.attribute,
title: `${data.customerAttributeList.map((tsItem: any) => {
return `${tsItem.name}${tsItem.customerAttributeValueList.map(cabItem => cabItem.name)}`
}).join(';')}`,
key: newCustomerAttributeList
})
}
this.filterList = tempFilter
}
})
......
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