uniApp全局公共样式

内置的一些类名,方便全局使用

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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
/*
全局公共样式
by fk 2020年11月5日11:27
*/

body {
/* background-color: #f6f6f6; */
color: #333333;
font-family: Helvetica Neue, Helvetica, sans-serif;
}

.yuan {
border-radius: 50%;
}

view,
scroll-view,
swiper,
button,
input,
textarea,
label,
navigator,
image {
box-sizing: border-box;
}

.btnhover {
opacity: 0.7;
}

.c-white {
color: #ffffff;
}

.bg-white {
background-color: #fff;
}

.c-black {
color: #333333;
}

.ty_content-tab {
height: calc(100vh - var(--status-bar-height));
width: 100%;
/* background-color: #f6f6f6; */
}

.ty_content {
min-height: 100vh;
width: 100%;
background-color: #fff;
}

.ty_contenthui {
min-height: 100vh;
width: 100%;
background-color: #f6f6f6;
}

.ty-hengxiang {
display: flex;
flex-direction: row;
}

.ty_hengxiangjuzhong {
display: flex;
flex-direction: row;
-webkit-justify-content: center;
justify-content: center;
}

.ty_hengxiangliangduan {
display: flex;
flex-direction: row;
-webkit-justify-content: space-between;
justify-content: space-between;
}

.ty_hengxiangjuyou {
display: flex;
flex-direction: row;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}

.ty-zidongzhanman {
-webkit-flex: 1;
flex: 1;
}

.ty-hengxianghuanhang {
display: flex;
flex-wrap: wrap;
}

.ty_zidongzhanman {
-webkit-flex: 1;
flex: 1;
}

.ty_chuizhijuzhong {
align-items: center;
}

.ty_shang {
width: 750rpx;
height: 40rpx;
}

.ty_daohanglan {
width: 750rpx;
height: 128rpx;
background-color: #ffffff;
}

.ty_anniuzi {
width: 750rpx;
height: 88rpx;

align-items: center;
-webkit-justify-content: space-between;
justify-content: space-between;
}

.ty_biaoti {
margin-right: 64rpx;
-webkit-flex: 1;
flex: 1;
text-align: center;
font-size: 36rpx;
letter-spacing: 0rpx;
color: #464646;
}

.ty_yuan {
border-radius: 150rpx;
}

.ty_mc {
background: rgba(0, 0, 0, 0.4);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10241;
}

.ty_mc10 {
background: rgba(0, 0, 0, 1);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 102411;
}

.ty_back {
width: 45rpx;
height: 45rpx;
}

.ty_guding {
position: fixed;
width: 100%;
top: 0;
z-index: 1024;
box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1);
}

.ty_beijinghuise {
width: 100%;
background-color: #f1f1f1;
}

.ty_congxiapailie {
display: flex;
flex-direction: column-reverse;
}

.ty_mengceng {
background: rgba(21, 19, 19, 0.6);
box-sizing: border-box;
position: fixed;
z-index: 1111;
width: 750rpx;
}

.t-s {
text-shadow: #999 2rpx 2rpx 5rpx;
}

/* 特殊处理 */
.ty_shanchuxian {
text-decoration: line-through;
/* 加删除线 */
}

/*========== flex布局相关 ==========*/
.dp-f {
display: flex;
display: -webkit-flex;
/*在webkit内核的浏览器上使用要加前缀*/
}

/*快捷水平垂直居中*/
.dp-fc {
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: center;
}

/*行内块元素*/
.dp-ib {
display: inline-block !important;
}

/* 主轴方向 */
.fd-rr {
flex-direction: row-reverse !important;
/* 主轴方向从右到左,默认从左到右 */
}

.fd-c {
flex-direction: column !important;
/* 主轴方向从上到下,默认从左到右 */
}

.fd-cr {
flex-direction: column-reverse !important;
/* 主轴方向从下到上,默认从左到右 */
}

/* flex-wrap属性 */
.fw-w {
flex-wrap: wrap !important;
/* 换行,第一行在上方。 */
}

.fw-wr {
flex-wrap: wrap-reverse !important;
/* 换行,第一行在下方。 */
}

/* justify-content属性 */
.jc-fs {
justify-content: flex-start !important;
/* 在主轴左对齐-默认 */
}

.jc-fe {
justify-content: flex-end !important;
/* 在主轴右对齐 */
}

.jc-c {
justify-content: center !important;
/* 在主轴居中对齐 */
}

.jc-sb {
justify-content: space-between !important;
/* 两端对齐(两边不留空) */
}

.jc-sa {
justify-content: space-around !important;
/* 等距对齐*/
}

/* align-items属性 */
.ai-fs {
align-items: flex-start !important;
}

.ai-fe {
align-items: flex-end !important;
/* 底对齐 */
}

.ai-c {
align-items: center !important;
/* 水平居中 */
}

.ai-bl {
align-items: baseline !important;
/* 水平居中 */
}

/* align-content属性(多列对齐) */

.ac-fs {
align-content: flex-start !important;
/* 与交叉轴的起点对齐 */
}

.ac-fe {
align-content: flex-end !important;
/* 与交叉轴的终点对齐 */
}

.ac-c {
align-content: center !important;
/* 与交叉轴的中点对齐。 */
}

.ac-sb {
align-content: space-between !important;
/* 与交叉轴两端对齐,轴线之间的间隔平均分布。 */
}

.ac-sa {
align-content: space-around !important;
/* 每根轴线两侧的间隔都相等。所以,轴线之间的间隔比轴线与边框的间隔大一倍。 */
}

/* align-self属性(默认auto),该属性用于子元素特殊处理 */
.as-fs {
align-self: flex-start !important;
/* 自身在交叉左对齐 */
}

.as-fe {
align-self: flex-end !important;
/* 自身在交叉右对齐 */
}

.as-c {
align-self: center !important;
/* 自身在交叉居中对齐 */
}

.as-bl {
align-self: baseline !important;
/* 自身根据文字对齐 */
}

/* 定位相关 */
.pt-f {
position: fixed;
}

.pt-r {
position: relative;
}

.pt-a {
position: absolute;
}

.top-0 {
top: 0;
}

.lef-0 {
left: 0;
}

.rig-0 {
right: 0;
}

.bot-0 {
bottom: 0;
}

.all-0 {
top: 0;
left: 0;
right: 0;
bottom: 0;
}

/* 百分比 */
.w100 {
width: 100%;
}

.h100 {
height: 100%;
}

/* 对齐方式 */
.te-l {
text-align: left;
}

.te-r {
text-align: right;
}

.te-c {
text-align: center;
}

/* 粗体 */
.fw-b {
font-weight: bold;
}

.fw-l {
font-weight: lighter;
}

.fw-n {
font-weight: normal;
}

// 定义flex等分
@for $i from 0 through 12 {
.f-#{$i} {
flex: $i;
}
}

// 定义字体(rpx)单位,10~100rpx fs-10 ~ fs-100
@for $i from 10 through 100 {
.fs-#{$i} {
font-size: $i + rpx;
}
}

// 定义内外边距,历遍1-100
@for $i from 0 through 100 {
// 得出:m-all-30
.m-all-#{$i} {
margin: $i + rpx;
}

// 得出:p-all-30
.p-all-#{$i} {
padding: $i + rpx;
}

@each $short, $long in l left, t top, r right, b bottom {
// 缩写版,结果如: ml-30
// 定义外边距
.m#{$short}-#{$i} {
margin-#{$long}: $i + rpx;
}

// 定义内边距
.p#{$short}-#{$i} {
padding-#{$long}: $i + rpx;
}
}
}

//全局宽高
@for $i from 0 through 750 {
// w-0 ~ w-750
.w-#{$i} {
width: $i + rpx;
}
// h-0 ~ h-750
.h-#{$i} {
height: $i + rpx;
}
}

//全局圆角 行高 br-0 ~ br-50 lh0 ~ lh-50
@for $i from 0 through 50 {
// w-0 ~ w-750
.br-#{$i} {
border-radius: $i + rpx;
}
// h-0 ~ h-750
.lh-#{$i} {
line-height: $i + rpx;
}
}

/* start--文本行数限制--start */
.line-1 {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}

.line-2 {
-webkit-line-clamp: 2;
}

.line-3 {
-webkit-line-clamp: 3;
}

.line-4 {
-webkit-line-clamp: 4;
}

.line-5 {
-webkit-line-clamp: 5;
}

.line-2,
.line-3,
.line-4,
.line-5 {
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box; // 弹性伸缩盒
-webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
}