Commit f495d88b authored by GuanHua's avatar GuanHua

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

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