lilei 4 ay önce
ebeveyn
işleme
949daba868

+ 8 - 0
uni_modules/vk-uview-ui/changelog.md

@@ -1,3 +1,11 @@
+## 1.6.1(2024-12-20)
+* 【优化】input组件在鸿蒙元服务的兼容性
+**特别注意**
+1. 当前鸿蒙元服务自身框架有一些小问题,渲染页面会可能会出现卡顿和部分样式丢失问题,经排查为元服务自身框架问题。
+## 1.6.0(2024-12-18)
+* 【重要】兼容鸿蒙App和鸿蒙元服务
+**特别注意**
+1. 当前鸿蒙元服务自身框架有一些小问题,渲染页面会可能会出现卡顿和部分样式丢失问题,经排查为元服务自身框架问题。
 ## 1.5.7(2024-09-02)
 * 【修复】`u-input` type 为select时,在支付宝小程序无法点击的问题
 * 【修复】`u-picker` 在微信小程序部分情况下会报警告的问题

+ 15 - 6
uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue

@@ -170,8 +170,7 @@ export default {
 			sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
 			success: res => {
 				this.src = res.tempFilePaths[0];
-				//  获取裁剪图片资源后,给data添加src属性及其值
-				this.cropper.pushOrign(this.src);
+				this.pushOrign(this.src);
 			},
 			fail: (err) => {
 				console.error('chooseImageErr: ', err);
@@ -221,15 +220,25 @@ export default {
 			const self = this;
 			uni.chooseImage({
 				count: 1, // 默认9
-				sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+				sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
 				sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
 				success: (res) => {
 					self.src = res.tempFilePaths[0];
-					//  获取裁剪图片资源后,给data添加src属性及其值
-
-					self.cropper.pushOrign(this.src);
+					self.pushOrign(self.src);
 				}
 			});
+		},
+		pushOrign(src) {
+			// #ifdef MP-HARMONY
+			uni.$emit('uAvatarCropper', src);
+			this.$u.route({
+				type: 'back'
+			});
+			// #endif
+			// #ifndef MP-HARMONY
+			// 获取裁剪图片资源后,给data添加src属性及其值
+			this.cropper.pushOrign(src);
+			// #endif
 		}
 	}
 };

+ 4 - 4
uni_modules/vk-uview-ui/components/u-avatar/u-avatar.vue

@@ -20,11 +20,11 @@
     <slot v-else></slot>
     <view
       class="u-avatar__sex"
-      v-if="showSex"
+      v-if="showSex && sexIcon"
       :class="['u-avatar__sex--' + sexIcon]"
       :style="[uSexStyle]"
     >
-      <u-icon :name="sexIcon" size="20"></u-icon>
+      <u-icon v-if="sexIcon" :name="sexIcon" size="20"></u-icon>
     </view>
     <view class="u-avatar__level" v-if="showLevel" :style="[uLevelStyle]">
       <u-icon :name="levelIcon" size="20"></u-icon>
@@ -72,7 +72,7 @@ export default {
     },
     // 头像路径
     src: {
-      type: String,
+      type: [String, null],
       default: ""
     },
     // 尺寸,large-大,default-中等,mini-小,如果为数值,则单位为rpx
@@ -103,7 +103,7 @@ export default {
     },
     // 右上角性别角标,man-男,woman-女
     sexIcon: {
-      type: String,
+      type: [String, null],
       default: "man"
     },
     // 右下角的等级图标

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

@@ -5,6 +5,7 @@
 		:class="{ 'u-border': border, 'u-card-full': full, 'u-card--border': borderRadius > 0 }"
 		:style="{
 			'--radius': borderRadius + 'rpx',
+			'border-radius': borderRadius + 'rpx',
 			margin: margin,
 			boxShadow: boxShadow
 		}"

+ 3 - 3
uni_modules/vk-uview-ui/components/u-cell-item/u-cell-item.vue

@@ -31,7 +31,7 @@
 			</view>
 		</view>
 
-		<view class="u-cell__value" :style="[valueStyle]">
+		<view class="u-cell__value" :style="[valueStyle || {}]">
 			<block class="u-cell__value" v-if="value !== ''">{{ value }}</block>
 			<slot v-else></slot>
 		</view>
@@ -147,7 +147,7 @@ export default {
 		},
 		// 右侧显示内容的样式
 		valueStyle: {
-			type: Object,
+			type: [Object, null],
 			default() {
 				return {};
 			}
@@ -250,7 +250,7 @@ export default {
 }
 
 .u-cell-border:after {
-	position: absolute; 
+	position: absolute;
 	/* #ifndef APP-NVUE */
 	box-sizing: border-box;
 	content: ' ';

+ 6 - 4
uni_modules/vk-uview-ui/components/u-grid-item/u-grid-item.vue

@@ -58,7 +58,9 @@
 			// 父组件的实例
 			this.updateParentData();
 			// this.parent在updateParentData()中定义
-			this.parent.children.push(this);
+			if (this.parent && this.parent.children) {
+				this.parent.children.push(this);
+			}
 		},
 		computed: {
 			// 每个grid-item的宽度
@@ -82,7 +84,7 @@
 
 <style scoped lang="scss">
 	@import "../../libs/css/style.components.scss";
-	
+
 	.u-grid-item {
 		box-sizing: border-box;
 		background: #fff;
@@ -91,7 +93,7 @@
 		justify-content: center;
 		position: relative;
 		flex-direction: column;
-		
+
 		/* #ifdef MP */
 		position: relative;
 		float: left;
@@ -105,7 +107,7 @@
 	.u-grid-marker-box {
 		position: absolute;
 		/* #ifndef APP-NVUE */
-		display: inline-flex;		
+		display: inline-flex;
 		/* #endif */
 		line-height: 0;
 	}

+ 9 - 7
uni_modules/vk-uview-ui/components/u-input/u-input.vue

@@ -11,7 +11,13 @@
 			textAlign: inputAlignCom,
 			backgroundColor: backgroundColor,
 		}"
+		
+		<!-- #ifndef MP-HARMONY -->
 		@tap.stop="inputClick"
+		<!-- #endif -->
+		<!-- #ifdef MP-HARMONY -->
+		@tap="inputClick"
+		<!-- #endif -->
 	>
 		<textarea
 			v-if="type == 'textarea'"
@@ -86,7 +92,7 @@
 					'u-input__right-icon--select--reverse': selectOpen
 				}"
 			>
-				<u-icon name="arrow-right" size="26" color="#c0c4cc"></u-icon>
+				<u-icon name="arrow-down" size="26" color="#c0c4cc"></u-icon>
 			</view>
 		</view>
 	</view>
@@ -359,12 +365,7 @@ export default {
 				this.uForm[key] = parent[key];
 			});
 		}
-		// #ifdef MP-ALIPAY
-		if (this.type === 'select') {
-			this.showCover = true;
-		}
-		// #endif
-		// #ifdef APP
+		// #ifdef MP-ALIPAY || MP-HARMONY || APP
 		if (this.type === 'select') {
 			this.showCover = true;
 		}
@@ -461,6 +462,7 @@ export default {
 		pointer-events: none;
 	}
 	/* #endif */
+
 	&__textarea {
 		width: auto;
 		font-size: 28rpx;

+ 4 - 2
uni_modules/vk-uview-ui/components/u-picker/u-picker.vue

@@ -245,7 +245,7 @@ export default {
 		},
 		// 默认显示的时间,2025-07-02 || 2025-07-02 13:01:00 || 2025/07/02
 		defaultTime: {
-			type: String,
+			type: [String, null],
 			default: ""
 		},
 		// 默认显示的地区,可传类似["河北省", "秦皇岛市", "北戴河区"]
@@ -438,10 +438,12 @@ export default {
 		//日期时间处理
 		initTimeValue() {
 			// 格式化时间,在IE浏览器(uni不存在此情况),无法识别日期间的"-"间隔符号
-			let fdate = this.defaultTime.replace(/\-/g, "/");
+			let fdate;
 			// 如果未设置默认时间,则默认时间 = 当前时间
 			if (!this.defaultTime) {
 				fdate = timeFormat(Date.now(), "yyyy/mm/dd hh:MM:ss");
+			} else {
+				fdate = this.defaultTime.replace(/\-/g, "/");
 			}
 			fdate = fdate && fdate.indexOf("/") == -1 ? `2020/01/01 ${fdate}` : fdate;
 

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

@@ -169,7 +169,7 @@ export default {
 		// 输入框最大能输入的长度,-1为不限制长度(来自uniapp文档)
 		maxlength: {
 			type: [Number, String],
-			default: '-1'
+			default: 1000
 		},
 		// 搜索图标的颜色,默认同输入框字体颜色
 		searchIconColor: {

+ 0 - 6
uni_modules/vk-uview-ui/components/u-subsection/u-subsection.vue

@@ -300,7 +300,6 @@
 			},
 			// 获取各个tab的节点信息
 			getTabsInfo() {
-				if(this.list.length==0){return}
 				let view = uni.createSelectorQuery().in(this);
 				for (let i = 0; i < this.list.length; i++) {
 					view.select('.u-item-' + i).boundingClientRect();
@@ -368,12 +367,7 @@
 		align-items: center;
 		justify-content: center;
 		color: $u-main-color;
-		/*#ifdef APP-PlUS*/
 		padding: 0 6rpx;
-		/*#endif*/
-		/*#ifdef APP-HARMONY*/
-		padding: 8rpx 6rpx;
-		/*#endif*/
 		position: relative;
 	}
 

+ 1 - 1
uni_modules/vk-uview-ui/components/u-switch/u-switch.vue

@@ -16,7 +16,7 @@
 				:show="loading"
 				class="u-switch__loading"
 				:size="size * 0.6"
-				:color="loadingColor"
+				:color="loadingColor || '#c7c7c7'"
 			/>
 		</view>
 	</view>

+ 2 - 2
uni_modules/vk-uview-ui/components/u-tabs/u-tabs.vue

@@ -337,8 +337,7 @@
 <style lang="scss" scoped>
 	@import "../../libs/css/style.components.scss";
 
-	view,
-	scroll-view {
+	.u-tabs {
 		box-sizing: border-box;
 	}
 
@@ -376,6 +375,7 @@
 		width: 100%;
 		white-space: nowrap;
 		position: relative;
+		box-sizing: border-box;
 	}
 
 	.u-tab-item {

+ 11 - 10
uni_modules/vk-uview-ui/package.json

@@ -2,13 +2,13 @@
   "id": "vk-uview-ui",
 	"name": "vk-uview-ui",
   "displayName": "【开箱即用】uView Vue3 横空出世,继承uView1意志,再战江湖,风云再起!",
-  "version": "1.5.7",
+  "version": "1.6.1",
   "description": "同时支持 Vue3.0 和 Vue2.0,你没看错,现在 uView 支持 Vue3.0 了!(不支持nvue,此版本为uView1.0的分支)",
   "keywords": [
     "vk-uview-ui",
     "vk云开发",
     "vue3.0",
-    "uniapp",
+    "鸿蒙",
     "uview"
 ],
   "repository": "https://gitee.com/vk-uni/vk-uview-ui.git",
@@ -50,9 +50,10 @@
           "vue3": "y"
         },
         "App": {
-          "app-vue": "y",
-          "app-nvue": "n",
-          "app-uvue": "n"
+            "app-vue": "y",
+            "app-nvue": "n",
+            "app-uvue": "n",
+            "app-harmony": "u"
         },
         "H5-mobile": {
           "Safari": "y",
@@ -69,14 +70,14 @@
         },
         "小程序": {
           "微信": "y",
-          "阿里": "u",
+          "阿里": "y",
           "百度": "u",
-          "字节跳动": "u",
-          "QQ": "u"
+          "字节跳动": "y",
+          "QQ": "y"
         },
         "快应用": {
-          "华为": "u",
-          "联盟": "u"
+          "华为": "y",
+          "联盟": "y"
         }
       }
     }