Browse Source

uview-plus依赖更新

fanghuisheng 1 year ago
parent
commit
c744fb8dae
100 changed files with 2868 additions and 1007 deletions
  1. 10 10
      src/uni_modules/uview-plus/README.md
  2. 80 0
      src/uni_modules/uview-plus/changelog.md
  3. 11 11
      src/uni_modules/uview-plus/components/u-action-sheet/props.js
  4. 1 1
      src/uni_modules/uview-plus/components/u-action-sheet/u-action-sheet.vue
  5. 12 12
      src/uni_modules/uview-plus/components/u-album/props.js
  6. 2 2
      src/uni_modules/uview-plus/components/u-album/u-album.vue
  7. 9 9
      src/uni_modules/uview-plus/components/u-alert/props.js
  8. 10 10
      src/uni_modules/uview-plus/components/u-avatar-group/props.js
  9. 2 2
      src/uni_modules/uview-plus/components/u-avatar-group/u-avatar-group.vue
  10. 15 15
      src/uni_modules/uview-plus/components/u-avatar/props.js
  11. 3 2
      src/uni_modules/uview-plus/components/u-avatar/u-avatar.vue
  12. 11 11
      src/uni_modules/uview-plus/components/u-back-top/props.js
  13. 1 1
      src/uni_modules/uview-plus/components/u-back-top/u-back-top.vue
  14. 15 15
      src/uni_modules/uview-plus/components/u-badge/props.js
  15. 1 1
      src/uni_modules/uview-plus/components/u-badge/u-badge.vue
  16. 29 38
      src/uni_modules/uview-plus/components/u-button/props.js
  17. 12 7
      src/uni_modules/uview-plus/components/u-button/u-button.vue
  18. 1 0
      src/uni_modules/uview-plus/components/u-button/vue.scss
  19. 1 1
      src/uni_modules/uview-plus/components/u-calendar/month.vue
  20. 28 28
      src/uni_modules/uview-plus/components/u-calendar/props.js
  21. 4 3
      src/uni_modules/uview-plus/components/u-calendar/u-calendar.vue
  22. 1 1
      src/uni_modules/uview-plus/components/u-car-keyboard/props.js
  23. 1 1
      src/uni_modules/uview-plus/components/u-car-keyboard/u-car-keyboard.vue
  24. 3 3
      src/uni_modules/uview-plus/components/u-cell-group/props.js
  25. 1 1
      src/uni_modules/uview-plus/components/u-cell-group/u-cell-group.vue
  26. 21 21
      src/uni_modules/uview-plus/components/u-cell/props.js
  27. 21 8
      src/uni_modules/uview-plus/components/u-cell/u-cell.vue
  28. 17 17
      src/uni_modules/uview-plus/components/u-checkbox-group/props.js
  29. 19 14
      src/uni_modules/uview-plus/components/u-checkbox/props.js
  30. 30 18
      src/uni_modules/uview-plus/components/u-checkbox/u-checkbox.vue
  31. 2 2
      src/uni_modules/uview-plus/components/u-circle-progress/props.js
  32. 17 17
      src/uni_modules/uview-plus/components/u-code-input/props.js
  33. 7 7
      src/uni_modules/uview-plus/components/u-code/props.js
  34. 1 1
      src/uni_modules/uview-plus/components/u-code/u-code.vue
  35. 6 6
      src/uni_modules/uview-plus/components/u-col/props.js
  36. 12 12
      src/uni_modules/uview-plus/components/u-collapse-item/props.js
  37. 4 4
      src/uni_modules/uview-plus/components/u-collapse/props.js
  38. 11 11
      src/uni_modules/uview-plus/components/u-column-notice/props.js
  39. 70 0
      src/uni_modules/uview-plus/components/u-copy/u-copy.vue
  40. 5 5
      src/uni_modules/uview-plus/components/u-count-down/props.js
  41. 1 1
      src/uni_modules/uview-plus/components/u-count-down/u-count-down.vue
  42. 12 12
      src/uni_modules/uview-plus/components/u-count-to/props.js
  43. 38 25
      src/uni_modules/uview-plus/components/u-datetime-picker/props.js
  44. 58 3
      src/uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.vue
  45. 9 9
      src/uni_modules/uview-plus/components/u-divider/props.js
  46. 10 1
      src/uni_modules/uview-plus/components/u-dropdown-item/props.js
  47. 89 118
      src/uni_modules/uview-plus/components/u-dropdown-item/u-dropdown-item.vue
  48. 9 15
      src/uni_modules/uview-plus/components/u-dropdown/props.js
  49. 202 77
      src/uni_modules/uview-plus/components/u-dropdown/u-dropdown.vue
  50. 12 12
      src/uni_modules/uview-plus/components/u-empty/props.js
  51. 19 9
      src/uni_modules/uview-plus/components/u-form-item/props.js
  52. 2 1
      src/uni_modules/uview-plus/components/u-form-item/u-form-item.vue
  53. 9 9
      src/uni_modules/uview-plus/components/u-form/props.js
  54. 3 3
      src/uni_modules/uview-plus/components/u-form/u-form.vue
  55. 5 5
      src/uni_modules/uview-plus/components/u-gap/props.js
  56. 5 4
      src/uni_modules/uview-plus/components/u-gap/u-gap.vue
  57. 3 3
      src/uni_modules/uview-plus/components/u-grid-item/props.js
  58. 8 7
      src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue
  59. 4 4
      src/uni_modules/uview-plus/components/u-grid/props.js
  60. 4 2
      src/uni_modules/uview-plus/components/u-grid/u-grid.vue
  61. 18 18
      src/uni_modules/uview-plus/components/u-icon/props.js
  62. 9 6
      src/uni_modules/uview-plus/components/u-icon/u-icon.vue
  63. 17 17
      src/uni_modules/uview-plus/components/u-image/props.js
  64. 1 1
      src/uni_modules/uview-plus/components/u-image/u-image.vue
  65. 6 6
      src/uni_modules/uview-plus/components/u-index-anchor/props.js
  66. 1 1
      src/uni_modules/uview-plus/components/u-index-anchor/u-index-anchor.vue
  67. 1 1
      src/uni_modules/uview-plus/components/u-index-item/props.js
  68. 1 1
      src/uni_modules/uview-plus/components/u-index-item/u-index-item.vue
  69. 6 6
      src/uni_modules/uview-plus/components/u-index-list/props.js
  70. 3 2
      src/uni_modules/uview-plus/components/u-index-list/u-index-list.vue
  71. 36 36
      src/uni_modules/uview-plus/components/u-input/props.js
  72. 11 5
      src/uni_modules/uview-plus/components/u-input/u-input.vue
  73. 17 17
      src/uni_modules/uview-plus/components/u-keyboard/props.js
  74. 62 0
      src/uni_modules/uview-plus/components/u-lazy-load/u-lazy-load.vue
  75. 6 6
      src/uni_modules/uview-plus/components/u-line-progress/props.js
  76. 7 7
      src/uni_modules/uview-plus/components/u-line/props.js
  77. 8 8
      src/uni_modules/uview-plus/components/u-link/props.js
  78. 2 2
      src/uni_modules/uview-plus/components/u-list-item/props.js
  79. 15 15
      src/uni_modules/uview-plus/components/u-list/props.js
  80. 12 12
      src/uni_modules/uview-plus/components/u-loading-icon/props.js
  81. 10 10
      src/uni_modules/uview-plus/components/u-loading-page/props.js
  82. 19 19
      src/uni_modules/uview-plus/components/u-loadmore/props.js
  83. 17 17
      src/uni_modules/uview-plus/components/u-modal/props.js
  84. 17 17
      src/uni_modules/uview-plus/components/u-navbar/props.js
  85. 4 4
      src/uni_modules/uview-plus/components/u-no-network/props.js
  86. 14 14
      src/uni_modules/uview-plus/components/u-notice-bar/props.js
  87. 10 10
      src/uni_modules/uview-plus/components/u-notify/props.js
  88. 23 23
      src/uni_modules/uview-plus/components/u-number-box/props.js
  89. 25 5
      src/uni_modules/uview-plus/components/u-number-box/u-number-box.vue
  90. 4 4
      src/uni_modules/uview-plus/components/u-number-keyboard/props.js
  91. 5 5
      src/uni_modules/uview-plus/components/u-overlay/props.js
  92. 9 9
      src/uni_modules/uview-plus/components/u-parse/props.js
  93. 1 1
      src/uni_modules/uview-plus/components/u-picker-column/props.js
  94. 17 17
      src/uni_modules/uview-plus/components/u-picker/props.js
  95. 5 2
      src/uni_modules/uview-plus/components/u-picker/u-picker.vue
  96. 16 16
      src/uni_modules/uview-plus/components/u-popup/props.js
  97. 1 1
      src/uni_modules/uview-plus/components/u-popup/u-popup.vue
  98. 1206 0
      src/uni_modules/uview-plus/components/u-qrcode/qrcode.js
  99. 199 0
      src/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue
  100. 18 18
      src/uni_modules/uview-plus/components/u-radio-group/props.js

+ 10 - 10
src/uni_modules/uview-plus/README.md

@@ -7,14 +7,14 @@
 [![stars](https://img.shields.io/github/stars/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus)
 [![forks](https://img.shields.io/github/forks/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus)
 [![issues](https://img.shields.io/github/issues/ijry/uview-plus?style=flat-square&logo=GitHub)](https://github.com/ijry/uview-plus/issues)
-[![release](https://img.shields.io/github/v/release/ijry/uview-plus?style=flat-square)](https://gitee.com/uiadmin/uview-plus/releases)
+[![release](https://img.shields.io/github/v/release/ijry/uview-plus?style=flat-square)](https://gitee.com/jry/uview-plus/releases)
 [![license](https://img.shields.io/github/license/ijry/uview-plus?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
 
 ## 说明
 
 uview-plus,是uni-app全面兼容vue3/nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水。uview-plus是基于uView2.x移植的支持vue3的版本,感谢uView。
 
-## [官方文档:https://uiadmin.net/uview-plus](https://uiadmin.net/uview-plus)
+## [官方文档:https://uview-plus.jiangruyi.com](https://uview-plus.jiangruyi.com)
 
 
 ## 预览
@@ -22,18 +22,18 @@ uview-plus,是uni-app全面兼容vue3/nvue的uni-app生态框架,全面的
 您可以通过**微信**扫码,查看最佳的演示效果。
 <br>
 <br>
-<img src="https://uiadmin.net/uview-plus/common/h5_qrcode.png" width="220" height="220" >
+<img src="https://uview-plus.jiangruyi.com/common/h5_qrcode.png" width="220" height="220" >
 
 ## 链接
 
-- [官方文档](https://uiadmin.net/uview-plus)
-- [更新日志](https://uiadmin.net/uview-plus/components/changelog.html)
-- [升级指南](https://uiadmin.net/uview-plus/components/changeGuide.html)
-- [关于我们](https://uiadmin.net/uview-plus/cooperation/about.html)
+- [官方文档](https://uview-plus.jiangruyi.com)
+- [更新日志](https://uview-plus.jiangruyi.com/components/changelog.html)
+- [升级指南](https://uview-plus.jiangruyi.com/components/changeGuide.html)
+- [关于我们](https://uview-plus.jiangruyi.com/cooperation/about.html)
 
 ## 交流反馈
 
-欢迎加入我们的QQ群交流反馈:[点此跳转](https://uiadmin.net/uview-plus/components/addQQGroup.html)
+欢迎加入我们的QQ群交流反馈:[点此跳转](https://uview-plus.jiangruyi.com/components/addQQGroup.html)
 
 ## 关于PR
 
@@ -44,11 +44,11 @@ uview-plus,是uni-app全面兼容vue3/nvue的uni-app生态框架,全面的
 
 #### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?name=uview-plus](https://ext.dcloud.net.cn/plugin?name=uview-plus)
 
-请通过[官网安装文档](https://uiadmin.net/uview-plus/components/install.html)了解更详细的内容
+请通过[官网安装文档](https://uview-plus.jiangruyi.com/components/install.html)了解更详细的内容
 
 ## 快速上手
 
-请通过[快速上手](https://uiadmin.net/uview-plus/components/quickstart.html)了解更详细的内容
+请通过[快速上手](https://uview-plus.jiangruyi.com/components/quickstart.html)了解更详细的内容
 
 ## 使用方法
 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。

+ 80 - 0
src/uni_modules/uview-plus/changelog.md

@@ -1,3 +1,83 @@
+## 3.2.8(2024-04-15)
+修复up-tag语法错
+## 3.2.7(2024-04-15)
+修复下拉菜单背景色在支付宝小程序无效
+
+setConfig改为浅拷贝解决无法用import导入代替uni.$u.props设置
+
+## 3.2.6(2024-04-14)
+修复某些情况下滑动单元格默认右侧按钮是展开的问题
+## 3.2.5(2024-04-13)
+调整分段器尺寸及修复窗口大小改变时重新计算尺寸
+
+多个组件支持cursor-pointer增强PC端体验
+
+## 3.2.4(2024-04-12)
+初步支持typescript
+## 3.2.3(2024-04-12)
+fix: 修复square属性在小程序下无效问题
+
+fix:修复lastIndex异常导致的column异常问题
+
+fix: alipayapp picker style
+
+feat(button): 添加用户同意隐私协议事件回调
+
+fix: input switch password
+
+fix: 修复u-code组件keepRuning失效问题
+
+feat: form-item添加labelPosition属性
+
+新增dropdown组件
+
+分段器支持内部current值
+
+优化cell和action-sheet视觉大小
+
+修复tabs文字换行
+
+## 3.2.2(2024-04-11)
+修复换行符问题
+## 3.2.1(2024-04-11)
+修复演示H5二维码
+
+fix: #270 ReadMore 展开阅读更多内容变化兼容
+
+fix: #238Calendar组件maxDate修改为不能小于minDate
+
+checkbox支持独立使用
+
+修复popup中在微信小程序中真机调试滚动失效
+
+## 3.2.0(2024-04-10)
+修复轮播图在nvue显示
+修复疑似u-slider名称被占用导致slider在App下不显示
+解决微信小程序提示 Some selectors are not allowed in component wxss
+示例中u-前缀统一为up-
+增加瀑布流与图片懒加载组件
+fix: #308修复tag组件缺失iconColor参数
+fix: #297使用grid布局解决目前编译为抖音小程序无法开启virtualHost
+## 3.1.52(2024-04-07)
+工具类方法调用import化改造
+新增up-copy复制组件
+## 3.1.51(2024-04-07)
+优化时间选择器自带输入框格式化显示
+防止按钮文字换行
+修复订单列表模板滑动
+增加u-qrcode二维码组件
+## 3.1.49(2024-03-27)
+日期时间组件支持自带输入框
+fix: popup弹窗滚动穿透问题
+fix: 修复小程序numberbox bug
+## 3.1.48(2024-03-18)
+fix:[plugin:uni:pre-css] Unbalanced delimiter found in string
+## 3.1.47(2024-03-18)
+fix: setConfig设置组件默认参数无效问题
+fix: 修复自定义图标无效问题
+feat: 增加u-form-item单独设置规则变量
+fix:#293小程序是自定义导航栏的时候即传了customNavHeight的时候会出现跳转偏移的情况
+
 ## 3.1.46(2024-01-29)
 beforeUnmount
 ## 3.1.45(2024-01-24)

+ 11 - 11
src/uni_modules/uview-plus/components/u-action-sheet/props.js

@@ -1,55 +1,55 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 操作菜单是否展示 (默认false)
         show: {
             type: Boolean,
-            default: defprops.actionSheet.show
+            default: () => defProps.actionSheet.show
         },
         // 标题
         title: {
             type: String,
-            default: defprops.actionSheet.title
+            default: () => defProps.actionSheet.title
         },
         // 选项上方的描述信息
         description: {
             type: String,
-            default: defprops.actionSheet.description
+            default: () => defProps.actionSheet.description
         },
         // 数据
         actions: {
             type: Array,
-            default: defprops.actionSheet.actions
+            default: () => defProps.actionSheet.actions
         },
         // 取消按钮的文字,不为空时显示按钮
         cancelText: {
             type: String,
-            default: defprops.actionSheet.cancelText
+            default: () => defProps.actionSheet.cancelText
         },
         // 点击某个菜单项时是否关闭弹窗
         closeOnClickAction: {
             type: Boolean,
-            default: defprops.actionSheet.closeOnClickAction
+            default: () => defProps.actionSheet.closeOnClickAction
         },
         // 处理底部安全区(默认true)
         safeAreaInsetBottom: {
             type: Boolean,
-            default: defprops.actionSheet.safeAreaInsetBottom
+            default: () => defProps.actionSheet.safeAreaInsetBottom
         },
         // 小程序的打开方式
         openType: {
             type: String,
-            default: defprops.actionSheet.openType
+            default: () => defProps.actionSheet.openType
         },
         // 点击遮罩是否允许关闭 (默认true)
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.actionSheet.closeOnClickOverlay
+            default: () => defProps.actionSheet.closeOnClickOverlay
         },
         // 圆角值
         round: {
             type: [Boolean, String, Number],
-            default: defprops.actionSheet.round
+            default: () => defProps.actionSheet.round
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-action-sheet/u-action-sheet.vue

@@ -202,7 +202,7 @@
 	$u-action-sheet-description-font-size:13px !default;
 	$u-action-sheet-description-color:14px !default;
 	$u-action-sheet-description-margin: 18px 15px !default;
-	$u-action-sheet-item-wrap-item-padding:15px !default;
+	$u-action-sheet-item-wrap-item-padding:17px !default;
 	$u-action-sheet-item-wrap-name-font-size:16px !default;
 	$u-action-sheet-item-wrap-subname-font-size:13px !default;
 	$u-action-sheet-item-wrap-subname-color: #c0c4cc !default;

+ 12 - 12
src/uni_modules/uview-plus/components/u-album/props.js

@@ -1,60 +1,60 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 图片地址,Array<String>|Array<Object>形式
         urls: {
             type: Array,
-            default: defprops.album.urls
+            default: () => defProps.album.urls
         },
         // 指定从数组的对象元素中读取哪个属性作为图片地址
         keyName: {
             type: String,
-            default: defprops.album.keyName
+            default: () => defProps.album.keyName
         },
         // 单图时,图片长边的长度
         singleSize: {
             type: [String, Number],
-            default: defprops.album.singleSize
+            default: () => defProps.album.singleSize
         },
         // 多图时,图片边长
         multipleSize: {
             type: [String, Number],
-            default: defprops.album.multipleSize
+            default: () => defProps.album.multipleSize
         },
         // 多图时,图片水平和垂直之间的间隔
         space: {
             type: [String, Number],
-            default: defprops.album.space
+            default: () => defProps.album.space
         },
         // 单图时,图片缩放裁剪的模式
         singleMode: {
             type: String,
-            default: defprops.album.singleMode
+            default: () => defProps.album.singleMode
         },
         // 多图时,图片缩放裁剪的模式
         multipleMode: {
             type: String,
-            default: defprops.album.multipleMode
+            default: () => defProps.album.multipleMode
         },
         // 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量
         maxCount: {
             type: [String, Number],
-            default: defprops.album.maxCount
+            default: () => defProps.album.maxCount
         },
         // 是否可以预览图片
         previewFullImage: {
             type: Boolean,
-            default: defprops.album.previewFullImage
+            default: () => defProps.album.previewFullImage
         },
         // 每行展示图片数量,如设置,singleSize和multipleSize将会无效
         rowCount: {
             type: [String, Number],
-            default: defprops.album.rowCount
+            default: () => defProps.album.rowCount
         },
         // 超出maxCount时是否显示查看更多的提示
         showMore: {
             type: Boolean,
-            default: defprops.album.showMore
+            default: () => defProps.album.showMore
         }
     }
 }

+ 2 - 2
src/uni_modules/uview-plus/components/u-album/u-album.vue

@@ -39,13 +39,13 @@
                     "
                     class="u-album__row__wrapper__text"
                 >
-                    <u--text
+                    <up-text
                         :text="`+${urls.length - maxCount}`"
                         color="#fff"
                         :size="multipleSize * 0.3"
                         align="center"
                         customStyle="justify-content: center"
-                    ></u--text>
+                    ></up-text>
                 </view>
             </view>
         </view>

+ 9 - 9
src/uni_modules/uview-plus/components/u-alert/props.js

@@ -1,45 +1,45 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 显示文字
         title: {
             type: String,
-            default: defprops.alert.title
+            default: () => defProps.alert.title
         },
         // 主题,success/warning/info/error
         type: {
             type: String,
-            default: defprops.alert.type
+            default: () => defProps.alert.type
         },
         // 辅助性文字
         description: {
             type: String,
-            default: defprops.alert.description
+            default: () => defProps.alert.description
         },
         // 是否可关闭
         closable: {
             type: Boolean,
-            default: defprops.alert.closable
+            default: () => defProps.alert.closable
         },
         // 是否显示图标
         showIcon: {
             type: Boolean,
-            default: defprops.alert.showIcon
+            default: () => defProps.alert.showIcon
         },
         // 浅或深色调,light-浅色,dark-深色
         effect: {
             type: String,
-            default: defprops.alert.effect
+            default: () => defProps.alert.effect
         },
         // 文字是否居中
         center: {
             type: Boolean,
-            default: defprops.alert.center
+            default: () => defProps.alert.center
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.alert.fontSize
+            default: () => defProps.alert.fontSize
         }
     }
 }

+ 10 - 10
src/uni_modules/uview-plus/components/u-avatar-group/props.js

@@ -1,40 +1,40 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 头像图片组
         urls: {
             type: Array,
-            default: defprops.avatarGroup.urls
+            default: () => defProps.avatarGroup.urls
         },
         // 最多展示的头像数量
         maxCount: {
             type: [String, Number],
-            default: defprops.avatarGroup.maxCount
+            default: () => defProps.avatarGroup.maxCount
         },
         // 头像形状
         shape: {
             type: String,
-            default: defprops.avatarGroup.shape
+            default: () => defProps.avatarGroup.shape
         },
         // 图片裁剪模式
         mode: {
             type: String,
-            default: defprops.avatarGroup.mode
+            default: () => defProps.avatarGroup.mode
         },
         // 超出maxCount时是否显示查看更多的提示
         showMore: {
             type: Boolean,
-            default: defprops.avatarGroup.showMore
+            default: () => defProps.avatarGroup.showMore
         },
         // 头像大小
         size: {
             type: [String, Number],
-            default: defprops.avatarGroup.size
+            default: () => defProps.avatarGroup.size
         },
         // 指定从数组的对象元素中读取哪个属性作为图片地址
         keyName: {
             type: String,
-            default: defprops.avatarGroup.keyName
+            default: () => defProps.avatarGroup.keyName
         },
 		// 头像之间的遮挡比例
         gap: {
@@ -42,12 +42,12 @@ export default {
             validator(value) {
                 return value >= 0 && value <= 1
             },
-            default: defprops.avatarGroup.gap
+            default: () => defProps.avatarGroup.gap
         },
 		// 需额外显示的值
 		extraValue: {
 			type: [Number, String],
-			default: defprops.avatarGroup.extraValue
+			default: () => defProps.avatarGroup.extraValue
 		}
     }
 }

+ 2 - 2
src/uni_modules/uview-plus/components/u-avatar-group/u-avatar-group.vue

@@ -19,13 +19,13 @@
 			    v-if="showMore && index === showUrl.length - 1 && (urls.length > maxCount || extraValue > 0)"
 				@tap="clickHandler"
 			>
-				<u--text
+				<up-text
 				    color="#ffffff"
 				    :size="size * 0.4"
 				    :text="`+${extraValue || urls.length - showUrl.length}`"
 					align="center"
 					customStyle="justify-content: center"
-				></u--text>
+				></up-text>
 			</view>
 		</view>
 	</view>

+ 15 - 15
src/uni_modules/uview-plus/components/u-avatar/props.js

@@ -1,65 +1,65 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 头像图片路径(不能为相对路径)
         src: {
             type: String,
-            default: defprops.avatar.src
+            default: () => defProps.avatar.src
         },
         // 头像形状,circle-圆形,square-方形
         shape: {
             type: String,
-            default: defprops.avatar.shape
+            default: () => defProps.avatar.shape
         },
         // 头像尺寸
         size: {
             type: [String, Number],
-            default: defprops.avatar.size
+            default: () => defProps.avatar.size
         },
         // 裁剪模式
         mode: {
             type: String,
-            default: defprops.avatar.mode
+            default: () => defProps.avatar.mode
         },
         // 显示的文字
         text: {
             type: String,
-            default: defprops.avatar.text
+            default: () => defProps.avatar.text
         },
         // 背景色
         bgColor: {
             type: String,
-            default: defprops.avatar.bgColor
+            default: () => defProps.avatar.bgColor
         },
         // 文字颜色
         color: {
             type: String,
-            default: defprops.avatar.color
+            default: () => defProps.avatar.color
         },
         // 文字大小
         fontSize: {
             type: [String, Number],
-            default: defprops.avatar.fontSize
+            default: () => defProps.avatar.fontSize
         },
         // 显示的图标
         icon: {
             type: String,
-            default: defprops.avatar.icon
+            default: () => defProps.avatar.icon
         },
         // 显示小程序头像,只对百度,微信,QQ小程序有效
         mpAvatar: {
             type: Boolean,
-            default: defprops.avatar.mpAvatar
+            default: () => defProps.avatar.mpAvatar
         },
         // 是否使用随机背景色
         randomBgColor: {
             type: Boolean,
-            default: defprops.avatar.randomBgColor
+            default: () => defProps.avatar.randomBgColor
         },
         // 加载失败的默认头像(组件有内置默认图片)
         defaultUrl: {
             type: String,
-            default: defprops.avatar.defaultUrl
+            default: () => defProps.avatar.defaultUrl
         },
         // 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间
         colorIndex: {
@@ -68,12 +68,12 @@ export default {
             validator(n) {
                 return uni.$u.test.range(n, [0, 19]) || n === ''
             },
-            default: defprops.avatar.colorIndex
+            default: () => defProps.avatar.colorIndex
         },
         // 组件标识符
         name: {
             type: String,
-            default: defprops.avatar.name
+            default: () => defProps.avatar.name
         }
     }
 }

+ 3 - 2
src/uni_modules/uview-plus/components/u-avatar/u-avatar.vue

@@ -29,14 +29,14 @@
 				:size="fontSize"
 				:color="color"
 			></u-icon>
-			<u--text
+			<up-text
 				v-else-if="text"
 				:text="text"
 				:size="fontSize"
 				:color="color"
 				align="center"
 				customStyle="justify-content: center"
-			></u--text>
+			></up-text>
 			<image
 				class="u-avatar__image"
 				v-else
@@ -165,6 +165,7 @@
 		&__image {
 			&--circle {
 				border-radius: 100px;
+                overflow: hidden;
 			}
 
 			&--square {

+ 11 - 11
src/uni_modules/uview-plus/components/u-back-top/props.js

@@ -1,55 +1,55 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 返回顶部的形状,circle-圆形,square-方形
         mode: {
             type: String,
-            default: defprops.backtop.mode
+            default: () => defProps.backtop.mode
         },
         // 自定义图标
         icon: {
             type: String,
-            default: defprops.backtop.icon
+            default: () => defProps.backtop.icon
         },
         // 提示文字
         text: {
             type: String,
-            default: defprops.backtop.text
+            default: () => defProps.backtop.text
         },
         // 返回顶部滚动时间
         duration: {
             type: [String, Number],
-            default: defprops.backtop.duration
+            default: () => defProps.backtop.duration
         },
         // 滚动距离
         scrollTop: {
             type: [String, Number],
-            default: defprops.backtop.scrollTop
+            default: () => defProps.backtop.scrollTop
         },
         // 距离顶部多少距离显示,单位px
         top: {
             type: [String, Number],
-            default: defprops.backtop.top
+            default: () => defProps.backtop.top
         },
         // 返回顶部按钮到底部的距离,单位px
         bottom: {
             type: [String, Number],
-            default: defprops.backtop.bottom
+            default: () => defProps.backtop.bottom
         },
         // 返回顶部按钮到右边的距离,单位px
         right: {
             type: [String, Number],
-            default: defprops.backtop.right
+            default: () => defProps.backtop.right
         },
         // 层级
         zIndex: {
             type: [String, Number],
-            default: defprops.backtop.zIndex
+            default: () => defProps.backtop.zIndex
         },
         // 图标的样式,对象形式
         iconStyle: {
             type: Object,
-            default: defprops.backtop.iconStyle
+            default: () => defProps.backtop.iconStyle
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-back-top/u-back-top.vue

@@ -33,7 +33,7 @@
 	/**
 	 * backTop 返回顶部
 	 * @description 本组件一个用于长页面,滑动一定距离后,出现返回顶部按钮,方便快速返回顶部的场景。
-	 * @tutorial https://uiadmin.net/uview-plus/components/backTop.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/backTop.html
 	 * 
 	 * @property {String}			mode  		返回顶部的形状,circle-圆形,square-方形 (默认 'circle' )
 	 * @property {String} 			icon 		自定义图标 (默认 'arrow-upward' ) 见官方文档示例

+ 15 - 15
src/uni_modules/uview-plus/components/u-badge/props.js

@@ -1,55 +1,55 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否显示圆点
         isDot: {
             type: Boolean,
-            default: defprops.badge.isDot
+            default: () => defProps.badge.isDot
         },
         // 显示的内容
         value: {
             type: [Number, String],
-            default: defprops.badge.value
+            default: () => defProps.badge.value
         },
         // 显示的内容
         modelValue: {
             type: [Number, String],
-            default: defprops.badge.modelValue
+            default: () => defProps.badge.modelValue
         },
         // 是否显示
         show: {
             type: Boolean,
-            default: defprops.badge.show
+            default: () => defProps.badge.show
         },
         // 最大值,超过最大值会显示 '{max}+'
         max: {
             type: [Number, String],
-            default: defprops.badge.max
+            default: () => defProps.badge.max
         },
         // 主题类型,error|warning|success|primary
         type: {
             type: String,
-            default: defprops.badge.type
+            default: () => defProps.badge.type
         },
         // 当数值为 0 时,是否展示 Badge
         showZero: {
             type: Boolean,
-            default: defprops.badge.showZero
+            default: () => defProps.badge.showZero
         },
         // 背景颜色,优先级比type高,如设置,type参数会失效
         bgColor: {
             type: [String, null],
-            default: defprops.badge.bgColor
+            default: () => defProps.badge.bgColor
         },
         // 字体颜色
         color: {
             type: [String, null],
-            default: defprops.badge.color
+            default: () => defProps.badge.color
         },
         // 徽标形状,circle-四角均为圆角,horn-左下角为直角
         shape: {
             type: String,
-            default: defprops.badge.shape
+            default: () => defProps.badge.shape
         },
         // 设置数字的显示方式,overflow|ellipsis|limit
         // overflow会根据max字段判断,超出显示`${max}+`
@@ -57,22 +57,22 @@ export default {
         // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数
         numberType: {
             type: String,
-            default: defprops.badge.numberType
+            default: () => defProps.badge.numberType
         },
         // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
         offset: {
             type: Array,
-            default: defprops.badge.offset
+            default: () => defProps.badge.offset
         },
         // 是否反转背景和字体颜色
         inverted: {
             type: Boolean,
-            default: defprops.badge.inverted
+            default: () => defProps.badge.inverted
         },
         // 是否绝对定位
         absolute: {
             type: Boolean,
-            default: defprops.badge.absolute
+            default: () => defProps.badge.absolute
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-badge/u-badge.vue

@@ -14,7 +14,7 @@
 	/**
 	 * badge 徽标数
 	 * @description 该组件一般用于图标右上角显示未读的消息数量,提示用户点击,有圆点和圆包含文字两种形式。
-	 * @tutorial https://uiadmin.net/uview-plus/components/badge.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/badge.html
 	 * 
 	 * @property {Boolean} 			isDot 		是否显示圆点 (默认 false )
 	 * @property {String | Number} 	value 		显示的内容

+ 29 - 38
src/uni_modules/uview-plus/components/u-button/props.js

@@ -1,162 +1,153 @@
-/*
- * @Author       : LQ
- * @Description  :
- * @version      : 1.0
- * @Date         : 2021-08-16 10:04:04
- * @LastAuthor   : LQ
- * @lastTime     : 2021-08-16 10:04:24
- * @FilePath     : /u-view2.0/uview-ui/components/u-button/props.js
- */
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否细边框
         hairline: {
             type: Boolean,
-            default: defprops.button.hairline
+            default: () => defProps.button.hairline
         },
         // 按钮的预置样式,info,primary,error,warning,success
         type: {
             type: String,
-            default: defprops.button.type
+            default: () => defProps.button.type
         },
         // 按钮尺寸,large,normal,small,mini
         size: {
             type: String,
-            default: defprops.button.size
+            default: () => defProps.button.size
         },
         // 按钮形状,circle(两边为半圆),square(带圆角)
         shape: {
             type: String,
-            default: defprops.button.shape
+            default: () => defProps.button.shape
         },
         // 按钮是否镂空
         plain: {
             type: Boolean,
-            default: defprops.button.plain
+            default: () => defProps.button.plain
         },
         // 是否禁止状态
         disabled: {
             type: Boolean,
-            default: defprops.button.disabled
+            default: () => defProps.button.disabled
         },
         // 是否加载中
         loading: {
             type: Boolean,
-            default: defprops.button.loading
+            default: () => defProps.button.loading
         },
         // 加载中提示文字
         loadingText: {
             type: [String, Number],
-            default: defprops.button.loadingText
+            default: () => defProps.button.loadingText
         },
         // 加载状态图标类型
         loadingMode: {
             type: String,
-            default: defprops.button.loadingMode
+            default: () => defProps.button.loadingMode
         },
         // 加载图标大小
         loadingSize: {
             type: [String, Number],
-            default: defprops.button.loadingSize
+            default: () => defProps.button.loadingSize
         },
         // 开放能力,具体请看uniapp稳定关于button组件部分说明
         // https://uniapp.dcloud.io/component/button
         openType: {
             type: String,
-            default: defprops.button.openType
+            default: () => defProps.button.openType
         },
         // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
         // 取值为submit(提交表单),reset(重置表单)
         formType: {
             type: String,
-            default: defprops.button.formType
+            default: () => defProps.button.formType
         },
         // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
         // 只微信小程序、QQ小程序有效
         appParameter: {
             type: String,
-            default: defprops.button.appParameter
+            default: () => defProps.button.appParameter
         },
         // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
         hoverStopPropagation: {
             type: Boolean,
-            default: defprops.button.hoverStopPropagation
+            default: () => defProps.button.hoverStopPropagation
         },
         // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
         lang: {
             type: String,
-            default: defprops.button.lang
+            default: () => defProps.button.lang
         },
         // 会话来源,open-type="contact"时有效。只微信小程序有效
         sessionFrom: {
             type: String,
-            default: defprops.button.sessionFrom
+            default: () => defProps.button.sessionFrom
         },
         // 会话内消息卡片标题,open-type="contact"时有效
         // 默认当前标题,只微信小程序有效
         sendMessageTitle: {
             type: String,
-            default: defprops.button.sendMessageTitle
+            default: () => defProps.button.sendMessageTitle
         },
         // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
         // 默认当前分享路径,只微信小程序有效
         sendMessagePath: {
             type: String,
-            default: defprops.button.sendMessagePath
+            default: () => defProps.button.sendMessagePath
         },
         // 会话内消息卡片图片,open-type="contact"时有效
         // 默认当前页面截图,只微信小程序有效
         sendMessageImg: {
             type: String,
-            default: defprops.button.sendMessageImg
+            default: () => defProps.button.sendMessageImg
         },
         // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
         // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
         showMessageCard: {
             type: Boolean,
-            default: defprops.button.showMessageCard
+            default: () => defProps.button.showMessageCard
         },
         // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
         dataName: {
             type: String,
-            default: defprops.button.dataName
+            default: () => defProps.button.dataName
         },
         // 节流,一定时间内只能触发一次
         throttleTime: {
             type: [String, Number],
-            default: defprops.button.throttleTime
+            default: () => defProps.button.throttleTime
         },
         // 按住后多久出现点击态,单位毫秒
         hoverStartTime: {
             type: [String, Number],
-            default: defprops.button.hoverStartTime
+            default: () => defProps.button.hoverStartTime
         },
         // 手指松开后点击态保留时间,单位毫秒
         hoverStayTime: {
             type: [String, Number],
-            default: defprops.button.hoverStayTime
+            default: () => defProps.button.hoverStayTime
         },
         // 按钮文字,之所以通过props传入,是因为slot传入的话
         // nvue中无法控制文字的样式
         text: {
             type: [String, Number],
-            default: defprops.button.text
+            default: () => defProps.button.text
         },
         // 按钮图标
         icon: {
             type: String,
-            default: defprops.button.icon
+            default: () => defProps.button.icon
         },
         // 按钮图标
         iconColor: {
             type: String,
-            default: defprops.button.icon
+            default: () => defProps.button.icon
         },
         // 按钮颜色,支持传入linear-gradient渐变色
         color: {
             type: String,
-            default: defprops.button.color
+            default: () => defProps.button.color
         }
     }
 }

+ 12 - 7
src/uni_modules/uview-plus/components/u-button/u-button.vue

@@ -19,6 +19,7 @@
         @error="error"
         @opensetting="opensetting"
         @launchapp="launchapp"
+        @agreeprivacyauthorization="agreeprivacyauthorization"
         :hover-class="!disabled && !loading ? 'u-button--active' : ''"
         class="u-button u-reset-button"
         :style="[baseColor, $u.addStyle(customStyle)]"
@@ -108,7 +109,7 @@
     <!-- #endif -->
 </template>
 
-<script>
+<script lang="ts">
 import button from "../../libs/mixin/button.js";
 import openType from "../../libs/mixin/openType.js";
 import mpMixin from '../../libs/mixin/mpMixin.js';
@@ -155,6 +156,7 @@ import props from "./props.js";
  * @event {Function}	error			当使用开放能力时,发生错误的回调
  * @event {Function}	opensetting		在打开授权设置页并关闭后回调
  * @event {Function}	launchapp		打开 APP 成功的回调
+ * @event {Function}	agreeprivacyauthorization	用户同意隐私协议事件回调
  * @example <u-button>月落</u-button>
  */
 export default {
@@ -263,7 +265,7 @@ export default {
         },
     },
 	emits: ['click', 'getphonenumber', 'getuserinfo',
-		'error', 'opensetting', 'launchapp'],
+		'error', 'opensetting', 'launchapp', 'agreeprivacyauthorization'],
     methods: {
         clickHandler() {
             // 非禁止并且非加载中,才能点击
@@ -275,21 +277,24 @@ export default {
             }
         },
         // 下面为对接uniapp官方按钮开放能力事件回调的对接
-        getphonenumber(res) {
+        getphonenumber(res: any) {
             this.$emit("getphonenumber", res);
         },
-        getuserinfo(res) {
+        getuserinfo(res: any) {
             this.$emit("getuserinfo", res);
         },
-        error(res) {
+        error(res: any) {
             this.$emit("error", res);
         },
-        opensetting(res) {
+        opensetting(res: any) {
             this.$emit("opensetting", res);
         },
-        launchapp(res) {
+        launchapp(res: any) {
             this.$emit("launchapp", res);
         },
+        agreeprivacyauthorization(res) {
+            this.$emit("agreeprivacyauthorization", res);
+        },
     },
 };
 </script>

+ 1 - 0
src/uni_modules/uview-plus/components/u-button/vue.scss

@@ -16,6 +16,7 @@ $u-button-plain-u-button-warning-color:$u-error;
 
 .u-button {
 	width: 100%;
+	white-space: nowrap;
 	
 	&__text {
 		white-space: nowrap;

+ 1 - 1
src/uni_modules/uview-plus/components/u-calendar/month.vue

@@ -103,7 +103,7 @@
 			// 是否为只读状态,只读状态下禁止选择日期
 			readonly: {
 				type: Boolean,
-				default: defprops.calendar.readonly
+				default: () => uni.$u.props.calendar.readonly
 			},
 			// 日期区间最多可选天数,默认无限制,mode = range时有效
 			maxRange: {

+ 28 - 28
src/uni_modules/uview-plus/components/u-calendar/props.js

@@ -1,140 +1,140 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 日历顶部标题
         title: {
             type: String,
-            default: defprops.calendar.title
+            default: () => defProps.calendar.title
         },
         // 是否显示标题
         showTitle: {
             type: Boolean,
-            default: defprops.calendar.showTitle
+            default: () => defProps.calendar.showTitle
         },
         // 是否显示副标题
         showSubtitle: {
             type: Boolean,
-            default: defprops.calendar.showSubtitle
+            default: () => defProps.calendar.showSubtitle
         },
         // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围
         mode: {
             type: String,
-            default: defprops.calendar.mode
+            default: () => defProps.calendar.mode
         },
         // mode=range时,第一个日期底部的提示文字
         startText: {
             type: String,
-            default: defprops.calendar.startText
+            default: () => defProps.calendar.startText
         },
         // mode=range时,最后一个日期底部的提示文字
         endText: {
             type: String,
-            default: defprops.calendar.endText
+            default: () => defProps.calendar.endText
         },
         // 自定义列表
         customList: {
             type: Array,
-            default: defprops.calendar.customList
+            default: () => defProps.calendar.customList
         },
         // 主题色,对底部按钮和选中日期有效
         color: {
             type: String,
-            default: defprops.calendar.color
+            default: () => defProps.calendar.color
         },
         // 最小的可选日期
         minDate: {
             type: [String, Number],
-            default: defprops.calendar.minDate
+            default: () => defProps.calendar.minDate
         },
         // 最大可选日期
         maxDate: {
             type: [String, Number],
-            default: defprops.calendar.maxDate
+            default: () => defProps.calendar.maxDate
         },
         // 默认选中的日期,mode为multiple或range是必须为数组格式
         defaultDate: {
             type: [Array, String, Date, null],
-            default: defprops.calendar.defaultDate
+            default: () => defProps.calendar.defaultDate
         },
         // mode=multiple时,最多可选多少个日期
         maxCount: {
             type: [String, Number],
-            default: defprops.calendar.maxCount
+            default: () => defProps.calendar.maxCount
         },
         // 日期行高
         rowHeight: {
             type: [String, Number],
-            default: defprops.calendar.rowHeight
+            default: () => defProps.calendar.rowHeight
         },
         // 日期格式化函数
         formatter: {
             type: [Function, null],
-            default: defprops.calendar.formatter
+            default: () => defProps.calendar.formatter
         },
         // 是否显示农历
         showLunar: {
             type: Boolean,
-            default: defprops.calendar.showLunar
+            default: () => defProps.calendar.showLunar
         },
         // 是否显示月份背景色
         showMark: {
             type: Boolean,
-            default: defprops.calendar.showMark
+            default: () => defProps.calendar.showMark
         },
         // 确定按钮的文字
         confirmText: {
             type: String,
-            default: defprops.calendar.confirmText
+            default: () => defProps.calendar.confirmText
         },
         // 确认按钮处于禁用状态时的文字
         confirmDisabledText: {
             type: String,
-            default: defprops.calendar.confirmDisabledText
+            default: () => defProps.calendar.confirmDisabledText
         },
         // 是否显示日历弹窗
         show: {
             type: Boolean,
-            default: defprops.calendar.show
+            default: () => defProps.calendar.show
         },
         // 是否允许点击遮罩关闭日历
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.calendar.closeOnClickOverlay
+            default: () => defProps.calendar.closeOnClickOverlay
         },
         // 是否为只读状态,只读状态下禁止选择日期
         readonly: {
             type: Boolean,
-            default: defprops.calendar.readonly
+            default: () => defProps.calendar.readonly
         },
         // 	是否展示确认按钮
         showConfirm: {
             type: Boolean,
-            default: defprops.calendar.showConfirm
+            default: () => defProps.calendar.showConfirm
         },
         // 日期区间最多可选天数,默认无限制,mode = range时有效
         maxRange: {
             type: [Number, String],
-            default: defprops.calendar.maxRange
+            default: () => defProps.calendar.maxRange
         },
         // 范围选择超过最多可选天数时的提示文案,mode = range时有效
         rangePrompt: {
             type: String,
-            default: defprops.calendar.rangePrompt
+            default: () => defProps.calendar.rangePrompt
         },
         // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
         showRangePrompt: {
             type: Boolean,
-            default: defprops.calendar.showRangePrompt
+            default: () => defProps.calendar.showRangePrompt
         },
         // 是否允许日期范围的起止时间为同一天,mode = range时有效
         allowSameDay: {
             type: Boolean,
-            default: defprops.calendar.allowSameDay
+            default: () => defProps.calendar.allowSameDay
         },
 		// 圆角值
 		round: {
 		    type: [Boolean, String, Number],
-		    default: defprops.calendar.round
+		    default: () => defProps.calendar.round
 		},
 		// 最多展示月份数量
 		monthNum: {

+ 4 - 3
src/uni_modules/uview-plus/components/u-calendar/u-calendar.vue

@@ -218,12 +218,13 @@ export default {
 			}
 		},
 		init() {
-			// 校验maxDate,不能小于当前时间
+			// 校验maxDate,不能小于minDate。
 			if (
 				this.innerMaxDate &&
-				new Date(this.innerMaxDate).getTime() <= Date.now()
+                this.innerMinDate &&
+				new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()
 			) {
-				return uni.$u.error('maxDate不能小于当前时间')
+				return uni.$u.error('maxDate不能小于minDate时间')
 			}
 			// 滚动区域的高度
 			this.listHeight = this.rowHeight * 5 + 30

+ 1 - 1
src/uni_modules/uview-plus/components/u-car-keyboard/props.js

@@ -1,4 +1,4 @@
-import defprops from '../../libs/config/props';
+// import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否打乱键盘按键的顺序

+ 1 - 1
src/uni_modules/uview-plus/components/u-car-keyboard/u-car-keyboard.vue

@@ -74,7 +74,7 @@
 	/**
 	 * keyboard 键盘组件
 	 * @description 此为uView自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3种模式,都有可以打乱按键顺序的选项。
-	 * @tutorial https://uiadmin.net/uview-plus/components/keyboard.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/keyboard.html
 	 * @property {Boolean} random 是否打乱键盘的顺序
 	 * @event {Function} change 点击键盘触发
 	 * @event {Function} backspace 点击退格键触发

+ 3 - 3
src/uni_modules/uview-plus/components/u-cell-group/props.js

@@ -1,15 +1,15 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 分组标题
         title: {
             type: String,
-            default: defprops.cellGroup.title
+            default: () => defProps.cellGroup.title
         },
         // 是否显示外边框
         border: {
             type: Boolean,
-            default: defprops.cellGroup.border
+            default: () => defProps.cellGroup.border
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-cell-group/u-cell-group.vue

@@ -19,7 +19,7 @@
 	/**
 	 * cellGroup  单元格
 	 * @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。
-	 * @tutorial https://uiadmin.net/uview-plus/components/cell.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/cell.html
 	 * 
 	 * @property {String}	title		分组标题
 	 * @property {Boolean}	border		是否显示外边框 (默认 true )

+ 21 - 21
src/uni_modules/uview-plus/components/u-cell/props.js

@@ -1,111 +1,111 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 标题
         title: {
             type: [String, Number],
-            default: defprops.cell.title
+            default: () => defProps.cell.title
         },
         // 标题下方的描述信息
         label: {
             type: [String, Number],
-            default: defprops.cell.label
+            default: () => defProps.cell.label
         },
         // 右侧的内容
         value: {
             type: [String, Number],
-            default: defprops.cell.value
+            default: () => defProps.cell.value
         },
         // 左侧图标名称,或者图片链接(本地文件建议使用绝对地址)
         icon: {
             type: String,
-            default: defprops.cell.icon
+            default: () => defProps.cell.icon
         },
         // 是否禁用cell
         disabled: {
             type: Boolean,
-            default: defprops.cell.disabled
+            default: () => defProps.cell.disabled
         },
         // 是否显示下边框
         border: {
             type: Boolean,
-            default: defprops.cell.border
+            default: () => defProps.cell.border
         },
         // 内容是否垂直居中(主要是针对右侧的value部分)
         center: {
             type: Boolean,
-            default: defprops.cell.center
+            default: () => defProps.cell.center
         },
         // 点击后跳转的URL地址
         url: {
             type: String,
-            default: defprops.cell.url
+            default: () => defProps.cell.url
         },
         // 链接跳转的方式,内部使用的是uView封装的route方法,可能会进行拦截操作
         linkType: {
             type: String,
-            default: defprops.cell.linkType
+            default: () => defProps.cell.linkType
         },
         // 是否开启点击反馈(表现为点击时加上灰色背景)
         clickable: {
             type: Boolean,
-            default: defprops.cell.clickable
+            default: () => defProps.cell.clickable
         },
         // 是否展示右侧箭头并开启点击反馈
         isLink: {
             type: Boolean,
-            default: defprops.cell.isLink
+            default: () => defProps.cell.isLink
         },
         // 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件)
         required: {
             type: Boolean,
-            default: defprops.cell.required
+            default: () => defProps.cell.required
         },
         // 右侧的图标箭头
         rightIcon: {
             type: String,
-            default: defprops.cell.rightIcon
+            default: () => defProps.cell.rightIcon
         },
         // 右侧箭头的方向,可选值为:left,up,down
         arrowDirection: {
             type: String,
-            default: defprops.cell.arrowDirection
+            default: () => defProps.cell.arrowDirection
         },
         // 左侧图标样式
         iconStyle: {
             type: [Object, String],
             default: () => {
-				return uni.$u.props.cell.iconStyle
+				return defProps.cell.iconStyle
 			}
         },
         // 右侧箭头图标的样式
         rightIconStyle: {
             type: [Object, String],
             default: () => {
-				return uni.$u.props.cell.rightIconStyle
+				return defProps.cell.rightIconStyle
 			}
         },
         // 标题的样式
         titleStyle: {
             type: [Object, String],
 			default: () => {
-				return uni.$u.props.cell.titleStyle
+				return defProps.cell.titleStyle
 			}
         },
         // 单位元的大小,可选值为large
         size: {
             type: String,
-            default: defprops.cell.size
+            default: () => defProps.cell.size
         },
         // 点击cell是否阻止事件传播
         stop: {
             type: Boolean,
-            default: defprops.cell.stop
+            default: () => defProps.cell.stop
         },
         // 标识符,cell被点击时返回
         name: {
             type: [Number, String],
-            default: defprops.cell.name
+            default: () => defProps.cell.name
         }
     }
 }

+ 21 - 8
src/uni_modules/uview-plus/components/u-cell/u-cell.vue

@@ -11,9 +11,12 @@
 						:custom-style="iconStyle"
 						:size="size === 'large' ? 22 : 18"></u-icon>
 				</view>
-				<view class="u-cell__title">
					<slot name="title" v-if="$slots.title || !title">
					</slot>
-						<text v-else class="u-cell__title-text" :style="[titleTextStyle]"
-							:class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__title-text--large']">{{ title }}</text>
+				<view class="u-cell__title">
+                    <!-- 将slot与默认内容用if/else分开主要是因为微信小程序不支持slot嵌套传递,这样才能解决collapse组件的slot不失效问题,label暂时未用到。 -->
+					<slot name="title" v-if="$slots.title || !title">
+					</slot>
+                    <text v-else class="u-cell__title-text" :style="[titleTextStyle]"
+                        :class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__title-text--large']">{{ title }}</text>
 					<slot name="label">
 						<text class="u-cell__label" v-if="label"
 							:class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__label--large']">{{ label }}</text>
@@ -28,7 +31,14 @@
 			<view class="u-cell__right-icon-wrap" v-if="$slots['right-icon'] || isLink"
 				:class="[`u-cell__right-icon-wrap--${arrowDirection}`]">
 				<slot name="right-icon">
-					<u-icon v-if="rightIcon" :name="rightIcon" :custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
						:size="size === 'large' ? 18 : 16"></u-icon>
				</slot>
+					<u-icon v-if="rightIcon" :name="rightIcon" :custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
+						:size="size === 'large' ? 18 : 16"></u-icon>
+				</slot>
+			</view>
+			<view class="u-cell__right-icon-wrap" v-if="$slots['righticon']"
+				:class="[`u-cell__right-icon-wrap--${arrowDirection}`]">
+				<slot name="righticon">
+				</slot>
 			</view>
 		</view>
 		<u-line v-if="border"></u-line>
@@ -39,10 +49,11 @@
 	import props from './props.js';
 	import mpMixin from '../../libs/mixin/mpMixin.js';
 	import mixin from '../../libs/mixin/mixin.js';
+	import { addStyle } from '../../libs/function/index.js';
 	/**
 	 * cell  单元格
 	 * @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。
-	 * @tutorial https://uiadmin.net/uview-plus/components/cell.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/cell.html
 	 * @property {String | Number}	title			标题
 	 * @property {String | Number}	label			标题下方的描述信息
 	 * @property {String | Number}	value			右侧的内容
@@ -77,7 +88,7 @@
 		mixins: [mpMixin, mixin, props],
 		computed: {
 			titleTextStyle() {
-				return uni.$u.addStyle(this.titleStyle)
+				return addStyle(this.titleStyle)
 			}
 		},
 		emits: ['click'],
@@ -100,7 +111,7 @@
 <style lang="scss" scoped>
 	@import "../../libs/css/components.scss";
 
-	$u-cell-padding: 10px 15px !default;
+	$u-cell-padding: 13px 15px !default;
 	$u-cell-font-size: 15px !default;
 	$u-cell-line-height: 24px !default;
 	$u-cell-color: $u-main-color !default;
@@ -201,9 +212,11 @@
 			}
 		}
 
-		&__value {
+		&__value {	
 			text-align: right;
+			/* #ifndef APP-NVUE */
 			margin-left: auto;
+			/* #endif */	
 			font-size: $u-cell-value-font-size;
 			line-height: $u-cell-line-height;
 			color: $u-cell-value-color;

+ 17 - 17
src/uni_modules/uview-plus/components/u-checkbox-group/props.js

@@ -1,91 +1,91 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 标识符
         name: {
             type: String,
-            default: defprops.checkboxGroup.name
+            default: () => defProps.checkboxGroup.name
         },
 		// #ifdef VUE3
 		// 绑定的值
 		modelValue: {
 		    type: Array,
-		    default: defprops.checkboxGroup.value
+		    default: () => defProps.checkboxGroup.value
 		},
 		// #endif
 		// #ifdef VUE2
 		// 绑定的值
 		value: {
 		    type: Array,
-		    default: defprops.checkboxGroup.value
+		    default: () => defProps.checkboxGroup.value
 		},
 		// #endif
         // 形状,circle-圆形,square-方形
         shape: {
             type: String,
-            default: defprops.checkboxGroup.shape
+            default: () => defProps.checkboxGroup.shape
         },
         // 是否禁用全部checkbox
         disabled: {
             type: Boolean,
-            default: defprops.checkboxGroup.disabled
+            default: () => defProps.checkboxGroup.disabled
         },
 
         // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
         activeColor: {
             type: String,
-            default: defprops.checkboxGroup.activeColor
+            default: () => defProps.checkboxGroup.activeColor
         },
         // 未选中的颜色
         inactiveColor: {
             type: String,
-            default: defprops.checkboxGroup.inactiveColor
+            default: () => defProps.checkboxGroup.inactiveColor
         },
 
         // 整个组件的尺寸,默认px
         size: {
             type: [String, Number],
-            default: defprops.checkboxGroup.size
+            default: () => defProps.checkboxGroup.size
         },
         // 布局方式,row-横向,column-纵向
         placement: {
             type: String,
-            default: defprops.checkboxGroup.placement
+            default: () => defProps.checkboxGroup.placement
         },
         // label的字体大小,px单位
         labelSize: {
             type: [String, Number],
-            default: defprops.checkboxGroup.labelSize
+            default: () => defProps.checkboxGroup.labelSize
         },
         // label的字体颜色
         labelColor: {
             type: [String],
-            default: defprops.checkboxGroup.labelColor
+            default: () => defProps.checkboxGroup.labelColor
         },
         // 是否禁止点击文本操作
         labelDisabled: {
             type: Boolean,
-            default: defprops.checkboxGroup.labelDisabled
+            default: () => defProps.checkboxGroup.labelDisabled
         },
         // 图标颜色
         iconColor: {
             type: String,
-            default: defprops.checkboxGroup.iconColor
+            default: () => defProps.checkboxGroup.iconColor
         },
         // 图标的大小,单位px
         iconSize: {
             type: [String, Number],
-            default: defprops.checkboxGroup.iconSize
+            default: () => defProps.checkboxGroup.iconSize
         },
         // 勾选图标的对齐方式,left-左边,right-右边
         iconPlacement: {
             type: String,
-            default: defprops.checkboxGroup.iconPlacement
+            default: () => defProps.checkboxGroup.iconPlacement
         },
         // 竖向配列时,是否显示下划线
         borderBottom: {
             type: Boolean,
-            default: defprops.checkboxGroup.borderBottom
+            default: () => defProps.checkboxGroup.borderBottom
         }
 
     }

+ 19 - 14
src/uni_modules/uview-plus/components/u-checkbox/props.js

@@ -1,70 +1,75 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // checkbox的名称
         name: {
             type: [String, Number, Boolean],
-            default: defprops.checkbox.name
+            default: () => defProps.checkbox.name
         },
         // 形状,square为方形,circle为圆型
         shape: {
             type: String,
-            default: defprops.checkbox.shape
+            default: () => defProps.checkbox.shape
         },
         // 整体的大小
         size: {
             type: [String, Number],
-            default: defprops.checkbox.size
+            default: () => defProps.checkbox.size
         },
         // 是否默认选中
         checked: {
             type: Boolean,
-            default: defprops.checkbox.checked
+            default: () => defProps.checkbox.checked
         },
         // 是否禁用
         disabled: {
             type: [String, Boolean],
-            default: defprops.checkbox.disabled
+            default: () => defProps.checkbox.disabled
         },
         // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
         activeColor: {
             type: String,
-            default: defprops.checkbox.activeColor
+            default: () => defProps.checkbox.activeColor
         },
         // 未选中的颜色
         inactiveColor: {
             type: String,
-            default: defprops.checkbox.inactiveColor
+            default: () => defProps.checkbox.inactiveColor
         },
         // 图标的大小,单位px
         iconSize: {
             type: [String, Number],
-            default: defprops.checkbox.iconSize
+            default: () => defProps.checkbox.iconSize
         },
         // 图标颜色
         iconColor: {
             type: String,
-            default: defprops.checkbox.iconColor
+            default: () => defProps.checkbox.iconColor
         },
         // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
         label: {
             type: [String, Number],
-            default: defprops.checkbox.label
+            default: () => defProps.checkbox.label
         },
         // label的字体大小,px单位
         labelSize: {
             type: [String, Number],
-            default: defprops.checkbox.labelSize
+            default: () => defProps.checkbox.labelSize
         },
         // label的颜色
         labelColor: {
             type: String,
-            default: defprops.checkbox.labelColor
+            default: () => defProps.checkbox.labelColor
         },
         // 是否禁止点击提示语选中复选框
         labelDisabled: {
             type: [String, Boolean],
-            default: defprops.checkbox.labelDisabled
+            default: () => defProps.checkbox.labelDisabled
+        },
+		// 是否独立使用
+        usedAlone: {
+            type: [Boolean],
+            default: () => false
         }
     }
 }

+ 30 - 18
src/uni_modules/uview-plus/components/u-checkbox/u-checkbox.vue

@@ -1,12 +1,12 @@
 <template>
 	<view
-	    class="u-checkbox"
+	    class="u-checkbox cursor-pointer"
 	    :style="[checkboxStyle]"
 	    @tap.stop="wrapperClickHandler"
 	    :class="[`u-checkbox-label--${parentData.iconPlacement}`, parentData.borderBottom && parentData.placement === 'column' && 'u-border-bottom']"
 	>
 		<view
-		    class="u-checkbox__icon-wrap"
+		    class="u-checkbox__icon-wrap cursor-pointer"
 		    @tap.stop="iconClickHandler"
 		    :class="iconClasses"
 		    :style="[iconWrapStyle]"
@@ -38,7 +38,7 @@
 	/**
 	 * checkbox  复选框
 	 * @description 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
-	 * @tutorial https://uiadmin.net/uview-plus/components/checkbox.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/checkbox.html
 	 * @property {String | Number | Boolean}	name			checkbox组件的标示符
 	 * @property {String}						shape			形状,square为方形,circle为圆型
 	 * @property {String | Number}				size			整体的大小
@@ -161,19 +161,23 @@
 				style.width = uni.$u.addUnit(this.elSize)
 				style.height = uni.$u.addUnit(this.elSize)
 				// 如果是图标在右边的话,移除它的右边距
-				if (this.parentData.iconPlacement === 'right') {
-					style.marginRight = 0
+				if (!this.usedAlone) {
+					if (this.parentData.iconPlacement === 'right') {
+						style.marginRight = 0
+					}
 				}
 				return style
 			},
 			checkboxStyle() {
 				const style = {}
-				if (this.parentData.borderBottom && this.parentData.placement === 'row') {
-					uni.$u.error('检测到您将borderBottom设置为true,需要同时将u-checkbox-group的placement设置为column才有效')
-				}
-				// 当父组件设置了显示下边框并且排列形式为纵向时,给内容和边框之间加上一定间隔
-				if (this.parentData.borderBottom && this.parentData.placement === 'column') {
-					style.paddingBottom = '8px'
+				if (!this.usedAlone) {
+					if (this.parentData.borderBottom && this.parentData.placement === 'row') {
+						uni.$u.error('检测到您将borderBottom设置为true,需要同时将u-checkbox-group的placement设置为column才有效')
+					}
+					// 当父组件设置了显示下边框并且排列形式为纵向时,给内容和边框之间加上一定间隔
+					if (this.parentData.borderBottom && this.parentData.placement === 'column') {
+						style.paddingBottom = '8px'
+					}
 				}
 				return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
 			}
@@ -184,10 +188,12 @@
 		emits: ["change"],
 		methods: {
 			init() {
-				// 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用
-				this.updateParentData()
-				if (!this.parent) {
-					uni.$u.error('u-checkbox必须搭配u-checkbox-group组件使用')
+				if (!this.usedAlone) {
+					// 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用
+					this.updateParentData()
+					if (!this.parent) {
+						uni.$u.error('u-checkbox必须搭配u-checkbox-group组件使用')
+					}
 				}
 				// #ifdef VUE2
 				const value = this.parentData.value
@@ -198,7 +204,7 @@
 				// 设置初始化时,是否默认选中的状态,父组件u-checkbox-group的value可能是array,所以额外判断
 				if (this.checked) {
 					this.isChecked = true
-				} else if (uni.$u.test.array(value)) {
+				} else if (!this.usedAlone && uni.$u.test.array(value)) {
 					// 查找数组是是否存在this.name元素值
 					this.isChecked = value.some(item => {
 						return item === this.name
@@ -210,7 +216,11 @@
 			},
 			// 横向两端排列时,点击组件即可触发选中事件
 			wrapperClickHandler(e) {
-				this.parentData.iconPlacement === 'right' && this.iconClickHandler(e)
+				if (!this.usedAlone) {
+					this.parentData.iconPlacement === 'right' && this.iconClickHandler(e)
+				} else {
+					this.iconClickHandler(e)
+				}
 			},
 			// 点击图标
 			iconClickHandler(e) {
@@ -242,7 +252,9 @@
 				// 将本组件标记为与原来相反的状态
 				this.isChecked = !this.isChecked
 				this.emitEvent()
-				typeof this.parent.unCheckedOther === 'function' && this.parent.unCheckedOther(this)
+				if (!this.usedAlone) {
+					typeof this.parent.unCheckedOther === 'function' && this.parent.unCheckedOther(this)
+				}
 			}
 		},
 		watch:{

+ 2 - 2
src/uni_modules/uview-plus/components/u-circle-progress/props.js

@@ -1,9 +1,9 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         percentage: {
             type: [String, Number],
-            default: defprops.circleProgress.percentage
+            default: () => defProps.circleProgress.percentage
         }
     }
 }

+ 17 - 17
src/uni_modules/uview-plus/components/u-code-input/props.js

@@ -1,89 +1,89 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
 		// 键盘弹起时,是否自动上推页面
 		adjustPosition: {
 			type: Boolean,
-            default: defprops.codeInput.adjustPosition
+            default: () => defProps.codeInput.adjustPosition
 		},
         // 最大输入长度
         maxlength: {
             type: [String, Number],
-            default: defprops.codeInput.maxlength
+            default: () => defProps.codeInput.maxlength
         },
         // 是否用圆点填充
         dot: {
             type: Boolean,
-            default: defprops.codeInput.dot
+            default: () => defProps.codeInput.dot
         },
         // 显示模式,box-盒子模式,line-底部横线模式
         mode: {
             type: String,
-            default: defprops.codeInput.mode
+            default: () => defProps.codeInput.mode
         },
         // 是否细边框
         hairline: {
             type: Boolean,
-            default: defprops.codeInput.hairline
+            default: () => defProps.codeInput.hairline
         },
         // 字符间的距离
         space: {
             type: [String, Number],
-            default: defprops.codeInput.space
+            default: () => defProps.codeInput.space
         },
 		// #ifdef VUE3
 		// 预置值
 		modelValue: {
 			type: [String, Number],
-			default: defprops.codeInput.value
+			default: () => defProps.codeInput.value
 		},
 		// #endif
 		// #ifdef VUE2
 		// 预置值
 		value: {
 			type: [String, Number],
-			default: defprops.codeInput.value
+			default: () => defProps.codeInput.value
 		},
 		// #endif
         // 是否自动获取焦点
         focus: {
             type: Boolean,
-            default: defprops.codeInput.focus
+            default: () => defProps.codeInput.focus
         },
         // 字体是否加粗
         bold: {
             type: Boolean,
-            default: defprops.codeInput.bold
+            default: () => defProps.codeInput.bold
         },
         // 字体颜色
         color: {
             type: String,
-            default: defprops.codeInput.color
+            default: () => defProps.codeInput.color
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.codeInput.fontSize
+            default: () => defProps.codeInput.fontSize
         },
         // 输入框的大小,宽等于高
         size: {
             type: [String, Number],
-            default: defprops.codeInput.size
+            default: () => defProps.codeInput.size
         },
         // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true
         disabledKeyboard: {
             type: Boolean,
-            default: defprops.codeInput.disabledKeyboard
+            default: () => defProps.codeInput.disabledKeyboard
         },
         // 边框和线条颜色
         borderColor: {
             type: String,
-            default: defprops.codeInput.borderColor
+            default: () => defProps.codeInput.borderColor
         },
 		// 是否禁止输入"."符号
 		disabledDot: {
 			type: Boolean,
-			default: defprops.codeInput.disabledDot
+			default: () => defProps.codeInput.disabledDot
 		}
     }
 }

+ 7 - 7
src/uni_modules/uview-plus/components/u-code/props.js

@@ -1,35 +1,35 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 倒计时总秒数
         seconds: {
             type: [String, Number],
-            default: defprops.code.seconds
+            default: () => defProps.code.seconds
         },
         // 尚未开始时提示
         startText: {
             type: String,
-            default: defprops.code.startText
+            default: () => defProps.code.startText
         },
         // 正在倒计时中的提示
         changeText: {
             type: String,
-            default: defprops.code.changeText
+            default: () => defProps.code.changeText
         },
         // 倒计时结束时的提示
         endText: {
             type: String,
-            default: defprops.code.endText
+            default: () => defProps.code.endText
         },
         // 是否在H5刷新或各端返回再进入时继续倒计时
         keepRunning: {
             type: Boolean,
-            default: defprops.code.keepRunning
+            default: () => defProps.code.keepRunning
         },
         // 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了
         uniqueKey: {
             type: String,
-            default: defprops.code.uniqueKey
+            default: () => defProps.code.uniqueKey
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-code/u-code.vue

@@ -77,7 +77,6 @@
 				this.canGetCode = false
 				// 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示
 				this.changeEvent(this.changeText.replace(/x|X/, this.secNum))
-				this.setTimeToStorage()
 				this.timer = setInterval(() => {
 					if (--this.secNum) {
 						// 用当前倒计时的秒数替换提示字符串中的"x"字母
@@ -91,6 +90,7 @@
 						this.canGetCode = true
 					}
 				}, 1000)
+				this.setTimeToStorage()
 			},
 			// 重置,可以让用户再次获取验证码
 			reset() {

+ 6 - 6
src/uni_modules/uview-plus/components/u-col/props.js

@@ -1,30 +1,30 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 占父容器宽度的多少等分,总分为12份
         span: {
             type: [String, Number],
-            default: defprops.col.span
+            default: () => defProps.col.span
         },
         // 指定栅格左侧的间隔数(总12栏)
         offset: {
             type: [String, Number],
-            default: defprops.col.offset
+            default: () => defProps.col.offset
         },
         // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
         justify: {
             type: String,
-            default: defprops.col.justify
+            default: () => defProps.col.justify
         },
         // 垂直对齐方式,可选值为top、center、bottom、stretch
         align: {
             type: String,
-            default: defprops.col.align
+            default: () => defProps.col.align
         },
         // 文字对齐方式
         textAlign: {
             type: String,
-            default: defprops.col.textAlign
+            default: () => defProps.col.textAlign
         }
     }
 }

+ 12 - 12
src/uni_modules/uview-plus/components/u-collapse-item/props.js

@@ -1,60 +1,60 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 标题
         title: {
             type: String,
-            default: defprops.collapseItem.title
+            default: () => defProps.collapseItem.title
         },
         // 标题右侧内容
         value: {
             type: String,
-            default: defprops.collapseItem.value
+            default: () => defProps.collapseItem.value
         },
         // 标题下方的描述信息
         label: {
             type: String,
-            default: defprops.collapseItem.label
+            default: () => defProps.collapseItem.label
         },
         // 是否禁用折叠面板
         disabled: {
             type: Boolean,
-            default: defprops.collapseItem.disabled
+            default: () => defProps.collapseItem.disabled
         },
         // 是否展示右侧箭头并开启点击反馈
         isLink: {
             type: Boolean,
-            default: defprops.collapseItem.isLink
+            default: () => defProps.collapseItem.isLink
         },
         // 是否开启点击反馈
         clickable: {
             type: Boolean,
-            default: defprops.collapseItem.clickable
+            default: () => defProps.collapseItem.clickable
         },
         // 是否显示内边框
         border: {
             type: Boolean,
-            default: defprops.collapseItem.border
+            default: () => defProps.collapseItem.border
         },
         // 标题的对齐方式
         align: {
             type: String,
-            default: defprops.collapseItem.align
+            default: () => defProps.collapseItem.align
         },
         // 唯一标识符
         name: {
             type: [String, Number],
-            default: defprops.collapseItem.name
+            default: () => defProps.collapseItem.name
         },
         // 标题左侧图片,可为绝对路径的图片或内置图标
         icon: {
             type: String,
-            default: defprops.collapseItem.icon
+            default: () => defProps.collapseItem.icon
         },
         // 面板展开收起的过渡时间,单位ms
         duration: {
             type: Number,
-            default: defprops.collapseItem.duration
+            default: () => defProps.collapseItem.duration
         }
     }
 }

+ 4 - 4
src/uni_modules/uview-plus/components/u-collapse/props.js

@@ -1,20 +1,20 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 当前展开面板的name,非手风琴模式:[<string | number>],手风琴模式:string | number
         value: {
             type: [String, Number, Array, null],
-            default: defprops.collapse.value
+            default: () => defProps.collapse.value
         },
         // 是否手风琴模式
         accordion: {
             type: Boolean,
-            default: defprops.collapse.accordion
+            default: () => defProps.collapse.accordion
         },
         // 是否显示外边框
         border: {
             type: Boolean,
-            default: defprops.collapse.border
+            default: () => defProps.collapse.border
         }
     }
 }

+ 11 - 11
src/uni_modules/uview-plus/components/u-column-notice/props.js

@@ -1,56 +1,56 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 显示的内容,字符串
         text: {
             type: [Array],
-            default: defprops.columnNotice.text
+            default: () => defProps.columnNotice.text
         },
         // 是否显示左侧的音量图标
         icon: {
             type: String,
-            default: defprops.columnNotice.icon
+            default: () => defProps.columnNotice.icon
         },
         // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
         mode: {
             type: String,
-            default: defprops.columnNotice.mode
+            default: () => defProps.columnNotice.mode
         },
         // 文字颜色,各图标也会使用文字颜色
         color: {
             type: String,
-            default: defprops.columnNotice.color
+            default: () => defProps.columnNotice.color
         },
         // 背景颜色
         bgColor: {
             type: String,
-            default: defprops.columnNotice.bgColor
+            default: () => defProps.columnNotice.bgColor
         },
         // 字体大小,单位px
         fontSize: {
             type: [String, Number],
-            default: defprops.columnNotice.fontSize
+            default: () => defProps.columnNotice.fontSize
         },
         // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
         speed: {
             type: [String, Number],
-            default: defprops.columnNotice.speed
+            default: () => defProps.columnNotice.speed
         },
         // direction = row时,是否使用步进形式滚动
         step: {
             type: Boolean,
-            default: defprops.columnNotice.step
+            default: () => defProps.columnNotice.step
         },
         // 滚动一个周期的时间长,单位ms
         duration: {
             type: [String, Number],
-            default: defprops.columnNotice.duration
+            default: () => defProps.columnNotice.duration
         },
         // 是否禁止用手滑动切换
         // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
         disableTouch: {
             type: Boolean,
-            default: defprops.columnNotice.disableTouch
+            default: () => defProps.columnNotice.disableTouch
         }
     }
 }

+ 70 - 0
src/uni_modules/uview-plus/components/u-copy/u-copy.vue

@@ -0,0 +1,70 @@
+<template>
+	<view @click="handleClick">
+        <slot>复制</slot>
+    </view>
+</template>
+<script>
+export default {
+    name: "xy-copy",
+    props: {
+        content: {
+            type: String,
+            default: ''
+        },
+		alertStyle: {
+			type: String,
+			default: 'toast'
+		},
+		notice: {
+			type: String,
+			default: '复制成功'
+		}
+    },
+	emits: ['success'],
+    methods: {
+        handleClick() {
+            let content = this.content;
+			if (!content) {
+				uni.showToast({
+				    title: '暂无',
+				    icon: 'none',
+				    duration: 2000,
+				});
+				return false;
+			}
+            content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
+            /**
+			* 小程序端 和 app端的复制逻辑
+			*/
+			let that = this;
+            uni.setClipboardData({
+                data: content,
+                success: function() {
+					if (that.alertStyle == 'modal') {
+						uni.showModal({
+							title: '提示',
+							content: that.notice
+						});
+					} else {
+						uni.showToast({
+						    title: that.notice,
+						    icon: 'none'
+						});
+					}
+					that.$emit('success');
+                },
+                fail:function(){
+                    uni.showToast({
+                        title: '复制失败',
+                        icon: 'none',
+                        duration:3000,
+                    });
+                }
+            });
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 5 - 5
src/uni_modules/uview-plus/components/u-count-down/props.js

@@ -1,25 +1,25 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 倒计时时长,单位ms
         time: {
             type: [String, Number],
-            default: defprops.countDown.time
+            default: () => defProps.countDown.time
         },
         // 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
         format: {
             type: String,
-            default: defprops.countDown.format
+            default: () => defProps.countDown.format
         },
         // 是否自动开始倒计时
         autoStart: {
             type: Boolean,
-            default: defprops.countDown.autoStart
+            default: () => defProps.countDown.autoStart
         },
         // 是否展示毫秒倒计时
         millisecond: {
             type: Boolean,
-            default: defprops.countDown.millisecond
+            default: () => defProps.countDown.millisecond
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-count-down/u-count-down.vue

@@ -18,7 +18,7 @@
 	/**
 	 * u-count-down 倒计时
 	 * @description 该组件一般使用于某个活动的截止时间上,通过数字的变化,给用户明确的时间感受,提示用户进行某一个行为操作。
-	 * @tutorial https://uiadmin.net/uview-plus/components/countDown.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/countDown.html
 	 * @property {String | Number}	time		倒计时时长,单位ms (默认 0 )
 	 * @property {String}			format		时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒  (默认 'HH:mm:ss' )
 	 * @property {Boolean}			autoStart	是否自动开始倒计时 (默认 true )

+ 12 - 12
src/uni_modules/uview-plus/components/u-count-to/props.js

@@ -1,60 +1,60 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 开始的数值,默认从0增长到某一个数
         startVal: {
             type: [String, Number],
-            default: defprops.countTo.startVal
+            default: () => defProps.countTo.startVal
         },
         // 要滚动的目标数值,必须
         endVal: {
             type: [String, Number],
-            default: defprops.countTo.endVal
+            default: () => defProps.countTo.endVal
         },
         // 滚动到目标数值的动画持续时间,单位为毫秒(ms)
         duration: {
             type: [String, Number],
-            default: defprops.countTo.duration
+            default: () => defProps.countTo.duration
         },
         // 设置数值后是否自动开始滚动
         autoplay: {
             type: Boolean,
-            default: defprops.countTo.autoplay
+            default: () => defProps.countTo.autoplay
         },
         // 要显示的小数位数
         decimals: {
             type: [String, Number],
-            default: defprops.countTo.decimals
+            default: () => defProps.countTo.decimals
         },
         // 是否在即将到达目标数值的时候,使用缓慢滚动的效果
         useEasing: {
             type: Boolean,
-            default: defprops.countTo.useEasing
+            default: () => defProps.countTo.useEasing
         },
         // 十进制分割
         decimal: {
             type: [String, Number],
-            default: defprops.countTo.decimal
+            default: () => defProps.countTo.decimal
         },
         // 字体颜色
         color: {
             type: String,
-            default: defprops.countTo.color
+            default: () => defProps.countTo.color
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.countTo.fontSize
+            default: () => defProps.countTo.fontSize
         },
         // 是否加粗字体
         bold: {
             type: Boolean,
-            default: defprops.countTo.bold
+            default: () => defProps.countTo.bold
         },
         // 千位分隔符,类似金额的分割(¥23,321.05中的",")
         separator: {
             type: String,
-            default: defprops.countTo.separator
+            default: () => defProps.countTo.separator
         }
     }
 }

+ 38 - 25
src/uni_modules/uview-plus/components/u-datetime-picker/props.js

@@ -1,131 +1,144 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
+        // 是否显示input
+        hasInput: {
+            type: Boolean,
+            default: () => false
+        },
+        placeholder: {
+            type: String,
+            default: () => '请选择'
+        },
+        format: {
+            type: String,
+            default: () => ''
+        },
         // 是否打开组件
         show: {
             type: Boolean,
-            default: defprops.datetimePicker.show
+            default: () => defProps.datetimePicker.show
         },
 		// 弹出的方向,可选值为 top bottom right left center
         popupMode: {
             type: String,
-            default: defprops.picker.popupMode
+            default: () => defProps.picker.popupMode
         },
         // 是否展示顶部的操作栏
         showToolbar: {
             type: Boolean,
-            default: defprops.datetimePicker.showToolbar
+            default: () => defProps.datetimePicker.showToolbar
         },
         // #ifdef VUE2
         // 绑定值
         value: {
             type: [String, Number],
-            default: defprops.datetimePicker.value
+            default: () => defProps.datetimePicker.value
         },
         // #endif
         // #ifdef VUE3
         // 绑定值
         modelValue: {
             type: [String, Number],
-            default: defprops.datetimePicker.value
+            default: () => defProps.datetimePicker.value
         },
         // #endif
         // 顶部标题
         title: {
             type: String,
-            default: defprops.datetimePicker.title
+            default: () => defProps.datetimePicker.title
         },
         // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
         mode: {
             type: String,
-            default: defprops.datetimePicker.mode
+            default: () => defProps.datetimePicker.mode
         },
         // 可选的最大时间
         maxDate: {
             type: Number,
             // 最大默认值为后10年
-            default: defprops.datetimePicker.maxDate
+            default: () => defProps.datetimePicker.maxDate
         },
         // 可选的最小时间
         minDate: {
             type: Number,
             // 最小默认值为前10年
-            default: defprops.datetimePicker.minDate
+            default: () => defProps.datetimePicker.minDate
         },
         // 可选的最小小时,仅mode=time有效
         minHour: {
             type: Number,
-            default: defprops.datetimePicker.minHour
+            default: () => defProps.datetimePicker.minHour
         },
         // 可选的最大小时,仅mode=time有效
         maxHour: {
             type: Number,
-            default: defprops.datetimePicker.maxHour
+            default: () => defProps.datetimePicker.maxHour
         },
         // 可选的最小分钟,仅mode=time有效
         minMinute: {
             type: Number,
-            default: defprops.datetimePicker.minMinute
+            default: () => defProps.datetimePicker.minMinute
         },
         // 可选的最大分钟,仅mode=time有效
         maxMinute: {
             type: Number,
-            default: defprops.datetimePicker.maxMinute
+            default: () => defProps.datetimePicker.maxMinute
         },
         // 选项过滤函数
         filter: {
             type: [Function, null],
-            default: defprops.datetimePicker.filter
+            default: () => defProps.datetimePicker.filter
         },
         // 选项格式化函数
         formatter: {
             type: [Function, null],
-            default: defprops.datetimePicker.formatter
+            default: () => defProps.datetimePicker.formatter
         },
         // 是否显示加载中状态
         loading: {
             type: Boolean,
-            default: defprops.datetimePicker.loading
+            default: () => defProps.datetimePicker.loading
         },
         // 各列中,单个选项的高度
         itemHeight: {
             type: [String, Number],
-            default: defprops.datetimePicker.itemHeight
+            default: () => defProps.datetimePicker.itemHeight
         },
         // 取消按钮的文字
         cancelText: {
             type: String,
-            default: defprops.datetimePicker.cancelText
+            default: () => defProps.datetimePicker.cancelText
         },
         // 确认按钮的文字
         confirmText: {
             type: String,
-            default: defprops.datetimePicker.confirmText
+            default: () => defProps.datetimePicker.confirmText
         },
         // 取消按钮的颜色
         cancelColor: {
             type: String,
-            default: defprops.datetimePicker.cancelColor
+            default: () => defProps.datetimePicker.cancelColor
         },
         // 确认按钮的颜色
         confirmColor: {
             type: String,
-            default: defprops.datetimePicker.confirmColor
+            default: () => defProps.datetimePicker.confirmColor
         },
         // 每列中可见选项的数量
         visibleItemCount: {
             type: [String, Number],
-            default: defprops.datetimePicker.visibleItemCount
+            default: () => defProps.datetimePicker.visibleItemCount
         },
         // 是否允许点击遮罩关闭选择器
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.datetimePicker.closeOnClickOverlay
+            default: () => defProps.datetimePicker.closeOnClickOverlay
         },
         // 各列的默认索引
         defaultIndex: {
             type: Array,
-            default: defprops.datetimePicker.defaultIndex
+            default: () => defProps.datetimePicker.defaultIndex
         }
     }
 }

+ 58 - 3
src/uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.vue

@@ -1,7 +1,15 @@
 <template>
+    <view v-if="hasInput">
+        <u-input
+            :placeholder="placeholder"
+            border="surround"
+            v-model="inputValue"
+            @click="showByClickInput = !showByClickInput"
+        ></u-input>
+    </view>
 	<u-picker
 		ref="picker"
-		:show="show"
+		:show="show || (hasInput && showByClickInput)"
 		:popupMode="popupMode"
 		:closeOnClickOverlay="closeOnClickOverlay"
 		:columns="columns"
@@ -43,7 +51,7 @@
 	 * @tutorial https://ijry.github.io/uview-plus/components/datetimePicker.html
 	 * @property {Boolean}			show				用于控制选择器的弹出与收起 ( 默认 false )
 	 * @property {Boolean}			showToolbar			是否显示顶部的操作栏  ( 默认 true )
-	 * @property {String | Number}	value				绑定值
+	 * @property {String | Number}	modelValue		    绑定值
 	 * @property {String}			title				顶部标题
 	 * @property {String}			mode				展示格式 mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择  ( 默认 ‘datetime )
 	 * @property {Number}			maxDate				可选的最大时间  默认值为后10年
@@ -74,6 +82,9 @@
 		mixins: [mpMixin, mixin, props],
 		data() {
 			return {
+                // 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
+                inputValue: '', // 表单显示值
+                showByClickInput: false, // 是否在hasInput模式下显示日期选择弹唱
 				columns: [],
 				innerDefaultIndex: [],
 				innerFormatter: (type, value) => value
@@ -88,6 +99,7 @@
 			// #ifdef VUE3
 			modelValue(newValue) {
 				this.init()
+				this.getInputValue()
 			},
 			// #endif
 			// #ifdef VUE2
@@ -112,6 +124,34 @@
 		emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue'],
 		// #endif
 		methods: {
+			getInputValue(newValue) {
+				if (this.mode == 'time') {
+					this.inputValue = newValue
+				} else {
+					if (this.format) {
+						this.inputValue = dayjs(newValue).format(this.format)
+					} else {
+						let format = ''
+						switch (this.mode) {
+							case 'date':
+								format = 'YYYY-MM-DD'
+								break;
+							case 'year-month':
+								format = 'YYYY-MM'
+								break;
+							case 'datetime':
+								format = 'YYYY-MM-DD HH:mm'
+								break;
+							case 'time':
+								format = 'HH:mm'
+								break;
+							default:
+								break;
+						}
+						this.inputValue = dayjs(newValue).format(format)
+					}
+				}
+			},
 			init() {
 				// #ifdef VUE3
 				this.innerValue = this.correctValue(this.modelValue)
@@ -133,6 +173,9 @@
 			},
 			// 点击工具栏的取消按钮
 			cancel() {
+                if (this.hasInput) {
+                    this.showByClickInput = false
+                }
 				this.$emit('cancel')
 			},
 			// 点击工具栏的确定按钮
@@ -141,12 +184,17 @@
 					value: this.innerValue,
 					mode: this.mode
 				})
+                
 				// #ifdef VUE3
 				this.$emit('update:modelValue', this.innerValue)
 				// #endif
 				// #ifdef VUE2
 				this.$emit('input', this.innerValue)
 				// #endif
+                if (this.hasInput) {
+					this.getInputValue(this.innerValue)
+                    this.showByClickInput = false
+                }
 			},
 			//用正则截取输出值,当出现多组数字时,抛出错误
 			intercept(e,type){
@@ -214,7 +262,7 @@
         setTimeout(() => {
           this.updateIndexs(value)
         }, 0);
-				
+
 			},
 			// 更新索引
 			updateIndexs(value) {
@@ -268,6 +316,13 @@
 					// 进行过滤
 			        if (this.filter) {
 			            values = this.filter(type, values)
+						if (!values || (values && values.length == 0)) {
+							uni.showToast({
+								title: '日期filter结果不能为空',
+								icon: 'error',
+								mask: true
+							})
+						}
 			        }
 			        return { type, values }
 			    })

+ 9 - 9
src/uni_modules/uview-plus/components/u-divider/props.js

@@ -1,45 +1,45 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否虚线
         dashed: {
             type: Boolean,
-            default: defprops.divider.dashed
+            default: () => defProps.divider.dashed
         },
         // 是否细线
         hairline: {
             type: Boolean,
-            default: defprops.divider.hairline
+            default: () => defProps.divider.hairline
         },
         // 是否以点替代文字,优先于text字段起作用
         dot: {
             type: Boolean,
-            default: defprops.divider.dot
+            default: () => defProps.divider.dot
         },
         // 内容文本的位置,left-左边,center-中间,right-右边
         textPosition: {
             type: String,
-            default: defprops.divider.textPosition
+            default: () => defProps.divider.textPosition
         },
         // 文本内容
         text: {
             type: [String, Number],
-            default: defprops.divider.text
+            default: () => defProps.divider.text
         },
         // 文本大小
         textSize: {
             type: [String, Number],
-            default: defprops.divider.textSize
+            default: () => defProps.divider.textSize
         },
         // 文本颜色
         textColor: {
             type: String,
-            default: defprops.divider.textColor
+            default: () => defProps.divider.textColor
         },
         // 线条颜色
         lineColor: {
             type: String,
-            default: defprops.divider.lineColor
+            default: () => defProps.divider.lineColor
         }
     }
 }

+ 10 - 1
src/uni_modules/uview-plus/components/u-dropdown-item/props.js

@@ -1,11 +1,20 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
+        // #ifdef VUE3
         // 当前选中项的value值
+        modelValue: {
+            type: [Number, String, Array],
+            default: ''
+        },
+		// #endif
+		// #ifdef VUE2
+		// 当前选中项的value值
         value: {
             type: [Number, String, Array],
             default: ''
         },
+		// #endif
         // 菜单项标题
         title: {
             type: [String, Number],

+ 89 - 118
src/uni_modules/uview-plus/components/u-dropdown-item/u-dropdown-item.vue

@@ -1,148 +1,119 @@
 <template>
-	<view class="u-drawdown-item">
-		<u-overlay
-			customStyle="top: 126px"
-			:show="show"
-			:closeOnClickOverlay="closeOnClickOverlay"
-			@click="overlayClick"
-		></u-overlay>
-		<view
-			class="u-drawdown-item__content"
-			:style="[style]"
-			:animation="animationData"
-			ref="animation"
-		>
-			<slot />
-		</view>
+	<view class="u-dropdown-item" v-if="active" @touchmove.stop.prevent="() => {}" @tap.stop.prevent="() => {}">
+		<block v-if="!$slots.default && !$slots.$default">
+			<scroll-view class="u-dropdown-item__scroll" scroll-y="true" :style="{
+				height: $u.addUnit(height)
+			}">
+				<view class="u-dropdown-item__options">
+					<up-cell-group>
+						<up-cell @click="cellClick(item.value)" :arrow="false" :title="item.label" v-for="(item, index) in options"
+						 :key="index" :title-style="{
+							color: modelValue == item.value ? activeColor : inactiveColor
+						}">
+							<up-icon v-if="modelValue == item.value" name="checkbox-mark" :color="activeColor" size="32"></up-icon>
+						</up-cell>
+					</up-cell-group>
+				</view>
+			</scroll-view>
+		</block>
+		<slot v-else />
 	</view>
 </template>
 
 <script>
-	// #ifdef APP-NVUE
-	const animation = uni.requireNativePlugin('animation')
-	const dom = uni.requireNativePlugin('dom')
-	// #endif
-	import props from './props.js';
-	import mpMixin from '../../libs/mixin/mpMixin.js';
+    import props from './props.js';
+    import mpMixin from '../../libs/mixin/mpMixin.js';
 	import mixin from '../../libs/mixin/mixin.js';
 	/**
-	 * Drawdownitem
-	 * @description 
-	 * @tutorial url
-	 * @property {String}
-	 * @event {Function}
-	 * @example
+	 * dropdown-item 下拉菜单
+	 * @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
+	 * @tutorial https://ijry.github.io/uview-plus/components/dropdown.html
+	 * @property {String | Number} v-model 双向绑定选项卡选择值
+	 * @property {String} title 菜单项标题
+	 * @property {Array[Object]} options 选项数据,如果传入了默认slot,此参数无效
+	 * @property {Boolean} disabled 是否禁用此选项卡(默认false)
+	 * @property {String | Number} duration 选项卡展开和收起的过渡时间,单位ms(默认300)
+	 * @property {String | Number} height 弹窗下拉内容的高度(内容超出将会滚动)(默认auto)
+	 * @example <u-dropdown-item title="标题"></u-dropdown-item>
 	 */
 	export default {
-		name: 'u-drawdown-item',
+		name: 'u-dropdown-item',
 		mixins: [mpMixin, mixin, props],
+        options: {
+            styleIsolation: 'shared',
+        },
 		data() {
 			return {
-				show: false,
-				top: '126px',
-				// uni.createAnimation的导出数据
-				animationData: {},
+				active: false, // 当前项是否处于展开状态
+				activeColor: '#2979ff', // 激活时左边文字和右边对勾图标的颜色
+				inactiveColor: '#606266', // 未激活时左边文字和右边对勾图标的颜色
 			}
 		},
-		mounted() {
-			this.init()
+		computed: {
+			// 监听props是否发生了变化,有些值需要传递给父组件u-dropdown,无法双向绑定
+			propsChange() {
+				return `${this.title}-${this.disabled}`;
+			}
 		},
 		watch: {
-			// 发生变化时,需要去更新父组件对应的值
-			dataChange(newValue, oldValue) {
-				this.updateParentData()
+			propsChange(n) {
+				// 当值变化时,通知父组件重新初始化,让父组件执行每个子组件的init()方法
+				// 将所有子组件数据重新整理一遍
+				if (this.parent) this.parent.init();
 			}
 		},
-		computed: {
-			// 监听对应变量的变化
-			dataChange() {
-				return [this.title, this.disabled]
-			},
-			style() {
-				const style = {
-					zIndex: 10071,
-					position: 'fixed',
-					display: 'flex',
-					left: 0,
-					right: 0
-				}
-				style.top = uni.$u.addUnit(this.top)
-				return style
-			}
+		created() {
+			// 父组件的实例
+			this.parent = false;
 		},
+        emits: ['update:modelValue', 'change'],
 		methods: {
 			init() {
-				this.updateParentData()
-			},
-			// 更新父组件所需的数据
-			updateParentData() {
 				// 获取父组件u-dropdown
-				this.getParentData('u-dropdown')
-				if (!this.parent) uni.$u.error('u-dropdown-item必须配合u-dropdown使用')
-				// 查找父组件menuList数组中对应的标题数据
-				const menuIndex = this.parent.menuList.findIndex(item => item.title === this.title)
-				const menuContent = {
-					title: this.title,
-					disabled: this.disabled
-				}
-				if (menuIndex >= 0) {
-					// 如果能找到,则直接修改
-					this.parent.menuList[menuIndex] = menuContent;
-				} else {
-					// 如果无法找到,则为第一次添加,直接push即可
-					this.parent.menuList.push(menuContent);
-				}
-			},
-			async setContentAnimate(height) {
-				this.animating = true
-				// #ifdef APP-NVUE
-				const ref = this.$refs['animation'].ref
-				animation.transition(ref, {
-					styles: {
-						height: uni.$u.addUnit(height)
-					},
-					duration: this.duration,
-					timingFunction: 'ease-in-out',
-				}, () => {
-					this.animating = false
-				})
-				// #endif
-			
-				// #ifndef APP-NVUE
-				const animation = uni.createAnimation({
-					timingFunction: 'ease-in-out',
-				});
-				animation
-					.height(height)
-					.step({
-						duration: this.duration,
+				let parent = this.$u.$parent.call(this, 'u-dropdown');
+				if (parent) {
+					this.parent = parent;
+					// 将子组件的激活颜色配置为父组件设置的激活和未激活时的颜色
+					this.activeColor = parent.activeColor;
+					this.inactiveColor = parent.inactiveColor;
+					// 将本组件的this,放入到父组件的children数组中,让父组件可以操作本(子)组件的方法和属性
+					// push进去前,显判断是否已经存在了本实例,因为在子组件内部数据变化时,会通过父组件重新初始化子组件
+					let exist = parent.children.find(val => {
+						return this === val;
 					})
-					.step()
-				// 导出动画数据给面板的animationData值
-				this.animationData = animation.export()
-				// 标识动画结束
-				uni.$u.sleep(this.duration).then(() => {
-					this.animating = false
-				})
-				// #endif
+					if (!exist) parent.children.push(this);
+					if (parent.children.length == 1) this.active = true;
+					// 父组件无法监听children的变化,故将子组件的title,传入父组件的menuList数组中
+					parent.menuList.push({
+						title: this.title,
+						disabled: this.disabled
+					});
+				}
 			},
-			overlayClick() {
-				this.show = false
-				this.setContentAnimate(0)
+			// cell被点击
+			cellClick(value) {
+				// 修改通过v-model绑定的值
+                // #ifdef VUE2
+				this.$emit('input', value);
+                // #endif
+		        // #ifdef VUE3
+                this.$emit('update:modelValue', value);
+                // #endif
+				// 通知父组件(u-dropdown)收起菜单
+				this.parent.close();
+				// 发出事件,抛出当前勾选项的value
+				this.$emit('change', value);
 			}
 		},
+		mounted() {
+			this.init();
+		}
 	}
 </script>
 
-<style lang="scss" scoped>
-	@import '../../libs/css/components.scss';
-	
-	.u-drawdown-item {
-		
-		&__content {
-			background-color: #FFFFFF;
-			overflow: hidden;
-			height: 0;
-		}
-	}
+<style scoped lang="scss">
+	@import "../../libs/css/components.scss";
+    .u-dropdown-item__scroll {
+        background: #ffffff;
+    }
 </style>

+ 9 - 15
src/uni_modules/uview-plus/components/u-dropdown/props.js

@@ -1,21 +1,15 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
-        // 标题选中时的样式
-        activeStyle: {
-            type: [String, Object],
-            default: () => ({
-                color: '#2979ff',
-                fontSize: '14px'
-            })
+        // 菜单标题和选项的激活态颜色
+        activeColor: {
+            type: String,
+            default: '#2979ff'
         },
-        // 标题未选中时的样式
-        inactiveStyle: {
-            type: [String, Object],
-            default: () => ({
-                color: '#606266',
-                fontSize: '14px'
-            })
+        // 菜单标题和选项的未激活态颜色
+        inactiveColor: {
+            type: String,
+            default: '#606266'
         },
         // 点击遮罩是否关闭菜单
         closeOnClickMask: {

+ 202 - 77
src/uni_modules/uview-plus/components/u-dropdown/u-dropdown.vue

@@ -1,127 +1,252 @@
 <template>
-	<view class="u-drawdown">
-		<view
-			class="u-dropdown__menu"
-			:style="{
-				height: $u.addUnit(height)
-			}"
-			ref="u-dropdown__menu"
-		>
-			<view
-				class="u-dropdown__menu__item"
-				v-for="(item, index) in menuList"
-				:key="index"
-				@tap.stop="clickHandler(item, index)"
-			>
-				<view class="u-dropdown__menu__item__content">
-					<text
-						class="u-dropdown__menu__item__content__text"
-						:style="[index === current ? activeStyle : inactiveStyle]"
-					>{{item.title}}</text>
-					<view
-						class="u-dropdown__menu__item__content__arrow"
-						:class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
-					>
-						<u-icon
-							:name="menuIcon"
-							:size="$u.addUnit(menuIconSize)"
-						></u-icon>
+	<view class="u-dropdown">
+		<view class="u-dropdown__menu" :style="{
+			height: $u.addUnit(height)
+		}" :class="{
+			'u-border-bottom': borderBottom
+		}">
+			<view class="u-dropdown__menu__item" v-for="(item, index) in menuList" :key="index" @tap.stop="menuClick(index)">
+				<view class="u-flex u-flex-row">
+					<text class="u-dropdown__menu__item__text" :style="{
+						color: item.disabled ? '#c0c4cc' : (index === current || highlightIndex == index) ? activeColor : inactiveColor,
+						fontSize: $u.addUnit(titleSize)
+					}">{{item.title}}</text>
+					<view class="u-dropdown__menu__item__arrow" :class="{
+						'u-dropdown__menu__item__arrow--rotate': index === current
+					}">
+						<u-icon :custom-style="{display: 'flex'}" :name="menuIcon" :size="$u.addUnit(menuIconSize)" :color="index === current || highlightIndex == index ? activeColor : '#c0c4cc'"></u-icon>
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="u-dropdown__content">
-			<slot />
+		<view class="u-dropdown__content" :style="[contentStyle, {
+			transition: `opacity ${duration / 1000}s linear`,
+			top: $u.addUnit(height),
+			height: contentHeight + 'px'
+		}]"
+		 @tap="maskClick" @touchmove.stop.prevent>
+			<view @tap.stop.prevent class="u-dropdown__content__popup" :style="[popupStyle]">
+				<slot></slot>
+			</view>
+			<view class="u-dropdown__content__mask"></view>
 		</view>
 	</view>
 </template>
 
 <script>
-	import props from './props.js';
-	import mpMixin from '../../libs/mixin/mpMixin.js';
+    import props from './props.js';
+    import mpMixin from '../../libs/mixin/mpMixin.js';
 	import mixin from '../../libs/mixin/mixin.js';
 	/**
-	 * Dropdown  
-	 * @description 
-	 * @tutorial url
-	 * @property {String}
-	 * @event {Function}
-	 * @example
+	 * dropdown 下拉菜单
+	 * @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
+	 * @tutorial https://ijry.github.io/uview-plus/components/dropdown.html
+	 * @property {String} active-color 标题和选项卡选中的颜色(默认#2979ff)
+	 * @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266)
+	 * @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true)
+	 * @property {Boolean} close-on-click-self 点击当前激活项标题是否关闭菜单(默认true)
+	 * @property {String | Number} duration 选项卡展开和收起的过渡时间,单位ms(默认300)
+	 * @property {String | Number} height 标题菜单的高度,单位任意(默认80)
+	 * @property {String | Number} border-radius 菜单展开内容下方的圆角值,单位任意(默认0)
+	 * @property {Boolean} border-bottom 标题菜单是否显示下边框(默认false)
+	 * @property {String | Number} title-size 标题的字体大小,单位任意,数值默认为rpx单位(默认28)
+	 * @event {Function} open 下拉菜单被打开时触发
+	 * @event {Function} close 下拉菜单被关闭时触发
+	 * @example <u-dropdown></u-dropdown>
 	 */
 	export default {
 		name: 'u-dropdown',
-		mixins: [mixin, props],
+        mixins: [mpMixin, mixin, props],
 		data() {
 			return {
-				menuList: [],
-				current: 0
+				showDropdown: true, // 是否打开下来菜单,
+				menuList: [], // 显示的菜单
+				active: false, // 下拉菜单的状态
+				// 当前是第几个菜单处于激活状态,小程序中此处不能写成false或者"",否则后续将current赋值为0,
+				// 无能的TX没有使用===而是使用==判断,导致程序认为前后二者没有变化,从而不会触发视图更新
+				current: 99999,
+				// 外层内容的样式,初始时处于底层,且透明
+				contentStyle: {
+					zIndex: -1,
+					opacity: 0
+				},
+				// 让某个菜单保持高亮的状态
+				highlightIndex: 99999,
+				contentHeight: 0
 			}
 		},
 		computed: {
-		
+			// 下拉出来部分的样式
+			popupStyle() {
+				let style = {};
+				// 进行Y轴位移,展开状态时,恢复原位。收齐状态时,往上位移100%,进行隐藏
+				style.transform = `translateY(${this.active ? 0 : '-100%'})`
+				style['transition-duration'] = this.duration / 1000 + 's';
+				style.borderRadius = `0 0 ${this.$u.addUnit(this.borderRadius)} ${this.$u.addUnit(this.borderRadius)}`;
+				return style;
+			}
 		},
 		created() {
+			// 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错
 			this.children = [];
 		},
-		emits: ["click"],
+		mounted() {
+			this.getContentHeight();
+		},
+        emits: ['open', 'close'],
 		methods: {
-			clickHandler(item, index) {
+			init() {
+				// 当某个子组件内容变化时,触发父组件的init,父组件再让每一个子组件重新初始化一遍
+				// 以保证数据的正确性
+				this.menuList = [];
 				this.children.map(child => {
-					if(child.title === item.title) {
-						// this.queryRect('u-dropdown__menu').then(size => {
-							child.$emit('click')
-							child.setContentAnimate(child.show ? 0 : 300)
-							child.show = !child.show
-						// })
-					} else {
-						child.show = false
-						child.setContentAnimate(0)
-					}
+					child.init();
 				})
 			},
-			// 
-			queryRect(el) {
-				// #ifndef APP-NVUE
-				// $uGetRect?uView https://ijry.github.io/uview-plus/.uviewui.com/js/getRect.html
-				// this.$uGetRect this.$u.getRect
-				return new Promise(resolve => {
-					this.$uGetRect(`.${el}`).then(size => {
-						resolve(size)
-					})
-				})
-				// #endif
-			
-				// #ifdef APP-NVUE 
-				// promisethen
-				return new Promise(resolve => {
-					dom.getComponentRect(this.$refs[el], res => {
-						resolve(res.size)
-					})
+			// 点击菜单
+			menuClick(index) {
+				// 判断是否被禁用
+				if (this.menuList[index].disabled) return;
+				// 如果点击时的索引和当前激活项索引相同,意味着点击了激活项,需要收起下拉菜单
+				if (index === this.current && this.closeOnClickSelf) {
+					this.close();
+					// 等动画结束后,再移除下拉菜单中的内容,否则直接移除,也就没有下拉菜单收起的效果了
+					setTimeout(() => {
+						this.children[index].active = false;
+					}, this.duration)
+					return;
+				}
+				this.open(index);
+			},
+			// 打开下拉菜单
+			open(index) {
+				// 嵌套popup使用时可能获取不到正确的高度,重新计算
+				if (this.contentHeight < 1) this.getContentHeight()
+				// 重置高亮索引,否则会造成多个菜单同时高亮
+				// this.highlightIndex = 9999;
+				// 展开时,设置下拉内容的样式
+				this.contentStyle = {
+					zIndex: 11,
+				}
+				// 标记展开状态以及当前展开项的索引
+				this.active = true;
+				this.current = index;
+				// 历遍所有的子元素,将索引匹配的项标记为激活状态,因为子元素是通过v-if控制切换的
+				// 之所以不是因display: none,是因为nvue没有display这个属性
+				this.children.map((val, idx) => {
+					val.active = index == idx ? true : false;
 				})
-				// #endif
+				this.$emit('open', this.current);
 			},
-		},
+			// 设置下拉菜单处于收起状态
+			close() {
+				this.$emit('close', this.current);
+				// 设置为收起状态,同时current归位,设置为空字符串
+				this.active = false;
+				this.current = 99999;
+				// 下拉内容的样式进行调整,不透明度设置为0
+				this.contentStyle = {
+					zIndex: -1,
+					opacity: 0
+				}
+			},
+			// 点击遮罩
+			maskClick() {
+				// 如果不允许点击遮罩,直接返回
+				if (!this.closeOnClickMask) return;
+				this.close();
+			},
+			// 外部手动设置某个菜单高亮
+			highlight(index = undefined) {
+				this.highlightIndex = index !== undefined ? index : 99999;
+			},
+			// 获取下拉菜单内容的高度
+			getContentHeight() {
+				// 这里的原理为,因为dropdown组件是相对定位的,它的下拉出来的内容,必须给定一个高度
+				// 才能让遮罩占满菜单一下,直到屏幕底部的高度
+				// this.$u.sys()为uView封装的获取设备信息的方法
+				let windowHeight = this.$u.sys().windowHeight;
+				this.$uGetRect('.u-dropdown__menu').then(res => {
+					// 这里获取的是dropdown的尺寸,在H5上,uniapp获取尺寸是有bug的(以前提出修复过,后来又出现了此bug,目前hx2.8.11版本)
+					// H5端bug表现为元素尺寸的top值为导航栏底部到到元素的上边沿的距离,但是元素的bottom值确是导航栏顶部到元素底部的距离
+					// 二者是互相矛盾的,本质原因是H5端导航栏非原生,uni的开发者大意造成
+					// 这里取菜单栏的botton值合理的,不能用res.top,否则页面会造成滚动
+					this.contentHeight = windowHeight - res.bottom;
+				})
+			}
+		}
 	}
 </script>
 
-<style lang="scss">
-	@import '../../libs/css/components.scss';
+<style scoped lang="scss">
+	@import "../../libs/css/components.scss";
 
 	.u-dropdown {
+		flex: 1;
+		width: 100%;
+		position: relative;
 
 		&__menu {
 			@include flex;
+			position: relative;
+			z-index: 11;
+			height: 80rpx;
 
 			&__item {
 				flex: 1;
 				@include flex;
 				justify-content: center;
+				align-items: center;
 
-				&__content {
-					@include flex;
+                .u-flex-row {
+                    flex-direction: row;
+                }
+
+				&__text {
+					font-size: 28rpx;
+					color: $u-content-color;
+				}
+
+				&__arrow {
+					margin-left: 6rpx;
+					transition: transform .3s;
 					align-items: center;
+					@include flex;
+
+					&--rotate {
+						transform: rotate(180deg);
+					}
 				}
 			}
 		}
+
+		&__content {
+			position: absolute;
+			z-index: 8;
+			width: 100%;
+			left: 0px;
+			bottom: 0;
+			overflow: hidden;
+			
+
+			&__mask {
+				position: absolute;
+				z-index: 9;
+				background: rgba(0, 0, 0, .3);
+				width: 100%;
+				left: 0;
+				top: 0;
+				bottom: 0;
+			}
+
+			&__popup {
+				position: relative;
+				z-index: 10;
+				transition: all 0.3s;
+				transform: translate3D(0, -100%, 0);
+				overflow: hidden;
+			}
+		}
+
 	}
 </style>

+ 12 - 12
src/uni_modules/uview-plus/components/u-empty/props.js

@@ -1,60 +1,60 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 内置图标名称,或图片路径,建议绝对路径
         icon: {
             type: String,
-            default: defprops.empty.icon
+            default: () => defProps.empty.icon
         },
         // 提示文字
         text: {
             type: String,
-            default: defprops.empty.text
+            default: () => defProps.empty.text
         },
         // 文字颜色
         textColor: {
             type: String,
-            default: defprops.empty.textColor
+            default: () => defProps.empty.textColor
         },
         // 文字大小
         textSize: {
             type: [String, Number],
-            default: defprops.empty.textSize
+            default: () => defProps.empty.textSize
         },
         // 图标的颜色
         iconColor: {
             type: String,
-            default: defprops.empty.iconColor
+            default: () => defProps.empty.iconColor
         },
         // 图标的大小
         iconSize: {
             type: [String, Number],
-            default: defprops.empty.iconSize
+            default: () => defProps.empty.iconSize
         },
         // 选择预置的图标类型
         mode: {
             type: String,
-            default: defprops.empty.mode
+            default: () => defProps.empty.mode
         },
         //  图标宽度,单位px
         width: {
             type: [String, Number],
-            default: defprops.empty.width
+            default: () => defProps.empty.width
         },
         // 图标高度,单位px
         height: {
             type: [String, Number],
-            default: defprops.empty.height
+            default: () => defProps.empty.height
         },
         // 是否显示组件
         show: {
             type: Boolean,
-            default: defprops.empty.show
+            default: () => defProps.empty.show
         },
         // 组件距离上一个元素之间的距离,默认px单位
         marginTop: {
             type: [String, Number],
-            default: defprops.empty.marginTop
+            default: () => defProps.empty.marginTop
         }
     }
 }

+ 19 - 9
src/uni_modules/uview-plus/components/u-form-item/props.js

@@ -1,44 +1,54 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // input的label提示语
         label: {
             type: String,
-            default: defprops.formItem.label
+            default: () => defProps.formItem.label
         },
         // 绑定的值
         prop: {
             type: String,
-            default: defprops.formItem.prop
+            default: () => defProps.formItem.prop
+        },
+        // 绑定的规则
+        rule: {
+            type: String,
+            default: () => defProps.formItem.rule
         },
         // 是否显示表单域的下划线边框
         borderBottom: {
             type: [String, Boolean],
-            default: defprops.formItem.borderBottom
+            default: () => defProps.formItem.borderBottom
+        },
+        // label的位置,left-左边,top-上边
+        labelPosition: {
+            type: String,
+            default: () => defProps.formItem.labelPosition
         },
         // label的宽度,单位px
         labelWidth: {
             type: [String, Number],
-            default: defprops.formItem.labelWidth
+            default: () => defProps.formItem.labelWidth
         },
         // 右侧图标
         rightIcon: {
             type: String,
-            default: defprops.formItem.rightIcon
+            default: () => defProps.formItem.rightIcon
         },
         // 左侧图标
         leftIcon: {
             type: String,
-            default: defprops.formItem.leftIcon
+            default: () => defProps.formItem.leftIcon
         },
         // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
         required: {
             type: Boolean,
-            default: defprops.formItem.required
+            default: () => defProps.formItem.required
         },
         leftIconStyle: {
             type: [String, Object],
-            default: defprops.formItem.leftIconStyle,
+            default: () => defProps.formItem.leftIconStyle,
         }
     }
 }

+ 2 - 1
src/uni_modules/uview-plus/components/u-form-item/u-form-item.vue

@@ -4,7 +4,7 @@
 			class="u-form-item__body"
 			@tap="clickHandler"
 			:style="[$u.addStyle(customStyle), {
-				flexDirection: parentData.labelPosition === 'left' ? 'row' : 'column'
+                flexDirection: (labelPosition || parentData.labelPosition) === 'left' ? 'row' : 'column'
 			}]"
 		>
 			<!-- 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" -->
@@ -84,6 +84,7 @@
 	 * @tutorial https://ijry.github.io/uview-plus/components/form.html
 	 * @property {String}			label			input的label提示语
 	 * @property {String}			prop			绑定的值
+	 * @property {String}			rule			绑定的规则
 	 * @property {String | Boolean}	borderBottom	是否显示表单域的下划线边框
 	 * @property {String | Number}	labelWidth		label的宽度,单位px
 	 * @property {String}			rightIcon		右侧图标

+ 9 - 9
src/uni_modules/uview-plus/components/u-form/props.js

@@ -1,46 +1,46 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 当前form的需要验证字段的集合
         model: {
             type: Object,
-            default: defprops.form.model
+            default: () => defProps.form.model
         },
         // 验证规则
         rules: {
             type: [Object, Function, Array],
-            default: defprops.form.rules
+            default: () => defProps.form.rules
         },
         // 有错误时的提示方式,message-提示信息,toast-进行toast提示
         // border-bottom-下边框呈现红色,none-无提示
         errorType: {
             type: String,
-            default: defprops.form.errorType
+            default: () => defProps.form.errorType
         },
         // 是否显示表单域的下划线边框
         borderBottom: {
             type: Boolean,
-            default: defprops.form.borderBottom
+            default: () => defProps.form.borderBottom
         },
         // label的位置,left-左边,top-上边
         labelPosition: {
             type: String,
-            default: defprops.form.labelPosition
+            default: () => defProps.form.labelPosition
         },
         // label的宽度,单位px
         labelWidth: {
             type: [String, Number],
-            default: defprops.form.labelWidth
+            default: () => defProps.form.labelWidth
         },
         // lable字体的对齐方式
         labelAlign: {
             type: String,
-            default: defprops.form.labelAlign
+            default: () => defProps.form.labelAlign
         },
         // lable的样式,对象形式
         labelStyle: {
             type: Object,
-            default: defprops.form.labelStyle
+            default: () => defProps.form.labelStyle
         }
     }
 }

+ 3 - 3
src/uni_modules/uview-plus/components/u-form/u-form.vue

@@ -23,7 +23,7 @@
 	 * @property {String | Number}				labelWidth		提示文字的宽度,单位px  ( 默认 45 )
 	 * @property {String}						labelAlign		lable字体的对齐方式   ( 默认 ‘left' )
 	 * @property {Object}						labelStyle		lable的样式,对象形式
-	 * @example <u--formlabelPosition="left" :model="model1" :rules="rules" ref="form1"></u--form>
+	 * @example <up-formlabelPosition="left" :model="model1" :rules="rules" ref="form1"></up-form>
 	 */
 	export default {
 		name: "u-form",
@@ -147,14 +147,14 @@
 								propertyChain[propertyChain.length - 1];
 
 							let rule = this.formRules[child.prop];
-
+							
 							if(!rule){
 								rule=uni.$u.getProperty(
 								this.formRules,
 								child.prop
 								);
 							}
-
+							
 							// 如果不存在对应的规则,直接返回,否则校验器会报错
 							if (!rule) return;
 							// rule规则可为数组形式,也可为对象形式,此处拼接成为数组

+ 5 - 5
src/uni_modules/uview-plus/components/u-gap/props.js

@@ -1,25 +1,25 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 背景颜色(默认transparent)
         bgColor: {
             type: String,
-            default: defprops.gap.bgColor
+            default: () => defProps.gap.bgColor
         },
         // 分割槽高度,单位px(默认30)
         height: {
             type: [String, Number],
-            default: defprops.gap.height
+            default: () => defProps.gap.height
         },
         // 与上一个组件的距离
         marginTop: {
             type: [String, Number],
-            default: defprops.gap.marginTop
+            default: () => defProps.gap.marginTop
         },
         // 与下一个组件的距离
         marginBottom: {
             type: [String, Number],
-            default: defprops.gap.marginBottom
+            default: () => defProps.gap.marginBottom
         }
     }
 }

+ 5 - 4
src/uni_modules/uview-plus/components/u-gap/u-gap.vue

@@ -6,6 +6,7 @@
 	import props from './props.js';
 	import mpMixin from '../../libs/mixin/mpMixin.js';
 	import mixin from '../../libs/mixin/mixin.js';
+	import { addStyle, addUnit, deepMerge } from '../../libs/function/index.js';
 	/**
 	 * gap 间隔槽
 	 * @description 该组件一般用于内容块之间的用一个灰色块隔开的场景,方便用户风格统一,减少工作量
@@ -25,11 +26,11 @@
 			gapStyle() {
 				const style = {
 					backgroundColor: this.bgColor,
-					height: uni.$u.addUnit(this.height),
-					marginTop: uni.$u.addUnit(this.marginTop),
-					marginBottom: uni.$u.addUnit(this.marginBottom),
+					height: addUnit(this.height),
+					marginTop: addUnit(this.marginTop),
+					marginBottom: addUnit(this.marginBottom),
 				}
-				return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
+				return deepMerge(style, addStyle(this.customStyle))
 			}
 		}
 	};

+ 3 - 3
src/uni_modules/uview-plus/components/u-grid-item/props.js

@@ -1,15 +1,15 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 宫格的name
         name: {
             type: [String, Number, null],
-            default: defprops.gridItem.name
+            default: () => defProps.gridItem.name
         },
         // 背景颜色
         bgColor: {
             type: String,
-            default: defprops.gridItem.bgColor
+            default: () => defProps.gridItem.bgColor
         }
     }
 }

+ 8 - 7
src/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue

@@ -1,7 +1,6 @@
 <template>
-	<!-- #ifndef APP-NVUE -->
-	<view
-		v-if="parentData.col > 0"
+	<!-- #ifndef APP-NVUE -->
+	<view
		v-if="parentData.col > 0"
 	    class="u-grid-item"
 	    hover-class="u-grid-item--hover-class"
 	    :hover-stay-time="200"
@@ -50,6 +49,8 @@
 				},
 				// #ifdef APP-NVUE
 				width: 0, // nvue下才这么计算,vue下放到computed中,否则会因为延时造成闪烁
+				// #endif
				// #ifdef MP-TOUTIAO
+				width: '100%',
 				// #endif
 				classes: [], // 类名集合,用于判断是否显示右边和下边框
 			};
@@ -59,11 +60,11 @@
 		},
 		emits: ['click'],
 		//  微信小程序中 options 选项
-		options: {
-		    virtualHost: true //将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
-		},
+		// #ifdef MP-WEIXIN
		options: {
+		    virtualHost: true ,//将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
+		},
		// #endif
 		computed: {
-			// #ifndef APP-NVUE
+			// #ifndef APP-NVUE || MP-TOUTIAO
 			// vue下放到computed中,否则会因为延时造成闪烁
 			width() {
 				if (this.parentData.col > 0) {

+ 4 - 4
src/uni_modules/uview-plus/components/u-grid/props.js

@@ -1,20 +1,20 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 分成几列
         col: {
             type: [String, Number],
-            default: defprops.grid.col
+            default: () => defProps.grid.col
         },
         // 是否显示边框
         border: {
             type: Boolean,
-            default: defprops.grid.border
+            default: () => defProps.grid.border
         },
         // 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
         align: {
             type: String,
-            default: defprops.grid.align
+            default: () => defProps.grid.align
         }
     }
 }

+ 4 - 2
src/uni_modules/uview-plus/components/u-grid/u-grid.vue

@@ -71,7 +71,9 @@
 				return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
 			}
 		},
-		emits: ['click'], // 防止事件执行两次
+		emits: ['click'], // 防止事件执行两次
		// 20240409发现抖音小程序如果开启virtualHost会出现严重问题,几乎所有事件包括created等生命周期事件全部失效。
		// #ifdef MP-WEIXIN
		options: {
+		    // virtualHost: true ,//将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
+		},
		// #endif
 		methods: {
 			// 此方法由u-grid-item触发,用于在u-grid发出事件
 			childClick(name) {
@@ -95,6 +97,6 @@
 		justify-content: center;
 		@include flex;
 		flex-wrap: wrap;
-		align-items: center;
+		align-items: center;
		// 在uni-app中应尽量避免使用flex布局以外的方式,因为nvue/uvue等方案都支持flex布局
		// 这里使用grid布局使用为目前20240409uni-app在抖音小程序开启virtualHost时有bug,存在事件失效问题。
		/* #ifdef MP-TOUTIAO */
		display: grid;
		grid-template-columns: repeat(v-bind(col), 1fr);
		/* #endif */
 	}
 </style>

+ 18 - 18
src/uni_modules/uview-plus/components/u-icon/props.js

@@ -1,90 +1,90 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 图标类名
         name: {
             type: String,
-            default: defprops.icon.name
+            default: () => defProps.icon.name
         },
         // 图标颜色,可接受主题色
         color: {
             type: String,
-            default: defprops.icon.color
+            default: () => defProps.icon.color
         },
         // 字体大小,单位px
         size: {
             type: [String, Number],
-            default: defprops.icon.size
+            default: () => defProps.icon.size
         },
         // 是否显示粗体
         bold: {
             type: Boolean,
-            default: defprops.icon.bold
+            default: () => defProps.icon.bold
         },
         // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
         index: {
             type: [String, Number],
-            default: defprops.icon.index
+            default: () => defProps.icon.index
         },
         // 触摸图标时的类名
         hoverClass: {
             type: String,
-            default: defprops.icon.hoverClass
+            default: () => defProps.icon.hoverClass
         },
         // 自定义扩展前缀,方便用户扩展自己的图标库
         customPrefix: {
             type: String,
-            default: defprops.icon.customPrefix
+            default: () => defProps.icon.customPrefix
         },
         // 图标右边或者下面的文字
         label: {
             type: [String, Number],
-            default: defprops.icon.label
+            default: () => defProps.icon.label
         },
         // label的位置,只能右边或者下边
         labelPos: {
             type: String,
-            default: defprops.icon.labelPos
+            default: () => defProps.icon.labelPos
         },
         // label的大小
         labelSize: {
             type: [String, Number],
-            default: defprops.icon.labelSize
+            default: () => defProps.icon.labelSize
         },
         // label的颜色
         labelColor: {
             type: String,
-            default: defprops.icon.labelColor
+            default: () => defProps.icon.labelColor
         },
         // label与图标的距离
         space: {
             type: [String, Number],
-            default: defprops.icon.space
+            default: () => defProps.icon.space
         },
         // 图片的mode
         imgMode: {
             type: String,
-            default: defprops.icon.imgMode
+            default: () => defProps.icon.imgMode
         },
         // 用于显示图片小图标时,图片的宽度
         width: {
             type: [String, Number],
-            default: defprops.icon.width
+            default: () => defProps.icon.width
         },
         // 用于显示图片小图标时,图片的高度
         height: {
             type: [String, Number],
-            default: defprops.icon.height
+            default: () => defProps.icon.height
         },
         // 用于解决某些情况下,让图标垂直居中的用途
         top: {
             type: [String, Number],
-            default: defprops.icon.top
+            default: () => defProps.icon.top
         },
         // 是否阻止事件传播
         stop: {
             type: Boolean,
-            default: defprops.icon.stop
+            default: () => defProps.icon.stop
         }
     }
 }

+ 9 - 6
src/uni_modules/uview-plus/components/u-icon/u-icon.vue

@@ -92,12 +92,13 @@
 			uClasses() {
 				let classes = []
 				classes.push(this.customPrefix + '-' + this.name)
-				// // uView的自定义图标类名为u-iconfont
-				// if (this.customPrefix == 'uicon') {
-				// 	classes.push('u-iconfont')
-				// } else {
-				// 	classes.push(this.customPrefix)
-				// }
+				// uView的自定义图标类名为u-iconfont
+				if (this.customPrefix == 'uicon') {
+					classes.push('u-iconfont')
+				} else {
+					// 不能缺少这一步,否则自定义图标会无效
+					classes.push(this.customPrefix)
+				}
 				// 主题色,通过类配置
 				if (this.color && uni.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color)
 				// 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
@@ -134,6 +135,8 @@
 			},
 			// 通过图标名,查找对应的图标
 			icon() {
+				// 使用自定义图标的时候页面上会把name属性也展示出来,所以在这里处理一下
+				if (this.customPrefix !== "uicon") return "";
 				// 如果内置的图标中找不到对应的图标,就直接返回name值,因为用户可能传入的是unicode代码
 				return icons['uicon-' + this.name] || this.name
 			}

+ 17 - 17
src/uni_modules/uview-plus/components/u-image/props.js

@@ -1,85 +1,85 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 图片地址
         src: {
             type: String,
-            default: defprops.image.src
+            default: () => defProps.image.src
         },
         // 裁剪模式
         mode: {
             type: String,
-            default: defprops.image.mode
+            default: () => defProps.image.mode
         },
         // 宽度,单位任意
         width: {
             type: [String, Number],
-            default: defprops.image.width
+            default: () => defProps.image.width
         },
         // 高度,单位任意
         height: {
             type: [String, Number],
-            default: defprops.image.height
+            default: () => defProps.image.height
         },
         // 图片形状,circle-圆形,square-方形
         shape: {
             type: String,
-            default: defprops.image.shape
+            default: () => defProps.image.shape
         },
         // 圆角,单位任意
         radius: {
             type: [String, Number],
-            default: defprops.image.radius
+            default: () => defProps.image.radius
         },
         // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
         lazyLoad: {
             type: Boolean,
-            default: defprops.image.lazyLoad
+            default: () => defProps.image.lazyLoad
         },
         // 开启长按图片显示识别微信小程序码菜单
         showMenuByLongpress: {
             type: Boolean,
-            default: defprops.image.showMenuByLongpress
+            default: () => defProps.image.showMenuByLongpress
         },
         // 加载中的图标,或者小图片
         loadingIcon: {
             type: String,
-            default: defprops.image.loadingIcon
+            default: () => defProps.image.loadingIcon
         },
         // 加载失败的图标,或者小图片
         errorIcon: {
             type: String,
-            default: defprops.image.errorIcon
+            default: () => defProps.image.errorIcon
         },
         // 是否显示加载中的图标或者自定义的slot
         showLoading: {
             type: Boolean,
-            default: defprops.image.showLoading
+            default: () => defProps.image.showLoading
         },
         // 是否显示加载错误的图标或者自定义的slot
         showError: {
             type: Boolean,
-            default: defprops.image.showError
+            default: () => defProps.image.showError
         },
         // 是否需要淡入效果
         fade: {
             type: Boolean,
-            default: defprops.image.fade
+            default: () => defProps.image.fade
         },
         // 只支持网络资源,只对微信小程序有效
         webp: {
             type: Boolean,
-            default: defprops.image.webp
+            default: () => defProps.image.webp
         },
         // 过渡时间,单位ms
         duration: {
             type: [String, Number],
-            default: defprops.image.duration
+            default: () => defProps.image.duration
         },
         // 背景颜色,用于深色页面加载图片时,为了和背景色融合
         bgColor: {
             type: String,
-            default: defprops.image.bgColor
+            default: () => defProps.image.bgColor
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-image/u-image.vue

@@ -70,7 +70,7 @@
 	/**
 	 * Image 图片
 	 * @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
-	 * @tutorial https://uiadmin.net/uview-plus/components/image.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/image.html
 	 * @property {String}			src 				图片地址
 	 * @property {String}			mode 				裁剪模式,见官网说明 (默认 'aspectFill' )
 	 * @property {String | Number}	width 				宽度,单位任意,如果为数值,则为px单位 (默认 '300' )

+ 6 - 6
src/uni_modules/uview-plus/components/u-index-anchor/props.js

@@ -1,30 +1,30 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 列表锚点文本内容
         text: {
             type: [String, Number],
-            default: defprops.indexAnchor.text
+            default: () => defProps.indexAnchor.text
         },
         // 列表锚点文字颜色
         color: {
             type: String,
-            default: defprops.indexAnchor.color
+            default: () => defProps.indexAnchor.color
         },
         // 列表锚点文字大小,单位默认px
         size: {
             type: [String, Number],
-            default: defprops.indexAnchor.size
+            default: () => defProps.indexAnchor.size
         },
         // 列表锚点背景颜色
         bgColor: {
             type: String,
-            default: defprops.indexAnchor.bgColor
+            default: () => defProps.indexAnchor.bgColor
         },
         // 列表锚点高度,单位默认px
         height: {
             type: [String, Number],
-            default: defprops.indexAnchor.height
+            default: () => defProps.indexAnchor.height
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-index-anchor/u-index-anchor.vue

@@ -33,7 +33,7 @@
 	/**
 	 * IndexAnchor 列表锚点
 	 * @description 
-	 * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
 	 * @property {String | Number}	text	列表锚点文本内容
 	 * @property {String}			color	列表锚点文字颜色 ( 默认 '#606266' )
 	 * @property {String | Number}	size	列表锚点文字大小,单位默认px ( 默认 14 )

+ 1 - 1
src/uni_modules/uview-plus/components/u-index-item/props.js

@@ -1,4 +1,4 @@
-import defprops from '../../libs/config/props';
+// import defProps from '../../libs/config/props.js';
 export default {
     props: {
 

+ 1 - 1
src/uni_modules/uview-plus/components/u-index-item/u-index-item.vue

@@ -25,7 +25,7 @@
 	/**
 	 * IndexItem 
 	 * @description 
-	 * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
 	 * @property {String}
 	 * @event {Function}
 	 * @example

+ 6 - 6
src/uni_modules/uview-plus/components/u-index-list/props.js

@@ -1,30 +1,30 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 右边锚点非激活的颜色
         inactiveColor: {
             type: String,
-            default: defprops.indexList.inactiveColor
+            default: () => defProps.indexList.inactiveColor
         },
         // 右边锚点激活的颜色
         activeColor: {
             type: String,
-            default: defprops.indexList.activeColor
+            default: () => defProps.indexList.activeColor
         },
         // 索引字符列表,数组形式
         indexList: {
             type: Array,
-            default: defprops.indexList.indexList
+            default: () => defProps.indexList.indexList
         },
         // 是否开启锚点自动吸顶
         sticky: {
             type: Boolean,
-            default: defprops.indexList.sticky
+            default: () => defProps.indexList.sticky
         },
         // 自定义导航栏的高度
         customNavHeight: {
             type: [String, Number],
-            default: defprops.indexList.customNavHeight
+            default: () => defProps.indexList.customNavHeight
         }
     }
 }

+ 3 - 2
src/uni_modules/uview-plus/components/u-index-list/u-index-list.vue

@@ -110,7 +110,7 @@
 	/**
 	 * IndexList 索引列表
 	 * @description  通过折叠面板收纳内容区域
-	 * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
 	 * @property {String}			inactiveColor	右边锚点非激活的颜色 ( 默认 '#606266' )
 	 * @property {String}			activeColor		右边锚点激活的颜色 ( 默认 '#5677fc' )
 	 * @property {Array}			indexList		索引字符列表,数组形式
@@ -310,7 +310,8 @@
 				// #endif
 				// #ifdef MP-WEIXIN
 				// 微信小程序下,scroll-view的scroll-into-view属性无法对slot中的内容的id生效,只能通过设置scrollTop的形式去移动滚动条
-				this.scrollTop = this.children[currentIndex].top
+				const customNavHeight = this.customNavHeight
+				this.scrollTop = this.children[currentIndex].top - uni.$u.getPx(customNavHeight)
 				// #endif
 				// #ifdef APP-NVUE
 				// 在nvue中,由于cell和header为同级元素,所以实际是需要对header(anchor)进行偏移

+ 36 - 36
src/uni_modules/uview-plus/components/u-input/props.js

@@ -1,18 +1,18 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
 	props: {
 		// #ifdef VUE3
 		// 绑定的值
 		modelValue: {
 			type: [String, Number],
-			default: defprops.input.value
+			default: () => defProps.input.value
 		},
 		// #endif
 		// #ifdef VUE2
 		// 绑定的值
 		value: {
 			type: [String, Number],
-			default: defprops.input.value
+			default: () => defProps.input.value
 		},
 		// #endif
 		// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
@@ -21,171 +21,171 @@ export default {
 		// text-文本输入键盘
 		type: {
 			type: String,
-			default: defprops.input.type
+			default: () => defProps.input.type
 		},
 		// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
 		// 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
 		fixed: {
 			type: Boolean,
-			default: defprops.input.fixed
+			default: () => defProps.input.fixed
 		},
 		// 是否禁用输入框
 		disabled: {
 			type: Boolean,
-			default: defprops.input.disabled
+			default: () => defProps.input.disabled
 		},
 		// 禁用状态时的背景色
 		disabledColor: {
 			type: String,
-			default: defprops.input.disabledColor
+			default: () => defProps.input.disabledColor
 		},
 		// 是否显示清除控件
 		clearable: {
 			type: Boolean,
-			default: defprops.input.clearable
+			default: () => defProps.input.clearable
 		},
 		// 是否密码类型
 		password: {
 			type: Boolean,
-			default: defprops.input.password
+			default: () => defProps.input.password
 		},
 		// 最大输入长度,设置为 -1 的时候不限制最大长度
 		maxlength: {
 			type: [String, Number],
-			default: defprops.input.maxlength
+			default: () => defProps.input.maxlength
 		},
 		// 	输入框为空时的占位符
 		placeholder: {
 			type: String,
-			default: defprops.input.placeholder
+			default: () => defProps.input.placeholder
 		},
 		// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
 		placeholderClass: {
 			type: String,
-			default: defprops.input.placeholderClass
+			default: () => defProps.input.placeholderClass
 		},
 		// 指定placeholder的样式
 		placeholderStyle: {
 			type: [String, Object],
-			default: defprops.input.placeholderStyle
+			default: () => defProps.input.placeholderStyle
 		},
 		// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
 		showWordLimit: {
 			type: Boolean,
-			default: defprops.input.showWordLimit
+			default: () => defProps.input.showWordLimit
 		},
 		// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
 		// https://uniapp.dcloud.io/component/input
 		// https://uniapp.dcloud.io/component/textarea
 		confirmType: {
 			type: String,
-			default: defprops.input.confirmType
+			default: () => defProps.input.confirmType
 		},
 		// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
 		confirmHold: {
 			type: Boolean,
-			default: defprops.input.confirmHold
+			default: () => defProps.input.confirmHold
 		},
 		// focus时,点击页面的时候不收起键盘,微信小程序有效
 		holdKeyboard: {
 			type: Boolean,
-			default: defprops.input.holdKeyboard
+			default: () => defProps.input.holdKeyboard
 		},
 		// 自动获取焦点
 		// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
 		focus: {
 			type: Boolean,
-			default: defprops.input.focus
+			default: () => defProps.input.focus
 		},
 		// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
 		autoBlur: {
 			type: Boolean,
-			default: defprops.input.autoBlur
+			default: () => defProps.input.autoBlur
 		},
 		// 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
 		disableDefaultPadding: {
 			type: Boolean,
-			default: defprops.input.disableDefaultPadding
+			default: () => defProps.input.disableDefaultPadding
 		},
 		// 指定focus时光标的位置
 		cursor: {
 			type: [String, Number],
-			default: defprops.input.cursor
+			default: () => defProps.input.cursor
 		},
 		// 输入框聚焦时底部与键盘的距离
 		cursorSpacing: {
 			type: [String, Number],
-			default: defprops.input.cursorSpacing
+			default: () => defProps.input.cursorSpacing
 		},
 		// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
 		selectionStart: {
 			type: [String, Number],
-			default: defprops.input.selectionStart
+			default: () => defProps.input.selectionStart
 		},
 		// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
 		selectionEnd: {
 			type: [String, Number],
-			default: defprops.input.selectionEnd
+			default: () => defProps.input.selectionEnd
 		},
 		// 键盘弹起时,是否自动上推页面
 		adjustPosition: {
 			type: Boolean,
-			default: defprops.input.adjustPosition
+			default: () => defProps.input.adjustPosition
 		},
 		// 输入框内容对齐方式,可选值为:left|center|right
 		inputAlign: {
 			type: String,
-			default: defprops.input.inputAlign
+			default: () => defProps.input.inputAlign
 		},
 		// 输入框字体的大小
 		fontSize: {
 			type: [String, Number],
-			default: defprops.input.fontSize
+			default: () => defProps.input.fontSize
 		},
 		// 输入框字体颜色
 		color: {
 			type: String,
-			default: defprops.input.color
+			default: () => defProps.input.color
 		},
 		// 输入框前置图标
 		prefixIcon: {
 			type: String,
-			default: defprops.input.prefixIcon
+			default: () => defProps.input.prefixIcon
 		},
 		// 前置图标样式,对象或字符串
 		prefixIconStyle: {
 			type: [String, Object],
-			default: defprops.input.prefixIconStyle
+			default: () => defProps.input.prefixIconStyle
 		},
 		// 输入框后置图标
 		suffixIcon: {
 			type: String,
-			default: defprops.input.suffixIcon
+			default: () => defProps.input.suffixIcon
 		},
 		// 后置图标样式,对象或字符串
 		suffixIconStyle: {
 			type: [String, Object],
-			default: defprops.input.suffixIconStyle
+			default: () => defProps.input.suffixIconStyle
 		},
 		// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
 		border: {
 			type: String,
-			default: defprops.input.border
+			default: () => defProps.input.border
 		},
 		// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
 		readonly: {
 			type: Boolean,
-			default: defprops.input.readonly
+			default: () => defProps.input.readonly
 		},
 		// 输入框形状,circle-圆形,square-方形
 		shape: {
 			type: String,
-			default: defprops.input.shape
+			default: () => defProps.input.shape
 		},
 		// 用于处理或者过滤输入框内容的方法
 		formatter: {
 			type: [Function, null],
-			default: defprops.input.formatter
+			default: () => defProps.input.formatter
 		},
 		// 是否忽略组件内对文本合成系统事件的处理
 		ignoreCompositionEvent: {

+ 11 - 5
src/uni_modules/uview-plus/components/u-input/u-input.vue

@@ -37,7 +37,7 @@
             	    :adjust-position="adjustPosition"
             	    :selection-end="selectionEnd"
             	    :selection-start="selectionStart"
-            	    :password="password || type === 'password' || undefined"
+            	    :password="password || type === 'password' || false"
                     :ignoreCompositionEvent="ignoreCompositionEvent"
             	    @input="onInput"
             	    @blur="onBlur"
@@ -82,7 +82,7 @@ import mixin from '../../libs/mixin/mixin.js';
 /**
  * Input 输入框
  * @description  此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
- * @tutorial https://uiadmin.net/uview-plus/components/input.html
+ * @tutorial https://uview-plus.jiangruyi.com/components/input.html
  * @property {String | Number}	value					输入的值
  * @property {String}			type					输入框类型,见上方说明 ( 默认 'text' )
  * @property {Boolean}			fixed					如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
@@ -148,10 +148,13 @@ export default {
                 // 在H5中,外部value变化后,修改input中的值,不会触发@input事件,此时手动调用值变化方法
                 if (
                     this.firstChange === false &&
-					this.changeFromInner === false
+					this.changeFromInner === false
                 ) {
                     this.valueChange();
-                } else {
					// 尝试调用u-form的验证方法
					uni.$u.formValidate(this, "change");
				}
+                } else {
+					// 尝试调用u-form的验证方法
+					uni.$u.formValidate(this, "change");
+				}
                 /* #endif */
                 this.firstChange = false;
                 // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的
@@ -171,7 +174,10 @@ export default {
                     this.changeFromInner === false
                 ) {
                     this.valueChange();
-                } else {
					// 尝试调用u-form的验证方法
					uni.$u.formValidate(this, "change");
				}
+                } else {
+					// 尝试调用u-form的验证方法
+					uni.$u.formValidate(this, "change");
+				}
                 /* #endif */
                 this.firstChange = false;
                 // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的

+ 17 - 17
src/uni_modules/uview-plus/components/u-keyboard/props.js

@@ -1,85 +1,85 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
         mode: {
             type: String,
-            default: defprops.keyboard.mode
+            default: () => defProps.keyboard.mode
         },
         // 是否显示键盘的"."符号
         dotDisabled: {
             type: Boolean,
-            default: defprops.keyboard.dotDisabled
+            default: () => defProps.keyboard.dotDisabled
         },
         // 是否显示顶部工具条
         tooltip: {
             type: Boolean,
-            default: defprops.keyboard.tooltip
+            default: () => defProps.keyboard.tooltip
         },
         // 是否显示工具条中间的提示
         showTips: {
             type: Boolean,
-            default: defprops.keyboard.showTips
+            default: () => defProps.keyboard.showTips
         },
         // 工具条中间的提示文字
         tips: {
             type: String,
-            default: defprops.keyboard.tips
+            default: () => defProps.keyboard.tips
         },
         // 是否显示工具条左边的"取消"按钮
         showCancel: {
             type: Boolean,
-            default: defprops.keyboard.showCancel
+            default: () => defProps.keyboard.showCancel
         },
         // 是否显示工具条右边的"完成"按钮
         showConfirm: {
             type: Boolean,
-            default: defprops.keyboard.showConfirm
+            default: () => defProps.keyboard.showConfirm
         },
         // 是否打乱键盘按键的顺序
         random: {
             type: Boolean,
-            default: defprops.keyboard.random
+            default: () => defProps.keyboard.random
         },
         // 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距
         safeAreaInsetBottom: {
             type: Boolean,
-            default: defprops.keyboard.safeAreaInsetBottom
+            default: () => defProps.keyboard.safeAreaInsetBottom
         },
         // 是否允许通过点击遮罩关闭键盘
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.keyboard.closeOnClickOverlay
+            default: () => defProps.keyboard.closeOnClickOverlay
         },
         // 控制键盘的弹出与收起
         show: {
             type: Boolean,
-            default: defprops.keyboard.show
+            default: () => defProps.keyboard.show
         },
         // 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩
         overlay: {
             type: Boolean,
-            default: defprops.keyboard.overlay
+            default: () => defProps.keyboard.overlay
         },
         // z-index值
         zIndex: {
             type: [String, Number],
-            default: defprops.keyboard.zIndex
+            default: () => defProps.keyboard.zIndex
         },
         // 取消按钮的文字
         cancelText: {
             type: String,
-            default: defprops.keyboard.cancelText
+            default: () => defProps.keyboard.cancelText
         },
         // 确认按钮的文字
         confirmText: {
             type: String,
-            default: defprops.keyboard.confirmText
+            default: () => defProps.keyboard.confirmText
         },
         // 输入一个中文后,是否自动切换到英文
         autoChange: {
             type: Boolean,
-            default: defprops.keyboard.autoChange
+            default: () => defProps.keyboard.autoChange
         }
     }
 }

File diff suppressed because it is too large
+ 62 - 0
src/uni_modules/uview-plus/components/u-lazy-load/u-lazy-load.vue


+ 6 - 6
src/uni_modules/uview-plus/components/u-line-progress/props.js

@@ -1,29 +1,29 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 激活部分的颜色
         activeColor: {
             type: String,
-            default: defprops.lineProgress.activeColor
+            default: () => defProps.lineProgress.activeColor
         },
         inactiveColor: {
             type: String,
-            default: defprops.lineProgress.color
+            default: () => defProps.lineProgress.color
         },
         // 进度百分比,数值
         percentage: {
             type: [String, Number],
-            default: defprops.lineProgress.inactiveColor
+            default: () => defProps.lineProgress.inactiveColor
         },
         // 是否在进度条内部显示百分比的值
         showText: {
             type: Boolean,
-            default: defprops.lineProgress.showText
+            default: () => defProps.lineProgress.showText
         },
         // 进度条的高度,单位px
         height: {
             type: [String, Number],
-            default: defprops.lineProgress.height
+            default: () => defProps.lineProgress.height
         }
     }
 }

+ 7 - 7
src/uni_modules/uview-plus/components/u-line/props.js

@@ -1,34 +1,34 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         color: {
             type: String,
-            default: defprops.line.color
+            default: () => defProps.line.color
         },
         // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
         length: {
             type: [String, Number],
-            default: defprops.line.length
+            default: () => defProps.line.length
         },
         // 线条方向,col-竖向,row-横向
         direction: {
             type: String,
-            default: defprops.line.direction
+            default: () => defProps.line.direction
         },
         // 是否显示细边框
         hairline: {
             type: Boolean,
-            default: defprops.line.hairline
+            default: () => defProps.line.hairline
         },
         // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
         margin: {
             type: [String, Number],
-            default: defprops.line.margin
+            default: () => defProps.line.margin
         },
         // 是否虚线,true-虚线,false-实线
         dashed: {
             type: Boolean,
-            default: defprops.line.dashed
+            default: () => defProps.line.dashed
         }
     }
 }

+ 8 - 8
src/uni_modules/uview-plus/components/u-link/props.js

@@ -1,40 +1,40 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 文字颜色
         color: {
             type: String,
-            default: defprops.link.color
+            default: () => defProps.link.color
         },
         // 字体大小,单位px
         fontSize: {
             type: [String, Number],
-            default: defprops.link.fontSize
+            default: () => defProps.link.fontSize
         },
         // 是否显示下划线
         underLine: {
             type: Boolean,
-            default: defprops.link.underLine
+            default: () => defProps.link.underLine
         },
         // 要跳转的链接
         href: {
             type: String,
-            default: defprops.link.href
+            default: () => defProps.link.href
         },
         // 小程序中复制到粘贴板的提示语
         mpTips: {
             type: String,
-            default: defprops.link.mpTips
+            default: () => defProps.link.mpTips
         },
         // 下划线颜色
         lineColor: {
             type: String,
-            default: defprops.link.lineColor
+            default: () => defProps.link.lineColor
         },
         // 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
         text: {
             type: String,
-            default: defprops.link.text
+            default: () => defProps.link.text
         }
     }
 }

+ 2 - 2
src/uni_modules/uview-plus/components/u-list-item/props.js

@@ -1,10 +1,10 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 用于滚动到指定item
         anchor: {
             type: [String, Number],
-            default: defprops.listItem.anchor
+            default: () => defProps.listItem.anchor
         }
     }
 }

+ 15 - 15
src/uni_modules/uview-plus/components/u-list/props.js

@@ -1,75 +1,75 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 控制是否出现滚动条,仅nvue有效
         showScrollbar: {
             type: Boolean,
-            default: defprops.list.showScrollbar
+            default: () => defProps.list.showScrollbar
         },
         // 距底部多少时触发scrolltolower事件
         lowerThreshold: {
             type: [String, Number],
-            default: defprops.list.lowerThreshold
+            default: () => defProps.list.lowerThreshold
         },
         // 距顶部多少时触发scrolltoupper事件,非nvue有效
         upperThreshold: {
             type: [String, Number],
-            default: defprops.list.upperThreshold
+            default: () => defProps.list.upperThreshold
         },
         // 设置竖向滚动条位置
         scrollTop: {
             type: [String, Number],
-            default: defprops.list.scrollTop
+            default: () => defProps.list.scrollTop
         },
         // 控制 onscroll 事件触发的频率,仅nvue有效
         offsetAccuracy: {
             type: [String, Number],
-            default: defprops.list.offsetAccuracy
+            default: () => defProps.list.offsetAccuracy
         },
         // 启用 flexbox 布局。开启后,当前节点声明了display: flex就会成为flex container,并作用于其孩子节点,仅微信小程序有效
         enableFlex: {
             type: Boolean,
-            default: defprops.list.enableFlex
+            default: () => defProps.list.enableFlex
         },
         // 是否按分页模式显示List,默认值false
         pagingEnabled: {
             type: Boolean,
-            default: defprops.list.pagingEnabled
+            default: () => defProps.list.pagingEnabled
         },
         // 是否允许List滚动
         scrollable: {
             type: Boolean,
-            default: defprops.list.scrollable
+            default: () => defProps.list.scrollable
         },
         // 值应为某子元素id(id不能以数字开头)
         scrollIntoView: {
             type: String,
-            default: defprops.list.scrollIntoView
+            default: () => defProps.list.scrollIntoView
         },
         // 在设置滚动条位置时使用动画过渡
         scrollWithAnimation: {
             type: Boolean,
-            default: defprops.list.scrollWithAnimation
+            default: () => defProps.list.scrollWithAnimation
         },
         // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只对微信小程序有效
         enableBackToTop: {
             type: Boolean,
-            default: defprops.list.enableBackToTop
+            default: () => defProps.list.enableBackToTop
         },
         // 列表的高度
         height: {
             type: [String, Number],
-            default: defprops.list.height
+            default: () => defProps.list.height
         },
         // 列表宽度
         width: {
             type: [String, Number],
-            default: defprops.list.width
+            default: () => defProps.list.width
         },
         // 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度
         preLoadScreen: {
             type: [String, Number],
-            default: defprops.list.preLoadScreen
+            default: () => defProps.list.preLoadScreen
         }
         // vue下,是否开启虚拟列表
 

+ 12 - 12
src/uni_modules/uview-plus/components/u-loading-icon/props.js

@@ -1,60 +1,60 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否显示组件
         show: {
             type: Boolean,
-            default: defprops.loadingIcon.show
+            default: () => defProps.loadingIcon.show
         },
         // 颜色
         color: {
             type: String,
-            default: defprops.loadingIcon.color
+            default: () => defProps.loadingIcon.color
         },
         // 提示文字颜色
         textColor: {
             type: String,
-            default: defprops.loadingIcon.textColor
+            default: () => defProps.loadingIcon.textColor
         },
         // 文字和图标是否垂直排列
         vertical: {
             type: Boolean,
-            default: defprops.loadingIcon.vertical
+            default: () => defProps.loadingIcon.vertical
         },
         // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形
         mode: {
             type: String,
-            default: defprops.loadingIcon.mode
+            default: () => defProps.loadingIcon.mode
         },
         // 图标大小,单位默认px
         size: {
             type: [String, Number],
-            default: defprops.loadingIcon.size
+            default: () => defProps.loadingIcon.size
         },
         // 文字大小
         textSize: {
             type: [String, Number],
-            default: defprops.loadingIcon.textSize
+            default: () => defProps.loadingIcon.textSize
         },
         // 文字内容
         text: {
             type: [String, Number],
-            default: defprops.loadingIcon.text
+            default: () => defProps.loadingIcon.text
         },
         // 动画模式
         timingFunction: {
             type: String,
-            default: defprops.loadingIcon.timingFunction
+            default: () => defProps.loadingIcon.timingFunction
         },
         // 动画执行周期时间
         duration: {
             type: [String, Number],
-            default: defprops.loadingIcon.duration
+            default: () => defProps.loadingIcon.duration
         },
         // mode=circle时的暗边颜色
         inactiveColor: {
             type: String,
-            default: defprops.loadingIcon.inactiveColor
+            default: () => defProps.loadingIcon.inactiveColor
         }
     }
 }

+ 10 - 10
src/uni_modules/uview-plus/components/u-loading-page/props.js

@@ -1,50 +1,50 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 提示内容
         loadingText: {
             type: [String, Number],
-            default: defprops.loadingPage.loadingText
+            default: () => defProps.loadingPage.loadingText
         },
         // 文字上方用于替换loading动画的图片
         image: {
             type: String,
-            default: defprops.loadingPage.image
+            default: () => defProps.loadingPage.image
         },
         // 加载动画的模式,circle-圆形,spinner-花朵形,semicircle-半圆形
         loadingMode: {
             type: String,
-            default: defprops.loadingPage.loadingMode
+            default: () => defProps.loadingPage.loadingMode
         },
         // 是否加载中
         loading: {
             type: Boolean,
-            default: defprops.loadingPage.loading
+            default: () => defProps.loadingPage.loading
         },
         // 背景色
         bgColor: {
             type: String,
-            default: defprops.loadingPage.bgColor
+            default: () => defProps.loadingPage.bgColor
         },
         // 文字颜色
         color: {
             type: String,
-            default: defprops.loadingPage.color
+            default: () => defProps.loadingPage.color
         },
         // 文字大小
         fontSize: {
             type: [String, Number],
-            default: defprops.loadingPage.fontSize
+            default: () => defProps.loadingPage.fontSize
         },
 		// 图标大小
 		iconSize: {
 		    type: [String, Number],
-		    default: defprops.loadingPage.fontSize
+		    default: () => defProps.loadingPage.fontSize
 		},
         // 加载中图标的颜色,只能rgb或者十六进制颜色值
         loadingColor: {
             type: String,
-            default: defprops.loadingPage.loadingColor
+            default: () => defProps.loadingPage.loadingColor
         }
     }
 }

+ 19 - 19
src/uni_modules/uview-plus/components/u-loadmore/props.js

@@ -1,95 +1,95 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
         status: {
             type: String,
-            default: defprops.loadmore.status
+            default: () => defProps.loadmore.status
         },
         // 组件背景色
         bgColor: {
             type: String,
-            default: defprops.loadmore.bgColor
+            default: () => defProps.loadmore.bgColor
         },
         // 是否显示加载中的图标
         icon: {
             type: Boolean,
-            default: defprops.loadmore.icon
+            default: () => defProps.loadmore.icon
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.loadmore.fontSize
+            default: () => defProps.loadmore.fontSize
         },
 		    // 图标大小
         iconSize: {
             type: [String, Number],
-            default: defprops.loadmore.iconSize
+            default: () => defProps.loadmore.iconSize
         },
         // 字体颜色
         color: {
             type: String,
-            default: defprops.loadmore.color
+            default: () => defProps.loadmore.color
         },
         // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆
         loadingIcon: {
             type: String,
-            default: defprops.loadmore.loadingIcon
+            default: () => defProps.loadmore.loadingIcon
         },
         // 加载前的提示语
         loadmoreText: {
             type: String,
-            default: defprops.loadmore.loadmoreText
+            default: () => defProps.loadmore.loadmoreText
         },
         // 加载中提示语
         loadingText: {
             type: String,
-            default: defprops.loadmore.loadingText
+            default: () => defProps.loadmore.loadingText
         },
         // 没有更多的提示语
         nomoreText: {
             type: String,
-            default: defprops.loadmore.nomoreText
+            default: () => defProps.loadmore.nomoreText
         },
         // 在“没有更多”状态下,是否显示粗点
         isDot: {
             type: Boolean,
-            default: defprops.loadmore.isDot
+            default: () => defProps.loadmore.isDot
         },
         // 加载中图标的颜色
         iconColor: {
             type: String,
-            default: defprops.loadmore.iconColor
+            default: () => defProps.loadmore.iconColor
         },
         // 上边距
         marginTop: {
             type: [String, Number],
-            default: defprops.loadmore.marginTop
+            default: () => defProps.loadmore.marginTop
         },
         // 下边距
         marginBottom: {
             type: [String, Number],
-            default: defprops.loadmore.marginBottom
+            default: () => defProps.loadmore.marginBottom
         },
         // 高度,单位px
         height: {
             type: [String, Number],
-            default: defprops.loadmore.height
+            default: () => defProps.loadmore.height
         },
         // 是否显示左边分割线
         line: {
             type: Boolean,
-            default: defprops.loadmore.line
+            default: () => defProps.loadmore.line
         },
         // 线条颜色
         lineColor: {
             type: String,
-            default: defprops.loadmore.lineColor
+            default: () => defProps.loadmore.lineColor
         },
         // 是否虚线,true-虚线,false-实线
         dashed: {
             type: Boolean,
-            default: defprops.loadmore.dashed
+            default: () => defProps.loadmore.dashed
         }
     }
 }

+ 17 - 17
src/uni_modules/uview-plus/components/u-modal/props.js

@@ -1,85 +1,85 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否展示modal
         show: {
             type: Boolean,
-            default: defprops.modal.show
+            default: () => defProps.modal.show
         },
         // 标题
         title: {
             type: [String],
-            default: defprops.modal.title
+            default: () => defProps.modal.title
         },
         // 弹窗内容
         content: {
             type: String,
-            default: defprops.modal.content
+            default: () => defProps.modal.content
         },
         // 确认文案
         confirmText: {
             type: String,
-            default: defprops.modal.confirmText
+            default: () => defProps.modal.confirmText
         },
         // 取消文案
         cancelText: {
             type: String,
-            default: defprops.modal.cancelText
+            default: () => defProps.modal.cancelText
         },
         // 是否显示确认按钮
         showConfirmButton: {
             type: Boolean,
-            default: defprops.modal.showConfirmButton
+            default: () => defProps.modal.showConfirmButton
         },
         // 是否显示取消按钮
         showCancelButton: {
             type: Boolean,
-            default: defprops.modal.showCancelButton
+            default: () => defProps.modal.showCancelButton
         },
         // 确认按钮颜色
         confirmColor: {
             type: String,
-            default: defprops.modal.confirmColor
+            default: () => defProps.modal.confirmColor
         },
         // 取消文字颜色
         cancelColor: {
             type: String,
-            default: defprops.modal.cancelColor
+            default: () => defProps.modal.cancelColor
         },
         // 对调确认和取消的位置
         buttonReverse: {
             type: Boolean,
-            default: defprops.modal.buttonReverse
+            default: () => defProps.modal.buttonReverse
         },
         // 是否开启缩放效果
         zoom: {
             type: Boolean,
-            default: defprops.modal.zoom
+            default: () => defProps.modal.zoom
         },
         // 是否异步关闭,只对确定按钮有效
         asyncClose: {
             type: Boolean,
-            default: defprops.modal.asyncClose
+            default: () => defProps.modal.asyncClose
         },
         // 是否允许点击遮罩关闭modal
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.modal.closeOnClickOverlay
+            default: () => defProps.modal.closeOnClickOverlay
         },
         // 给一个负的margin-top,往上偏移,避免和键盘重合的情况
         negativeTop: {
             type: [String, Number],
-            default: defprops.modal.negativeTop
+            default: () => defProps.modal.negativeTop
         },
         // modal宽度,不支持百分比,可以数值,px,rpx单位
         width: {
             type: [String, Number],
-            default: defprops.modal.width
+            default: () => defProps.modal.width
         },
         // 确认按钮的样式,circle-圆形,square-方形,如设置,将不会显示取消按钮
         confirmButtonShape: {
             type: String,
-            default: defprops.modal.confirmButtonShape
+            default: () => defProps.modal.confirmButtonShape
         }
     }
 }

+ 17 - 17
src/uni_modules/uview-plus/components/u-navbar/props.js

@@ -1,85 +1,85 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
 	props: {
 		// 是否开启顶部安全区适配
 		safeAreaInsetTop: {
 			type: Boolean,
-			default: defprops.navbar.safeAreaInsetTop
+			default: () => defProps.navbar.safeAreaInsetTop
 		},
 		// 固定在顶部时,是否生成一个等高元素,以防止塌陷
 		placeholder: {
 			type: Boolean,
-			default: defprops.navbar.placeholder
+			default: () => defProps.navbar.placeholder
 		},
 		// 是否固定在顶部
 		fixed: {
 			type: Boolean,
-			default: defprops.navbar.fixed
+			default: () => defProps.navbar.fixed
 		},
 		// 是否显示下边框
 		border: {
 			type: Boolean,
-			default: defprops.navbar.border
+			default: () => defProps.navbar.border
 		},
 		// 左边的图标
 		leftIcon: {
 			type: String,
-			default: defprops.navbar.leftIcon
+			default: () => defProps.navbar.leftIcon
 		},
 		// 左边的提示文字
 		leftText: {
 			type: String,
-			default: defprops.navbar.leftText
+			default: () => defProps.navbar.leftText
 		},
 		// 左右的提示文字
 		rightText: {
 			type: String,
-			default: defprops.navbar.rightText
+			default: () => defProps.navbar.rightText
 		},
 		// 右边的图标
 		rightIcon: {
 			type: String,
-			default: defprops.navbar.rightIcon
+			default: () => defProps.navbar.rightIcon
 		},
 		// 标题
 		title: {
 			type: [String, Number],
-			default: defprops.navbar.title
+			default: () => defProps.navbar.title
 		},
 		// 背景颜色
 		bgColor: {
 			type: String,
-			default: defprops.navbar.bgColor
+			default: () => defProps.navbar.bgColor
 		},
 		// 标题的宽度
 		titleWidth: {
 			type: [String, Number],
-			default: defprops.navbar.titleWidth
+			default: () => defProps.navbar.titleWidth
 		},
 		// 导航栏高度
 		height: {
 			type: [String, Number],
-			default: defprops.navbar.height
+			default: () => defProps.navbar.height
 		},
 		// 左侧返回图标的大小
 		leftIconSize: {
 			type: [String, Number],
-			default: defprops.navbar.leftIconSize
+			default: () => defProps.navbar.leftIconSize
 		},
 		// 左侧返回图标的颜色
 		leftIconColor: {
 			type: String,
-			default: defprops.navbar.leftIconColor
+			default: () => defProps.navbar.leftIconColor
 		},
 		// 点击左侧区域(返回图标),是否自动返回上一页
 		autoBack: {
 			type: Boolean,
-			default: defprops.navbar.autoBack
+			default: () => defProps.navbar.autoBack
 		},
 		// 标题的样式,对象或字符串
 		titleStyle: {
 			type: [String, Object],
-			default: defprops.navbar.titleStyle
+			default: () => defProps.navbar.titleStyle
 		}
 	}
 }

+ 4 - 4
src/uni_modules/uview-plus/components/u-no-network/props.js

@@ -1,20 +1,20 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 页面文字提示
         tips: {
             type: String,
-            default: defprops.noNetwork.tips
+            default: () => defProps.noNetwork.tips
         },
         // 一个z-index值,用于设置没有网络这个组件的层次,因为页面可能会有其他定位的元素层级过高,导致此组件被覆盖
         zIndex: {
             type: [String, Number],
-            default: defprops.noNetwork.zIndex
+            default: () => defProps.noNetwork.zIndex
         },
         // image 没有网络的图片提示
         image: {
             type: String,
-            default: defprops.noNetwork.image
+            default: () => defProps.noNetwork.image
         }
     }
 }

+ 14 - 14
src/uni_modules/uview-plus/components/u-notice-bar/props.js

@@ -1,71 +1,71 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 显示的内容,数组
         text: {
             type: [Array, String],
-            default: defprops.noticeBar.text
+            default: () => defProps.noticeBar.text
         },
         // 通告滚动模式,row-横向滚动,column-竖向滚动
         direction: {
             type: String,
-            default: defprops.noticeBar.direction
+            default: () => defProps.noticeBar.direction
         },
         // direction = row时,是否使用步进形式滚动
         step: {
             type: Boolean,
-            default: defprops.noticeBar.step
+            default: () => defProps.noticeBar.step
         },
         // 是否显示左侧的音量图标
         icon: {
             type: String,
-            default: defprops.noticeBar.icon
+            default: () => defProps.noticeBar.icon
         },
         // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
         mode: {
             type: String,
-            default: defprops.noticeBar.mode
+            default: () => defProps.noticeBar.mode
         },
         // 文字颜色,各图标也会使用文字颜色
         color: {
             type: String,
-            default: defprops.noticeBar.color
+            default: () => defProps.noticeBar.color
         },
         // 背景颜色
         bgColor: {
             type: String,
-            default: defprops.noticeBar.bgColor
+            default: () => defProps.noticeBar.bgColor
         },
         // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
         speed: {
             type: [String, Number],
-            default: defprops.noticeBar.speed
+            default: () => defProps.noticeBar.speed
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.noticeBar.fontSize
+            default: () => defProps.noticeBar.fontSize
         },
         // 滚动一个周期的时间长,单位ms
         duration: {
             type: [String, Number],
-            default: defprops.noticeBar.duration
+            default: () => defProps.noticeBar.duration
         },
         // 是否禁止用手滑动切换
         // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
         disableTouch: {
             type: Boolean,
-            default: defprops.noticeBar.disableTouch
+            default: () => defProps.noticeBar.disableTouch
         },
         // 跳转的页面路径
         url: {
             type: String,
-            default: defprops.noticeBar.url
+            default: () => defProps.noticeBar.url
         },
         // 页面跳转的类型
         linkType: {
             type: String,
-            default: defprops.noticeBar.linkType
+            default: () => defProps.noticeBar.linkType
         }
     }
 }

+ 10 - 10
src/uni_modules/uview-plus/components/u-notify/props.js

@@ -1,50 +1,50 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 到顶部的距离
         top: {
             type: [String, Number],
-            default: defprops.notify.top
+            default: () => defProps.notify.top
         },
         // 是否展示组件
         // show: {
         // 	type: Boolean,
-        // 	default: defprops.notify.show
+        // 	default: () => defProps.notify.show
         // },
         // type主题,primary,success,warning,error
         type: {
             type: String,
-            default: defprops.notify.type
+            default: () => defProps.notify.type
         },
         // 字体颜色
         color: {
             type: String,
-            default: defprops.notify.color
+            default: () => defProps.notify.color
         },
         // 背景颜色
         bgColor: {
             type: String,
-            default: defprops.notify.bgColor
+            default: () => defProps.notify.bgColor
         },
         // 展示的文字内容
         message: {
             type: String,
-            default: defprops.notify.message
+            default: () => defProps.notify.message
         },
         // 展示时长,为0时不消失,单位ms
         duration: {
             type: [String, Number],
-            default: defprops.notify.duration
+            default: () => defProps.notify.duration
         },
         // 字体大小
         fontSize: {
             type: [String, Number],
-            default: defprops.notify.fontSize
+            default: () => defProps.notify.fontSize
         },
         // 是否留出顶部安全距离(状态栏高度)
         safeAreaInsetTop: {
             type: Boolean,
-            default: defprops.notify.safeAreaInsetTop
+            default: () => defProps.notify.safeAreaInsetTop
         }
     }
 }

+ 23 - 23
src/uni_modules/uview-plus/components/u-number-box/props.js

@@ -1,119 +1,119 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 步进器标识符,在change回调返回
         name: {
             type: [String, Number],
-            default: defprops.numberBox.name
+            default: () => defProps.numberBox.name
         },
         // #ifdef VUE2
         // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
         value: {
             type: [String, Number],
-            default: defprops.numberBox.value
+            default: () => defProps.numberBox.value
         },
         // #endif
         // #ifdef VUE3
         // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
         modelValue: {
             type: [String, Number],
-            default: defprops.numberBox.value
+            default: () => defProps.numberBox.value
         },
         // #endif
         // 最小值
         min: {
             type: [String, Number],
-            default: defprops.numberBox.min
+            default: () => defProps.numberBox.min
         },
         // 最大值
         max: {
             type: [String, Number],
-            default: defprops.numberBox.max
+            default: () => defProps.numberBox.max
         },
         // 加减的步长,可为小数
         step: {
             type: [String, Number],
-            default: defprops.numberBox.step
+            default: () => defProps.numberBox.step
         },
         // 是否只允许输入整数
         integer: {
             type: Boolean,
-            default: defprops.numberBox.integer
+            default: () => defProps.numberBox.integer
         },
         // 是否禁用,包括输入框,加减按钮
         disabled: {
             type: Boolean,
-            default: defprops.numberBox.disabled
+            default: () => defProps.numberBox.disabled
         },
         // 是否禁用输入框
         disabledInput: {
             type: Boolean,
-            default: defprops.numberBox.disabledInput
+            default: () => defProps.numberBox.disabledInput
         },
         // 是否开启异步变更,开启后需要手动控制输入值
         asyncChange: {
             type: Boolean,
-            default: defprops.numberBox.asyncChange
+            default: () => defProps.numberBox.asyncChange
         },
         // 输入框宽度,单位为px
         inputWidth: {
             type: [String, Number],
-            default: defprops.numberBox.inputWidth
+            default: () => defProps.numberBox.inputWidth
         },
         // 是否显示减少按钮
         showMinus: {
             type: Boolean,
-            default: defprops.numberBox.showMinus
+            default: () => defProps.numberBox.showMinus
         },
         // 是否显示增加按钮
         showPlus: {
             type: Boolean,
-            default: defprops.numberBox.showPlus
+            default: () => defProps.numberBox.showPlus
         },
         // 显示的小数位数
         decimalLength: {
             type: [String, Number, null],
-            default: defprops.numberBox.decimalLength
+            default: () => defProps.numberBox.decimalLength
         },
         // 是否开启长按加减手势
         longPress: {
             type: Boolean,
-            default: defprops.numberBox.longPress
+            default: () => defProps.numberBox.longPress
         },
         // 输入框文字和加减按钮图标的颜色
         color: {
             type: String,
-            default: defprops.numberBox.color
+            default: () => defProps.numberBox.color
         },
         // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
         buttonSize: {
             type: [String, Number],
-            default: defprops.numberBox.buttonSize
+            default: () => defProps.numberBox.buttonSize
         },
         // 输入框和按钮的背景颜色
         bgColor: {
             type: String,
-            default: defprops.numberBox.bgColor
+            default: () => defProps.numberBox.bgColor
         },
         // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
         cursorSpacing: {
             type: [String, Number],
-            default: defprops.numberBox.cursorSpacing
+            default: () => defProps.numberBox.cursorSpacing
         },
         // 是否禁用增加按钮
         disablePlus: {
             type: Boolean,
-            default: defprops.numberBox.disablePlus
+            default: () => defProps.numberBox.disablePlus
         },
         // 是否禁用减少按钮
         disableMinus: {
             type: Boolean,
-            default: defprops.numberBox.disableMinus
+            default: () => defProps.numberBox.disableMinus
         },
         // 加减按钮图标的样式
         iconStyle: {
             type: [Object, String],
-            default: defprops.numberBox.iconStyle
+            default: () => defProps.numberBox.iconStyle
         }
     }
 }

+ 25 - 5
src/uni_modules/uview-plus/components/u-number-box/u-number-box.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="u-number-box">
 		<view
-		    class="u-number-box__slot"
+		    class="u-number-box__slot cursor-pointer"
 		    @tap.stop="clickHandler('minus')"
 		    @touchstart="onTouchStart('minus')"
 		    @touchend.stop="clearTimeout"
@@ -11,7 +11,7 @@
 		</view>
 		<view
 		    v-else-if="showMinus"
-		    class="u-number-box__minus"
+		    class="u-number-box__minus cursor-pointer"
 		    @tap.stop="clickHandler('minus')"
 		    @touchstart="onTouchStart('minus')"
 		    @touchend.stop="clearTimeout"
@@ -30,6 +30,21 @@
 		</view>
 
 		<slot name="input">
+			<!-- #ifdef MP-WEIXIN -->
+			<input
+			    :disabled="disabledInput || disabled"
+			    :cursor-spacing="getCursorSpacing"
+			    :class="{ 'u-number-box__input--disabled': disabled || disabledInput }"
+			    :value="currentValue"
+			    class="u-number-box__input"
+			    @blur="onBlur"
+			    @focus="onFocus"
+			    @input="onInput"
+			    type="number"
+			    :style="[inputStyle]"
+			/>
+			<!-- #endif -->
+			<!-- #ifndef MP-WEIXIN -->
 			<input
 			    :disabled="disabledInput || disabled"
 			    :cursor-spacing="getCursorSpacing"
@@ -42,9 +57,10 @@
 			    type="number"
 			    :style="[inputStyle]"
 			/>
+			<!-- #endif -->
 		</slot>
 		<view
-		    class="u-number-box__slot"
+		    class="u-number-box__slot cursor-pointer"
 		    @tap.stop="clickHandler('plus')"
 		    @touchstart="onTouchStart('plus')"
 		    @touchend.stop="clearTimeout"
@@ -54,7 +70,7 @@
 		</view>
 		<view
 		    v-else-if="showPlus"
-		    class="u-number-box__plus"
+		    class="u-number-box__plus cursor-pointer"
 		    @tap.stop="clickHandler('plus')"
 		    @touchstart="onTouchStart('plus')"
 		    @touchend.stop="clearTimeout"
@@ -81,7 +97,7 @@
 	/**
 	 * numberBox 步进器
 	 * @description 该组件一般用于商城购物选择物品数量的场景。
-	 * @tutorial https://uiadmin.net/uview-plus/components/numberBox.html
+	 * @tutorial https://uview-plus.jiangruyi.com/components/numberBox.html
 	 * @property {String | Number}	name			步进器标识符,在change回调返回
 	 * @property {String | Number}	value			用于双向绑定的值,初始化时设置设为默认min值(最小值)  (默认 0 )
 	 * @property {String | Number}	min				最小值 (默认 1 )
@@ -295,6 +311,10 @@
 				}
 				formatted = this.format(formatted)
 				this.emitChange(formatted);
+				// #ifdef MP-WEIXIN 
+				return formatted
+				// #endif 
+			
 			},
 			// 发出change事件
 			emitChange(value) {

+ 4 - 4
src/uni_modules/uview-plus/components/u-number-keyboard/props.js

@@ -1,20 +1,20 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 键盘的类型,number-数字键盘,card-身份证键盘
         mode: {
             type: String,
-            default: defprops.numberKeyboard.value
+            default: () => defProps.numberKeyboard.value
         },
         // 是否显示键盘的"."符号
         dotDisabled: {
             type: Boolean,
-            default: defprops.numberKeyboard.dotDisabled
+            default: () => defProps.numberKeyboard.dotDisabled
         },
         // 是否打乱键盘按键的顺序
         random: {
             type: Boolean,
-            default: defprops.numberKeyboard.random
+            default: () => defProps.numberKeyboard.random
         }
     }
 }

+ 5 - 5
src/uni_modules/uview-plus/components/u-overlay/props.js

@@ -1,25 +1,25 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否显示遮罩
         show: {
             type: Boolean,
-            default: defprops.overlay.show
+            default: () => defProps.overlay.show
         },
         // 层级z-index
         zIndex: {
             type: [String, Number],
-            default: defprops.overlay.zIndex
+            default: () => defProps.overlay.zIndex
         },
         // 遮罩的过渡时间,单位为ms
         duration: {
             type: [String, Number],
-            default: defprops.overlay.duration
+            default: () => defProps.overlay.duration
         },
         // 不透明度值,当做rgba的第四个参数
         opacity: {
             type: [String, Number],
-            default: defprops.overlay.opacity
+            default: () => defProps.overlay.opacity
         }
     }
 }

+ 9 - 9
src/uni_modules/uview-plus/components/u-parse/props.js

@@ -1,4 +1,4 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
 		containerStyle: {
@@ -8,38 +8,38 @@ export default {
         content: String,
         copyLink: {
 		  type: Boolean,
-		  default: defprops.parse.copyLink
+		  default: () => defProps.parse.copyLink
         },
         domain: String,
         errorImg: {
 		  type: String,
-		  default: defprops.parse.errorImg
+		  default: () => defProps.parse.errorImg
         },
         lazyLoad: {
 		  type: Boolean,
-		  default: defprops.parse.lazyLoad
+		  default: () => defProps.parse.lazyLoad
         },
         loadingImg: {
 		  type: String,
-		  default: defprops.parse.loadingImg
+		  default: () => defProps.parse.loadingImg
         },
         pauseVideo: {
 		  type: Boolean,
-		  default: defprops.parse.pauseVideo
+		  default: () => defProps.parse.pauseVideo
         },
         previewImg: {
 		  type: Boolean,
-		  default: defprops.parse.previewImg
+		  default: () => defProps.parse.previewImg
         },
         scrollTable: Boolean,
         selectable: Boolean,
         setTitle: {
 		  type: Boolean,
-		  default: defprops.parse.setTitle
+		  default: () => defProps.parse.setTitle
         },
         showImgMenu: {
 		  type: Boolean,
-		  default: defprops.parse.showImgMenu
+		  default: () => defProps.parse.showImgMenu
         },
         tagStyle: Object,
         useAnchor: null

+ 1 - 1
src/uni_modules/uview-plus/components/u-picker-column/props.js

@@ -1,4 +1,4 @@
-import defprops from '../../libs/config/props';
+// import defProps from '../../libs/config/props.js';
 export default {
     props: {
 

+ 17 - 17
src/uni_modules/uview-plus/components/u-picker/props.js

@@ -1,85 +1,85 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否展示picker弹窗
         show: {
             type: Boolean,
-            default: defprops.picker.show
+            default: () => defProps.picker.show
         },
 		// 弹出的方向,可选值为 top bottom right left center
         popupMode: {
             type: String,
-            default: defprops.picker.popupMode
+            default: () => defProps.picker.popupMode
         },
         // 是否展示顶部的操作栏
         showToolbar: {
             type: Boolean,
-            default: defprops.picker.showToolbar
+            default: () => defProps.picker.showToolbar
         },
         // 顶部标题
         title: {
             type: String,
-            default: defprops.picker.title
+            default: () => defProps.picker.title
         },
         // 对象数组,设置每一列的数据
         columns: {
             type: Array,
-            default: defprops.picker.columns
+            default: () => defProps.picker.columns
         },
         // 是否显示加载中状态
         loading: {
             type: Boolean,
-            default: defprops.picker.loading
+            default: () => defProps.picker.loading
         },
         // 各列中,单个选项的高度
         itemHeight: {
             type: [String, Number],
-            default: defprops.picker.itemHeight
+            default: () => defProps.picker.itemHeight
         },
         // 取消按钮的文字
         cancelText: {
             type: String,
-            default: defprops.picker.cancelText
+            default: () => defProps.picker.cancelText
         },
         // 确认按钮的文字
         confirmText: {
             type: String,
-            default: defprops.picker.confirmText
+            default: () => defProps.picker.confirmText
         },
         // 取消按钮的颜色
         cancelColor: {
             type: String,
-            default: defprops.picker.cancelColor
+            default: () => defProps.picker.cancelColor
         },
         // 确认按钮的颜色
         confirmColor: {
             type: String,
-            default: defprops.picker.confirmColor
+            default: () => defProps.picker.confirmColor
         },
         // 每列中可见选项的数量
         visibleItemCount: {
             type: [String, Number],
-            default: defprops.picker.visibleItemCount
+            default: () => defProps.picker.visibleItemCount
         },
         // 选项对象中,需要展示的属性键名
         keyName: {
             type: String,
-            default: defprops.picker.keyName
+            default: () => defProps.picker.keyName
         },
         // 是否允许点击遮罩关闭选择器
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.picker.closeOnClickOverlay
+            default: () => defProps.picker.closeOnClickOverlay
         },
         // 各列的默认索引
         defaultIndex: {
             type: Array,
-            default: defprops.picker.defaultIndex
+            default: () => defProps.picker.defaultIndex
         },
 		// 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
 		immediateChange: {
 			type: Boolean,
-			default: defprops.picker.immediateChange
+			default: () => defProps.picker.immediateChange
 		}
     }
 }

+ 5 - 2
src/uni_modules/uview-plus/components/u-picker/u-picker.vue

@@ -38,7 +38,8 @@
 						:style="{
 							height: $u.addUnit(itemHeight),
 							lineHeight: $u.addUnit(itemHeight),
-							fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
+							fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal',
+							display: 'block'
 						}"
 					>{{ getItemText(item1) }}</view>
 				</picker-view-column>
@@ -79,7 +80,7 @@
  */
 import props from './props.js';
 import mpMixin from '../../libs/mixin/mpMixin.js';
-	import mixin from '../../libs/mixin/mixin.js';
+import mixin from '../../libs/mixin/mixin.js';
 export default {
 	name: 'u-picker',
 	mixins: [mpMixin, mixin, props],
@@ -194,6 +195,8 @@ export default {
 		setColumnValues(columnIndex, values) {
 			// 替换innerColumns数组中columnIndex索引的值为values,使用的是数组的splice方法
 			this.innerColumns.splice(columnIndex, 1, values)
+            // 替换完成之后将修改列之后的已选值置空
+			this.setLastIndex(this.innerIndex.slice(0, columnIndex))
 			// 拷贝一份原有的innerIndex做临时变量,将大于当前变化列的所有的列的默认索引设置为0
 			let tmpIndex = uni.$u.deepClone(this.innerIndex)
 			for (let i = 0; i < this.innerColumns.length; i++) {

+ 16 - 16
src/uni_modules/uview-plus/components/u-popup/props.js

@@ -1,80 +1,80 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // 是否展示弹窗
         show: {
             type: Boolean,
-            default: defprops.popup.show
+            default: () => defProps.popup.show
         },
         // 是否显示遮罩
         overlay: {
             type: Boolean,
-            default: defprops.popup.overlay
+            default: () => defProps.popup.overlay
         },
         // 弹出的方向,可选值为 top bottom right left center
         mode: {
             type: String,
-            default: defprops.popup.mode
+            default: () => defProps.popup.mode
         },
         // 动画时长,单位ms
         duration: {
             type: [String, Number],
-            default: defprops.popup.duration
+            default: () => defProps.popup.duration
         },
         // 是否显示关闭图标
         closeable: {
             type: Boolean,
-            default: defprops.popup.closeable
+            default: () => defProps.popup.closeable
         },
         // 自定义遮罩的样式
         overlayStyle: {
             type: [Object, String],
-            default: defprops.popup.overlayStyle
+            default: () => defProps.popup.overlayStyle
         },
         // 点击遮罩是否关闭弹窗
         closeOnClickOverlay: {
             type: Boolean,
-            default: defprops.popup.closeOnClickOverlay
+            default: () => defProps.popup.closeOnClickOverlay
         },
         // 层级
         zIndex: {
             type: [String, Number],
-            default: defprops.popup.zIndex
+            default: () => defProps.popup.zIndex
         },
         // 是否为iPhoneX留出底部安全距离
         safeAreaInsetBottom: {
             type: Boolean,
-            default: defprops.popup.safeAreaInsetBottom
+            default: () => defProps.popup.safeAreaInsetBottom
         },
         // 是否留出顶部安全距离(状态栏高度)
         safeAreaInsetTop: {
             type: Boolean,
-            default: defprops.popup.safeAreaInsetTop
+            default: () => defProps.popup.safeAreaInsetTop
         },
         // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
         closeIconPos: {
             type: String,
-            default: defprops.popup.closeIconPos
+            default: () => defProps.popup.closeIconPos
         },
         // 是否显示圆角
         round: {
             type: [Boolean, String, Number],
-            default: defprops.popup.round
+            default: () => defProps.popup.round
         },
         // mode=center,也即中部弹出时,是否使用缩放模式
         zoom: {
             type: Boolean,
-            default: defprops.popup.zoom
+            default: () => defProps.popup.zoom
         },
         // 弹窗背景色,设置为transparent可去除白色背景
         bgColor: {
             type: String,
-            default: defprops.popup.bgColor
+            default: () => defProps.popup.bgColor
         },
         // 遮罩的透明度,0-1之间
         overlayOpacity: {
             type: [Number, String],
-            default: defprops.popup.overlayOpacity
+            default: () => defProps.popup.overlayOpacity
         }
     }
 }

+ 1 - 1
src/uni_modules/uview-plus/components/u-popup/u-popup.vue

@@ -57,7 +57,7 @@
 	 * @property {Boolean}			overlay				是否显示遮罩 (默认 true )
 	 * @property {String}			mode				弹出方向(默认 'bottom' )
 	 * @property {String | Number}	duration			动画时长,单位ms (默认 300 )
-	 * @property {String | Number}	overlayDuration			遮罩层动画时长,单位ms (默认 350 )
+	 * @property {String | Number}	overlayDuration		遮罩层动画时长,单位ms (默认 350 )
 	 * @property {Boolean}			closeable			是否显示关闭图标(默认 false )
 	 * @property {Object | String}	overlayStyle		自定义遮罩的样式
 	 * @property {String | Number}	overlayOpacity		遮罩透明度,0-1之间(默认 0.5)

+ 1206 - 0
src/uni_modules/uview-plus/components/u-qrcode/qrcode.js

@@ -0,0 +1,1206 @@
+let QRCode = {};
+(function () {
+    /**
+     * 获取单个字符的utf8编码
+     * unicode BMP平面约65535个字符
+     * @param {num} code
+     * return {array}
+     */
+    function unicodeFormat8(code) {
+        // 1 byte
+        var c0, c1, c2;
+        if (code < 128) {
+            return [code];
+            // 2 bytes
+        } else if (code < 2048) {
+            c0 = 192 + (code >> 6);
+            c1 = 128 + (code & 63);
+            return [c0, c1];
+            // 3 bytes
+        } else {
+            c0 = 224 + (code >> 12);
+            c1 = 128 + (code >> 6 & 63);
+            c2 = 128 + (code & 63);
+            return [c0, c1, c2];
+        }
+    }
+    /**
+     * 获取字符串的utf8编码字节串
+     * @param {string} string
+     * @return {array}
+     */
+    function getUTF8Bytes(string) {
+        var utf8codes = [];
+        for (var i = 0; i < string.length; i++) {
+            var code = string.charCodeAt(i);
+            var utf8 = unicodeFormat8(code);
+            for (var j = 0; j < utf8.length; j++) {
+                utf8codes.push(utf8[j]);
+            }
+        }
+        return utf8codes;
+    }
+    /**
+     * 二维码算法实现
+     * @param {string} data              要编码的信息字符串
+     * @param {num} errorCorrectLevel 纠错等级
+     */
+    function QRCodeAlg(data, errorCorrectLevel) {
+        this.typeNumber = -1; //版本
+        this.errorCorrectLevel = errorCorrectLevel;
+        this.modules = null; //二维矩阵,存放最终结果
+        this.moduleCount = 0; //矩阵大小
+        this.dataCache = null; //数据缓存
+        this.rsBlocks = null; //版本数据信息
+        this.totalDataCount = -1; //可使用的数据量
+        this.data = data;
+        this.utf8bytes = getUTF8Bytes(data);
+        this.make();
+    }
+    QRCodeAlg.prototype = {
+        constructor: QRCodeAlg,
+        /**
+         * 获取二维码矩阵大小
+         * @return {num} 矩阵大小
+         */
+        getModuleCount: function () {
+            return this.moduleCount;
+        },
+        /**
+         * 编码
+         */
+        make: function () {
+            this.getRightType();
+            this.dataCache = this.createData();
+            this.createQrcode();
+        },
+        /**
+         * 设置二位矩阵功能图形
+         * @param  {bool} test 表示是否在寻找最好掩膜阶段
+         * @param  {num} maskPattern 掩膜的版本
+         */
+        makeImpl: function (maskPattern) {
+            this.moduleCount = this.typeNumber * 4 + 17;
+            this.modules = new Array(this.moduleCount);
+            for (var row = 0; row < this.moduleCount; row++) {
+                this.modules[row] = new Array(this.moduleCount);
+            }
+            this.setupPositionProbePattern(0, 0);
+            this.setupPositionProbePattern(this.moduleCount - 7, 0);
+            this.setupPositionProbePattern(0, this.moduleCount - 7);
+            this.setupPositionAdjustPattern();
+            this.setupTimingPattern();
+            this.setupTypeInfo(true, maskPattern);
+            if (this.typeNumber >= 7) {
+                this.setupTypeNumber(true);
+            }
+            this.mapData(this.dataCache, maskPattern);
+        },
+        /**
+         * 设置二维码的位置探测图形
+         * @param  {num} row 探测图形的中心横坐标
+         * @param  {num} col 探测图形的中心纵坐标
+         */
+        setupPositionProbePattern: function (row, col) {
+            for (var r = -1; r <= 7; r++) {
+                if (row + r <= -1 || this.moduleCount <= row + r) continue;
+                for (var c = -1; c <= 7; c++) {
+                    if (col + c <= -1 || this.moduleCount <= col + c) continue;
+                    if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+                        this.modules[row + r][col + c] = true;
+                    } else {
+                        this.modules[row + r][col + c] = false;
+                    }
+                }
+            }
+        },
+        /**
+         * 创建二维码
+         * @return {[type]} [description]
+         */
+        createQrcode: function () {
+            var minLostPoint = 0;
+            var pattern = 0;
+            var bestModules = null;
+            for (var i = 0; i < 8; i++) {
+                this.makeImpl(i);
+                var lostPoint = QRUtil.getLostPoint(this);
+                if (i == 0 || minLostPoint > lostPoint) {
+                    minLostPoint = lostPoint;
+                    pattern = i;
+                    bestModules = this.modules;
+                }
+            }
+            this.modules = bestModules;
+            this.setupTypeInfo(false, pattern);
+            if (this.typeNumber >= 7) {
+                this.setupTypeNumber(false);
+            }
+        },
+        /**
+         * 设置定位图形
+         * @return {[type]} [description]
+         */
+        setupTimingPattern: function () {
+            for (var r = 8; r < this.moduleCount - 8; r++) {
+                if (this.modules[r][6] != null) {
+                    continue;
+                }
+                this.modules[r][6] = (r % 2 == 0);
+                if (this.modules[6][r] != null) {
+                    continue;
+                }
+                this.modules[6][r] = (r % 2 == 0);
+            }
+        },
+        /**
+         * 设置矫正图形
+         * @return {[type]} [description]
+         */
+        setupPositionAdjustPattern: function () {
+            var pos = QRUtil.getPatternPosition(this.typeNumber);
+            for (var i = 0; i < pos.length; i++) {
+                for (var j = 0; j < pos.length; j++) {
+                    var row = pos[i];
+                    var col = pos[j];
+                    if (this.modules[row][col] != null) {
+                        continue;
+                    }
+                    for (var r = -2; r <= 2; r++) {
+                        for (var c = -2; c <= 2; c++) {
+                            if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) {
+                                this.modules[row + r][col + c] = true;
+                            } else {
+                                this.modules[row + r][col + c] = false;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+         * 设置版本信息(7以上版本才有)
+         * @param  {bool} test 是否处于判断最佳掩膜阶段
+         * @return {[type]}      [description]
+         */
+        setupTypeNumber: function (test) {
+            var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+            for (var i = 0; i < 18; i++) {
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+                this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+            }
+        },
+        /**
+         * 设置格式信息(纠错等级和掩膜版本)
+         * @param  {bool} test
+         * @param  {num} maskPattern 掩膜版本
+         * @return {}
+         */
+        setupTypeInfo: function (test, maskPattern) {
+            var data = (QRErrorCorrectLevel[this.errorCorrectLevel] << 3) | maskPattern;
+            var bits = QRUtil.getBCHTypeInfo(data);
+            // vertical
+            for (var i = 0; i < 15; i++) {
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                if (i < 6) {
+                    this.modules[i][8] = mod;
+                } else if (i < 8) {
+                    this.modules[i + 1][8] = mod;
+                } else {
+                    this.modules[this.moduleCount - 15 + i][8] = mod;
+                }
+                // horizontal
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                if (i < 8) {
+                    this.modules[8][this.moduleCount - i - 1] = mod;
+                } else if (i < 9) {
+                    this.modules[8][15 - i - 1 + 1] = mod;
+                } else {
+                    this.modules[8][15 - i - 1] = mod;
+                }
+            }
+            // fixed module
+            this.modules[this.moduleCount - 8][8] = (!test);
+        },
+        /**
+         * 数据编码
+         * @return {[type]} [description]
+         */
+        createData: function () {
+            var buffer = new QRBitBuffer();
+            var lengthBits = this.typeNumber > 9 ? 16 : 8;
+            buffer.put(4, 4); //添加模式
+            buffer.put(this.utf8bytes.length, lengthBits);
+            for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
+                buffer.put(this.utf8bytes[i], 8);
+            }
+            if (buffer.length + 4 <= this.totalDataCount * 8) {
+                buffer.put(0, 4);
+            }
+            // padding
+            while (buffer.length % 8 != 0) {
+                buffer.putBit(false);
+            }
+            // padding
+            while (true) {
+                if (buffer.length >= this.totalDataCount * 8) {
+                    break;
+                }
+                buffer.put(QRCodeAlg.PAD0, 8);
+                if (buffer.length >= this.totalDataCount * 8) {
+                    break;
+                }
+                buffer.put(QRCodeAlg.PAD1, 8);
+            }
+            return this.createBytes(buffer);
+        },
+        /**
+         * 纠错码编码
+         * @param  {buffer} buffer 数据编码
+         * @return {[type]}
+         */
+        createBytes: function (buffer) {
+            var offset = 0;
+            var maxDcCount = 0;
+            var maxEcCount = 0;
+            var length = this.rsBlock.length / 3;
+            var rsBlocks = new Array();
+            for (var i = 0; i < length; i++) {
+                var count = this.rsBlock[i * 3 + 0];
+                var totalCount = this.rsBlock[i * 3 + 1];
+                var dataCount = this.rsBlock[i * 3 + 2];
+                for (var j = 0; j < count; j++) {
+                    rsBlocks.push([dataCount, totalCount]);
+                }
+            }
+            var dcdata = new Array(rsBlocks.length);
+            var ecdata = new Array(rsBlocks.length);
+            for (var r = 0; r < rsBlocks.length; r++) {
+                var dcCount = rsBlocks[r][0];
+                var ecCount = rsBlocks[r][1] - dcCount;
+                maxDcCount = Math.max(maxDcCount, dcCount);
+                maxEcCount = Math.max(maxEcCount, ecCount);
+                dcdata[r] = new Array(dcCount);
+                for (var i = 0; i < dcdata[r].length; i++) {
+                    dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+                }
+                offset += dcCount;
+                var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+                var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+                var modPoly = rawPoly.mod(rsPoly);
+                ecdata[r] = new Array(rsPoly.getLength() - 1);
+                for (var i = 0; i < ecdata[r].length; i++) {
+                    var modIndex = i + modPoly.getLength() - ecdata[r].length;
+                    ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+                }
+            }
+            var data = new Array(this.totalDataCount);
+            var index = 0;
+            for (var i = 0; i < maxDcCount; i++) {
+                for (var r = 0; r < rsBlocks.length; r++) {
+                    if (i < dcdata[r].length) {
+                        data[index++] = dcdata[r][i];
+                    }
+                }
+            }
+            for (var i = 0; i < maxEcCount; i++) {
+                for (var r = 0; r < rsBlocks.length; r++) {
+                    if (i < ecdata[r].length) {
+                        data[index++] = ecdata[r][i];
+                    }
+                }
+            }
+            return data;
+
+        },
+        /**
+         * 布置模块,构建最终信息
+         * @param  {} data
+         * @param  {} maskPattern
+         * @return {}
+         */
+        mapData: function (data, maskPattern) {
+            var inc = -1;
+            var row = this.moduleCount - 1;
+            var bitIndex = 7;
+            var byteIndex = 0;
+            for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+                if (col == 6) col--;
+                while (true) {
+                    for (var c = 0; c < 2; c++) {
+                        if (this.modules[row][col - c] == null) {
+                            var dark = false;
+                            if (byteIndex < data.length) {
+                                dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+                            }
+                            var mask = QRUtil.getMask(maskPattern, row, col - c);
+                            if (mask) {
+                                dark = !dark;
+                            }
+                            this.modules[row][col - c] = dark;
+                            bitIndex--;
+                            if (bitIndex == -1) {
+                                byteIndex++;
+                                bitIndex = 7;
+                            }
+                        }
+                    }
+                    row += inc;
+                    if (row < 0 || this.moduleCount <= row) {
+                        row -= inc;
+                        inc = -inc;
+                        break;
+                    }
+                }
+            }
+        }
+    };
+    /**
+     * 填充字段
+     */
+    QRCodeAlg.PAD0 = 0xEC;
+    QRCodeAlg.PAD1 = 0x11;
+    //---------------------------------------------------------------------
+    // 纠错等级对应的编码
+    //---------------------------------------------------------------------
+    var QRErrorCorrectLevel = [1, 0, 3, 2];
+    //---------------------------------------------------------------------
+    // 掩膜版本
+    //---------------------------------------------------------------------
+    var QRMaskPattern = {
+        PATTERN000: 0,
+        PATTERN001: 1,
+        PATTERN010: 2,
+        PATTERN011: 3,
+        PATTERN100: 4,
+        PATTERN101: 5,
+        PATTERN110: 6,
+        PATTERN111: 7
+    };
+    //---------------------------------------------------------------------
+    // 工具类
+    //---------------------------------------------------------------------
+    var QRUtil = {
+        /*
+        每个版本矫正图形的位置
+         */
+        PATTERN_POSITION_TABLE: [
+            [],
+            [6, 18],
+            [6, 22],
+            [6, 26],
+            [6, 30],
+            [6, 34],
+            [6, 22, 38],
+            [6, 24, 42],
+            [6, 26, 46],
+            [6, 28, 50],
+            [6, 30, 54],
+            [6, 32, 58],
+            [6, 34, 62],
+            [6, 26, 46, 66],
+            [6, 26, 48, 70],
+            [6, 26, 50, 74],
+            [6, 30, 54, 78],
+            [6, 30, 56, 82],
+            [6, 30, 58, 86],
+            [6, 34, 62, 90],
+            [6, 28, 50, 72, 94],
+            [6, 26, 50, 74, 98],
+            [6, 30, 54, 78, 102],
+            [6, 28, 54, 80, 106],
+            [6, 32, 58, 84, 110],
+            [6, 30, 58, 86, 114],
+            [6, 34, 62, 90, 118],
+            [6, 26, 50, 74, 98, 122],
+            [6, 30, 54, 78, 102, 126],
+            [6, 26, 52, 78, 104, 130],
+            [6, 30, 56, 82, 108, 134],
+            [6, 34, 60, 86, 112, 138],
+            [6, 30, 58, 86, 114, 142],
+            [6, 34, 62, 90, 118, 146],
+            [6, 30, 54, 78, 102, 126, 150],
+            [6, 24, 50, 76, 102, 128, 154],
+            [6, 28, 54, 80, 106, 132, 158],
+            [6, 32, 58, 84, 110, 136, 162],
+            [6, 26, 54, 82, 110, 138, 166],
+            [6, 30, 58, 86, 114, 142, 170]
+        ],
+        G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+        G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+        G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+        /*
+        BCH编码格式信息
+         */
+        getBCHTypeInfo: function (data) {
+            var d = data << 10;
+            while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+                d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+            }
+            return ((data << 10) | d) ^ QRUtil.G15_MASK;
+        },
+        /*
+        BCH编码版本信息
+         */
+        getBCHTypeNumber: function (data) {
+            var d = data << 12;
+            while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+                d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+            }
+            return (data << 12) | d;
+        },
+        /*
+        获取BCH位信息
+         */
+        getBCHDigit: function (data) {
+            var digit = 0;
+            while (data != 0) {
+                digit++;
+                data >>>= 1;
+            }
+            return digit;
+        },
+        /*
+        获取版本对应的矫正图形位置
+         */
+        getPatternPosition: function (typeNumber) {
+            return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+        },
+        /*
+        掩膜算法
+         */
+        getMask: function (maskPattern, i, j) {
+            switch (maskPattern) {
+                case QRMaskPattern.PATTERN000:
+                    return (i + j) % 2 == 0;
+                case QRMaskPattern.PATTERN001:
+                    return i % 2 == 0;
+                case QRMaskPattern.PATTERN010:
+                    return j % 3 == 0;
+                case QRMaskPattern.PATTERN011:
+                    return (i + j) % 3 == 0;
+                case QRMaskPattern.PATTERN100:
+                    return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+                case QRMaskPattern.PATTERN101:
+                    return (i * j) % 2 + (i * j) % 3 == 0;
+                case QRMaskPattern.PATTERN110:
+                    return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+                case QRMaskPattern.PATTERN111:
+                    return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+                default:
+                    throw new Error("bad maskPattern:" + maskPattern);
+            }
+        },
+        /*
+        获取RS的纠错多项式
+         */
+        getErrorCorrectPolynomial: function (errorCorrectLength) {
+            var a = new QRPolynomial([1], 0);
+            for (var i = 0; i < errorCorrectLength; i++) {
+                a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+            }
+            return a;
+        },
+        /*
+        获取评价
+         */
+        getLostPoint: function (qrCode) {
+            var moduleCount = qrCode.getModuleCount(),
+                lostPoint = 0,
+                darkCount = 0;
+            for (var row = 0; row < moduleCount; row++) {
+                var sameCount = 0;
+                var head = qrCode.modules[row][0];
+                for (var col = 0; col < moduleCount; col++) {
+                    var current = qrCode.modules[row][col];
+                    //level 3 评价
+                    if (col < moduleCount - 6) {
+                        if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
+                            if (col < moduleCount - 10) {
+                                if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
+                                    lostPoint += 40;
+                                }
+                            } else if (col > 3) {
+                                if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
+                                    lostPoint += 40;
+                                }
+                            }
+                        }
+                    }
+                    //level 2 评价
+                    if ((row < moduleCount - 1) && (col < moduleCount - 1)) {
+                        var count = 0;
+                        if (current) count++;
+                        if (qrCode.modules[row + 1][col]) count++;
+                        if (qrCode.modules[row][col + 1]) count++;
+                        if (qrCode.modules[row + 1][col + 1]) count++;
+                        if (count == 0 || count == 4) {
+                            lostPoint += 3;
+                        }
+                    }
+                    //level 1 评价
+                    if (head ^ current) {
+                        sameCount++;
+                    } else {
+                        head = current;
+                        if (sameCount >= 5) {
+                            lostPoint += (3 + sameCount - 5);
+                        }
+                        sameCount = 1;
+                    }
+                    //level 4 评价
+                    if (current) {
+                        darkCount++;
+                    }
+                }
+            }
+            for (var col = 0; col < moduleCount; col++) {
+                var sameCount = 0;
+                var head = qrCode.modules[0][col];
+                for (var row = 0; row < moduleCount; row++) {
+                    var current = qrCode.modules[row][col];
+                    //level 3 评价
+                    if (row < moduleCount - 6) {
+                        if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
+                            if (row < moduleCount - 10) {
+                                if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
+                                    lostPoint += 40;
+                                }
+                            } else if (row > 3) {
+                                if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
+                                    lostPoint += 40;
+                                }
+                            }
+                        }
+                    }
+                    //level 1 评价
+                    if (head ^ current) {
+                        sameCount++;
+                    } else {
+                        head = current;
+                        if (sameCount >= 5) {
+                            lostPoint += (3 + sameCount - 5);
+                        }
+                        sameCount = 1;
+                    }
+                }
+            }
+            // LEVEL4
+            var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+            lostPoint += ratio * 10;
+            return lostPoint;
+        }
+
+    };
+    //---------------------------------------------------------------------
+    // QRMath使用的数学工具
+    //---------------------------------------------------------------------
+    var QRMath = {
+        /*
+        将n转化为a^m
+         */
+        glog: function (n) {
+            if (n < 1) {
+                throw new Error("glog(" + n + ")");
+            }
+            return QRMath.LOG_TABLE[n];
+        },
+        /*
+        将a^m转化为n
+         */
+        gexp: function (n) {
+            while (n < 0) {
+                n += 255;
+            }
+            while (n >= 256) {
+                n -= 255;
+            }
+            return QRMath.EXP_TABLE[n];
+        },
+        EXP_TABLE: new Array(256),
+        LOG_TABLE: new Array(256)
+
+    };
+    for (var i = 0; i < 8; i++) {
+        QRMath.EXP_TABLE[i] = 1 << i;
+    }
+    for (var i = 8; i < 256; i++) {
+        QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
+    }
+    for (var i = 0; i < 255; i++) {
+        QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+    }
+    //---------------------------------------------------------------------
+    // QRPolynomial 多项式
+    //---------------------------------------------------------------------
+    /**
+     * 多项式类
+     * @param {Array} num   系数
+     * @param {num} shift a^shift
+     */
+    function QRPolynomial(num, shift) {
+        if (num.length == undefined) {
+            throw new Error(num.length + "/" + shift);
+        }
+        var offset = 0;
+        while (offset < num.length && num[offset] == 0) {
+            offset++;
+        }
+        this.num = new Array(num.length - offset + shift);
+        for (var i = 0; i < num.length - offset; i++) {
+            this.num[i] = num[i + offset];
+        }
+    }
+    QRPolynomial.prototype = {
+        get: function (index) {
+            return this.num[index];
+        },
+        getLength: function () {
+            return this.num.length;
+        },
+        /**
+         * 多项式乘法
+         * @param  {QRPolynomial} e 被乘多项式
+         * @return {[type]}   [description]
+         */
+        multiply: function (e) {
+            var num = new Array(this.getLength() + e.getLength() - 1);
+            for (var i = 0; i < this.getLength(); i++) {
+                for (var j = 0; j < e.getLength(); j++) {
+                    num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+                }
+            }
+            return new QRPolynomial(num, 0);
+        },
+        /**
+         * 多项式模运算
+         * @param  {QRPolynomial} e 模多项式
+         * @return {}
+         */
+        mod: function (e) {
+            var tl = this.getLength(),
+                el = e.getLength();
+            if (tl - el < 0) {
+                return this;
+            }
+            var num = new Array(tl);
+            for (var i = 0; i < tl; i++) {
+                num[i] = this.get(i);
+            }
+            while (num.length >= el) {
+                var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
+
+                for (var i = 0; i < e.getLength(); i++) {
+                    num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+                }
+                while (num[0] == 0) {
+                    num.shift();
+                }
+            }
+            return new QRPolynomial(num, 0);
+        }
+    };
+
+    //---------------------------------------------------------------------
+    // RS_BLOCK_TABLE
+    //---------------------------------------------------------------------
+    /*
+    二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
+     */
+    var RS_BLOCK_TABLE = [
+        // L
+        // M
+        // Q
+        // H
+        // 1
+        [1, 26, 19],
+        [1, 26, 16],
+        [1, 26, 13],
+        [1, 26, 9],
+
+        // 2
+        [1, 44, 34],
+        [1, 44, 28],
+        [1, 44, 22],
+        [1, 44, 16],
+
+        // 3
+        [1, 70, 55],
+        [1, 70, 44],
+        [2, 35, 17],
+        [2, 35, 13],
+
+        // 4
+        [1, 100, 80],
+        [2, 50, 32],
+        [2, 50, 24],
+        [4, 25, 9],
+
+        // 5
+        [1, 134, 108],
+        [2, 67, 43],
+        [2, 33, 15, 2, 34, 16],
+        [2, 33, 11, 2, 34, 12],
+
+        // 6
+        [2, 86, 68],
+        [4, 43, 27],
+        [4, 43, 19],
+        [4, 43, 15],
+
+        // 7
+        [2, 98, 78],
+        [4, 49, 31],
+        [2, 32, 14, 4, 33, 15],
+        [4, 39, 13, 1, 40, 14],
+
+        // 8
+        [2, 121, 97],
+        [2, 60, 38, 2, 61, 39],
+        [4, 40, 18, 2, 41, 19],
+        [4, 40, 14, 2, 41, 15],
+
+        // 9
+        [2, 146, 116],
+        [3, 58, 36, 2, 59, 37],
+        [4, 36, 16, 4, 37, 17],
+        [4, 36, 12, 4, 37, 13],
+
+        // 10
+        [2, 86, 68, 2, 87, 69],
+        [4, 69, 43, 1, 70, 44],
+        [6, 43, 19, 2, 44, 20],
+        [6, 43, 15, 2, 44, 16],
+
+        // 11
+        [4, 101, 81],
+        [1, 80, 50, 4, 81, 51],
+        [4, 50, 22, 4, 51, 23],
+        [3, 36, 12, 8, 37, 13],
+
+        // 12
+        [2, 116, 92, 2, 117, 93],
+        [6, 58, 36, 2, 59, 37],
+        [4, 46, 20, 6, 47, 21],
+        [7, 42, 14, 4, 43, 15],
+
+        // 13
+        [4, 133, 107],
+        [8, 59, 37, 1, 60, 38],
+        [8, 44, 20, 4, 45, 21],
+        [12, 33, 11, 4, 34, 12],
+
+        // 14
+        [3, 145, 115, 1, 146, 116],
+        [4, 64, 40, 5, 65, 41],
+        [11, 36, 16, 5, 37, 17],
+        [11, 36, 12, 5, 37, 13],
+
+        // 15
+        [5, 109, 87, 1, 110, 88],
+        [5, 65, 41, 5, 66, 42],
+        [5, 54, 24, 7, 55, 25],
+        [11, 36, 12],
+
+        // 16
+        [5, 122, 98, 1, 123, 99],
+        [7, 73, 45, 3, 74, 46],
+        [15, 43, 19, 2, 44, 20],
+        [3, 45, 15, 13, 46, 16],
+
+        // 17
+        [1, 135, 107, 5, 136, 108],
+        [10, 74, 46, 1, 75, 47],
+        [1, 50, 22, 15, 51, 23],
+        [2, 42, 14, 17, 43, 15],
+
+        // 18
+        [5, 150, 120, 1, 151, 121],
+        [9, 69, 43, 4, 70, 44],
+        [17, 50, 22, 1, 51, 23],
+        [2, 42, 14, 19, 43, 15],
+
+        // 19
+        [3, 141, 113, 4, 142, 114],
+        [3, 70, 44, 11, 71, 45],
+        [17, 47, 21, 4, 48, 22],
+        [9, 39, 13, 16, 40, 14],
+
+        // 20
+        [3, 135, 107, 5, 136, 108],
+        [3, 67, 41, 13, 68, 42],
+        [15, 54, 24, 5, 55, 25],
+        [15, 43, 15, 10, 44, 16],
+
+        // 21
+        [4, 144, 116, 4, 145, 117],
+        [17, 68, 42],
+        [17, 50, 22, 6, 51, 23],
+        [19, 46, 16, 6, 47, 17],
+
+        // 22
+        [2, 139, 111, 7, 140, 112],
+        [17, 74, 46],
+        [7, 54, 24, 16, 55, 25],
+        [34, 37, 13],
+
+        // 23
+        [4, 151, 121, 5, 152, 122],
+        [4, 75, 47, 14, 76, 48],
+        [11, 54, 24, 14, 55, 25],
+        [16, 45, 15, 14, 46, 16],
+
+        // 24
+        [6, 147, 117, 4, 148, 118],
+        [6, 73, 45, 14, 74, 46],
+        [11, 54, 24, 16, 55, 25],
+        [30, 46, 16, 2, 47, 17],
+
+        // 25
+        [8, 132, 106, 4, 133, 107],
+        [8, 75, 47, 13, 76, 48],
+        [7, 54, 24, 22, 55, 25],
+        [22, 45, 15, 13, 46, 16],
+
+        // 26
+        [10, 142, 114, 2, 143, 115],
+        [19, 74, 46, 4, 75, 47],
+        [28, 50, 22, 6, 51, 23],
+        [33, 46, 16, 4, 47, 17],
+
+        // 27
+        [8, 152, 122, 4, 153, 123],
+        [22, 73, 45, 3, 74, 46],
+        [8, 53, 23, 26, 54, 24],
+        [12, 45, 15, 28, 46, 16],
+
+        // 28
+        [3, 147, 117, 10, 148, 118],
+        [3, 73, 45, 23, 74, 46],
+        [4, 54, 24, 31, 55, 25],
+        [11, 45, 15, 31, 46, 16],
+
+        // 29
+        [7, 146, 116, 7, 147, 117],
+        [21, 73, 45, 7, 74, 46],
+        [1, 53, 23, 37, 54, 24],
+        [19, 45, 15, 26, 46, 16],
+
+        // 30
+        [5, 145, 115, 10, 146, 116],
+        [19, 75, 47, 10, 76, 48],
+        [15, 54, 24, 25, 55, 25],
+        [23, 45, 15, 25, 46, 16],
+
+        // 31
+        [13, 145, 115, 3, 146, 116],
+        [2, 74, 46, 29, 75, 47],
+        [42, 54, 24, 1, 55, 25],
+        [23, 45, 15, 28, 46, 16],
+
+        // 32
+        [17, 145, 115],
+        [10, 74, 46, 23, 75, 47],
+        [10, 54, 24, 35, 55, 25],
+        [19, 45, 15, 35, 46, 16],
+
+        // 33
+        [17, 145, 115, 1, 146, 116],
+        [14, 74, 46, 21, 75, 47],
+        [29, 54, 24, 19, 55, 25],
+        [11, 45, 15, 46, 46, 16],
+
+        // 34
+        [13, 145, 115, 6, 146, 116],
+        [14, 74, 46, 23, 75, 47],
+        [44, 54, 24, 7, 55, 25],
+        [59, 46, 16, 1, 47, 17],
+
+        // 35
+        [12, 151, 121, 7, 152, 122],
+        [12, 75, 47, 26, 76, 48],
+        [39, 54, 24, 14, 55, 25],
+        [22, 45, 15, 41, 46, 16],
+
+        // 36
+        [6, 151, 121, 14, 152, 122],
+        [6, 75, 47, 34, 76, 48],
+        [46, 54, 24, 10, 55, 25],
+        [2, 45, 15, 64, 46, 16],
+
+        // 37
+        [17, 152, 122, 4, 153, 123],
+        [29, 74, 46, 14, 75, 47],
+        [49, 54, 24, 10, 55, 25],
+        [24, 45, 15, 46, 46, 16],
+
+        // 38
+        [4, 152, 122, 18, 153, 123],
+        [13, 74, 46, 32, 75, 47],
+        [48, 54, 24, 14, 55, 25],
+        [42, 45, 15, 32, 46, 16],
+
+        // 39
+        [20, 147, 117, 4, 148, 118],
+        [40, 75, 47, 7, 76, 48],
+        [43, 54, 24, 22, 55, 25],
+        [10, 45, 15, 67, 46, 16],
+
+        // 40
+        [19, 148, 118, 6, 149, 119],
+        [18, 75, 47, 31, 76, 48],
+        [34, 54, 24, 34, 55, 25],
+        [20, 45, 15, 61, 46, 16]
+    ];
+
+    /**
+     * 根据数据获取对应版本
+     * @return {[type]} [description]
+     */
+    QRCodeAlg.prototype.getRightType = function () {
+        for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
+            var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
+            if (rsBlock == undefined) {
+                throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
+            }
+            var length = rsBlock.length / 3;
+            var totalDataCount = 0;
+            for (var i = 0; i < length; i++) {
+                var count = rsBlock[i * 3 + 0];
+                var dataCount = rsBlock[i * 3 + 2];
+                totalDataCount += dataCount * count;
+            }
+            var lengthBytes = typeNumber > 9 ? 2 : 1;
+            if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
+                this.typeNumber = typeNumber;
+                this.rsBlock = rsBlock;
+                this.totalDataCount = totalDataCount;
+                break;
+            }
+        }
+    };
+
+    //---------------------------------------------------------------------
+    // QRBitBuffer
+    //---------------------------------------------------------------------
+    function QRBitBuffer() {
+        this.buffer = new Array();
+        this.length = 0;
+    }
+    QRBitBuffer.prototype = {
+        get: function (index) {
+            var bufIndex = Math.floor(index / 8);
+            return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1);
+        },
+        put: function (num, length) {
+            for (var i = 0; i < length; i++) {
+                this.putBit(((num >>> (length - i - 1)) & 1));
+            }
+        },
+        putBit: function (bit) {
+            var bufIndex = Math.floor(this.length / 8);
+            if (this.buffer.length <= bufIndex) {
+                this.buffer.push(0);
+            }
+            if (bit) {
+                this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+            }
+            this.length++;
+        }
+    };
+
+
+
+    // xzedit
+    let qrcodeAlgObjCache = [];
+    /**
+     * 二维码构造函数,主要用于绘制
+     * @param  {参数列表} opt 传递参数
+     * @return {}
+     */
+    QRCode = function (opt) {
+        //设置默认参数
+        this.options = {
+            text: '',
+            size: 256,
+            correctLevel: 3,
+            background: '#ffffff',
+            foreground: '#000000',
+            pdground: '#000000',
+            image: '',
+            imageSize: 30,
+            canvasId: opt.canvasId,
+            context: opt.context,
+            usingComponents: opt.usingComponents,
+            showLoading: opt.showLoading,
+            loadingText: opt.loadingText,
+        };
+        if (typeof opt === 'string') { // 只编码ASCII字符串
+            opt = {
+                text: opt
+            };
+        }
+        if (opt) {
+            for (var i in opt) {
+                this.options[i] = opt[i];
+            }
+        }
+        //使用QRCodeAlg创建二维码结构
+        var qrCodeAlg = null;
+        for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
+            if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
+                qrCodeAlg = qrcodeAlgObjCache[i].obj;
+                break;
+            }
+        }
+        if (i == l) {
+            qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
+            qrcodeAlgObjCache.push({
+                text: this.options.text,
+                correctLevel: this.options.correctLevel,
+                obj: qrCodeAlg
+            });
+        }
+        /**
+         * 计算矩阵点的前景色
+         * @param {Obj} config
+         * @param {Number} config.row 点x坐标
+         * @param {Number} config.col 点y坐标
+         * @param {Number} config.count 矩阵大小
+         * @param {Number} config.options 组件的options
+         * @return {String}
+         */
+        let getForeGround = function (config) {
+            var options = config.options;
+            if (options.pdground && (
+                (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+                (config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+                (config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+            )) {
+                return options.pdground;
+            }
+            return options.foreground;
+        }
+        // 创建canvas
+        let createCanvas = function (options) {
+            if(options.showLoading){
+                uni.showLoading({
+                    title: options.loadingText,
+                    mask: true
+                });
+            }
+            var ctx = uni.createCanvasContext(options.canvasId, options.context);
+            var count = qrCodeAlg.getModuleCount();
+            var ratioSize = options.size;
+            var ratioImgSize = options.imageSize;
+            //计算每个点的长宽
+            var tileW = (ratioSize / count).toPrecision(4);
+            var tileH = (ratioSize / count).toPrecision(4);
+            //绘制
+            for (var row = 0; row < count; row++) {
+                for (var col = 0; col < count; col++) {
+                    var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW));
+                    var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW));
+                    var foreground = getForeGround({
+                        row: row,
+                        col: col,
+                        count: count,
+                        options: options
+                    });
+                    ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
+                    ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
+                }
+            }
+            if (options.image) {
+                var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+                var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+                drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true)
+                ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
+                // 画圆角矩形
+                function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
+                    ctxi.setLineWidth(lineWidth);
+                    ctxi.setFillStyle(options.background);
+                    ctxi.setStrokeStyle(options.background);
+                    ctxi.beginPath(); // draw top and top right corner 
+                    ctxi.moveTo(x + r, y);
+                    ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner 
+                    ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner 
+                    ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner 
+                    ctxi.arcTo(x, y, x + r, y, r);
+                    ctxi.closePath();
+                    if (fill) {
+                        ctxi.fill();
+                    }
+                    if (stroke) {
+                        ctxi.stroke();
+                    }
+                }
+            }
+            setTimeout(() => {
+                ctx.draw(true, () => {
+                    // 保存到临时区域
+                    setTimeout(() => {
+                        uni.canvasToTempFilePath({
+                            width: options.width,
+                            height: options.height,
+                            destWidth: options.width,
+                            destHeight: options.height,
+                            canvasId: options.canvasId,
+                            quality: Number(1),
+                            success: function (res) {
+                                if (options.cbResult) {
+                                    // 由于官方还没有统一此接口的输出字段,所以先判定下  支付宝为 res.apFilePath
+                                    if (!empty(res.tempFilePath)) {
+                                        options.cbResult(res.tempFilePath)
+                                    } else if (!empty(res.apFilePath)) {
+                                        options.cbResult(res.apFilePath)
+                                    } else {
+                                        options.cbResult(res.tempFilePath)
+                                    }
+                                }
+                            },
+                            fail: function (res) {
+                                if (options.cbResult) {
+                                    options.cbResult(res)
+                                }
+                            },
+                            complete: function () {
+                                uni.hideLoading();
+                            },
+                        }, options.context);
+                    }, options.text.length + 100);
+                });
+            }, options.usingComponents ? 0 : 150);
+        }
+        createCanvas(this.options);
+        // 空判定
+        let empty = function (v) {
+            let tp = typeof v,
+                rt = false;
+            if (tp == "number" && String(v) == "") {
+                rt = true
+            } else if (tp == "undefined") {
+                rt = true
+            } else if (tp == "object") {
+                if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+            } else if (tp == "string") {
+                if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+            } else if (tp == "function") {
+                rt = false
+            }
+            return rt
+        }
+    };
+    QRCode.prototype.clear = function (fn) {
+        var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context)
+        ctx.clearRect(0, 0, this.options.size, this.options.size)
+        ctx.draw(false, () => {
+            if (fn) {
+                fn()
+            }
+        })
+    };
+})()
+
+export default QRCode

+ 199 - 0
src/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue

@@ -0,0 +1,199 @@
+<template>
+	<view class="u-qrcode">
+		<canvas class="u-qrcode__canvas" :canvas-id="cid" :style="{ width: size + unit, height: size + unit }" />
+		<image v-show="show" :src="result" :style="{ width: size + unit, height: size + unit }" />
+	</view>
+</template>
+
+<script>
+import QRCode from "./qrcode.js"
+let qrcode
+export default {
+	name: "u-qrcode",
+	props: {
+		cid: {
+			type: String,
+			default: 'u-qrcode-canvas' + Math.random().toString()
+		},
+		size: {
+			type: Number,
+			default: 200
+		},
+		unit: {
+			type: String,
+			default: 'px'
+		},
+		show: {
+			type: Boolean,
+			default: true
+		},
+		val: {
+			type: String,
+			default: ''
+		},
+		background: {
+			type: String,
+			default: '#ffffff'
+		},
+		foreground: {
+			type: String,
+			default: '#000000'
+		},
+		pdground: {
+			type: String,
+			default: '#000000'
+		},
+		icon: {
+			type: String,
+			default: ''
+		},
+		iconSize: {
+			type: Number,
+			default: 40
+		},
+		lv: {
+			type: Number,
+			default: 3
+		},
+		onval: {
+			type: Boolean,
+			default: true
+		},
+		loadMake: {
+			type: Boolean,
+			default: true
+		},
+		usingComponents: {
+			type: Boolean,
+			default: true
+		},
+		showLoading: {
+			type: Boolean,
+			default: true
+		},
+		loadingText: {
+			type: String,
+			default: '二维码生成中'
+		},
+	},
+	data() {
+		return {
+			result: '',
+		}
+	},
+	methods: {
+		_makeCode() {
+			let that = this
+			if (!this._empty(this.val)) {
+				qrcode = new QRCode({
+					context: that, // 上下文环境
+					canvasId: that.cid, // canvas-id
+					usingComponents: that.usingComponents, // 是否是自定义组件
+					showLoading: that.showLoading, // 是否显示loading
+					loadingText: that.loadingText, // loading文字
+					text: that.val, // 生成内容
+					size: that.size, // 二维码大小
+					background: that.background, // 背景色
+					foreground: that.foreground, // 前景色
+					pdground: that.pdground, // 定位角点颜色
+					correctLevel: that.lv, // 容错级别
+					image: that.icon, // 二维码图标
+					imageSize: that.iconSize,// 二维码图标大小
+					cbResult: function (res) { // 生成二维码的回调
+						that._result(res)
+					},
+				});
+			} else {
+				uni.showToast({
+					title: '二维码内容不能为空',
+					icon: 'none',
+					duration: 2000
+				});
+			}
+		},
+		_clearCode() {
+			this._result('')
+			qrcode.clear()
+		},
+		_saveCode() {
+			let that = this;
+			if (this.result != "") {
+				uni.saveImageToPhotosAlbum({
+					filePath: that.result,
+					success: function () {
+						uni.showToast({
+							title: '二维码保存成功',
+							icon: 'success',
+							duration: 2000
+						});
+					}
+				});
+			}
+		},
+		_result(res) {
+			this.result = res;
+			this.$emit('result', res)
+		},
+		_empty(v) {
+			let tp = typeof v,
+				rt = false;
+			if (tp == "number" && String(v) == "") {
+				rt = true
+			} else if (tp == "undefined") {
+				rt = true
+			} else if (tp == "object") {
+				if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+			} else if (tp == "string") {
+				if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+			} else if (tp == "function") {
+				rt = false
+			}
+			return rt
+		}
+	},
+	watch: {
+		size: function (n, o) {
+			if (n != o && !this._empty(n)) {
+				this.cSize = n
+				if (!this._empty(this.val)) {
+					setTimeout(() => {
+						this._makeCode()
+					}, 100);
+				}
+			}
+		},
+		val: function (n, o) {
+			if (this.onval) {
+				if (n != o && !this._empty(n)) {
+					setTimeout(() => {
+						this._makeCode()
+					}, 0);
+				}
+			}
+		}
+	},
+	computed: {
+	},
+	mounted: function () {
+		if (this.loadMake) {
+			if (!this._empty(this.val)) {
+				setTimeout(() => {
+					this._makeCode()
+				}, 0);
+			}
+		}
+	},
+}
+</script>
+<style lang="scss" scoped>
+.u-qrcode {
+	position: relative;
+
+	&__canvas {
+		position: fixed;
+		top: -99999rpx;
+		left: -99999rpx;
+		z-index: -99999;
+	}
+}
+</style>

+ 18 - 18
src/uni_modules/uview-plus/components/u-radio-group/props.js

@@ -1,94 +1,94 @@
-import defprops from '../../libs/config/props';
+import defProps from '../../libs/config/props.js';
 export default {
     props: {
         // #ifdef VUE3
         // 绑定的值
         modelValue: {
             type: [String, Number, Boolean],
-            default: defprops.radioGroup.value
+            default: () => defProps.radioGroup.value
         },
         // #endif
         // #ifdef VUE2
         // 绑定的值
         value: {
             type: [String, Number, Boolean],
-            default: defprops.radioGroup.value
+            default: () => defProps.radioGroup.value
         },
         // #endif
         // 是否禁用全部radio
         disabled: {
             type: Boolean,
-            default: defprops.radioGroup.disabled
+            default: () => defProps.radioGroup.disabled
         },
         // 形状,circle-圆形,square-方形
         shape: {
             type: String,
-            default: defprops.radioGroup.shape
+            default: () => defProps.radioGroup.shape
         },
         // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
         activeColor: {
             type: String,
-            default: defprops.radioGroup.activeColor
+            default: () => defProps.radioGroup.activeColor
         },
         // 未选中的颜色
         inactiveColor: {
             type: String,
-            default: defprops.radioGroup.inactiveColor
+            default: () => defProps.radioGroup.inactiveColor
         },
         // 标识符
         name: {
             type: String,
-            default: defprops.radioGroup.name
+            default: () => defProps.radioGroup.name
         },
         // 整个组件的尺寸,默认px
         size: {
             type: [String, Number],
-            default: defprops.radioGroup.size
+            default: () => defProps.radioGroup.size
         },
         // 布局方式,row-横向,column-纵向
         placement: {
             type: String,
-            default: defprops.radioGroup.placement
+            default: () => defProps.radioGroup.placement
         },
         // label的文本
         label: {
             type: [String],
-            default: defprops.radioGroup.label
+            default: () => defProps.radioGroup.label
         },
         // label的颜色 (默认 '#303133' )
         labelColor: {
             type: [String],
-            default: defprops.radioGroup.labelColor
+            default: () => defProps.radioGroup.labelColor
         },
         // label的字体大小,px单位
         labelSize: {
             type: [String, Number],
-            default: defprops.radioGroup.labelSize
+            default: () => defProps.radioGroup.labelSize
         },
         // 是否禁止点击文本操作checkbox(默认 false )
         labelDisabled: {
             type: Boolean,
-            default: defprops.radioGroup.labelDisabled
+            default: () => defProps.radioGroup.labelDisabled
         },
         // 图标颜色
         iconColor: {
             type: String,
-            default: defprops.radioGroup.iconColor
+            default: () => defProps.radioGroup.iconColor
         },
         // 图标的大小,单位px
         iconSize: {
             type: [String, Number],
-            default: defprops.radioGroup.iconSize
+            default: () => defProps.radioGroup.iconSize
         },
         // 竖向配列时,是否显示下划线
         borderBottom: {
             type: Boolean,
-            default: defprops.radioGroup.borderBottom
+            default: () => defProps.radioGroup.borderBottom
         },
         // 图标与文字的对齐方式
         iconPlacement: {
             type: String,
-            default: defprops.radio.iconPlacement
+            default: () => defProps.radio.iconPlacement
         }
     }
 }

Some files were not shown because too many files changed in this diff