gaoluyang
2026-06-24 bfdc0e0e6d5e47aa501f9b6fadd143d9c97cf00a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import type { DiyComponent } from '../../../util';
 
/** 底部导航菜单属性 */
export interface TabBarProperty {
  items: TabBarItemProperty[]; // 选项列表
  theme: string; // 主题
  style: TabBarStyle; // 样式
}
 
/** 选项属性 */
export interface TabBarItemProperty {
  text: string; // 标签文字
  url: string; // 链接
  iconUrl: string; // 默认图标链接
  activeIconUrl: string; // 选中的图标链接
}
 
/** 样式 */
export interface TabBarStyle {
  bgType: 'color' | 'img'; // 背景类型
  bgColor: string; // 背景颜色
  bgImg: string; // 图片链接
  color: string; // 默认颜色
  activeColor: string; // 选中的颜色
}
 
/** 定义组件 */
export const component = {
  id: 'TabBar',
  name: '底部导航',
  icon: 'fluent:table-bottom-row-16-filled',
  property: {
    theme: 'red',
    style: {
      bgType: 'color',
      bgColor: '#fff',
      color: '#282828',
      activeColor: '#fc4141',
    },
    items: [
      {
        text: '首页',
        url: '/pages/index/index',
        iconUrl: 'http://mall.yudao.iocoder.cn/static/images/1-001.png',
        activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/1-002.png',
      },
      {
        text: '分类',
        url: '/pages/index/category?id=3',
        iconUrl: 'http://mall.yudao.iocoder.cn/static/images/2-001.png',
        activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/2-002.png',
      },
      {
        text: '购物车',
        url: '/pages/index/cart',
        iconUrl: 'http://mall.yudao.iocoder.cn/static/images/3-001.png',
        activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/3-002.png',
      },
      {
        text: '我的',
        url: '/pages/index/user',
        iconUrl: 'http://mall.yudao.iocoder.cn/static/images/4-001.png',
        activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/4-002.png',
      },
    ],
  },
} as DiyComponent<TabBarProperty>;
 
export const THEME_LIST = [
  {
    id: 'red',
    name: '中国红',
    icon: 'icon-park-twotone:theme',
    color: '#d10019',
  },
  {
    id: 'orange',
    name: '桔橙',
    icon: 'icon-park-twotone:theme',
    color: '#f37b1d',
  },
  {
    id: 'gold',
    name: '明黄',
    icon: 'icon-park-twotone:theme',
    color: '#fbbd08',
  },
  {
    id: 'green',
    name: '橄榄绿',
    icon: 'icon-park-twotone:theme',
    color: '#8dc63f',
  },
  {
    id: 'cyan',
    name: '天青',
    icon: 'icon-park-twotone:theme',
    color: '#1cbbb4',
  },
  {
    id: 'blue',
    name: '海蓝',
    icon: 'icon-park-twotone:theme',
    color: '#0081ff',
  },
  {
    id: 'purple',
    name: '姹紫',
    icon: 'icon-park-twotone:theme',
    color: '#6739b6',
  },
  {
    id: 'brightRed',
    name: '嫣红',
    icon: 'icon-park-twotone:theme',
    color: '#e54d42',
  },
  {
    id: 'forestGreen',
    name: '森绿',
    icon: 'icon-park-twotone:theme',
    color: '#39b54a',
  },
  {
    id: 'mauve',
    name: '木槿',
    icon: 'icon-park-twotone:theme',
    color: '#9c26b0',
  },
  {
    id: 'pink',
    name: '桃粉',
    icon: 'icon-park-twotone:theme',
    color: '#e03997',
  },
  {
    id: 'brown',
    name: '棕褐',
    icon: 'icon-park-twotone:theme',
    color: '#a5673f',
  },
  {
    id: 'grey',
    name: '玄灰',
    icon: 'icon-park-twotone:theme',
    color: '#8799a3',
  },
  {
    id: 'gray',
    name: '草灰',
    icon: 'icon-park-twotone:theme',
    color: '#aaaaaa',
  },
  {
    id: 'black',
    name: '墨黑',
    icon: 'icon-park-twotone:theme',
    color: '#333333',
  },
];