xydata-tools-uniapp 1.0.0

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.
@@ -0,0 +1,531 @@
1
+ // ==================== 通用样式 ====================
2
+ .media-picker-wrapper {
3
+ width: 100%;
4
+ }
5
+
6
+ // 隐藏的水印绘制 canvas(固定定位移出屏幕,避免 display:none 导致小程序无法绘制)
7
+ // 尺寸通过内联 style 动态设置,与图片实际尺寸保持一致
8
+ .watermark-canvas {
9
+ position: fixed;
10
+ left: -9999px;
11
+ top: -9999px;
12
+ z-index: -1;
13
+ }
14
+
15
+ .flex-align-center {
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ }
20
+
21
+ .flex-center {
22
+ display: flex;
23
+ justify-content: center;
24
+ }
25
+
26
+ // ==================== 垂直布局样式 ====================
27
+ .vertical-layout {
28
+ .media-section {
29
+ width: 100%;
30
+ }
31
+
32
+ // 上传按钮行容器(both 模式时并排显示)
33
+ .upload-buttons-row {
34
+ display: flex;
35
+ margin-top: 20rpx;
36
+ padding-left: 11rpx;
37
+ }
38
+
39
+ .upload-btn-vertical {
40
+ width: 190rpx;
41
+ height: 180rpx;
42
+ background: #ffffff;
43
+ border-radius: 24rpx;
44
+ border: 2rpx solid #e6e6eb;
45
+ display: flex;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ justify-content: center;
49
+ gap: 8rpx;
50
+ transition: all 0.3s;
51
+ margin-right: 22rpx;
52
+
53
+ &:active {
54
+ opacity: 0.7;
55
+ background: #f7f8fa;
56
+ }
57
+
58
+ .upload-icon {
59
+ width: 58rpx;
60
+ height: 58rpx;
61
+ flex-shrink: 0;
62
+ }
63
+
64
+ .upload-text {
65
+ font-size: 26rpx;
66
+ color: #333333;
67
+ white-space: nowrap;
68
+ }
69
+ }
70
+ }
71
+
72
+ // ==================== 水平布局样式 ====================
73
+ .horizontal-layout {
74
+ width: 100%;
75
+ }
76
+
77
+ // 拖拽模式下的上传按钮(在网格中)
78
+ ::v-deep .add-wrap {
79
+ background: #fbfbfb !important;
80
+ border: 2rpx solid #dddddd;
81
+
82
+ .drag-upload-btn {
83
+ width: 100%;
84
+ height: 100%;
85
+ box-sizing: border-box;
86
+ display: flex;
87
+ flex-direction: column;
88
+ align-items: center;
89
+ justify-content: center;
90
+ transition: all 0.3s;
91
+
92
+ .upload-icon {
93
+ margin-bottom: 8rpx;
94
+ flex-shrink: 0;
95
+ }
96
+
97
+ .upload-text {
98
+ color: #333;
99
+ white-space: nowrap;
100
+ }
101
+ }
102
+
103
+ &:active {
104
+ opacity: 0.7;
105
+ background: #f5f5f5 !important;
106
+ }
107
+ }
108
+
109
+ // ==================== 视频网格布局(垂直布局) ====================
110
+ .video-grid {
111
+ display: flex;
112
+ flex-wrap: wrap;
113
+ gap: 20rpx;
114
+ padding: 8rpx 0;
115
+ }
116
+
117
+ .video-item {
118
+ width: 160rpx;
119
+ height: 160rpx;
120
+ position: relative;
121
+ border: 1px solid #dddddd;
122
+ box-shadow: 0 0 10rpx 0 rgba(0, 0, 0, 0.1);
123
+ border-radius: 12rpx;
124
+ overflow: hidden;
125
+
126
+ .video-player {
127
+ width: 100%;
128
+ height: 100%;
129
+ border-radius: 12rpx;
130
+ }
131
+
132
+ .play-btn {
133
+ position: absolute;
134
+ top: 50%;
135
+ left: 50%;
136
+ transform: translate(-50%, -50%);
137
+ width: 60rpx;
138
+ height: 60rpx;
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ z-index: 2;
143
+
144
+ .play-icon {
145
+ width: 100%;
146
+ height: 100%;
147
+ opacity: 0.9;
148
+ }
149
+ }
150
+
151
+ .clear-btn {
152
+ position: absolute;
153
+ right: -12rpx;
154
+ top: -12rpx;
155
+ width: 40rpx;
156
+ height: 40rpx;
157
+ background-color: rgba(0, 0, 0, 0.6);
158
+ border-radius: 50%;
159
+ display: flex;
160
+ align-items: center;
161
+ justify-content: center;
162
+ z-index: 3;
163
+
164
+ .clear-icon {
165
+ color: #ffffff;
166
+ font-size: 28rpx;
167
+ line-height: 0.1;
168
+ font-weight: 300;
169
+ }
170
+ }
171
+ }
172
+
173
+ // 视频上传中状态
174
+ .uploading-video {
175
+ border: 2rpx dashed #1890ff;
176
+ background-color: rgba(24, 144, 255, 0.05);
177
+ display: flex;
178
+ flex-direction: column;
179
+ align-items: center;
180
+ justify-content: center;
181
+
182
+ .loading-icon {
183
+ height: 48rpx;
184
+ width: 48rpx;
185
+ animation: rotate 2s linear infinite;
186
+ }
187
+
188
+ .upload-text {
189
+ color: #1890ff;
190
+ font-size: 22rpx;
191
+ margin-top: 8rpx;
192
+ }
193
+
194
+ .progress-bar {
195
+ width: 120rpx;
196
+ height: 8rpx;
197
+ background-color: #e6f7ff;
198
+ border-radius: 4rpx;
199
+ margin-top: 12rpx;
200
+ overflow: hidden;
201
+
202
+ .progress-bar-inner {
203
+ height: 100%;
204
+ background-color: #1890ff;
205
+ border-radius: 4rpx;
206
+ transition: width 0.3s;
207
+ }
208
+ }
209
+ }
210
+
211
+ // 视频上传按钮
212
+ .video-upload-btn {
213
+ background: #fbfbfb;
214
+ border: 2rpx dashed #dddddd;
215
+ display: flex;
216
+ flex-direction: column;
217
+ align-items: center;
218
+ justify-content: center;
219
+ cursor: pointer;
220
+ transition: all 0.3s;
221
+
222
+ .upload-icon {
223
+ width: 48rpx;
224
+ height: 48rpx;
225
+ }
226
+
227
+ .upload-text {
228
+ color: #999;
229
+ font-size: 22rpx;
230
+ margin-top: 8rpx;
231
+ }
232
+
233
+ &:active {
234
+ opacity: 0.7;
235
+ background: #f5f5f5;
236
+ }
237
+ }
238
+
239
+ // 水平布局下的视频网格
240
+ .video-horizontal-grid {
241
+ display: flex;
242
+ flex-wrap: wrap;
243
+ gap: 20rpx;
244
+ padding: 8rpx 0;
245
+ }
246
+
247
+ @keyframes rotate {
248
+ 0% {
249
+ transform: rotate(0deg);
250
+ }
251
+ 100% {
252
+ transform: rotate(360deg);
253
+ }
254
+ }
255
+
256
+ // ==================== 只读模式网格布局(混合媒体) ====================
257
+ .readonly-grid {
258
+ display: grid;
259
+ width: 100%;
260
+ align-items: start;
261
+
262
+ // 右对齐时,让 Grid 容器靠右
263
+ &.align-right {
264
+ justify-content: end;
265
+ margin-left: auto;
266
+ width: fit-content;
267
+ }
268
+
269
+ .readonly-grid-item {
270
+ position: relative;
271
+ overflow: hidden;
272
+ width: 100%;
273
+ aspect-ratio: 1 / 1;
274
+
275
+ // 占位元素样式(不显示,但占据空间)
276
+ &.placeholder-item {
277
+ visibility: hidden;
278
+ pointer-events: none;
279
+
280
+ .placeholder-content {
281
+ width: 100%;
282
+ height: 100%;
283
+ }
284
+ }
285
+
286
+ image {
287
+ width: 100%;
288
+ height: 100%;
289
+ display: block;
290
+ }
291
+
292
+ .readonly-video {
293
+ width: 100%;
294
+ height: 100%;
295
+ display: block;
296
+ }
297
+
298
+ // 视频播放图标覆盖层
299
+ .video-play-overlay {
300
+ position: absolute;
301
+ top: 50%;
302
+ left: 50%;
303
+ transform: translate(-50%, -50%);
304
+ width: 60rpx;
305
+ height: 60rpx;
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: center;
309
+ z-index: 2;
310
+ pointer-events: none;
311
+
312
+ .play-icon {
313
+ width: 100%;
314
+ height: 100%;
315
+ opacity: 0.9;
316
+ }
317
+ }
318
+
319
+ // 媒体加载遮罩
320
+ .media-loading-overlay {
321
+ position: absolute;
322
+ top: 0;
323
+ left: 0;
324
+ right: 0;
325
+ bottom: 0;
326
+ display: flex;
327
+ align-items: center;
328
+ justify-content: center;
329
+ background-color: rgba(0, 0, 0, 0.05);
330
+ }
331
+ }
332
+
333
+ // 超过限制数量时,最后一项显示遮罩
334
+ .filter-avatar {
335
+ position: relative;
336
+ cursor: pointer;
337
+
338
+ &::after {
339
+ content: attr(data-count);
340
+ position: absolute;
341
+ top: 0;
342
+ left: 0;
343
+ right: 0;
344
+ bottom: 0;
345
+ background-color: rgba(0, 0, 0, 0.5);
346
+ border-radius: inherit;
347
+ font-size: 64rpx;
348
+ color: #fff;
349
+ text-align: center;
350
+ display: flex;
351
+ align-items: center;
352
+ justify-content: center;
353
+ transition: background-color 0.3s;
354
+ z-index: 10;
355
+ }
356
+
357
+ &:active::after {
358
+ background-color: rgba(0, 0, 0, 0.7);
359
+ }
360
+ }
361
+ }
362
+
363
+ // ==================== 自定义弹窗样式(从底部滑出) ====================
364
+ .popup-overlay {
365
+ position: fixed;
366
+ top: 0;
367
+ left: 0;
368
+ right: 0;
369
+ bottom: 0;
370
+ background-color: rgba(0, 0, 0, 0);
371
+ z-index: 999;
372
+ transition: background-color 0.3s ease;
373
+ overflow: hidden;
374
+
375
+ &.popup-overlay-show {
376
+ background-color: rgba(0, 0, 0, 0.5);
377
+ }
378
+ }
379
+
380
+ .popup-content {
381
+ position: absolute;
382
+ left: 0;
383
+ right: 0;
384
+ bottom: 0;
385
+ max-height: 70vh;
386
+ background: #ffffff;
387
+ border-radius: 24rpx 24rpx 0 0;
388
+ overflow: hidden;
389
+ display: flex;
390
+ flex-direction: column;
391
+ transform: translateY(100%);
392
+ transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
393
+ box-sizing: border-box;
394
+
395
+ &.popup-content-show {
396
+ transform: translateY(0);
397
+ }
398
+
399
+ .popup-header {
400
+ position: relative;
401
+ display: flex;
402
+ align-items: center;
403
+ justify-content: center;
404
+ padding: 32rpx 32rpx 24rpx;
405
+ border-bottom: 1rpx solid #f0f0f0;
406
+ flex-shrink: 0;
407
+ box-sizing: border-box;
408
+ height: 96rpx;
409
+
410
+ .popup-title {
411
+ font-size: 32rpx;
412
+ font-weight: 600;
413
+ color: #333333;
414
+ text-align: center;
415
+ }
416
+
417
+ .popup-close {
418
+ position: absolute;
419
+ right: 32rpx;
420
+ top: 50%;
421
+ transform: translateY(-50%);
422
+ width: 48rpx;
423
+ height: 48rpx;
424
+ display: flex;
425
+ align-items: center;
426
+ justify-content: center;
427
+ font-size: 40rpx;
428
+ color: #999999;
429
+ cursor: pointer;
430
+ transition: all 0.3s;
431
+ flex-shrink: 0;
432
+
433
+ &:active {
434
+ opacity: 0.6;
435
+ transform: translateY(-50%) scale(0.9);
436
+ }
437
+ }
438
+ }
439
+
440
+ .popup-scroll {
441
+ width: 100%;
442
+ height: calc(70vh - 96rpx);
443
+ box-sizing: border-box;
444
+ }
445
+
446
+ .popup-grid {
447
+ display: grid;
448
+ grid-template-columns: repeat(3, 1fr);
449
+ gap: 16rpx;
450
+ padding: 24rpx 32rpx;
451
+ box-sizing: border-box;
452
+
453
+ .popup-grid-item {
454
+ position: relative;
455
+ width: 100%;
456
+ aspect-ratio: 1 / 1;
457
+ overflow: hidden;
458
+ cursor: pointer;
459
+ transition: transform 0.2s;
460
+
461
+ &:active {
462
+ transform: scale(0.95);
463
+ }
464
+
465
+ image {
466
+ width: 100%;
467
+ height: 100%;
468
+ display: block;
469
+ }
470
+
471
+ .popup-video {
472
+ width: 100%;
473
+ height: 100%;
474
+ display: block;
475
+ }
476
+
477
+ // 视频播放图标(小)
478
+ .video-play-overlay {
479
+ position: absolute;
480
+ top: 50%;
481
+ left: 50%;
482
+ transform: translate(-50%, -50%);
483
+ width: 48rpx;
484
+ height: 48rpx;
485
+ display: flex;
486
+ align-items: center;
487
+ justify-content: center;
488
+ z-index: 2;
489
+ pointer-events: none;
490
+
491
+ .play-icon-small {
492
+ width: 100%;
493
+ height: 100%;
494
+ opacity: 0.9;
495
+ }
496
+ }
497
+
498
+ // 媒体加载遮罩
499
+ .media-loading-overlay {
500
+ position: absolute;
501
+ top: 0;
502
+ left: 0;
503
+ right: 0;
504
+ bottom: 0;
505
+ display: flex;
506
+ align-items: center;
507
+ justify-content: center;
508
+ background-color: rgba(0, 0, 0, 0.05);
509
+ }
510
+ }
511
+ }
512
+ }
513
+
514
+ // ==================== 加载动画 ====================
515
+ .loading-spinner {
516
+ width: 40rpx;
517
+ height: 40rpx;
518
+ border: 4rpx solid rgba(0, 0, 0, 0.1);
519
+ border-top-color: #007aff;
520
+ border-radius: 50%;
521
+ animation: spinner-rotate 0.8s linear infinite;
522
+ }
523
+
524
+ @keyframes spinner-rotate {
525
+ 0% {
526
+ transform: rotate(0deg);
527
+ }
528
+ 100% {
529
+ transform: rotate(360deg);
530
+ }
531
+ }