Commit cb890863 authored by GuanHua's avatar GuanHua

feat: 平台首页装修

parent f544eff1
......@@ -51,6 +51,7 @@ export enum TEMPLATE_TYPE {
}
export enum TEMPLATE_TYPE_TEXT {
platform = 'platform',
mall = 'mall',
shop = 'shop',
goods = 'goods',
......
......@@ -51,7 +51,7 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
<span>{templateInfo.siteName}</span>
</div>
{
type !== TEMPLATE_TYPE_TEXT.goods && (
(type !== TEMPLATE_TYPE_TEXT.goods && type !== TEMPLATE_TYPE_TEXT.platform) && (
<div className={styles.template_info_content_text_line}>
<label>使用商城:</label>
<span title={templateInfo.shopName}>{templateInfo.shopName}</span>
......@@ -60,7 +60,7 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
}
</div>
{
type === TEMPLATE_TYPE_TEXT.mall ? (
(type === TEMPLATE_TYPE_TEXT.mall || type === TEMPLATE_TYPE_TEXT.platform) ? (
<div className={cx(styles.template_item_btn, templateInfo.status === 1 ? styles.active : '')}>
<PlayCircleOutlined />
<label>{templateInfo.status === 1 ? '启用中' : '启用'}</label>
......
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页添加推荐商品
const PlatformAddGoodsItem: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformAddGoodsItem;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页广告编辑
const PlatformAdvert: ComponentConfigTypes = {
propsConfig: {
componentType: {
label: '广告编辑',
type: PROPS_TYPES.platformAdvert
},
sliderList: {
label: '广告编辑',
type: PROPS_TYPES.carousel,
},
},
};
export default PlatformAdvert;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页品牌馆
const PlatformBrand: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformBrand;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页推荐商品
const PlatformGoods: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformGoods;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页行情资讯
const PlatformInformation: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformInformation;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页物流服务
const PlatformLogistics: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformLogistics;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页实力商家
const PlatformMerchant: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformMerchant;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页加工服务
const PlatformProcess: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformProcess;
import { ComponentConfigTypes, PROPS_TYPES, NODE_PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页名企采购
const PlatformPurchase: ComponentConfigTypes = {
nodePropsConfig: {
overflowedIndicator: {
type: NODE_PROPS_TYPES.reactNode,
isOnlyNode: true,
},
children: {
type: NODE_PROPS_TYPES.reactNode,
childNodesRule: [
'PlatformPurchase.Banner'
],
},
},
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
const Banner: ComponentConfigTypes = {
propsConfig: {
componentType: {
label: '分类广告推荐设置',
type: PROPS_TYPES.categoryBanner
},
dataList: {
label: '分类广告推荐设置',
type: PROPS_TYPES.categoryBanner,
},
},
};
export default {
PlatformPurchase,
'PlatformPurchase.Banner': Banner,
};
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页快捷导航
const PlatformQuickNav: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformQuickNav;
import { ComponentConfigTypes, PROPS_TYPES } from 'lingxi-editor-core';
// 平台首页平台服务
const PlatformService: ComponentConfigTypes = {
propsConfig: {
children: {
label: '文本内容',
type: PROPS_TYPES.string,
},
},
};
export default PlatformService;
......@@ -26,6 +26,17 @@ import MobileQuickNav from './MobileQuickNav'
import MobileRecommendShops from './MobileRecommendShops'
import MobileShowCase from './MobileShowCase'
import Category from './Category'
import PlatformQuickNav from './PlatformQuickNav'
import PlatformAdvert from './PlatformAdvert'
import PlatformGoods from './PlatformGoods'
import PlatformBrand from './PlatformBrand'
import PlatformLogistics from './PlatformLogistics'
import PlatformMerchant from './PlatformMerchant'
import PlatformProcess from './PlatformProcess'
import PlatformPurchase from './PlatformPurchase'
import PlatformService from './PlatformService'
import PlatformInformation from './PlatformInformation'
import PlatformAddGoodsItem from './PlatformAddGoodsItem'
export default {
TopBar,
......@@ -56,4 +67,15 @@ export default {
MobileRecommendShops,
MobileShowCase,
Category,
PlatformQuickNav,
PlatformAdvert,
PlatformGoods,
PlatformBrand,
PlatformLogistics,
PlatformMerchant,
PlatformInformation,
PlatformProcess,
...PlatformPurchase,
PlatformService,
PlatformAddGoodsItem,
}
......@@ -3,11 +3,12 @@ import { reactContainers, reactNonContainers } from './reactCategory';
// import * as Ants from 'antd/es';
import * as LingXiUI from 'lingxi-design-ui'
import AllComponentConfigs from './componentConfigs';
import * as CustomComponents from '../customComponents'
import { CategoryType, ConfigType } from 'lingxi-editor-core';
import { flattenDeepArray } from '../utils';
import { message } from 'antd';
const originalComponents = { ...LingXiUI }
const originalComponents = { ...LingXiUI, ...CustomComponents }
/**
* 容器组件分类
......
......@@ -45,6 +45,18 @@ export const reactContainers: CategoryType = {
'FloorLine.Horizontal': null,
}
},
'PlatformPurchase': {
components: {
'PlatformPurchase': {
props: [{
style: {
height: 100,
}
}]
},
'PlatformPurchase.Banner': null
}
},
'ShopFloorLine': {
components: {
'ShopFloorLine': {
......
.add_goods_item {
width: 1200px;
height: 32px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
border: 1px dashed #00B37A;
margin-top: 16px;
cursor: pointer;
.add_icon {
margin-right: 9.4px;
color: #00B37A;
}
.add_text {
color: #00B37A;
font-size: 12px;
}
}
import React from 'react'
import { PlusCircleOutlined } from '@ant-design/icons'
import cx from 'classnames'
import styles from './index.less'
interface AddGoodsItemProps {
className?: string
}
const AddGoodsItem: React.FC<AddGoodsItemProps> = (props) => {
const { className, ...others } = props
const classNameString = cx(styles.add_goods_item, className)
return (
<div className={classNameString} {...others}>
<PlusCircleOutlined className={styles.add_icon} />
<span className={styles.add_text}>添加新的推荐商品模块</span>
</div>
)
}
export default AddGoodsItem
export { default as PlatformAddGoodsItem } from './AddGoodsItem'
......@@ -9,7 +9,7 @@ export const mallLayoutConfig = {
"minHeight": "100%"
}
},
"childNodes": ["1", "3", "4", "21"]
"childNodes": ["1", "3", "4", "5", "13", "30", "14", "15", "16", "17", "18", "19", "20", "22"]
},
}
......@@ -23,24 +23,12 @@ export const topBarConfig = {
}
}
export const topAdvertConfig = {
key: "2",
"2": {
"componentName": "Advert",
"props": {
"type": "top",
"linkdisable": true,
"advertList": []
},
},
}
export const headerConfig = {
key: "3",
"3": {
"componentName": "Header",
"props": {
"logoUrl": ""
"type": "platform"
},
},
}
......@@ -53,28 +41,10 @@ export const mainNavConfig = {
},
}
// < div className = { styles.horizontalWrap } >
// <Category categoryList={ categoryList } />
// < div className = { styles.bannerWrap } >
// {
// useMemo(() => <Advert type="banner" advertList = { firstAdvertList } />, [firstAdvertList])
// }
// {
// useMemo(() => <Advert type="interact" advertList = { secondAdvertList } />, [secondAdvertList])
// }
// </div>
// < div className = { styles.quickNavWrap } >
// <QuickNav
// userInfo={ userInfo }
// userRoles = { userRoles }
// name = { mallInfo?.name }
// advertList = { secondAdvertList }
// />
// </div>
// < /div>
export const bannerContainer = {
key: "21",
"21": {
key: "5",
"5": {
"componentName": "div",
"props": {
"style": {
......@@ -85,13 +55,13 @@ export const bannerContainer = {
margin: "0 auto",
}
},
"childNodes": ["22", "23", "24"]
"childNodes": ["6", "7", "12"]
}
}
export const categoryConfig = {
key: "22",
"22": {
key: "6",
"6": {
"componentName": "Category",
"props": {
categoryList: [],
......@@ -101,94 +71,170 @@ export const categoryConfig = {
}
export const bannerWrap = {
key: "23",
"23": {
key: "7",
"7": {
"componentName": "div",
"props": {
"style": {
margin: "0 16px",
flex: 1,
width: 0,
padding: '0 16px',
}
},
"childNodes": ["5", "6"]
"childNodes": ["8", "11"]
}
}
export const quickNavConfigWrap = {
key: "24",
"24": {
export const bannerHorizontal = {
key: "8",
"8": {
"componentName": "div",
"props": {},
"childNodes": ["25", "26"]
"props": {
"style": {
display: 'flex',
justifyContent: 'space-between',
}
}
export const quickNavConfig = {
key: "25",
"25": {
"componentName": "QuickNav",
"props": {},
},
"childNodes": ["9", "10"]
}
}
export const navAdvertConfig = {
key: "26",
"26": {
"componentName": "Advert",
export const bannerAdvertConfig = {
key: "9",
"9": {
"componentName": "PlatformAdvert",
"props": {
"type": "nav",
"type": "banner",
"linkdisable": true,
"advertList": []
},
}
},
}
export const bannerAdvertConfig = {
key: "5",
"5": {
"componentName": "Advert",
export const bannerRightAdvertConfig = {
key: "10",
"10": {
"componentName": "PlatformAdvert",
"props": {
"type": "banner",
"hasQuickNav": false,
"type": "bannerRight",
"linkdisable": true,
"advertList": []
}
},
}
export const interactAdvertConfig = {
key: "6",
"6": {
"componentName": "Advert",
export const bannerBottomAdvertConfig = {
key: "11",
"11": {
"componentName": "PlatformAdvert",
"props": {
"type": "interact",
"type": "bannerBottom",
"linkdisable": true,
"advertList": []
}
},
}
export const quickNavConfigWrap = {
key: "12",
"12": {
"componentName": "PlatformQuickNav",
"props": {},
}
}
export const PlatformGoodsConfig = {
key: "13",
"13": {
"componentName": "PlatformGoods",
"props": {
"dataInfo": {}
},
}
}
export const PlatformBrandConfig = {
key: "14",
"14": {
"componentName": "PlatformBrand",
"props": {},
}
}
export const FindMoreConfig = {
export const PlatformMerchantConfig = {
key: "15",
"15": {
"componentName": "PlatformMerchant",
"props": {},
}
}
export const PlatformInformationConfig = {
key: "16",
"16": {
"componentName": "PlatformInformation",
"props": {},
}
}
export const PlatformPurchaseConfig = {
key: "17",
"17": {
"componentName": "PlatformPurchase",
"props": {
},
"childNodes": ["21"]
}
}
export const PlatformLogisticsConfig = {
key: "18",
"18": {
"componentName": "FindMore",
"componentName": "PlatformLogistics",
"props": {},
},
}
}
export const InformationConfig = {
key: '19',
export const PlatformProcessConfig = {
key: "19",
"19": {
"componentName": "Information",
"componentName": "PlatformProcess",
"props": {},
}
}
export const PlatformServiceConfig = {
key: "20",
"20": {
"componentName": "PlatformService",
"props": {},
}
}
export const PurchaseAdvertConfig = {
key: "21",
"21": {
"componentName": "PlatformPurchase.Banner",
"props": {
advertList: []
},
}
}
export const FooterConfig = {
key: '20',
"20": {
key: '22',
"22": {
"componentName": "Footer",
"props": {},
},
}
export const PlatformAddGoodsItemConfig = {
key: "30",
"30": {
"componentName": 'PlatformAddGoodsItem',
"props": {},
}
}
import { GlobalConfig } from '@/global/config'
const siteUrl = GlobalConfig.site.siteInfo.siteUrl
/**
* 请求头
*/
export const REQUEST_HEADER = 'http://'
export const getTopDomainByHost = (url: string): string => {
if (!url) return ''
return url.split('.').slice(-2).join('.')
}
export const TOP_DOMAIN = getTopDomainByHost(siteUrl)
export const getMenuData = (shopId: number) => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { id: number}) => item.id === shopId)
if (webMallList.length > 0) {
const SUB_DOMAIN = webMallList[0].url
return [
{
"id": 0,
"link": `${REQUEST_HEADER}${SUB_DOMAIN}.${TOP_DOMAIN}`,
"name": "商城首页",
"status": true,
"key": "shopHome",
},
{
"id": 1,
"link": `${REQUEST_HEADER}${SUB_DOMAIN}.${TOP_DOMAIN}/commodity`,
"name": "现货商品",
"status": true,
"key": "shopCommodity",
},
{
"id": 2,
"link": `${REQUEST_HEADER}${SUB_DOMAIN}.${TOP_DOMAIN}/inquiry`,
"name": "询价商品",
"status": true,
"key": "purchaseOnline",
},
{
"id": 3,
"link": `${REQUEST_HEADER}${SUB_DOMAIN}.${TOP_DOMAIN}/stores`,
"name": "优选店铺",
"status": true,
"key": "shopPointsMall",
},
{
"id": 4,
"link": `${REQUEST_HEADER}${SUB_DOMAIN}.${TOP_DOMAIN}/integral`,
"name": "积分商城",
"key": "shops",
"status": true,
},
{
"id": 5,
"link": `${REQUEST_HEADER}info.${TOP_DOMAIN}`,
"name": "行情资讯",
"status": true,
"key": "shopInfomation",
},
]
}
return []
}
......@@ -23,3 +23,44 @@
overflow: hidden;
}
.toolbar {
width: 100%;
height: 64px;
background-color: #FFF;
display: flex;
align-items: center;
border-bottom: 1px solid #606266;
&_back_btn {
width: 64px;
height: 64px;
text-align: center;
line-height: 64px;
background-color: #606266;
color: #FFF;
cursor: pointer;
}
&_title {
color: #909399;
padding-left: 12px;
font-size: 12px;
&>label {
color: #303133;
font-size: 18px;
margin-left: 4px;
}
}
.toolbar_actions {
margin-left: auto;
padding-right: 24px;
}
}
.modal_confirm {
width: 420px !important;
}
export interface DesingConfigItemType {
name: string,
status: boolean,
content: any
}
export type PlatformConfigType = DesingConfigItemType[]
import { GlobalConfig } from '@/global/config'
const siteUrl = GlobalConfig.site.siteInfo.siteUrl
/**
* 请求头
*/
export const REQUEST_HEADER = 'http://'
export const getTopDomainByHost = (url: string): string => {
if (!url) return ''
return url.split('.').slice(-2).join('.')
}
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 channelList = shopInfo.filter((item: any) => item.type === 3 && item.environment === 1)
if (webMallList.length > 0 && channelList.length > 0) {
const enterpriseSubDomain = webMallList[0].url
const channelSubDomain = channelList[0].url
return [
{
"id": 0,
"link": `${REQUEST_HEADER}www.${TOP_DOMAIN}`,
"name": "首页",
"status": true,
"key": "home",
},
{
"id": 1,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}`,
"name": "企业商城",
"status": true,
"key": "enterpriseMall",
},
{
"id": 2,
"link": `${REQUEST_HEADER}srm.${TOP_DOMAIN}`,
"name": "名企采购",
"status": true,
"key": "srm",
},
{
"id": 3,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}/stores`,
"name": "优选供应商",
"status": true,
"key": "enterpriseMallStores",
},
{
"id": 4,
"link": `${REQUEST_HEADER}${channelSubDomain}.${TOP_DOMAIN}`,
"name": "渠道服务",
"status": true,
"key": "channel",
},
{
"id": 5,
"link": `${REQUEST_HEADER}logistics.${TOP_DOMAIN}`,
"name": "物流服务",
"key": "logistics",
"status": true,
},
{
"id": 6,
"link": `${REQUEST_HEADER}manufacture.${TOP_DOMAIN}`,
"name": "加工服务",
"status": true,
"key": "process",
},
{
"id": 7,
"link": `${REQUEST_HEADER}${enterpriseSubDomain}.${TOP_DOMAIN}/integral`,
"name": "积分商城",
"status": true,
"key": "enterprisePointsMall",
},
{
"id": 8,
"link": `${REQUEST_HEADER}info.${TOP_DOMAIN}`,
"name": "行情资讯",
"status": true,
"key": "information",
},
]
}
return []
}
/**
* 一开始没有装修过用的初始数据
*/
export const defaultDesignConfig = [
{
name: 'navList',
status: true,
content: getMenuData()
},
{
name: 'bannerAdvert',
status: true,
content: [
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/积分商城-默认头图639ead79aac64d7aaff5492ecb7fa0d7.jpg'
},
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/积分商城-默认头图639ead79aac64d7aaff5492ecb7fa0d7.jpg'
}
]
},
{
name: 'bannerRightAdvert',
status: true,
content: [
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/20210526172707d615298a7f8e4439bf5d137517d8cd34.jpg'
}
]
},
{
name: 'banneBottomrAdvert',
status: true,
content: [
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/202105261727241c2b85a9823c4f13bdd1b01bb10d3cb6.jpg'
},
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/202105261727241c2b85a9823c4f13bdd1b01bb10d3cb6.jpg'
},
{
link: '',
imgUrl: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/20210526172735392fd23b81d3447eb11330090a64f035.jpg'
}
]
},
{
name: 'fastVisit',
status: true,
content: {
sellerBOList: [
{
name: '上传商品',
icon: '',
link: '',
},
{
name: '报价',
icon: '',
link: '',
},
{
name: '接单',
icon: '',
link: '',
}
],
buyerBOList: [
{
name: '我要求购',
icon: '',
link: '',
},
{
name: '报价信息',
icon: '',
link: '',
},
{
name: '我的订单',
icon: '',
link: '',
}
],
fastFunctionBOList: [
{
name: '找现货',
icon: '',
link: '',
},
{
name: '找供应',
icon: '',
link: '',
},
{
name: '去求购',
icon: '',
link: '',
},
{
name: '找店铺',
icon: '',
link: '',
},
{
name: '换积分',
icon: '',
link: '',
},
{
name: '看资讯',
icon: '',
link: '',
}
]
}
},
{
name: 'goods',
status: true,
content: [
{
"advertImg": "",
"shopId": undefined,
"firstId": undefined,
"secondId": undefined,
"thirdlyId": undefined,
"name": "",
"describe": "",
"goodsIdList": []
}
]
},
{
name: 'brand',
status: true,
content: []
},
{
name: 'merchant',
status: true,
content: []
},
{
name: 'marketInformation',
status: true,
content: {
marketBOList: [],
informationBO: {
allIdList: [],
bazaarIdList: [],
hotIdList: [],
}
}
},
{
name: 'middleAdvert',
status: true,
content: []
},
{
name: 'purchase',
status: true,
content: []
},
{
name: 'logistics',
status: true,
content: {
advertImg: "",
link: "",
advertTitle: "",
advertDescribe: "",
logisticsMerchantBOList: []
}
},
{
name: 'process',
status: true,
content: {
advertImg: "",
link: "",
advertTitle: "",
advertDescribe: "",
processMerchantBOList: []
}
},
{
name: 'platform',
status: true,
content: []
},
{
name: 'bottomAdvert',
status: true,
content: []
}
]
......@@ -33,7 +33,7 @@ const ShopCenterTemplate: React.FC<ShopCenterTemplatePropsType> = (props) => {
{
templateList.map(item => (
<Col xxl={6} xl={8} lg={12} key={item.id}>
<TemplateItem templateInfo={item} type="mall" />
<TemplateItem templateInfo={item} type="platform" />
</Col>
))
}
......
.advert_setting {
.advert_setting_title {
position: relative;
height: 32px;
line-height: 32px;
}
.advert_setting_line {
margin-bottom: 12px;
display: flex;
background-color: #FFF;
&_main {
position: relative;
flex: 1;
}
&_addItem {
flex: 1;
margin-top: 16px;
&_input {
width: 100%;
}
&_line {
display: flex;
margin-bottom: 16px;
&_label {
width: 80px;
}
&_brief {
flex: 1;
}
}
}
&_sort {
width: 32px;
background-color: #FAFBFC;
height: 32px;
line-height: 32px;
text-align: center;
margin-right: 8px;
}
&_name {
display: flex;
flex: 1;
height: 32px;
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #FAFBFC;
&>.icon {
cursor: pointer;
width: 32px;
height: 32px;
line-height: 32px;
margin-right: 12px;
}
}
&_operation {
margin-left: auto;
background-color: #FAFBFC;
&_btn {
margin-left: 16px;
width: 16px;
&_icon {
width: 16px;
height: 16px;
}
}
}
}
.add_btn {
width: 100%;
border: 1px dashed #DFE1E6;
}
}
......@@ -4,6 +4,7 @@ import GoodsSetting from './components/GoodsSetting'
import BrandSetting from './components/BrandSetting'
import ShopSetting from './components/ShopSetting'
import AdvertSetting from './components/AdvertSetting'
import PlatformAdvertSetting from './components/PlatformAdvertSetting'
import MallNav from './components/MallNav'
import CategoryRecommendSetting from './components/CategoryreCommendSetting'
import { SelectedInfoType, clearSelectedStatus, PROPS_TYPES } from 'lingxi-editor-core';
......@@ -43,6 +44,8 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
return <AdvertSetting templateid={templateId} {...initProps} />
case PROPS_TYPES.mallNav:
return <MallNav templateid={templateId} {...initProps} />
case PROPS_TYPES.platformAdvert:
return <PlatformAdvertSetting templateid={templateId} {...initProps} />
}
}
return null
......
......@@ -4,6 +4,7 @@ import { Modal, message } from 'antd'
import cx from 'classnames'
import { inject } from 'mobx-react'
import UseModal from '../components/useModal'
import { TEMPLATE_TYPE_TEXT } from '@/constants'
import DetailPage from '@/components/DetailPage'
import { PublicApi } from '@/services/api'
import { GetTemplateWebPageTemplateWebFindTemplateDetailsResponse } from '@/services/TemplateApi'
......@@ -138,10 +139,14 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<label>使用站点:</label>
<span>{detailInfo?.siteName}</span>
</div>
{
type !== TEMPLATE_TYPE_TEXT.platform && (
<div className={styles.template_info_line}>
<label>使用商城:</label>
<span>{detailInfo?.shopName}</span>
</div>
)
}
</div>
</div>
<div className={styles.btn} onClick={() => linkToPreview()}>
......@@ -149,15 +154,27 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<label>预览</label>
</div>
{
type === 'mall' && (
(type === TEMPLATE_TYPE_TEXT.mall || type === TEMPLATE_TYPE_TEXT.platform) && (
<Fragment>
<div className={cx(styles.btn, styles.renovation)} onClick={() => {
switch (type) {
case TEMPLATE_TYPE_TEXT.mall:
if (detailInfo?.environment === 1) {
window.location.href = `/pageCustomized/mall/template/edit?id=${id}&template=${detailInfo?.fileName}&environment=${detailInfo?.environment}&shopId=${detailInfo?.shopId}`
} else {
// message.info(`暂仅支持web环境模板装修`)
window.location.href = `/pageCustomized/mobile/template/edit?id=${id}&template=${detailInfo?.fileName}&environment=${detailInfo?.environment}`
}
break
case TEMPLATE_TYPE_TEXT.platform:
if (detailInfo?.environment === 1) {
window.location.href = `/pageCustomized/platform/template/edit?id=${id}&template=${detailInfo?.fileName}&environment=${detailInfo?.environment}`
} else {
message.info(`暂仅支持web环境模板装修`)
}
break
default:
break
}
}} >
<LayoutOutlined />
<label>装修</label>
......
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