Commit ab54e95f authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents bfc533f4 c1c4756f
......@@ -530,26 +530,26 @@ export const paramsShop = (
}
break;
// 底部导航
case '9':
propsData = get(pageConfig, ['9', 'props']) || {}
childNodes = get(pageConfig, ['9', 'childNodes']) || {}
_params.adornContent.bottom = {
style: propsData.styleTheme || 0,
status: true,
details: []
}
if (childNodes && Array.isArray(childNodes) && childNodes.length > 0) {
for (let key in childNodes) {
tempProps = pageConfig[childNodes[key]]?.props || {}
!isEmpty(tempProps) && _params.adornContent.bottom.details.push({
defaultIcon: tempProps.defaultIcon,
selectIcon: tempProps.selectIcon,
name: tempProps.name,
type: tempProps.type,
});
case '9':
propsData = get(pageConfig, ['9', 'props']) || {}
childNodes = get(pageConfig, ['9', 'childNodes']) || {}
_params.adornContent.bottom = {
style: propsData.styleTheme || 0,
status: true,
details: []
}
}
break
if (childNodes && Array.isArray(childNodes) && childNodes.length > 0) {
for (let key in childNodes) {
tempProps = pageConfig[childNodes[key]]?.props || {}
!isEmpty(tempProps) && _params.adornContent.bottom.details.push({
defaultIcon: tempProps.defaultIcon,
selectIcon: tempProps.selectIcon,
name: tempProps.name,
type: tempProps.type,
});
}
}
break
}
})
......
......@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
import { Input, Select } from 'antd';
import { PlusCircleOutlined, DeleteOutlined } from '@ant-design/icons';
import { changeProps } from '@lingxi-disign/core';
import { LAYOUT_TYPE } from '@/constants'
import UploadImage from '@/components/UploadImage';
import uploadImgIcon from '@/assets/icons/upload_img_icon.svg'
......@@ -22,10 +22,38 @@ interface BottomNavigationClientProps {
// 当前选中组件的key
selectedKey?: any,
// 1.B端 2.C端 3.SRM
property?: 1 | 2 | 3
property?: 1 | 2 | 3,
layoutType: LAYOUT_TYPE
}
const RedirectTypeList = [
const shopRedirectTypeList = [
{
value: 1,
label: '首页',
},
{
value: 2,
label: '全部商品',
},
{
value: 3,
label: '分类',
},
{
value: 4,
label: '积分兑换',
},
{
value: 5,
label: '店铺会员',
},
{
value: 6,
label: '商家信息',
},
];
const ChannelRedirectTypeList = [
{
value: 1,
label: '首页',
......@@ -53,7 +81,7 @@ const RedirectTypeList = [
];
const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: BottomNavigationClientProps) => {
const { defaultIcon, selectIcon, name, type, property = 2, selectedKey } = props;
const { defaultIcon, selectIcon, name, type, layoutType, selectedKey } = props;
const _isNull = (list) => {
let _number = 0;
......@@ -91,17 +119,25 @@ const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: Bo
});
}
const _getNavLinkType = useMemo(() => {
if (layoutType === LAYOUT_TYPE.shop) {
return shopRedirectTypeList
} else {
return ChannelRedirectTypeList
}
}, [layoutType])
return (
<div className={styles['bottomNavigationClient']}>
<div className={styles['bottomNavigationClient-box']}>
<div className={styles['bottomNavigationClient-box-label']}>名称</div>
<Input key={`${selectedKey}-name`} defaultValue={name} onBlur={_onChangeName} />
<Input key={`${selectedKey}-name`} disabled={type === 1} defaultValue={name} onBlur={_onChangeName} />
</div>
<div className={styles['bottomNavigationClient-box']}>
<div className={styles['bottomNavigationClient-box-label']}>链接</div>
<Select key={`${selectedKey}-type`} defaultValue={type} onChange={_onChangeType} style={{ width: '100%' }} >
<Select key={`${selectedKey}-type`} disabled={type === 1} defaultValue={type} onChange={_onChangeType} style={{ width: '100%' }} >
{
RedirectTypeList?.map(selectItem => <Select.Option value={selectItem.value} key={`redirect_type_${selectItem.value}`}>{selectItem.label}</Select.Option>)
_getNavLinkType?.map(selectItem => <Select.Option value={selectItem.value} key={`redirect_type_${selectItem.value}`}>{selectItem.label}</Select.Option>)
}
</Select>
</div>
......
......@@ -15,7 +15,6 @@ import { priceFormat } from '@/utils/numberFomat';
import { getAuth } from '@/utils/auth'
import styles from './index.less';
interface CardNavItemProps {
name: string,
/** 跳转类型:1-品类导航 2.活动导航 3.频道导航 4.外部链接 */
......@@ -143,6 +142,10 @@ const CardNavItem: React.FC<CardNavItemProps> = (props: CardNavItemProps) => {
}
}
if (key === 'type') {
newProps['id'] = ""
}
changeProps({
title: title ? title : name,
props: Object.assign({ ...props }, newProps)
......
......@@ -27,11 +27,11 @@ interface PropsSettingsPropsType {
}
const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
const { selectedInfo, shopId, pageConfig } = props
const { selectedInfo, shopId, layoutType, pageConfig } = props
const renderSettingItem = () => {
const { props: initProps, propsConfig, parentKey } = selectedInfo || {};
const _props = { ...initProps, shopId, selectedKey: selectedInfo?.selectedKey }
const _props = { ...initProps, shopId, layoutType, selectedKey: selectedInfo?.selectedKey }
const componentType = propsConfig?.componentType
if (componentType) {
......
......@@ -129,25 +129,25 @@ export const defaultConfig: PageConfigType = {
canEdit: true,
canHide: false,
},
// '9': {
// title: '底部标签栏',
// componentName: 'BottomNavigation',
// props: {},
// childNodes: ['10'],
// childComponentName: 'BottomNavigation.Items',
// addBtnText: '添加标签',
// maxLength: 5,
// },
// '10': {
// loop: '${bottom}',
// title: '${item.name}',
// componentName: 'BottomNavigation.Items',
// props: {
// defaultIcon: '${item.defaultIcon}',
// selectIcon: '${item.selectIcon}',
// name: '${item.name}',
// type: '${item.type}',
// isnull: false,
// },
// },
'9': {
title: '底部标签栏',
componentName: 'BottomNavigation',
props: {},
childNodes: ['10'],
childComponentName: 'BottomNavigation.Items',
addBtnText: '添加标签',
maxLength: 5,
},
'10': {
loop: '${bottom}',
title: '${item.name}',
componentName: 'BottomNavigation.Items',
props: {
defaultIcon: '${item.defaultIcon}',
selectIcon: '${item.selectIcon}',
name: '${item.name}',
type: '${item.type}',
isnull: false,
},
},
}
......@@ -238,7 +238,13 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
navList: appConfig?.navList ? appConfig?.navList.details : [],
advert: appConfig?.advert ? appConfig?.advert.details : [],
commodityList: [],
bottom: appConfig?.bottom ? appConfig?.bottom.details : [],
bottom: appConfig?.bottom ? appConfig?.bottom.details : [{
defaultIcon: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/grid@2xf2a5b4c6612742759d5fcf322e2d6102.png',
selectIcon: 'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/Icon@2x(3)06695cb1e9904ae1a7a0b8ec73d29cb0.png',
name: '首页',
type: 1,
isnull: false,
}],
}
if (appConfig?.commodity) {
......@@ -1012,7 +1018,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
_other = { ..._other, ..._marketingConfig_19 };
!_mallLayoutConfig['0'].childNodes.includes('11-19') && _mallLayoutConfig['0'].childNodes.push('11-19');
}
_mallLayoutConfig['0'].childNodes = [..._mallLayoutConfig['0'].childNodes, '8', '6']
_mallLayoutConfig['0'].childNodes = [..._mallLayoutConfig['0'].childNodes, '8', '6', '9']
const config = {
..._mallLayoutConfig,
......
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