uview-plus 3.3.14 → 3.3.16
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/changelog.md
CHANGED
|
@@ -158,13 +158,13 @@
|
|
|
158
158
|
const dayWidth = Number(parseFloat(this.width / 7).toFixed(3).slice(0, -1))
|
|
159
159
|
// 得出每个日期的宽度
|
|
160
160
|
// #ifdef APP-NVUE
|
|
161
|
-
style.width = addUnit(dayWidth)
|
|
161
|
+
style.width = addUnit(dayWidth, 'px')
|
|
162
162
|
// #endif
|
|
163
163
|
style.height = addUnit(this.rowHeight)
|
|
164
164
|
if (index2 === 0) {
|
|
165
165
|
// 获取当前为星期几,如果为0,则为星期天,减一为每月第一天时,需要向左偏移的item个数
|
|
166
166
|
week = (week === 0 ? 7 : week) - 1
|
|
167
|
-
style.marginLeft = addUnit(week * dayWidth)
|
|
167
|
+
style.marginLeft = addUnit(week * dayWidth, 'px')
|
|
168
168
|
}
|
|
169
169
|
if (this.mode === 'range') {
|
|
170
170
|
// 之所以需要这么写,是因为DCloud公司的iOS客户端的开发者能力有限导致的bug
|
|
@@ -23,8 +23,13 @@
|
|
|
23
23
|
v-if="mode === 'line'"
|
|
24
24
|
:style="[lineStyle]"
|
|
25
25
|
></view>
|
|
26
|
-
<!-- #ifndef APP-
|
|
27
|
-
<view v-if="isFocus && codeArray.length === index"
|
|
26
|
+
<!-- #ifndef APP-NVUE -->
|
|
27
|
+
<view v-if="isFocus && codeArray.length === index"
|
|
28
|
+
:style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
|
|
29
|
+
<!-- #endif -->
|
|
30
|
+
<!-- #ifdef APP-NVUE -->
|
|
31
|
+
<view v-if="isFocus && codeArray.length === index"
|
|
32
|
+
:style="{backgroundColor: color, opacity: opacity}" class="u-code-input__item__cursor"></view>
|
|
28
33
|
<!-- #endif -->
|
|
29
34
|
</view>
|
|
30
35
|
<input
|
|
@@ -79,22 +84,51 @@
|
|
|
79
84
|
data() {
|
|
80
85
|
return {
|
|
81
86
|
inputValue: '',
|
|
82
|
-
isFocus: this.focus
|
|
87
|
+
isFocus: this.focus,
|
|
88
|
+
timer: null,
|
|
89
|
+
opacity: 1
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
watch: {
|
|
86
93
|
// #ifdef VUE2
|
|
87
94
|
value: {
|
|
95
|
+
immediate: true,
|
|
96
|
+
handler(val) {
|
|
97
|
+
// 转为字符串,超出部分截掉
|
|
98
|
+
this.inputValue = String(val).substring(0, this.maxlength)
|
|
99
|
+
}
|
|
100
|
+
},
|
|
88
101
|
// #endif
|
|
89
102
|
// #ifdef VUE3
|
|
90
103
|
modelValue: {
|
|
91
|
-
// #endif
|
|
92
104
|
immediate: true,
|
|
93
105
|
handler(val) {
|
|
94
106
|
// 转为字符串,超出部分截掉
|
|
95
107
|
this.inputValue = String(val).substring(0, this.maxlength)
|
|
96
108
|
}
|
|
97
109
|
},
|
|
110
|
+
// #endif
|
|
111
|
+
isFocus: {
|
|
112
|
+
handler(val) {
|
|
113
|
+
// #ifdef APP-NVUE
|
|
114
|
+
if (val) {
|
|
115
|
+
this.timer = setInterval(() => {
|
|
116
|
+
this.opacity = Math.abs(this.opacity - 1)
|
|
117
|
+
}, 600)
|
|
118
|
+
} else {
|
|
119
|
+
clearInterval(this.timer)
|
|
120
|
+
}
|
|
121
|
+
// #endif
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
created() {
|
|
126
|
+
|
|
127
|
+
},
|
|
128
|
+
beforeUnmount() {
|
|
129
|
+
// #ifdef APP-NVUE
|
|
130
|
+
clearInterval(this.timer)
|
|
131
|
+
// #endif
|
|
98
132
|
},
|
|
99
133
|
computed: {
|
|
100
134
|
// 根据长度,循环输入框的个数,因为头条小程序数值不能用于v-for
|
|
@@ -188,7 +222,7 @@
|
|
|
188
222
|
<style lang="scss" scoped>
|
|
189
223
|
@import "../../libs/css/components.scss";
|
|
190
224
|
$u-code-input-cursor-width: 1px;
|
|
191
|
-
$u-code-input-cursor-height:
|
|
225
|
+
$u-code-input-cursor-height: 20px;
|
|
192
226
|
$u-code-input-cursor-animation-duration: 1s;
|
|
193
227
|
$u-code-input-cursor-animation-name: u-cursor-flicker;
|
|
194
228
|
|
|
@@ -223,18 +257,18 @@
|
|
|
223
257
|
width: 40px;
|
|
224
258
|
background-color: $u-content-color;
|
|
225
259
|
}
|
|
226
|
-
/* #ifndef APP-PLUS */
|
|
227
260
|
&__cursor {
|
|
228
261
|
position: absolute;
|
|
262
|
+
/* #ifndef APP-NVUE */
|
|
229
263
|
top: 50%;
|
|
230
264
|
left: 50%;
|
|
265
|
+
opacity: 1;
|
|
231
266
|
transform: translate(-50%,-50%);
|
|
267
|
+
/* #endif */
|
|
232
268
|
width: $u-code-input-cursor-width;
|
|
233
269
|
height: $u-code-input-cursor-height;
|
|
234
270
|
animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite;
|
|
235
271
|
}
|
|
236
|
-
/* #endif */
|
|
237
|
-
|
|
238
272
|
}
|
|
239
273
|
|
|
240
274
|
&__input {
|
|
@@ -249,7 +283,7 @@
|
|
|
249
283
|
}
|
|
250
284
|
}
|
|
251
285
|
|
|
252
|
-
/* #ifndef APP-
|
|
286
|
+
/* #ifndef APP-NVUE */
|
|
253
287
|
@keyframes u-cursor-flicker {
|
|
254
288
|
0% {
|
|
255
289
|
opacity: 0;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-navbar-mini" :class="[customClass]">
|
|
3
|
-
<view
|
|
4
|
-
class="u-navbar-mini__placeholder"
|
|
5
|
-
v-if="fixed"
|
|
6
|
-
:style="{
|
|
7
|
-
height: addUnit(getPx(height) + sys().statusBarHeight,'px'),
|
|
8
|
-
}"
|
|
9
|
-
></view>
|
|
10
3
|
<view class="u-navbar-mini__inner" :class="[fixed && 'u-navbar-mini--fixed']">
|
|
11
4
|
<u-status-bar
|
|
12
5
|
v-if="safeAreaInsetTop"
|
|
13
|
-
:bgColor="bgColor"
|
|
14
6
|
></u-status-bar>
|
|
15
7
|
<view
|
|
16
8
|
class="u-navbar-mini__content"
|
|
@@ -112,7 +104,6 @@
|
|
|
112
104
|
|
|
113
105
|
&__inner {
|
|
114
106
|
width: 180rpx;
|
|
115
|
-
border-radius: 20px;
|
|
116
107
|
overflow: hidden;
|
|
117
108
|
}
|
|
118
109
|
|
|
@@ -127,8 +118,9 @@
|
|
|
127
118
|
&__content {
|
|
128
119
|
@include flex(row);
|
|
129
120
|
padding: 0 15px;
|
|
121
|
+
border-radius: 20px;
|
|
130
122
|
align-items: center;
|
|
131
|
-
height:
|
|
123
|
+
height: 36px;
|
|
132
124
|
background-color: #9acafc;
|
|
133
125
|
position: relative;
|
|
134
126
|
justify-content: space-between;
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
controls
|
|
69
69
|
@tap="clickHandler(index)"
|
|
70
70
|
></video>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
>{{ item.title }}</text>
|
|
71
|
+
<view v-if="showTitle && testObject(item) && item.title && testImage(getSource(item))" class="u-swiper__wrapper__item__wrapper__title">
|
|
72
|
+
<text class="u-line-1">{{ item.title }}</text>
|
|
73
|
+
</view>
|
|
75
74
|
</view>
|
|
76
75
|
</swiper-item>
|
|
77
76
|
</swiper>
|
package/libs/function/index.js
CHANGED
|
@@ -181,8 +181,11 @@ export function addUnit(value = 'auto', unit = '') {
|
|
|
181
181
|
if (!unit) {
|
|
182
182
|
unit = config.unit || 'px'
|
|
183
183
|
}
|
|
184
|
+
if (unit == 'rpx') {
|
|
185
|
+
value = value * 2
|
|
186
|
+
}
|
|
184
187
|
value = String(value)
|
|
185
|
-
//
|
|
188
|
+
// 用内置验证规则中的number判断是否为数值
|
|
186
189
|
return testNumber(value) ? `${value}${unit}` : value
|
|
187
190
|
}
|
|
188
191
|
|