@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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
  3. package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
  4. package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
  5. package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
  6. package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
  7. package/components/PrismCode/PrismCode.vue +749 -749
  8. package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
  9. package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
  10. package/components/PrismDropdown/PrismDropdown.vue +77 -77
  11. package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
  12. package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
  13. package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
  14. package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
  15. package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
  16. package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
  17. package/components/PrismNavBar/PrismNavBar.vue +199 -199
  18. package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
  19. package/components/PrismSticky/PrismSticky.vue +173 -173
  20. package/components/PrismSwiper/PrismSwiper.vue +338 -338
  21. package/components/PrismSwitch/PrismSwitch.vue +202 -202
  22. package/components/PrismTabBar/PrismTabBar.vue +147 -147
  23. package/components/PrismTabs/PrismTabs.vue +49 -49
  24. package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
  25. package/fonts/fa-brands-400.woff2 +0 -0
  26. package/fonts/fa-regular-400.woff2 +0 -0
  27. package/fonts/fa-solid-900.woff2 +0 -0
  28. package/fonts/fa-v4compatibility.woff2 +0 -0
  29. package/fonts/font-awesome.css +913 -0
  30. package/fonts/iconfont.woff2 +0 -0
  31. package/package.json +7 -1
  32. package/store/app.d.ts +21 -0
  33. package/store/app.js +68 -0
  34. package/styles/base.scss +2 -2
@@ -1,339 +1,339 @@
1
- <template>
2
- <view class="prism-swiper" :class="{ 'dark-mode': isDarkMode, 'prism-swiper--preview': displayMode === 'preview' }">
3
- <swiper
4
- class="prism-swiper__container"
5
- :class="{ 'prism-swiper__container--preview': displayMode === 'preview' }"
6
- :style="{ height: height }"
7
- :indicator-dots="false"
8
- :autoplay="autoplay"
9
- :circular="circular"
10
- :interval="interval"
11
- :duration="duration"
12
- :current="currentIndex"
13
- :previous-margin="displayMode === 'preview' ? previousMargin : '0'"
14
- :next-margin="displayMode === 'preview' ? nextMargin : '0'"
15
- @change="onChange"
16
- >
17
- <swiper-item v-for="(item, index) in list" :key="index">
18
- <view
19
- class="prism-swiper__item"
20
- :class="{
21
- 'prism-swiper__item--preview': displayMode === 'preview',
22
- 'prism-swiper__item--active': displayMode === 'preview' && currentIndex === index
23
- }"
24
- :style="itemStyle(item)"
25
- @click="onItemClick(item, index)"
26
- >
27
- <image v-if="item.image" class="prism-swiper__image" :src="item.image" mode="aspectFill" />
28
- <view v-else-if="item.color" class="prism-swiper__color" :style="{ background: item.color }">
29
- <text v-if="item.text" class="prism-swiper__text">{{ item.text }}</text>
30
- </view>
31
- <slot v-else :item="item" :index="index"></slot>
32
- </view>
33
- </swiper-item>
34
- </swiper>
35
-
36
- <!-- 自定义指示器 -->
37
- <!-- 圆点指示器 -->
38
- <view v-if="indicatorType === 'dots'" class="prism-swiper__dots">
39
- <view
40
- v-for="(item, index) in list"
41
- :key="index"
42
- class="prism-swiper__dot"
43
- :class="{ 'prism-swiper__dot--active': currentIndex === index }"
44
- @click="goToSlide(index)"
45
- ></view>
46
- </view>
47
-
48
- <!-- 数字指示器 -->
49
- <view v-else-if="indicatorType === 'number'" class="prism-swiper__number">
50
- <text>{{ currentIndex + 1 }}</text>
51
- <text class="prism-swiper__number-divider">/</text>
52
- <text>{{ list.length }}</text>
53
- </view>
54
-
55
- <!-- 预览图指示器 -->
56
- <view v-else-if="indicatorType === 'thumbnails'" class="prism-swiper__thumbnails">
57
- <view
58
- v-for="(item, index) in list"
59
- :key="index"
60
- class="prism-swiper__thumbnail"
61
- :class="{ 'prism-swiper__thumbnail--active': currentIndex === index }"
62
- @click="goToSlide(index)"
63
- >
64
- <image v-if="item.image" class="prism-swiper__thumbnail-image" :src="item.image" mode="aspectFill" />
65
- <view v-else class="prism-swiper__thumbnail-color" :style="{ background: item.color || '#ccc' }"></view>
66
- </view>
67
- </view>
68
-
69
- <!-- 手风琴指示器 -->
70
- <view v-else-if="indicatorType === 'accordion'" class="prism-swiper__accordion">
71
- <view
72
- v-for="(item, index) in list"
73
- :key="index"
74
- class="prism-swiper__accordion-item"
75
- :class="{ 'prism-swiper__accordion-item--active': currentIndex === index }"
76
- @click="goToSlide(index)"
77
- >
78
- <view class="prism-swiper__accordion-bar"></view>
79
- </view>
80
- </view>
81
- </view>
82
- </template>
83
-
84
- <script setup>
85
- import { ref } from 'vue';
86
-
87
- const props = defineProps({
88
- list: {
89
- type: Array,
90
- default: () => []
91
- },
92
- height: {
93
- type: String,
94
- default: '300rpx'
95
- },
96
- displayMode: {
97
- type: String,
98
- default: 'normal', // 'normal' | 'preview'
99
- validator: (value) => ['normal', 'preview'].includes(value)
100
- },
101
- previousMargin: {
102
- type: String,
103
- default: '60rpx'
104
- },
105
- nextMargin: {
106
- type: String,
107
- default: '60rpx'
108
- },
109
- indicatorType: {
110
- type: String,
111
- default: 'dots', // 'dots' | 'number' | 'thumbnails' | 'accordion'
112
- validator: (value) => ['dots', 'number', 'thumbnails', 'accordion'].includes(value)
113
- },
114
- autoplay: {
115
- type: Boolean,
116
- default: true
117
- },
118
- circular: {
119
- type: Boolean,
120
- default: true
121
- },
122
- interval: {
123
- type: Number,
124
- default: 3000
125
- },
126
- duration: {
127
- type: Number,
128
- default: 500
129
- },
130
- radius: {
131
- type: String,
132
- default: '16rpx'
133
- },
134
- isDarkMode: {
135
- type: Boolean,
136
- default: false
137
- }
138
- });
139
-
140
- const emit = defineEmits(['change', 'click']);
141
-
142
- const currentIndex = ref(0);
143
-
144
- function itemStyle(item) {
145
- return {
146
- borderRadius: props.radius
147
- };
148
- }
149
-
150
- function onChange(e) {
151
- currentIndex.value = e.detail.current;
152
- emit('change', e.detail.current);
153
- }
154
-
155
- function onItemClick(item, index) {
156
- emit('click', { item, index });
157
- }
158
-
159
- function goToSlide(index) {
160
- currentIndex.value = index;
161
- }
162
- </script>
163
-
164
- <style lang="scss" scoped>
165
- .prism-swiper {
166
- position: relative;
167
- width: 100%;
168
- }
169
-
170
- .prism-swiper__container {
171
- width: 100%;
172
- }
173
-
174
- .prism-swiper__item {
175
- width: 100%;
176
- height: 100%;
177
- overflow: hidden;
178
- transition: all 0.3s ease;
179
- }
180
-
181
- /* 预览模式样式 */
182
- .prism-swiper--preview {
183
- .prism-swiper__item--preview {
184
- opacity: 0.6;
185
- transform: scale(0.9);
186
-
187
- &.prism-swiper__item--active {
188
- opacity: 1;
189
- transform: scale(1);
190
- }
191
- }
192
- }
193
-
194
- .prism-swiper__image {
195
- width: 100%;
196
- height: 100%;
197
- display: block;
198
- }
199
-
200
- .prism-swiper__color {
201
- width: 100%;
202
- height: 100%;
203
- display: flex;
204
- align-items: center;
205
- justify-content: center;
206
- }
207
-
208
- .prism-swiper__text {
209
- font-size: 32rpx;
210
- color: #ffffff;
211
- font-weight: 500;
212
- }
213
-
214
- /* 圆点指示器 */
215
- .prism-swiper__dots {
216
- position: absolute;
217
- bottom: 16rpx;
218
- left: 50%;
219
- transform: translateX(-50%);
220
- display: flex;
221
- gap: 12rpx;
222
- z-index: 10;
223
- }
224
-
225
- .prism-swiper__dot {
226
- width: 12rpx;
227
- height: 12rpx;
228
- border-radius: 50%;
229
- background: rgba(255, 255, 255, 0.5);
230
- transition: all 0.3s ease;
231
- cursor: pointer;
232
-
233
- &--active {
234
- width: 32rpx;
235
- border-radius: 6rpx;
236
- background: #FFFFFF;
237
- }
238
- }
239
-
240
- /* 数字指示器 */
241
- .prism-swiper__number {
242
- position: absolute;
243
- bottom: 16rpx;
244
- right: 16rpx;
245
- padding: 8rpx 16rpx;
246
- background: rgba(0, 0, 0, 0.5);
247
- border-radius: 20rpx;
248
- display: flex;
249
- align-items: center;
250
- gap: 4rpx;
251
- font-size: 24rpx;
252
- color: #FFFFFF;
253
- z-index: 10;
254
- backdrop-filter: blur(10px);
255
- -webkit-backdrop-filter: blur(10px);
256
- }
257
-
258
- .prism-swiper__number-divider {
259
- margin: 0 4rpx;
260
- opacity: 0.7;
261
- }
262
-
263
- /* 预览图指示器 */
264
- .prism-swiper__thumbnails {
265
- position: absolute;
266
- bottom: 16rpx;
267
- left: 50%;
268
- transform: translateX(-50%);
269
- display: flex;
270
- gap: 12rpx;
271
- z-index: 10;
272
- }
273
-
274
- .prism-swiper__thumbnail {
275
- width: 80rpx;
276
- height: 60rpx;
277
- border-radius: 8rpx;
278
- overflow: hidden;
279
- border: 3rpx solid rgba(255, 255, 255, 0.5);
280
- transition: all 0.3s ease;
281
- cursor: pointer;
282
-
283
- &--active {
284
- border-color: #FFFFFF;
285
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.3);
286
- }
287
- }
288
-
289
- .prism-swiper__thumbnail-image,
290
- .prism-swiper__thumbnail-color {
291
- width: 100%;
292
- height: 100%;
293
- display: block;
294
- }
295
-
296
- /* 手风琴指示器 */
297
- .prism-swiper__accordion {
298
- position: absolute;
299
- bottom: 16rpx;
300
- left: 50%;
301
- transform: translateX(-50%);
302
- display: flex;
303
- gap: 8rpx;
304
- z-index: 10;
305
- }
306
-
307
- .prism-swiper__accordion-item {
308
- height: 6rpx;
309
- border-radius: 3rpx;
310
- overflow: hidden;
311
- cursor: pointer;
312
- }
313
-
314
- .prism-swiper__accordion-bar {
315
- width: 100%;
316
- height: 100%;
317
- background: rgba(255, 255, 255, 0.5);
318
- transition: all 0.3s ease;
319
- }
320
-
321
- .prism-swiper__accordion-item {
322
- width: 40rpx;
323
-
324
- &--active {
325
- width: 80rpx;
326
-
327
- .prism-swiper__accordion-bar {
328
- background: #FFFFFF;
329
- }
330
- }
331
- }
332
-
333
- /* 深色模式适配 */
334
- .dark-mode {
335
- .prism-swiper__number {
336
- background: rgba(255, 255, 255, 0.15);
337
- }
338
- }
1
+ <template>
2
+ <view class="prism-swiper" :class="{ 'dark-mode': isDarkMode, 'prism-swiper--preview': displayMode === 'preview' }">
3
+ <swiper
4
+ class="prism-swiper__container"
5
+ :class="{ 'prism-swiper__container--preview': displayMode === 'preview' }"
6
+ :style="{ height: height }"
7
+ :indicator-dots="false"
8
+ :autoplay="autoplay"
9
+ :circular="circular"
10
+ :interval="interval"
11
+ :duration="duration"
12
+ :current="currentIndex"
13
+ :previous-margin="displayMode === 'preview' ? previousMargin : '0'"
14
+ :next-margin="displayMode === 'preview' ? nextMargin : '0'"
15
+ @change="onChange"
16
+ >
17
+ <swiper-item v-for="(item, index) in list" :key="index">
18
+ <view
19
+ class="prism-swiper__item"
20
+ :class="{
21
+ 'prism-swiper__item--preview': displayMode === 'preview',
22
+ 'prism-swiper__item--active': displayMode === 'preview' && currentIndex === index
23
+ }"
24
+ :style="itemStyle(item)"
25
+ @click="onItemClick(item, index)"
26
+ >
27
+ <image v-if="item.image" class="prism-swiper__image" :src="item.image" mode="aspectFill" />
28
+ <view v-else-if="item.color" class="prism-swiper__color" :style="{ background: item.color }">
29
+ <text v-if="item.text" class="prism-swiper__text">{{ item.text }}</text>
30
+ </view>
31
+ <slot v-else :item="item" :index="index"></slot>
32
+ </view>
33
+ </swiper-item>
34
+ </swiper>
35
+
36
+ <!-- 自定义指示器 -->
37
+ <!-- 圆点指示器 -->
38
+ <view v-if="indicatorType === 'dots'" class="prism-swiper__dots">
39
+ <view
40
+ v-for="(item, index) in list"
41
+ :key="index"
42
+ class="prism-swiper__dot"
43
+ :class="{ 'prism-swiper__dot--active': currentIndex === index }"
44
+ @click="goToSlide(index)"
45
+ ></view>
46
+ </view>
47
+
48
+ <!-- 数字指示器 -->
49
+ <view v-else-if="indicatorType === 'number'" class="prism-swiper__number">
50
+ <text>{{ currentIndex + 1 }}</text>
51
+ <text class="prism-swiper__number-divider">/</text>
52
+ <text>{{ list.length }}</text>
53
+ </view>
54
+
55
+ <!-- 预览图指示器 -->
56
+ <view v-else-if="indicatorType === 'thumbnails'" class="prism-swiper__thumbnails">
57
+ <view
58
+ v-for="(item, index) in list"
59
+ :key="index"
60
+ class="prism-swiper__thumbnail"
61
+ :class="{ 'prism-swiper__thumbnail--active': currentIndex === index }"
62
+ @click="goToSlide(index)"
63
+ >
64
+ <image v-if="item.image" class="prism-swiper__thumbnail-image" :src="item.image" mode="aspectFill" />
65
+ <view v-else class="prism-swiper__thumbnail-color" :style="{ background: item.color || '#ccc' }"></view>
66
+ </view>
67
+ </view>
68
+
69
+ <!-- 手风琴指示器 -->
70
+ <view v-else-if="indicatorType === 'accordion'" class="prism-swiper__accordion">
71
+ <view
72
+ v-for="(item, index) in list"
73
+ :key="index"
74
+ class="prism-swiper__accordion-item"
75
+ :class="{ 'prism-swiper__accordion-item--active': currentIndex === index }"
76
+ @click="goToSlide(index)"
77
+ >
78
+ <view class="prism-swiper__accordion-bar"></view>
79
+ </view>
80
+ </view>
81
+ </view>
82
+ </template>
83
+
84
+ <script setup>
85
+ import { ref } from 'vue';
86
+
87
+ const props = defineProps({
88
+ list: {
89
+ type: Array,
90
+ default: () => []
91
+ },
92
+ height: {
93
+ type: String,
94
+ default: '300rpx'
95
+ },
96
+ displayMode: {
97
+ type: String,
98
+ default: 'normal', // 'normal' | 'preview'
99
+ validator: (value) => ['normal', 'preview'].includes(value)
100
+ },
101
+ previousMargin: {
102
+ type: String,
103
+ default: '60rpx'
104
+ },
105
+ nextMargin: {
106
+ type: String,
107
+ default: '60rpx'
108
+ },
109
+ indicatorType: {
110
+ type: String,
111
+ default: 'dots', // 'dots' | 'number' | 'thumbnails' | 'accordion'
112
+ validator: (value) => ['dots', 'number', 'thumbnails', 'accordion'].includes(value)
113
+ },
114
+ autoplay: {
115
+ type: Boolean,
116
+ default: true
117
+ },
118
+ circular: {
119
+ type: Boolean,
120
+ default: true
121
+ },
122
+ interval: {
123
+ type: Number,
124
+ default: 3000
125
+ },
126
+ duration: {
127
+ type: Number,
128
+ default: 500
129
+ },
130
+ radius: {
131
+ type: String,
132
+ default: '16rpx'
133
+ },
134
+ isDarkMode: {
135
+ type: Boolean,
136
+ default: false
137
+ }
138
+ });
139
+
140
+ const emit = defineEmits(['change', 'click']);
141
+
142
+ const currentIndex = ref(0);
143
+
144
+ function itemStyle(item) {
145
+ return {
146
+ borderRadius: props.radius
147
+ };
148
+ }
149
+
150
+ function onChange(e) {
151
+ currentIndex.value = e.detail.current;
152
+ emit('change', e.detail.current);
153
+ }
154
+
155
+ function onItemClick(item, index) {
156
+ emit('click', { item, index });
157
+ }
158
+
159
+ function goToSlide(index) {
160
+ currentIndex.value = index;
161
+ }
162
+ </script>
163
+
164
+ <style lang="scss" scoped>
165
+ .prism-swiper {
166
+ position: relative;
167
+ width: 100%;
168
+ }
169
+
170
+ .prism-swiper__container {
171
+ width: 100%;
172
+ }
173
+
174
+ .prism-swiper__item {
175
+ width: 100%;
176
+ height: 100%;
177
+ overflow: hidden;
178
+ transition: all 0.3s ease;
179
+ }
180
+
181
+ /* 预览模式样式 */
182
+ .prism-swiper--preview {
183
+ .prism-swiper__item--preview {
184
+ opacity: 0.6;
185
+ transform: scale(0.9);
186
+
187
+ &.prism-swiper__item--active {
188
+ opacity: 1;
189
+ transform: scale(1);
190
+ }
191
+ }
192
+ }
193
+
194
+ .prism-swiper__image {
195
+ width: 100%;
196
+ height: 100%;
197
+ display: block;
198
+ }
199
+
200
+ .prism-swiper__color {
201
+ width: 100%;
202
+ height: 100%;
203
+ display: flex;
204
+ align-items: center;
205
+ justify-content: center;
206
+ }
207
+
208
+ .prism-swiper__text {
209
+ font-size: 32rpx;
210
+ color: #ffffff;
211
+ font-weight: 500;
212
+ }
213
+
214
+ /* 圆点指示器 */
215
+ .prism-swiper__dots {
216
+ position: absolute;
217
+ bottom: 16rpx;
218
+ left: 50%;
219
+ transform: translateX(-50%);
220
+ display: flex;
221
+ gap: 12rpx;
222
+ z-index: 10;
223
+ }
224
+
225
+ .prism-swiper__dot {
226
+ width: 12rpx;
227
+ height: 12rpx;
228
+ border-radius: 50%;
229
+ background: rgba(255, 255, 255, 0.5);
230
+ transition: all 0.3s ease;
231
+ cursor: pointer;
232
+
233
+ &--active {
234
+ width: 32rpx;
235
+ border-radius: 6rpx;
236
+ background: #FFFFFF;
237
+ }
238
+ }
239
+
240
+ /* 数字指示器 */
241
+ .prism-swiper__number {
242
+ position: absolute;
243
+ bottom: 16rpx;
244
+ right: 16rpx;
245
+ padding: 8rpx 16rpx;
246
+ background: rgba(0, 0, 0, 0.5);
247
+ border-radius: 20rpx;
248
+ display: flex;
249
+ align-items: center;
250
+ gap: 4rpx;
251
+ font-size: 24rpx;
252
+ color: #FFFFFF;
253
+ z-index: 10;
254
+ backdrop-filter: blur(10px);
255
+ -webkit-backdrop-filter: blur(10px);
256
+ }
257
+
258
+ .prism-swiper__number-divider {
259
+ margin: 0 4rpx;
260
+ opacity: 0.7;
261
+ }
262
+
263
+ /* 预览图指示器 */
264
+ .prism-swiper__thumbnails {
265
+ position: absolute;
266
+ bottom: 16rpx;
267
+ left: 50%;
268
+ transform: translateX(-50%);
269
+ display: flex;
270
+ gap: 12rpx;
271
+ z-index: 10;
272
+ }
273
+
274
+ .prism-swiper__thumbnail {
275
+ width: 80rpx;
276
+ height: 60rpx;
277
+ border-radius: 8rpx;
278
+ overflow: hidden;
279
+ border: 3rpx solid rgba(255, 255, 255, 0.5);
280
+ transition: all 0.3s ease;
281
+ cursor: pointer;
282
+
283
+ &--active {
284
+ border-color: #FFFFFF;
285
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.3);
286
+ }
287
+ }
288
+
289
+ .prism-swiper__thumbnail-image,
290
+ .prism-swiper__thumbnail-color {
291
+ width: 100%;
292
+ height: 100%;
293
+ display: block;
294
+ }
295
+
296
+ /* 手风琴指示器 */
297
+ .prism-swiper__accordion {
298
+ position: absolute;
299
+ bottom: 16rpx;
300
+ left: 50%;
301
+ transform: translateX(-50%);
302
+ display: flex;
303
+ gap: 8rpx;
304
+ z-index: 10;
305
+ }
306
+
307
+ .prism-swiper__accordion-item {
308
+ height: 6rpx;
309
+ border-radius: 3rpx;
310
+ overflow: hidden;
311
+ cursor: pointer;
312
+ }
313
+
314
+ .prism-swiper__accordion-bar {
315
+ width: 100%;
316
+ height: 100%;
317
+ background: rgba(255, 255, 255, 0.5);
318
+ transition: all 0.3s ease;
319
+ }
320
+
321
+ .prism-swiper__accordion-item {
322
+ width: 40rpx;
323
+
324
+ &--active {
325
+ width: 80rpx;
326
+
327
+ .prism-swiper__accordion-bar {
328
+ background: #FFFFFF;
329
+ }
330
+ }
331
+ }
332
+
333
+ /* 深色模式适配 */
334
+ .dark-mode {
335
+ .prism-swiper__number {
336
+ background: rgba(255, 255, 255, 0.15);
337
+ }
338
+ }
339
339
  </style>