@ruixinkeji/prism-ui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
- package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
- package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
- package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
- package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
- package/components/PrismCode/PrismCode.vue +749 -749
- package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
- package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
- package/components/PrismDropdown/PrismDropdown.vue +77 -77
- package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
- package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
- package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
- package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
- package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
- package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
- package/components/PrismNavBar/PrismNavBar.vue +199 -199
- package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
- package/components/PrismSticky/PrismSticky.vue +173 -173
- package/components/PrismSwiper/PrismSwiper.vue +338 -338
- package/components/PrismSwitch/PrismSwitch.vue +202 -202
- package/components/PrismTabBar/PrismTabBar.vue +147 -147
- package/components/PrismTabs/PrismTabs.vue +49 -49
- package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
- package/fonts/fa-brands-400.woff2 +0 -0
- package/fonts/fa-regular-400.woff2 +0 -0
- package/fonts/fa-solid-900.woff2 +0 -0
- package/fonts/fa-v4compatibility.woff2 +0 -0
- package/fonts/font-awesome.css +913 -0
- package/fonts/iconfont.woff2 +0 -0
- package/package.json +7 -1
- package/store/app.d.ts +21 -0
- package/store/app.js +68 -0
- package/styles/base.scss +2 -2
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="prism-tabbar" :class="{ 'dark-mode': appStore.isDarkMode, 'glass-effect': glass, 'wechat-browser': isWechatBrowser }">
|
|
3
|
-
<view
|
|
4
|
-
class="prism-tabbar-item"
|
|
5
|
-
v-for="(item, index) in tabList"
|
|
6
|
-
:key="index"
|
|
7
|
-
:class="{ active: currentPath === item.path }"
|
|
8
|
-
@click="switchTab(item.path)"
|
|
9
|
-
>
|
|
10
|
-
<view class="prism-tabbar-icon-wrapper" :class="{ active: currentPath === item.path }">
|
|
11
|
-
<text class="fa prism-tabbar-icon" :class="item.icon"></text>
|
|
12
|
-
</view>
|
|
13
|
-
<text class="prism-tabbar-text">{{ item.text }}</text>
|
|
14
|
-
</view>
|
|
15
|
-
</view>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup>
|
|
19
|
-
import { computed, ref, onMounted } from 'vue';
|
|
20
|
-
import { useAppStore } from '@/store/app';
|
|
21
|
-
|
|
22
|
-
const props = defineProps({
|
|
23
|
-
current: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: ''
|
|
26
|
-
},
|
|
27
|
-
glass: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: true
|
|
30
|
-
},
|
|
31
|
-
tabs: {
|
|
32
|
-
type: Array,
|
|
33
|
-
default: () => [
|
|
34
|
-
{ path: '/pages/index/index', text: '首页', icon: 'fa-home' },
|
|
35
|
-
{ path: '/pages/icons/icons', text: '图标', icon: 'fa-icons' },
|
|
36
|
-
{ path: '/pages/examples/examples', text: '案例', icon: 'fa-layer-group' },
|
|
37
|
-
{ path: '/pages/tools/tools', text: '工具', icon: 'fa-screwdriver-wrench' }
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const appStore = useAppStore();
|
|
43
|
-
const currentPath = computed(() => props.current);
|
|
44
|
-
const tabList = computed(() => props.tabs);
|
|
45
|
-
|
|
46
|
-
// 检测是否是微信浏览器
|
|
47
|
-
const isWechatBrowser = ref(false);
|
|
48
|
-
onMounted(() => {
|
|
49
|
-
// #ifdef H5
|
|
50
|
-
const ua = navigator.userAgent.toLowerCase();
|
|
51
|
-
isWechatBrowser.value = ua.includes('micromessenger');
|
|
52
|
-
// #endif
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
function switchTab(path) {
|
|
56
|
-
if (currentPath.value === path) return;
|
|
57
|
-
uni.reLaunch({ url: path });
|
|
58
|
-
}
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<style lang="scss" scoped>
|
|
62
|
-
.prism-tabbar {
|
|
63
|
-
position: fixed;
|
|
64
|
-
bottom: 0;
|
|
65
|
-
left: 0;
|
|
66
|
-
right: 0;
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: space-around;
|
|
70
|
-
padding: 15rpx 0;
|
|
71
|
-
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
72
|
-
z-index: 999;
|
|
73
|
-
background: var(--prism-bg-color-card);
|
|
74
|
-
border-top: 1rpx solid var(--prism-border-color-light);
|
|
75
|
-
|
|
76
|
-
// 微信浏览器下添加额外底部间距
|
|
77
|
-
&.wechat-browser {
|
|
78
|
-
padding-bottom: calc(60rpx + env(safe-area-inset-bottom, 0px));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* #ifndef H5 */
|
|
82
|
-
&.glass-effect {
|
|
83
|
-
background: rgba(255, 255, 255, 0.4);
|
|
84
|
-
backdrop-filter: saturate(180%) blur(40px);
|
|
85
|
-
-webkit-backdrop-filter: saturate(180%) blur(40px);
|
|
86
|
-
border-top: 1rpx solid rgba(0, 0, 0, 0.1);
|
|
87
|
-
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
|
88
|
-
}
|
|
89
|
-
/* #endif */
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.prism-tabbar-item {
|
|
93
|
-
flex: 1;
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
gap: 4rpx;
|
|
99
|
-
|
|
100
|
-
&.active {
|
|
101
|
-
.prism-tabbar-icon,
|
|
102
|
-
.prism-tabbar-text {
|
|
103
|
-
color: var(--prism-primary-color, #3478F6);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.prism-tabbar-icon-wrapper {
|
|
109
|
-
width: 48rpx;
|
|
110
|
-
height: 48rpx;
|
|
111
|
-
display: flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
justify-content: center;
|
|
114
|
-
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
115
|
-
|
|
116
|
-
&.active {
|
|
117
|
-
transform: translateY(-4rpx) scale(1.1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.prism-tabbar-icon {
|
|
122
|
-
font-size: 36rpx;
|
|
123
|
-
color: var(--prism-text-secondary, #86909C);
|
|
124
|
-
line-height: 1;
|
|
125
|
-
display: block;
|
|
126
|
-
transition: all 0.3s ease;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.prism-tabbar-icon-wrapper.active .prism-tabbar-icon {
|
|
130
|
-
color: var(--prism-primary-color, #3478F6);
|
|
131
|
-
-webkit-text-stroke: 0.5px var(--prism-primary-color, #3478F6);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.prism-tabbar-text {
|
|
135
|
-
font-size: 20rpx;
|
|
136
|
-
color: var(--prism-text-secondary, #86909C);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* 深色模式 - 毛玻璃效果 */
|
|
140
|
-
/* #ifndef H5 */
|
|
141
|
-
.prism-tabbar.dark-mode.glass-effect {
|
|
142
|
-
background: rgba(26, 26, 26, 0.4);
|
|
143
|
-
border-top-color: rgba(255, 255, 255, 0.12);
|
|
144
|
-
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.4);
|
|
145
|
-
}
|
|
146
|
-
/* #endif */
|
|
147
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="prism-tabbar" :class="{ 'dark-mode': appStore.isDarkMode, 'glass-effect': glass, 'wechat-browser': isWechatBrowser }">
|
|
3
|
+
<view
|
|
4
|
+
class="prism-tabbar-item"
|
|
5
|
+
v-for="(item, index) in tabList"
|
|
6
|
+
:key="index"
|
|
7
|
+
:class="{ active: currentPath === item.path }"
|
|
8
|
+
@click="switchTab(item.path)"
|
|
9
|
+
>
|
|
10
|
+
<view class="prism-tabbar-icon-wrapper" :class="{ active: currentPath === item.path }">
|
|
11
|
+
<text class="fa prism-tabbar-icon" :class="item.icon"></text>
|
|
12
|
+
</view>
|
|
13
|
+
<text class="prism-tabbar-text">{{ item.text }}</text>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { computed, ref, onMounted } from 'vue';
|
|
20
|
+
import { useAppStore } from '@/store/app';
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
current: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ''
|
|
26
|
+
},
|
|
27
|
+
glass: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
tabs: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => [
|
|
34
|
+
{ path: '/pages/index/index', text: '首页', icon: 'fa-home' },
|
|
35
|
+
{ path: '/pages/icons/icons', text: '图标', icon: 'fa-icons' },
|
|
36
|
+
{ path: '/pages/examples/examples', text: '案例', icon: 'fa-layer-group' },
|
|
37
|
+
{ path: '/pages/tools/tools', text: '工具', icon: 'fa-screwdriver-wrench' }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const appStore = useAppStore();
|
|
43
|
+
const currentPath = computed(() => props.current);
|
|
44
|
+
const tabList = computed(() => props.tabs);
|
|
45
|
+
|
|
46
|
+
// 检测是否是微信浏览器
|
|
47
|
+
const isWechatBrowser = ref(false);
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
// #ifdef H5
|
|
50
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
51
|
+
isWechatBrowser.value = ua.includes('micromessenger');
|
|
52
|
+
// #endif
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
function switchTab(path) {
|
|
56
|
+
if (currentPath.value === path) return;
|
|
57
|
+
uni.reLaunch({ url: path });
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="scss" scoped>
|
|
62
|
+
.prism-tabbar {
|
|
63
|
+
position: fixed;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
right: 0;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-around;
|
|
70
|
+
padding: 15rpx 0;
|
|
71
|
+
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
72
|
+
z-index: 999;
|
|
73
|
+
background: var(--prism-bg-color-card);
|
|
74
|
+
border-top: 1rpx solid var(--prism-border-color-light);
|
|
75
|
+
|
|
76
|
+
// 微信浏览器下添加额外底部间距
|
|
77
|
+
&.wechat-browser {
|
|
78
|
+
padding-bottom: calc(60rpx + env(safe-area-inset-bottom, 0px));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* #ifndef H5 */
|
|
82
|
+
&.glass-effect {
|
|
83
|
+
background: rgba(255, 255, 255, 0.4);
|
|
84
|
+
backdrop-filter: saturate(180%) blur(40px);
|
|
85
|
+
-webkit-backdrop-filter: saturate(180%) blur(40px);
|
|
86
|
+
border-top: 1rpx solid rgba(0, 0, 0, 0.1);
|
|
87
|
+
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
|
88
|
+
}
|
|
89
|
+
/* #endif */
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.prism-tabbar-item {
|
|
93
|
+
flex: 1;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
gap: 4rpx;
|
|
99
|
+
|
|
100
|
+
&.active {
|
|
101
|
+
.prism-tabbar-icon,
|
|
102
|
+
.prism-tabbar-text {
|
|
103
|
+
color: var(--prism-primary-color, #3478F6);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.prism-tabbar-icon-wrapper {
|
|
109
|
+
width: 48rpx;
|
|
110
|
+
height: 48rpx;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
115
|
+
|
|
116
|
+
&.active {
|
|
117
|
+
transform: translateY(-4rpx) scale(1.1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.prism-tabbar-icon {
|
|
122
|
+
font-size: 36rpx;
|
|
123
|
+
color: var(--prism-text-secondary, #86909C);
|
|
124
|
+
line-height: 1;
|
|
125
|
+
display: block;
|
|
126
|
+
transition: all 0.3s ease;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.prism-tabbar-icon-wrapper.active .prism-tabbar-icon {
|
|
130
|
+
color: var(--prism-primary-color, #3478F6);
|
|
131
|
+
-webkit-text-stroke: 0.5px var(--prism-primary-color, #3478F6);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.prism-tabbar-text {
|
|
135
|
+
font-size: 20rpx;
|
|
136
|
+
color: var(--prism-text-secondary, #86909C);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* 深色模式 - 毛玻璃效果 */
|
|
140
|
+
/* #ifndef H5 */
|
|
141
|
+
.prism-tabbar.dark-mode.glass-effect {
|
|
142
|
+
background: rgba(26, 26, 26, 0.4);
|
|
143
|
+
border-top-color: rgba(255, 255, 255, 0.12);
|
|
144
|
+
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.4);
|
|
145
|
+
}
|
|
146
|
+
/* #endif */
|
|
147
|
+
</style>
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="prism-tabs-container" :class="{ 'prism-tabs-container--chrome': type === 'chrome' }">
|
|
3
|
-
<view class="prism-tabs-wrapper" :class="[`prism-tabs--${type}`]">
|
|
4
|
-
<view
|
|
5
|
-
v-for="(item, index) in tabs"
|
|
6
|
-
:key="index"
|
|
7
|
-
class="prism-tabs__item"
|
|
8
|
-
:class="{ 'active': modelValue === index }"
|
|
9
|
-
@click="handleClick(index)"
|
|
10
|
-
>
|
|
11
|
-
<text>{{ item.label || item }}</text>
|
|
12
|
-
<text v-if="item.badge !== undefined" class="prism-tabs__badge">{{ item.badge }}</text>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
<!-- Chrome 类型的内容区域插槽 -->
|
|
16
|
-
<view v-if="type === 'chrome'" class="prism-tabs__content">
|
|
17
|
-
<slot></slot>
|
|
18
|
-
</view>
|
|
19
|
-
</view>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup>
|
|
23
|
-
defineProps({
|
|
24
|
-
tabs: {
|
|
25
|
-
type: Array,
|
|
26
|
-
required: true
|
|
27
|
-
// 格式: ['标签1', '标签2'] 或 [{ label: '标签1', badge: 10 }]
|
|
28
|
-
},
|
|
29
|
-
modelValue: {
|
|
30
|
-
type: Number,
|
|
31
|
-
default: 0
|
|
32
|
-
},
|
|
33
|
-
type: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: 'line' // 'line' | 'card' | 'chrome'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const emit = defineEmits(['update:modelValue', 'change']);
|
|
40
|
-
|
|
41
|
-
function handleClick(index) {
|
|
42
|
-
emit('update:modelValue', index);
|
|
43
|
-
emit('change', index);
|
|
44
|
-
}
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<style lang="scss">
|
|
48
|
-
/* 样式已移至 src/styles/navigation.scss */
|
|
49
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="prism-tabs-container" :class="{ 'prism-tabs-container--chrome': type === 'chrome' }">
|
|
3
|
+
<view class="prism-tabs-wrapper" :class="[`prism-tabs--${type}`]">
|
|
4
|
+
<view
|
|
5
|
+
v-for="(item, index) in tabs"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="prism-tabs__item"
|
|
8
|
+
:class="{ 'active': modelValue === index }"
|
|
9
|
+
@click="handleClick(index)"
|
|
10
|
+
>
|
|
11
|
+
<text>{{ item.label || item }}</text>
|
|
12
|
+
<text v-if="item.badge !== undefined" class="prism-tabs__badge">{{ item.badge }}</text>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
<!-- Chrome 类型的内容区域插槽 -->
|
|
16
|
+
<view v-if="type === 'chrome'" class="prism-tabs__content">
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
defineProps({
|
|
24
|
+
tabs: {
|
|
25
|
+
type: Array,
|
|
26
|
+
required: true
|
|
27
|
+
// 格式: ['标签1', '标签2'] 或 [{ label: '标签1', badge: 10 }]
|
|
28
|
+
},
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'line' // 'line' | 'card' | 'chrome'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const emit = defineEmits(['update:modelValue', 'change']);
|
|
40
|
+
|
|
41
|
+
function handleClick(index) {
|
|
42
|
+
emit('update:modelValue', index);
|
|
43
|
+
emit('change', index);
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="scss">
|
|
48
|
+
/* 样式已移至 src/styles/navigation.scss */
|
|
49
|
+
</style>
|