diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md
index 1aecf782deffececa99ab5f5463e419bc508f19c..56581c4eee26d01227b094831bf8c03aaecf5ebc 100644
--- a/uni_modules/uni-badge/changelog.md
+++ b/uni_modules/uni-badge/changelog.md
@@ -1,29 +1,31 @@
+## 1.2.1(2022-09-05)
+- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473)
## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge)
-## 1.1.7(2021-11-08)
-- 优化 升级ui
-- 修改 size 属性默认值调整为 small
-- 修改 type 属性,默认值调整为 error,info 替换 default
-## 1.1.6(2021-09-22)
-- 修复 在字节小程序上样式不生效的 bug
-## 1.1.5(2021-07-30)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.4(2021-07-29)
-- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
-## 1.1.3(2021-06-24)
-- 优化 示例项目
-## 1.1.1(2021-05-12)
-- 新增 组件示例地址
-## 1.1.0(2021-05-12)
-- 新增 uni-badge 的 absolute 属性,支持定位
-- 新增 uni-badge 的 offset 属性,支持定位偏移
-- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
-- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
-- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
-## 1.0.7(2021-05-07)
-- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
-- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
-- 新增 uni-badge 属性 custom-style, 支持自定义样式
-## 1.0.6(2021-02-04)
-- 调整为uni_modules目录规范
+## 1.1.7(2021-11-08)
+- 优化 升级ui
+- 修改 size 属性默认值调整为 small
+- 修改 type 属性,默认值调整为 error,info 替换 default
+## 1.1.6(2021-09-22)
+- 修复 在字节小程序上样式不生效的 bug
+## 1.1.5(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.4(2021-07-29)
+- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
+## 1.1.3(2021-06-24)
+- 优化 示例项目
+## 1.1.1(2021-05-12)
+- 新增 组件示例地址
+## 1.1.0(2021-05-12)
+- 新增 uni-badge 的 absolute 属性,支持定位
+- 新增 uni-badge 的 offset 属性,支持定位偏移
+- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
+- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
+- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
+## 1.0.7(2021-05-07)
+- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
+- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
+- 新增 uni-badge 属性 custom-style, 支持自定义样式
+## 1.0.6(2021-02-04)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
index 5e11cc693d32f4d7d30a46654d24fcd2f6c73e2f..664dc370bfa3d192570df854b490b1f80b4aa01a 100644
--- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
+++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
@@ -1,7 +1,7 @@
- {{displayValue}}
@@ -21,11 +21,11 @@
* @value error 红色
* @property {String} inverted = [true|false] 是否无需背景颜色
* @property {Number} maxNum 展示封顶的数字值,超过 99 显示 99+
- * @property {String} absolute = [rightTop|rightBottom|leftBottom|leftTop] 开启绝对定位, 角标将定位到其包裹的标签的四角上
+ * @property {String} absolute = [rightTop|rightBottom|leftBottom|leftTop] 开启绝对定位, 角标将定位到其包裹的标签的四角上
* @value rightTop 右上
* @value rightBottom 右下
* @value leftTop 左上
- * @value leftBottom 左下
+ * @value leftBottom 左下
* @property {Array[number]} offset 距定位角中心点的偏移量,只有存在 absolute 属性时有效,例如:[-10, -10] 表示向外偏移 10px,[10, 10] 表示向 absolute 指定的内偏移 10px
* @property {String} isDot = [true|false] 是否显示为一个小点
* @event {Function} click 点击 Badge 触发事件
@@ -130,16 +130,13 @@
const match = whiteList[this.absolute]
return match ? match : whiteList['rightTop']
},
- badgeWidth() {
- return {
- width: `${this.width}px`
- }
- },
dotStyle() {
if (!this.isDot) return {}
return {
width: '10px',
+ minWidth: '0',
height: '10px',
+ padding: '0',
borderRadius: '10px'
}
},
@@ -160,7 +157,7 @@
};
-
+
diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json
index 52bd1c9393df524ffebc9ad3ddcc31521cb3881c..7a34d9c3e1a0c3604f2dea26843e10e77eb616f2 100644
--- a/uni_modules/uni-badge/package.json
+++ b/uni_modules/uni-badge/package.json
@@ -1,88 +1,85 @@
-{
- "id": "uni-badge",
- "displayName": "uni-badge 数字角标",
- "version": "1.2.0",
- "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
- "keywords": [
- "",
- "badge",
- "uni-ui",
- "uniui",
- "数字角标",
- "徽章"
-],
- "repository": "https://github.com/dcloudio/uni-ui",
- "engines": {
- "HBuilderX": ""
- },
- "directories": {
- "example": "../../temps/example_temps"
- },
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "y",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "y",
- "百度": "y",
- "字节跳动": "y",
- "QQ": "y"
- },
- "快应用": {
- "华为": "y",
- "联盟": "y"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "y"
- }
- }
- }
- }
+{
+ "id": "uni-badge",
+ "displayName": "uni-badge 数字角标",
+ "version": "1.2.1",
+ "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
+ "keywords": [
+ "",
+ "badge",
+ "uni-ui",
+ "uniui",
+ "数字角标",
+ "徽章"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+"dcloudext": {
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-scss"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "y",
+ "联盟": "y"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md
index d8f420b9a6cfec68b7fd755ab516f26f8f2dfd39..c7a468a286ce21077d7e86f6cafc34e47a67c935 100644
--- a/uni_modules/uni-data-checkbox/changelog.md
+++ b/uni_modules/uni-data-checkbox/changelog.md
@@ -1,3 +1,7 @@
+## 1.0.3(2022-09-16)
+- 可以使用 uni-scss 控制主题色
+## 1.0.2(2022-06-30)
+- 优化 在 uni-forms 中的依赖注入方式
## 1.0.1(2022-02-07)
- 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug
## 1.0.0(2021-11-19)
diff --git a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
index 300cb5fe6e7e31a60b2bc2c9a15b48dc15ac4315..341a4af4bab8ef163dbbc0a008ecfa177be4f0ee 100644
--- a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
+++ b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
@@ -155,17 +155,17 @@
value(newVal) {
this.dataList = this.getDataList(newVal)
// fix by mehaotian is_reset 在 uni-forms 中定义
- if(!this.is_reset){
- this.is_reset = false
- this.formItem && this.formItem.setValue(newVal)
- }
+ // if(!this.is_reset){
+ // this.is_reset = false
+ // this.formItem && this.formItem.setValue(newVal)
+ // }
},
modelValue(newVal) {
this.dataList = this.getDataList(newVal);
- if(!this.is_reset){
- this.is_reset = false
- this.formItem && this.formItem.setValue(newVal)
- }
+ // if(!this.is_reset){
+ // this.is_reset = false
+ // this.formItem && this.formItem.setValue(newVal)
+ // }
}
},
data() {
@@ -193,22 +193,22 @@
}
},
created() {
- this.form = this.getForm('uniForms')
- this.formItem = this.getForm('uniFormsItem')
+ // this.form = this.getForm('uniForms')
+ // this.formItem = this.getForm('uniFormsItem')
// this.formItem && this.formItem.setValue(this.value)
- if (this.formItem) {
- this.isTop = 6
- if (this.formItem.name) {
- // 如果存在name添加默认值,否则formData 中不存在这个字段不校验
- if(!this.is_reset){
- this.is_reset = false
- this.formItem.setValue(this.dataValue)
- }
- this.rename = this.formItem.name
- this.form.inputChildrens.push(this)
- }
- }
+ // if (this.formItem) {
+ // this.isTop = 6
+ // if (this.formItem.name) {
+ // // 如果存在name添加默认值,否则formData 中不存在这个字段不校验
+ // if(!this.is_reset){
+ // this.is_reset = false
+ // this.formItem.setValue(this.dataValue)
+ // }
+ // this.rename = this.formItem.name
+ // this.form.inputChildrens.push(this)
+ // }
+ // }
if (this.localdata && this.localdata.length !== 0) {
this.isLocal = true
@@ -273,7 +273,7 @@
}
}
}
- this.formItem && this.formItem.setValue(detail.value)
+ // this.formItem && this.formItem.setValue(detail.value)
// TODO 兼容 vue2
this.$emit('input', detail.value);
// // TOTO 兼容 vue3
@@ -375,7 +375,7 @@
selectedArr.push(item[this.map.value])
}
})
- return this.dataValue && this.dataValue.length > 0 ? this.dataValue : selectedArr
+ return this.dataValue.length > 0 ? this.dataValue : selectedArr
},
/**
@@ -383,12 +383,14 @@
*/
setStyleBackgroud(item) {
let styles = {}
- let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
- if (this.mode !== 'list') {
- styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
- }
- if (this.mode === 'tag') {
- styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
+ let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
+ if (this.selectedColor) {
+ if (this.mode !== 'list') {
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+ }
+ if (this.mode === 'tag') {
+ styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
+ }
}
let classles = ''
for (let i in styles) {
@@ -398,16 +400,17 @@
},
setStyleIcon(item) {
let styles = {}
- let classles = ''
- let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
- styles['background-color'] = item.selected?selectedColor:'#fff'
- styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
-
- if(!item.selected && item.disabled){
- styles['background-color'] = '#F2F6FC'
- styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+ let classles = ''
+ if (this.selectedColor) {
+ let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
+ styles['background-color'] = item.selected?selectedColor:'#fff'
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+
+ if(!item.selected && item.disabled){
+ styles['background-color'] = '#F2F6FC'
+ styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+ }
}
-
for (let i in styles) {
classles += `${i}:${styles[i]};`
}
@@ -415,17 +418,18 @@
},
setStyleIconText(item) {
let styles = {}
- let classles = ''
- let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
- if (this.mode === 'tag') {
- styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666'
- } else {
- styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666'
- }
- if(!item.selected && item.disabled){
- styles.color = '#999'
+ let classles = ''
+ if (this.selectedColor) {
+ let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
+ if (this.mode === 'tag') {
+ styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666'
+ } else {
+ styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666'
+ }
+ if(!item.selected && item.disabled){
+ styles.color = '#999'
+ }
}
-
for (let i in styles) {
classles += `${i}:${styles[i]};`
}
@@ -448,7 +452,7 @@
+
diff --git a/uni_modules/uni-easyinput/package.json b/uni_modules/uni-easyinput/package.json
index 67e4e04cb1bc4cea5ea58572f3f7c2f286a5c399..a11be70ca9ead15fb7b792a2d632026fe419271c 100644
--- a/uni_modules/uni-easyinput/package.json
+++ b/uni_modules/uni-easyinput/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框",
- "version": "1.0.3",
+ "version": "1.1.1",
"description": "Easyinput 组件是对原生input组件的增强",
"keywords": [
"uni-ui",
@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
+"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
},
"uni_modules": {
"dependencies": [
diff --git a/uni_modules/uni-forms/changelog.md b/uni_modules/uni-forms/changelog.md
index 26e120b5c0878e5d3bc2916063da30603f3c87a7..c358a21abbe9d9c871febe80fb8b141f23561e1d 100644
--- a/uni_modules/uni-forms/changelog.md
+++ b/uni_modules/uni-forms/changelog.md
@@ -1,3 +1,33 @@
+## 1.4.8(2022-08-23)
+- 优化 根据 rules 自动添加 required 的问题
+## 1.4.7(2022-08-22)
+- 修复 item 未设置 require 属性,rules 设置 require 后,星号也显示的 bug,详见:[https://ask.dcloud.net.cn/question/151540](https://ask.dcloud.net.cn/question/151540)
+## 1.4.6(2022-07-13)
+- 修复 model 需要校验的值没有声明对应字段时,导致第一次不触发校验的bug
+## 1.4.5(2022-07-05)
+- 新增 更多表单示例
+- 优化 子表单组件过期提示的问题
+- 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式
+## 1.4.4(2022-07-04)
+- 更新 删除组件日志
+## 1.4.3(2022-07-04)
+- 修复 由 1.4.0 引发的 label 插槽不生效的bug
+## 1.4.2(2022-07-04)
+- 修复 子组件找不到 setValue 报错的bug
+## 1.4.1(2022-07-04)
+- 修复 uni-data-picker 在 uni-forms-item 中报错的bug
+- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
+## 1.4.0(2022-06-30)
+- 【重要】组件逻辑重构,部分用法用旧版本不兼容,请注意兼容问题
+- 【重要】组件使用 Provide/Inject 方式注入依赖,提供了自定义表单组件调用 uni-forms 校验表单的能力
+- 新增 model 属性,等同于原 value/modelValue 属性,旧属性即将废弃
+- 新增 validateTrigger 属性的 blur 值,仅 uni-easyinput 生效
+- 新增 onFieldChange 方法,可以对子表单进行校验,可替代binddata方法
+- 新增 子表单的 setRules 方法,配合自定义校验函数使用
+- 新增 uni-forms-item 的 setRules 方法,配置动态表单使用可动态更新校验规则
+- 优化 动态表单校验方式,废弃拼接name的方式
+## 1.3.3(2022-06-22)
+- 修复 表单校验顺序无序问题
## 1.3.2(2021-12-09)
-
## 1.3.1(2021-11-19)
diff --git a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
index 679b12f9349692459f9fcce0932668a43a5dfa90..349ee7012350798a177b7ec94a5b9be3bfd4ef42 100644
--- a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
+++ b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
@@ -1,213 +1,325 @@
-
-
-
-
-
- *
-
- {{ label }}
-
-
-
-
-
+
+
+
+ *
+ {{label}}
-
- {{ showMsg === 'undertext' ? msg : '' }}
+
+
+
+
+
+ {{msg}}
+
+
+
+
+
+
+
+ {{msg}}
+
+
+
-
diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
index dff823bb09d7681708bfe3f1be932dcdfb09efe0..21aee1a4605ef58b757af2c66645ae16164b098f 100644
--- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
@@ -1,13 +1,27 @@
-
-
-
+
diff --git a/uni_modules/uni-forms/components/uni-forms/utils.js b/uni_modules/uni-forms/components/uni-forms/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..31d57f41031ee6b5ebd01d0a091a17611ae270c3
--- /dev/null
+++ b/uni_modules/uni-forms/components/uni-forms/utils.js
@@ -0,0 +1,293 @@
+/**
+ * 简单处理对象拷贝
+ * @param {Obejct} 被拷贝对象
+ * @@return {Object} 拷贝对象
+ */
+export const deepCopy = (val) => {
+ return JSON.parse(JSON.stringify(val))
+}
+/**
+ * 过滤数字类型
+ * @param {String} format 数字类型
+ * @@return {Boolean} 返回是否为数字类型
+ */
+export const typeFilter = (format) => {
+ return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
+}
+
+/**
+ * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
+ * @param {String} key 字段名
+ * @param {any} value 字段值
+ * @param {Object} rules 表单校验规则
+ */
+export const getValue = (key, value, rules) => {
+ const isRuleNumType = rules.find(val => val.format && typeFilter(val.format));
+ const isRuleBoolType = rules.find(val => (val.format && val.format === 'boolean') || val.format === 'bool');
+ // 输入类型为 number
+ if (!!isRuleNumType) {
+ if (!value && value !== 0) {
+ value = null
+ } else {
+ value = isNumber(Number(value)) ? Number(value) : value
+ }
+ }
+
+ // 输入类型为 boolean
+ if (!!isRuleBoolType) {
+ value = isBoolean(value) ? value : false
+ }
+
+ return value;
+}
+
+/**
+ * 获取表单数据
+ * @param {String|Array} name 真实名称,需要使用 realName 获取
+ * @param {Object} data 原始数据
+ * @param {any} value 需要设置的值
+ */
+export const setDataValue = (field, formdata, value) => {
+ formdata[field] = value
+ return value || ''
+}
+
+/**
+ * 获取表单数据
+ * @param {String|Array} field 真实名称,需要使用 realName 获取
+ * @param {Object} data 原始数据
+ */
+export const getDataValue = (field, data) => {
+ return objGet(data, field)
+}
+
+/**
+ * 获取表单类型
+ * @param {String|Array} field 真实名称,需要使用 realName 获取
+ */
+export const getDataValueType = (field, data) => {
+ const value = getDataValue(field, data)
+ return {
+ type: type(value),
+ value
+ }
+}
+
+/**
+ * 获取表单可用的真实name
+ * @param {String|Array} name 表单name
+ * @@return {String} 表单可用的真实name
+ */
+export const realName = (name, data = {}) => {
+ const base_name = _basePath(name)
+ if (typeof base_name === 'object' && Array.isArray(base_name) && base_name.length > 1) {
+ const realname = base_name.reduce((a, b) => a += `#${b}`, '_formdata_')
+ return realname
+ }
+ return base_name[0] || name
+}
+
+/**
+ * 判断是否表单可用的真实name
+ * @param {String|Array} name 表单name
+ * @@return {String} 表单可用的真实name
+ */
+export const isRealName = (name) => {
+ const reg = /^_formdata_#*/
+ return reg.test(name)
+}
+
+/**
+ * 获取表单数据的原始格式
+ * @@return {Object|Array} object 需要解析的数据
+ */
+export const rawData = (object = {}, name) => {
+ let newData = JSON.parse(JSON.stringify(object))
+ let formData = {}
+ for(let i in newData){
+ let path = name2arr(i)
+ objSet(formData,path,newData[i])
+ }
+ return formData
+}
+
+/**
+ * 真实name还原为 array
+ * @param {*} name
+ */
+export const name2arr = (name) => {
+ let field = name.replace('_formdata_#', '')
+ field = field.split('#').map(v => (isNumber(v) ? Number(v) : v))
+ return field
+}
+
+/**
+ * 对象中设置值
+ * @param {Object|Array} object 源数据
+ * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
+ * @param {String} value 需要设置的值
+ */
+export const objSet = (object, path, value) => {
+ if (typeof object !== 'object') return object;
+ _basePath(path).reduce((o, k, i, _) => {
+ if (i === _.length - 1) {
+ // 若遍历结束直接赋值
+ o[k] = value
+ return null
+ } else if (k in o) {
+ // 若存在对应路径,则返回找到的对象,进行下一次遍历
+ return o[k]
+ } else {
+ // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
+ o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {}
+ return o[k]
+ }
+ }, object)
+ // 返回object
+ return object;
+}
+
+// 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
+function _basePath(path) {
+ // 若是数组,则直接返回
+ if (Array.isArray(path)) return path
+ // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
+ return path.replace(/\[/g, '.').replace(/\]/g, '').split('.')
+}
+
+/**
+ * 从对象中获取值
+ * @param {Object|Array} object 源数据
+ * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
+ * @param {String} defaultVal 如果无法从调用链中获取值的默认值
+ */
+export const objGet = (object, path, defaultVal = 'undefined') => {
+ // 先将path处理成统一格式
+ let newPath = _basePath(path)
+ // 递归处理,返回最后结果
+ let val = newPath.reduce((o, k) => {
+ return (o || {})[k]
+ }, object);
+ return !val || val !== undefined ? val : defaultVal
+}
+
+
+/**
+ * 是否为 number 类型
+ * @param {any} num 需要判断的值
+ * @return {Boolean} 是否为 number
+ */
+export const isNumber = (num) => {
+ return !isNaN(Number(num))
+}
+
+/**
+ * 是否为 boolean 类型
+ * @param {any} bool 需要判断的值
+ * @return {Boolean} 是否为 boolean
+ */
+export const isBoolean = (bool) => {
+ return (typeof bool === 'boolean')
+}
+/**
+ * 是否有必填字段
+ * @param {Object} rules 规则
+ * @return {Boolean} 是否有必填字段
+ */
+export const isRequiredField = (rules) => {
+ let isNoField = false;
+ for (let i = 0; i < rules.length; i++) {
+ const ruleData = rules[i];
+ if (ruleData.required) {
+ isNoField = true;
+ break;
+ }
+ }
+ return isNoField;
+}
+
+
+/**
+ * 获取数据类型
+ * @param {Any} obj 需要获取数据类型的值
+ */
+export const type = (obj) => {
+ var class2type = {};
+
+ // 生成class2type映射
+ "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function(item, index) {
+ class2type["[object " + item + "]"] = item.toLowerCase();
+ })
+ if (obj == null) {
+ return obj + "";
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[Object.prototype.toString.call(obj)] || "object" :
+ typeof obj;
+}
+
+/**
+ * 判断两个值是否相等
+ * @param {any} a 值
+ * @param {any} b 值
+ * @return {Boolean} 是否相等
+ */
+export const isEqual = (a, b) => {
+ //如果a和b本来就全等
+ if (a === b) {
+ //判断是否为0和-0
+ return a !== 0 || 1 / a === 1 / b;
+ }
+ //判断是否为null和undefined
+ if (a == null || b == null) {
+ return a === b;
+ }
+ //接下来判断a和b的数据类型
+ var classNameA = toString.call(a),
+ classNameB = toString.call(b);
+ //如果数据类型不相等,则返回false
+ if (classNameA !== classNameB) {
+ return false;
+ }
+ //如果数据类型相等,再根据不同数据类型分别判断
+ switch (classNameA) {
+ case '[object RegExp]':
+ case '[object String]':
+ //进行字符串转换比较
+ return '' + a === '' + b;
+ case '[object Number]':
+ //进行数字转换比较,判断是否为NaN
+ if (+a !== +a) {
+ return +b !== +b;
+ }
+ //判断是否为0或-0
+ return +a === 0 ? 1 / +a === 1 / b : +a === +b;
+ case '[object Date]':
+ case '[object Boolean]':
+ return +a === +b;
+ }
+ //如果是对象类型
+ if (classNameA == '[object Object]') {
+ //获取a和b的属性长度
+ var propsA = Object.getOwnPropertyNames(a),
+ propsB = Object.getOwnPropertyNames(b);
+ if (propsA.length != propsB.length) {
+ return false;
+ }
+ for (var i = 0; i < propsA.length; i++) {
+ var propName = propsA[i];
+ //如果对应属性对应值不相等,则返回false
+ if (a[propName] !== b[propName]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ //如果是数组类型
+ if (classNameA == '[object Array]') {
+ if (a.toString() == b.toString()) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json
index dfa7af4c459063564c2ad3942a96a79503e6a905..e3736c45357f4a5f8061a1d0aeea79e89c7f6a1e 100644
--- a/uni_modules/uni-forms/package.json
+++ b/uni_modules/uni-forms/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-forms",
"displayName": "uni-forms 表单",
- "version": "1.3.2",
+ "version": "1.4.8",
"description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
"keywords": [
"uni-ui",
@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
+"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
},
"uni_modules": {
"dependencies": [
@@ -74,7 +71,8 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
- "QQ": "y"
+ "QQ": "y",
+ "京东": "u"
},
"快应用": {
"华为": "u",
diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md
index 29cbb7d574d54f882ad197e4a71b16793e344c16..d19b8ef5168d54636d5e828300b93b1baa341f4b 100644
--- a/uni_modules/uni-id-pages/changelog.md
+++ b/uni_modules/uni-id-pages/changelog.md
@@ -1,3 +1,5 @@
+## 1.0.19(2022-09-20)
+- 修复 小程序端,使用将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)的uni-ui组件,样式错乱的问题
## 1.0.18(2022-09-20)
- 修复 微信小程序端 WXSS 编译报错的bug
## 1.0.17(2022.09-19)
diff --git a/uni_modules/uni-id-pages/common/login-page.scss b/uni_modules/uni-id-pages/common/login-page.scss
index 2bd6c9e16725040bcea28713be6134f60ae09e75..9a2fc3b348d8f96cb2ab873d7418108b92a02b94 100644
--- a/uni_modules/uni-id-pages/common/login-page.scss
+++ b/uni_modules/uni-id-pages/common/login-page.scss
@@ -79,17 +79,23 @@
font-size: 11px;
margin: 6px 0;
}
+
+
+/* #ifdef MP */
+// 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98)
+.uni-content ::v-deep .uni-easyinput__content,
+/* #endif */
.input-box {
padding: 4px;
- background-color: #F8F8F8;
+ background-color: #F8F8F8 !important;
border-radius: 0;
font-size: 14px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
-}
+}
.link {
color: #04498c;
diff --git a/uni_modules/uni-id-pages/package-lock.json b/uni_modules/uni-id-pages/package-lock.json
index a4c0c59c76a41c35f82d7099256705ef7fb5ae32..02e97b734518ac49de3c2ae6c4d9d46f1973dd70 100644
--- a/uni_modules/uni-id-pages/package-lock.json
+++ b/uni_modules/uni-id-pages/package-lock.json
@@ -1,11 +1,11 @@
{
"name": "uni-id-pages",
- "version": "1.0.7",
+ "version": "1.0.19",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "version": "1.0.7",
+ "version": "1.0.19",
"dependencies": {
"jweixin-module": "^1.6.0"
},
diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json
index 5d99182adb1d6349258eb0d2ccbf321977cc97d5..a6aaae11245a774c777dc364a6d417ffc677f25c 100644
--- a/uni_modules/uni-id-pages/package.json
+++ b/uni_modules/uni-id-pages/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
- "version": "1.0.18",
+ "version": "1.0.19",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
index b58f78fa0386774acd35c8f503e2f0a2205b91cb..234cae15c15a1b258f3c8f3e4cef7869ad3d63cd 100644
--- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
@@ -169,7 +169,11 @@
left: 3px;
position: relative;
}
-
+
+ /* #ifdef MP */
+ // 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98)
+ .phone-box ::v-deep .uni-easyinput__content,
+ /* #endif */
.input-box {
/* #ifndef APP-NVUE */
box-sizing: border-box;
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package-lock.json b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package-lock.json
index 98ba096445790817e26b630a81bfc9af68de74de..a26cc97a4044bfe0d5813d1739d48e5b41ebfca0 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package-lock.json
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "uni-id-co",
- "version": "1.0.18",
+ "version": "1.0.19",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "uni-id-co",
- "version": "1.0.12",
+ "version": "1.0.19",
"dependencies": {
"jsonwebtoken": "8.5.1",
"lodash.merge": "^4.6.2",
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
index 9c14d305011ced78449b4ede5f42e1547b640885..6cdd385979248855baa5462fcf15571e8c3d77dd 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
@@ -1,6 +1,6 @@
{
"name": "uni-id-co",
- "version": "1.0.18",
+ "version": "1.0.19",
"description": "",
"main": "index.js",
"keywords": [],
diff --git a/uni_modules/uni-list/changelog.md b/uni_modules/uni-list/changelog.md
index b86237ea334ae2de12a3902c189c15840fe84d8b..6aa6e4e0028e0a51f0b0ca9c29912fa70a8a1315 100644
--- a/uni_modules/uni-list/changelog.md
+++ b/uni_modules/uni-list/changelog.md
@@ -1,18 +1,20 @@
+## 1.2.1(2022-03-30)
+- 删除无用文件
## 1.2.0(2021-11-23)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-list](https://uniapp.dcloud.io/component/uniui/uni-list)
-## 1.1.3(2021-08-30)
-- 修复 在vue3中to属性在发行应用的时候报错的bug
-## 1.1.2(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 1.1.1(2021-07-21)
-- 修复 与其他组件嵌套使用时,点击失效的Bug
-## 1.1.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.0.17(2021-05-12)
-- 新增 组件示例地址
-## 1.0.16(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-## 1.0.15(2021-02-05)
-- 调整为uni_modules目录规范
-- 修复 uni-list-chat 角标显示不正常的问题
+## 1.1.3(2021-08-30)
+- 修复 在vue3中to属性在发行应用的时候报错的bug
+## 1.1.2(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 1.1.1(2021-07-21)
+- 修复 与其他组件嵌套使用时,点击失效的Bug
+## 1.1.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.17(2021-05-12)
+- 新增 组件示例地址
+## 1.0.16(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.0.15(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 uni-list-chat 角标显示不正常的问题
diff --git a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
index 553dea2cc0a33e3ec09823b6e2a64a21b615ebea..d145b5498febefe29d34fee987d7bd3122a0e6d8 100644
--- a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
+++ b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue
@@ -69,7 +69,7 @@
}
-
+
diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
index a56c8be7b28c782bd44d5a3621d345b620c5121b..04e56b82f9902b0a23740e69d93e46133cc5ea7a 100644
--- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
+++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
@@ -7,7 +7,7 @@