Commit a5b666f8 authored by GuanHua's avatar GuanHua

平台首页导航装修修改

parent 0ee02286
......@@ -105,6 +105,10 @@ export enum LAYOUT_TYPE {
* 渠道商城-积分兑换
*/
channelScoreMall = 'channelScoreMall',
/**
* 平台首页
*/
platform = 'platform'
}
// 本地环境跳过权限校验
......
......@@ -3,7 +3,7 @@ import { LegoProvider, PROPS_TYPES } from 'lingxi-editor-core'
import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel'
import config from '../configs'
import { Button, Modal, message } from 'antd'
import { Modal, message } from 'antd'
import { Prompt, history } from 'umi'
import { GlobalConfig } from '@/global/config'
import {
......@@ -12,7 +12,7 @@ import {
FooterConfig
} from './defaultData'
import Loading from '../components/Loading'
import { ArrowLeftOutlined } from '@ant-design/icons'
import { LAYOUT_TYPE } from '@/constants'
import PlatformToolBar from '../components/toolBar/platform'
import { getMenuData, defaultDesignConfig } from './utils'
import { DesingConfigItemType } from './types'
......@@ -270,7 +270,9 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
"4": {
"componentName": "PlatformIndex.MallMainNav",
"componentType": PROPS_TYPES.mallNav,
"props": {},
"props": {
type: LAYOUT_TYPE.platform
},
}
}
......
......@@ -33,6 +33,7 @@ export const getMenuData = () => {
"id": 0,
"link": `${REQUEST_HEADER}www.${TOP_DOMAIN}`,
"name": "首页",
"type": 1,
"status": true,
"key": "home",
},
......@@ -40,6 +41,7 @@ export const getMenuData = () => {
"id": 1,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}`,
"name": "企业商城",
"type": 2,
"status": true,
"key": "enterpriseMall",
},
......@@ -47,6 +49,7 @@ export const getMenuData = () => {
"id": 2,
"link": `${REQUEST_HEADER}srm.${TOP_DOMAIN}`,
"name": "名企采购",
"type": 3,
"status": true,
"key": "srm",
},
......@@ -54,6 +57,7 @@ export const getMenuData = () => {
"id": 3,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}/stores`,
"name": "优选供应商",
"type": 4,
"status": true,
"key": "enterpriseMallStores",
},
......@@ -61,6 +65,7 @@ export const getMenuData = () => {
"id": 4,
"link": `${REQUEST_HEADER}${channelSubDomain}.${TOP_DOMAIN}`,
"name": "渠道服务",
"type": 5,
"status": true,
"key": "channel",
},
......@@ -68,6 +73,7 @@ export const getMenuData = () => {
"id": 5,
"link": `${REQUEST_HEADER}logistics.${TOP_DOMAIN}`,
"name": "物流服务",
"type": 6,
"key": "logistics",
"status": true,
},
......@@ -75,6 +81,7 @@ export const getMenuData = () => {
"id": 6,
"link": `${REQUEST_HEADER}manufacture.${TOP_DOMAIN}`,
"name": "加工服务",
"type": 7,
"status": true,
"key": "process",
},
......@@ -82,6 +89,7 @@ export const getMenuData = () => {
"id": 7,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}/integral`,
"name": "积分商城",
"type": 8,
"status": true,
"key": "enterprisePointsMall",
},
......@@ -89,6 +97,7 @@ export const getMenuData = () => {
"id": 8,
"link": `${REQUEST_HEADER}info.${TOP_DOMAIN}`,
"name": "行情资讯",
"type": 9,
"status": true,
"key": "information",
},
......
......@@ -6,6 +6,7 @@ import { ReactSortable } from "react-sortablejs"
import { useEffect } from 'react'
import { PublicApi } from '@/services/api'
import isEmpty from 'lodash/isEmpty'
import { LAYOUT_TYPE } from '@/constants'
import cx from 'classnames'
import { cloneDeep } from 'lodash'
import upIcon from '@/asserts/icons/up_icon.png'
......@@ -22,11 +23,12 @@ interface MenuItemType {
interface MallNavProps {
templateid: number,
menuData: MenuItemType[]
menuData: MenuItemType[],
type: LAYOUT_TYPE
}
const MallNav: React.FC<MallNavProps> = (props) => {
const { menuData, templateid } = props
const { menuData, templateid, type } = props
const [list, setList] = useState<MenuItemType[]>([])
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [newProps, setNewProps] = useState(props)
......@@ -86,15 +88,22 @@ const MallNav: React.FC<MallNavProps> = (props) => {
}
setConfirmLoading(true)
saveNav(newProps).then(() => {
if (type === LAYOUT_TYPE.platform) {
changeProps({
props: newProps
})
clearSelectedStatus()
setConfirmLoading(false)
}).catch(() => {
setConfirmLoading(false)
})
} else {
saveNav(newProps).then(() => {
changeProps({
props: newProps
})
clearSelectedStatus()
setConfirmLoading(false)
}).catch(() => {
setConfirmLoading(false)
})
}
}
const sortUp = (index: number, item: MenuItemType) => {
......
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