🎈 perf(优化我的页面icon):
This commit is contained in:
parent
6354f4b530
commit
a7416a81f5
3
src/components/svgIconfont/index.module.scss
Normal file
3
src/components/svgIconfont/index.module.scss
Normal file
@ -0,0 +1,3 @@
|
||||
.svg {
|
||||
display: flex;
|
||||
}
|
||||
25
src/components/svgIconfont/index.tsx
Normal file
25
src/components/svgIconfont/index.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import { View } from '@tarojs/components'
|
||||
import classNames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
interface Pram {
|
||||
name: string
|
||||
style?: object
|
||||
}
|
||||
function SvgIcon(params: Pram) {
|
||||
const { name = '', style } = params
|
||||
return (
|
||||
<View className={classNames(styles.svg, `${name}`)} style={style}>
|
||||
<View className="path1" style={style}></View>
|
||||
<View className="path2" style={style}></View>
|
||||
<View className="path3" style={style}></View>
|
||||
<View className="path4" style={style}></View>
|
||||
<View className="path5" style={style}></View>
|
||||
<View className="path6" style={style}></View>
|
||||
<View className="path7" style={style}></View>
|
||||
<View className="path8" style={style}></View>
|
||||
<View className="path9" style={style}></View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
export default SvgIcon
|
||||
@ -10,6 +10,7 @@ import { formatImgUrl, formatPriceDiv } from '@/common/fotmat'
|
||||
import { userassets, userorderStatistics } from '@/api/mine'
|
||||
import useLogin from '@/use/useLogin'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import SvgIconfont from '@/components/svgIconfont'
|
||||
import MoveBtn from '@/components/moveBtn'
|
||||
import { BASE_URL } from '@/common/constant'
|
||||
|
||||
@ -58,7 +59,7 @@ export default () => {
|
||||
|
||||
const menuList = [
|
||||
{ label: '地址管理', icon: 'icon-dizhiguanli', callback: () => goLink('/pages/addressManager/index') },
|
||||
{ label: '码单管理', icon: 'icon-yanseduibi', callback: () => goLink('/pages/weightList/index') },
|
||||
{ label: '码单管理', icon: 'icon-mdgl', icon_status: 'local', callback: () => goLink('/pages/weightList/index') },
|
||||
{ label: '颜色对比', icon: 'icon-yanseduibi', callback: () => goLink('/pages/sampleComparison/index') },
|
||||
{ label: '我的客服', icon: 'icon-wodekefu', text: '7x24小时服务', callback: () => (set_customer_service_show(true)) },
|
||||
]
|
||||
@ -166,7 +167,7 @@ export default () => {
|
||||
<View className={styles.list_con}>
|
||||
{menuList.map((item, index) => {
|
||||
return <View key={index} className={styles.list_item} onClick={item?.callback}>
|
||||
<IconFont name={item.icon as any} size={70} />
|
||||
{item.icon_status != 'local' ? <IconFont name={item.icon as any} size={70} /> : <SvgIconfont name={item.icon as any} style={{ fontSize: '70rpx' }} />}
|
||||
<View className={styles.list_item_con}>
|
||||
<Text>{item.label}</Text>
|
||||
<View className={styles.title_more_kf}>
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
[class^='icon-'],
|
||||
[class*=' icon-'] {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user