@vtj/materials 0.10.1-alpha.0 → 0.10.1-alpha.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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +3 -3
- package/dist/assets/uni-ui/index.umd.js +7 -0
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +2 -2
- package/dist/deps/@vtj/uni/index.umd.js +3 -3
- package/dist/deps/@vtj/utils/index.umd.js +2 -2
- package/dist/deps/mockjs/mock-min.js +10 -0
- package/dist/deps/uni-ui/index.umd.js +1 -0
- package/dist/deps/uni-ui/style.css +1 -0
- package/package.json +9 -6
- package/src/env.d.ts +7 -0
- package/src/uni-h5/components/index.ts +43 -2
- package/src/uni-ui/components/badge.ts +73 -0
- package/src/uni-ui/components/index.ts +30 -0
- package/src/uni-ui/index.ts +213 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +177 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +947 -0
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +22 -0
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hans.json +22 -0
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hant.json +22 -0
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +940 -0
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +1232 -0
- package/src/uni-ui/lib/uni-datetime-picker/util.js +421 -0
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +416 -0
- package/src/uni-ui/lib/uni-forms/utils.js +293 -0
- package/src/uni-ui/lib/uni-forms/validate.js +486 -0
- package/src/uni-ui/lib/uni-popup/i18n/en.json +7 -0
- package/src/uni-ui/lib/uni-popup/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hans.json +7 -0
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hant.json +7 -0
- package/src/uni-ui/lib/uni-popup/keypress.js +45 -0
- package/src/uni-ui/lib/uni-popup/popup.js +26 -0
- package/src/uni-ui/lib/uni-popup/uni-popup.uvue +90 -0
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +552 -0
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +302 -0
- package/src/uni-ui/lib/uni-swipe-action-item/isPC.js +12 -0
- package/src/uni-ui/lib/uni-swipe-action-item/mpalipay.js +195 -0
- package/src/uni-ui/lib/uni-swipe-action-item/mpother.js +260 -0
- package/src/uni-ui/lib/uni-swipe-action-item/mpwxs.js +84 -0
- package/src/uni-ui/lib/uni-swipe-action-item/render.js +270 -0
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +494 -0
- package/src/uni-ui/lib/uni-swipe-action-item/wx.wxs +341 -0
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +511 -0
- package/src/uni-ui/lib/uni-th/uni-th.vue +295 -0
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +179 -0
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +184 -0
- package/src/uni-ui/lib/uni.scss +76 -0
- package/src/uni-ui/polyfill.ts +41 -0
- package/src/version.ts +2 -2
@@ -0,0 +1,552 @@
|
|
1
|
+
<template>
|
2
|
+
<view
|
3
|
+
v-if="showPopup"
|
4
|
+
class="uni-popup"
|
5
|
+
:class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
|
6
|
+
<view @touchstart="touchstart">
|
7
|
+
<uni-transition
|
8
|
+
key="1"
|
9
|
+
v-if="maskShow"
|
10
|
+
name="mask"
|
11
|
+
mode-class="fade"
|
12
|
+
:styles="maskClass"
|
13
|
+
:duration="duration"
|
14
|
+
:show="showTrans"
|
15
|
+
@click="onTap" />
|
16
|
+
<uni-transition
|
17
|
+
key="2"
|
18
|
+
:mode-class="ani"
|
19
|
+
name="content"
|
20
|
+
:styles="transClass"
|
21
|
+
:duration="duration"
|
22
|
+
:show="showTrans"
|
23
|
+
@click="onTap">
|
24
|
+
<view
|
25
|
+
class="uni-popup__wrapper"
|
26
|
+
:style="getStyles"
|
27
|
+
:class="[popupstyle]"
|
28
|
+
@click="clear">
|
29
|
+
<slot />
|
30
|
+
</view>
|
31
|
+
</uni-transition>
|
32
|
+
</view>
|
33
|
+
<!-- #ifdef H5 -->
|
34
|
+
<keypress v-if="maskShow" @esc="onTap" />
|
35
|
+
<!-- #endif -->
|
36
|
+
</view>
|
37
|
+
</template>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
// #ifdef H5
|
41
|
+
import keypress from './keypress.js';
|
42
|
+
// #endif
|
43
|
+
|
44
|
+
/**
|
45
|
+
* PopUp 弹出层
|
46
|
+
* @description 弹出层组件,为了解决遮罩弹层的问题
|
47
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
48
|
+
* @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
|
49
|
+
* @value top 顶部弹出
|
50
|
+
* @value center 中间弹出
|
51
|
+
* @value bottom 底部弹出
|
52
|
+
* @value left 左侧弹出
|
53
|
+
* @value right 右侧弹出
|
54
|
+
* @value message 消息提示
|
55
|
+
* @value dialog 对话框
|
56
|
+
* @value share 底部分享示例
|
57
|
+
* @property {Boolean} animation = [true|false] 是否开启动画
|
58
|
+
* @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
|
59
|
+
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
|
60
|
+
* @property {String} backgroundColor 主窗口背景色
|
61
|
+
* @property {String} maskBackgroundColor 蒙版颜色
|
62
|
+
* @property {String} borderRadius 设置圆角(左上、右上、右下和左下) 示例:"10px 10px 10px 10px"
|
63
|
+
* @property {Boolean} safeArea 是否适配底部安全区
|
64
|
+
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
65
|
+
* @event {Function} maskClick 点击遮罩触发
|
66
|
+
*/
|
67
|
+
|
68
|
+
export default {
|
69
|
+
name: 'uniPopup',
|
70
|
+
components: {
|
71
|
+
// #ifdef H5
|
72
|
+
keypress
|
73
|
+
// #endif
|
74
|
+
},
|
75
|
+
emits: ['change', 'maskClick'],
|
76
|
+
props: {
|
77
|
+
// 开启动画
|
78
|
+
animation: {
|
79
|
+
type: Boolean,
|
80
|
+
default: true
|
81
|
+
},
|
82
|
+
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
83
|
+
// message: 消息提示 ; dialog : 对话框
|
84
|
+
type: {
|
85
|
+
type: String,
|
86
|
+
default: 'center'
|
87
|
+
},
|
88
|
+
// maskClick
|
89
|
+
isMaskClick: {
|
90
|
+
type: Boolean,
|
91
|
+
default: null
|
92
|
+
},
|
93
|
+
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
|
94
|
+
maskClick: {
|
95
|
+
type: Boolean,
|
96
|
+
default: null
|
97
|
+
},
|
98
|
+
backgroundColor: {
|
99
|
+
type: String,
|
100
|
+
default: 'none'
|
101
|
+
},
|
102
|
+
safeArea: {
|
103
|
+
type: Boolean,
|
104
|
+
default: true
|
105
|
+
},
|
106
|
+
maskBackgroundColor: {
|
107
|
+
type: String,
|
108
|
+
default: 'rgba(0, 0, 0, 0.4)'
|
109
|
+
},
|
110
|
+
borderRadius: {
|
111
|
+
type: String
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
watch: {
|
116
|
+
/**
|
117
|
+
* 监听type类型
|
118
|
+
*/
|
119
|
+
type: {
|
120
|
+
handler: function (type) {
|
121
|
+
if (!this.config[type]) return;
|
122
|
+
this[this.config[type]](true);
|
123
|
+
},
|
124
|
+
immediate: true
|
125
|
+
},
|
126
|
+
isDesktop: {
|
127
|
+
handler: function (newVal) {
|
128
|
+
if (!this.config[newVal]) return;
|
129
|
+
this[this.config[this.type]](true);
|
130
|
+
},
|
131
|
+
immediate: true
|
132
|
+
},
|
133
|
+
/**
|
134
|
+
* 监听遮罩是否可点击
|
135
|
+
* @param {Object} val
|
136
|
+
*/
|
137
|
+
maskClick: {
|
138
|
+
handler: function (val) {
|
139
|
+
this.mkclick = val;
|
140
|
+
},
|
141
|
+
immediate: true
|
142
|
+
},
|
143
|
+
isMaskClick: {
|
144
|
+
handler: function (val) {
|
145
|
+
this.mkclick = val;
|
146
|
+
},
|
147
|
+
immediate: true
|
148
|
+
},
|
149
|
+
// H5 下禁止底部滚动
|
150
|
+
showPopup(show) {
|
151
|
+
// #ifdef H5
|
152
|
+
// fix by mehaotian 处理 h5 滚动穿透的问题
|
153
|
+
document.getElementsByTagName('body')[0].style.overflow = show
|
154
|
+
? 'hidden'
|
155
|
+
: 'visible';
|
156
|
+
// #endif
|
157
|
+
}
|
158
|
+
},
|
159
|
+
data() {
|
160
|
+
return {
|
161
|
+
duration: 300,
|
162
|
+
ani: [],
|
163
|
+
showPopup: false,
|
164
|
+
showTrans: false,
|
165
|
+
popupWidth: 0,
|
166
|
+
popupHeight: 0,
|
167
|
+
config: {
|
168
|
+
top: 'top',
|
169
|
+
bottom: 'bottom',
|
170
|
+
center: 'center',
|
171
|
+
left: 'left',
|
172
|
+
right: 'right',
|
173
|
+
message: 'top',
|
174
|
+
dialog: 'center',
|
175
|
+
share: 'bottom'
|
176
|
+
},
|
177
|
+
maskClass: {
|
178
|
+
position: 'fixed',
|
179
|
+
bottom: 0,
|
180
|
+
top: 0,
|
181
|
+
left: 0,
|
182
|
+
right: 0,
|
183
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)'
|
184
|
+
},
|
185
|
+
transClass: {
|
186
|
+
backgroundColor: 'transparent',
|
187
|
+
borderRadius: this.borderRadius || '0',
|
188
|
+
position: 'fixed',
|
189
|
+
left: 0,
|
190
|
+
right: 0
|
191
|
+
},
|
192
|
+
maskShow: true,
|
193
|
+
mkclick: true,
|
194
|
+
popupstyle: 'top'
|
195
|
+
};
|
196
|
+
},
|
197
|
+
computed: {
|
198
|
+
getStyles() {
|
199
|
+
let res = { backgroundColor: this.bg };
|
200
|
+
if (this.borderRadius || '0') {
|
201
|
+
res = Object.assign(res, { borderRadius: this.borderRadius });
|
202
|
+
}
|
203
|
+
return res;
|
204
|
+
},
|
205
|
+
isDesktop() {
|
206
|
+
return this.popupWidth >= 500 && this.popupHeight >= 500;
|
207
|
+
},
|
208
|
+
bg() {
|
209
|
+
if (this.backgroundColor === '' || this.backgroundColor === 'none') {
|
210
|
+
return 'transparent';
|
211
|
+
}
|
212
|
+
return this.backgroundColor;
|
213
|
+
}
|
214
|
+
},
|
215
|
+
mounted() {
|
216
|
+
const fixSize = () => {
|
217
|
+
// #ifdef MP-WEIXIN
|
218
|
+
const {
|
219
|
+
windowWidth,
|
220
|
+
windowHeight,
|
221
|
+
windowTop,
|
222
|
+
safeArea,
|
223
|
+
screenHeight,
|
224
|
+
safeAreaInsets
|
225
|
+
} = uni.getWindowInfo();
|
226
|
+
// #endif
|
227
|
+
// #ifndef MP-WEIXIN
|
228
|
+
// const {
|
229
|
+
// windowWidth,
|
230
|
+
// windowHeight,
|
231
|
+
// windowTop,
|
232
|
+
// safeArea,
|
233
|
+
// screenHeight,
|
234
|
+
// safeAreaInsets
|
235
|
+
// } = uni.getSystemInfoSync()
|
236
|
+
// #endif
|
237
|
+
this.popupWidth = windowWidth;
|
238
|
+
this.popupHeight = windowHeight + (windowTop || 0);
|
239
|
+
// TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
|
240
|
+
if (safeArea && this.safeArea) {
|
241
|
+
// #ifdef MP-WEIXIN
|
242
|
+
this.safeAreaInsets = screenHeight - safeArea.bottom;
|
243
|
+
// #endif
|
244
|
+
// #ifndef MP-WEIXIN
|
245
|
+
this.safeAreaInsets = safeAreaInsets.bottom;
|
246
|
+
// #endif
|
247
|
+
} else {
|
248
|
+
this.safeAreaInsets = 0;
|
249
|
+
}
|
250
|
+
};
|
251
|
+
fixSize();
|
252
|
+
// #ifdef H5
|
253
|
+
// window.addEventListener('resize', fixSize)
|
254
|
+
// this.$once('hook:beforeDestroy', () => {
|
255
|
+
// window.removeEventListener('resize', fixSize)
|
256
|
+
// })
|
257
|
+
// #endif
|
258
|
+
},
|
259
|
+
// #ifndef VUE3
|
260
|
+
// TODO vue2
|
261
|
+
destroyed() {
|
262
|
+
this.setH5Visible();
|
263
|
+
},
|
264
|
+
// #endif
|
265
|
+
// #ifdef VUE3
|
266
|
+
// TODO vue3
|
267
|
+
unmounted() {
|
268
|
+
this.setH5Visible();
|
269
|
+
},
|
270
|
+
// #endif
|
271
|
+
activated() {
|
272
|
+
this.setH5Visible(!this.showPopup);
|
273
|
+
},
|
274
|
+
deactivated() {
|
275
|
+
this.setH5Visible(true);
|
276
|
+
},
|
277
|
+
created() {
|
278
|
+
// this.mkclick = this.isMaskClick || this.maskClick
|
279
|
+
if (this.isMaskClick === null && this.maskClick === null) {
|
280
|
+
this.mkclick = true;
|
281
|
+
} else {
|
282
|
+
this.mkclick =
|
283
|
+
this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
|
284
|
+
}
|
285
|
+
if (this.animation) {
|
286
|
+
this.duration = 300;
|
287
|
+
} else {
|
288
|
+
this.duration = 0;
|
289
|
+
}
|
290
|
+
// TODO 处理 message 组件生命周期异常的问题
|
291
|
+
this.messageChild = null;
|
292
|
+
// TODO 解决头条冒泡的问题
|
293
|
+
this.clearPropagation = false;
|
294
|
+
this.maskClass.backgroundColor = this.maskBackgroundColor;
|
295
|
+
},
|
296
|
+
methods: {
|
297
|
+
setH5Visible(visible = true) {
|
298
|
+
// #ifdef H5
|
299
|
+
// fix by mehaotian 处理 h5 滚动穿透的问题
|
300
|
+
document.getElementsByTagName('body')[0].style.overflow = visible
|
301
|
+
? 'visible'
|
302
|
+
: 'hidden';
|
303
|
+
// #endif
|
304
|
+
},
|
305
|
+
/**
|
306
|
+
* 公用方法,不显示遮罩层
|
307
|
+
*/
|
308
|
+
closeMask() {
|
309
|
+
this.maskShow = false;
|
310
|
+
},
|
311
|
+
/**
|
312
|
+
* 公用方法,遮罩层禁止点击
|
313
|
+
*/
|
314
|
+
disableMask() {
|
315
|
+
this.mkclick = false;
|
316
|
+
},
|
317
|
+
// TODO nvue 取消冒泡
|
318
|
+
clear(e) {
|
319
|
+
// #ifndef APP-NVUE
|
320
|
+
e.stopPropagation();
|
321
|
+
// #endif
|
322
|
+
this.clearPropagation = true;
|
323
|
+
},
|
324
|
+
|
325
|
+
open(direction) {
|
326
|
+
// fix by mehaotian 处理快速打开关闭的情况
|
327
|
+
if (this.showPopup) {
|
328
|
+
return;
|
329
|
+
}
|
330
|
+
let innerType = [
|
331
|
+
'top',
|
332
|
+
'center',
|
333
|
+
'bottom',
|
334
|
+
'left',
|
335
|
+
'right',
|
336
|
+
'message',
|
337
|
+
'dialog',
|
338
|
+
'share'
|
339
|
+
];
|
340
|
+
if (!(direction && innerType.indexOf(direction) !== -1)) {
|
341
|
+
direction = this.type;
|
342
|
+
}
|
343
|
+
if (!this.config[direction]) {
|
344
|
+
console.error('缺少类型:', direction);
|
345
|
+
return;
|
346
|
+
}
|
347
|
+
this[this.config[direction]]();
|
348
|
+
this.$emit('change', {
|
349
|
+
show: true,
|
350
|
+
type: direction
|
351
|
+
});
|
352
|
+
},
|
353
|
+
close(type) {
|
354
|
+
this.showTrans = false;
|
355
|
+
this.$emit('change', {
|
356
|
+
show: false,
|
357
|
+
type: this.type
|
358
|
+
});
|
359
|
+
clearTimeout(this.timer);
|
360
|
+
// // 自定义关闭事件
|
361
|
+
// this.customOpen && this.customClose()
|
362
|
+
this.timer = setTimeout(() => {
|
363
|
+
this.showPopup = false;
|
364
|
+
}, 300);
|
365
|
+
},
|
366
|
+
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
367
|
+
touchstart() {
|
368
|
+
this.clearPropagation = false;
|
369
|
+
},
|
370
|
+
|
371
|
+
onTap() {
|
372
|
+
if (this.clearPropagation) {
|
373
|
+
// fix by mehaotian 兼容 nvue
|
374
|
+
this.clearPropagation = false;
|
375
|
+
return;
|
376
|
+
}
|
377
|
+
this.$emit('maskClick');
|
378
|
+
if (!this.mkclick) return;
|
379
|
+
this.close();
|
380
|
+
},
|
381
|
+
/**
|
382
|
+
* 顶部弹出样式处理
|
383
|
+
*/
|
384
|
+
top(type) {
|
385
|
+
this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top';
|
386
|
+
this.ani = ['slide-top'];
|
387
|
+
this.transClass = {
|
388
|
+
position: 'fixed',
|
389
|
+
left: 0,
|
390
|
+
right: 0,
|
391
|
+
backgroundColor: this.bg,
|
392
|
+
borderRadius: this.borderRadius || '0'
|
393
|
+
};
|
394
|
+
// TODO 兼容 type 属性 ,后续会废弃
|
395
|
+
if (type) return;
|
396
|
+
this.showPopup = true;
|
397
|
+
this.showTrans = true;
|
398
|
+
this.$nextTick(() => {
|
399
|
+
this.showPoptrans();
|
400
|
+
if (this.messageChild && this.type === 'message') {
|
401
|
+
this.messageChild.timerClose();
|
402
|
+
}
|
403
|
+
});
|
404
|
+
},
|
405
|
+
/**
|
406
|
+
* 底部弹出样式处理
|
407
|
+
*/
|
408
|
+
bottom(type) {
|
409
|
+
this.popupstyle = 'bottom';
|
410
|
+
this.ani = ['slide-bottom'];
|
411
|
+
this.transClass = {
|
412
|
+
position: 'fixed',
|
413
|
+
left: 0,
|
414
|
+
right: 0,
|
415
|
+
bottom: 0,
|
416
|
+
paddingBottom: this.safeAreaInsets + 'px',
|
417
|
+
backgroundColor: this.bg,
|
418
|
+
borderRadius: this.borderRadius || '0'
|
419
|
+
};
|
420
|
+
// TODO 兼容 type 属性 ,后续会废弃
|
421
|
+
if (type) return;
|
422
|
+
this.showPoptrans();
|
423
|
+
},
|
424
|
+
/**
|
425
|
+
* 中间弹出样式处理
|
426
|
+
*/
|
427
|
+
center(type) {
|
428
|
+
this.popupstyle = 'center';
|
429
|
+
//微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
|
430
|
+
// #ifdef MP-WEIXIN
|
431
|
+
this.ani = ['fade'];
|
432
|
+
// #endif
|
433
|
+
// #ifndef MP-WEIXIN
|
434
|
+
this.ani = ['zoom-out', 'fade'];
|
435
|
+
// #endif
|
436
|
+
this.transClass = {
|
437
|
+
position: 'fixed',
|
438
|
+
/* #ifndef APP-NVUE */
|
439
|
+
display: 'flex',
|
440
|
+
flexDirection: 'column',
|
441
|
+
/* #endif */
|
442
|
+
bottom: 0,
|
443
|
+
left: 0,
|
444
|
+
right: 0,
|
445
|
+
top: 0,
|
446
|
+
justifyContent: 'center',
|
447
|
+
alignItems: 'center',
|
448
|
+
borderRadius: this.borderRadius || '0'
|
449
|
+
};
|
450
|
+
// TODO 兼容 type 属性 ,后续会废弃
|
451
|
+
if (type) return;
|
452
|
+
this.showPoptrans();
|
453
|
+
},
|
454
|
+
left(type) {
|
455
|
+
this.popupstyle = 'left';
|
456
|
+
this.ani = ['slide-left'];
|
457
|
+
this.transClass = {
|
458
|
+
position: 'fixed',
|
459
|
+
left: 0,
|
460
|
+
bottom: 0,
|
461
|
+
top: 0,
|
462
|
+
backgroundColor: this.bg,
|
463
|
+
borderRadius: this.borderRadius || '0',
|
464
|
+
/* #ifndef APP-NVUE */
|
465
|
+
display: 'flex',
|
466
|
+
flexDirection: 'column'
|
467
|
+
/* #endif */
|
468
|
+
};
|
469
|
+
// TODO 兼容 type 属性 ,后续会废弃
|
470
|
+
if (type) return;
|
471
|
+
this.showPoptrans();
|
472
|
+
},
|
473
|
+
right(type) {
|
474
|
+
this.popupstyle = 'right';
|
475
|
+
this.ani = ['slide-right'];
|
476
|
+
this.transClass = {
|
477
|
+
position: 'fixed',
|
478
|
+
bottom: 0,
|
479
|
+
right: 0,
|
480
|
+
top: 0,
|
481
|
+
backgroundColor: this.bg,
|
482
|
+
borderRadius: this.borderRadius || '0',
|
483
|
+
/* #ifndef APP-NVUE */
|
484
|
+
display: 'flex',
|
485
|
+
flexDirection: 'column'
|
486
|
+
/* #endif */
|
487
|
+
};
|
488
|
+
// TODO 兼容 type 属性 ,后续会废弃
|
489
|
+
if (type) return;
|
490
|
+
this.showPoptrans();
|
491
|
+
},
|
492
|
+
showPoptrans() {
|
493
|
+
this.$nextTick(() => {
|
494
|
+
this.showPopup = true;
|
495
|
+
this.showTrans = true;
|
496
|
+
});
|
497
|
+
}
|
498
|
+
}
|
499
|
+
};
|
500
|
+
</script>
|
501
|
+
<style lang="scss">
|
502
|
+
.uni-popup {
|
503
|
+
position: fixed;
|
504
|
+
/* #ifndef APP-NVUE */
|
505
|
+
z-index: 99;
|
506
|
+
|
507
|
+
/* #endif */
|
508
|
+
&.top,
|
509
|
+
&.left,
|
510
|
+
&.right {
|
511
|
+
/* #ifdef H5 */
|
512
|
+
top: var(--window-top);
|
513
|
+
/* #endif */
|
514
|
+
/* #ifndef H5 */
|
515
|
+
top: 0;
|
516
|
+
/* #endif */
|
517
|
+
}
|
518
|
+
|
519
|
+
.uni-popup__wrapper {
|
520
|
+
/* #ifndef APP-NVUE */
|
521
|
+
display: block;
|
522
|
+
/* #endif */
|
523
|
+
position: relative;
|
524
|
+
|
525
|
+
/* iphonex 等安全区设置,底部安全区适配 */
|
526
|
+
/* #ifndef APP-NVUE */
|
527
|
+
// padding-bottom: constant(safe-area-inset-bottom);
|
528
|
+
// padding-bottom: env(safe-area-inset-bottom);
|
529
|
+
/* #endif */
|
530
|
+
&.left,
|
531
|
+
&.right {
|
532
|
+
/* #ifdef H5 */
|
533
|
+
padding-top: var(--window-top);
|
534
|
+
/* #endif */
|
535
|
+
/* #ifndef H5 */
|
536
|
+
padding-top: 0;
|
537
|
+
/* #endif */
|
538
|
+
flex: 1;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
.fixforpc-z-index {
|
544
|
+
/* #ifndef APP-NVUE */
|
545
|
+
z-index: 999;
|
546
|
+
/* #endif */
|
547
|
+
}
|
548
|
+
|
549
|
+
.fixforpc-top {
|
550
|
+
top: 0;
|
551
|
+
}
|
552
|
+
</style>
|