Commit e76fd382 authored by GuanHua's avatar GuanHua

feat: 平台首页装修修改

parent aa9d996a
......@@ -16,13 +16,18 @@ export const TOP_DOMAIN = getTopDomainByHost(siteUrl)
export const getMenuData = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: any) => item.type === 1 && item.environment === 1 && item.isDefault === 1)
const webMallList = shopInfo.filter((item: any) => item.type === 1 && item.environment === 1)
const channelList = shopInfo.filter((item: any) => item.type === 3 && item.environment === 1)
if (webMallList.length > 0 && channelList.length > 0) {
const enterpriseSubDomain = webMallList[0].url
const defaultEnterprise = webMallList.filter((item) => item.isDefault === 1)
let enterpriseSubDomain = ''
if (defaultEnterprise && defaultEnterprise.length > 0) {
enterpriseSubDomain = defaultEnterprise[0].url
} else {
enterpriseSubDomain = webMallList[0].url
}
const channelSubDomain = channelList[0].url
return [
{
"id": 0,
......
......@@ -29,6 +29,8 @@ interface GoodsItemType {
goodsIdList: number[],
goodsList?: any[],
name: string,
memberId: number,
memberRoleId: number,
secondId: string | undefined,
shopId: number | undefined,
thirdId: string | undefined,
......@@ -229,7 +231,7 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
switch (type) {
case 'first':
for (const item of categoryList) {
if (item.id === value) {
if (item.id && item.id === value) {
if (item.children) {
changeNewProps('dataInfo', Object.assign(dataInfo, { firstId: item.id, secondId: undefined, thirdId: undefined }))
setSecondCategoryList(item.children)
......@@ -239,7 +241,7 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
break
case 'second':
for (const item of secondCategoryList) {
if (item.id === value) {
if (item.id && item.id === value) {
if (item.children) {
changeNewProps('dataInfo', Object.assign(dataInfo, { secondId: item.id, thirdId: undefined }))
setThirdCategoryList(item.children)
......@@ -282,13 +284,17 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const handleDeleteSelect = (goodItem: any) => {
const newList: any[] = []
const ids: number[] = []
dataInfo.goodsList?.forEach((item) => {
if (item.id !== goodItem.id) {
if (item.goodsId !== goodItem.goodsId) {
newList.push(item)
ids.push(item.goodsId)
}
})
changeNewProps('dataInfo', Object.assign(dataInfo, {
goodsList: newList
goodsList: newList,
goodsIdList: ids
}))
}
......
......@@ -12,6 +12,7 @@ export interface MerchantItem {
avgTradeCommentStar: number,
areas: string,
memberId: string,
memberRoleId: number,
memberName: string,
logo: string,
}
......
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