Commit 121d44d3 authored by GuanHua's avatar GuanHua

feat: 店铺和渠道页面修改

parent bff41537
...@@ -10,7 +10,7 @@ export const mallLayoutConfig = { ...@@ -10,7 +10,7 @@ export const mallLayoutConfig = {
"background": "#FFF" "background": "#FFF"
} }
}, },
"childNodes": ["1", "3", "4", "5", "6"] "childNodes": ["1", "3", "4", "5"]
}, },
} }
...@@ -24,18 +24,6 @@ export const topBarConfig = { ...@@ -24,18 +24,6 @@ export const topBarConfig = {
} }
} }
export const topAdvertConfig = {
key: "2",
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
}
export const headerConfig = { export const headerConfig = {
key: "3", key: "3",
"3": { "3": {
...@@ -52,10 +40,51 @@ export const mainNavConfig = { ...@@ -52,10 +40,51 @@ export const mainNavConfig = {
}, },
} }
export const bannerAdvertConfig = { export const horizontalWrap = {
key: "5", key: "5",
"5": { "5": {
"componentName": "Advert", "componentName": "div",
"props": {
"style": {
"width": "1200px",
"margin": "0 auto",
"display": "flex",
"marginTop": "16px",
}
},
"childNodes": ["6", "7", "10"]
},
}
export const channelCategoryConfig = {
key: "6",
"6": {
"componentName": "ChannelCategory",
"props": {
categoryList: []
},
},
}
export const bannerWrap = {
key: "7",
"7": {
"componentName": "div",
"props": {
"style": {
"margin": "0 16px",
"flex": 1,
"width": 0,
}
},
"childNodes": ["8", "9"]
},
}
export const bannerAdvertConfig = {
key: "8",
"8": {
"componentName": "ChannelAdvert",
"props": { "props": {
"type": "banner", "type": "banner",
"linkdisable": true, "linkdisable": true,
...@@ -64,21 +93,34 @@ export const bannerAdvertConfig = { ...@@ -64,21 +93,34 @@ export const bannerAdvertConfig = {
}, },
} }
export const CommonTitle1Config = {
key: "6", export const interactAdvertConfig = {
"6": { key: "9",
"componentName": "CommonTitle", "9": {
"componentName": "ChannelAdvert",
"props": { "props": {
"title": "热销商品", "type": "interact",
"type": "primary" "linkdisable": true,
}, "advertList": []
}
}, },
} }
export const channelQuickNavConfig = {
key: "10",
"10": {
"componentName": "ChannelQuickNav",
"props": {
"linkdisable": true,
}
},
}
export const serviceAdvertConfig = { export const serviceAdvertConfig = {
key: "16", key: "16",
"16": { "16": {
"componentName": "Advert", "componentName": "ChannelAdvert",
"props": { "props": {
"type": "service", "type": "service",
"linkdisable": true, "linkdisable": true,
...@@ -99,159 +141,42 @@ export const CommonTitle2Config = { ...@@ -99,159 +141,42 @@ export const CommonTitle2Config = {
}, },
} }
export const AboutUsConfig = { export const CompanyInfoConfig = {
key: "18", key: "18",
"18": { "18": {
"componentName": "AboutUs", "componentName": "CompanyInfo",
"props": {}, "props": {},
}, },
} }
export const InformationConfig = { export const AlbumConfig = {
key: '19', key: "19",
"19": { "19": {
"componentName": "Information", "componentName": "Album",
"props": {}, "props": {},
}, },
} }
export const FooterConfig = { export const HonroPicConfig = {
key: '20', key: "20",
"20": { "20": {
"componentName": "Footer", "componentName": "HonroPic",
"props": {}, "props": {},
}, },
} }
export const InformationConfig = {
key: '21',
export default { "21": {
"0": {
"componentName": "MallLayout",
"props": {
"style": {
"width": "100%",
"minHeight": "100%"
}
},
"childNodes": ["1", "2", "3", "4", "5", "7", "8", "18", "19", "20"]
},
"1": {
"componentName": "TopBar",
"props": {
linkdisable: true
},
},
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
"3": {
"componentName": "Header",
"props": {},
},
"4": {
"componentName": "MainNav",
"props": {},
},
"5": {
"componentName": "Advert",
"props": {
"type": "banner",
"hasQuickNav": true,
"linkdisable": true,
"advertList": []
// "advertList": [
// {
// id: 1,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/imgextra/i4/81/O1CN01VT5ViO1CT8h4sY7qc_!!81-0-luban.jpg_q100.jpg_.webp',
// link: 'https://www.baidu.com',
// sort: 1,
// },
// {
// id: 2,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/tps/i4/TB1ICgYL.H1gK0jSZSySuttlpXa.jpg',
// link: 'https://www.baidu.com',
// sort: 2,
// }
// ]
}
},
"7": {
"componentName": "Advert",
"props": {
"type": "interact",
"linkdisable": true,
"advertList": []
},
},
"8": {
"componentName": "FloorLine",
"props": {},
"childNodes": ["9", "10"]
},
"9": {
"componentName": "FloorLine.Horizontal",
"props": {},
"childNodes": ["11", "12"]
},
"10": {
"componentName": "FloorLine.Brand",
"props": {},
},
"11": {
"componentName": "FloorLine.Category",
"props": {},
},
"12": {
"componentName": "FloorLine.Vertical",
"props": {},
"childNodes": ["13", "15"]
},
"13": {
"componentName": "FloorLine.FloorHeader",
"props": {},
"childNodes": ["14"]
},
"14": {
"componentName": "FloorLine.Banner",
"props": {
"type": "category",
},
},
"15": {
"componentName": "FloorLine.Horizontal",
"props": {},
"childNodes": ["16", "17"]
},
"16": {
"componentName": "FloorLine.Goods",
"props": {},
},
"17": {
"componentName": "FloorLine.Shops",
"props": {},
},
"18": {
"componentName": "FindMore",
"props": {},
},
"19": {
"componentName": "Information", "componentName": "Information",
"props": {}, "props": {},
}, },
"20": { }
export const FooterConfig = {
key: '22',
"22": {
"componentName": "Footer", "componentName": "Footer",
"props": {}, "props": {},
}, },
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ export const menuData = [ ...@@ -16,7 +16,7 @@ export const menuData = [
}, },
{ {
"path": "/shop/infomation", "path": "/shop/infomation",
"name": "资讯", "name": "行情资讯",
"key": "shopInfomation", "key": "shopInfomation",
}, },
{ {
...@@ -24,4 +24,4 @@ export const menuData = [ ...@@ -24,4 +24,4 @@ export const menuData = [
"name": "关于我们", "name": "关于我们",
"key": "shopAbout", "key": "shopAbout",
}, },
] ]
\ No newline at end of file
...@@ -4,9 +4,10 @@ import ToolBar from '../components/toolBar' ...@@ -4,9 +4,10 @@ import ToolBar from '../components/toolBar'
import DesignPanel from '../components/DesignPanel' import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel' import SettingPanel from '../settingsPanel'
import config from '../configs' import config from '../configs'
import { GlobalConfig } from '@/global/config'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi' import { GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, CommonTitle1Config, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, AboutUsConfig, InformationConfig, FooterConfig } from './defaultData' import { topBarConfig, headerConfig, mainNavConfig, horizontalWrap, channelCategoryConfig, bannerWrap, bannerAdvertConfig, interactAdvertConfig, channelQuickNavConfig, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, CompanyInfoConfig, AlbumConfig, HonroPicConfig, InformationConfig, FooterConfig } from './defaultData'
import Loading from '../components/Loading' import Loading from '../components/Loading'
import { menuData } from './defaultMenu' import { menuData } from './defaultMenu'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -24,6 +25,7 @@ interface ChannelPreviewPropsType { ...@@ -24,6 +25,7 @@ interface ChannelPreviewPropsType {
* 模板名称 * 模板名称
*/ */
template: string; template: string;
type: number
} }
} }
} }
...@@ -31,7 +33,7 @@ interface ChannelPreviewPropsType { ...@@ -31,7 +33,7 @@ interface ChannelPreviewPropsType {
const TemplateList = ['science'] const TemplateList = ['science']
const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const { query: { id, template } } = props.location const { query: { id, template, type } } = props.location
const userInfo = getAuth() || {} const userInfo = getAuth() || {}
const [loading, setLoading] = useState<boolean>(true) const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-channel-science') const [theme, setTheme] = useState<string>('theme-channel-science')
...@@ -46,11 +48,11 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -46,11 +48,11 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
getComponentsConfig() getComponentsConfig()
}, []) }, [])
const findFirstAdvertsByType = () => { const findAdvertsByType = (type: number) => {
return new Promise((resolve) => { return new Promise((resolve) => {
const params: any = { const params: any = {
templateId: id, templateId: id,
type: 1, type,
memberId: userInfo.memberId memberId: userInfo.memberId
} }
...@@ -162,27 +164,85 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -162,27 +164,85 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
}) })
} }
const fetchNewByLabel = (label: string) => {
// 1-头条文章 2-轮播新闻 3-图片新闻 4-推荐阅读
return new Promise((resolve, reject) => {
PublicApi.getManageContentInformationFindAllByRecommendLabel({ recommendLabel: label }).then((res: { code: number; data: unknown }) => {
if (res.code === 1000) {
resolve(res.data)
} else {
reject()
}
}).catch(() => {
reject()
})
})
}
const getChannelInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { environment: number; type: number }) => item.environment === 1 && item.type === 3)
return webMallList[0]
}
const getIChannelInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { environment: number; type: number }) => item.environment === 1 && item.type === 4)
return webMallList[0]
}
const initCategoryData = (list: any, parentKey?: string, parentName?: string) => {
if (!list) {
return []
}
const result: any = list.map((item: any) => {
let cid = `c${item.id}`
let treeName = item.title
if (parentKey) {
cid = `${parentKey}_${cid}`
treeName = `${parentName} ${treeName}`
}
const newItem: any = {
title: item.title,
name: item.title,
treeName: treeName,
key: cid,
id: item.id,
brandList: item.brandList
}
if (item.children && item.children.length > 0) {
newItem.children = initCategoryData(item.children, cid, treeName)
}
return newItem
})
return result
}
/** /**
* 获取全部栏目 * 获取商品品类树
*/ */
const fetchAllColumn = () => { const getCategoryTree = () => {
return new Promise((resolve) => { return new Promise((resolve) => {
const headers: any = {}
const param: any = {
channelMemberId: userInfo.memberId
}
switch (Number(type)) {
case 3:
headers.type = 3
break
case 4:
headers.type = 4
break
default:
break
}
PublicApi.getManageContentColumnAll().then(res => { PublicApi.getSearchShopChannelGetCustomerCategoryTree(param, { headers }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
let result = "" resolve(initCategoryData(res.data))
const allColumn = res.data
if (allColumn && allColumn.length > 0) {
let labelList = allColumn.map((item: any) => item.name)
const showCount = 4
if (labelList.length <= showCount) {
result = labelList.join(' | ')
} else {
labelList = labelList.slice(0, showCount)
result = labelList.join(' | ') + " ..."
}
}
resolve(result)
} }
}) })
}) })
...@@ -192,24 +252,42 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -192,24 +252,42 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
// 导航栏 // 导航栏
mainNavConfig[mainNavConfig.key].props.menuData = menuData mainNavConfig[mainNavConfig.key].props.menuData = menuData
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.channel mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.channel
mainNavConfig[mainNavConfig.key].props.categoryList = [] // mainNavConfig[mainNavConfig.key].props.categoryList = []
// 一号位广告 // 一号位广告
bannerAdvertConfig[bannerAdvertConfig.key].props.advertList = await findFirstAdvertsByType() bannerAdvertConfig[bannerAdvertConfig.key].props.advertList = await findAdvertsByType(1)
// 二号位广告 // 二号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType() interactAdvertConfig[interactAdvertConfig.key].props.advertList = await findAdvertsByType(2)
// 三号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findAdvertsByType(3)
//店铺信息 //店铺信息
const channelInfo: any = await fetchShopInfo() const channelInfo: any = await fetchShopInfo()
AboutUsConfig[AboutUsConfig.key].props.shopInfo = channelInfo CompanyInfoConfig[CompanyInfoConfig.key].props.shopInfo = channelInfo || {}
channelQuickNavConfig[channelQuickNavConfig.key].props.channelInfo = channelInfo
AlbumConfig[AlbumConfig.key].props.workshopPics = channelInfo.workshopPics || []
HonroPicConfig[HonroPicConfig.key].props.honorPics = channelInfo.honorPics || []
channelCategoryConfig[channelCategoryConfig.key].props.categoryList = await getCategoryTree()
let globalChannelInfo: any = {}
switch (Number(type)) {
case 3:
globalChannelInfo = getChannelInfo()
break
case 4:
globalChannelInfo = getIChannelInfo()
break
default:
globalChannelInfo = getChannelInfo()
break
}
headerConfig[headerConfig.key].props.logoUrl = channelInfo.logo || "" headerConfig[headerConfig.key].props.logo = globalChannelInfo.logoUrl || ''
topBarConfig[topBarConfig.key].props.shopname = channelInfo.company || "" headerConfig[headerConfig.key].props.channelInfo = channelInfo
topBarConfig[topBarConfig.key].props.shopname = globalChannelInfo.name || ""
// 行情资讯 // 行情资讯
InformationConfig[InformationConfig.key].props.newsList = await fetchLeadNews() InformationConfig[InformationConfig.key].props.newsList = await fetchNewByLabel('4')
InformationConfig[InformationConfig.key].props.allColumn = await fetchAllColumn()
let initIndex = 100 let initIndex = 100
let floorLineConfig: any = {} let floorLineConfig: any = {}
...@@ -264,20 +342,25 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -264,20 +342,25 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
} }
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, AboutUsConfig.key, InformationConfig.key, FooterConfig.key] mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, CompanyInfoConfig.key, AlbumConfig.key, HonroPicConfig.key, InformationConfig.key, FooterConfig.key]
const config = { const config = {
...mallLayoutConfig, ...mallLayoutConfig,
...topBarConfig, ...topBarConfig,
...topAdvertConfig,
...headerConfig, ...headerConfig,
...mainNavConfig, ...mainNavConfig,
...horizontalWrap,
...channelCategoryConfig,
...bannerWrap,
...bannerAdvertConfig, ...bannerAdvertConfig,
...CommonTitle1Config, ...interactAdvertConfig,
...channelQuickNavConfig,
...floorLineConfig, ...floorLineConfig,
...serviceAdvertConfig, ...serviceAdvertConfig,
...CommonTitle2Config, ...CommonTitle2Config,
...AboutUsConfig, ...CompanyInfoConfig,
...AlbumConfig,
...HonroPicConfig,
...InformationConfig, ...InformationConfig,
...FooterConfig ...FooterConfig
} }
......
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const Album: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default Album;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const ChannelAdvert: ComponentConfigTypes = {
propsConfig: {
componentType: {
label: '广告编辑',
type: PROPS_TYPES.advert
},
sliderList: {
label: '广告编辑',
type: PROPS_TYPES.carousel,
},
},
};
export default ChannelAdvert;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const ChannelCategory: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default ChannelCategory;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const ChannelQuickNav: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default ChannelQuickNav;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const CompanyInfo: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default CompanyInfo;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const HonroPic: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default HonroPic;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
const ShopAdvert: ComponentConfigTypes = {
propsConfig: {
componentType: {
label: '广告编辑',
type: PROPS_TYPES.advert
},
sliderList: {
label: '广告编辑',
type: PROPS_TYPES.carousel,
},
},
};
export default ShopAdvert;
...@@ -14,6 +14,8 @@ import ShowCase from './ShowCase' ...@@ -14,6 +14,8 @@ import ShowCase from './ShowCase'
import MallLayout from './MallLayout' import MallLayout from './MallLayout'
import MainNav from './MainNav' import MainNav from './MainNav'
import Advert from './Advert' import Advert from './Advert'
import ChannelAdvert from './ChannelAdvert'
import ShopAdvert from './ShopAdvert'
import QuickNav from './QuickNav' import QuickNav from './QuickNav'
import FloorLine from './FloorLine' import FloorLine from './FloorLine'
import ShopFloorLine from './ShopFloorLine' import ShopFloorLine from './ShopFloorLine'
...@@ -24,6 +26,12 @@ import ShopHeader from './ShopHeader' ...@@ -24,6 +26,12 @@ import ShopHeader from './ShopHeader'
import FindMore from './FindMore' import FindMore from './FindMore'
import Information from './Information' import Information from './Information'
import Footer from './Footer' import Footer from './Footer'
import CompanyInfo from './CompanyInfo'
import Album from './Album'
import HonroPic from './HonroPic'
import ChannelQuickNav from './ChannelQuickNav'
import ChannelCategory from './ChannelCategory'
import MobileBanner from './MobileBanner' import MobileBanner from './MobileBanner'
import MobileChannelBanner from './MobileChannelBanner' import MobileChannelBanner from './MobileChannelBanner'
import MobileQuickNav from './MobileQuickNav' import MobileQuickNav from './MobileQuickNav'
...@@ -43,9 +51,16 @@ export default { ...@@ -43,9 +51,16 @@ export default {
MallLayout, MallLayout,
MainNav, MainNav,
Advert, Advert,
ChannelAdvert,
ShopAdvert,
QuickNav, QuickNav,
FindMore, FindMore,
Information, Information,
CompanyInfo,
Album,
HonroPic,
ChannelQuickNav,
ChannelCategory,
Footer, Footer,
AboutUs, AboutUs,
CommonTitle, CommonTitle,
......
...@@ -56,7 +56,7 @@ interface AdvertItemType { ...@@ -56,7 +56,7 @@ interface AdvertItemType {
interface AdvertSettingPropsType { interface AdvertSettingPropsType {
advertList: AdvertItemType[]; advertList: AdvertItemType[];
onChange: Function; onChange: Function;
type: 'top' | 'banner' | 'interact' | 'category'; type: 'top' | 'banner' | 'interact' | 'category' | 'service';
templateid: number; templateid: number;
categoryid?: number; categoryid?: number;
templateType: 'channel' | 'shop' templateType: 'channel' | 'shop'
...@@ -78,6 +78,8 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref) ...@@ -78,6 +78,8 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
return "285*120" return "285*120"
case 'category': case 'category':
return "500*90" return "500*90"
case 'service':
return "580*90"
} }
} }
...@@ -262,7 +264,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref) ...@@ -262,7 +264,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
postFn(param).then(res => { postFn(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve() resolve(true)
} else { } else {
message.error(res.message) message.error(res.message)
reject() reject()
......
...@@ -10,7 +10,7 @@ export const mallLayoutConfig = { ...@@ -10,7 +10,7 @@ export const mallLayoutConfig = {
"background": "#FFF" "background": "#FFF"
} }
}, },
"childNodes": ["1", "3", "4", "5", "17", "18", "6"] "childNodes": ["1", "3", "4", "5"]
}, },
} }
...@@ -27,7 +27,7 @@ export const topBarConfig = { ...@@ -27,7 +27,7 @@ export const topBarConfig = {
export const topAdvertConfig = { export const topAdvertConfig = {
key: "2", key: "2",
"2": { "2": {
"componentName": "Advert", "componentName": "ShopAdvert",
"props": { "props": {
"type": "top", "type": "top",
"linkdisable": true, "linkdisable": true,
...@@ -51,14 +51,15 @@ export const mainNavConfig = { ...@@ -51,14 +51,15 @@ export const mainNavConfig = {
key: "4", key: "4",
"4": { "4": {
"componentName": "MainNav", "componentName": "MainNav",
"props": {}, "props": {
},
}, },
} }
export const bannerAdvertConfig = { export const bannerAdvertConfig = {
key: "5", key: "5",
"5": { "5": {
"componentName": "Advert", "componentName": "ShopAdvert",
"props": { "props": {
"type": "banner", "type": "banner",
"linkdisable": true, "linkdisable": true,
...@@ -67,21 +68,10 @@ export const bannerAdvertConfig = { ...@@ -67,21 +68,10 @@ export const bannerAdvertConfig = {
}, },
} }
export const CommonTitle1Config = {
key: "6",
"6": {
"componentName": "CommonTitle",
"props": {
"title": "热销商品",
"type": "primary"
},
},
}
export const serviceAdvertConfig = { export const serviceAdvertConfig = {
key: "16", key: "16",
"16": { "16": {
"componentName": "Advert", "componentName": "ShopAdvert",
"props": { "props": {
"type": "service", "type": "service",
"linkdisable": true, "linkdisable": true,
...@@ -90,39 +80,34 @@ export const serviceAdvertConfig = { ...@@ -90,39 +80,34 @@ export const serviceAdvertConfig = {
}, },
} }
export const CompanyInfoConfig = {
export const CommonTitle2Config = {
key: "17",
"17": {
"componentName": "CommonTitle",
"props": {
"title": "关于我们",
"type": "primary"
},
},
}
export const AboutUsConfig = {
key: "18", key: "18",
"18": { "18": {
"componentName": "AboutUs", "componentName": "CompanyInfo",
"props": { "props": {},
"shopInfo": {}
},
}, },
} }
export const InformationConfig = { export const AlbumConfig = {
key: '19', key: "19",
"19": { "19": {
"componentName": "Information", "componentName": "Album",
"props": {}, "props": {},
}, },
} }
export const FooterConfig = { export const HonroPicConfig = {
key: '20', key: "20",
"20": { "20": {
"componentName": "HonroPic",
"props": {},
},
}
export const FooterConfig = {
key: '21',
"21": {
"componentName": "Footer", "componentName": "Footer",
"props": {}, "props": {},
}, },
......
...@@ -6,17 +6,17 @@ export const menuData = [ ...@@ -6,17 +6,17 @@ export const menuData = [
}, },
{ {
"path": "/shop/commodity", "path": "/shop/commodity",
"name": "商品", "name": "现货商品",
"key": "shopCommodity", "key": "shopCommodity",
}, },
{ {
"path": "/shop/pointsMall", "path": "/shop/pointsMall",
"name": "积分兑换", "name": "询价商品",
"key": "shopPointsMall", "key": "shopPointsMall",
}, },
{ {
"path": "/shop/infomation", "path": "/shop/infomation",
"name": "资讯", "name": "积分兑换",
"key": "shopInfomation", "key": "shopInfomation",
}, },
{ {
...@@ -24,4 +24,4 @@ export const menuData = [ ...@@ -24,4 +24,4 @@ export const menuData = [
"name": "关于我们", "name": "关于我们",
"key": "shopAbout", "key": "shopAbout",
}, },
] ]
\ No newline at end of file
...@@ -5,7 +5,7 @@ import DesignPanel from '../components/DesignPanel' ...@@ -5,7 +5,7 @@ import DesignPanel from '../components/DesignPanel'
import SettingPanel from '../settingsPanel' import SettingPanel from '../settingsPanel'
import config from '../configs' import config from '../configs'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, CommonTitle1Config, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, AboutUsConfig, InformationConfig, FooterConfig } from './defaultData' import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, mallLayoutConfig, serviceAdvertConfig, CompanyInfoConfig, AlbumConfig, HonroPicConfig, FooterConfig } from './defaultData'
import { menuData } from './defaultMenu' import { menuData } from './defaultMenu'
import Loading from '../components/Loading' import Loading from '../components/Loading'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -124,13 +124,14 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -124,13 +124,14 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
/** /**
* 获取店铺信息 * 获取店铺信息
*/ */
const fetchShopInfo = () => { const fetchShopInfo = (shopId: number) => {
return new Promise((resolve) => { return new Promise((resolve) => {
const param: any = { const param: any = {
memberId, memberId,
roleId: memberRoleId roleId: memberRoleId,
shopId,
} }
PublicApi.getTemplateWebMemberShopWebFindByMemberIdAndRoleId(param).then(res => { PublicApi.getTemplateWebMemberShopWebMemberShopMain(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
...@@ -151,14 +152,17 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -151,14 +152,17 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
// 二号位广告 // 二号位广告
serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType() serviceAdvertConfig[serviceAdvertConfig.key].props.advertList = await findSecondAdvertsByType()
//店铺信息 //店铺信息
const shopInfo = await fetchShopInfo()
headerConfig[headerConfig.key].props.shopInfo = shopInfo
const shopList = GlobalConfig.web.shopInfo const shopList = GlobalConfig.web.shopInfo
const webMallInfo = shopList.filter(item => item.environment === 1 && item.type === 1)[0] const webMallInfo = shopList.filter(item => item.environment === 1 && item.type === 1)[0]
const shopInfo: any = await fetchShopInfo(webMallInfo.id)
headerConfig[headerConfig.key].props.shopInfo = shopInfo
headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl
topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name
AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo CompanyInfoConfig[CompanyInfoConfig.key].props.shopInfo = shopInfo || {}
AlbumConfig[AlbumConfig.key].props.workshopPics = shopInfo.workshopPics || []
HonroPicConfig[HonroPicConfig.key].props.honorPics = shopInfo.honorPics || []
// AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo
let initIndex = 100 let initIndex = 100
let floorLineConfig: any = {} let floorLineConfig: any = {}
const floorLineKeys: any = [] const floorLineKeys: any = []
...@@ -211,7 +215,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -211,7 +215,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
} }
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, FooterConfig.key] mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CompanyInfoConfig.key, AlbumConfig.key, HonroPicConfig.key, FooterConfig.key]
const config = { const config = {
...mallLayoutConfig, ...mallLayoutConfig,
...topBarConfig, ...topBarConfig,
...@@ -219,11 +223,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -219,11 +223,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...headerConfig, ...headerConfig,
...mainNavConfig, ...mainNavConfig,
...bannerAdvertConfig, ...bannerAdvertConfig,
...CommonTitle2Config,
...AboutUsConfig,
...CommonTitle1Config,
...floorLineConfig, ...floorLineConfig,
...serviceAdvertConfig, ...serviceAdvertConfig,
...CompanyInfoConfig,
...AlbumConfig,
...HonroPicConfig,
...FooterConfig ...FooterConfig
} }
setComponentConfigs(config) setComponentConfigs(config)
......
...@@ -28,8 +28,8 @@ export const formatSpecialProps = (props: any, propsConfig: any) => { ...@@ -28,8 +28,8 @@ export const formatSpecialProps = (props: any, propsConfig: any) => {
if (funcTemplate) { if (funcTemplate) {
nextProps[k] = () => eval(funcTemplate); nextProps[k] = () => eval(funcTemplate);
} else { } else {
nextProps[k] = () => { // nextProps[k] = () => {
}; // };
} }
} }
} else if (isObject(v) && !isEmpty(propsConfig[k].childPropsConfig) && isEqual(keys(v), keys(propsConfig[k].childPropsConfig))) { } else if (isObject(v) && !isEmpty(propsConfig[k].childPropsConfig) && isEqual(keys(v), keys(propsConfig[k].childPropsConfig))) {
...@@ -134,7 +134,6 @@ export const diffProps = (restProps: any, props: any) => { ...@@ -134,7 +134,6 @@ export const diffProps = (restProps: any, props: any) => {
}); });
return props; return props;
}; };
...@@ -153,19 +152,20 @@ export const getAdvertType = (type) => { ...@@ -153,19 +152,20 @@ export const getAdvertType = (type) => {
switch (type) { switch (type) {
case 'banner': case 'banner':
return 1 return 1
case 'service':
case 'interact': case 'interact':
return 2 return 2
case 'service':
return 3
} }
} }
/** /**
* 往数组添加模板id字段 * 往数组添加模板id字段
* @param list * @param list
*/ */
export const addTempalteIdToList = (list, templateId) => { export const addTempalteIdToList = (list, templateId) => {
return list.map(item => { return list.map(item => {
item.templateId = templateId item.templateId = templateId
return item return item
}) })
} }
\ No newline at end of file
...@@ -23,8 +23,8 @@ import { GlobalConfig } from '@/global/config' ...@@ -23,8 +23,8 @@ import { GlobalConfig } from '@/global/config'
import ErrorResult from './error' import ErrorResult from './error'
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
import useStoreId from '@/hooks/useStoreId' import useStoreId from '@/hooks/useStoreId'
import { OrderModalType } from '@/constants/order'
import { LAYOUT_TYPE, COMMODITY_TYPE, OrderModalType } from '@/constants' import { LAYOUT_TYPE, COMMODITY_TYPE } from '@/constants'
const Logistics_Type = { const Logistics_Type = {
1: '物流', 1: '物流',
......
...@@ -16,7 +16,8 @@ import SignModal from '@/components/SignModal' ...@@ -16,7 +16,8 @@ import SignModal from '@/components/SignModal'
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE } from '@/constants' import { OrderModalType } from '@/constants/order'
import { LAYOUT_TYPE, COMMODITY_TYPE } from '@/constants'
import useStoreId from '@/hooks/useStoreId' import useStoreId from '@/hooks/useStoreId'
interface OrderPropsType { interface OrderPropsType {
......
...@@ -11,7 +11,8 @@ import { priceFormat, numFormat } from "@/utils/numberFomat" ...@@ -11,7 +11,8 @@ import { priceFormat, numFormat } from "@/utils/numberFomat"
import { useLocalStore, observer } from 'mobx-react' import { useLocalStore, observer } from 'mobx-react'
import ImageBox from '@/components/ImageBox' import ImageBox from '@/components/ImageBox'
import { store } from '@/store' import { store } from '@/store'
import { LAYOUT_TYPE, OrderModalType } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import { OrderModalType } from '@/constants/order'
import { GetSearchShopPurchaseGetPurchaseListResponse } from '@/services/SearchApi' import { GetSearchShopPurchaseGetPurchaseListResponse } from '@/services/SearchApi'
import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi' import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi'
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
......
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
// 渠道科技类模板 // 渠道科技类模板
.theme-channel-science { .theme-channel-science {
font-size: 14px; font-size: 14px;
--mall_main_color: #464552; --mall_main_color: #00B37A;
--mall_sub_color: #00B37F; --mall_main_color_opacity_2: #daf2e7;
--mall_sub_color: #daf2e7;
--mall_main_nav_hover_color: #00B37A; --mall_main_nav_hover_color: #00B37A;
--category_content_bg: #464552; --category_content_bg: #FFFFFF;
--category_content_title_text: #FFFFFF; --category_content_title_text: #303133;
--category_content_title_text_hover: #FFFFFF; --category_content_title_text_hover: #00B37A;
--category_content_sub_title_text: rgba(255, 255, 255, 0.45); --category_content_sub_title_text: #606266;
} }
// 店铺科技类模板颜色配置 // 店铺科技类模板颜色配置
......
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