hwb0 hace 3 años
padre
commit
4c6bf1fc9a
Se han modificado 35 ficheros con 315 adiciones y 168 borrados
  1. 47 0
      uni_modules/uview-ui/changelog.md
  2. 1 0
      uni_modules/uview-ui/components/u--text/u--text.vue
  3. 8 5
      uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
  4. 39 1
      uni_modules/uview-ui/components/u-code-input/u-code-input.vue
  5. 28 9
      uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue
  6. 2 2
      uni_modules/uview-ui/components/u-image/u-image.vue
  7. 1 1
      uni_modules/uview-ui/components/u-list/u-list.vue
  8. 1 1
      uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue
  9. 1 1
      uni_modules/uview-ui/components/u-navbar/u-navbar.vue
  10. 1 1
      uni_modules/uview-ui/components/u-popup/u-popup.vue
  11. 5 0
      uni_modules/uview-ui/components/u-rate/props.js
  12. 2 1
      uni_modules/uview-ui/components/u-rate/u-rate.vue
  13. 1 1
      uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue
  14. 0 2
      uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue
  15. 1 1
      uni_modules/uview-ui/components/u-search/u-search.vue
  16. 1 0
      uni_modules/uview-ui/components/u-skeleton/u-skeleton.vue
  17. 2 2
      uni_modules/uview-ui/components/u-subsection/u-subsection.vue
  18. 3 2
      uni_modules/uview-ui/components/u-swipe-action-item/nvue.js
  19. 1 1
      uni_modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue
  20. 11 2
      uni_modules/uview-ui/components/u-swiper/u-swiper.vue
  21. 8 4
      uni_modules/uview-ui/components/u-switch/u-switch.vue
  22. 5 0
      uni_modules/uview-ui/components/u-tabs/props.js
  23. 6 7
      uni_modules/uview-ui/components/u-tabs/u-tabs.vue
  24. 1 1
      uni_modules/uview-ui/components/u-text/u-text.vue
  25. 1 1
      uni_modules/uview-ui/components/u-text/value.js
  26. 6 4
      uni_modules/uview-ui/components/u-transition/transition.js
  27. 92 79
      uni_modules/uview-ui/components/u-upload/u-upload.vue
  28. 3 3
      uni_modules/uview-ui/libs/config/config.js
  29. 1 1
      uni_modules/uview-ui/libs/config/props/checkbox.js
  30. 1 0
      uni_modules/uview-ui/libs/config/props/tabs.js
  31. 1 1
      uni_modules/uview-ui/libs/config/props/textarea.js
  32. 1 1
      uni_modules/uview-ui/libs/css/flex.scss
  33. 3 2
      uni_modules/uview-ui/libs/function/test.js
  34. 27 23
      uni_modules/uview-ui/libs/mixin/mixin.js
  35. 3 8
      uni_modules/uview-ui/package.json

+ 47 - 0
uni_modules/uview-ui/changelog.md

@@ -1,3 +1,50 @@
+## 2.0.31(2022-04-19)
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题
+2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题
+3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能)
+4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题
+5. 其他修复
+## 2.0.30(2022-04-04)
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. `u-rate`增加`readonly`属性
+2. `tabs`滑块支持设置背景图片
+3. 修复`u-subsection` `mode`为`subsection`时,滑块样式不正确的问题
+4. `u-code-input`添加光标效果动画
+5. 修复`popup`的`open`事件不触发
+6. 修复`u-flex-column`无效的问题
+7. 修复`u-datetime-picker`索引在特定场合异常问题
+8. 修复`u-datetime-picker`最小时间字符串模板错误问题
+9. `u-swiper`添加`m3u8`验证
+10. `u-swiper`修改判断image和video逻辑
+11. 修复`swiper`无法使用本地图片问题,增加`type`参数
+12. 修复`u-row-notice`格式错误问题
+13. 修复`u-switch`组件当`unit`为`rpx`时,`nodeStyle`消失的问题
+14. 修复`datetime-picker`组件`showToolbar`与`visibleItemCount`属性无效的问题
+15. 修复`upload`组件条件编译位置判断错误,导致`previewImage`属性设置为`false`时,整个组件都会被隐藏的问题
+16. 修复`u-checkbox-group`设置`shape`属性无效的问题
+17. 修复`u-upload`的`capture`传入字符串的时候不生效的问题
+18. 修复`u-action-sheet`组件,关闭事件逻辑错误的问题
+19. 修复`u-list`触顶事件的触发错误的问题
+20. 修复`u-text`只有手机号可拨打的问题
+21. 修复`u-textarea`不能换行的问题
+22. 其他修复
+## 2.0.29(2022-03-13)
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. 修复`u--text`组件设置`decoration`属性未生效的问题
+2. 修复`u-datetime-picker`使用`formatter`后返回值不正确
+3. 修复`u-datetime-picker` `intercept` 可能为undefined
+4. 修复已设置单位 uni..config.unit = 'rpx'时,线型指示器 `transform` 的位置翻倍,导致指示器超出宽度
+5. 修复mixin中bem方法生成的类名在支付宝和字节小程序中失效
+6. 修复默认值传值为空的时候,打开`u-datetime-picker`报错,不能选中第一列时间的bug
+7. 修复`u-datetime-picker`使用`formatter`后返回值不正确
+8. 修复`u-image`组件`loading`无效果的问题
+9. 修复`config.unit`属性设为`rpx`时,导航栏占用高度不足导致塌陷的问题
+10. 修复`u-datetime-picker`组件`itemHeight`无效问题
+11. 其他修复
 ## 2.0.28(2022-02-22)
 # uView2.0重磅发布,利剑出鞘,一统江湖
 

+ 1 - 0
uni_modules/uview-ui/components/u--text/u--text.vue

@@ -14,6 +14,7 @@
         :block="block"
         :lines="lines"
         :color="color"
+		:decoration="decoration"
         :size="size"
         :iconStyle="iconStyle"
         :margin="margin"

+ 8 - 5
uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue

@@ -3,8 +3,7 @@
 	<u-popup
 	    :show="show"
 	    mode="bottom"
-	    @close="close"
-	    :closeOnClickOverlay="closeOnClickOverlay"
+	    @close="closeHandler"
 	    :safeAreaInsetBottom="safeAreaInsetBottom"
 	    :round="round"
 	>
@@ -16,7 +15,7 @@
 				<text class="u-action-sheet__header__title u-line-1">{{title}}</text>
 				<view
 				    class="u-action-sheet__header__icon-wrap"
-				    @tap.stop="close"
+				    @tap.stop="cancel"
 				>
 					<u-icon
 					    name="close"
@@ -100,7 +99,7 @@
 				    :hover-stay-time="150"
 				    v-if="cancelText"
 				    class="u-action-sheet__cancel-text"
-				    @tap="close"
+				    @tap="cancel"
 				>{{cancelText}}</text>
 			</view>
 		</view>
@@ -167,12 +166,16 @@
 			},
 		},
 		methods: {
-			close() {
+			closeHandler() {
 				// 允许点击遮罩关闭时,才发出close事件
 				if(this.closeOnClickOverlay) {
 					this.$emit('close')
 				}
 			},
+			// 点击取消按钮
+			cancel() {
+				this.$emit('close')
+			},
 			selectHandler(index) {
 				const item = this.actions[index]
 				if (item && !item.disabled && !item.loading) {

+ 39 - 1
uni_modules/uview-ui/components/u-code-input/u-code-input.vue

@@ -23,6 +23,9 @@
 				v-if="mode === 'line'"
 				:style="[lineStyle]"
 			></view>
+			<!-- #ifndef APP-PLUS -->
+			<view v-if="isFocus && codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
+			<!-- #endif -->
 		</view>
 		<input
 			:disabled="disabledKeyboard"
@@ -35,6 +38,8 @@
 			:style="{
 				height: $u.addUnit(size) 
 			}"
+			@focus="isFocus = true"
+			@blur="isFocus = false"
 		/>
 	</view>
 </template>
@@ -69,7 +74,8 @@
 		mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
 		data() {
 			return {
-				inputValue: ''
+				inputValue: '',
+				isFocus: this.focus
 			}
 		},
 		watch: {
@@ -166,6 +172,10 @@
 
 <style lang="scss" scoped>
 	@import "../../libs/css/components.scss";
+	$u-code-input-cursor-width: 1px;
+	$u-code-input-cursor-height: 40%;
+	$u-code-input-cursor-animation-duration: 1s;
+	$u-code-input-cursor-animation-name: u-cursor-flicker;
 
 	.u-code-input {
 		@include flex;
@@ -176,6 +186,7 @@
 			@include flex;
 			justify-content: center;
 			align-items: center;
+			position: relative;
 
 			&__text {
 				font-size: 15px;
@@ -197,6 +208,18 @@
 				width: 40px;
 				background-color: $u-content-color;
 			}
+			/* #ifndef APP-PLUS */
+			&__cursor {
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%,-50%);
+				width: $u-code-input-cursor-width;
+				height: $u-code-input-cursor-height;
+				animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite;
+			}
+			/* #endif */
+			
 		}
 
 		&__input {
@@ -210,4 +233,19 @@
 			text-align: left;
 		}
 	}
+	
+	/* #ifndef APP-PLUS */
+	@keyframes u-cursor-flicker {
+		0% {
+		    opacity: 0;
+		}
+		50% {
+		    opacity: 1;
+		}
+		100% {
+		    opacity: 0;
+		}
+	}
+	/* #endif */
+
 </style>

+ 28 - 9
uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue

@@ -5,6 +5,9 @@
 		:closeOnClickOverlay="closeOnClickOverlay"
 		:columns="columns"
 		:title="title"
+		:itemHeight="itemHeight"
+		:showToolbar="showToolbar"
+		:visibleItemCount="visibleItemCount"
 		:defaultIndex="innerDefaultIndex"
 		:cancelText="cancelText"
 		:confirmText="confirmText"
@@ -74,7 +77,7 @@
 		watch: {
 			show(newValue, oldValue) {
 				if (newValue) {
-					this.updateColumnValue(this.value)
+					this.updateColumnValue(this.innerValue)
 				}
 			},
 			propsChange() {
@@ -117,21 +120,37 @@
 				})
 				this.$emit('input', this.innerValue)
 			},
+			//用正则截取输出值,当出现多组数字时,抛出错误
+			intercept(e,type){
+				let judge = e.match(/\d+/g)
+				//判断是否掺杂数字
+				if(judge.length>1){
+					uni.$u.error("请勿在过滤或格式化函数时添加数字")
+					return 0
+				}else if(type&&judge[0].length==4){//判断是否是年份
+					return judge[0]
+				}else if(judge[0].length>2){
+					uni.$u.error("请勿在过滤或格式化函数时添加数字")
+					return 0
+				}else{
+					return judge[0]
+				}
+			},
 			// 列发生变化时触发
 			change(e) {
 				const { indexs, values } = e
 				let selectValue = ''
 				if(this.mode === 'time') {
 					// 根据value各列索引,从各列数组中,取出当前时间的选中值
-					selectValue = `${values[0][indexs[0]]}:${values[1][indexs[1]]}`
+					selectValue = `${this.intercept(values[0][indexs[0]])}:${this.intercept(values[1][indexs[1]])}`
 				} else {
 					// 将选择的值转为数值,比如'03'转为数值的3,'2019'转为数值的2019
-					const year = parseInt(values[0][indexs[0]])
-					const month = parseInt(values[1][indexs[1]])
-					let date = parseInt(values[2] ? values[2][indexs[2]] : 1)
+					const year = parseInt(this.intercept(values[0][indexs[0]],'year'))
+					const month = parseInt(this.intercept(values[1][indexs[1]]))
+					let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1)
 					let hour = 0, minute = 0
 					// 此月份的最大天数
-					const maxDate = dayjs(`${year}-${month}-${date}`).daysInMonth()
+					const maxDate = dayjs(`${year}-${month}`).daysInMonth()
 					// year-month模式下,date不会出现在列中,设置为1,为了符合后边需要减1的需求
 					if (this.mode === 'year-month') {
 					    date = 1
@@ -139,8 +158,8 @@
 					// 不允许超过maxDate值
 					date = Math.min(maxDate, date)
 					if (this.mode === 'datetime') {
-					    hour = parseInt(values[3][indexs[3]])
-					    minute = parseInt(values[4][indexs[4]])
+					    hour = parseInt(this.intercept(values[3][indexs[3]]))
+					    minute = parseInt(this.intercept(values[4][indexs[4]]))
 					}
 					// 转为时间模式
 					selectValue = Number(new Date(year, month - 1, date, hour, minute))
@@ -234,7 +253,7 @@
 					value = this.minDate
 				} else if (!isDateMode && !value) {
 					// 如果是时间类型,而又没有默认值的话,就用最小时间
-					value = `${uni.$u.padZero(this.minHour)}:uni.$u.padZero(this.minMinute)}`
+					value = `${uni.$u.padZero(this.minHour)}:${uni.$u.padZero(this.minMinute)}`
 				}
 				// 时间类型
 				if (!isDateMode) {

+ 2 - 2
uni_modules/uview-ui/components/u-image/u-image.vue

@@ -119,8 +119,8 @@
 						this.isError = true
 						
 					} else {
-						this.isError = false
-						this.loading = false
+						this.isError = false;
+						this.loading = true;
 					}
 				}
 			}

+ 1 - 1
uni_modules/uview-ui/components/u-list/u-list.vue

@@ -139,7 +139,7 @@
 			// 滚动到底部时触发,非nvue有效
 			scrolltoupper(e) {
 				uni.$u.sleep(30).then(() => {
-					this.$emit('scrolltolower')
+					this.$emit('scrolltoupper')
 					// 这一句很重要,能绝对保证在性功能障碍的webview,滚动条到顶时,取消偏移值,让页面置顶
 					this.offset = 0
 				})

+ 1 - 1
uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue

@@ -61,7 +61,7 @@
 	 * @property {Boolean}			icon			加载中时是否显示图标(默认 true )
 	 * @property {String | Number}	fontSize		字体大小(默认 14 )
 	 * @property {String}			color			字体颜色(默认 '#606266' )
-	 * @property {String}			loadingIcon		加载前的提示语(默认 'circle' )
+	 * @property {String}			loadingIcon		加载图标(默认 'circle' )
 	 * @property {String}			loadmoreText	加载前的提示语(默认 '加载更多' )
 	 * @property {String}			loadingText		加载中提示语(默认 '正在加载...' )
 	 * @property {String}			nomoreText		没有更多的提示语(默认 '没有更多了' )

+ 1 - 1
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -4,7 +4,7 @@
 			class="u-navbar__placeholder"
 			v-if="fixed && placeholder"
 			:style="{
-				height: $u.addUnit($u.getPx(height) + $u.sys().statusBarHeight),
+				height: $u.addUnit($u.getPx(height) + $u.sys().statusBarHeight,'px'),
 			}"
 		></view>
 		<view :class="[fixed && 'u-navbar--fixed']">

+ 1 - 1
uni_modules/uview-ui/components/u-popup/u-popup.vue

@@ -13,7 +13,7 @@
 			:customStyle="transitionStyle"
 			:mode="position"
 			:duration="duration"
-			@after-enter="afterEnter"
+			@afterEnter="afterEnter"
 			@click="clickHandler"
 		>
 			<view

+ 5 - 0
uni_modules/uview-ui/components/u-rate/props.js

@@ -15,6 +15,11 @@ export default {
             type: Boolean,
             default: uni.$u.props.rate.disabled
         },
+        // 是否只读
+        readonly: {
+            type: Boolean,
+            default: uni.$u.props.rate.readonly
+        },
         // 星星的大小,单位px
         size: {
             type: [String, Number],

+ 2 - 1
uni_modules/uview-ui/components/u-rate/u-rate.vue

@@ -86,6 +86,7 @@
 	 * @property {String | Number}	value			用于v-model双向绑定选中的星星数量 (默认 1 )
 	 * @property {String | Number}	count			最多可选的星星数量 (默认 5 )
 	 * @property {Boolean}			disabled		是否禁止用户操作 (默认 false )
+	 * @property {Boolean}			readonly		是否只读 (默认 false )
 	 * @property {String | Number}	size			星星的大小,单位px (默认 18 )
 	 * @property {String}			inactiveColor	未选中星星的颜色 (默认 '#b2b2b2' )
 	 * @property {String}			activeColor		选中的星星颜色 (默认 '#FA3534' )
@@ -206,7 +207,7 @@
 			},
 			// 获取当前激活的评分图标
 			getActiveIndex(x,isClick = false) {
-				if (this.disabled) {
+				if (this.disabled || this.readonly) {
 					return;
 				}
 				// 判断当前操作的点的x坐标值,是否在允许的边界范围内

+ 1 - 1
uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue

@@ -97,7 +97,7 @@
 				}
 			},
 			fontSize() {
-				t // #ifdef APP-NVUE
+				// #ifdef APP-NVUE
 				this.nvueInit = true
 				// #endif
 				// #ifndef APP-NVUE

+ 0 - 2
uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue

@@ -72,13 +72,11 @@
 	</view>
 </template>
 
-<!-- #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ -->
 <script
 	src="./scrollWxs.wxs"
 	module="wxs"
 	lang="wxs"
 ></script>
-<!-- #endif -->
 
 <script>
 /**

+ 1 - 1
uni_modules/uview-ui/components/u-search/u-search.vue

@@ -91,7 +91,7 @@
 	 * @property {Boolean}			disabled			是否启用输入框(默认 false )
 	 * @property {String}			borderColor			边框颜色,配置了颜色,才会有边框 (默认 'transparent' )
 	 * @property {String}			searchIconColor		搜索图标的颜色,默认同输入框字体颜色 (默认 '#909399' )
-	 * @property {Number | String}	searchIconSize 搜索图标的字体,默认26
+	 * @property {Number | String}	searchIconSize 搜索图标的字体,默认22
 	 * @property {String}			color				输入框字体颜色(默认 '#606266' )
 	 * @property {String}			placeholderColor	placeholder的颜色(默认 '#909399' )
 	 * @property {String}			searchIcon			输入框左边的图标,可以为uView图标名称或图片路径  (默认 'search' )

+ 1 - 0
uni_modules/uview-ui/components/u-skeleton/u-skeleton.vue

@@ -110,6 +110,7 @@
 					item.height = uni.$u.addUnit(rowHeight)
 					rows.push(item)
 				}
+				// console.log(rows);
 				return rows
 			},
 			uTitleWidth() {

+ 2 - 2
uni_modules/uview-ui/components/u-subsection/u-subsection.vue

@@ -15,10 +15,10 @@
                     mode === 'subsection' &&
                     'u-subsection__bar--first',
                 current > 0 &&
-                    current < this.list.length - 1 &&
+                    current < list.length - 1 &&
                     mode === 'subsection' &&
                     'u-subsection__bar--center',
-                current === this.list.length - 1 &&
+                current === list.length - 1 &&
                     mode === 'subsection' &&
                     'u-subsection__bar--last',
             ]"

+ 3 - 2
uni_modules/uview-ui/components/u-swipe-action-item/nvue.js

@@ -69,8 +69,9 @@ export default {
 				// 如果在打开状态下,进行点击的话,直接关闭单元格
 				return this.moveCellByAnimation('close') && this.unbindBindingX()
 			}
-			e.stopPropagation && e.stopPropagation() 
-			e.preventDefault && e.preventDefault()
+			// 特殊情况下,e可能不为一个对象
+			e?.stopPropagation && e.stopPropagation() 
+			e?.preventDefault && e.preventDefault()
 			this.moving = true
 			// 获取元素ref
 			const content = this.getContentRef()

+ 1 - 1
uni_modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue

@@ -57,7 +57,7 @@
 			lineStyle() {
 				let style = {}
 				style.width = uni.$u.addUnit(this.lineWidth)
-				style.transform = `translateX(${ this.current * this.lineWidth }px)`
+				style.transform = `translateX(${ uni.$u.addUnit(this.current * this.lineWidth) })`
 				style.backgroundColor = this.indicatorActiveColor
 				return style
 			},

+ 11 - 2
uni_modules/uview-ui/components/u-swiper/u-swiper.vue

@@ -44,7 +44,7 @@
 					<!-- 在nvue中,image图片的宽度默认为屏幕宽度,需要通过flex:1撑开,另外必须设置高度才能显示图片 -->
 					<image
 						class="u-swiper__wrapper__item__wrapper__image"
-						v-if="$u.test.image(getSource(item))"
+						v-if="getItemType(item) === 'image'"
 						:src="getSource(item)"
 						:mode="imgMode"
 						@tap="clickHandler(index)"
@@ -55,7 +55,7 @@
 					></image>
 					<video
 						class="u-swiper__wrapper__item__wrapper__video"
-						v-if="$u.test.video(getSource(item))"
+						v-if="getItemType(item) === 'video'"
 						:id="`video-${index}`"
 						:enable-progress-gesture="false"
 						:src="getSource(item)"
@@ -154,6 +154,15 @@
 			}
 		},
 		methods: {
+      getItemType(item) {
+        if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
+        if (typeof item === 'object' && this.keyName) {
+          if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
+          if (item.type === 'image') return 'image'
+          if (item.type === 'video') return 'video'
+          return 'image'
+        }
+      },
 			// 获取目标路径,可能数组中为字符串,对象的形式,额外可指定对象的目标属性名keyName
 			getSource(item) {
 				if (typeof item === 'string') return item

+ 8 - 4
uni_modules/uview-ui/components/u-switch/u-switch.vue

@@ -67,6 +67,9 @@
 			}
 		},
 		computed: {
+			isActive(){
+				return this.value === this.activeValue;
+			},
 			switchStyle() {
 				let style = {}
 				// 这里需要加2,是为了腾出边框的距离,否则圆点node会和外边框紧贴在一起
@@ -78,7 +81,7 @@
 				if(this.customInactiveColor) {
 					style.borderColor = 'rgba(0, 0, 0, 0)'
 				}
-				style.backgroundColor = this.value === this.activeValue ? this.activeColor : this.inactiveColor
+				style.backgroundColor = this.isActive ? this.activeColor : this.inactiveColor
 				return style;
 			},
 			nodeStyle() {
@@ -86,7 +89,8 @@
 				// 如果自定义非激活颜色,将node圆点的尺寸减少两个像素,让其与外边框距离更大一点
 				style.width = uni.$u.addUnit(this.size - this.space)
 				style.height = uni.$u.addUnit(this.size - this.space)
-				style.transform = `translateX(${this.value === this.activeValue ? -this.space : -this.size}px)`
+				const translateX = this.isActive ? uni.$u.addUnit(this.space) : uni.$u.addUnit(this.size);
+				style.transform = `translateX(-${translateX})`
 				return style
 			},
 			bgStyle() {
@@ -96,7 +100,7 @@
 				style.height = uni.$u.addUnit(this.size)
 				style.backgroundColor = this.inactiveColor
 				// 打开时,让此元素收缩,否则反之
-				style.transform = `scale(${this.value === this.activeValue ? 0 : 1})`
+				style.transform = `scale(${this.isActive ? 0 : 1})`
 				return style
 			},
 			customInactiveColor() {
@@ -107,7 +111,7 @@
 		methods: {
 			clickHandler() {
 				if (!this.disabled && !this.loading) {
-					const oldValue = this.value === this.activeValue ? this.inactiveValue : this.activeValue
+					const oldValue = this.isActive ? this.inactiveValue : this.activeValue
 					if(!this.asyncChange) {
 						this.$emit('input', oldValue)
 					}

+ 5 - 0
uni_modules/uview-ui/components/u-tabs/props.js

@@ -35,6 +35,11 @@ export default {
             type: [String, Number],
             default: uni.$u.props.tabs.lineHeight
         },
+        // 滑块背景显示大小,当滑块背景设置为图片时使用
+        lineBgSize: {
+            type: String,
+            default: uni.$u.props.tabs.lineBgSize
+        },
         // 菜单item的样式
         itemStyle: {
             type: [String, Object],

+ 6 - 7
uni_modules/uview-ui/components/u-tabs/u-tabs.vue

@@ -14,9 +14,6 @@
 					<view
 						class="u-tabs__wrapper__nav"
 						ref="u-tabs__wrapper__nav"
-						:style="[{
-							flex: scrollable ? 0 : 1
-						}]"
 					>
 						<view
 							class="u-tabs__wrapper__nav__item"
@@ -24,7 +21,7 @@
 							:key="index"
 							@tap="clickHandler(item, index)"
 							:ref="`u-tabs__wrapper__nav__item-${index}`"
-							:style="[$u.addStyle(itemStyle)]"
+							:style="[$u.addStyle(itemStyle), {flex: scrollable ? '' : 1}]"
 							:class="[`u-tabs__wrapper__nav__item-${index}`, item.disabled && 'u-tabs__wrapper__nav__item--disabled']"
 						>
 							<text
@@ -54,7 +51,8 @@
 							:style="[{
 									width: $u.addUnit(lineWidth),
 									height: $u.addUnit(lineHeight),
-									backgroundColor: lineColor
+									background: lineColor,
+									backgroundSize: lineBgSize,
 								}]"
 						>
 							<!-- #endif -->
@@ -67,7 +65,8 @@
 										transform: `translate(${lineOffsetLeft}px)`,
 										transitionDuration: `${firstTime ? 0 : duration}ms`,
 										height: $u.addUnit(lineHeight),
-										backgroundColor: lineColor
+										background: lineColor,
+										backgroundSize: lineBgSize,
 									}]"
 							>
 								<!-- #endif -->
@@ -341,7 +340,7 @@
 
 				&__line {
 					height: 3px;
-					background-color: $u-primary;
+					background: $u-primary;
 					width: 30px;
 					position: absolute;
 					bottom: 2px;

+ 1 - 1
uni_modules/uview-ui/components/u-text/u-text.vue

@@ -146,7 +146,7 @@ export default {
     methods: {
         clickHandler() {
             // 如果为手机号模式,拨打电话
-            if (this.call && this.mode === 'phone' && uni.$u.test.mobile(this.text)) {
+            if (this.call && this.mode === 'phone') {
                 uni.makePhoneCall({
                     phoneNumber: this.text
                 })

+ 1 - 1
uni_modules/uview-ui/components/u-text/value.js

@@ -36,7 +36,7 @@ export default {
                 return uni.$u.timeFormat(text, 'yyyy-mm-dd')
             } if (mode === 'phone') {
                 // 判断是否合法的手机号
-                !uni.$u.test.mobile(text) && uni.$u.error('手机号模式下,text参数需要为手机号码格式')
+                // !uni.$u.test.mobile(text) && uni.$u.error('手机号模式下,text参数需要为手机号码格式')
                 if (uni.$u.test.func(format)) {
                     // 如果用户传入的是函数,使用函数格式化
                     return format(text)

+ 6 - 4
uni_modules/uview-ui/components/u-transition/transition.js

@@ -41,10 +41,11 @@ export default {
 				// #ifdef H5
 				await uni.$u.sleep(20)
 				// #endif
-                // 组件动画进入后触发的事件
-                this.$emit('afterEnter')
                 // 标识动画尚未结束
+                this.$emit('enter')
                 this.transitionEnded = false
+				// 组件动画进入后触发的事件
+                this.$emit('afterEnter')
                 // 赋予组件enter-to类名
                 this.classes = classNames['enter-to']
             })
@@ -61,8 +62,9 @@ export default {
             this.classes = classNames.leave
 
             this.$nextTick(() => {
-                // 标记动画已经结束了
-                this.transitionEnded = false
+               // 动画正在离场的状态
+               this.transitionEnded = false
+               this.$emit('leave')
                 // 组件执行动画,到了执行的执行时间后,执行一些额外处理
                 setTimeout(this.onTransitionEnd, this.duration)
                 this.classes = classNames['leave-to']

+ 92 - 79
uni_modules/uview-ui/components/u-upload/u-upload.vue

@@ -1,90 +1,94 @@
 <template>
 	<view class="u-upload" :style="[$u.addStyle(customStyle)]">
-		<view class="u-upload__wrap" v-if="previewImage">
-			<view
-			    class="u-upload__wrap__preview"
-			    v-for="(item, index) in lists"
-			    :key="index"
-			>
-				<image
-				    v-if="item.isImage || (item.type && item.type === 'image')"
-				    :src="item.thumb || item.url"
-				    :mode="imageMode"
-				    class="u-upload__wrap__preview__image"
-				    @tap="onPreviewImage(item)"
-					:style="[{
-						width: $u.addUnit(width),
-						height: $u.addUnit(height)
-					}]"
-				/>
-				<view
-				    v-else
-				    class="u-upload__wrap__preview__other"
-				>
-					<u-icon
-					    color="#80CBF9"
-					    size="26"
-					    :name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
-					></u-icon>
-					<text class="u-upload__wrap__preview__other__text">{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}</text>
-				</view>
-				<view
-				    class="u-upload__status"
-				    v-if="item.status === 'uploading' || item.status === 'failed'"
-				>
-					<view class="u-upload__status__icon">
-						<u-icon
-						    v-if="item.status === 'failed'"
-						    name="close-circle"
-						    color="#ffffff"
-						    size="25"
-						/>
-						<u-loading-icon
-						    size="22"
-						    mode="circle"
-						    color="#ffffff"
-						    v-else
-						/>
-					</view>
-					<text
-					    v-if="item.message"
-					    class="u-upload__status__message"
-					>{{ item.message }}</text>
-				</view>
-				<view
-				    class="u-upload__deletable"
-				    v-if="item.status !== 'uploading' && (deletable || item.deletable)"
-				    @tap.stop="deleteItem(index)"
-				>
-					<view class="u-upload__deletable__icon">
-						<u-icon
-						    name="close"
-						    color="#ffffff"
-						    size="10"
-						></u-icon>
-					</view>
-				</view>
+		<view class="u-upload__wrap" >
+			<template v-if="previewImage">
 				<view
-				    class="u-upload__success"
-				    v-if="item.status === 'success'"
+				    class="u-upload__wrap__preview"
+				    v-for="(item, index) in lists"
+				    :key="index"
 				>
-					<!-- #ifdef APP-NVUE -->
 					<image
-					    :src="successIcon"
-					    class="u-upload__success__icon"
-					></image>
-					<!-- #endif -->
-					<!-- #ifndef APP-NVUE -->
-					<view class="u-upload__success__icon">
+					    v-if="item.isImage || (item.type && item.type === 'image')"
+					    :src="item.thumb || item.url"
+					    :mode="imageMode"
+					    class="u-upload__wrap__preview__image"
+					    @tap="onPreviewImage(item)"
+						:style="[{
+							width: $u.addUnit(width),
+							height: $u.addUnit(height)
+						}]"
+					/>
+					<view
+					    v-else
+					    class="u-upload__wrap__preview__other"
+					>
 						<u-icon
-						    name="checkmark"
-						    color="#ffffff"
-						    size="12"
+						    color="#80CBF9"
+						    size="26"
+						    :name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
 						></u-icon>
+						<text class="u-upload__wrap__preview__other__text">{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}</text>
+					</view>
+					<view
+					    class="u-upload__status"
+					    v-if="item.status === 'uploading' || item.status === 'failed'"
+					>
+						<view class="u-upload__status__icon">
+							<u-icon
+							    v-if="item.status === 'failed'"
+							    name="close-circle"
+							    color="#ffffff"
+							    size="25"
+							/>
+							<u-loading-icon
+							    size="22"
+							    mode="circle"
+							    color="#ffffff"
+							    v-else
+							/>
+						</view>
+						<text
+						    v-if="item.message"
+						    class="u-upload__status__message"
+						>{{ item.message }}</text>
+					</view>
+					<view
+					    class="u-upload__deletable"
+					    v-if="item.status !== 'uploading' && (deletable || item.deletable)"
+					    @tap.stop="deleteItem(index)"
+					>
+						<view class="u-upload__deletable__icon">
+							<u-icon
+							    name="close"
+							    color="#ffffff"
+							    size="10"
+							></u-icon>
+						</view>
+					</view>
+					<view
+					    class="u-upload__success"
+					    v-if="item.status === 'success'"
+					>
+						<!-- #ifdef APP-NVUE -->
+						<image
+						    :src="successIcon"
+						    class="u-upload__success__icon"
+						></image>
+						<!-- #endif -->
+						<!-- #ifndef APP-NVUE -->
+						<view class="u-upload__success__icon">
+							<u-icon
+							    name="checkmark"
+							    color="#ffffff"
+							    size="12"
+							></u-icon>
+						</view>
+						<!-- #endif -->
 					</view>
-					<!-- #endif -->
 				</view>
-			</view>
+				
+			</template>
+			
 			<template v-if="isInCount">
 				<view
 				    v-if="$slots.default || $slots.$default"
@@ -205,11 +209,18 @@
 					disabled
 				} = this;
 				if (disabled) return;
+				// 如果用户传入的是字符串,需要格式化成数组
+				let capture;
+				try {
+					capture = uni.$u.test.array(this.capture) ? this.capture : this.capture.split(',');
+				}catch(e) {
+					capture = [];
+				}
 				chooseFile(
 						Object.assign({
 							accept: this.accept,
 							multiple: this.multiple,
-							capture: this.capture,
+							capture: capture,
 							compressed: this.compressed,
 							maxDuration: this.maxDuration,
 							sizeType: this.sizeType,
@@ -363,6 +374,7 @@
 	$u-upload-deletable-zIndex:3 !default;
 	$u-upload-success-bottom:0 !default;
 	$u-upload-success-right:0 !default;
+	$u-upload-success-border-style:solid !default;
 	$u-upload-success-border-top-color:transparent !default;
 	$u-upload-success-border-left-color:transparent !default;
 	$u-upload-success-border-bottom-color: $u-success !default;
@@ -468,6 +480,7 @@
 			// 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形
 			// 所以在nvue下使用图片,非nvue下使用css实现
 			/* #ifndef APP-NVUE */
+			border-style: $u-upload-success-border-style;
 			border-top-color: $u-upload-success-border-top-color;
 			border-left-color: $u-upload-success-border-left-color;
 			border-bottom-color: $u-upload-success-border-bottom-color;

+ 3 - 3
uni_modules/uview-ui/libs/config/config.js

@@ -1,9 +1,9 @@
-// 此版本发布于2022-02-22
-const version = '2.0.28'
+// 此版本发布于2022-04-19
+const version = '2.0.31'
 
 // 开发环境才提示,生产环境不会提示
 if (process.env.NODE_ENV === 'development') {
-	// console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
+	console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
 }
 
 export default {

+ 1 - 1
uni_modules/uview-ui/libs/config/props/checkbox.js

@@ -11,7 +11,7 @@ export default {
     // checkbox组件
     checkbox: {
         name: '',
-        shape: 'square',
+        shape: '',
         size: '',
         checkbox: false,
         disabled: '',

+ 1 - 0
uni_modules/uview-ui/libs/config/props/tabs.js

@@ -21,6 +21,7 @@ export default {
         }),
         lineWidth: 20,
         lineHeight: 3,
+        lineBgSize: 'cover',
         itemStyle: () => ({
             height: '44px'
         }),

+ 1 - 1
uni_modules/uview-ui/libs/config/props/textarea.js

@@ -15,7 +15,7 @@ export default {
 		placeholderClass: 'textarea-placeholder',
 		placeholderStyle: 'color: #c0c4cc',
 		height: 70,
-		confirmType: 'done',
+		confirmType: '',
 		disabled: false,
 		count: false,
 		focus: false,

+ 1 - 1
uni_modules/uview-ui/libs/css/flex.scss

@@ -36,7 +36,7 @@
 
 .u-flex-y,
 .u-flex-column {
-	@include flex('column');
+	@include flex(column);
 }
 
 .u-flex-x-center {

+ 3 - 2
uni_modules/uview-ui/libs/function/test.js

@@ -232,8 +232,9 @@ function promise(value) {
  * @param {Object} value
  */
 function image(value) {
+    const newValue = value.split('?')[0]
     const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i
-    return IMAGE_REGEXP.test(value)
+    return IMAGE_REGEXP.test(newValue)
 }
 
 /**
@@ -241,7 +242,7 @@ function image(value) {
  * @param {Object} value
  */
 function video(value) {
-    const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i
+    const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i
     return VIDEO_REGEXP.test(value)
 }
 

+ 27 - 23
uni_modules/uview-ui/libs/mixin/mixin.js

@@ -31,33 +31,33 @@ module.exports = {
     created() {
         // 组件当中,只有created声明周期,为了能在组件使用,故也在created中将方法挂载到$u
         this.$u.getRect = this.$uGetRect
-	},
+    },
     computed: {
         // 在2.x版本中,将会把$u挂载到uni对象下,导致在模板中无法使用uni.$u.xxx形式
         // 所以这里通过computed计算属性将其附加到this.$u上,就可以在模板或者js中使用uni.$u.xxx
-		// 只在nvue环境通过此方式引入完整的$u,其他平台会出现性能问题,非nvue则按需引入(主要原因是props过大)
-		$u() {
-			// #ifndef APP-NVUE
-			// 在非nvue端,移除props,http,mixin等对象,避免在小程序setData时数据过大影响性能
-			return uni.$u.deepMerge(uni.$u, {
-				props: undefined,
-				http: undefined,
-				mixin: undefined
-			})
-			// #endif
-			// #ifdef APP-NVUE
-			return uni.$u
-			// #endif
-		},
+        // 只在nvue环境通过此方式引入完整的$u,其他平台会出现性能问题,非nvue则按需引入(主要原因是props过大)
+        $u() {
+            // #ifndef APP-NVUE
+            // 在非nvue端,移除props,http,mixin等对象,避免在小程序setData时数据过大影响性能
+            return uni.$u.deepMerge(uni.$u, {
+                props: undefined,
+                http: undefined,
+                mixin: undefined
+            })
+            // #endif
+            // #ifdef APP-NVUE
+            return uni.$u
+            // #endif
+        },
         /**
-		 * 生成bem规则类名
-		 * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
-		 * 故采用如下折中做法,最后返回的是数组,类似['a', 'b', 'c']的形式
-		 * @param {String} name 组件名称
-		 * @param {Array} fixed 一直会存在的类名
-		 * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
-		 * @return Array
-		 */
+         * 生成bem规则类名
+         * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
+         * 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
+         * @param {String} name 组件名称
+         * @param {Array} fixed 一直会存在的类名
+         * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
+         * @returns {Array|string}
+         */
         bem() {
             return function (name, fixed, change) {
                 // 类名前缀
@@ -76,6 +76,10 @@ module.exports = {
                     })
                 }
                 return Object.keys(classes)
+                    // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
+                    // #ifdef MP-ALIPAY || MP-TOUTIAO
+                    .join(' ')
+                    // #endif
             }
         }
     },

+ 3 - 8
uni_modules/uview-ui/package.json

@@ -2,20 +2,15 @@
 	"id": "uview-ui",
 	"name": "uview-ui",
 	"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
-	"version": "2.0.28",
+	"version": "2.0.31",
 	"description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
 	"keywords": [
         "uview",
-        "uview",
-        "ui",
         "ui",
-        "uni-app",
-        "uni-app",
-        "ui"
+        "uni-app"
     ],
 	"repository": "https://github.com/umicro/uView2.0",
-	"engines": {
-		"HBuilderX": "^3.1.0"
+    "engines": {
 	},
 	"dcloudext": {
 		"category": [