@10yun/cv-mobile-ui 0.4.1 → 0.4.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/package.json +1 -1
- package/ui-cv/cv-badge/{uni-badge.vue → cv-badge.vue} +2 -2
- package/ui-cv/cv-calendar/calendar.js +762 -345
- package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
- package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
- package/ui-cv/cv-card/cv-card.vue +427 -0
- package/ui-cv/cv-col/cv-col.vue +2965 -0
- package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
- package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
- package/ui-cv/cv-combox/cv-combox.vue +250 -0
- package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
- package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
- package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
- package/ui-cv/cv-data-pickerview/{uni-data-picker.js → cv-data-picker.js} +0 -0
- package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
- package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
- package/ui-cv/cv-datetime-picker/calendar.vue +752 -738
- package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
- package/ui-cv/cv-datetime-picker/time-picker.vue +900 -892
- package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
- package/ui-cv/cv-fab/cv-fab.vue +465 -0
- package/ui-cv/cv-fab/{uni-fab.vue.bak → cv-fab.vue.bak} +2 -2
- package/ui-cv/cv-fav/cv-fav.vue +150 -0
- package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
- package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
- package/ui-cv/cv-goods-nav/{uni-goods-nav.vue → cv-goods-nav.vue} +1 -1
- package/ui-cv/{cv-icons2/cv-icons2.vue → cv-icon2/cv-icon2.vue} +3 -3
- package/ui-cv/{cv-icons2 → cv-icon2}/icons.js +0 -0
- package/ui-cv/{cv-icons2 → cv-icon2}/uni.ttf +0 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
- package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
- package/ui-cv/{cv-link/uni-link.vue → cv-link2/cv-link2.vue} +1 -1
- package/ui-cv/cv-list/cv-list.vue +107 -0
- package/ui-cv/cv-list/cv-refresh.vue +65 -0
- package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.scss → cv-list-chat.scss} +0 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.vue → cv-list-chat.vue} +0 -0
- package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
- package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
- package/ui-cv/cv-nav-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
- package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
- package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
- package/ui-cv/cv-popup/cv-popup.vue +429 -0
- package/ui-cv/cv-popup-dialog/{uni-popup-dialog.vue → cv-popup-dialog.vue} +0 -0
- package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
- package/ui-cv/cv-popup-share/{uni-popup-share.vue → cv-popup-share.vue} +0 -0
- package/ui-cv/cv-row/{uni-row.vue → cv-row.vue} +1 -1
- package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
- package/ui-cv/cv-section/{uni-section.vue → cv-section.vue} +0 -0
- package/ui-cv/cv-segmented-control/{uni-segmented-control.vue → cv-segmented-control.vue} +0 -0
- package/ui-cv/cv-status-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-steps/cv-steps.vue +293 -0
- package/ui-cv/cv-swipe-action/{uni-swipe-action.vue → cv-swipe-action.vue} +0 -0
- package/ui-cv/cv-swipe-action-item/{uni-swipe-action-item.vue → cv-swipe-action-item.vue} +0 -0
- package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
- package/ui-cv/cv-table/cv-table.vue +460 -0
- package/ui-cv/cv-tag/cv-tag.vue +276 -0
- package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
- package/ui-cv/cv-td/cv-td.vue +93 -0
- package/ui-cv/cv-test/{uni-test.vue → cv-test.vue} +0 -0
- package/ui-cv/cv-th/cv-th.vue +270 -0
- package/ui-cv/cv-thead/cv-thead.vue +114 -0
- package/ui-cv/cv-title/cv-title.vue +168 -0
- package/ui-cv/cv-tr/cv-tr.vue +166 -0
- package/ui-cv/cv-transition/cv-transition.vue +279 -0
- package/ui-cv/cv-calendar/uni-calendar-item.vue +0 -171
- package/ui-cv/cv-calendar/uni-calendar.vue +0 -504
- package/ui-cv/cv-card/uni-card.vue +0 -420
- package/ui-cv/cv-col/uni-col.vue +0 -2968
- package/ui-cv/cv-collapse/uni-collapse.vue +0 -146
- package/ui-cv/cv-collapse-item/uni-collapse-item.vue +0 -378
- package/ui-cv/cv-combox/uni-combox.vue +0 -237
- package/ui-cv/cv-countdown/uni-countdown.vue +0 -234
- package/ui-cv/cv-data-checkbox/uni-data-checkbox.vue +0 -792
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list.vue +0 -364
- package/ui-cv/cv-data-picker/uni-data-picker.vue +0 -468
- package/ui-cv/cv-data-pickerview/uni-data-pickerview.vue +0 -298
- package/ui-cv/cv-dateformat/uni-dateformat.vue +0 -88
- package/ui-cv/cv-datetime-picker/uni-datetime-picker.vue +0 -874
- package/ui-cv/cv-easyinput/uni-easyinput.vue +0 -438
- package/ui-cv/cv-fab/uni-fab.vue +0 -443
- package/ui-cv/cv-fav/uni-fav.vue +0 -136
- package/ui-cv/cv-file-picker/uni-file-picker.vue +0 -614
- package/ui-cv/cv-indexed-list/uni-indexed-list-item.vue +0 -142
- package/ui-cv/cv-indexed-list/uni-indexed-list.vue +0 -357
- package/ui-cv/cv-list/uni-list.vue +0 -107
- package/ui-cv/cv-list/uni-refresh.vue +0 -65
- package/ui-cv/cv-list-ad/uni-list-ad.vue +0 -106
- package/ui-cv/cv-list-item/uni-list-item.vue +0 -428
- package/ui-cv/cv-nav-bar/uni-nav-bar.vue +0 -244
- package/ui-cv/cv-notice-bar/uni-notice-bar.vue +0 -394
- package/ui-cv/cv-number-box/uni-number-box.vue +0 -224
- package/ui-cv/cv-pagination/uni-pagination.vue +0 -376
- package/ui-cv/cv-popup/uni-popup.vue +0 -412
- package/ui-cv/cv-popup-message/uni-popup-message.vue +0 -143
- package/ui-cv/cv-search-bar/uni-search-bar.vue +0 -262
- package/ui-cv/cv-steps/uni-steps.vue +0 -250
- package/ui-cv/cv-swiper-dot/uni-swiper-dot.vue +0 -205
- package/ui-cv/cv-table/uni-table.vue +0 -455
- package/ui-cv/cv-tag/uni-tag.vue +0 -283
- package/ui-cv/cv-tbody/uni-tbody.vue +0 -30
- package/ui-cv/cv-td/uni-td.vue +0 -88
- package/ui-cv/cv-th/uni-th.vue +0 -259
- package/ui-cv/cv-thead/uni-thead.vue +0 -114
- package/ui-cv/cv-title/uni-title.vue +0 -171
- package/ui-cv/cv-tr/uni-tr.vue +0 -156
- package/ui-cv/cv-transition/uni-transition.vue +0 -287
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']" @touchmove.stop.prevent="clear">
|
|
3
|
-
<view @touchstart="touchstart">
|
|
4
|
-
<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass" :duration="duration" :show="showTrans" @click="onTap" />
|
|
5
|
-
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
|
|
6
|
-
<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
|
|
7
|
-
<slot />
|
|
8
|
-
</view>
|
|
9
|
-
</uni-transition>
|
|
10
|
-
</view>
|
|
11
|
-
<!-- #ifdef H5 -->
|
|
12
|
-
<keypress v-if="maskShow" @esc="onTap" />
|
|
13
|
-
<!-- #endif -->
|
|
14
|
-
</view>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
// #ifdef H5
|
|
19
|
-
import keypress from './keypress.js'
|
|
20
|
-
// #endif
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* PopUp 弹出层
|
|
24
|
-
* @description 弹出层组件,为了解决遮罩弹层的问题
|
|
25
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
26
|
-
* @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
|
|
27
|
-
* @value top 顶部弹出
|
|
28
|
-
* @value center 中间弹出
|
|
29
|
-
* @value bottom 底部弹出
|
|
30
|
-
* @value left 左侧弹出
|
|
31
|
-
* @value right 右侧弹出
|
|
32
|
-
* @value message 消息提示
|
|
33
|
-
* @value dialog 对话框
|
|
34
|
-
* @value share 底部分享示例
|
|
35
|
-
* @property {Boolean} animation = [ture|false] 是否开启动画
|
|
36
|
-
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
|
|
37
|
-
* @property {String} backgroundColor 主窗口背景色
|
|
38
|
-
* @property {Boolean} safeArea 是否适配底部安全区
|
|
39
|
-
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'uniPopup',
|
|
44
|
-
components: {
|
|
45
|
-
// #ifdef H5
|
|
46
|
-
keypress
|
|
47
|
-
// #endif
|
|
48
|
-
},
|
|
49
|
-
emits: ['change', 'maskClick'],
|
|
50
|
-
props: {
|
|
51
|
-
// 开启动画
|
|
52
|
-
animation: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: true
|
|
55
|
-
},
|
|
56
|
-
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
57
|
-
// message: 消息提示 ; dialog : 对话框
|
|
58
|
-
type: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: 'center'
|
|
61
|
-
},
|
|
62
|
-
// maskClick
|
|
63
|
-
maskClick: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: true
|
|
66
|
-
},
|
|
67
|
-
backgroundColor: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: 'none'
|
|
70
|
-
},
|
|
71
|
-
safeArea: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: true
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
watch: {
|
|
78
|
-
/**
|
|
79
|
-
* 监听type类型
|
|
80
|
-
*/
|
|
81
|
-
type: {
|
|
82
|
-
handler: function(type) {
|
|
83
|
-
if (!this.config[type]) return
|
|
84
|
-
this[this.config[type]](true)
|
|
85
|
-
},
|
|
86
|
-
immediate: true
|
|
87
|
-
},
|
|
88
|
-
isDesktop: {
|
|
89
|
-
handler: function(newVal) {
|
|
90
|
-
if (!this.config[newVal]) return
|
|
91
|
-
this[this.config[this.type]](true)
|
|
92
|
-
},
|
|
93
|
-
immediate: true
|
|
94
|
-
},
|
|
95
|
-
/**
|
|
96
|
-
* 监听遮罩是否可点击
|
|
97
|
-
* @param {Object} val
|
|
98
|
-
*/
|
|
99
|
-
maskClick: {
|
|
100
|
-
handler: function(val) {
|
|
101
|
-
this.mkclick = val
|
|
102
|
-
},
|
|
103
|
-
immediate: true
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
data() {
|
|
107
|
-
return {
|
|
108
|
-
duration: 300,
|
|
109
|
-
ani: [],
|
|
110
|
-
showPopup: false,
|
|
111
|
-
showTrans: false,
|
|
112
|
-
popupWidth: 0,
|
|
113
|
-
popupHeight: 0,
|
|
114
|
-
config: {
|
|
115
|
-
top: 'top',
|
|
116
|
-
bottom: 'bottom',
|
|
117
|
-
center: 'center',
|
|
118
|
-
left: 'left',
|
|
119
|
-
right: 'right',
|
|
120
|
-
message: 'top',
|
|
121
|
-
dialog: 'center',
|
|
122
|
-
share: 'bottom'
|
|
123
|
-
},
|
|
124
|
-
maskClass: {
|
|
125
|
-
position: 'fixed',
|
|
126
|
-
bottom: 0,
|
|
127
|
-
top: 0,
|
|
128
|
-
left: 0,
|
|
129
|
-
right: 0,
|
|
130
|
-
backgroundColor: 'rgba(0, 0, 0, 0.4)'
|
|
131
|
-
},
|
|
132
|
-
transClass: {
|
|
133
|
-
position: 'fixed',
|
|
134
|
-
left: 0,
|
|
135
|
-
right: 0
|
|
136
|
-
},
|
|
137
|
-
maskShow: true,
|
|
138
|
-
mkclick: true,
|
|
139
|
-
popupstyle: this.isDesktop ? 'fixforpc-top' : 'top'
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
computed: {
|
|
143
|
-
isDesktop() {
|
|
144
|
-
return this.popupWidth >= 500 && this.popupHeight >= 500
|
|
145
|
-
},
|
|
146
|
-
bg() {
|
|
147
|
-
if (this.backgroundColor === '' || this.backgroundColor === 'none') {
|
|
148
|
-
return 'transparent'
|
|
149
|
-
}
|
|
150
|
-
return this.backgroundColor
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
mounted() {
|
|
154
|
-
const fixSize = () => {
|
|
155
|
-
const {
|
|
156
|
-
windowWidth,
|
|
157
|
-
windowHeight,
|
|
158
|
-
windowTop,
|
|
159
|
-
safeAreaInsets
|
|
160
|
-
} = uni.getSystemInfoSync()
|
|
161
|
-
this.popupWidth = windowWidth
|
|
162
|
-
this.popupHeight = windowHeight + windowTop
|
|
163
|
-
// 是否适配底部安全区
|
|
164
|
-
if (this.safeArea) {
|
|
165
|
-
this.safeAreaInsets = safeAreaInsets
|
|
166
|
-
} else {
|
|
167
|
-
this.safeAreaInsets = 0
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
fixSize()
|
|
171
|
-
// #ifdef H5
|
|
172
|
-
// window.addEventListener('resize', fixSize)
|
|
173
|
-
// this.$once('hook:beforeDestroy', () => {
|
|
174
|
-
// window.removeEventListener('resize', fixSize)
|
|
175
|
-
// })
|
|
176
|
-
// #endif
|
|
177
|
-
},
|
|
178
|
-
created() {
|
|
179
|
-
this.mkclick = this.maskClick
|
|
180
|
-
if (this.animation) {
|
|
181
|
-
this.duration = 300
|
|
182
|
-
} else {
|
|
183
|
-
this.duration = 0
|
|
184
|
-
}
|
|
185
|
-
// TODO 处理 message 组件生命周期异常的问题
|
|
186
|
-
this.messageChild = null
|
|
187
|
-
// TODO 解决头条冒泡的问题
|
|
188
|
-
this.clearPropagation = false
|
|
189
|
-
},
|
|
190
|
-
methods: {
|
|
191
|
-
/**
|
|
192
|
-
* 公用方法,不显示遮罩层
|
|
193
|
-
*/
|
|
194
|
-
closeMask() {
|
|
195
|
-
this.maskShow = false
|
|
196
|
-
},
|
|
197
|
-
/**
|
|
198
|
-
* 公用方法,遮罩层禁止点击
|
|
199
|
-
*/
|
|
200
|
-
disableMask() {
|
|
201
|
-
this.mkclick = false
|
|
202
|
-
},
|
|
203
|
-
// TODO nvue 取消冒泡
|
|
204
|
-
clear(e) {
|
|
205
|
-
// #ifndef APP-NVUE
|
|
206
|
-
e.stopPropagation()
|
|
207
|
-
// #endif
|
|
208
|
-
this.clearPropagation = true
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
open(direction) {
|
|
212
|
-
let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
|
|
213
|
-
if (!(direction && innerType.indexOf(direction) !== -1)) {
|
|
214
|
-
direction = this.type
|
|
215
|
-
}
|
|
216
|
-
if (!this.config[direction]) {
|
|
217
|
-
console.error('缺少类型:', direction)
|
|
218
|
-
return
|
|
219
|
-
}
|
|
220
|
-
this[this.config[direction]]()
|
|
221
|
-
this.$emit('change', {
|
|
222
|
-
show: true,
|
|
223
|
-
type: direction
|
|
224
|
-
})
|
|
225
|
-
},
|
|
226
|
-
close(type) {
|
|
227
|
-
this.showTrans = false
|
|
228
|
-
this.$emit('change', {
|
|
229
|
-
show: false,
|
|
230
|
-
type: this.type
|
|
231
|
-
})
|
|
232
|
-
clearTimeout(this.timer)
|
|
233
|
-
// // 自定义关闭事件
|
|
234
|
-
// this.customOpen && this.customClose()
|
|
235
|
-
this.timer = setTimeout(() => {
|
|
236
|
-
this.showPopup = false
|
|
237
|
-
}, 300)
|
|
238
|
-
},
|
|
239
|
-
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
|
240
|
-
touchstart() {
|
|
241
|
-
this.clearPropagation = false
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
onTap() {
|
|
245
|
-
if (this.clearPropagation) {
|
|
246
|
-
// fix by mehaotian 兼容 nvue
|
|
247
|
-
this.clearPropagation = false
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
this.$emit('maskClick')
|
|
251
|
-
if (!this.mkclick) return
|
|
252
|
-
this.close()
|
|
253
|
-
},
|
|
254
|
-
/**
|
|
255
|
-
* 顶部弹出样式处理
|
|
256
|
-
*/
|
|
257
|
-
top(type) {
|
|
258
|
-
this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
|
|
259
|
-
this.ani = ['slide-top']
|
|
260
|
-
this.transClass = {
|
|
261
|
-
position: 'fixed',
|
|
262
|
-
left: 0,
|
|
263
|
-
right: 0,
|
|
264
|
-
backgroundColor: this.bg
|
|
265
|
-
}
|
|
266
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
267
|
-
if (type) return
|
|
268
|
-
this.showPopup = true
|
|
269
|
-
this.showTrans = true
|
|
270
|
-
this.$nextTick(() => {
|
|
271
|
-
if (this.messageChild && this.type === 'message') {
|
|
272
|
-
this.messageChild.timerClose()
|
|
273
|
-
}
|
|
274
|
-
})
|
|
275
|
-
},
|
|
276
|
-
/**
|
|
277
|
-
* 底部弹出样式处理
|
|
278
|
-
*/
|
|
279
|
-
bottom(type) {
|
|
280
|
-
this.popupstyle = 'bottom'
|
|
281
|
-
this.ani = ['slide-bottom']
|
|
282
|
-
|
|
283
|
-
this.transClass = {
|
|
284
|
-
position: 'fixed',
|
|
285
|
-
left: 0,
|
|
286
|
-
right: 0,
|
|
287
|
-
bottom: 0,
|
|
288
|
-
paddingBottom: (this.safeAreaInsets && this.safeAreaInsets.bottom) || 0,
|
|
289
|
-
backgroundColor: this.bg
|
|
290
|
-
}
|
|
291
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
292
|
-
if (type) return
|
|
293
|
-
this.showPopup = true
|
|
294
|
-
this.showTrans = true
|
|
295
|
-
},
|
|
296
|
-
/**
|
|
297
|
-
* 中间弹出样式处理
|
|
298
|
-
*/
|
|
299
|
-
center(type) {
|
|
300
|
-
this.popupstyle = 'center'
|
|
301
|
-
this.ani = ['zoom-out', 'fade']
|
|
302
|
-
this.transClass = {
|
|
303
|
-
position: 'fixed',
|
|
304
|
-
/* #ifndef APP-NVUE */
|
|
305
|
-
display: 'flex',
|
|
306
|
-
flexDirection: 'column',
|
|
307
|
-
/* #endif */
|
|
308
|
-
bottom: 0,
|
|
309
|
-
left: 0,
|
|
310
|
-
right: 0,
|
|
311
|
-
top: 0,
|
|
312
|
-
justifyContent: 'center',
|
|
313
|
-
alignItems: 'center'
|
|
314
|
-
}
|
|
315
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
316
|
-
if (type) return
|
|
317
|
-
this.showPopup = true
|
|
318
|
-
this.showTrans = true
|
|
319
|
-
},
|
|
320
|
-
left(type) {
|
|
321
|
-
this.popupstyle = 'left'
|
|
322
|
-
this.ani = ['slide-left']
|
|
323
|
-
this.transClass = {
|
|
324
|
-
position: 'fixed',
|
|
325
|
-
left: 0,
|
|
326
|
-
bottom: 0,
|
|
327
|
-
top: 0,
|
|
328
|
-
backgroundColor: this.bg,
|
|
329
|
-
/* #ifndef APP-NVUE */
|
|
330
|
-
display: 'flex',
|
|
331
|
-
flexDirection: 'column'
|
|
332
|
-
/* #endif */
|
|
333
|
-
}
|
|
334
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
335
|
-
if (type) return
|
|
336
|
-
this.showPopup = true
|
|
337
|
-
this.showTrans = true
|
|
338
|
-
},
|
|
339
|
-
right(type) {
|
|
340
|
-
this.popupstyle = 'right'
|
|
341
|
-
this.ani = ['slide-right']
|
|
342
|
-
this.transClass = {
|
|
343
|
-
position: 'fixed',
|
|
344
|
-
bottom: 0,
|
|
345
|
-
right: 0,
|
|
346
|
-
top: 0,
|
|
347
|
-
backgroundColor: this.bg,
|
|
348
|
-
/* #ifndef APP-NVUE */
|
|
349
|
-
display: 'flex',
|
|
350
|
-
flexDirection: 'column'
|
|
351
|
-
/* #endif */
|
|
352
|
-
}
|
|
353
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
354
|
-
if (type) return
|
|
355
|
-
this.showPopup = true
|
|
356
|
-
this.showTrans = true
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
</script>
|
|
361
|
-
<style scoped>
|
|
362
|
-
@charset "UTF-8";
|
|
363
|
-
|
|
364
|
-
.uni-popup {
|
|
365
|
-
position: fixed;
|
|
366
|
-
/* #ifndef APP-NVUE */
|
|
367
|
-
z-index: 99;
|
|
368
|
-
/* #endif */
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.uni-popup.top,
|
|
372
|
-
.uni-popup.left,
|
|
373
|
-
.uni-popup.right {
|
|
374
|
-
/* #ifdef H5 */
|
|
375
|
-
top: var(--window-top);
|
|
376
|
-
/* #endif */
|
|
377
|
-
/* #ifndef H5 */
|
|
378
|
-
top: 0;
|
|
379
|
-
/* #endif */
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.uni-popup .uni-popup__wrapper {
|
|
383
|
-
/* #ifndef APP-NVUE */
|
|
384
|
-
display: block;
|
|
385
|
-
/* #endif */
|
|
386
|
-
position: relative;
|
|
387
|
-
/* iphonex 等安全区设置,底部安全区适配 */
|
|
388
|
-
/* #ifndef APP-NVUE */
|
|
389
|
-
/* #endif */
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.uni-popup .uni-popup__wrapper.left,
|
|
393
|
-
.uni-popup .uni-popup__wrapper.right {
|
|
394
|
-
/* #ifdef H5 */
|
|
395
|
-
padding-top: var(--window-top);
|
|
396
|
-
/* #endif */
|
|
397
|
-
/* #ifndef H5 */
|
|
398
|
-
padding-top: 0;
|
|
399
|
-
/* #endif */
|
|
400
|
-
flex: 1;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.fixforpc-z-index {
|
|
404
|
-
/* #ifndef APP-NVUE */
|
|
405
|
-
z-index: 999;
|
|
406
|
-
/* #endif */
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.fixforpc-top {
|
|
410
|
-
top: 0;
|
|
411
|
-
}
|
|
412
|
-
</style>
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="uni-popup-message">
|
|
3
|
-
<view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__'+type">
|
|
4
|
-
<slot>
|
|
5
|
-
<text class="uni-popup-message-text" :class="'uni-popup__'+type+'-text'">{{message}}</text>
|
|
6
|
-
</slot>
|
|
7
|
-
</view>
|
|
8
|
-
</view>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import popup from '../uni-popup/popup.js'
|
|
13
|
-
/**
|
|
14
|
-
* PopUp 弹出层-消息提示
|
|
15
|
-
* @description 弹出层-消息提示
|
|
16
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
17
|
-
* @property {String} type = [success|warning|info|error] 主题样式
|
|
18
|
-
* @value success 成功
|
|
19
|
-
* @value warning 提示
|
|
20
|
-
* @value info 消息
|
|
21
|
-
* @value error 错误
|
|
22
|
-
* @property {String} message 消息提示文字
|
|
23
|
-
* @property {String} duration 显示时间,设置为 0 则不会自动关闭
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
name: 'uniPopupMessage',
|
|
28
|
-
mixins: [popup],
|
|
29
|
-
props: {
|
|
30
|
-
/**
|
|
31
|
-
* 主题 success/warning/info/error 默认 success
|
|
32
|
-
*/
|
|
33
|
-
type: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: 'success'
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* 消息文字
|
|
39
|
-
*/
|
|
40
|
-
message: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: ''
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* 显示时间,设置为 0 则不会自动关闭
|
|
46
|
-
*/
|
|
47
|
-
duration: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 3000
|
|
50
|
-
},
|
|
51
|
-
maskShow: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: false
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
data() {
|
|
57
|
-
return {}
|
|
58
|
-
},
|
|
59
|
-
created() {
|
|
60
|
-
this.popup.maskShow = this.maskShow
|
|
61
|
-
this.popup.messageChild = this
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
timerClose() {
|
|
65
|
-
if (this.duration === 0) return
|
|
66
|
-
clearTimeout(this.timer)
|
|
67
|
-
this.timer = setTimeout(() => {
|
|
68
|
-
this.popup.close()
|
|
69
|
-
}, this.duration)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
</script>
|
|
74
|
-
<style scoped>
|
|
75
|
-
.uni-popup-message {
|
|
76
|
-
/* #ifndef APP-NVUE */
|
|
77
|
-
display: flex;
|
|
78
|
-
/* #endif */
|
|
79
|
-
flex-direction: row;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.uni-popup-message__box {
|
|
84
|
-
background-color: #e1f3d8;
|
|
85
|
-
padding: 10px 15px;
|
|
86
|
-
border-color: #eee;
|
|
87
|
-
border-style: solid;
|
|
88
|
-
border-width: 1px;
|
|
89
|
-
flex: 1;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@media screen and (min-width: 500px) {
|
|
93
|
-
.fixforpc-width {
|
|
94
|
-
margin-top: 20px;
|
|
95
|
-
border-radius: 4px;
|
|
96
|
-
flex: none;
|
|
97
|
-
min-width: 380px;
|
|
98
|
-
/* #ifndef APP-NVUE */
|
|
99
|
-
max-width: 50%;
|
|
100
|
-
/* #endif */
|
|
101
|
-
/* #ifdef APP-NVUE */
|
|
102
|
-
max-width: 500px;
|
|
103
|
-
/* #endif */
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.uni-popup-message-text {
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
padding: 0;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.uni-popup__success {
|
|
113
|
-
background-color: #e1f3d8;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.uni-popup__success-text {
|
|
117
|
-
color: #67C23A;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.uni-popup__warn {
|
|
121
|
-
background-color: #faecd8;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.uni-popup__warn-text {
|
|
125
|
-
color: #E6A23C;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.uni-popup__error {
|
|
129
|
-
background-color: #fde2e2;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.uni-popup__error-text {
|
|
133
|
-
color: #F56C6C;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.uni-popup__info {
|
|
137
|
-
background-color: #F2F6FC;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.uni-popup__info-text {
|
|
141
|
-
color: #909399;
|
|
142
|
-
}
|
|
143
|
-
</style>
|