Commit eb48ad23 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 88f9d246 7115ba6e
......@@ -18,6 +18,7 @@ interface DataItemType {
id: number,
name: string,
icon: string,
selectIcon: string,
/** 类型:1-首页 2-积分 3-工作台 4-资讯 5-进货单 6-我的 */
type: number,
status: boolean,
......@@ -187,11 +188,11 @@ const BottomNavigation: React.FC<BottomNavigationPropsType> = (props) => {
})
}
const handleIconChange = (url: string, id: number) => {
const handleIconChange = (url: string, id: number, key: string) => {
const newList = [...list]
newList.map(item => {
if (item.id === id) {
item.icon = url
item[key] = url
}
})
setList(newList)
......@@ -256,11 +257,11 @@ const BottomNavigation: React.FC<BottomNavigationPropsType> = (props) => {
</div>
</div>
<div className={styles.setting_line_addItem_line}>
<div className={styles.setting_line_addItem_line_label}>图标:</div>
<div className={styles.setting_line_addItem_line_label}>图标-默认</div>
<div className={styles.setting_line_addItem_line_brief}>
<div className={styles.uploadIconWrap}>
<UploadImage
onChange={(url) => handleIconChange(url, item.id)}
onChange={(url) => handleIconChange(url, item.id, "icon")}
listType="text"
>
<div className={cx(styles.uploadIconBtn, styles.small)}>
......@@ -275,6 +276,26 @@ const BottomNavigation: React.FC<BottomNavigationPropsType> = (props) => {
</div>
</div>
</div>
<div className={styles.setting_line_addItem_line}>
<div className={styles.setting_line_addItem_line_label}>图标-选中:</div>
<div className={styles.setting_line_addItem_line_brief}>
<div className={styles.uploadIconWrap}>
<UploadImage
onChange={(url) => handleIconChange(url, item.id, "selectIcon")}
listType="text"
>
<div className={cx(styles.uploadIconBtn, styles.small)}>
<PlusOutlined className={styles.uploadIconBtnIcon} />
<span>上传图标</span>
</div>
</UploadImage>
<label className={styles.uploadIconTip}>最佳尺寸:160*160</label>
</div>
<div className={styles.previewIconWrap}>
{item.selectIcon && <img src={item.selectIcon} className={styles.previewIcon} alt={item.name} />}
</div>
</div>
</div>
{
(item.type !== 1 && item.type !== 4) && (
<div className={styles.setting_line_addItem_line}>
......
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