@vtj/materials 0.13.15 → 0.13.17
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 +3 -3
- package/dist/assets/icons/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +2 -2
- package/dist/assets/uni-ui/index.umd.js +2 -2
- 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 +4 -4
- package/dist/deps/@vtj/ui/style.css +1 -1
- package/dist/deps/@vtj/utils/index.umd.js +28 -33
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/element-plus/index.css +1 -1
- package/dist/deps/element-plus/index.full.min.js +14 -14
- package/dist/deps/element-plus/zh-cn.js +1 -1
- package/dist/deps/uni-app/index.umd.js +1 -1
- package/dist/deps/uni-h5/index.umd.js +8 -8
- package/dist/deps/uni-h5/style.css +1 -1
- package/dist/deps/uni-h5-vue/index.umd.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +6 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/dist/deps/vue/vue.global.js +88 -53
- package/dist/deps/vue/vue.global.prod.js +9 -9
- package/package.json +12 -12
- package/src/antdv/image.ts +1 -1
- package/src/element/image.ts +1 -1
- package/src/element/virtualizedTable.ts +6 -6
- package/src/manifest.json +69 -0
- package/src/pages/index.vue +2 -0
- package/src/pages.json +19 -0
- package/src/uni-ui/index.ts +88 -58
- package/src/{uni-ui/lib/uni.scss → uni.scss} +4 -0
- package/src/version.ts +2 -2
- package/src/uni-ui/lib/uni-col/uni-col.vue +0 -324
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +0 -153
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +0 -425
- package/src/uni-ui/lib/uni-data-picker/keypress.js +0 -45
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +0 -604
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +0 -622
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +0 -76
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +0 -335
- package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +0 -590
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +0 -188
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +0 -985
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hans.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hant.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +0 -1032
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +0 -1230
- package/src/uni-ui/lib/uni-datetime-picker/util.js +0 -448
- package/src/uni-ui/lib/uni-easyinput/common.js +0 -54
- package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +0 -790
- package/src/uni-ui/lib/uni-fav/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +0 -170
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +0 -280
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +0 -668
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +0 -325
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +0 -292
- package/src/uni-ui/lib/uni-file-picker/utils.js +0 -110
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +0 -416
- package/src/uni-ui/lib/uni-forms/utils.js +0 -293
- package/src/uni-ui/lib/uni-forms/validate.js +0 -486
- package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +0 -630
- package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +0 -231
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +0 -148
- package/src/uni-ui/lib/uni-icons/uni-icons.uvue +0 -91
- package/src/uni-ui/lib/uni-icons/uni-icons.vue +0 -114
- package/src/uni-ui/lib/uni-icons/uniicons.css +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file.ts +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +0 -649
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +0 -168
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +0 -404
- package/src/uni-ui/lib/uni-list/uni-list.vue +0 -123
- package/src/uni-ui/lib/uni-list/uni-refresh.vue +0 -65
- package/src/uni-ui/lib/uni-list/uni-refresh.wxs +0 -87
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +0 -5
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +0 -456
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +0 -484
- package/src/uni-ui/lib/uni-popup/i18n/en.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hans.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hant.json +0 -7
- package/src/uni-ui/lib/uni-popup/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup/popup.js +0 -26
- package/src/uni-ui/lib/uni-popup/uni-popup.uvue +0 -90
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +0 -552
- package/src/uni-ui/lib/uni-popup-dialog/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +0 -324
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +0 -149
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +0 -380
- package/src/uni-ui/lib/uni-row/uni-row.vue +0 -193
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +0 -339
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +0 -311
- package/src/uni-ui/lib/uni-swipe-action-item/isPC.js +0 -12
- package/src/uni-ui/lib/uni-swipe-action-item/mpalipay.js +0 -195
- package/src/uni-ui/lib/uni-swipe-action-item/mpother.js +0 -260
- package/src/uni-ui/lib/uni-swipe-action-item/mpwxs.js +0 -84
- package/src/uni-ui/lib/uni-swipe-action-item/render.js +0 -270
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +0 -493
- package/src/uni-ui/lib/uni-swipe-action-item/wx.wxs +0 -341
- package/src/uni-ui/lib/uni-table/uni-table.vue +0 -496
- package/src/uni-ui/lib/uni-td/uni-td.vue +0 -99
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +0 -559
- package/src/uni-ui/lib/uni-th/uni-th.vue +0 -322
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +0 -181
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +0 -208
- package/src/uni-ui/lib/uni-transition/createAnimation.js +0 -131
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +0 -310
- package/src/uni-ui/polyfill.ts +0 -41
@@ -1,484 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view
|
3
|
-
v-if="show"
|
4
|
-
class="uni-noticebar"
|
5
|
-
:style="{ backgroundColor }"
|
6
|
-
@click="onClick">
|
7
|
-
<uni-icons
|
8
|
-
v-if="showIcon === true || showIcon === 'true'"
|
9
|
-
class="uni-noticebar-icon"
|
10
|
-
type="sound"
|
11
|
-
:color="color"
|
12
|
-
:size="fontSize * 1.5" />
|
13
|
-
<view
|
14
|
-
ref="textBox"
|
15
|
-
class="uni-noticebar__content-wrapper"
|
16
|
-
:class="{
|
17
|
-
'uni-noticebar__content-wrapper--scrollable': scrollable,
|
18
|
-
'uni-noticebar__content-wrapper--single':
|
19
|
-
!scrollable && (single || moreText)
|
20
|
-
}"
|
21
|
-
:style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }">
|
22
|
-
<view
|
23
|
-
:id="elIdBox"
|
24
|
-
class="uni-noticebar__content"
|
25
|
-
:class="{
|
26
|
-
'uni-noticebar__content--scrollable': scrollable,
|
27
|
-
'uni-noticebar__content--single': !scrollable && (single || moreText)
|
28
|
-
}">
|
29
|
-
<text
|
30
|
-
:id="elId"
|
31
|
-
ref="animationEle"
|
32
|
-
class="uni-noticebar__content-text"
|
33
|
-
:class="{
|
34
|
-
'uni-noticebar__content-text--scrollable': scrollable,
|
35
|
-
'uni-noticebar__content-text--single':
|
36
|
-
!scrollable && (single || showGetMore)
|
37
|
-
}"
|
38
|
-
:style="{
|
39
|
-
color: color,
|
40
|
-
fontSize: fontSize + 'px',
|
41
|
-
lineHeight: fontSize * 1.5 + 'px',
|
42
|
-
width: wrapWidth + 'px',
|
43
|
-
animationDuration: animationDuration,
|
44
|
-
'-webkit-animationDuration': animationDuration,
|
45
|
-
animationPlayState: webviewHide ? 'paused' : animationPlayState,
|
46
|
-
'-webkit-animationPlayState': webviewHide
|
47
|
-
? 'paused'
|
48
|
-
: animationPlayState,
|
49
|
-
animationDelay: animationDelay,
|
50
|
-
'-webkit-animationDelay': animationDelay
|
51
|
-
}"
|
52
|
-
>{{ text }}</text
|
53
|
-
>
|
54
|
-
</view>
|
55
|
-
</view>
|
56
|
-
<view
|
57
|
-
v-if="isShowGetMore"
|
58
|
-
class="uni-noticebar__more uni-cursor-point"
|
59
|
-
@click="clickMore">
|
60
|
-
<text
|
61
|
-
v-if="moreText.length > 0"
|
62
|
-
:style="{ color: moreColor, fontSize: fontSize + 'px' }"
|
63
|
-
>{{ moreText }}</text
|
64
|
-
>
|
65
|
-
<uni-icons
|
66
|
-
v-else
|
67
|
-
type="right"
|
68
|
-
:color="moreColor"
|
69
|
-
:size="fontSize * 1.1" />
|
70
|
-
</view>
|
71
|
-
<view class="uni-noticebar-close uni-cursor-point" v-if="isShowClose">
|
72
|
-
<uni-icons
|
73
|
-
type="closeempty"
|
74
|
-
:color="color"
|
75
|
-
:size="fontSize * 1.1"
|
76
|
-
@click="close" />
|
77
|
-
</view>
|
78
|
-
</view>
|
79
|
-
</template>
|
80
|
-
|
81
|
-
<script>
|
82
|
-
// #ifdef APP-NVUE
|
83
|
-
const dom = weex.requireModule('dom');
|
84
|
-
const animation = weex.requireModule('animation');
|
85
|
-
// #endif
|
86
|
-
|
87
|
-
/**
|
88
|
-
* NoticeBar 自定义导航栏
|
89
|
-
* @description 通告栏组件
|
90
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=30
|
91
|
-
* @property {Number} speed 文字滚动的速度,默认100px/秒
|
92
|
-
* @property {String} text 显示文字
|
93
|
-
* @property {String} backgroundColor 背景颜色
|
94
|
-
* @property {String} color 文字颜色
|
95
|
-
* @property {String} moreColor 查看更多文字的颜色
|
96
|
-
* @property {String} moreText 设置“查看更多”的文本
|
97
|
-
* @property {Boolean} single = [true|false] 是否单行
|
98
|
-
* @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
|
99
|
-
* @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
|
100
|
-
* @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
|
101
|
-
* @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
|
102
|
-
* @event {Function} click 点击 NoticeBar 触发事件
|
103
|
-
* @event {Function} close 关闭 NoticeBar 触发事件
|
104
|
-
* @event {Function} getmore 点击”查看更多“时触发事件
|
105
|
-
*/
|
106
|
-
|
107
|
-
export default {
|
108
|
-
name: 'UniNoticeBar',
|
109
|
-
emits: ['click', 'getmore', 'close'],
|
110
|
-
props: {
|
111
|
-
text: {
|
112
|
-
type: String,
|
113
|
-
default: ''
|
114
|
-
},
|
115
|
-
moreText: {
|
116
|
-
type: String,
|
117
|
-
default: ''
|
118
|
-
},
|
119
|
-
backgroundColor: {
|
120
|
-
type: String,
|
121
|
-
default: '#FFF9EA'
|
122
|
-
},
|
123
|
-
speed: {
|
124
|
-
// 默认1s滚动100px
|
125
|
-
type: Number,
|
126
|
-
default: 100
|
127
|
-
},
|
128
|
-
color: {
|
129
|
-
type: String,
|
130
|
-
default: '#FF9A43'
|
131
|
-
},
|
132
|
-
fontSize: {
|
133
|
-
type: Number,
|
134
|
-
default: 14
|
135
|
-
},
|
136
|
-
moreColor: {
|
137
|
-
type: String,
|
138
|
-
default: '#FF9A43'
|
139
|
-
},
|
140
|
-
single: {
|
141
|
-
// 是否单行
|
142
|
-
type: [Boolean, String],
|
143
|
-
default: false
|
144
|
-
},
|
145
|
-
scrollable: {
|
146
|
-
// 是否滚动,添加后控制单行效果取消
|
147
|
-
type: [Boolean, String],
|
148
|
-
default: false
|
149
|
-
},
|
150
|
-
showIcon: {
|
151
|
-
// 是否显示左侧icon
|
152
|
-
type: [Boolean, String],
|
153
|
-
default: false
|
154
|
-
},
|
155
|
-
showGetMore: {
|
156
|
-
// 是否显示右侧查看更多
|
157
|
-
type: [Boolean, String],
|
158
|
-
default: false
|
159
|
-
},
|
160
|
-
showClose: {
|
161
|
-
// 是否显示左侧关闭按钮
|
162
|
-
type: [Boolean, String],
|
163
|
-
default: false
|
164
|
-
}
|
165
|
-
},
|
166
|
-
data() {
|
167
|
-
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`;
|
168
|
-
const elIdBox = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`;
|
169
|
-
return {
|
170
|
-
textWidth: 0,
|
171
|
-
boxWidth: 0,
|
172
|
-
wrapWidth: '',
|
173
|
-
webviewHide: false,
|
174
|
-
// #ifdef APP-NVUE
|
175
|
-
stopAnimation: false,
|
176
|
-
// #endif
|
177
|
-
elId: elId,
|
178
|
-
elIdBox: elIdBox,
|
179
|
-
show: true,
|
180
|
-
animationDuration: 'none',
|
181
|
-
animationPlayState: 'paused',
|
182
|
-
animationDelay: '0s'
|
183
|
-
};
|
184
|
-
},
|
185
|
-
watch: {
|
186
|
-
text: function (newValue, oldValue) {
|
187
|
-
this.initSize();
|
188
|
-
}
|
189
|
-
},
|
190
|
-
computed: {
|
191
|
-
isShowGetMore() {
|
192
|
-
return this.showGetMore === true || this.showGetMore === 'true';
|
193
|
-
},
|
194
|
-
isShowClose() {
|
195
|
-
return (
|
196
|
-
(this.showClose === true || this.showClose === 'true') &&
|
197
|
-
(this.showGetMore === false || this.showGetMore === 'false')
|
198
|
-
);
|
199
|
-
}
|
200
|
-
},
|
201
|
-
mounted() {
|
202
|
-
// #ifdef APP-PLUS
|
203
|
-
// var pages = getCurrentPages();
|
204
|
-
// var page = pages[pages.length - 1];
|
205
|
-
// var currentWebview = page.$getAppWebview();
|
206
|
-
// currentWebview.addEventListener('hide', () => {
|
207
|
-
// this.webviewHide = true;
|
208
|
-
// });
|
209
|
-
// currentWebview.addEventListener('show', () => {
|
210
|
-
// this.webviewHide = false;
|
211
|
-
// });
|
212
|
-
// #endif
|
213
|
-
this.$nextTick(() => {
|
214
|
-
this.initSize();
|
215
|
-
});
|
216
|
-
},
|
217
|
-
// #ifdef APP-NVUE
|
218
|
-
beforeDestroy() {
|
219
|
-
this.stopAnimation = true;
|
220
|
-
},
|
221
|
-
// #endif
|
222
|
-
methods: {
|
223
|
-
initSize() {
|
224
|
-
if (this.scrollable) {
|
225
|
-
// #ifndef APP-NVUE
|
226
|
-
let query = [],
|
227
|
-
boxWidth = 0,
|
228
|
-
textWidth = 0;
|
229
|
-
let textQuery = new Promise((resolve, reject) => {
|
230
|
-
uni
|
231
|
-
.createSelectorQuery()
|
232
|
-
// #ifndef MP-ALIPAY
|
233
|
-
.in(this)
|
234
|
-
// #endif
|
235
|
-
.select(`#${this.elId}`)
|
236
|
-
.boundingClientRect()
|
237
|
-
.exec((ret) => {
|
238
|
-
this.textWidth = ret[0].width;
|
239
|
-
resolve();
|
240
|
-
});
|
241
|
-
});
|
242
|
-
let boxQuery = new Promise((resolve, reject) => {
|
243
|
-
uni
|
244
|
-
.createSelectorQuery()
|
245
|
-
// #ifndef MP-ALIPAY
|
246
|
-
.in(this)
|
247
|
-
// #endif
|
248
|
-
.select(`#${this.elIdBox}`)
|
249
|
-
.boundingClientRect()
|
250
|
-
.exec((ret) => {
|
251
|
-
this.boxWidth = ret[0].width;
|
252
|
-
resolve();
|
253
|
-
});
|
254
|
-
});
|
255
|
-
query.push(textQuery);
|
256
|
-
query.push(boxQuery);
|
257
|
-
Promise.all(query).then(() => {
|
258
|
-
this.animationDuration = `${this.textWidth / this.speed}s`;
|
259
|
-
this.animationDelay = `-${this.boxWidth / this.speed}s`;
|
260
|
-
setTimeout(() => {
|
261
|
-
this.animationPlayState = 'running';
|
262
|
-
}, 1000);
|
263
|
-
});
|
264
|
-
// #endif
|
265
|
-
// #ifdef APP-NVUE
|
266
|
-
dom.getComponentRect(this.$refs['animationEle'], (res) => {
|
267
|
-
let winWidth = uni.getSystemInfoSync().windowWidth;
|
268
|
-
this.textWidth = res.size.width;
|
269
|
-
animation.transition(
|
270
|
-
this.$refs['animationEle'],
|
271
|
-
{
|
272
|
-
styles: {
|
273
|
-
transform: `translateX(-${winWidth}px)`
|
274
|
-
},
|
275
|
-
duration: 0,
|
276
|
-
timingFunction: 'linear',
|
277
|
-
delay: 0
|
278
|
-
},
|
279
|
-
() => {
|
280
|
-
if (!this.stopAnimation) {
|
281
|
-
animation.transition(
|
282
|
-
this.$refs['animationEle'],
|
283
|
-
{
|
284
|
-
styles: {
|
285
|
-
transform: `translateX(-${this.textWidth}px)`
|
286
|
-
},
|
287
|
-
timingFunction: 'linear',
|
288
|
-
duration:
|
289
|
-
((this.textWidth - winWidth) / this.speed) * 1000,
|
290
|
-
delay: 1000
|
291
|
-
},
|
292
|
-
() => {
|
293
|
-
if (!this.stopAnimation) {
|
294
|
-
this.loopAnimation();
|
295
|
-
}
|
296
|
-
}
|
297
|
-
);
|
298
|
-
}
|
299
|
-
}
|
300
|
-
);
|
301
|
-
});
|
302
|
-
// #endif
|
303
|
-
}
|
304
|
-
// #ifdef APP-NVUE
|
305
|
-
if (!this.scrollable && (this.single || this.moreText)) {
|
306
|
-
dom.getComponentRect(this.$refs['textBox'], (res) => {
|
307
|
-
this.wrapWidth = res.size.width;
|
308
|
-
});
|
309
|
-
}
|
310
|
-
// #endif
|
311
|
-
},
|
312
|
-
loopAnimation() {
|
313
|
-
// #ifdef APP-NVUE
|
314
|
-
animation.transition(
|
315
|
-
this.$refs['animationEle'],
|
316
|
-
{
|
317
|
-
styles: {
|
318
|
-
transform: `translateX(0px)`
|
319
|
-
},
|
320
|
-
duration: 0
|
321
|
-
},
|
322
|
-
() => {
|
323
|
-
if (!this.stopAnimation) {
|
324
|
-
animation.transition(
|
325
|
-
this.$refs['animationEle'],
|
326
|
-
{
|
327
|
-
styles: {
|
328
|
-
transform: `translateX(-${this.textWidth}px)`
|
329
|
-
},
|
330
|
-
duration: (this.textWidth / this.speed) * 1000,
|
331
|
-
timingFunction: 'linear',
|
332
|
-
delay: 0
|
333
|
-
},
|
334
|
-
() => {
|
335
|
-
if (!this.stopAnimation) {
|
336
|
-
this.loopAnimation();
|
337
|
-
}
|
338
|
-
}
|
339
|
-
);
|
340
|
-
}
|
341
|
-
}
|
342
|
-
);
|
343
|
-
// #endif
|
344
|
-
},
|
345
|
-
clickMore() {
|
346
|
-
this.$emit('getmore');
|
347
|
-
},
|
348
|
-
close() {
|
349
|
-
this.show = false;
|
350
|
-
this.$emit('close');
|
351
|
-
},
|
352
|
-
onClick() {
|
353
|
-
this.$emit('click');
|
354
|
-
}
|
355
|
-
}
|
356
|
-
};
|
357
|
-
</script>
|
358
|
-
|
359
|
-
<style lang="scss" scoped>
|
360
|
-
.uni-noticebar {
|
361
|
-
/* #ifndef APP-NVUE */
|
362
|
-
display: flex;
|
363
|
-
width: 100%;
|
364
|
-
box-sizing: border-box;
|
365
|
-
/* #endif */
|
366
|
-
flex-direction: row;
|
367
|
-
align-items: center;
|
368
|
-
padding: 10px 12px;
|
369
|
-
margin-bottom: 10px;
|
370
|
-
}
|
371
|
-
|
372
|
-
.uni-cursor-point {
|
373
|
-
/* #ifdef H5 */
|
374
|
-
cursor: pointer;
|
375
|
-
/* #endif */
|
376
|
-
}
|
377
|
-
|
378
|
-
.uni-noticebar-close {
|
379
|
-
margin-left: 8px;
|
380
|
-
margin-right: 5px;
|
381
|
-
}
|
382
|
-
|
383
|
-
.uni-noticebar-icon {
|
384
|
-
margin-right: 5px;
|
385
|
-
}
|
386
|
-
|
387
|
-
.uni-noticebar__content-wrapper {
|
388
|
-
flex: 1;
|
389
|
-
flex-direction: column;
|
390
|
-
overflow: hidden;
|
391
|
-
}
|
392
|
-
|
393
|
-
.uni-noticebar__content-wrapper--single {
|
394
|
-
/* #ifndef APP-NVUE */
|
395
|
-
line-height: 18px;
|
396
|
-
/* #endif */
|
397
|
-
}
|
398
|
-
|
399
|
-
.uni-noticebar__content-wrapper--single,
|
400
|
-
.uni-noticebar__content-wrapper--scrollable {
|
401
|
-
flex-direction: row;
|
402
|
-
}
|
403
|
-
|
404
|
-
/* #ifndef APP-NVUE */
|
405
|
-
.uni-noticebar__content-wrapper--scrollable {
|
406
|
-
position: relative;
|
407
|
-
}
|
408
|
-
|
409
|
-
/* #endif */
|
410
|
-
|
411
|
-
.uni-noticebar__content--scrollable {
|
412
|
-
/* #ifdef APP-NVUE */
|
413
|
-
flex: 0;
|
414
|
-
/* #endif */
|
415
|
-
/* #ifndef APP-NVUE */
|
416
|
-
flex: 1;
|
417
|
-
display: block;
|
418
|
-
overflow: hidden;
|
419
|
-
/* #endif */
|
420
|
-
}
|
421
|
-
|
422
|
-
.uni-noticebar__content--single {
|
423
|
-
/* #ifndef APP-NVUE */
|
424
|
-
display: flex;
|
425
|
-
flex: none;
|
426
|
-
width: 100%;
|
427
|
-
justify-content: center;
|
428
|
-
/* #endif */
|
429
|
-
}
|
430
|
-
|
431
|
-
.uni-noticebar__content-text {
|
432
|
-
font-size: 14px;
|
433
|
-
line-height: 18px;
|
434
|
-
/* #ifndef APP-NVUE */
|
435
|
-
word-break: break-all;
|
436
|
-
/* #endif */
|
437
|
-
}
|
438
|
-
|
439
|
-
.uni-noticebar__content-text--single {
|
440
|
-
/* #ifdef APP-NVUE */
|
441
|
-
lines: 1;
|
442
|
-
/* #endif */
|
443
|
-
/* #ifndef APP-NVUE */
|
444
|
-
display: block;
|
445
|
-
width: 100%;
|
446
|
-
white-space: nowrap;
|
447
|
-
/* #endif */
|
448
|
-
overflow: hidden;
|
449
|
-
text-overflow: ellipsis;
|
450
|
-
}
|
451
|
-
|
452
|
-
.uni-noticebar__content-text--scrollable {
|
453
|
-
/* #ifdef APP-NVUE */
|
454
|
-
lines: 1;
|
455
|
-
padding-left: 750rpx;
|
456
|
-
/* #endif */
|
457
|
-
/* #ifndef APP-NVUE */
|
458
|
-
position: absolute;
|
459
|
-
display: block;
|
460
|
-
height: 18px;
|
461
|
-
line-height: 18px;
|
462
|
-
white-space: nowrap;
|
463
|
-
padding-left: 100%;
|
464
|
-
animation: notice 10s 0s linear infinite both;
|
465
|
-
animation-play-state: paused;
|
466
|
-
/* #endif */
|
467
|
-
}
|
468
|
-
|
469
|
-
.uni-noticebar__more {
|
470
|
-
/* #ifndef APP-NVUE */
|
471
|
-
display: inline-flex;
|
472
|
-
/* #endif */
|
473
|
-
flex-direction: row;
|
474
|
-
flex-wrap: nowrap;
|
475
|
-
align-items: center;
|
476
|
-
padding-left: 5px;
|
477
|
-
}
|
478
|
-
|
479
|
-
@keyframes notice {
|
480
|
-
100% {
|
481
|
-
transform: translate3d(-100%, 0, 0);
|
482
|
-
}
|
483
|
-
}
|
484
|
-
</style>
|
@@ -1,45 +0,0 @@
|
|
1
|
-
// #ifdef H5
|
2
|
-
export default {
|
3
|
-
name: 'Keypress',
|
4
|
-
props: {
|
5
|
-
disable: {
|
6
|
-
type: Boolean,
|
7
|
-
default: false
|
8
|
-
}
|
9
|
-
},
|
10
|
-
mounted () {
|
11
|
-
const keyNames = {
|
12
|
-
esc: ['Esc', 'Escape'],
|
13
|
-
tab: 'Tab',
|
14
|
-
enter: 'Enter',
|
15
|
-
space: [' ', 'Spacebar'],
|
16
|
-
up: ['Up', 'ArrowUp'],
|
17
|
-
left: ['Left', 'ArrowLeft'],
|
18
|
-
right: ['Right', 'ArrowRight'],
|
19
|
-
down: ['Down', 'ArrowDown'],
|
20
|
-
delete: ['Backspace', 'Delete', 'Del']
|
21
|
-
}
|
22
|
-
const listener = ($event) => {
|
23
|
-
if (this.disable) {
|
24
|
-
return
|
25
|
-
}
|
26
|
-
const keyName = Object.keys(keyNames).find(key => {
|
27
|
-
const keyName = $event.key
|
28
|
-
const value = keyNames[key]
|
29
|
-
return value === keyName || (Array.isArray(value) && value.includes(keyName))
|
30
|
-
})
|
31
|
-
if (keyName) {
|
32
|
-
// 避免和其他按键事件冲突
|
33
|
-
setTimeout(() => {
|
34
|
-
this.$emit(keyName, {})
|
35
|
-
}, 0)
|
36
|
-
}
|
37
|
-
}
|
38
|
-
document.addEventListener('keyup', listener)
|
39
|
-
// this.$once('hook:beforeDestroy', () => {
|
40
|
-
// document.removeEventListener('keyup', listener)
|
41
|
-
// })
|
42
|
-
},
|
43
|
-
render: () => {}
|
44
|
-
}
|
45
|
-
// #endif
|
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
export default {
|
3
|
-
data() {
|
4
|
-
return {
|
5
|
-
|
6
|
-
}
|
7
|
-
},
|
8
|
-
created(){
|
9
|
-
this.popup = this.getParent()
|
10
|
-
},
|
11
|
-
methods:{
|
12
|
-
/**
|
13
|
-
* 获取父元素实例
|
14
|
-
*/
|
15
|
-
getParent(name = 'uniPopup') {
|
16
|
-
let parent = this.$parent;
|
17
|
-
let parentName = parent.$options.name;
|
18
|
-
while (parentName !== name) {
|
19
|
-
parent = parent.$parent;
|
20
|
-
if (!parent) return false
|
21
|
-
parentName = parent.$options.name;
|
22
|
-
}
|
23
|
-
return parent;
|
24
|
-
},
|
25
|
-
}
|
26
|
-
}
|
@@ -1,90 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view class="popup-root" v-if="isOpen" v-show="isShow" @click="clickMask">
|
3
|
-
<view @click.stop>
|
4
|
-
<slot></slot>
|
5
|
-
</view>
|
6
|
-
</view>
|
7
|
-
</template>
|
8
|
-
|
9
|
-
<script>
|
10
|
-
type CloseCallBack = ()=> void;
|
11
|
-
let closeCallBack:CloseCallBack = () :void => {};
|
12
|
-
export default {
|
13
|
-
emits:["close","clickMask"],
|
14
|
-
data() {
|
15
|
-
return {
|
16
|
-
isShow:false,
|
17
|
-
isOpen:false
|
18
|
-
}
|
19
|
-
},
|
20
|
-
props: {
|
21
|
-
maskClick: {
|
22
|
-
type: Boolean,
|
23
|
-
default: true
|
24
|
-
},
|
25
|
-
},
|
26
|
-
watch: {
|
27
|
-
// 设置show = true 时,如果没有 open 需要设置为 open
|
28
|
-
isShow:{
|
29
|
-
handler(isShow) {
|
30
|
-
// console.log("isShow",isShow)
|
31
|
-
if(isShow && this.isOpen == false){
|
32
|
-
this.isOpen = true
|
33
|
-
}
|
34
|
-
},
|
35
|
-
immediate:true
|
36
|
-
},
|
37
|
-
// 设置isOpen = true 时,如果没有 isShow 需要设置为 isShow
|
38
|
-
isOpen:{
|
39
|
-
handler(isOpen) {
|
40
|
-
// console.log("isOpen",isOpen)
|
41
|
-
if(isOpen && this.isShow == false){
|
42
|
-
this.isShow = true
|
43
|
-
}
|
44
|
-
},
|
45
|
-
immediate:true
|
46
|
-
}
|
47
|
-
},
|
48
|
-
methods:{
|
49
|
-
open(){
|
50
|
-
// ...funs : CloseCallBack[]
|
51
|
-
// if(funs.length > 0){
|
52
|
-
// closeCallBack = funs[0]
|
53
|
-
// }
|
54
|
-
this.isOpen = true;
|
55
|
-
},
|
56
|
-
clickMask(){
|
57
|
-
if(this.maskClick == true){
|
58
|
-
this.$emit('clickMask')
|
59
|
-
this.close()
|
60
|
-
}
|
61
|
-
},
|
62
|
-
close(): void{
|
63
|
-
this.isOpen = false;
|
64
|
-
this.$emit('close')
|
65
|
-
closeCallBack()
|
66
|
-
},
|
67
|
-
hiden(){
|
68
|
-
this.isShow = false
|
69
|
-
},
|
70
|
-
show(){
|
71
|
-
this.isShow = true
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
</script>
|
76
|
-
|
77
|
-
<style>
|
78
|
-
.popup-root {
|
79
|
-
position: fixed;
|
80
|
-
top: 0;
|
81
|
-
left: 0;
|
82
|
-
width: 750rpx;
|
83
|
-
height: 100%;
|
84
|
-
flex: 1;
|
85
|
-
background-color: rgba(0, 0, 0, 0.3);
|
86
|
-
justify-content: center;
|
87
|
-
align-items: center;
|
88
|
-
z-index: 99;
|
89
|
-
}
|
90
|
-
</style>
|