diff --git a/src/components/sp-tabbar/index.js b/src/components/sp-tabbar/index.js index 2a841ccba..1414e90d4 100755 --- a/src/components/sp-tabbar/index.js +++ b/src/components/sp-tabbar/index.js @@ -80,52 +80,59 @@ function SpTabbar() { return ( - {tabList?.map((item, index) => ( - handleTabbarClick(index)}> - {/* {index == 0 && - (index !== currentIndex ? ( - <> - - - {item.text} + {tabList?.map((item, index) => { + const iconPath = index == currentIndex ? item.selectedIconPath : item.iconPath + return ( + handleTabbarClick(index)}> + {/* {index == 0 && + (index !== currentIndex ? ( + <> + + + {item.text} + + + ) : ( + + ))} */} + + + {/^http/.test(iconPath) ? ( + + ) : ( + + )} + + {item.name == 'cart' && cartCount > 0 && ( + 99 ? '1' : ''}`}> + {cartCount > 0 && cartCount <= 99 && ( + {cartCount} + )} + {cartCount > 99 && 99+} - - ) : ( - - ))} */} + )} + - - - - {item.name == 'cart' && cartCount > 0 && ( - 99 ? '1' : ''}`}> - {cartCount > 0 && cartCount <= 99 && ( - {cartCount} - )} - {cartCount > 99 && 99+} - - )} + + {item.text} + - - - {item.text} - - - ))} + ) + })} ) } diff --git a/src/components/sp-tabbar/index.scss b/src/components/sp-tabbar/index.scss index 60f434c20..f2e50c8d3 100755 --- a/src/components/sp-tabbar/index.scss +++ b/src/components/sp-tabbar/index.scss @@ -79,6 +79,9 @@ } &-image-wrapper { position: relative; + .iconfont { + font-size: 56px; + } } &-image { // position: relative;