Commit 120b47a0 authored by GuanHua's avatar GuanHua

fix: 平台首页装修分类选择问题

parent 403283b3
......@@ -41,7 +41,7 @@ export interface ShopInfo {
describe: string;
state: number;
url: string;
isDefault: number;
isDefault?: any;
}
export interface OrderMode {
......@@ -60,7 +60,7 @@ export interface SiteInfo {
name: string;
logo: string;
siteUrl: string;
symbol: string;
symbol?: any;
}
export interface Site {
......
......@@ -81,10 +81,24 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const [selectedRows, setSelectedRows] = useState([]);
const [mallSelectList, setMallSelectList] = useState<NewSelectItemType[]>([]);
const [selectMallInfo, setSelectMallInfo] = useState<NewSelectItemType>();
const [categoryId, setCategoryId] = useState<number>();
const [categoryId, setCategoryId] = useState<string>();
const [fontColor, setFontColor] = useState<string>();
const ref = useRef<any>({});
const initCategoryId = () => {
if (dataInfo) {
if (dataInfo.thirdId) {
setCategoryId(dataInfo.thirdId)
} else if (dataInfo.secondId) {
setCategoryId(dataInfo.secondId)
} else if (dataInfo.firstId){
setCategoryId(dataInfo.firstId)
} else {
setCategoryId(undefined)
}
}
}
const initMallList = (mallList: ShopInfo[]) => {
if (!mallList) {
return [];
......@@ -134,6 +148,7 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const enterpriseMallList = GlobalConfig.web.shopInfo.filter((item) => item.type === 1 && item.environment === 1);
setMallSelectList(initMallList(enterpriseMallList));
initColorPicker();
initCategoryId()
}, []);
useEffect(() => {
......
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