Commit 53613721 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 60202838 99d69887
import { ComponentSchemaType, PROPS_TYPES } from '@lingxi-disign/core';;
const Album: ComponentSchemaType = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default Album;
import { ComponentSchemaType, PROPS_SETTING_TYPES } from '@lingxi-disign/core';;
const ChannelAdvert: ComponentSchemaType = {
propsConfig: {
componentType: {
label: '广告编辑',
type: PROPS_SETTING_TYPES.advert
},
sliderList: {
label: '广告编辑',
type: PROPS_SETTING_TYPES.carousel,
},
},
};
export default ChannelAdvert;
import { ComponentSchemaType, PROPS_TYPES } from '@lingxi-disign/core';;
const ChannelCategory: ComponentSchemaType = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default ChannelCategory;
import { ComponentSchemaType, PROPS_TYPES } from '@lingxi-disign/core';;
const ChannelQuickNav: ComponentSchemaType = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default ChannelQuickNav;
import { ComponentSchemaType, PROPS_TYPES } from '@lingxi-disign/core';;
const CompanyInfo: ComponentSchemaType = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default CompanyInfo;
import { ComponentSchemaType, PROPS_TYPES } from '@lingxi-disign/core';;
const HonroPic: ComponentSchemaType = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default HonroPic;
import { ComponentSchemaType, PROPS_SETTING_TYPES } from '@lingxi-disign/core';;
const ShopAdvert: ComponentSchemaType = {
propsConfig: {
componentType: {
label: '广告编辑',
type: PROPS_SETTING_TYPES.advert
},
sliderList: {
label: '广告编辑',
type: PROPS_SETTING_TYPES.carousel,
},
},
};
export default ShopAdvert;
......@@ -58,6 +58,13 @@ import RecommendCommodityList from './RecommendCommodityList'
import RecommendInformationList from './RecommendInformationList'
import RecommendShopList from './RecommendShopList'
import ClassifyLabel from './ClassifyLabel'
import ShopAdvert from './ShopAdvert'
import ChannelAdvert from './ChannelAdvert'
import ChannelCategory from './ChannelCategory'
import ChannelQuickNav from './ChannelQuickNav'
import Album from './Album'
import HonroPic from './HonroPic'
import CompanyInfo from './CompanyInfo'
export default {
View,
......@@ -120,4 +127,11 @@ export default {
RecommendInformationList,
...RecommendShopList,
...ClassifyLabel,
ShopAdvert,
ChannelAdvert,
ChannelCategory,
ChannelQuickNav,
Album,
HonroPic,
CompanyInfo,
};
import { LAYOUT_TYPE } from "@/constants"
export const mallLayoutConfig = {
key: "0",
"0": {
"componentName": "MallLayout",
"props": {
"style": {
"width": "100%",
"minHeight": "100%",
"background": "#FFF"
}
},
"childNodes": ["1", "3", "4", "5", "6"]
},
}
const shopInfo = {
"id": 3,
"logo": "https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/8225da43b0bb4d6199a028a63d9f8da91603161481060.jpg",
......@@ -32,6 +19,7 @@ const shopInfo = {
"storeUrl": "http://lingxi.shushangyun.com/shop/pointsMall?shopId=eyJzaG9wSWQiOjMsIm1lbWJlcklkIjo5fQ==",
"customerUrl": " http://10.0.0.25:4396/shop?shopId=eyJzaG9wSWQiOm51bGwsIm1lbWJlcklkIjpudWxsfQ==",
"allStatus": 0,
"memberName": "广州市数商云网络科技有限公司",
"company": "广州市数商云网络科技有限公司",
"templateId": 3,
"fileName": "science",
......@@ -41,6 +29,21 @@ const shopInfo = {
"registerYears": 1,
}
export const mallLayoutConfig = {
key: "0",
"0": {
"componentName": "MallLayout",
"props": {
"style": {
"width": "100%",
"minHeight": "100%",
"background": "#FFF"
}
},
"childNodes": ["1", "3", "4", "5"]
},
}
export const topBarConfig = {
key: "1",
"1": {
......@@ -52,27 +55,13 @@ export const topBarConfig = {
}
}
export const topAdvertConfig = {
key: "2",
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
}
export const headerConfig = {
key: "3",
"3": {
"componentName": "ChannelHeader",
"props": {
"shopInfo": shopInfo,
"logoUrl": shopInfo.logo
"channelInfo": shopInfo,
"logo": shopInfo.logo
},
},
}
......@@ -81,14 +70,58 @@ export const mainNavConfig = {
key: "4",
"4": {
"componentName": "MainNav",
"props": {},
"props": {
menuData: [],
type: LAYOUT_TYPE.channel
},
},
}
export const bannerAdvertConfig = {
export const horizontalWrap = {
key: "5",
"5": {
"componentName": "Advert",
"componentName": "View",
"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": "View",
"props": {
"style": {
"margin": "0 16px",
"flex": 1,
"width": 0,
}
},
"childNodes": ["8", "9"]
},
}
export const bannerAdvertConfig = {
key: "8",
"8": {
"componentName": "ChannelAdvert",
"props": {
"type": "banner",
"linkdisable": true,
......@@ -122,21 +155,35 @@ export const bannerAdvertConfig = {
},
}
export const CommonTitle1Config = {
key: "6",
"6": {
"componentName": "CommonTitle",
export const interactAdvertConfig = {
key: "9",
"9": {
"componentName": "ChannelAdvert",
"props": {
"title": "热销商品",
"type": "primary"
"type": "interact",
"linkdisable": true,
"advertList": []
}
},
}
export const channelQuickNavConfig = {
key: "10",
"10": {
"componentName": "ChannelQuickNav",
"props": {
"linkdisable": true,
channelInfo: shopInfo
}
},
}
export const serviceAdvertConfig = {
key: "16",
"16": {
"componentName": "Advert",
"componentName": "ChannelAdvert",
"props": {
"type": "service",
"linkdisable": true,
......@@ -190,6 +237,52 @@ export const CommonTitle2Config = {
},
}
export const CompanyInfoConfig = {
key: "18",
"18": {
"componentName": "CompanyInfo",
"props": {
shopInfo
},
},
}
export const AlbumConfig = {
key: "19",
"19": {
"componentName": "Album",
"props": {
workshopPics: shopInfo.workshopPics
},
},
}
export const HonroPicConfig = {
key: "20",
"20": {
"componentName": "HonroPic",
"props": {
honorPics: shopInfo.honorPics
},
},
}
export const topAdvertConfig = {
key: "2",
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
}
export const AboutUsConfig = {
key: "18",
"18": {
......@@ -217,9 +310,18 @@ const changeColumn = (data) => {
}
export const FooterConfig = {
key: '22',
"22": {
"componentName": "Footer",
"props": {},
},
}
export const InformationConfig = {
key: '19',
"19": {
key: '21',
"21": {
"componentName": "Information",
"props": {
newsList: {
......@@ -326,12 +428,3 @@ export const InformationConfig = {
},
},
}
export const FooterConfig = {
key: '20',
"20": {
"componentName": "Footer",
"props": {},
},
}
import React, { useEffect, useState } from 'react';
import { BrickProvider } from '@lingxi-disign/react';
import { LAYOUT_TYPE } from '@/constants';
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 { menuData } from './defaultMenu';
import styles from './index.less';
import ToolBar from '../../components/toolBar';
......@@ -27,7 +27,7 @@ interface ShopPreviewPropsType {
const TemplateList = ['science'];
const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
const { query: { template } } = props.location;
const { query: { template, id } } = props.location;
const [loading, setLoading] = useState<boolean>(true);
const [theme, setTheme] = useState<string>('theme-channel-science');
const [componentConfigs, setComponentConfigs] = useState({});
......@@ -204,22 +204,28 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
initIndex += 100;
}
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 = {
...mallLayoutConfig,
...topBarConfig,
...topAdvertConfig,
...headerConfig,
...mainNavConfig,
...horizontalWrap,
...channelCategoryConfig,
...bannerWrap,
...bannerAdvertConfig,
...CommonTitle1Config,
...interactAdvertConfig,
...channelQuickNavConfig,
...floorLineConfig,
...serviceAdvertConfig,
...CommonTitle2Config,
...AboutUsConfig,
...CompanyInfoConfig,
...AlbumConfig,
...HonroPicConfig,
...InformationConfig,
...FooterConfig
};
}
setComponentConfigs(config);
setLoading(false);
};
......@@ -229,7 +235,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
config={config}
>
<div className={styles['wrapper']}>
<ToolBar type={2} title="首页" />
<ToolBar templateId={Number(id)} type={2} title="首页" />
<div className={styles['content']}>
<div className={styles['canvas-container']}>
<PreviewPanel theme={theme} pageConfig={componentConfigs} />
......
......@@ -73,7 +73,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
const headers: any = {
shopId
}
getTemplateWebCategoryWebFindAllFirstCategory({}, { headers }).then(res => {
getTemplateWebCategoryWebFindAllFirstCategory({ templateId: String(id) }, { headers }).then(res => {
if (res.code === 1000) {
resolve(res.data);
} else {
......
......@@ -35,7 +35,7 @@ interface MallEditPropsType {
* 模板名称
*/
template: string;
shopId: number;
shopId: string;
}
}
}
......@@ -43,7 +43,7 @@ interface MallEditPropsType {
const TemplateList = ['science'];
const MallEdit: React.FC<MallEditPropsType> = (props) => {
const { query: { id, template } } = props.location;
const { query: { id, template, shopId } } = props.location;
const [loading, setLoading] = useState<boolean>(true);
const [theme, setTheme] = useState<string>('theme-mall-science');
const [componentConfigs, setComponentConfigs] = useState({});
......@@ -178,7 +178,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
pageSize: 6,
overdue: true
};
getPurchaseInviteTenderGetInviteTenderListByEnterpriseWeb(param).then((res) => {
const headers: any = {
shopId: GlobalConfig.srmMallId || 0
}
getPurchaseInviteTenderGetInviteTenderListByEnterpriseWeb(param, { headers }).then((res) => {
if (res.code === 1000) {
let list: any[] = res.data.data;
list = list.map((item) => {
......
......@@ -27,7 +27,7 @@ export const topBarConfig = {
export const topAdvertConfig = {
key: "2",
"2": {
"componentName": "Advert",
"componentName": "ShopAdvert",
"props": {
"type": "top",
"linkdisable": true,
......@@ -86,7 +86,7 @@ export const mainNavConfig = {
export const bannerAdvertConfig = {
key: "5",
"5": {
"componentName": "Advert",
"componentName": "ShopAdvert",
"props": {
"type": "banner",
"linkdisable": true,
......
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