Commit 318ced22 authored by 卢均锐's avatar 卢均锐

feat: 装修导航设置兼容b端

parent fc863f1a
......@@ -19,10 +19,12 @@ interface BottomNavigationClientProps {
/** 类型:1-首页 2-分类 3-进货单 4-工作台 5-我的 6-找现货 7-找供应 8-求购 9-换积分 10-找店铺 */
type?: any,
// 当前选中组件的key
selectedKey?: any
selectedKey?: any,
// 1.B端 2.C端 3.SRM
property?: 1 | 2 | 3
}
const RedirectTypeList = [
const RedirectTypeList_B = [
{
value: 1,
label: '首页',
......@@ -37,7 +39,7 @@ const RedirectTypeList = [
},
{
value: 4,
label: '工作台',
label: '消息',
},
{
value: 5,
......@@ -53,20 +55,47 @@ const RedirectTypeList = [
},
{
value: 8,
label: '求购',
label: '换积分',
},
{
value: 9,
label: '换积分',
label: '找店铺',
},
];
const RedirectTypeList_C = [
{
value: 10,
label: '找店铺',
value: 1,
label: '首页',
},
{
value: 2,
label: '分类',
},
{
value: 3,
label: '购物车',
},
{
value: 4,
label: '我的',
},
{
value: 5,
label: '消息',
},
{
value: 6,
label: '积分兑换',
},
{
value: 7,
label: '在线客服',
},
];
const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: BottomNavigationClientProps) => {
const { defaultIcon, selectIcon, name, type, selectedKey } = props;
const { defaultIcon, selectIcon, name, type, property = 2, selectedKey } = props;
const _isNull = (list) => {
let _number = 0;
......@@ -104,6 +133,14 @@ const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: Bo
});
}
const RedirectTypeList = useMemo(() => {
if(property === 1){
return RedirectTypeList_B
}else if(property === 2){
return RedirectTypeList_C
}
}, [property])
return (
<div className={styles['bottomNavigationClient']}>
<div className={styles['bottomNavigationClient-box']}>
......@@ -114,7 +151,7 @@ const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: Bo
<div className={styles['bottomNavigationClient-box-label']}>链接</div>
<Select key={`${selectedKey}-type`} defaultValue={type} onChange={_onChangeType} style={{ width: '100%' }} >
{
RedirectTypeList.map(selectItem => <Select.Option value={selectItem.value} key={`redirect_type_${selectItem.value}`}>{selectItem.label}</Select.Option>)
RedirectTypeList?.map(selectItem => <Select.Option value={selectItem.value} key={`redirect_type_${selectItem.value}`}>{selectItem.label}</Select.Option>)
}
</Select>
</div>
......
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