Commit 135fb0b0 authored by GuanHua's avatar GuanHua

fix: 自营商城装修

parent 2e7ef061
export const getDefaultMenuData = (mallPath: string, memberId: number) => {
return [
{
"link": `${mallPath}/${memberId}`,
"name": "商城首页",
"key": "Home",
type: 1,
status: true,
},
{
"link": `${mallPath}/${memberId}/commodity`,
"name": "现货商品",
"key": "commodity",
type: 2,
status: true,
},
{
"link": `${mallPath}/${memberId}/inquery`,
"name": "询价商品",
"key": "inquery",
type: 3,
status: true,
},
{
"link": `${mallPath}/${memberId}/points`,
"name": "积分兑换",
"key": "points",
type: 4,
status: true,
},
{
"link": `${mallPath}/${memberId}/infomation`,
"name": "行情资讯",
"key": "infomation",
type: 6,
status: true,
},
{
"link": `${mallPath}/${memberId}/about`,
"name": "关于我们",
"key": "about",
type: 5,
status: true,
},
]
}
export const menuData = [
{
"link": "/",
"name": "首页",
"name": "商城首页",
"key": "Home",
type: 1,
status: true,
......
......@@ -6,7 +6,7 @@ import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel'
import config from '../configs'
import { isEmpty } from 'lodash'
import { LAYOUT_TYPE } from '@/constants'
import { LAYOUT_TYPE, REQUEST_HEADER, TOP_DOMAIN } from '@/constants'
import {
topBarConfig,
topAdvertConfig,
......@@ -22,7 +22,7 @@ import {
InformationConfig,
FooterConfig,
} from './defaultData'
import { menuData } from './defaultMenu'
import { menuData, getDefaultMenuData } from './defaultMenu'
import Loading from '../components/Loading'
import { PublicApi } from '@/services/api'
import { GlobalConfig } from '@/global/config'
......@@ -173,12 +173,17 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
};
const getComponentsConfig = async () => {
//商城信息
const shopList = GlobalConfig.web.shopInfo
const webMallInfo = shopList.filter(item => item.id === Number(shopId))[0]
// 导航栏
const navData = await getOwnMallNavData();
if(!isEmpty(navData)) {
mainNavConfig[mainNavConfig.key].props.menuData = navData;
} else {
mainNavConfig[mainNavConfig.key].props.menuData = menuData;
const mallPath = `${REQUEST_HEADER}${webMallInfo.url}.${TOP_DOMAIN}`
mainNavConfig[mainNavConfig.key].props.menuData = getDefaultMenuData(mallPath, memberId);
}
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.shop
mainNavConfig[mainNavConfig.key].props.categoryList = []
......@@ -191,9 +196,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
threeBannerConfig[threeBannerConfig.key].props.advertList = await findAdvertsByType(3)
// 四号位广告
fourBannerConfig[fourBannerConfig.key].props.advertList = await findAdvertsByType(4)
//商城信息
const shopList = GlobalConfig.web.shopInfo
const webMallInfo = shopList.filter(item => item.id === Number(shopId))[0]
topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name
headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl
......
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