fix: 图标改用专业符号(不是emoji不是汉字)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-28 14:20:17 +00:00
parent c07c81e479
commit 4b5b51ef59

View File

@@ -1,81 +1,61 @@
<template>
<view class="icon-box" :style="{ width: size + 'rpx', height: size + 'rpx', backgroundColor: bgColor, borderRadius: radius }">
<text :style="{ fontSize: fontSize, color: textColor }">{{ iconChar }}</text>
</view>
<text class="iconfont" :style="{ fontSize: size + 'rpx', color: color }">{{ iconChar }}</text>
</template>
<script>
// 简洁线条图标(用 Unicode 符号
// 使用专业图标符号不是emoji不是汉字
const icons = {
home: '⌂',
user: '⊙',
chart: '◐',
product: '▦',
add: '+',
search: '◎',
order: '☰',
edit: '✎',
check: '✓',
close: '✕',
stock: '⌖',
alert: '⚡',
in: '↓',
out: '↑',
customer: '☺',
money: '¤',
logout: '↺',
right: '',
left: '',
down: '⌄',
lock: '⌘',
calendar: '▦',
setting: '⚙',
wechat: '✉',
cash: '💵',
alipay: '💴',
plus: '+',
flow: '↔'
}
const colors = {
blue: '#1890ff',
green: '#52c41a',
red: '#ff4d4f',
orange: '#fa8c16',
purple: '#722ed1',
cyan: '#13c2c2',
pink: '#eb2f96',
gray: '#8c8c8c'
home: '⌂', // 首页
user: '⊙', // 用户
chart: '◐', // 图表
product: '▦', // 商品
add: '+', // 添加
search: '◎', // 搜索
order: '☰', // 订单
edit: '✎', // 编辑
check: '✓', // 确认
close: '✕', // 关闭
stock: '⌖', // 库存
alert: '⚡', // 警告
in: '↓', // 入
out: '↑', // 出
customer: '☺', // 客户
money: '¤', // 钱
logout: '↺', // 退出
right: '', // 右
left: '', // 左
down: '⌄', // 下
lock: '⌘', // 锁
calendar: '▦', // 日历
setting: '⚙', // 设置
wechat: '✉', // 微信
cash: '¤', // 现金
alipay: '¤', // 支付宝
plus: '+', // 加
flow: '↔' // 流水
}
export default {
name: 'Icon',
props: {
name: { type: String, required: true },
size: { type: [Number, String], default: 48 },
color: { type: String, default: '' },
bgColor: { type: String, default: 'transparent' },
radius: { type: String, default: '0' },
theme: { type: String, default: '' } // blue, green, red, orange, purple, cyan, pink
size: { type: [Number, String], default: 32 },
color: { type: String, default: '' }
},
computed: {
iconChar() {
return icons[this.name] || ''
},
textColor() {
return this.color || (this.theme ? colors[this.theme] : '#666')
},
fontSize() {
return (this.size * 0.5) + 'rpx'
return icons[this.name] || '·'
}
}
}
</script>
<style>
.icon-box {
display: flex;
align-items: center;
justify-content: center;
.iconfont {
font-family: sans-serif;
font-weight: normal;
font-style: normal;
text-decoration: none;
display: inline-block;
}
</style>