From ff1eec09f6d96528b70f080769ddf98884ecc33b Mon Sep 17 00:00:00 2001
From: jiangzewen <2834322062@qq.com>
Date: Wed, 11 Jun 2025 08:27:38 +0800
Subject: [PATCH] 11
---
.env | 64 +-
uni_modules/uni-forms/changelog.md | 120 +-
.../uni-forms-item/uni-forms-item.vue | 1072 ++++----
.../components/uni-forms/uni-forms.vue | 944 +++----
.../components/uni-forms/validate.js | 972 +++----
uni_modules/uni-forms/package.json | 180 +-
uni_modules/uni-forms/readme.md | 44 +-
uni_modules/uni-goods-nav/changelog.md | 36 +-
.../components/uni-goods-nav/i18n/en.json | 12 +-
.../components/uni-goods-nav/i18n/index.js | 16 +-
.../uni-goods-nav/i18n/zh-Hans.json | 12 +-
.../uni-goods-nav/i18n/zh-Hant.json | 12 +-
.../uni-goods-nav/uni-goods-nav.vue | 458 ++--
uni_modules/uni-goods-nav/package.json | 176 +-
uni_modules/uni-goods-nav/readme.md | 18 +-
uni_modules/uni-grid/changelog.md | 26 +-
.../uni-grid-item/uni-grid-item.vue | 280 +-
.../uni-grid/components/uni-grid/uni-grid.vue | 284 +-
uni_modules/uni-grid/package.json | 172 +-
uni_modules/uni-grid/readme.md | 20 +-
uni_modules/uni-group/changelog.md | 32 +-
.../components/uni-group/uni-group.vue | 268 +-
uni_modules/uni-group/package.json | 172 +-
uni_modules/uni-group/readme.md | 16 +-
uni_modules/uni-icons/changelog.md | 44 +-
.../uni-icons/components/uni-icons/icons.js | 2338 ++++++++---------
.../components/uni-icons/uni-icons.vue | 192 +-
.../components/uni-icons/uniicons.css | 1326 +++++-----
uni_modules/uni-icons/package.json | 170 +-
uni_modules/uni-icons/readme.md | 16 +-
uni_modules/uni-link/changelog.md | 34 +-
.../uni-link/components/uni-link/uni-link.vue | 256 +-
uni_modules/uni-link/package.json | 172 +-
uni_modules/uni-link/readme.md | 20 +-
uni_modules/uni-list/changelog.md | 40 +-
.../components/uni-list-ad/uni-list-ad.vue | 214 +-
.../uni-list-chat/uni-list-chat.scss | 116 +-
.../uni-list-chat/uni-list-chat.vue | 1076 ++++----
.../uni-list-item/uni-list-item.vue | 946 +++----
.../uni-list/components/uni-list/uni-list.vue | 216 +-
.../components/uni-list/uni-refresh.vue | 130 +-
.../components/uni-list/uni-refresh.wxs | 174 +-
uni_modules/uni-list/package.json | 180 +-
uni_modules/uni-list/readme.md | 690 ++---
uni_modules/uni-load-more/changelog.md | 38 +-
.../components/uni-load-more/i18n/en.json | 10 +-
.../components/uni-load-more/i18n/index.js | 16 +-
.../uni-load-more/i18n/zh-Hans.json | 10 +-
.../uni-load-more/i18n/zh-Hant.json | 10 +-
.../uni-load-more/uni-load-more.vue | 798 +++---
uni_modules/uni-load-more/package.json | 170 +-
uni_modules/uni-load-more/readme.md | 28 +-
uni_modules/uni-nav-bar/changelog.md | 78 +-
.../components/uni-nav-bar/uni-nav-bar.vue | 696 ++---
.../components/uni-nav-bar/uni-status-bar.vue | 54 +-
uni_modules/uni-nav-bar/package.json | 176 +-
uni_modules/uni-nav-bar/readme.md | 30 +-
uni_modules/uni-notice-bar/changelog.md | 32 +-
.../uni-notice-bar/uni-notice-bar.vue | 790 +++---
uni_modules/uni-notice-bar/package.json | 180 +-
uni_modules/uni-notice-bar/readme.md | 26 +-
uni_modules/uni-number-box/changelog.md | 50 +-
.../uni-number-box/uni-number-box.vue | 440 ++--
uni_modules/uni-number-box/package.json | 168 +-
uni_modules/uni-number-box/readme.md | 26 +-
uni_modules/uni-rate/changelog.md | 50 +-
.../uni-rate/components/uni-rate/uni-rate.vue | 722 ++---
uni_modules/uni-rate/package.json | 176 +-
uni_modules/uni-rate/readme.md | 22 +-
uni_modules/uni-row/changelog.md | 20 +-
.../uni-row/components/uni-col/uni-col.vue | 634 ++---
.../uni-row/components/uni-row/uni-row.vue | 380 +--
uni_modules/uni-row/package.json | 172 +-
uni_modules/uni-row/readme.md | 18 +-
uni_modules/uni-scss/changelog.md | 16 +-
uni_modules/uni-scss/index.scss | 2 +-
uni_modules/uni-scss/manifest.json | 190 +-
uni_modules/uni-scss/package.json | 164 +-
uni_modules/uni-scss/readme.md | 6 +-
uni_modules/uni-scss/styles/index.scss | 14 +-
.../uni-scss/styles/setting/_border.scss | 4 +-
.../uni-scss/styles/setting/_color.scss | 132 +-
.../uni-scss/styles/setting/_radius.scss | 110 +-
.../uni-scss/styles/setting/_space.scss | 110 +-
.../uni-scss/styles/setting/_styles.scss | 334 +--
.../uni-scss/styles/setting/_text.scss | 48 +-
.../uni-scss/styles/setting/_variables.scss | 292 +-
.../uni-scss/styles/tools/functions.scss | 38 +-
uni_modules/uni-scss/theme.scss | 62 +-
uni_modules/uni-scss/variables.scss | 124 +-
uni_modules/uni-search-bar/changelog.md | 66 +-
.../components/uni-search-bar/i18n/en.json | 6 +-
.../components/uni-search-bar/i18n/index.js | 16 +-
.../uni-search-bar/i18n/zh-Hans.json | 8 +-
.../uni-search-bar/i18n/zh-Hant.json | 8 +-
.../uni-search-bar/uni-search-bar.vue | 596 ++---
uni_modules/uni-search-bar/package.json | 176 +-
uni_modules/uni-search-bar/readme.md | 28 +-
.../uni-segmented-control/changelog.md | 18 +-
.../uni-segmented-control.vue | 290 +-
.../uni-segmented-control/package.json | 172 +-
uni_modules/uni-segmented-control/readme.md | 26 +-
uni_modules/uni-steps/changelog.md | 32 +-
.../components/uni-steps/uni-steps.vue | 538 ++--
uni_modules/uni-steps/package.json | 176 +-
uni_modules/uni-steps/readme.md | 26 +-
uni_modules/uni-swiper-dot/changelog.md | 24 +-
.../uni-swiper-dot/uni-swiper-dot.vue | 436 +--
uni_modules/uni-swiper-dot/package.json | 172 +-
uni_modules/uni-swiper-dot/readme.md | 20 +-
uni_modules/uni-tag/changelog.md | 42 +-
.../uni-tag/components/uni-tag/uni-tag.vue | 504 ++--
uni_modules/uni-tag/package.json | 172 +-
uni_modules/uni-tag/readme.md | 26 +-
uni_modules/uni-title/changelog.md | 20 +-
.../components/uni-title/uni-title.vue | 342 +--
uni_modules/uni-title/package.json | 174 +-
uni_modules/uni-title/readme.md | 28 +-
uni_modules/uni-tooltip/changelog.md | 20 +-
.../components/uni-tooltip/uni-tooltip.vue | 136 +-
uni_modules/uni-tooltip/package.json | 164 +-
uni_modules/uni-tooltip/readme.md | 16 +-
uni_modules/uni-transition/changelog.md | 40 +-
.../uni-transition/createAnimation.js | 256 +-
.../uni-transition/uni-transition.vue | 598 ++---
uni_modules/uni-transition/package.json | 172 +-
uni_modules/uni-transition/readme.md | 20 +-
uni_modules/z-paging/changelog.md | 148 +-
.../z-paging-cell/z-paging-cell.vue | 78 +-
.../z-paging-empty-view.vue | 378 +--
.../z-paging-swiper-item.vue | 286 +-
.../z-paging-swiper/z-paging-swiper.vue | 334 +--
.../components/z-paging-load-more.vue | 356 +--
.../z-paging/components/z-paging-refresh.vue | 416 +--
.../components/z-paging/config/index.js | 4 +-
.../components/z-paging/css/z-paging-main.css | 474 ++--
.../z-paging/css/z-paging-static.css | 100 +-
.../z-paging/components/z-paging/i18n/en.json | 46 +-
.../components/z-paging/i18n/index.js | 16 +-
.../components/z-paging/i18n/zh-Hans.json | 46 +-
.../components/z-paging/i18n/zh-Hant.json | 46 +-
.../z-paging/js/hooks/useZPaging.js | 48 +-
.../z-paging/js/hooks/useZPagingComp.js | 48 +-
.../z-paging/js/modules/back-to-top.js | 250 +-
.../z-paging/js/modules/chat-record-mode.js | 298 +--
.../z-paging/js/modules/common-layout.js | 282 +-
.../z-paging/js/modules/data-handle.js | 1476 +++++------
.../components/z-paging/js/modules/empty.js | 286 +-
.../components/z-paging/js/modules/i18n.js | 238 +-
.../z-paging/js/modules/load-more.js | 740 +++---
.../components/z-paging/js/modules/loading.js | 190 +-
.../components/z-paging/js/modules/nvue.js | 510 ++--
.../z-paging/js/modules/refresher.js | 1648 ++++++------
.../z-paging/js/modules/scroller.js | 1036 ++++----
.../z-paging/js/modules/virtual-list.js | 1024 ++++----
.../z-paging/js/z-paging-constant.js | 38 +-
.../components/z-paging/js/z-paging-enum.js | 88 +-
.../z-paging/js/z-paging-interceptor.js | 194 +-
.../components/z-paging/js/z-paging-main.js | 1006 +++----
.../components/z-paging/js/z-paging-mixin.js | 44 +-
.../components/z-paging/js/z-paging-static.js | 26 +-
.../components/z-paging/js/z-paging-utils.js | 540 ++--
.../z-paging/wxs/z-paging-renderjs.js | 134 +-
.../components/z-paging/wxs/z-paging-wxs.wxs | 764 +++---
.../z-paging/components/z-paging/z-paging.vue | 690 ++---
uni_modules/z-paging/global.d.ts | 1446 +++++-----
uni_modules/z-paging/package.json | 174 +-
uni_modules/z-paging/readme.md | 110 +-
vite.config.js | 68 +-
169 files changed, 21555 insertions(+), 21555 deletions(-)
diff --git a/.env b/.env
index 7de40fe6..2985746e 100644
--- a/.env
+++ b/.env
@@ -1,32 +1,32 @@
-# 版本号
-SHOPRO_VERSION=v2.4.1
-
-# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development)
-SHOPRO_BASE_URL=https://zjxshopapi.zianxin.com
-# http://api-dashboard.yudao.iocoder.cn
-
-# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development)
-SHOPRO_DEV_BASE_URL=https://zjxshopapi.zianxin.com
-### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
-
-# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
-SHOPRO_UPLOAD_TYPE=server
-
-# 后端接口前缀(一般不建议调整)
-SHOPRO_API_PATH=/app-api
-
-# 后端 websocket 接口前缀
-SHOPRO_WEBSOCKET_PATH=/infra/ws
-
-# 开发环境运行端口
-SHOPRO_DEV_PORT=3000
-
-# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
-### SHOPRO_STATIC_URL=http://test.yudao.iocoder.cn
- SHOPRO_STATIC_URL = https://file.sheepjs.com
-
-# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
-SHOPRO_MPLIVE_ON=0
-
-# 租户ID 默认 1
-SHOPRO_TENANT_ID=1
+# 版本号
+SHOPRO_VERSION=v2.4.1
+
+# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development)
+SHOPRO_BASE_URL=https://symy.asset-cloud.com.cn
+# http://api-dashboard.yudao.iocoder.cn
+
+# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development)
+SHOPRO_DEV_BASE_URL=https://symy.asset-cloud.com.cn
+### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
+
+# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
+SHOPRO_UPLOAD_TYPE=server
+
+# 后端接口前缀(一般不建议调整)
+SHOPRO_API_PATH=/app-api
+
+# 后端 websocket 接口前缀
+SHOPRO_WEBSOCKET_PATH=/infra/ws
+
+# 开发环境运行端口
+SHOPRO_DEV_PORT=3000
+
+# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
+### SHOPRO_STATIC_URL=http://test.yudao.iocoder.cn
+ SHOPRO_STATIC_URL = https://file.sheepjs.com
+
+# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
+SHOPRO_MPLIVE_ON=0
+
+# 租户ID 默认 1
+SHOPRO_TENANT_ID=1
diff --git a/uni_modules/uni-forms/changelog.md b/uni_modules/uni-forms/changelog.md
index 26e120b5..a007da69 100644
--- a/uni_modules/uni-forms/changelog.md
+++ b/uni_modules/uni-forms/changelog.md
@@ -1,60 +1,60 @@
-## 1.3.2(2021-12-09)
--
-## 1.3.1(2021-11-19)
-- 修复 label 插槽不生效的bug
-## 1.3.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-forms](https://uniapp.dcloud.io/component/uniui/uni-forms)
-## 1.2.7(2021-08-13)
-- 修复 没有添加校验规则的字段依然报错的Bug
-## 1.2.6(2021-08-11)
-- 修复 重置表单错误信息无法清除的问题
-## 1.2.5(2021-08-11)
-- 优化 组件文档
-## 1.2.4(2021-08-11)
-- 修复 表单验证只生效一次的问题
-## 1.2.3(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 1.2.2(2021-07-26)
-- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug
-- 修复 1.2.1 引起的示例在小程序平台报错的Bug
-## 1.2.1(2021-07-22)
-- 修复 动态校验表单,默认值为空的情况下校验失效的Bug
-- 修复 不指定name属性时,运行报错的Bug
-- 优化 label默认宽度从65调整至70,使required为true且四字时不换行
-- 优化 组件示例,新增动态校验示例代码
-- 优化 组件文档,使用方式更清晰
-## 1.2.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.1.2(2021-06-25)
-- 修复 pattern 属性在微信小程序平台无效的问题
-## 1.1.1(2021-06-22)
-- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug
-## 1.1.0(2021-06-22)
-- 修复 只写setRules方法而导致校验不生效的Bug
-- 修复 由上个办法引发的错误提示文字错位的Bug
-## 1.0.48(2021-06-21)
-- 修复 不设置 label 属性 ,无法设置label插槽的问题
-## 1.0.47(2021-06-21)
-- 修复 不设置label属性,label-width属性不生效的bug
-- 修复 setRules 方法与rules属性冲突的问题
-## 1.0.46(2021-06-04)
-- 修复 动态删减数据导致报错的问题
-## 1.0.45(2021-06-04)
-- 新增 modelValue 属性 ,value 即将废弃
-## 1.0.44(2021-06-02)
-- 新增 uni-forms-item 可以设置单独的 rules
-- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤
-- 优化 submit 事件重命名为 validate
-## 1.0.43(2021-05-12)
-- 新增 组件示例地址
-## 1.0.42(2021-04-30)
-- 修复 自定义检验器失效的问题
-## 1.0.41(2021-03-05)
-- 更新 校验器
-- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
-## 1.0.40(2021-03-04)
-- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
-## 1.0.39(2021-02-05)
-- 调整为uni_modules目录规范
-- 修复 校验器传入 int 等类型 ,返回String类型的Bug
+## 1.3.2(2021-12-09)
+-
+## 1.3.1(2021-11-19)
+- 修复 label 插槽不生效的bug
+## 1.3.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-forms](https://uniapp.dcloud.io/component/uniui/uni-forms)
+## 1.2.7(2021-08-13)
+- 修复 没有添加校验规则的字段依然报错的Bug
+## 1.2.6(2021-08-11)
+- 修复 重置表单错误信息无法清除的问题
+## 1.2.5(2021-08-11)
+- 优化 组件文档
+## 1.2.4(2021-08-11)
+- 修复 表单验证只生效一次的问题
+## 1.2.3(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 1.2.2(2021-07-26)
+- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug
+- 修复 1.2.1 引起的示例在小程序平台报错的Bug
+## 1.2.1(2021-07-22)
+- 修复 动态校验表单,默认值为空的情况下校验失效的Bug
+- 修复 不指定name属性时,运行报错的Bug
+- 优化 label默认宽度从65调整至70,使required为true且四字时不换行
+- 优化 组件示例,新增动态校验示例代码
+- 优化 组件文档,使用方式更清晰
+## 1.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.2(2021-06-25)
+- 修复 pattern 属性在微信小程序平台无效的问题
+## 1.1.1(2021-06-22)
+- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug
+## 1.1.0(2021-06-22)
+- 修复 只写setRules方法而导致校验不生效的Bug
+- 修复 由上个办法引发的错误提示文字错位的Bug
+## 1.0.48(2021-06-21)
+- 修复 不设置 label 属性 ,无法设置label插槽的问题
+## 1.0.47(2021-06-21)
+- 修复 不设置label属性,label-width属性不生效的bug
+- 修复 setRules 方法与rules属性冲突的问题
+## 1.0.46(2021-06-04)
+- 修复 动态删减数据导致报错的问题
+## 1.0.45(2021-06-04)
+- 新增 modelValue 属性 ,value 即将废弃
+## 1.0.44(2021-06-02)
+- 新增 uni-forms-item 可以设置单独的 rules
+- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤
+- 优化 submit 事件重命名为 validate
+## 1.0.43(2021-05-12)
+- 新增 组件示例地址
+## 1.0.42(2021-04-30)
+- 修复 自定义检验器失效的问题
+## 1.0.41(2021-03-05)
+- 更新 校验器
+- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
+## 1.0.40(2021-03-04)
+- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug
+## 1.0.39(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 校验器传入 int 等类型 ,返回String类型的Bug
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 184122a9..faea081a 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,536 +1,536 @@
-
-
-
-
-
-
-
- *
-
- {{ label }}
-
-
-
-
-
-
-
- {{ showMsg === 'undertext' ? msg : '' }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ *
+
+ {{ label }}
+
+
+
+
+
+
+
+ {{ showMsg === 'undertext' ? 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 d8b4e66b..dff823bb 100644
--- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
@@ -1,472 +1,472 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-forms/components/uni-forms/validate.js b/uni_modules/uni-forms/components/uni-forms/validate.js
index 1834c6cf..e631fb23 100644
--- a/uni_modules/uni-forms/components/uni-forms/validate.js
+++ b/uni_modules/uni-forms/components/uni-forms/validate.js
@@ -1,486 +1,486 @@
-var pattern = {
- email: /^\S+?@\S+?\.\S+?$/,
- idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
- url: new RegExp(
- "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
- 'i')
-};
-
-const FORMAT_MAPPING = {
- "int": 'integer',
- "bool": 'boolean',
- "double": 'number',
- "long": 'number',
- "password": 'string'
- // "fileurls": 'array'
-}
-
-function formatMessage(args, resources = '') {
- var defaultMessage = ['label']
- defaultMessage.forEach((item) => {
- if (args[item] === undefined) {
- args[item] = ''
- }
- })
-
- let str = resources
- for (let key in args) {
- let reg = new RegExp('{' + key + '}')
- str = str.replace(reg, args[key])
- }
- return str
-}
-
-function isEmptyValue(value, type) {
- if (value === undefined || value === null) {
- return true;
- }
-
- if (typeof value === 'string' && !value) {
- return true;
- }
-
- if (Array.isArray(value) && !value.length) {
- return true;
- }
-
- if (type === 'object' && !Object.keys(value).length) {
- return true;
- }
-
- return false;
-}
-
-const types = {
- integer(value) {
- return types.number(value) && parseInt(value, 10) === value;
- },
- string(value) {
- return typeof value === 'string';
- },
- number(value) {
- if (isNaN(value)) {
- return false;
- }
- return typeof value === 'number';
- },
- "boolean": function(value) {
- return typeof value === 'boolean';
- },
- "float": function(value) {
- return types.number(value) && !types.integer(value);
- },
- array(value) {
- return Array.isArray(value);
- },
- object(value) {
- return typeof value === 'object' && !types.array(value);
- },
- date(value) {
- return value instanceof Date;
- },
- timestamp(value) {
- if (!this.integer(value) || Math.abs(value).toString().length > 16) {
- return false
- }
- return true;
- },
- file(value) {
- return typeof value.url === 'string';
- },
- email(value) {
- return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
- },
- url(value) {
- return typeof value === 'string' && !!value.match(pattern.url);
- },
- pattern(reg, value) {
- try {
- return new RegExp(reg).test(value);
- } catch (e) {
- return false;
- }
- },
- method(value) {
- return typeof value === 'function';
- },
- idcard(value) {
- return typeof value === 'string' && !!value.match(pattern.idcard);
- },
- 'url-https'(value) {
- return this.url(value) && value.startsWith('https://');
- },
- 'url-scheme'(value) {
- return value.startsWith('://');
- },
- 'url-web'(value) {
- return false;
- }
-}
-
-class RuleValidator {
-
- constructor(message) {
- this._message = message
- }
-
- async validateRule(fieldKey, fieldValue, value, data, allData) {
- var result = null
-
- let rules = fieldValue.rules
-
- let hasRequired = rules.findIndex((item) => {
- return item.required
- })
- if (hasRequired < 0) {
- if (value === null || value === undefined) {
- return result
- }
- if (typeof value === 'string' && !value.length) {
- return result
- }
- }
-
- var message = this._message
-
- if (rules === undefined) {
- return message['default']
- }
-
- for (var i = 0; i < rules.length; i++) {
- let rule = rules[i]
- let vt = this._getValidateType(rule)
-
- Object.assign(rule, {
- label: fieldValue.label || `["${fieldKey}"]`
- })
-
- if (RuleValidatorHelper[vt]) {
- result = RuleValidatorHelper[vt](rule, value, message)
- if (result != null) {
- break
- }
- }
-
- if (rule.validateExpr) {
- let now = Date.now()
- let resultExpr = rule.validateExpr(value, allData, now)
- if (resultExpr === false) {
- result = this._getMessage(rule, rule.errorMessage || this._message['default'])
- break
- }
- }
-
- if (rule.validateFunction) {
- result = await this.validateFunction(rule, value, data, allData, vt)
- if (result !== null) {
- break
- }
- }
- }
-
- if (result !== null) {
- result = message.TAG + result
- }
-
- return result
- }
-
- async validateFunction(rule, value, data, allData, vt) {
- let result = null
- try {
- let callbackMessage = null
- const res = await rule.validateFunction(rule, value, allData || data, (message) => {
- callbackMessage = message
- })
- if (callbackMessage || (typeof res === 'string' && res) || res === false) {
- result = this._getMessage(rule, callbackMessage || res, vt)
- }
- } catch (e) {
- result = this._getMessage(rule, e.message, vt)
- }
- return result
- }
-
- _getMessage(rule, message, vt) {
- return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default'])
- }
-
- _getValidateType(rule) {
- var result = ''
- if (rule.required) {
- result = 'required'
- } else if (rule.format) {
- result = 'format'
- } else if (rule.arrayType) {
- result = 'arrayTypeFormat'
- } else if (rule.range) {
- result = 'range'
- } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
- result = 'rangeNumber'
- } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
- result = 'rangeLength'
- } else if (rule.pattern) {
- result = 'pattern'
- } else if (rule.validateFunction) {
- result = 'validateFunction'
- }
- return result
- }
-}
-
-const RuleValidatorHelper = {
- required(rule, value, message) {
- if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
- return formatMessage(rule, rule.errorMessage || message.required);
- }
-
- return null
- },
-
- range(rule, value, message) {
- const {
- range,
- errorMessage
- } = rule;
-
- let list = new Array(range.length);
- for (let i = 0; i < range.length; i++) {
- const item = range[i];
- if (types.object(item) && item.value !== undefined) {
- list[i] = item.value;
- } else {
- list[i] = item;
- }
- }
-
- let result = false
- if (Array.isArray(value)) {
- result = (new Set(value.concat(list)).size === list.length);
- } else {
- if (list.indexOf(value) > -1) {
- result = true;
- }
- }
-
- if (!result) {
- return formatMessage(rule, errorMessage || message['enum']);
- }
-
- return null
- },
-
- rangeNumber(rule, value, message) {
- if (!types.number(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- let {
- minimum,
- maximum,
- exclusiveMinimum,
- exclusiveMaximum
- } = rule;
- let min = exclusiveMinimum ? value <= minimum : value < minimum;
- let max = exclusiveMaximum ? value >= maximum : value > maximum;
-
- if (minimum !== undefined && min) {
- return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
- 'exclusiveMinimum' : 'minimum'
- ])
- } else if (maximum !== undefined && max) {
- return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
- 'exclusiveMaximum' : 'maximum'
- ])
- } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
- return formatMessage(rule, rule.errorMessage || message['number'].range)
- }
-
- return null
- },
-
- rangeLength(rule, value, message) {
- if (!types.string(value) && !types.array(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- let min = rule.minLength;
- let max = rule.maxLength;
- let val = value.length;
-
- if (min !== undefined && val < min) {
- return formatMessage(rule, rule.errorMessage || message['length'].minLength)
- } else if (max !== undefined && val > max) {
- return formatMessage(rule, rule.errorMessage || message['length'].maxLength)
- } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
- return formatMessage(rule, rule.errorMessage || message['length'].range)
- }
-
- return null
- },
-
- pattern(rule, value, message) {
- if (!types['pattern'](rule.pattern, value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
-
- return null
- },
-
- format(rule, value, message) {
- var customTypes = Object.keys(types);
- var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : (rule.format || rule.arrayType);
-
- if (customTypes.indexOf(format) > -1) {
- if (!types[format](value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
- }
-
- return null
- },
-
- arrayTypeFormat(rule, value, message) {
- if (!Array.isArray(value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
-
- for (let i = 0; i < value.length; i++) {
- const element = value[i];
- let formatResult = this.format(rule, element, message)
- if (formatResult !== null) {
- return formatResult
- }
- }
-
- return null
- }
-}
-
-class SchemaValidator extends RuleValidator {
-
- constructor(schema, options) {
- super(SchemaValidator.message);
-
- this._schema = schema
- this._options = options || null
- }
-
- updateSchema(schema) {
- this._schema = schema
- }
-
- async validate(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidate(data, false, allData)
- }
- return result.length ? result[0] : null
- }
-
- async validateAll(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidate(data, true, allData)
- }
- return result
- }
-
- async validateUpdate(data, allData) {
- let result = this._checkFieldInSchema(data)
- if (!result) {
- result = await this.invokeValidateUpdate(data, false, allData)
- }
- return result.length ? result[0] : null
- }
-
- async invokeValidate(data, all, allData) {
- let result = []
- let schema = this._schema
- for (let key in schema) {
- let value = schema[key]
- let errorMessage = await this.validateRule(key, value, data[key], data, allData)
- if (errorMessage != null) {
- result.push({
- key,
- errorMessage
- })
- if (!all) break
- }
- }
- return result
- }
-
- async invokeValidateUpdate(data, all, allData) {
- let result = []
- for (let key in data) {
- let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData)
- if (errorMessage != null) {
- result.push({
- key,
- errorMessage
- })
- if (!all) break
- }
- }
- return result
- }
-
- _checkFieldInSchema(data) {
- var keys = Object.keys(data)
- var keys2 = Object.keys(this._schema)
- if (new Set(keys.concat(keys2)).size === keys2.length) {
- return ''
- }
-
- var noExistFields = keys.filter((key) => {
- return keys2.indexOf(key) < 0;
- })
- var errorMessage = formatMessage({
- field: JSON.stringify(noExistFields)
- }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid'])
- return [{
- key: 'invalid',
- errorMessage
- }]
- }
-}
-
-function Message() {
- return {
- TAG: "",
- default: '验证错误',
- defaultInvalid: '提交的字段{field}在数据库中并不存在',
- validateFunction: '验证无效',
- required: '{label}必填',
- 'enum': '{label}超出范围',
- timestamp: '{label}格式无效',
- whitespace: '{label}不能为空',
- typeError: '{label}类型无效',
- date: {
- format: '{label}日期{value}格式无效',
- parse: '{label}日期无法解析,{value}无效',
- invalid: '{label}日期{value}无效'
- },
- length: {
- minLength: '{label}长度不能少于{minLength}',
- maxLength: '{label}长度不能超过{maxLength}',
- range: '{label}必须介于{minLength}和{maxLength}之间'
- },
- number: {
- minimum: '{label}不能小于{minimum}',
- maximum: '{label}不能大于{maximum}',
- exclusiveMinimum: '{label}不能小于等于{minimum}',
- exclusiveMaximum: '{label}不能大于等于{maximum}',
- range: '{label}必须介于{minimum}and{maximum}之间'
- },
- pattern: {
- mismatch: '{label}格式不匹配'
- }
- };
-}
-
-
-SchemaValidator.message = new Message();
-
-export default SchemaValidator
+var pattern = {
+ email: /^\S+?@\S+?\.\S+?$/,
+ idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
+ url: new RegExp(
+ "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
+ 'i')
+};
+
+const FORMAT_MAPPING = {
+ "int": 'integer',
+ "bool": 'boolean',
+ "double": 'number',
+ "long": 'number',
+ "password": 'string'
+ // "fileurls": 'array'
+}
+
+function formatMessage(args, resources = '') {
+ var defaultMessage = ['label']
+ defaultMessage.forEach((item) => {
+ if (args[item] === undefined) {
+ args[item] = ''
+ }
+ })
+
+ let str = resources
+ for (let key in args) {
+ let reg = new RegExp('{' + key + '}')
+ str = str.replace(reg, args[key])
+ }
+ return str
+}
+
+function isEmptyValue(value, type) {
+ if (value === undefined || value === null) {
+ return true;
+ }
+
+ if (typeof value === 'string' && !value) {
+ return true;
+ }
+
+ if (Array.isArray(value) && !value.length) {
+ return true;
+ }
+
+ if (type === 'object' && !Object.keys(value).length) {
+ return true;
+ }
+
+ return false;
+}
+
+const types = {
+ integer(value) {
+ return types.number(value) && parseInt(value, 10) === value;
+ },
+ string(value) {
+ return typeof value === 'string';
+ },
+ number(value) {
+ if (isNaN(value)) {
+ return false;
+ }
+ return typeof value === 'number';
+ },
+ "boolean": function(value) {
+ return typeof value === 'boolean';
+ },
+ "float": function(value) {
+ return types.number(value) && !types.integer(value);
+ },
+ array(value) {
+ return Array.isArray(value);
+ },
+ object(value) {
+ return typeof value === 'object' && !types.array(value);
+ },
+ date(value) {
+ return value instanceof Date;
+ },
+ timestamp(value) {
+ if (!this.integer(value) || Math.abs(value).toString().length > 16) {
+ return false
+ }
+ return true;
+ },
+ file(value) {
+ return typeof value.url === 'string';
+ },
+ email(value) {
+ return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
+ },
+ url(value) {
+ return typeof value === 'string' && !!value.match(pattern.url);
+ },
+ pattern(reg, value) {
+ try {
+ return new RegExp(reg).test(value);
+ } catch (e) {
+ return false;
+ }
+ },
+ method(value) {
+ return typeof value === 'function';
+ },
+ idcard(value) {
+ return typeof value === 'string' && !!value.match(pattern.idcard);
+ },
+ 'url-https'(value) {
+ return this.url(value) && value.startsWith('https://');
+ },
+ 'url-scheme'(value) {
+ return value.startsWith('://');
+ },
+ 'url-web'(value) {
+ return false;
+ }
+}
+
+class RuleValidator {
+
+ constructor(message) {
+ this._message = message
+ }
+
+ async validateRule(fieldKey, fieldValue, value, data, allData) {
+ var result = null
+
+ let rules = fieldValue.rules
+
+ let hasRequired = rules.findIndex((item) => {
+ return item.required
+ })
+ if (hasRequired < 0) {
+ if (value === null || value === undefined) {
+ return result
+ }
+ if (typeof value === 'string' && !value.length) {
+ return result
+ }
+ }
+
+ var message = this._message
+
+ if (rules === undefined) {
+ return message['default']
+ }
+
+ for (var i = 0; i < rules.length; i++) {
+ let rule = rules[i]
+ let vt = this._getValidateType(rule)
+
+ Object.assign(rule, {
+ label: fieldValue.label || `["${fieldKey}"]`
+ })
+
+ if (RuleValidatorHelper[vt]) {
+ result = RuleValidatorHelper[vt](rule, value, message)
+ if (result != null) {
+ break
+ }
+ }
+
+ if (rule.validateExpr) {
+ let now = Date.now()
+ let resultExpr = rule.validateExpr(value, allData, now)
+ if (resultExpr === false) {
+ result = this._getMessage(rule, rule.errorMessage || this._message['default'])
+ break
+ }
+ }
+
+ if (rule.validateFunction) {
+ result = await this.validateFunction(rule, value, data, allData, vt)
+ if (result !== null) {
+ break
+ }
+ }
+ }
+
+ if (result !== null) {
+ result = message.TAG + result
+ }
+
+ return result
+ }
+
+ async validateFunction(rule, value, data, allData, vt) {
+ let result = null
+ try {
+ let callbackMessage = null
+ const res = await rule.validateFunction(rule, value, allData || data, (message) => {
+ callbackMessage = message
+ })
+ if (callbackMessage || (typeof res === 'string' && res) || res === false) {
+ result = this._getMessage(rule, callbackMessage || res, vt)
+ }
+ } catch (e) {
+ result = this._getMessage(rule, e.message, vt)
+ }
+ return result
+ }
+
+ _getMessage(rule, message, vt) {
+ return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default'])
+ }
+
+ _getValidateType(rule) {
+ var result = ''
+ if (rule.required) {
+ result = 'required'
+ } else if (rule.format) {
+ result = 'format'
+ } else if (rule.arrayType) {
+ result = 'arrayTypeFormat'
+ } else if (rule.range) {
+ result = 'range'
+ } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
+ result = 'rangeNumber'
+ } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
+ result = 'rangeLength'
+ } else if (rule.pattern) {
+ result = 'pattern'
+ } else if (rule.validateFunction) {
+ result = 'validateFunction'
+ }
+ return result
+ }
+}
+
+const RuleValidatorHelper = {
+ required(rule, value, message) {
+ if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
+ return formatMessage(rule, rule.errorMessage || message.required);
+ }
+
+ return null
+ },
+
+ range(rule, value, message) {
+ const {
+ range,
+ errorMessage
+ } = rule;
+
+ let list = new Array(range.length);
+ for (let i = 0; i < range.length; i++) {
+ const item = range[i];
+ if (types.object(item) && item.value !== undefined) {
+ list[i] = item.value;
+ } else {
+ list[i] = item;
+ }
+ }
+
+ let result = false
+ if (Array.isArray(value)) {
+ result = (new Set(value.concat(list)).size === list.length);
+ } else {
+ if (list.indexOf(value) > -1) {
+ result = true;
+ }
+ }
+
+ if (!result) {
+ return formatMessage(rule, errorMessage || message['enum']);
+ }
+
+ return null
+ },
+
+ rangeNumber(rule, value, message) {
+ if (!types.number(value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ let {
+ minimum,
+ maximum,
+ exclusiveMinimum,
+ exclusiveMaximum
+ } = rule;
+ let min = exclusiveMinimum ? value <= minimum : value < minimum;
+ let max = exclusiveMaximum ? value >= maximum : value > maximum;
+
+ if (minimum !== undefined && min) {
+ return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
+ 'exclusiveMinimum' : 'minimum'
+ ])
+ } else if (maximum !== undefined && max) {
+ return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
+ 'exclusiveMaximum' : 'maximum'
+ ])
+ } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
+ return formatMessage(rule, rule.errorMessage || message['number'].range)
+ }
+
+ return null
+ },
+
+ rangeLength(rule, value, message) {
+ if (!types.string(value) && !types.array(value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ let min = rule.minLength;
+ let max = rule.maxLength;
+ let val = value.length;
+
+ if (min !== undefined && val < min) {
+ return formatMessage(rule, rule.errorMessage || message['length'].minLength)
+ } else if (max !== undefined && val > max) {
+ return formatMessage(rule, rule.errorMessage || message['length'].maxLength)
+ } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
+ return formatMessage(rule, rule.errorMessage || message['length'].range)
+ }
+
+ return null
+ },
+
+ pattern(rule, value, message) {
+ if (!types['pattern'](rule.pattern, value)) {
+ return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
+ }
+
+ return null
+ },
+
+ format(rule, value, message) {
+ var customTypes = Object.keys(types);
+ var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : (rule.format || rule.arrayType);
+
+ if (customTypes.indexOf(format) > -1) {
+ if (!types[format](value)) {
+ return formatMessage(rule, rule.errorMessage || message.typeError);
+ }
+ }
+
+ return null
+ },
+
+ arrayTypeFormat(rule, value, message) {
+ if (!Array.isArray(value)) {
+ return formatMessage(rule, rule.errorMessage || message.typeError);
+ }
+
+ for (let i = 0; i < value.length; i++) {
+ const element = value[i];
+ let formatResult = this.format(rule, element, message)
+ if (formatResult !== null) {
+ return formatResult
+ }
+ }
+
+ return null
+ }
+}
+
+class SchemaValidator extends RuleValidator {
+
+ constructor(schema, options) {
+ super(SchemaValidator.message);
+
+ this._schema = schema
+ this._options = options || null
+ }
+
+ updateSchema(schema) {
+ this._schema = schema
+ }
+
+ async validate(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidate(data, false, allData)
+ }
+ return result.length ? result[0] : null
+ }
+
+ async validateAll(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidate(data, true, allData)
+ }
+ return result
+ }
+
+ async validateUpdate(data, allData) {
+ let result = this._checkFieldInSchema(data)
+ if (!result) {
+ result = await this.invokeValidateUpdate(data, false, allData)
+ }
+ return result.length ? result[0] : null
+ }
+
+ async invokeValidate(data, all, allData) {
+ let result = []
+ let schema = this._schema
+ for (let key in schema) {
+ let value = schema[key]
+ let errorMessage = await this.validateRule(key, value, data[key], data, allData)
+ if (errorMessage != null) {
+ result.push({
+ key,
+ errorMessage
+ })
+ if (!all) break
+ }
+ }
+ return result
+ }
+
+ async invokeValidateUpdate(data, all, allData) {
+ let result = []
+ for (let key in data) {
+ let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData)
+ if (errorMessage != null) {
+ result.push({
+ key,
+ errorMessage
+ })
+ if (!all) break
+ }
+ }
+ return result
+ }
+
+ _checkFieldInSchema(data) {
+ var keys = Object.keys(data)
+ var keys2 = Object.keys(this._schema)
+ if (new Set(keys.concat(keys2)).size === keys2.length) {
+ return ''
+ }
+
+ var noExistFields = keys.filter((key) => {
+ return keys2.indexOf(key) < 0;
+ })
+ var errorMessage = formatMessage({
+ field: JSON.stringify(noExistFields)
+ }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid'])
+ return [{
+ key: 'invalid',
+ errorMessage
+ }]
+ }
+}
+
+function Message() {
+ return {
+ TAG: "",
+ default: '验证错误',
+ defaultInvalid: '提交的字段{field}在数据库中并不存在',
+ validateFunction: '验证无效',
+ required: '{label}必填',
+ 'enum': '{label}超出范围',
+ timestamp: '{label}格式无效',
+ whitespace: '{label}不能为空',
+ typeError: '{label}类型无效',
+ date: {
+ format: '{label}日期{value}格式无效',
+ parse: '{label}日期无法解析,{value}无效',
+ invalid: '{label}日期{value}无效'
+ },
+ length: {
+ minLength: '{label}长度不能少于{minLength}',
+ maxLength: '{label}长度不能超过{maxLength}',
+ range: '{label}必须介于{minLength}和{maxLength}之间'
+ },
+ number: {
+ minimum: '{label}不能小于{minimum}',
+ maximum: '{label}不能大于{maximum}',
+ exclusiveMinimum: '{label}不能小于等于{minimum}',
+ exclusiveMaximum: '{label}不能大于等于{maximum}',
+ range: '{label}必须介于{minimum}and{maximum}之间'
+ },
+ pattern: {
+ mismatch: '{label}格式不匹配'
+ }
+ };
+}
+
+
+SchemaValidator.message = new Message();
+
+export default SchemaValidator
diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json
index dfa7af4c..55e6838b 100644
--- a/uni_modules/uni-forms/package.json
+++ b/uni_modules/uni-forms/package.json
@@ -1,90 +1,90 @@
-{
- "id": "uni-forms",
- "displayName": "uni-forms 表单",
- "version": "1.3.2",
- "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
- "keywords": [
- "uni-ui",
- "表单",
- "校验",
- "表单校验",
- "表单验证"
-],
- "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": [
- "uni-scss",
- "uni-icons"
- ],
- "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"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "y"
- }
- }
- }
- }
-}
+{
+ "id": "uni-forms",
+ "displayName": "uni-forms 表单",
+ "version": "1.3.2",
+ "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
+ "keywords": [
+ "uni-ui",
+ "表单",
+ "校验",
+ "表单校验",
+ "表单验证"
+],
+ "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": [
+ "uni-scss",
+ "uni-icons"
+ ],
+ "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"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-forms/readme.md b/uni_modules/uni-forms/readme.md
index 63d5a043..5334701e 100644
--- a/uni_modules/uni-forms/readme.md
+++ b/uni_modules/uni-forms/readme.md
@@ -1,23 +1,23 @@
-
-
-## Forms 表单
-
-> **组件名:uni-forms**
-> 代码块: `uForms`、`uni-forms-item`
-> 关联组件:`uni-forms-item`、`uni-easyinput`、`uni-data-checkbox`、`uni-group`。
-
-
-uni-app的内置组件已经有了 `