diff --git a/pages.json b/pages.json
index eb7384b4dab511b06006e371f773f594699d336a..3e7a9ed0c40f9d0c28c082bed15853598b4e9810 100644
--- a/pages.json
+++ b/pages.json
@@ -67,7 +67,18 @@
"navigationStyle": "custom"
}
}, {
- "path": "pages/ucenter/uni-feedback/uni-feedback",
+ "path": "uni_modules/opendb-feedback/pages/opendb-feedback/list",
+ "style": {
+ "navigationBarTitleText": "反馈列表",
+ "enablePullDownRefresh":true
+ }
+ }, {
+ "path": "uni_modules/opendb-feedback/pages/opendb-feedback/add",
+ "style": {
+ "navigationBarTitleText": "问题反馈"
+ }
+ }, {
+ "path": "uni_modules/opendb-feedback/pages/opendb-feedback/detail",
"style": {
"navigationBarTitleText": "问题反馈"
}
diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue
index 828417b918ddf2741bc17da381538910d5f9ab16..68b92669c8f5f26fb746d06b2f7abb23e4130f14 100644
--- a/pages/ucenter/ucenter.vue
+++ b/pages/ucenter/ucenter.vue
@@ -81,7 +81,7 @@
],
[{
title: '反馈',
- to: '/pages/ucenter/uni-feedback/uni-feedback'
+ to: '/uni_modules/opendb-feedback/pages/opendb-feedback/list' // /pages/ucenter/uni-feedback/uni-feedback uni_modules/opendb-feedback/pages/opendb-feedback/list
}, {
title: '设置',
to: '/pages/ucenter/settings/settings'
diff --git a/pages/ucenter/uni-feedback/uni-feedback.vue b/pages/ucenter/uni-feedback/uni-feedback.vue
deleted file mode 100644
index 7eacbaadfbcc67ccc548bcbb4fccf39fb20c755c..0000000000000000000000000000000000000000
--- a/pages/ucenter/uni-feedback/uni-feedback.vue
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
-
- 问题和意见
- 快速键入
-
-
- 图片(选填,提供问题截图,总大小10M以下)
-
-
-
- 点击预览图片
- {{ imageList.length }}/5
-
-
-
-
-
-
- x
-
-
-
-
-
-
-
-
-
- 联系方式
-
-
- 应用评分
-
-
-
-
-
- 用户反馈的结果可在app打包后于DCloud开发者中心查看
-
-
-
-
-
-
diff --git a/uniCloud-aliyun/database/opendb-feedback.schema.json b/uniCloud-aliyun/database/opendb-feedback.schema.json
deleted file mode 100644
index c3d23928d8861523373f6425a709e023715d244b..0000000000000000000000000000000000000000
--- a/uniCloud-aliyun/database/opendb-feedback.schema.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "bsonType": "object",
- "permission": {
- "read": "doc.uid == auth.uid && doc.article_status == 0 || doc.article_status == 1",
- "create": true,
- "update": "doc.uid == auth.uid",
- "delete": "doc.uid == auth.uid"
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "留言反馈用户ID\/回复留言用户ID,参考uni-id-users表",
- "foreignKey": "uni-id-users._id"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "留言时间\/回复留言时间"
- },
- "content": {
- "bsonType": "string",
- "description": "留言内容\/回复内容",
- "trim": "right"
- },
- "imgs": {
- "bsonType": "array",
- "description": "图片列表"
- },
- "is_reply": {
- "bsonType": "bool",
- "description": "是否是回复类型"
- },
- "feedback_id": {
- "bsonType": "string",
- "description": "被回复留言ID"
- },
- "contact": {
- "bsonType": "string",
- "description": "联系人",
- "trim": "both"
- },
- "mobile": {
- "bsonType": "string",
- "description": "联系电话",
- "trim": "both"
- },
- "reply_count": {
- "bsonType": "int",
- "description": "被回复条数"
- }
- }
-}
diff --git a/uni_modules/opendb-feedback/changelog.md b/uni_modules/opendb-feedback/changelog.md
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/uni_modules/opendb-feedback/components/feedback-imgs.vue b/uni_modules/opendb-feedback/components/feedback-imgs.vue
new file mode 100644
index 0000000000000000000000000000000000000000..7254c048c987438804392c062509a417640dbb27
--- /dev/null
+++ b/uni_modules/opendb-feedback/components/feedback-imgs.vue
@@ -0,0 +1,255 @@
+
+
+
+
+ 点击预览图片
+ {{ imgs.length }}/5
+
+
+
+
+
+
+
+ x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/opendb-feedback/js_sdk/validator/opendb-feedback.js b/uni_modules/opendb-feedback/js_sdk/validator/opendb-feedback.js
new file mode 100644
index 0000000000000000000000000000000000000000..3918e36d1fb1761beb95459da72dbd2ba192d082
--- /dev/null
+++ b/uni_modules/opendb-feedback/js_sdk/validator/opendb-feedback.js
@@ -0,0 +1,74 @@
+
+// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema
+
+
+
+const validator = {
+ "user_id": {
+ "rules": [
+ {
+ "format": "string"
+ }
+ ]
+ },
+ "create_date": {
+ "rules": [
+ {
+ "format": "timestamp"
+ }
+ ]
+ },
+ "content": {
+ "rules": [
+ {
+ "format": "string"
+ }
+ ]
+ },
+ "imgs": {
+ "rules": [
+ {
+ "format": "array"
+ }
+ ]
+ },
+ "is_reply": {
+ "rules": [
+ {
+ "format": "bool"
+ }
+ ]
+ },
+ "feedback_id": {
+ "rules": [
+ {
+ "format": "string"
+ }
+ ]
+ },
+ "contact": {
+ "rules": [
+ {
+ "format": "string"
+ }
+ ]
+ },
+ "mobile": {
+ "rules": [
+ {
+ "format": "string"
+ }
+ ]
+ },
+ "reply_count": {
+ "rules": [
+ {
+ "format": "int"
+ }
+ ]
+ }
+}
+
+const enumConverter = {}
+
+export { validator, enumConverter }
diff --git a/uni_modules/opendb-feedback/package.json b/uni_modules/opendb-feedback/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..48810656ae9f92a2e4296454cf265813c53a1f15
--- /dev/null
+++ b/uni_modules/opendb-feedback/package.json
@@ -0,0 +1,91 @@
+{
+ "id": "opendb-feedback",
+ "displayName": "opendb-feedback",
+ "version": "1.0.0",
+ "description": "",
+ "keywords": [
+ "opendb-feedback"
+ ],
+ "repository": "",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+ "dcloudext": {
+ "category": [
+ "uniCloud",
+ "Admin插件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": ""
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-dateformat",
+ "uni-badge",
+ "uni-icons",
+ "uni-link",
+ "uni-load-more",
+ "uni-forms",
+ "uni-group",
+ "uni-list",
+ "uni-fab",
+ "uni-datetime-picker",
+ "uni-file-picker",
+ "uni-easyinput",
+ "uni-data-checkbox",
+ "switch"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "u",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/opendb-feedback/pages/opendb-feedback/add.vue b/uni_modules/opendb-feedback/pages/opendb-feedback/add.vue
new file mode 100644
index 0000000000000000000000000000000000000000..267239c80c5b099a02fd201289934dff644bfdbf
--- /dev/null
+++ b/uni_modules/opendb-feedback/pages/opendb-feedback/add.vue
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/opendb-feedback/pages/opendb-feedback/detail.vue b/uni_modules/opendb-feedback/pages/opendb-feedback/detail.vue
new file mode 100644
index 0000000000000000000000000000000000000000..8984ccb17ec0d624fbf26e82df6da2acb6c89bca
--- /dev/null
+++ b/uni_modules/opendb-feedback/pages/opendb-feedback/detail.vue
@@ -0,0 +1,82 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/opendb-feedback/pages/opendb-feedback/edit.vue b/uni_modules/opendb-feedback/pages/opendb-feedback/edit.vue
new file mode 100644
index 0000000000000000000000000000000000000000..23f82e7f9103556c439206adebe21a995270ae8c
--- /dev/null
+++ b/uni_modules/opendb-feedback/pages/opendb-feedback/edit.vue
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/opendb-feedback/pages/opendb-feedback/list.vue b/uni_modules/opendb-feedback/pages/opendb-feedback/list.vue
new file mode 100644
index 0000000000000000000000000000000000000000..403e996847fd3347d8a0b97b56c561ec1978e61f
--- /dev/null
+++ b/uni_modules/opendb-feedback/pages/opendb-feedback/list.vue
@@ -0,0 +1,67 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+ {{item.content}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/opendb-feedback/readme.md b/uni_modules/opendb-feedback/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..89b3a6064cf93c314d54f2defc67cd735a99f80b
--- /dev/null
+++ b/uni_modules/opendb-feedback/readme.md
@@ -0,0 +1 @@
+# opendb-feedback
\ No newline at end of file
diff --git a/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json b/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json
new file mode 100644
index 0000000000000000000000000000000000000000..6cd00a6c11afba4fbec6b73de5990cde8dd78590
--- /dev/null
+++ b/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json
@@ -0,0 +1,54 @@
+{
+ "bsonType": "object",
+ "permission": {
+ "read": "auth.uid && doc.uid == auth.uid",
+ "create": true,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "ID,系统自动生成"
+ },
+ "user_id": {
+ "bsonType": "string",
+ "description": "留言反馈用户ID/回复留言用户ID,参考uni-id-users表",
+ "foreignKey": "uni-id-users._id"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "留言时间/回复留言时间"
+ },
+ "content": {
+ "bsonType": "string",
+ "description": "留言内容/回复内容",
+ "trim": "right"
+ },
+ "imgs": {
+ "bsonType": "array",
+ "description": "图片列表"
+ },
+ "is_reply": {
+ "bsonType": "bool",
+ "description": "是否是回复类型"
+ },
+ "feedback_id": {
+ "bsonType": "string",
+ "description": "被回复留言ID"
+ },
+ "contact": {
+ "bsonType": "string",
+ "description": "联系人",
+ "trim": "both"
+ },
+ "mobile": {
+ "bsonType": "string",
+ "description": "联系电话",
+ "trim": "both"
+ },
+ "reply_count": {
+ "bsonType": "int",
+ "description": "被回复条数"
+ }
+ }
+}
\ No newline at end of file
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 670b53292c96c35fd4b7bd89e7c2c712bc28afd2..e26d14d906667e913501b8eab355f1e9f41be111 100644
--- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
+++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
@@ -1,156 +1,156 @@
-
- {{ text }}
-
-
-
-
-
diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md
index 5fa34d21693b3f97958a186e23cc07728df32660..9a5d23f5e94bb06350f64096ee4e0f0d5d8220e6 100644
--- a/uni_modules/uni-data-checkbox/changelog.md
+++ b/uni_modules/uni-data-checkbox/changelog.md
@@ -1,3 +1,5 @@
+## 0.1.4(2021-04-09)
+- 修复 nvue 下无法选中的问题
## 0.1.3(2021-03-22)
- 新增 disabled属性
## 0.1.2(2021-02-24)
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 c6bf68a6954bcb3f9531bd4bc53f4fdca2372469..f9caf32bb9fd54ad3b8ca5acbfcb2f00aad463ce 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
@@ -1,785 +1,785 @@
-
-
-
-
-
- {{mixinDatacomErrorMessage}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{mixinDatacomErrorMessage}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-data-checkbox/package.json b/uni_modules/uni-data-checkbox/package.json
index c5fcbfc73f7c09e9b3fabec955bf2eec6b2a0117..e6e4868826d80684725aff0dcb4807ce271f07c8 100644
--- a/uni_modules/uni-data-checkbox/package.json
+++ b/uni_modules/uni-data-checkbox/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-data-checkbox",
"displayName": "DataCheckbox 数据选择器",
- "version": "0.1.3",
+ "version": "0.1.4",
"description": "通过数据驱动的单选框和复选框",
"keywords": [
"checkbox",
diff --git a/uni_modules/uni-data-checkbox/readme.md b/uni_modules/uni-data-checkbox/readme.md
index c34450c5f51a856477bd57f1c0920bb39844bdc2..6fb99721b853f0fa0159bfbd16cfa5fb28d7a666 100644
--- a/uni_modules/uni-data-checkbox/readme.md
+++ b/uni_modules/uni-data-checkbox/readme.md
@@ -1,6 +1,7 @@
## DataCheckbox 数据驱动的单选复选框
+> **组件名:uni-data-checkbox**
> 代码块: `uDataCheckbox`
@@ -13,6 +14,7 @@
在uniCloud开发中,`DB Schema`中配置了enum枚举等类型后,在web控制台的[自动生成表单](https://uniapp.dcloud.io/uniCloud/schema?id=autocode)功能中,会自动生成``uni-data-checkbox``组件并绑定好data
+> **注意事项**
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
> - 组件需要依赖 `sass` 插件 ,请自行手动安装
> - 本组件为数据驱动,目的是快速投入使用,只可通过 style 覆盖有限样式,不支持自定义更多样式
diff --git a/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
index 579aded153c433a3ce23bcccff99589b08c74e73..24b450e1b4017ced9a0100c1b4e622a1158fa6fa 100644
--- a/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
+++ b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
@@ -59,13 +59,7 @@ function getDate(time) {
}
switch (typeof time) {
case 'string':
- {
- // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
- if (time.indexOf('T') > -1) {
- return new Date(time)
- }
- return new Date(time.replace(/-/g, '/'))
- }
+ return new Date(time.replace(/-/g, '/'))
default:
return new Date(time)
}
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
index 4a09b4b914f1c29d966e58fb8dfb2e17aa305af8..ab77c96975ba8d399d9a7dc46c3c1327dfac1fd1 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
@@ -1,827 +1,827 @@
-
-
-
-
-
- {{time}}
-
- 选择{{title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-datetime-picker/readme.md b/uni_modules/uni-datetime-picker/readme.md
index f263ca88a97df9967a27c746d2d7c35d820364e0..ed6710276022b3d5a71321c8000151398a2dac9b 100644
--- a/uni_modules/uni-datetime-picker/readme.md
+++ b/uni_modules/uni-datetime-picker/readme.md
@@ -10,11 +10,11 @@
___点击 picker 默认值规则:___
-
-- 若设置初始值 value, 会显示在 picker 显示框中; 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中
- - 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
- - 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
- - 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
+
+- 若设置初始值 value, 会显示在 picker 显示框中; 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中
+ - 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
+ - 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
+ - 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
- 无起始终止时间,则初始值为 value
### 安装方式
diff --git a/uni_modules/uni-easyinput/components/uni-easyinput/common.js b/uni_modules/uni-easyinput/components/uni-easyinput/common.js
index df9abe1da71fd2245aba33c6d31dadd62e39c47c..5549cc993e5af6a6b50b3fc2bcd2543c2472b547 100644
--- a/uni_modules/uni-easyinput/components/uni-easyinput/common.js
+++ b/uni_modules/uni-easyinput/components/uni-easyinput/common.js
@@ -1,56 +1,56 @@
-/**
- * @desc 函数防抖
- * @param func 目标函数
- * @param wait 延迟执行毫秒数
- * @param immediate true - 立即执行, false - 延迟执行
- */
-export const debounce = function(func, wait = 1000, immediate = true) {
- let timer;
- console.log(1);
- return function() {
- console.log(123);
- let context = this,
- args = arguments;
- if (timer) clearTimeout(timer);
- if (immediate) {
- let callNow = !timer;
- timer = setTimeout(() => {
- timer = null;
- }, wait);
- if (callNow) func.apply(context, args);
- } else {
- timer = setTimeout(() => {
- func.apply(context, args);
- }, wait)
- }
- }
-}
-/**
- * @desc 函数节流
- * @param func 函数
- * @param wait 延迟执行毫秒数
- * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
- */
-export const throttle = (func, wait = 1000, type = 1) => {
- let previous = 0;
- let timeout;
- return function() {
- let context = this;
- let args = arguments;
- if (type === 1) {
- let now = Date.now();
-
- if (now - previous > wait) {
- func.apply(context, args);
- previous = now;
- }
- } else if (type === 2) {
- if (!timeout) {
- timeout = setTimeout(() => {
- timeout = null;
- func.apply(context, args)
- }, wait)
- }
- }
- }
+/**
+ * @desc 函数防抖
+ * @param func 目标函数
+ * @param wait 延迟执行毫秒数
+ * @param immediate true - 立即执行, false - 延迟执行
+ */
+export const debounce = function(func, wait = 1000, immediate = true) {
+ let timer;
+ console.log(1);
+ return function() {
+ console.log(123);
+ let context = this,
+ args = arguments;
+ if (timer) clearTimeout(timer);
+ if (immediate) {
+ let callNow = !timer;
+ timer = setTimeout(() => {
+ timer = null;
+ }, wait);
+ if (callNow) func.apply(context, args);
+ } else {
+ timer = setTimeout(() => {
+ func.apply(context, args);
+ }, wait)
+ }
+ }
+}
+/**
+ * @desc 函数节流
+ * @param func 函数
+ * @param wait 延迟执行毫秒数
+ * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
+ */
+export const throttle = (func, wait = 1000, type = 1) => {
+ let previous = 0;
+ let timeout;
+ return function() {
+ let context = this;
+ let args = arguments;
+ if (type === 1) {
+ let now = Date.now();
+
+ if (now - previous > wait) {
+ func.apply(context, args);
+ previous = now;
+ }
+ } else if (type === 2) {
+ if (!timeout) {
+ timeout = setTimeout(() => {
+ timeout = null;
+ func.apply(context, args)
+ }, wait)
+ }
+ }
+ }
}
diff --git a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
index c1e0724e7efb4f1920c6dd7ddbd953472338f94b..f40d360f8938a3949e3408b998252f575ee57f1f 100644
--- a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
+++ b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
@@ -1,428 +1,427 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
index e6fe5a9e6083504bfc21a543dfa7d01a38298916..e077eae7e433c07e2d362fbb8a4e7a3a8e3f39d2 100644
--- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
+++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
@@ -1,447 +1,447 @@
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/changelog.md b/uni_modules/uni-file-picker/changelog.md
index c591273eb3c6c5c53056d3900cae870521a19dd8..8f89126108297034d255489268480d2a556b56fd 100644
--- a/uni_modules/uni-file-picker/changelog.md
+++ b/uni_modules/uni-file-picker/changelog.md
@@ -1,3 +1,9 @@
+## 0.0.6(2021-04-09)
+- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
+## 0.0.5(2021-04-09)
+- 优化 更新组件示例
+## 0.0.4(2021-04-09)
+- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
## 0.0.3(2021-02-05)
- 调整为uni_modules目录规范
- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
index e810428ede06a084d6848006a492b36f61bcd809..1d57b5ed52dbe6f21fd3fd7f508895b76e83c638 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
@@ -2,185 +2,185 @@
Object.defineProperty(exports, '__esModule', { value: true });
-const ERR_MSG_OK = 'chooseAndUploadFile:ok';
-const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
-function chooseImage(opts) {
- const { count, sizeType, sourceType, extension } = opts;
- return new Promise((resolve, reject) => {
- uni.chooseImage({
- count,
- sizeType,
- sourceType,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res, 'image'));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-function chooseVideo(opts) {
- const { camera, compressed, maxDuration, sourceType, extension } = opts;
- return new Promise((resolve, reject) => {
- uni.chooseVideo({
- camera,
- compressed,
- maxDuration,
- sourceType,
- extension,
- success(res) {
- const { tempFilePath, duration, size, height, width } = res;
- resolve(normalizeChooseAndUploadFileRes({
- errMsg: 'chooseVideo:ok',
- tempFilePaths: [tempFilePath],
- tempFiles: [
- {
- name: (res.tempFile && res.tempFile.name) || '',
- path: tempFilePath,
- size,
- type: (res.tempFile && res.tempFile.type) || '',
- width,
- height,
- duration,
- fileType: 'video',
- cloudPath: '',
- },
- ],
- }, 'video'));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-function chooseAll(opts) {
- const { count, extension } = opts;
- return new Promise((resolve, reject) => {
- let chooseFile = uni.chooseFile;
- if (typeof wx !== 'undefined' &&
- typeof wx.chooseMessageFile === 'function') {
- chooseFile = wx.chooseMessageFile;
- }
- if (typeof chooseFile !== 'function') {
- return reject({
- errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
- });
- }
- chooseFile({
- type: 'all',
- count,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
- });
- },
- });
- });
-}
-function normalizeChooseAndUploadFileRes(res, fileType) {
- res.tempFiles.forEach((item, index) => {
- if (!item.name) {
- item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
- }
- if (fileType) {
- item.fileType = fileType;
- }
- item.cloudPath =
- Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
- });
- // wx.chooseMessageFile
- if (!res.tempFilePaths) {
- res.tempFilePaths = res.tempFiles.map((file) => file.path);
- }
- return res;
-}
-function uploadCloudFiles(res, max = 5, onUploadProgress) {
- res = Object.assign({}, res);
- res.errMsg = ERR_MSG_OK;
- const files = res.tempFiles;
- const len = files.length;
- let count = 0;
- return new Promise((resolve) => {
- while (count < max) {
- next();
- }
- function next() {
+const ERR_MSG_OK = 'chooseAndUploadFile:ok';
+const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
+function chooseImage(opts) {
+ const { count, sizeType, sourceType, extension } = opts;
+ return new Promise((resolve, reject) => {
+ uni.chooseImage({
+ count,
+ sizeType,
+ sourceType,
+ extension,
+ success(res) {
+ resolve(normalizeChooseAndUploadFileRes(res, 'image'));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+function chooseVideo(opts) {
+ const { camera, compressed, maxDuration, sourceType, extension } = opts;
+ return new Promise((resolve, reject) => {
+ uni.chooseVideo({
+ camera,
+ compressed,
+ maxDuration,
+ sourceType,
+ extension,
+ success(res) {
+ const { tempFilePath, duration, size, height, width } = res;
+ resolve(normalizeChooseAndUploadFileRes({
+ errMsg: 'chooseVideo:ok',
+ tempFilePaths: [tempFilePath],
+ tempFiles: [
+ {
+ name: (res.tempFile && res.tempFile.name) || '',
+ path: tempFilePath,
+ size,
+ type: (res.tempFile && res.tempFile.type) || '',
+ width,
+ height,
+ duration,
+ fileType: 'video',
+ cloudPath: '',
+ },
+ ],
+ }, 'video'));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+function chooseAll(opts) {
+ const { count, extension } = opts;
+ return new Promise((resolve, reject) => {
+ let chooseFile = uni.chooseFile;
+ if (typeof wx !== 'undefined' &&
+ typeof wx.chooseMessageFile === 'function') {
+ chooseFile = wx.chooseMessageFile;
+ }
+ if (typeof chooseFile !== 'function') {
+ return reject({
+ errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
+ });
+ }
+ chooseFile({
+ type: 'all',
+ count,
+ extension,
+ success(res) {
+ resolve(normalizeChooseAndUploadFileRes(res));
+ },
+ fail(res) {
+ reject({
+ errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
+ });
+ },
+ });
+ });
+}
+function normalizeChooseAndUploadFileRes(res, fileType) {
+ res.tempFiles.forEach((item, index) => {
+ if (!item.name) {
+ item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
+ }
+ if (fileType) {
+ item.fileType = fileType;
+ }
+ item.cloudPath =
+ Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
+ });
+ // wx.chooseMessageFile
+ if (!res.tempFilePaths) {
+ res.tempFilePaths = res.tempFiles.map((file) => file.path);
+ }
+ return res;
+}
+function uploadCloudFiles(res, max = 5, onUploadProgress) {
+ res = Object.assign({}, res);
+ res.errMsg = ERR_MSG_OK;
+ const files = res.tempFiles;
+ const len = files.length;
+ let count = 0;
+ return new Promise((resolve) => {
+ while (count < max) {
+ next();
+ }
+ function next() {
let cur = count++;
- if (cur >= len) {
- !files.find((item) => !item.url && !item.errMsg) && resolve(res);
- return;
- }
- const fileItem = files[cur];
- uniCloud
- .uploadFile({
- filePath: fileItem.path,
- cloudPath: fileItem.cloudPath,
- fileType: fileItem.fileType,
- onUploadProgress(res) {
- res.index = cur;
- res.tempFile = fileItem;
- res.tempFilePath = fileItem.path;
- onUploadProgress &&
- onUploadProgress(res);
- },
- })
- .then((res) => {
- fileItem.url = res.fileID;
- if (cur < len) {
- next();
- }
- })
- .catch((res) => {
+ if (cur >= len) {
+ !files.find((item) => !item.url && !item.errMsg) && resolve(res);
+ return;
+ }
+ const fileItem = files[cur];
+ uniCloud
+ .uploadFile({
+ filePath: fileItem.path,
+ cloudPath: fileItem.cloudPath,
+ fileType: fileItem.fileType,
+ onUploadProgress(res) {
+ res.index = cur;
+ res.tempFile = fileItem;
+ res.tempFilePath = fileItem.path;
+ onUploadProgress &&
+ onUploadProgress(res);
+ },
+ })
+ .then((res) => {
+ fileItem.url = res.fileID;
+ if (cur < len) {
+ next();
+ }
+ })
+ .catch((res) => {
// fileItem.errMsg = res.message;
- fileItem.errMsg = res.errMsg || res.message;
- if (cur < len) {
- next();
- }
- });
- }
- });
-}
-function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
- return choosePromise
- .then((res) => {
- if (onChooseFile) {
- const customChooseRes = onChooseFile(res);
- if (typeof customChooseRes !== 'undefined') {
- return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ? res : chooseRes);
- }
- }
- return res;
- })
- .then((res) => {
- if (res === false) {
- return {
- errMsg: ERR_MSG_OK,
- tempFilePaths: [],
- tempFiles: [],
- };
- }
- return uploadCloudFiles(res, 5, onUploadProgress);
- });
-}
-function chooseAndUploadFile(opts = { type: 'all' }) {
- if (opts.type === 'image') {
- return uploadFiles(chooseImage(opts), opts);
- }
- else if (opts.type === 'video') {
- return uploadFiles(chooseVideo(opts), opts);
- }
- return uploadFiles(chooseAll(opts), opts);
+ fileItem.errMsg = res.errMsg || res.message;
+ if (cur < len) {
+ next();
+ }
+ });
+ }
+ });
+}
+function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
+ return choosePromise
+ .then((res) => {
+ if (onChooseFile) {
+ const customChooseRes = onChooseFile(res);
+ if (typeof customChooseRes !== 'undefined') {
+ return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ? res : chooseRes);
+ }
+ }
+ return res;
+ })
+ .then((res) => {
+ if (res === false) {
+ return {
+ errMsg: ERR_MSG_OK,
+ tempFilePaths: [],
+ tempFiles: [],
+ };
+ }
+ return uploadCloudFiles(res, 5, onUploadProgress);
+ });
+}
+function chooseAndUploadFile(opts = { type: 'all' }) {
+ if (opts.type === 'image') {
+ return uploadFiles(chooseImage(opts), opts);
+ }
+ else if (opts.type === 'video') {
+ return uploadFiles(chooseVideo(opts), opts);
+ }
+ return uploadFiles(chooseAll(opts), opts);
}
exports.chooseAndUploadFile = chooseAndUploadFile;
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
index 6262411442ed4ed798503fb728627ef12bd64fa6..370d98e4e0da161c4a0aca9e5d78fea5dc446ce3 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
@@ -1,646 +1,669 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
index 445dad5a90c0de43d25df0c75bea5619d8a27555..c369d7d5d20430a2296ce4e5160ff0f7e030d293 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
@@ -1,325 +1,324 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.name}}
-
-
-
-
-
-
-
-
-
- 点击重试
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
index 7cee3f080ec42ac8e8e6b6d2b8f9fbd6ceb5ff62..486e2094631ee604854f9bf17bfd3e732b46ec23 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue
@@ -1,289 +1,289 @@
-
+
-
-
-
-
-
-
-
-
-
- 点击重试
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-file-picker/package.json b/uni_modules/uni-file-picker/package.json
index d20798619cdfbf75fee441e141d929baa48d132a..0b8c6d889cadba1d5e285c52d7ee381e46984265 100644
--- a/uni_modules/uni-file-picker/package.json
+++ b/uni_modules/uni-file-picker/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-file-picker",
"displayName": "FilePicker 文件选择上传",
- "version": "0.0.3",
+ "version": "0.0.6",
"description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
"keywords": [
"uni-ui",
diff --git a/uni_modules/uni-file-picker/readme.md b/uni_modules/uni-file-picker/readme.md
index bf206a8039fa2ea037277775346415e5ee9a7be7..7d36050349f0805fe2763ae39e0eeeb4f91b45f4 100644
--- a/uni_modules/uni-file-picker/readme.md
+++ b/uni_modules/uni-file-picker/readme.md
@@ -1,11 +1,13 @@
## FilePicker 文件选择上传
+> **组件名:uni-file-picker**
> 代码块: `uFilePicker`
文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
+> **注意事项**
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
> - 组件需要依赖 `sass` 插件 ,请自行手动安装
> - 使用组件需要绑定服务空间
@@ -31,7 +33,7 @@
| title | String | - | - | 组件标题,右侧显示上传计数 |
| mode | String | list | list/grid | 选择文件后的文件列表样式 |
| file-mediatype| String | image | image/video/all | 选择文件类型,all 只支持 H5 和微信小程序平台 |
-| file-extname | Array | - | - | 选择文件后缀,根据 `file-mediatype` 属性而不同|
+| file-extname | Array\String | - | - | 选择文件后缀,字符串的情况下需要用逗号分隔(推荐使用字符串),根据 `file-mediatype` 属性而不同|
| list-styles | Object | - | - | `mode:list` 时的样式 |
| image-styles | Object | - | - | `mode:grid` 时的样式 |
@@ -174,7 +176,7 @@ export default {
配置 `file-mediatype` 属性为 `image`,限定只选择图片
-配置 `file-extname` 属性为 `['png','jpg']`,限定只选择 `png`和`jpg`后缀的图片
+配置 `file-extname` 属性为 `'png,jpg'`,限定只选择 `png`和`jpg`后缀的图片
配置 `limit` 属性为 1 ,则最多选择一张图片
@@ -186,7 +188,7 @@ export default {
v-model="imageValue"
file-mediatype="image"
mode="grid"
- file-extname="['png','jpg']"
+ file-extname="png,jpg"
:limit="1"
@progress="progress"
@success="success"
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 22d18892606d4f558a533412819bc4427ab11663..acaac80e27dd6ea29d83a1d526850a70beff2fa6 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,5 +1,5 @@
-
-
+
+
@@ -15,220 +15,220 @@
{{ showMsg === 'undertext' ? msg:'' }}
+ }">{{ 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 64aa51340c71c0f4e99679af6ef3d9b9f0c92e97..af83748f1e11af479269cbe6759bd74c0ccd70f2 100644
--- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
@@ -1,456 +1,456 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-forms/components/uni-forms/validate.js b/uni_modules/uni-forms/components/uni-forms/validate.js
index 46eeccb278e79db15ef6d91595e2e1462aad40e3..e4aad95003ceb6b71379fb7c4d85007af896d956 100644
--- a/uni_modules/uni-forms/components/uni-forms/validate.js
+++ b/uni_modules/uni-forms/components/uni-forms/validate.js
@@ -1,472 +1,472 @@
-
-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) {
- // TODO
- 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 || rule.minimum) {
- result = 'rangeNumber'
- } else if (rule.maxLength || rule.minLength) {
- 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) {
+ // TODO
+ 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 || rule.minimum) {
+ result = 'rangeNumber'
+ } else if (rule.maxLength || rule.minLength) {
+ 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-group/components/uni-group/uni-group.vue b/uni_modules/uni-group/components/uni-group/uni-group.vue
index 6af22d018fbe7c3622e163e9656202f6210b04f4..67ba869bc2ca57dd79f2e91459978c35f853b816 100644
--- a/uni_modules/uni-group/components/uni-group/uni-group.vue
+++ b/uni_modules/uni-group/components/uni-group/uni-group.vue
@@ -1,128 +1,128 @@
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js
index 60b733214dc67b78c1523ae31f878d937e5a830b..5242f2277365e36b41fc3203f831f9a9075fb184 100644
--- a/uni_modules/uni-icons/components/uni-icons/icons.js
+++ b/uni_modules/uni-icons/components/uni-icons/icons.js
@@ -1,132 +1,132 @@
-export default {
- "pulldown": "\ue588",
- "refreshempty": "\ue461",
- "back": "\ue471",
- "forward": "\ue470",
- "more": "\ue507",
- "more-filled": "\ue537",
- "scan": "\ue612",
- "qq": "\ue264",
- "weibo": "\ue260",
- "weixin": "\ue261",
- "pengyouquan": "\ue262",
- "loop": "\ue565",
- "refresh": "\ue407",
- "refresh-filled": "\ue437",
- "arrowthindown": "\ue585",
- "arrowthinleft": "\ue586",
- "arrowthinright": "\ue587",
- "arrowthinup": "\ue584",
- "undo-filled": "\ue7d6",
- "undo": "\ue406",
- "redo": "\ue405",
- "redo-filled": "\ue7d9",
- "bars": "\ue563",
- "chatboxes": "\ue203",
- "camera": "\ue301",
- "chatboxes-filled": "\ue233",
- "camera-filled": "\ue7ef",
- "cart-filled": "\ue7f4",
- "cart": "\ue7f5",
- "checkbox-filled": "\ue442",
- "checkbox": "\ue7fa",
- "arrowleft": "\ue582",
- "arrowdown": "\ue581",
- "arrowright": "\ue583",
- "smallcircle-filled": "\ue801",
- "arrowup": "\ue580",
- "circle": "\ue411",
- "eye-filled": "\ue568",
- "eye-slash-filled": "\ue822",
- "eye-slash": "\ue823",
- "eye": "\ue824",
- "flag-filled": "\ue825",
- "flag": "\ue508",
- "gear-filled": "\ue532",
- "reload": "\ue462",
- "gear": "\ue502",
- "hand-thumbsdown-filled": "\ue83b",
- "hand-thumbsdown": "\ue83c",
- "hand-thumbsup-filled": "\ue83d",
- "heart-filled": "\ue83e",
- "hand-thumbsup": "\ue83f",
- "heart": "\ue840",
- "home": "\ue500",
- "info": "\ue504",
- "home-filled": "\ue530",
- "info-filled": "\ue534",
- "circle-filled": "\ue441",
- "chat-filled": "\ue847",
- "chat": "\ue263",
- "mail-open-filled": "\ue84d",
- "email-filled": "\ue231",
- "mail-open": "\ue84e",
- "email": "\ue201",
- "checkmarkempty": "\ue472",
- "list": "\ue562",
- "locked-filled": "\ue856",
- "locked": "\ue506",
- "map-filled": "\ue85c",
- "map-pin": "\ue85e",
- "map-pin-ellipse": "\ue864",
- "map": "\ue364",
- "minus-filled": "\ue440",
- "mic-filled": "\ue332",
- "minus": "\ue410",
- "micoff": "\ue360",
- "mic": "\ue302",
- "clear": "\ue434",
- "smallcircle": "\ue868",
- "close": "\ue404",
- "closeempty": "\ue460",
- "paperclip": "\ue567",
- "paperplane": "\ue503",
- "paperplane-filled": "\ue86e",
- "person-filled": "\ue131",
- "contact-filled": "\ue130",
- "person": "\ue101",
- "contact": "\ue100",
- "images-filled": "\ue87a",
- "phone": "\ue200",
- "images": "\ue87b",
- "image": "\ue363",
- "image-filled": "\ue877",
- "location-filled": "\ue333",
- "location": "\ue303",
- "plus-filled": "\ue439",
- "plus": "\ue409",
- "plusempty": "\ue468",
- "help-filled": "\ue535",
- "help": "\ue505",
- "navigate-filled": "\ue884",
- "navigate": "\ue501",
- "mic-slash-filled": "\ue892",
- "search": "\ue466",
- "settings": "\ue560",
- "sound": "\ue590",
- "sound-filled": "\ue8a1",
- "spinner-cycle": "\ue465",
- "download-filled": "\ue8a4",
- "personadd-filled": "\ue132",
- "videocam-filled": "\ue8af",
- "personadd": "\ue102",
- "upload": "\ue402",
- "upload-filled": "\ue8b1",
- "starhalf": "\ue463",
- "star-filled": "\ue438",
- "star": "\ue408",
- "trash": "\ue401",
- "phone-filled": "\ue230",
- "compose": "\ue400",
- "videocam": "\ue300",
- "trash-filled": "\ue8dc",
- "download": "\ue403",
- "chatbubble-filled": "\ue232",
- "chatbubble": "\ue202",
- "cloud-download": "\ue8e4",
- "cloud-upload-filled": "\ue8e5",
- "cloud-upload": "\ue8e6",
+export default {
+ "pulldown": "\ue588",
+ "refreshempty": "\ue461",
+ "back": "\ue471",
+ "forward": "\ue470",
+ "more": "\ue507",
+ "more-filled": "\ue537",
+ "scan": "\ue612",
+ "qq": "\ue264",
+ "weibo": "\ue260",
+ "weixin": "\ue261",
+ "pengyouquan": "\ue262",
+ "loop": "\ue565",
+ "refresh": "\ue407",
+ "refresh-filled": "\ue437",
+ "arrowthindown": "\ue585",
+ "arrowthinleft": "\ue586",
+ "arrowthinright": "\ue587",
+ "arrowthinup": "\ue584",
+ "undo-filled": "\ue7d6",
+ "undo": "\ue406",
+ "redo": "\ue405",
+ "redo-filled": "\ue7d9",
+ "bars": "\ue563",
+ "chatboxes": "\ue203",
+ "camera": "\ue301",
+ "chatboxes-filled": "\ue233",
+ "camera-filled": "\ue7ef",
+ "cart-filled": "\ue7f4",
+ "cart": "\ue7f5",
+ "checkbox-filled": "\ue442",
+ "checkbox": "\ue7fa",
+ "arrowleft": "\ue582",
+ "arrowdown": "\ue581",
+ "arrowright": "\ue583",
+ "smallcircle-filled": "\ue801",
+ "arrowup": "\ue580",
+ "circle": "\ue411",
+ "eye-filled": "\ue568",
+ "eye-slash-filled": "\ue822",
+ "eye-slash": "\ue823",
+ "eye": "\ue824",
+ "flag-filled": "\ue825",
+ "flag": "\ue508",
+ "gear-filled": "\ue532",
+ "reload": "\ue462",
+ "gear": "\ue502",
+ "hand-thumbsdown-filled": "\ue83b",
+ "hand-thumbsdown": "\ue83c",
+ "hand-thumbsup-filled": "\ue83d",
+ "heart-filled": "\ue83e",
+ "hand-thumbsup": "\ue83f",
+ "heart": "\ue840",
+ "home": "\ue500",
+ "info": "\ue504",
+ "home-filled": "\ue530",
+ "info-filled": "\ue534",
+ "circle-filled": "\ue441",
+ "chat-filled": "\ue847",
+ "chat": "\ue263",
+ "mail-open-filled": "\ue84d",
+ "email-filled": "\ue231",
+ "mail-open": "\ue84e",
+ "email": "\ue201",
+ "checkmarkempty": "\ue472",
+ "list": "\ue562",
+ "locked-filled": "\ue856",
+ "locked": "\ue506",
+ "map-filled": "\ue85c",
+ "map-pin": "\ue85e",
+ "map-pin-ellipse": "\ue864",
+ "map": "\ue364",
+ "minus-filled": "\ue440",
+ "mic-filled": "\ue332",
+ "minus": "\ue410",
+ "micoff": "\ue360",
+ "mic": "\ue302",
+ "clear": "\ue434",
+ "smallcircle": "\ue868",
+ "close": "\ue404",
+ "closeempty": "\ue460",
+ "paperclip": "\ue567",
+ "paperplane": "\ue503",
+ "paperplane-filled": "\ue86e",
+ "person-filled": "\ue131",
+ "contact-filled": "\ue130",
+ "person": "\ue101",
+ "contact": "\ue100",
+ "images-filled": "\ue87a",
+ "phone": "\ue200",
+ "images": "\ue87b",
+ "image": "\ue363",
+ "image-filled": "\ue877",
+ "location-filled": "\ue333",
+ "location": "\ue303",
+ "plus-filled": "\ue439",
+ "plus": "\ue409",
+ "plusempty": "\ue468",
+ "help-filled": "\ue535",
+ "help": "\ue505",
+ "navigate-filled": "\ue884",
+ "navigate": "\ue501",
+ "mic-slash-filled": "\ue892",
+ "search": "\ue466",
+ "settings": "\ue560",
+ "sound": "\ue590",
+ "sound-filled": "\ue8a1",
+ "spinner-cycle": "\ue465",
+ "download-filled": "\ue8a4",
+ "personadd-filled": "\ue132",
+ "videocam-filled": "\ue8af",
+ "personadd": "\ue102",
+ "upload": "\ue402",
+ "upload-filled": "\ue8b1",
+ "starhalf": "\ue463",
+ "star-filled": "\ue438",
+ "star": "\ue408",
+ "trash": "\ue401",
+ "phone-filled": "\ue230",
+ "compose": "\ue400",
+ "videocam": "\ue300",
+ "trash-filled": "\ue8dc",
+ "download": "\ue403",
+ "chatbubble-filled": "\ue232",
+ "chatbubble": "\ue202",
+ "cloud-download": "\ue8e4",
+ "cloud-upload-filled": "\ue8e5",
+ "cloud-upload": "\ue8e6",
"cloud-download-filled": "\ue8e9",
"headphones":"\ue8bf",
- "shop":"\ue609"
+ "shop":"\ue609"
}
diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
index 631956574c3bd7ea7177103555476792b2c5a8c4..71aef8a076eb8449661b739162f59a342f3c9fcf 100644
--- a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
+++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
@@ -1,71 +1,71 @@
-
- {{icons[type]}}
-
-
-
-
-
diff --git a/uni_modules/uni-link/changelog.md b/uni_modules/uni-link/changelog.md
index 79570ae6a66762e49a1ecc8a833fd64985a14ef2..861e56be4847ad5e4e73b1ea722cfbfc2f4430bd 100644
--- a/uni_modules/uni-link/changelog.md
+++ b/uni_modules/uni-link/changelog.md
@@ -1,5 +1,4 @@
## 0.0.3(2021-03-09)
- 新增 href 属性支持 tel:|mailto:
-
-## 0.0.2(2021-02-05)
-- 调整为uni_modules目录规范
+## 0.0.2(2021-02-05)
+- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-link/components/uni-link/uni-link.vue b/uni_modules/uni-link/components/uni-link/uni-link.vue
index 9598a4b85ded336d459821cbc6ba325aac45992a..6b5f4fb7677cf79fb6e64e56d61c73a3cc9a40f4 100644
--- a/uni_modules/uni-link/components/uni-link/uni-link.vue
+++ b/uni_modules/uni-link/components/uni-link/uni-link.vue
@@ -1,111 +1,111 @@
-
- {{text}}
- {{text}}
-
-
-
-
-
diff --git a/uni_modules/uni-link/package.json b/uni_modules/uni-link/package.json
index d0df4db97b82cc81b8503919a6241d13f183f408..3908ef076602de766df2bcc801990b862a548538 100644
--- a/uni_modules/uni-link/package.json
+++ b/uni_modules/uni-link/package.json
@@ -1,82 +1,82 @@
-{
- "id": "uni-link",
- "displayName": "Link 超链接",
- "version": "0.0.2",
- "description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打",
- "keywords": [
- "",
- "link",
- "超链接",
- "ulink"
-],
- "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": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
+{
+ "id": "uni-link",
+ "displayName": "Link 超链接",
+ "version": "0.0.3",
+ "description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打",
+ "keywords": [
+ "",
+ "link",
+ "超链接",
+ "ulink"
+],
+ "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": "u",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "u",
+ "Android Browser": "u",
+ "微信浏览器(Android)": "u",
+ "QQ浏览器(Android)": "u"
+ },
+ "H5-pc": {
+ "Chrome": "u",
+ "IE": "u",
+ "Edge": "u",
+ "Firefox": "u",
+ "Safari": "u"
+ },
+ "小程序": {
+ "微信": "u",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/uni_modules/uni-link/readme.md b/uni_modules/uni-link/readme.md
index b342902d8d348d609d37bd38d80d12e7f9ac9b8a..43f6c5820c6523710b344d2bf609b5123b6ccdb6 100644
--- a/uni_modules/uni-link/readme.md
+++ b/uni_modules/uni-link/readme.md
@@ -1,41 +1,41 @@
-
-
-## Link 链接
-> 代码块: `uLink`
-
-
-uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。
-
-### 安装方式
-
-本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
-
-如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
-
-### 基本用法
-
-在 ``template`` 中使用组件
-
-```html
-
-```
-
-## API
-
-### Link Props
-
-|属性名 |类型 |默认值 |说明 |
-|:-: |:-: |:-: |:-: |
-|href |String |- |链接地址 |
-|text |String |- |显示文字 |
-|showUnderLine|Boolean|true |是否显示下划线 |
-|copyTips |String |已自动复制网址,请在手机浏览器里粘贴该网址 |在小程序端复制链接时的提示语 |
-|color |String |#999999 |链接文字颜色 |
-|fontSize |String |14 |链接文字大小,单位px |
+
+
+## Link 链接
+> 代码块: `uLink`
+
+
+uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+
+```
+
+## API
+
+### Link Props
+
+|属性名 |类型 |默认值 |说明 |
+|:-: |:-: |:-: |:-: |
+|href |String |- |链接地址 |
+|text |String |- |显示文字 |
+|showUnderLine|Boolean|true |是否显示下划线 |
+|copyTips |String |已自动复制网址,请在手机浏览器里粘贴该网址 |在小程序端复制链接时的提示语 |
+|color |String |#999999 |链接文字颜色 |
+|fontSize |String |14 |链接文字大小,单位px |
### href属性对tel和mailto格式说明
-|值 |说明 |平台 |
-|:-: |:-: |:-: |
+|值 |说明 |平台 |
+|:-: |:-: |:-: |
|tel:xxxxxxxxxxx |拨打电话 |H5,App |
|mailto:xxx@xxx.xxx |发送邮件 |H5 |
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 e256e4c5c8e45ca094c0002c19a4928aa9fbcb32..553dea2cc0a33e3ec09823b6e2a64a21b615ebea 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
@@ -1,107 +1,107 @@
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
index 311f8d9faf070f43c719519076af6a8b29424383..7e2708f74c2643208872ef6fa4d2c1f014328639 100644
--- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
+++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss
@@ -14,8 +14,8 @@ $divide-line-color : #e5e5e5;
$avatar-width : 45px ;
// 头像边框
-$avatar-border-radius: 5px;
-$avatar-border-color: #eee;
+$avatar-border-radius: 5px;
+$avatar-border-color: #eee;
$avatar-border-width: 1px;
// 标题文字样式
@@ -36,11 +36,11 @@ $right-text-weight : normal;
// 角标样式
// nvue 页面不支持修改圆点位置以及大小
// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动
-$badge-left: 0px;
+$badge-left: 0px;
$badge-top: 0px;
// 显示圆点时,圆点大小
-$dot-width: 10px;
+$dot-width: 10px;
$dot-height: 10px;
// 显示角标时,角标大小和字体大小
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 a2de186949e954636c50e2b603e80143069b2b76..8e8b1e67d3ddc20d1252f7c53c272e8a986d0dde 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
@@ -1,533 +1,533 @@
-
-
-
-
-
-
-
-
-
- {{ badgeText === 'dot' ? '' : badgeText }}
-
-
-
- {{ title }}
- {{ note }}
-
-
-
-
-
-
- |
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
index c0ba12e728d2571feece33a7d1da00bb66624622..7f1eced06f74880838557eaf162f6cc295d9a3ac 100644
--- a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
+++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
@@ -1,173 +1,175 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ title }}
- {{ note }}
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue
index d478729b27d0d456920434be21749a280fde6816..fc611ef9e1be021ce07d2ccf67acd93f76067901 100644
--- a/uni_modules/uni-list/components/uni-list/uni-list.vue
+++ b/uni_modules/uni-list/components/uni-list/uni-list.vue
@@ -1,106 +1,106 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-load-more/changelog.md b/uni_modules/uni-load-more/changelog.md
index e9d99768940ecf15118b7ffffe7969f501d8c31a..7ed3afebbdbad15768718c254246dbe5e023d477 100644
--- a/uni_modules/uni-load-more/changelog.md
+++ b/uni_modules/uni-load-more/changelog.md
@@ -1,2 +1,4 @@
+## 1.1.7(2021-03-30)
+- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
## 1.1.6(2021-02-05)
- 调整为uni_modules目录规范
diff --git a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
index 9430321c094ea87c7d7c078d4f8e44b9c516edae..6e6f4263a441af894067eb38dfd2484cf99913bc 100644
--- a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
+++ b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
@@ -1,34 +1,37 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- {{ status === 'more' ? contentText.contentdown : status === 'loading' ? contentText.contentrefresh : contentText.contentnomore }}
-
-
-
+
+
+ {{ status === 'more' ? contentText.contentdown : status === 'loading' ? contentText.contentrefresh : contentText.contentnomore }}
+
+
+
-
-
diff --git a/uni_modules/uni-load-more/package.json b/uni_modules/uni-load-more/package.json
index bd9300af70c7eba2acfd6b4aa021d22aa76161a5..492ee79586559bafa0d3cb7e510463acd4a38541 100644
--- a/uni_modules/uni-load-more/package.json
+++ b/uni_modules/uni-load-more/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-load-more",
"displayName": "LoadMore 加载更多",
- "version": "1.1.6",
+ "version": "1.1.7",
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
"keywords": [
"loadmore",
diff --git a/uni_modules/uni-load-more/readme.md b/uni_modules/uni-load-more/readme.md
index c5eef6029bc05419687386ee4c01e6e14e2c8fc3..af17c9abc17897faea9d7276ea988ef96dbe78d2 100644
--- a/uni_modules/uni-load-more/readme.md
+++ b/uni_modules/uni-load-more/readme.md
@@ -1,6 +1,7 @@
### LoadMore 加载更多
+> **组件名:uni-load-more**
> 代码块: `uLoadMore`
@@ -27,7 +28,7 @@
|属性名 |类型 | 可选值 |默认值 |说明 |
|:-: |:-: |:-: |:-: |:-: |
|iconSize |Number |- |24 |指定图标大小 |
-|status |String |more/loading/moMore |more |loading 的状态 |
+|status |String |more/loading/noMore |more |loading 的状态 |
|showIcon |Boolean|- |true |是否显示 loading 图标 |
|iconType |String |snow/circle/auto |auto |指定图标样式|
|color |String |- |#777777 |图标和文字颜色 |
@@ -51,6 +52,7 @@
+> **说明**
> `iconType`为`snow`时,在`APP-NVUE`平台不可设置大小,在非`APP-NVUE`平台不可设置颜色
diff --git a/uni_modules/uni-login-page/common/loginPage.mixin.js b/uni_modules/uni-login-page/common/loginPage.mixin.js
index 20ad828ea71e46ef727559d32d6292771d2fdd5f..3e143f02a3f77ae99a9c8272db29d74e3444c3d3 100644
--- a/uni_modules/uni-login-page/common/loginPage.mixin.js
+++ b/uni_modules/uni-login-page/common/loginPage.mixin.js
@@ -62,6 +62,23 @@ let mixin = {
}
}
},
+ computed: {
+ isPhone(){
+ let reg_phone = /^1\d{10}$/;
+ let isPhone = reg_phone.test(this.formData.phone);
+ return isPhone;
+ },
+ isPwd(){
+ let reg_pwd = /^.{6,20}$/;
+ let isPwd = reg_pwd.test(this.formData.pwd);
+ return isPwd;
+ },
+ isCode(){
+ let reg_code = /^\d{6}$/;
+ let isCode = reg_code.test(this.formData.code);
+ return isCode;
+ }
+ },
methods:{
...mapMutations({
setUserInfo: 'user/login'
diff --git a/uni_modules/uni-login-page/pages/index/index.vue b/uni_modules/uni-login-page/pages/index/index.vue
index 42e2b93b8d0a86e3ccb64441a17df818afc44e0b..facf935f70a97649f47143055aabb162366567df 100644
--- a/uni_modules/uni-login-page/pages/index/index.vue
+++ b/uni_modules/uni-login-page/pages/index/index.vue
@@ -70,19 +70,10 @@
},
computed: {
canGetShortMsg() {
- let reg = /^1\d{10}$/;
- return reg.test(this.formData.phone);
+ return this.isPhone;
}
},
methods: {
- // 触发提交表单
- submit() {
- this.$refs.form.submit().then(res => {
- console.log('表单数据信息:', res);
- }).catch(err => {
- console.log('表单错误信息:', err);
- })
- },
selectPhoneArea(event) {
uni.showToast({
title: '当前仅支持中国大陆手机号',
@@ -91,7 +82,6 @@
// this.currenPhoneArea = this.phoneArea[event.detail.value];
},
sendShortMsg() {
- if (!this.canGetShortMsg) return;
/**
* 发送验证吗
*/
diff --git a/uni_modules/uni-login-page/pages/index/phone-code.vue b/uni_modules/uni-login-page/pages/index/phone-code.vue
index 60988933ac4a3b183a271ed4c2d59bf9a4775443..e9f5c436c4586b289ffe409c64dc8429dc6c6cde 100644
--- a/uni_modules/uni-login-page/pages/index/phone-code.vue
+++ b/uni_modules/uni-login-page/pages/index/phone-code.vue
@@ -38,11 +38,7 @@
return `验证码已通过短信发送至${this.currenPhoneArea} ${this.formData.phone}。`;
},
canSubmit() {
- let reg_phone = /^1\d{10}$/;
- let reg_code = /^\d{6}$/;
- let isPhone = reg_phone.test(this.formData.phone);
- let isCode = reg_code.test(this.formData.code);
- return isPhone && isCode;
+ return this.isPhone && this.isCode;
}
},
onLoad({phoneNumber,phoneArea}) {
diff --git a/uni_modules/uni-login-page/pages/index/pwd-login.vue b/uni_modules/uni-login-page/pages/index/pwd-login.vue
index a94fadfc745ad307a78c27f0acd0f31a78bca241..4d236a0e0152b8ce549760880756cdddedfcca02 100644
--- a/uni_modules/uni-login-page/pages/index/pwd-login.vue
+++ b/uni_modules/uni-login-page/pages/index/pwd-login.vue
@@ -40,25 +40,13 @@
mixins:[mixin],
data() {
return {
- link: [{
- text: '用户协议',
- to: '/pages/ucenter/agree-list/service/service'
- }, {
- text: '隐私政策',
- to: '/pages/ucenter/agree-list/privacy/privacy'
- }],
phoneArea: ['+86'],
currenPhoneArea: '+86',
}
},
computed: {
canLogin() {
- let reg_phone = /^1\d{10}$/;
- let reg_pwd = /^.{6,20}$/;
- let isPhone = reg_phone.test(this.formData.phone);
-
- let isPwd = reg_pwd.test(this.formData.pwd);
- return isPhone && isPwd;
+ return this.isPhone && this.isPwd;
}
},
methods: {
@@ -66,9 +54,7 @@
* 页面跳转,找回密码
*/
toRetrievePwd() {
- let reg_phone = /^1\d{10}$/;
- let isPhone = reg_phone.test(this.formData.phone);
- if (!isPhone) return uni.showToast({
+ if (!this.isPhone) return uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
});
@@ -81,7 +67,6 @@
* 密码登录
*/
pwdLogin() {
- if (!this.canLogin) return;
// 下边是可以登录
uniCloud.callFunction({
name:"user-center",
diff --git a/uni_modules/uni-login-page/pages/index/pwd-retrieve.vue b/uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
index 66823f0a3905dff446e96153b4615b97bf99034f..7594f968ea43dbbbf86e25c39ef0ee69aebd5149 100644
--- a/uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
+++ b/uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
@@ -41,13 +41,7 @@ import mixin from '../../common/loginPage.mixin.js';
return `验证码已通过短信发送至${this.currenPhoneArea} ${this.formData.phone}。密码为6 - 20位`
},
canSubmit() {
- let reg_phone = /^1\d{10}$/;
- let reg_pwd = /^.{6,20}$/;
- let reg_code = /^\d{6}$/;
- let isPhone = reg_phone.test(this.formData.phone);
- let isPwd = reg_pwd.test(this.formData.pwd);
- let isCode = reg_code.test(this.formData.code);
- return isPhone && isPwd && isCode;
+ return this.isPhone && this.isPwd && this.isCode;
}
},
onLoad(event) {