diff --git a/README.md b/README.md index 1a8b116465655ecbd2902141ad42087e795eef32..faccd69a3011d62d1fde0e92e504c24f259aad8e 100644 --- a/README.md +++ b/README.md @@ -1,569 +1,3 @@ -#### 视频介绍 - - 腾讯课堂uniCloud视频教程 - - -注:视频会有滞后问题,入门为主。最新的完整功能请看以下文档 - -#### 简介 -uni-starter是一个集成了大量商用项目常见功能的,云端一体应用快速开发基本项目模版。 - -APP有很多通用的功能,比如登录注册、头像、设置、banner、... uni-starter将这些功能都已经集成好。 - -直接在`hbuilderx`新建项目选择`uni-starter`模板,即可在此基础上快速开发自己的特色业务。 - -有了`uni-starter`,再加上`schema2code`生成前端页面,一个简单应用就可以快速完成。 - -如果说[uniCloud admin](https://uniapp.dcloud.io/uniCloud/admin)是管理端项目的基本项目模版,那么uni-starter则是用户端、尤其是移动端的基础项目模板。 - -`uni-starter` + `uniCloud admin` 提供了用户端和管理端的基本项目模版,应用开发从未如此简单快捷! - -##### 扫码体验:h5版演示效果(链接:[https://uni-starter.dcloud.net.cn](https://uni-starter.dcloud.net.cn)) - - -### uni-starter集成包括: -1. 用户管理: - - 登录注册(用户名密码登录、手机号验证码登录、APP一键登录、微信登录、Apple登录、微信小程序登录) - - 修改密码、忘记密码、头像更换(集成图片裁剪)、昵称修改、积分查看、退出登录 -2. 系统设置: - - App更新(整包升级、wgt升级、强制升级,后台搭配uniCloud admin的升级中心插件管理) - - 推送开关(app)、清除缓存(app) - - 指纹解锁(app)、人脸解锁(app) - - 多语言切换 - - 账号注销(正在完善中...) -3. 隐私权限:内置Android先弹出隐私协议对话框,然后再向用户申请设备权限 -4. 权限引导:当应用拒绝授权某些权限,但在后续使用中又需要这个权限;此时实现:引导用户可“一键跳转至系统设置”中开启。 - - 而不是报错让用户自己去找解决方案(更好的用户体验)。 - - 采用高内聚低耦合的设计结构,直接在应用启动时,应用拦截器中实现。免去在每个业务代码中处理这类问题,更优雅更方便。 - - 已实现项目:摄像头、相册、获取GPS定位、网络2/3/4/5G和Wi-Fi。你可以参考这些实现,处理更多该类场景的处理。uni-starter也会持续更新完善。 -5. 实用功能 - - 问题与反馈、关于、隐私政策、用户服务协议 - - banner(后台搭配uniCloud admin的banner插件管理) - - 新闻的搜索、列表、详情、分享。通过clientDB实现,开发者直接修改定义的表名等参数,即可轻松改为自己的业务 - - 可覆盖原生层的分享菜单 - - h5版在页面顶部(全局悬浮)引导用户点击下载App - - 营销裂变:点击“分销推荐”,生成带用户inviteCode参数的应用下载页(H5),一键分享到微信或微信朋友圈等。被邀请人打开下载页面点击下载,设备剪贴板的内容会被自动设置为邀请者的inviteCode。被邀请人下载app之后通过任何方式登录(含:注册并登录),uni-starter框架会自动获取设备剪切板中的inviteCode提交到服务端绑定关联关系。 -6. 更好的性能:首页采用nvue,fast编译模式,加快App端启动速度 -7. 内置拦截器: - - 页面路由拦截,配置需强制登录的页面;打开时自动检测`token`若无效就自动跳转到登录页 - - 调用云函数(callFunction)拦截器,自动携带必要参数、自动处理响应体。详见9.自动完成1-2 -8. 自动完成: - - 分析uniCloud.callfunction和clientDB操作的响应体,判断code执行对应的操作如跳转到登录页,自动续期token - - 操作注册/登录操作自动获取客户端设备:push_clientid、imei、oaid、idfa新增/更新到数据表uni-id-device - - 异常恢复处理:断网恢复后自动重连“因网络错误导致的”网络请求 - - 为迎合苹果App Store的规则,登录与分享功能项显示之前自动检测是否安装了对应客户端。比如:设备未安装微信则不显示微信快捷登录和微信分享选项 - -* 更多功能模块会不断更新,请持续关注本插件 - -## 快速体验部署流程 -#### 1. 开通uniCloud -- 开通`uniCloud`:本项目是云端一体的,它的云端代码需要部署在uniCloud云服务空间里,需要开通uniCloud。在[https://unicloud.dcloud.net.cn/](https://unicloud.dcloud.net.cn/)登录,按云厂商要求进行实名认证。 -- 在uniCloud认证通过后,创建一个服务空间给本项目使用。选择阿里云或腾讯云均可,两种服务空间差异[详情](https://uniapp.dcloud.net.cn/uniCloud/price) - -#### 2. 运行云服务空间初始化向导 - - - - -## 功能模块介绍 -### 1.登录模块 -|登录类型 |描述 | -|-- |-- | -|smsCode |验证码登录 | -|univerify |读取手机SIM卡一键登录 | -|username |账号密码登录 | -|weixin |微信登录 | -|apple |苹果登录 | - -配置文件:`项目根目录/uni-starter.config.js` -```js -{ - "router":{ - "login":["username","smsCode"] - } -} -``` - -#### 启用登录方式 -如上示例配置为:`["username","smsCode"]` 表示启用:验证码登录、账号密码登录。 - -同理配置为:`["weixin","username","smsCode"]` 则表示启用:微信登录、验证码登录、账号密码登录。 - -总结:需要几项列举几项即可。 - -#### 优先级 -在uni-starter框架中执行`uni.navigateTo({url: "/pages/ucenter/login-page/index/index"})`,会根据配置跳转到相应的登录页面。如果配置内容为:`["username","smsCode"]`会自动切换到"配置的第0项,也就是`username`类型的登录方式对应的页面”,即`账户登录`方式页面,路径:`/pages/ucenter/login-page/pwd-login/pwd-login` - -#### 平台差异性配置 -这里支持用[条件编译](https://uniapp.dcloud.io/platform?id=%e6%9d%a1%e4%bb%b6%e7%bc%96%e8%af%91)因此你可以配置在不同平台下拥有的登录方式。 -如下配置,即表示仅在APP端启用“短信验证码登录” -```js -"login": [ - "username","univerify","weixin","apple" - // #ifdef APP-PLUS - "smsCode", - // #endif -] -``` - -#### 生效策略 -登录方式有如上5种,虽然你希望有几种登录方式就在配置中列举几种。但是有的登录方式可能因为设备环境问题而不被支持; -比如你正确地配置了微信登录,而用户的手机并没有安装微信,这样微信登录功能就无法使用。 -并且如果出现这种情况你的app会被iOS的App Store拒绝上架。 -所以在这里,我们的生效策略在检测:你是否有列举到某个配置项为前提的情况下,增加了检测当前环境是否支持,如果不支持会自动隐藏。 - -#### 在uni-app框架中配置: -在应用模块:`manifest.json` App模块配置 --> OAuth(登录鉴权)--> 勾选并配置你所需要的模块 -+ 一键登录: - [开通配置](https://dev.dcloud.net.cn/uniLogin) - [使用指南](https://uniapp.dcloud.io/univerify) -+ [苹果登录集成指南](https://ask.dcloud.net.cn/article/36651) -+ 短信登录: ->`uni-id-cf`文件路径:`/uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js` - - 测试期间,为节约资源。统一虚拟短信验证码为:123456。正式使用注视掉`uni-id-cf`第339-344行即可 - 使用本功能需要在[DCloud开发者中心](https://dev.dcloud.net.cn/uniSms)开通并充值 - 教程参考[短信服务开通指南](https://ask.dcloud.net.cn/article/37534) - 修改短信注册/登录发生验证码的模板id,在`uni-id-cf`搜索 `const templateId = '11753'` 替换为自己申请的模板id - -#### 服务端配置 -uni-starter服务端使用[uni-config-center](https://ext.dcloud.net.cn/plugin?id=4425)统一管理这些配置, -文件路径`/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json` -详情下文[目录结构](#id=catalogue) 和[uni-id配置说明](https://uniapp.dcloud.io/uniCloud/uni-id?id=configjson%e7%9a%84%e8%af%b4%e6%98%8e) - -### 2.路由拦截 -#### 应用场景 -有些页面,限允许已经登录后用户才访问。 -常规的做法是打开这类页面之前,检查(前端校验)uni_id_token的值是否有效,如果无效会自动跳转到登录页面。 -而这样的页面有很多,入口也不少。面向过程的写法会产生大量的代码冗余,且不易维护。 -而uni-starter基于拦截器(`uni.addInterceptor`),提供了仅需简单配置即可实现的路由拦截功能。 -#### 配置方式 -支持两种模式(二选一) -##### 黑名单模式 -列举需要强制登录的页面完整路径(支持正则) -##### 白名单模式 -列举不需要强制登录即可访问的页面完整路径(支持正则) -#### 配置示例 -配置文件:`项目根目录/uni-starter.config.js` - -```js -"router": { - "needLogin" : [ - {pattern:/^\/pages\/list.*/}, //支持正则表达式 - "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list", - "/uni_modules/uni-feedback/pages/uni-feedback/add" - ], -/* - 请注意上下,黑名单(needLogin)、白名单(visitor)两种配置模式二选一不可同时使用 -*/ - "visitor" : [ - "/",//注意入口页必须直接写 "/" - {"pattern":/^\/pages\/list.*/}, //支持正则表达式 - {"pattern":/^\/pages\/ucenter\/login-page.*/}, - "/pages/common/webview/webview", - "/pages/grid/grid", - "/pages/ucenter/ucenter", - "/pages/ucenter/about/about", - "/pages/ucenter/settings/settings" - ] -} -``` - -##### 优势: -传统的路由管理方式是对uni-app框架路由写法的二次封装,自定义的写法不支持ide的代码提示,且不优雅。 -另外不同插件作者封装不同的路由管理方式,这样做出来的插件与用户的项目结合时,路由写法不统一的差异需要去磨平。 -为此`uni-starter`基于`uni.addInterceptor`(拦截器)实现路由管理。 - -##### 注意: -- uni-starter的路由拦截,仅在调用路由API(navigateTo、redirectTo、reLaunch、switchTab)时触发。应用的首页是由系统自动打开,不会触发拦截器。首页需要强制登录才能访问的场景,不由路由控制。但不用担心,如果未登录的用户,打开了需要登录才能访问页面,必定会触发需要携带有效token才能访问的API。此时则会返回相应的响应体,uni-starter监测到token无效这类的响应体也会自动跳转到登录页(这种效果需要前后端都开发完成才体验到)。 -- uni-starter框架不能将登录页`/pages/ucenter/login-page/index/index`设置为首页,否则由拦截器实现的路由管理将生效。 -- 拦截器实现的路由控制,是在路由跳转未完成之前触发。路由切换方式(navigateTo、redirectTo、reLaunch、switchTab)URL参数必须使用绝对路径路 - -### 3.h5版在页面顶部引导用户`点击下载App` -把h5端用户引流到APP端,是一个非常实用的功能。相对于h5,APP端有更高的用户留存和更好的产品体验。 -uni-starter集成了这个功能,你只需直接在`项目根目录/uni-starter.config.js`的"h5"->"openApp"中配置相关内容,即可开启全局悬浮的下载引导。 -这也是一个演示开发者如何在h5端做全局悬浮块的例子。你也可以在`/common/openApp.js`中修改他的样式等代码等,注意他只支持原生js语法。 - -### 4.分享模块 -一个可覆盖原生层分享模块 -- 应用配置:`manifest.json` App模块配置 --> Share --> 勾选并配置你所需要的模块 -- 分享功能配置参数,随着应用的业务场景决定,在各场景调用的时候配置。参考uni-starter的`/pages/list/detail.vue`的`methods -> shareClick` -- 更多`uni-share`的介绍 [详情](https://ext.dcloud.net.cn/plugin?id=4860) - -### 5.升级中心相关 -为了解决开发者维护多个 App 升级繁琐,重复逻辑过多,管理不便的问题,升级中心`uni-upgrade-center`应运而生。 -提供了简单、易用、统一的 App 管理、App 版本管理、安装包发布管理,升级检测更新管理。 -- 升级中心分为两个部分:`uni-upgrade-center` Admin管理后台和`uni-upgrade-center - Admin`前台检测更新。 -- `uni-upgrade-center`的介绍 [详情](https://ext.dcloud.net.cn/plugin?id=4542) -- `uni-upgrade-center - Admin`的介绍 [详情](https://ext.dcloud.net.cn/plugin?id=4470) - -### 6.意见反馈 -- 客户端[详情](https://ext.dcloud.net.cn/plugin?id=50) -- admin端[详情](https://ext.dcloud.net.cn/plugin?id=4992) - -### 7.指纹识别模块 -- `manifest.json` App模块配置 --> `Fingerprint`指纹识别 - -### 8.消息推送模块 -- `manifest.json` App模块配置 --> `push`消息推送 - -### 9.隐私政策弹框 -根据工业和信息化部关于开展APP侵害用户权益专项整治要求,App提交到应用市场必须满足以下条件: -- 应用启动运行时需弹出隐私政策协议,说明应用采集用户数据 -- 应用不能强制要求用户授予权限,即不能“不给权限不让用” -+ 如不希望应用启动时申请“读写手机存储”和“访问设备信息”权限,请参考:https://ask.dcloud.net.cn/article/36549 - -配置弹出“隐私协议和政策”打开项目的manifest.json文件,切换到“源码视图”项 -在`manifest.json` -> `app-plus` -> `privacy` 节点下添加 prompt节点 -```js -"privacy" : { - "prompt" : "template", - "template" : { - "title" : "服务协议和隐私政策", - "message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  你可阅读《服务协议》《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。", - "buttonAccept" : "同意", - "buttonRefuse" : "暂不同意" - } -} -``` -- prompt - 字符串类型,必填,隐私政策提示框配置策略,可取值template、custom、none,默认值为none - + template - 使用原生提示框模板,可自定义标题、内容已经按钮上的文本 - + custom - 自定义隐私政策提示框,uni-app项目中推荐使用nvue页面进行自定义,5+ APP使用html页面进行自定义 - + none - 不弹出隐私政策提示框 -- template - json格式,可选,模板提示框上显示的内容 - + title - 模板提示框上的标题,默认为“服务协议和隐私政策” - + message - 模板提示框上的内容,richtext类型字符串,支持a/font/br等节点,点击a链接会调用内置页面打开其href属性中链接地址。 - **注意:务必配置此提示内容,或参考上面示例内容并修改《服务协议》和《隐私政策》链接地址** - + buttonAccept - 模板提示框上接受按钮的文本,默认值为“我知道了” - + buttonRefuse - 模板提示框上拒绝按钮的文本,默认不显示此按钮 - + second - HBuilderX3.1.12+版本新增支持隐私提示框二次确认提示,用于配置二次确认提示框显示内容,message属性值不为空时弹出二次确认提示框 - + title 二次确认提示框上的标题 - + message 二次确认提示框上的内容,支持richtext类型字符串 - + buttonAccept 二次确认提示框上接受按钮的文本 - + buttonRefuse 二次确认提示框上拒绝按钮的文本 - -> 更多Android平台隐私与政策提示框配置方法,[详情](https://ask.dcloud.net.cn/article/36937) - -##### 注意: -1. 最新的华为应用市场要求,隐私政策提示框上接受按钮的文本,必须为“同意”而不能是其他有歧义的文字。 -2. 配置后提交云端打包后生效。理论上绝大部分和`manifest.json`生效相关的配置均需要提交云打包后生效 - -### 10.拦截器改造后的uniCloud -1. Debug,调试期间开启Debug。接口一旦fail就会弹出真实错误信息。否则将弹出,系统错误请稍后再试! -```js - if(Debug){ - console.log(e); - uni.showModal({ - content: JSON.stringify(e), - showCancel: false - }); - } -``` -2. 断网自动重试,当callFunction为fail时检测是否因断网引起。如果是会提醒用户并且会在恢复网络之后自动重新发起请求 -3. 常规的errCoder自动执行对应程序,如token无效/过期自动跳转到登录页面。 -4. token自动续期。 - -### 11.举例路由控制原理,深入了解拦截器的使用 -比如你希望在打开用户中心等页面之前,都检查一下该用户是否登录,否则就重定向到登录页面。使用拦截器你可以用以下写法在应用入口定义全局生效: - -```js - //定义各个页面,这里为了演示uni-starter框架是把该定义写在全局配置uni-starter.config.js中 - let needLogin = ["/pages/ucenter/userinfo/userinfo", ... ] - - uni.addInterceptor("navigateTo", { - invoke(e) { // 调用前拦截 - //获取用户的token - const token = uni.getStorageSync('uni_id_token') - //获取当前页面路径(即url去掉"?"和"?"后的参数) - const url = e.url.split('?')[0] - //判断要打开的页面是否需要验证登录 - if (needLogin.includes(url) && token == '') { - uni.showToast({ - title: '该页面需要登录才能访问,请先登录', - icon: 'none' - }) - uni.navigateTo({ - url: "/pages/ucenter/login-page/index/index" - }) - return false - } - }, - fail(err) { // 失败回调拦截 - console.log(err); - }, - }) -``` -- 而路由跳转方法不仅有`uni.navigateTo`还有`uni.redirectTo`,`uni.reLaunch`,`uni.switchTab`; -- 另外我们还希望控制直接跳转至哪种登录类型 -所以在uni-starter框架中我们这样定义: -uni-starter/common/appInit.js 的第228-280行 -```js - const {"router": {needLogin,login} } = uniStarterConfig //需要登录的页面 - let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]; - list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器 - uni.addInterceptor(item, { - invoke(e) { // 调用前拦截 - //获取用户的token - const token = uni.getStorageSync('uni_id_token') - //获取当前页面路径(即url去掉"?"和"?"后的参数) - const url = e.url.split('?')[0] - //判断要打开的页面是否需要验证登录 - if (needLogin.includes(url) && token == '') { - uni.showToast({ - title: '该页面需要登录才能访问,请先登录', - icon: 'none' - }) - uni.navigateTo({ - url: "/pages/ucenter/login-page/index/index" - }) - return false - } - //控制登录优先级 - if (url == '/pages/ucenter/login-page/index/index') { - //一键登录(univerify)、账号(username)、验证码登录(短信smsCode) - if (login[0] == 'univerify') { - if(e.url == url) { e.url += '?' } //添加参数之前判断是否带了`?`号如果没有就补上,因为当开发场景本身有参数的情况下是已经带了`?`号 - e.url += "univerify_first=true" - } else if (login[0] == 'username') { - e.url = "/pages/ucenter/login-page/pwd-login/pwd-login" - } - } - return true - }, - fail(err) { // 失败回调拦截 - console.log(err); - }, - }) - }) -``` - -### 12.关于升级 -- 项目升级 - - uni-starter遵循uni-app的插件模块化规范,即:[uni_modules](https://uniapp.dcloud.io/uni_modules) 。他是个项目类型的插件。在项目的根目录下有一个符合uni_modules规范的package.json文件,在这个文件右键-从插件市场更新即可更新该插件。 - -- 插件升级 - - 非项目类型的uni_modules插件,是项目根目录下的uni_modules目录下。以插件ID为插件文件夹命名,在该目录右键也会看到“从插件市场更新”选项,点击即可更新该插件。 - -### 13.多语言国际化 - uni-starter支持多语言国际化。默认开启,可以在`uni-starter.config.js`->`i18n`->`enable`中配置 - 如果你启用了多语言国际化需要先阅读:[uni-app多语言国际化](https://uniapp.dcloud.io/collocation/i18n?id=%e6%a1%86%e6%9e%b6%e5%86%85%e7%bd%ae%e7%bb%84%e4%bb%b6%e5%92%8capi%e5%9b%bd%e9%99%85%e5%8c%96) - -## 应用启动时序介绍 -文件路径: App.vue -```js - import initApp from '@/common/appInit.js'; - export default { - onLaunch: function() { - initApp(); - } - } -``` -onLaunch生命周期执行了 -1. 全局监听clientDB的err事件, - - 判断是否为token过期失效等需要重新登录的问题。自动跳转到登录页面 - - 检测本地的token是否有效(存在且并未过期)否则跳转到登录页面 -2. 预登录一键登录功能 -3. 执行了initApp()包含以下操作 - 1. 读取uni-starter.config并挂载到globalData的config下 - 2. 读取应用版本号,并存到globalData下 - 3. 检查是否有可更新的应用版本,决定是否启动在线更新版本 - 4. 监听设备的网络变化并以uni.showToast APi的方式提醒用户 - 5. 使用[拦截器](https://uniapp.dcloud.io/api/interceptor?id=addinterceptor) 实现 - - 页面路由拦截,配置需强制登录的页面;打开时检测,如果token无效就自动跳转到登录页 - - 优雅实现:自动引导打开`选择图片`所需要的权限。当调用`uni.chooseImage`时检测到无权限自动开启引导。并不是在每次调用接口时处理这类问题,你可以参考该例子做更多该类场景的处理。uni-starter也会持续完善 - - -## 配置文件 -uni-starter提供了`uni-starter.config.js`,可配置选择登录注册方式及优先级等,可指定该应用是否强制登录才能进入某个页面。配置项内容如下: -```js -module.exports = { - "h5": { - "url": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com", // 前端网页托管的域名 - // 在h5端全局悬浮引导用户下载app的功能 更多自定义要求在/common/openApp.js中修改 - "openApp": { - //点击悬浮下载栏后打开的网页链接 - "openUrl": 'https://sj.qq.com/myapp/detail.htm?apkName=com.tencent.android.qqdownloader&info=6646FD239A6EBA9E2DEE5DFC7E18D867', - //左侧显示的应用名称 - "appname": 'uni-starter', - //应用的图标 - "logo": './static/logo.png', - } - }, - "mp": { - "weixin": { - //微信小程序原始id,微信小程序分享时 - "id": "gh_132465798" - } - }, - "router": { - //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(无需联网)uni_id_token的值,如果token无效就自动跳转到登录页 - "needLogin": [ - "/pages/ucenter/userinfo/userinfo", - "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list", - ], - "login": ["smsCode","univerify", "username", "weixin", "apple"], - /* - 这里会根据数组的第0项,决定登录方式的第一优先级是哪种登录方式。 - 所有你希望拥有的登录方式这里都需要一一列举,未列举到的或设备环境不支持的登录方式将被隐藏。 - 如果你需要在不同平台有不同的配置,直接用条件编译即可。 - */ - }, - //关于应用 - "about": { - //应用名称 - "appName": "uni-starter", - //应用logo - "logo": "/static/logo.png", - //公司名称 - "company": "数字天堂(北京)网络技术有限公司", - //口号 - "slogan": "为开发而生", - //政策协议 - "agreements": [{ - "title": "用户服务协议", //协议名称 - "url": "https://ask.dcloud.net.cn/protocol.html" //对应的网络链接 - }, - { - "title": "隐私政策", - "url": "https://ask.dcloud.net.cn/protocol.html" - } - ], - //应用的链接,用于分享到第三方平台和生成关于我们页的二维码 - "download": "https://m3w.cn/uniapp" - }, - //用于打开应用市场评分界面 - "marketId":{ - "ios":"id1417078253", - "android":"123456" - }, - //配置多语言国际化。i18n为英文单词 internationalization的首末字符i和n,18为中间的字符数 是“国际化”的简称 - "i18n":{ - "enable":false //默认启用,国际化。如果你不想使用国际化相关功能,请改为false - } -} -``` - -## 目录结构@catalogue -
-uni-starter
-├─uniCloud-aliyun	
-│	├─cloudfunctions 云函数目录
-│	|	├─common 公共模块
-│	│	|	├─uni-config-center		uni-starter的服务端配置中心,项目所有云函数的配置在这里填写 详情
-│	│	|	|	├─index.js			config-center入口文件
-│	│	|	|	└─uni-id			uni-id模块配置目录
-│	│	|	|		├─config.json	uni-id对应的配置数据:微信登录、一键登录、短信验证码登录等key都在这里填写详情
-│	│	|	|		└─file.cert		uni-id依赖的配置文件,假如你使用微信发红包功能,需要的证书文件就是放到这里
-│	|	|	└───uni-id				uni-id用户体系 详情
-│	|	├─uni-analyse-searchhot		云端一体搜索模板依赖的云函数 详情
-│	|	└─uni-id-cf				用户中心云函数,实现用户注册、修改密码、发送验证码、快捷登录(微信、短信、账户、一键登录)
-│	└──database						云数据目录
-│		├─db_init.json				db_init.json初始化数据库文件,其中不再包含schema 详情
-│		├─opendb-app-versions.schema.json		应用版本,表结构文件
-│		├─opendb-banner.schema.json	        	横幅数据表,表结构文件
-│		├─opendb-feedback.schema.json	        意见反馈表,表结构文件
-│		├─opendb-news-articles.schema.json	    新闻文章表,表结构文件
-│		├─opendb-news-categories.schema.json	新闻分类表,表结构文件
-│		├─opendb-news-comments.schema.json		新闻评论表,表结构文件
-│		├─opendb-news-favorite.schema.json		新闻收藏表,表结构文件
-│		├─opendb-search-hot.schema.json			热门搜索表,表结构文件
-│		├─opendb-search-log.schema.json			搜索记录表,表结构文件
-│		├─opendb-verify-codes.schema.json		验证码表,表结构文件
-│		├─uni-id-log.schema.json	        	登录日志表,表结构文件
-│		├─uni-id-scores.schema.json	        	用户积分表,表结构文件
-│		└─uni-id-users.schema.json	        	用户表,表结构文件
-├─pages										业务页面文件存放的目录
-│	├─common						
-│	│	└─webview							webview目录
-│	│		└─webview.vue					webview页面	用于实现跨端的web页面浏览
-│	├─grid
-│	│	└─grid.vue	 						带宫格和banner的示例页面
-│	├─list
-│	│	├─list.vue	 						新闻列表
-│	│	├─search
-│	│	│	└─search						云端一体搜索插件
-│	│	└─detail.vue						新闻详情
-│	├─ucenter
-│	│	├─about								关于我们
-│	│	│	└─about
-│	│	├─login-page						登录模块
-│	|	|	├─common						登录模块公共库
-│	│	│	│	├─login-page.css			公共样式库
-│	│	│	│	├─login-page.mixin.js		公共mixin
-│	│	│	│	└─loginSuccess.js			公共登录成功后操作
-│	|	|	├─index							短信验证码登录,手机号码输入页面
-│	|	|	├─phone-code					短信验证码登录,验证码输入页面
-│	|	|	├─pwd-login						账户密码登录
-│	|	|	├─pwd-retrieve					密码重置
-│	│	│	└─register						注册账户模块
-│	│	│		├─validator.js
-│	│	│		└─register.vue
-│	│	├─read-news-log						新闻阅读记录
-│	│	│	└─read-news-log
-│	│	├─settings						
-│	│	│	├─dc-push
-│	│	│	│	└─push.js					push权限操作SDK
-│	│	│	└─settings.vue					app设置
-│	│	├─userinfo							用户个人信息
-│	│	│	├─bind-mobile
-│	│	│	│	└─bind-mobile.vue			绑定手机号码
-│	│	│	├─limeClipper					图片裁剪插件,来源[limeClipper](https://ext.dcloud.net.cn/plugin?id=3594) @作者: 陌上华年
-│	│	│	│	├─images
-│	│	│	│	│	├─photo.svg
-│	│	│	│	│	└─rotate.svg
-│	│	│	│	├─index.css
-│	│	│	│	├─limeClipper.vue
-│	│	│	│	├─README.md
-│	│	│	│	└─utils.js
-│	│	│	├─main.js
-│	│	│	├─cropImage.vue	引用limeClipper的图片裁剪模块,为了方便二开可能会出现兼容`vue`与`nvue`,所以做成了`页面`而不是`组件`
-│	│	│	└─userinfo.vue
-│	|	└─ucenter.vue						用户中心
-│	|
-├─static	 						存放应用引用的本地静态资源(如图片、视频等)的目录,注意:静态资源只能存放于此
-├─uni_modules						存放[uni_module](/uni_modules)规范的插件。
-├─uni_modules_tools					uni_modules插件上传辅助脚本 详情。
-├─main.js							Vue初始化入口文件
-├─App.vue							应用配置,用来配置App全局样式以及监听 应用生命周期
-├─uni-starter.config				uni-starter的前端的配置文件,项目所有模块的配置在这里填写。详见该文件的代码注释。
-├─manifest.json	 					配置应用名称、appid、logo、版本等打包信息,详见
-└─pages.json						配置页面路由、导航条、选项卡等页面类信息,详见
-
-完整的uni-app目录结构[详情](https://uniapp.dcloud.io/frame?id=%e7%9b%ae%e5%bd%95%e7%bb%93%e6%9e%84) - -## 常见API示范 -1. 判断当前用户是否拥有某角色`uniIDHasRole` 演示页面:`/pages/grid/grid` [API文档详情:](https://uniapp.dcloud.io/api/global?id=uniidhasrole) -2. 指纹解锁、人脸解锁 演示页面:`/pages/ucenter/settings/settings` [API文档详情:](https://uniapp.dcloud.io/api/system/authentication) - -## 注意事项 -1. 真机运行需要制作自定义基座,制作后选择运行到自定义基座 -2. 苹果登录的图标,需要满足苹果应用市场的审核规范请勿随便修改;如需修改请先阅读:[Sign in with Apple Button](https://appleid.apple.com/signinwithapple/button) -3. 应用登录功能,默认不勾选同意隐私权限是响应安卓应用市场的规范;请勿修改该逻辑。 - -## FAQ:常见问题 -1. 提示“公共模块uni-id缺少配置信息”解决方案:在cloudfunctions右键‘上传所有云函数、公共模块及actions’之后,需要在cloudfunctions -> common -> uni-config-center 目录单独上传一次,右键‘上传公共模块’。 -2. 本项目代码可以商用,无需为DCloud付费。但不能把本项目的代码改造用于非uni-app和uniCloud的技术体系。即,不能将后台改成php、java等其他后台,这将违反使用许可协议。 - -## 相关案例 -[ - ![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/dd4c366f-6165-46c0-8500-5a679d7e5463.jpg) -](https://ext.dcloud.net.cn/search?q=uni-starter) -(点击跳转到案例列表) - - -## 第三方插件(感谢插件作者,排名不分前后): -1. 图片裁剪 [limeClipper](https://ext.dcloud.net.cn/plugin?id=3594) @作者: 陌上华年 -2. 二维码生成 [Sansnn-uQRCode](https://ext.dcloud.net.cn/plugin?id=1287) @作者: 3snn -3. clipboard.js [clipboard](https://clipboardjs.com/) \ No newline at end of file +

+文档已移至 uni-starter文档 +

\ No newline at end of file diff --git a/changelog.md b/changelog.md index 58e7f258a44b89d8d454898480b5dd4a6eab3082..6a216ac6db9f721ab50b0e881d7791d4594ad7fd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,22 @@ +## 1.2.5(2022-05-29) +升级预置的`uni_modules`->`uni-captcha`版本为:0.6.0。[详情](https://ext.dcloud.net.cn/plugin?name=uni-captcha) +## 1.2.4(2022-05-20) +- 修改`uni-starter.config.js`->`debug`的默认值为`false` +## 1.2.3(2022-05-20) +- 默认关闭`manifest.json`中的扩展配置 +- `uni-starter.config.js` 新增debug,用于配置是否开启调试模式 +## 1.2.2(2022-05-19) +- 优化登陆体验,账号密码登陆错误超过2次,再显示图形验证码进行人机校验。 +## 1.2.1(2022-05-18) +- 修复在某些情况下,微信小程序端验证码显示错误的问题 +## 1.2.0(2022-05-16) +- 短信验证码登陆、绑定手机号码新增防刷逻辑。当短信验证码输入错误2次以上,弹出图形验证码进行人机校验。 +- uni-id-cf,新增防刷机制。更改loginLog为uniIdLog 记录各类uni-id操作,并新增action字段记录操作的行为名称 +- 注册账号新增需要输入图形验证码 +## 1.1.34(2022-05-12) +修复绑定手机号码,未验证空验证码的问题。注意:请确保项目依赖的uni-id版本为3.3.18+ +## 1.1.33(2022-02-24) +修复微信小程序端,个人资料-绑定手机号码,一键获取微信资料中手机号码绑定授权,点击“拒绝”时toast:encryptedData 不可为空的问题 ## 1.1.32(2022-02-24) - 删除多余文件:`uniCloud/database/opendb-news-articles-detail.schema.json` - 修复当用户选择验证码登陆方式,在输入验证码页面,点击微信登陆时报“你未同意隐私政策协议”的问题 diff --git a/common/appInit.js b/common/appInit.js index 2cd4864c0b9afbe7f4b22e4319686591f7c634e1..da70ffd2acfb32c8c1fac8f2652fdd5db79550d2 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -8,7 +8,8 @@ import interceptorChooseImage from '@/uni_modules/json-interceptor-chooseImage/j // #endif const db = uniCloud.database() export default async function() { - let loginConfig = uniStarterConfig.router.login + let loginConfig = uniStarterConfig.router.login; + const debug = uniStarterConfig.debug; //清除有配置但设备环境不支持的登录项 // #ifdef APP-PLUS await new Promise((callBack) => { @@ -94,7 +95,6 @@ export default async function() { url: '/pages/ucenter/login-page/index/index' }) } - return code } // 绑定clientDB错误事件 db.on('error', onDBError) @@ -153,7 +153,6 @@ export default async function() { } }) - const Debug = false; //拦截器封装callFunction let callFunctionOption; uniCloud.addInterceptor('callFunction', { @@ -199,8 +198,9 @@ export default async function() { complete(e) { // console.log(JSON.stringify(e)); }, - fail(e) { // 失败回调拦截 - if (Debug) { + fail(e) { // 失败回调拦截 + console.error('网络请求错误码:',JSON.stringify(e)); + if (debug) { uni.showModal({ content: JSON.stringify(e), showCancel: false @@ -375,7 +375,7 @@ export default async function() { }, fail(err) { // 失败回调拦截 console.log(err); - if (Debug) { + if (debug) { console.log(err); uni.showModal({ content: JSON.stringify(err), diff --git a/components/uni-agreements/uni-agreements.vue b/components/uni-agreements/uni-agreements.vue index 8d82aa0b18837e465c5ea72d8792b5bb09fb4ab2..d94a5b76d88a0422f894cd84871e0b4c2ad60752 100644 --- a/components/uni-agreements/uni-agreements.vue +++ b/components/uni-agreements/uni-agreements.vue @@ -16,7 +16,7 @@ name:"uni-agreements", computed:{ agreements(){ - return getApp({allowDefault: true}).globalData.config.about.agreements||[] + return getApp().globalData.config.about.agreements||[] } }, methods:{ diff --git a/components/uni-bindMobileByMpWeixin/uni-bindMobileByMpWeixin.vue b/components/uni-bindMobileByMpWeixin/uni-bindMobileByMpWeixin.vue index bc07a6d6bd579e86db54f5a97f20ad2a1825b35a..c1246e515916058503b5f54ff21b1fc13d1248ce 100644 --- a/components/uni-bindMobileByMpWeixin/uni-bindMobileByMpWeixin.vue +++ b/components/uni-bindMobileByMpWeixin/uni-bindMobileByMpWeixin.vue @@ -70,29 +70,33 @@ }) }, bindMobileByMpWeixin(e) { - console.log(e.detail); - uniCloud.callFunction({ - name: "uni-id-cf", - data: { - "action": "bindMobileByMpWeixin", - "params": e.detail - }, - complete: (e) => { - console.log(e); - }, - success: (e) => { - uni.showToast({ - title: e.result.msg||'绑定成功', - icon: 'none' - }); - if(e.result.code === 0){ - this.setUserInfo({ - "mobile": e.result.mobile - }) + console.log(e.detail); + if(e.errMsg == "getPhoneNumber:ok"){ + uniCloud.callFunction({ + name: "uni-id-cf", + data: { + "action": "bindMobileByMpWeixin", + "params": e.detail + }, + complete: (e) => { + console.log(e); + }, + success: (e) => { + uni.showToast({ + title: e.result.msg||'绑定成功', + icon: 'none' + }); + if(e.result.code === 0){ + this.setUserInfo({ + "mobile": e.result.mobile + }) + } + this.closeMe() } - this.closeMe() - } - }) + }) + }else{ + this.closeMe() + } }, async open(uid) { userId = uid diff --git a/components/uni-load-state/uni-load-state.vue b/components/uni-load-state/uni-load-state.vue index 744471e0d38cce340f0717e2512cc7a64ffd632a..25b2902c4c62acebe3bb1f34297f23d65769e172 100644 --- a/components/uni-load-state/uni-load-state.vue +++ b/components/uni-load-state/uni-load-state.vue @@ -115,7 +115,8 @@ + diff --git a/main.js b/main.js index dcd2e463ceec110000ae7e77bec3cf6dd856fa3d..ee65e43fdd8a11fae2868934148eade8295fc70c 100644 --- a/main.js +++ b/main.js @@ -2,7 +2,7 @@ import App from './App' import store from './store' import i18n from './lang/i18n' -// uni.showModal = ()=>{}; +uni.showModal = ()=>{}; // #ifndef VUE3 import Vue from 'vue' diff --git a/package.json b/package.json index 83cf66dc86e249278ff273655d2ab38cba50e464..1d91d4b3f3c558fc8b0035c80670f923713c2fc9 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.1.32", + "version": "1.2.5", "description": "云端一体应用快速开发基本项目模版", "keywords": [ - "login", - "登录", - "搜索", - "uni-id实例", - "留言板" - ], + "login", + "登录", + "搜索", + "uni-id实例", + "留言板" + ], "repository": "https://gitcode.net/dcloud/uni-starter", "engines": { "HBuilderX": "^3.2.6" @@ -38,7 +38,10 @@ "npmurl": "" }, "uni_modules": { - "dependencies": [], + "dependencies": [ + "uni-id-cf", + "uni-captcha" + ], "encrypt": [], "platforms": { "cloud": { @@ -82,6 +85,6 @@ } }, "dependencies": { - "@jest/test-sequencer": "^27.0.6" + "@jest/test-sequencer": "^27.5.1" } } diff --git a/pages.json b/pages.json index d4ed64383abfb61dcd4a2893a61c8cbf750321c7..bcb5ccbe8e440fa7ca1a87763c28db0dba0b6514 100644 --- a/pages.json +++ b/pages.json @@ -1,5 +1,6 @@ { - "pages": [{ + "pages": [ + { "path": "pages/list/list", "style": { // #ifndef APP-PLUS @@ -176,7 +177,11 @@ "navigationBarTitleText": "uni-starter", "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#F8F8F8", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + // "maxWidth":375, + "rpxCalcMaxDeviceWidth":375, + "rpxCalcBaseDeviceWidth":375 + // "rpxCalcIncludeWidth":0 }, "condition": { "list": [{ diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue index 90a63ac51b08d5198a8140be880ed711cc336955..55a04b76fc31a492a8195f73fc112e02563944fb 100644 --- a/pages/grid/grid.vue +++ b/pages/grid/grid.vue @@ -2,39 +2,39 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + - - @@ -209,13 +200,13 @@ margin-right: 10rpx; } - .main { - justify-content: space-between; + .main { + justify-content: space-between; + flex: 1; } .title { - width: 480rpx; - font-size: 32rpx; + font-size: 16px; } .info { @@ -225,7 +216,7 @@ .author, .last_modify_date { - font-size: 28rpx; + font-size: 14px; color: #999999; } @@ -251,5 +242,4 @@ z-index: 999; /* #endif */ } - - + diff --git a/pages/list/list.test1.js b/pages/list/list.test1.js index 7ec3c49c240c61c39932efa37b37c4336fb94359..1373455c597302bb840da64e4d42244259a2a3b5 100644 --- a/pages/list/list.test1.js +++ b/pages/list/list.test1.js @@ -13,7 +13,7 @@ describe('pages/list/list.vue', () => { }) it('点击搜索跳转', async () => { - expect.assertions(2); + // expect.assertions(2); const searchTo = await page.callMethod('searchClick') await page.waitFor(300) expect((await program.currentPage()).path).toBe('pages/list/search/search') diff --git a/pages/list/search/search.test.js b/pages/list/search/search.test1.js similarity index 100% rename from pages/list/search/search.test.js rename to pages/list/search/search.test1.js diff --git a/pages/ucenter/about/about.vue b/pages/ucenter/about/about.vue index 235e3c5c81d685671182344ad5e5656fd36ba62e..a30fad239d7e389d293dac5065d5f294080ac94a 100644 --- a/pages/ucenter/about/about.vue +++ b/pages/ucenter/about/about.vue @@ -41,8 +41,8 @@ }, computed: { uniStarterConfig() { - console.log(getApp({allowDefault: true}),"getApp----------------"); - return getApp({allowDefault: true}).globalData.config + console.log(getApp()); + return getApp().globalData.config } }, data() { @@ -54,7 +54,6 @@ }, created() { this.about = this.uniStarterConfig.about - console.log("this.about:------ ",this.about); uni.setNavigationBarTitle({ title: this.$t('about.about')+ " " + this.about.appName }) @@ -77,7 +76,7 @@ }, menus: [{ "img": "/static/app-plus/sharemenu/wechatfriend.png", - "text": this.$t('common').wechatFriends, + "text": this.$t('common.wechatFriends'), "share": { "provider": "weixin", "scene": "WXSceneSession" @@ -85,7 +84,7 @@ }, { "img": "/static/app-plus/sharemenu/wechatmoments.png", - "text": this.$t('common').wechatBbs, + "text": this.$t('common.wechatBbs'), "share": { "provider": "weixin", "scene": "WXSceneTimeline" @@ -93,7 +92,7 @@ }, { "img": "/static/app-plus/sharemenu/weibo.png", - "text": this.$t('common').weibo, + "text": this.$t('common.weibo'), "share": { "provider": "sinaweibo" } @@ -107,16 +106,16 @@ }, { "img": "/static/app-plus/sharemenu/copyurl.png", - "text": this.$t('common').copy, + "text": this.$t('common.copy'), "share": "copyurl" }, { "img": "/static/app-plus/sharemenu/more.png", - "text": this.$t('common').more, + "text": this.$t('common.more'), "share": "shareSystem" } ], - cancelText: this.$t('common').cancelShare, + cancelText: this.$t('common.cancelShare'), }, e => { //callback console.log(e); }) @@ -127,7 +126,7 @@ title }) { uni.navigateTo({ - url: '/pages/common/webview/webview?url=' + url + '&title=' + title, + url: '/pages/common/webview/webview?url=' + url + '&title=' + title, success: res => {}, fail: () => {}, complete: () => {} @@ -145,8 +144,9 @@ } /* #endif */ .about { - width: 750rpx; - flex-direction: column; + flex-direction: column; + justify-content: center; + align-items: center; } .box { @@ -181,13 +181,12 @@ } .copyright { - width: 750rpx; font-size: 32rpx; flex-direction: column; justify-content: center; align-items: center; bottom: 20px; - left: 0; + // left: 0; position: fixed; } diff --git a/pages/ucenter/login-page/common/login-page.css b/pages/ucenter/login-page/common/login-page.css index d30c21c562bcdadbc2ace0e5b49b361135e8f0bb..4189236f739afe71edf8c02fdefd22c9f70d1796 100644 --- a/pages/ucenter/login-page/common/login-page.css +++ b/pages/ucenter/login-page/common/login-page.css @@ -9,7 +9,7 @@ view { .content { padding: 0 50rpx; - width: 750rpx; + /* width: 750rpx; */ flex: 1; } diff --git a/pages/ucenter/login-page/index/index.vue b/pages/ucenter/login-page/index/index.vue index 8d1a855dc67725bb0e93fbfa5a70d8419519eee7..e1750d5ce521c4af434976f4beac9d218b16a5e6 100644 --- a/pages/ucenter/login-page/index/index.vue +++ b/pages/ucenter/login-page/index/index.vue @@ -6,12 +6,12 @@ - + @@ -91,7 +91,7 @@ sendShortMsg() { if (!this.agree) { return uni.showToast({ - title: this.$t('common').noAgree, + title: this.$t('common.noAgree'), icon: 'none' }); } diff --git a/pages/ucenter/login-page/phone-code/phone-code.vue b/pages/ucenter/login-page/phone-code/phone-code.vue index b482e62e4729cb8e631940193d85ccd56b6dd0f0..9cd8992bd4c0dd5172a89d5086025ed05f5e2145 100644 --- a/pages/ucenter/login-page/phone-code/phone-code.vue +++ b/pages/ucenter/login-page/phone-code/phone-code.vue @@ -4,92 +4,113 @@ {{$t('common.verifyCodePlaceholder')}} {{tipText}} - - + + - + + + + diff --git a/pages/ucenter/login-page/pwd-login/pwd-login.vue b/pages/ucenter/login-page/pwd-login/pwd-login.vue index 7fc70d7985680c137389be07c1739d3664520422..b5baa76a448d697321ebb37411e32674896a990c 100644 --- a/pages/ucenter/login-page/pwd-login/pwd-login.vue +++ b/pages/ucenter/login-page/pwd-login/pwd-login.vue @@ -4,11 +4,8 @@ {{$t('pwdLogin.pwdLogin')}} - - - - - + + @@ -28,14 +25,14 @@ return { "password": "", "username": "", - "agree": false, - "captchaBase64":"", - "captcha":"" + "agree": false, + "captcha":'', + "needCaptcha":false } }, computed: { canLogin() { - return this.username.length && this.isPwd; + return this.username.length && this.isPwd && this.agree; }, isPwd() { return /^.{6,20}$/.test(this.password); @@ -51,10 +48,6 @@ url: '../pwd-retrieve/pwd-retrieve?phoneNumber=' + (this.isPhone ? this.username : '') + '&phoneArea=' + this.currenPhoneArea }) - // uni.redirectTo({ - // url: '../pwd-retrieve/pwd-retrieve?phoneNumber=' + (this.isPhone ? this.username : '') + - // '&phoneArea=' + this.currenPhoneArea - // }) }, /** * 密码登录 @@ -62,12 +55,11 @@ async pwdLogin() { if (!this.agree) { return uni.showToast({ - title: this.$t('common').noAgree, + title: this.$t('common.noAgree'), icon: 'none' }); } return await uniCloud.callFunction({ - name:'uni-id-cf', data:{ action:'login', params:{ @@ -76,23 +68,24 @@ "captcha":this.captcha }, }, - }).then(({result}) => { + }).then(({result})=>{ console.log(result); if (result.code === 0) { this.loginSuccess(result) } else { if (result.needCaptcha) { uni.showToast({ - title: result.msg, + title: result.msg||'完成', icon: 'none' }); - this.createCaptcha() + this.needCaptcha = true + // this.createCaptcha() }else{ uni.showModal({ - title: this.$t('common').error, + title: this.$t('common.error'), content: result.msg, showCancel: false, - confirmText: this.$t('common').gotIt + confirmText: this.$t('common.gotIt') }); } } @@ -101,63 +94,43 @@ console.log("res:-- ",res); return res }) - // 下边是可以登录 - // uniCloud.callFunction({ - // name:'uni-id-cf', - // data:{ - // action:'login', - // params:{ - // "username": this.username, - // "password": this.password, - // "captcha":this.captcha - // }, - // }, - // success: ({result}) => { - // console.log(result); - // if (result.code === 0) { - // this.loginSuccess(result) - // } else { - // if (result.needCaptcha) { - // uni.showToast({ - // title: result.msg, - // icon: 'none' - // }); - // this.createCaptcha() - // }else{ - // uni.showModal({ - // title: this.$t('common').error, - // content: result.msg, - // showCancel: false, - // confirmText: this.$t('common').gotIt - // }); - // } - // } - // } - // }) - }, - createCaptcha(){ - uniCloud.callFunction({ - name:'uni-id-cf', - data:{ - action:'createCaptcha', - params:{ - scene: "login" - }, - }, - success: ({result}) => { - if (result.code === 0) { - this.captchaBase64 = result.captchaBase64 - }else{ - uni.showModal({ - content: result.msg, - showCancel: false - }); - } - } - }) + // 下边是可以登录 + /* uniCloud.callFunction({ + name:'uni-id-cf', + data:{ + action:'login', + params:{ + "username": this.username, + "password": this.password, + "captcha":this.captcha + }, + }, + success: ({result}) => { + console.log(result); + if (result.code === 0) { + this.loginSuccess(result) + } else { + if (result.needCaptcha) { + uni.showToast({ + title: result.msg||'完成', + icon: 'none' + }); + this.needCaptcha = true + // this.createCaptcha() + }else{ + uni.showModal({ + title: this.$t('common.error'), + content: result.msg, + showCancel: false, + confirmText: this.$t('common.gotIt') + }); + } + } + } + }) */ }, /* 前往注册 */ - toRegister(e) { + toRegister() { uni.navigateTo({ url: '/pages/ucenter/login-page/register/register' }) @@ -166,7 +139,7 @@ } - diff --git a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue index 3d0705c54a12cca656d0b79720b5f28bd6b8522b..567e2ab89556543c39054f7ed3bf34ffc6f98676 100644 --- a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue +++ b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue @@ -2,11 +2,12 @@ - + - + { + .then(async res => { return await uniCloud.callFunction({ - name:'uni-id-cf', - data:{ - action:'resetPwdBySmsCode', - params:{ + name: 'uni-id-cf', + data: { + action: 'resetPwdBySmsCode', + params: { "mobile": this.formData.phone, "code": this.formData.code, "password": this.formData.pwd }, } - }).then(({result})=>{ + }).then(({ + result + }) => { console.log(result); uni.showToast({ - title: result.msg||'更新成功', + title: result.msg || '更新成功', icon: 'none' }); if (result.code === 0) { uni.navigateBack() } return result + }).catch((reason) => { + console.log(reason, 'reason----'); + return reason }) // uniCloud.callFunction({ @@ -176,7 +185,7 @@ // success: ({result}) => { // console.log(result); // uni.showToast({ - // title: result.msg, + // title: result.msg||'更新成功', // icon: 'none' // }); // if (result.code === 0) { @@ -192,7 +201,8 @@ + diff --git a/pages/ucenter/login-page/register/register.vue b/pages/ucenter/login-page/register/register.vue index ff0c1ee2d53bded19309d0c08d031d3e6f9866fe..a7e66184a81e6a032daccd73cf15fe22cb439844 100644 --- a/pages/ucenter/login-page/register/register.vue +++ b/pages/ucenter/login-page/register/register.vue @@ -2,38 +2,55 @@ - + - + - + - + + + + - + - + diff --git a/pages/ucenter/settings/settings.vue b/pages/ucenter/settings/settings.vue index c012f431829601fba926933821b865274b6e24bf..d0c44b4a1057bcdc9fd579e6cf9a300202202ca5 100644 --- a/pages/ucenter/settings/settings.vue +++ b/pages/ucenter/settings/settings.vue @@ -1,7 +1,7 @@ - - - + + + - - + + diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json index 4efafd509b3489e15a5081e838f51456acfbb9a4..7ba6d2f67ebddbff45a7997e8e6c845bd65dd043 100644 --- a/uni_modules/uni-badge/package.json +++ b/uni_modules/uni-badge/package.json @@ -1,7 +1,7 @@ { "id": "uni-badge", "displayName": "uni-badge 数字角标", - "version": "1.1.6", + "version": "1.2.0", "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", "keywords": [ "", diff --git a/uni_modules/uni-badge/readme.md b/uni_modules/uni-badge/readme.md index d29680be1c2da3d0e6ad943e41568f7d1161fc84..bdf175da9f759cafe6a4bc910c0e8ac0d20fcff7 100644 --- a/uni_modules/uni-badge/readme.md +++ b/uni_modules/uni-badge/readme.md @@ -1,58 +1,10 @@ - - ## Badge 数字角标 > **组件名:uni-badge** > 代码块: `uBadge` - 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - -``` - - -## API - -### Badge Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |角标内容 | -|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)| -|size |String |normal |Badge 大小,可取值:normal、small | -|is-dot |Boolean|false |不展示数字,只有一个小点 | -|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ | -|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 | -|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 | -|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) | -|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])| - -### Badge Events - -|事件名 |事件说明 |返回参数 | -|:-: |:-: |:-: | -|@click |点击 Badge 触发事件| - | - - - +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -## 组件示例 -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) \ No newline at end of file diff --git a/uni_modules/uni-calendar/changelog.md b/uni_modules/uni-calendar/changelog.md index 454f13d38cbb666310b799fa6aeec20748706b92..6df4493eb6ea268de09092e4bd1b70cc766abd91 100644 --- a/uni_modules/uni-calendar/changelog.md +++ b/uni_modules/uni-calendar/changelog.md @@ -1,3 +1,7 @@ +## 1.4.5(2022-02-25) +- 修复 条件编译 nvue 不支持的 css 样式 +## 1.4.4(2022-02-25) +- 修复 条件编译 nvue 不支持的 css 样式 ## 1.4.3(2021-09-22) - 修复 startDate、 endDate 属性失效的 bug ## 1.4.2(2021-08-24) diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue index 1364c0a9d564d1bf8819c052330dcfe1c19832db..a4b96ce346a34ed1f3c07840bdad138a780e38dd 100644 --- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue +++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue @@ -388,14 +388,17 @@ } .uni-calendar--fixed { - position: fixed; - bottom: calc(var(--window-bottom)); + position: fixed; + /* #ifdef APP-NVUE */ + bottom: 0; + /* #endif */ left: 0; right: 0; transition-property: transform; transition-duration: 0.3s; transform: translateY(460px); - /* #ifndef APP-NVUE */ + /* #ifndef APP-NVUE */ + bottom: calc(var(--window-bottom)); z-index: 99; /* #endif */ } diff --git a/uni_modules/uni-calendar/package.json b/uni_modules/uni-calendar/package.json index 4c9db65549e2f251bf0bc63238addffd7b30c03d..40455c8702569aa7271c4b77461a85ebdd6da2d4 100644 --- a/uni_modules/uni-calendar/package.json +++ b/uni_modules/uni-calendar/package.json @@ -1,7 +1,7 @@ { "id": "uni-calendar", "displayName": "uni-calendar 日历", - "version": "1.4.3", + "version": "1.4.5", "description": "日历组件", "keywords": [ "uni-ui", diff --git a/uni_modules/uni-captcha/changelog.md b/uni_modules/uni-captcha/changelog.md index a710020dbc70b575fc9b169f02a83fa61347edfd..703a268752ab4ae27973fe597e1e6bc75eff543d 100644 --- a/uni_modules/uni-captcha/changelog.md +++ b/uni_modules/uni-captcha/changelog.md @@ -1,4 +1,30 @@ -## 0.1.1(2021-03-04) -- refresh不再读取上一条验证码状态 +## 0.6.0(2022-05-27) +- 新增:支持在`uni-config-center`中根据场景值配置 +- 修复:弹窗式验证码,输入内容后点击取消,重新打开验证码的值仍然存在的问题 +## 0.5.2(2022-05-19) +- 修复在Vue3的兼容问题 +## 0.5.1(2022-05-18) +- 修复在某些情况下微信小程序端验证码显示错误的问题 +## 0.5.0(2022-05-17) +- 新增支持在`uni-captcha-co`->`config`配置验证码 +## 0.4.1(2022-05-16) +- 新增示例项目 +## 0.4.0(2022-05-16) +- 集成创建、刷新、显示验证码的云端一体验证码组件 +- 云对象`uni-captcha-co`集成获取验证码的api,`getImageCaptcha` +## 0.3.1(2022-05-13) +- 新增 返回值符合响应体规范 +## 0.3.0(2022-05-13) +- 新增 支持 uni-config-center 配置 +## 0.2.2(2022-04-25) +- 修复 0.2.1 版本引起的使用 image 组件验证码不显示的Bug +## 0.2.1(2022-04-18) +- 更新 优化字体 +## 0.2.0(2022-04-14) +- 新增 使用 svg 表现形式更好 +- 新增 使用字体,可以任意替换默认字体 +- 新增 支持设置字体大小 +- 新增 支持忽略某些字符 +- 注意 更新之后请重新上传公共模块 ## 0.1.0(2021-03-01) - 调整为uni_modules目录规范 diff --git a/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue new file mode 100644 index 0000000000000000000000000000000000000000..3d3334344d02fdfdfb6ee470b514014632681159 --- /dev/null +++ b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue b/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue new file mode 100644 index 0000000000000000000000000000000000000000..64ec5b1bfec8d0d2bcd2ec627f910c783c815d63 --- /dev/null +++ b/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/uni_modules/uni-captcha/package.json b/uni_modules/uni-captcha/package.json index 7245ea0fc88f8725eace8210063c393e6d373961..1a147798fed2856994f64b418432ac45dfdfc1ff 100644 --- a/uni_modules/uni-captcha/package.json +++ b/uni_modules/uni-captcha/package.json @@ -1,8 +1,8 @@ { "id": "uni-captcha", "displayName": "uni-captcha", - "version": "0.1.1", - "description": "简洁、高效、灵活可配置的云端验证码模块", + "version": "0.6.0", + "description": "云端一体图形验证码组件", "keywords": [ "uniCloud", "captcha", @@ -73,6 +73,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "u" } } } diff --git a/uni_modules/uni-captcha/readme.md b/uni_modules/uni-captcha/readme.md index 295d852f7646fb801eefa88dfdb4dddac6b14cbe..d929f633b9698b2170088fa85b572884eea7d77d 100644 --- a/uni_modules/uni-captcha/readme.md +++ b/uni_modules/uni-captcha/readme.md @@ -1,92 +1,3 @@ -## uni 验证码验证文档 - -> 用途:主要使用在登录、需要人机校验或其他限制调用的场景 - -> 验证码生成、校验都在服务端。页面使用返回的 base64 显示。[云端一体登陆模板](https://ext.dcloud.net.cn/plugin?id=13)已集成,可下载体验。 - -> 数据表使用[opendb-verify-codes](https://gitee.com/dcloud/opendb/blob/master/collection/opendb-verify-codes/collection.json) - -### 获取验证码@create - -用法:`uniCaptcha.create(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| --------------- | ------ | ---- | ------- | ----------------------------------------------- | -| scene | String | 是 | 4 | 使用场景值,用于防止不同功能的验证码混用 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | -| width | Number | - | 100 | 图片宽度 | -| height | Number | - | 40 | 图片高度 | -| backgroundColor | String | - | #FFFAE8 | 验证码背景色 | -| size | Number | - | 4 | 验证码长度,最多 6 个字符 | -| noise | Number | - | 4 | 验证码干扰线条数 | -| expiresDate | Number | - | 180 | 验证码过期时间(s) | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------------- | ------ | ------------------- | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | -| captchaBase64 | String | 验证码:base64 格式 | - -`注意:` - -- 重新生成后,上条验证码作废 - -### 校验验证码@verify - -用法:`uniCaptcha.verify(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| -------- | ------ | ---- | ------ | ----------------------------------------------- | -| scene | String | 是 | - | 类型,用于防止不同功能的验证码混用 | -| captcha | String | 是 | - | 验证码 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------- | ------ | ------------------ | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | - -`注意:` - -- 若提示验证码失效,请重新获取 - -### 刷新验证码@refresh - -用法:`uniCaptcha.refresh(Object params);` - -**参数说明** - -| 字段 | 类型 | 必填 | 默认值 | 说明 | -| -------- | ------ | ---- | ------ | ----------------------------------------------- | -| scene | String | 是 | - | 类型,用于防止不同功能的验证码混用 | -| deviceId | String | - | - | 设备 id,如果不传,将自动从 uniCloud 上下文获取 | - -**响应参数** - -| 字段 | 类型 | 说明 | -| ------------- | ------ | ------------------- | -| code | Number | 错误码,0 表示成功 | -| message | String | 详细信息 | -| captchaBase64 | String | 验证码:base64 格式 | - -`注意:` - -- 支持传入 create 方法的所有参数,如果不传,则自动按照 deviceId 匹配上次生成时的配置生成新的验证码 - -## 错误码 - -_详细信息请查看 message 中查看_ - -| 模块 | 模块码 | 错误代码 | 错误信息 | -| :----: | :----: | :------: | :---------------------: | -| 验证码 | 100 | 01 | (10001)验证码生成失败 | -| | | 02 | (10002)验证码校验失败 | -| | | 03 | (10003)验证码刷新失败 | +

+文档已移至 uni-captcha文档 +

\ No newline at end of file diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a60ce88613704bc7fe02dbff52043c3757a0c9d7 Binary files /dev/null and b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf differ diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js index 241fb67add560da76cd4d2cae99a060af56cb001..fe2692aed61362fefaeb8814e032f8a1e3fabeb6 100644 --- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js @@ -1 +1 @@ -"use strict";var t,e=(t=require("fs"))&&"object"==typeof t&&"default"in t?t.default:t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.font16x32=e.font12x24=e.font8x16=void 0;var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";e.font8x16={w:8,h:16,fonts:n,data:[[0,0,0,0,0,0,0,60,66,30,34,66,66,63,0,0],[0,0,0,192,64,64,64,88,100,66,66,66,100,88,0,0],[0,0,0,0,0,0,0,28,34,64,64,64,34,28,0,0],[0,0,0,6,2,2,2,30,34,66,66,66,38,27,0,0],[0,0,0,0,0,0,0,60,66,126,64,64,66,60,0,0],[0,0,0,15,17,16,16,126,16,16,16,16,16,124,0,0],[0,0,0,0,0,0,0,62,68,68,56,64,60,66,66,60],[0,0,0,192,64,64,64,92,98,66,66,66,66,231,0,0],[0,0,0,48,48,0,0,112,16,16,16,16,16,124,0,0],[0,0,0,12,12,0,0,28,4,4,4,4,4,4,68,120],[0,0,0,192,64,64,64,78,72,80,104,72,68,238,0,0],[0,0,0,112,16,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,0,0,0,0,254,73,73,73,73,73,237,0,0],[0,0,0,0,0,0,0,220,98,66,66,66,66,231,0,0],[0,0,0,0,0,0,0,60,66,66,66,66,66,60,0,0],[0,0,0,0,0,0,0,216,100,66,66,66,68,120,64,224],[0,0,0,0,0,0,0,30,34,66,66,66,34,30,2,7],[0,0,0,0,0,0,0,238,50,32,32,32,32,248,0,0],[0,0,0,0,0,0,0,62,66,64,60,2,66,124,0,0],[0,0,0,0,0,16,16,124,16,16,16,16,16,12,0,0],[0,0,0,0,0,0,0,198,66,66,66,66,70,59,0,0],[0,0,0,0,0,0,0,231,66,36,36,40,16,16,0,0],[0,0,0,0,0,0,0,215,146,146,170,170,68,68,0,0],[0,0,0,0,0,0,0,110,36,24,24,24,36,118,0,0],[0,0,0,0,0,0,0,231,66,36,36,40,24,16,16,224],[0,0,0,0,0,0,0,126,68,8,16,16,34,126,0,0],[0,0,0,16,16,24,40,40,36,60,68,66,66,231,0,0],[0,0,0,248,68,68,68,120,68,66,66,66,68,248,0,0],[0,0,0,62,66,66,128,128,128,128,128,66,68,56,0,0],[0,0,0,248,68,66,66,66,66,66,66,66,68,248,0,0],[0,0,0,252,66,72,72,120,72,72,64,66,66,252,0,0],[0,0,0,252,66,72,72,120,72,72,64,64,64,224,0,0],[0,0,0,60,68,68,128,128,128,142,132,68,68,56,0,0],[0,0,0,231,66,66,66,66,126,66,66,66,66,231,0,0],[0,0,0,124,16,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,62,8,8,8,8,8,8,8,8,8,8,136,240],[0,0,0,238,68,72,80,112,80,72,72,68,68,238,0,0],[0,0,0,224,64,64,64,64,64,64,64,64,66,254,0,0],[0,0,0,238,108,108,108,108,84,84,84,84,84,214,0,0],[0,0,0,199,98,98,82,82,74,74,74,70,70,226,0,0],[0,0,0,56,68,130,130,130,130,130,130,130,68,56,0,0],[0,0,0,252,66,66,66,66,124,64,64,64,64,224,0,0],[0,0,0,56,68,130,130,130,130,130,178,202,76,56,6,0],[0,0,0,252,66,66,66,124,72,72,68,68,66,227,0,0],[0,0,0,62,66,66,64,32,24,4,2,66,66,124,0,0],[0,0,0,254,146,16,16,16,16,16,16,16,16,56,0,0],[0,0,0,231,66,66,66,66,66,66,66,66,66,60,0,0],[0,0,0,231,66,66,68,36,36,40,40,24,16,16,0,0],[0,0,0,214,146,146,146,146,170,170,108,68,68,68,0,0],[0,0,0,231,66,36,36,24,24,24,36,36,66,231,0,0],[0,0,0,238,68,68,40,40,16,16,16,16,16,56,0,0],[0,0,0,126,132,4,8,8,16,32,32,66,66,252,0,0],[0,0,0,24,36,66,66,66,66,66,66,66,36,24,0,0],[0,0,0,16,112,16,16,16,16,16,16,16,16,124,0,0],[0,0,0,60,66,66,66,4,4,8,16,32,66,126,0,0],[0,0,0,60,66,66,4,24,4,2,2,66,68,56,0,0],[0,0,0,4,12,20,36,36,68,68,126,4,4,30,0,0],[0,0,0,126,64,64,64,88,100,2,2,66,68,56,0,0],[0,0,0,28,36,64,64,88,100,66,66,66,36,24,0,0],[0,0,0,126,68,68,8,8,16,16,16,16,16,16,0,0],[0,0,0,60,66,66,66,36,24,36,66,66,66,60,0,0],[0,0,0,24,36,66,66,66,38,26,2,2,36,56,0,0]]},e.font12x24={w:12,h:24,fonts:n,data:[[0,0,0,0,0,0,0,0,0,0,15,48,48,7,28,48,96,96,96,113,62,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,208,240,0,0,0],[0,0,0,0,16,112,48,48,48,48,51,60,56,48,48,48,48,48,48,56,47,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,96,64,192,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,49,49,97,96,96,96,96,48,48,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,64,64,128,0,0,0,0],[0,0,0,0,0,1,0,0,0,0,30,49,48,96,96,96,96,96,32,49,30,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,192,192,192,192,192,224,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,7,24,16,48,63,48,48,48,24,28,7,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,224,0,0,0,32,64,128,0,0,0],[0,0,0,0,0,3,6,12,12,12,127,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0,0,0,0,192,96,96,0,0,192,0,0,0,0,0,0,0,0,0,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,25,48,48,48,25,31,48,62,31,96,96,112,31,0,0,0,0,0,0,0,0,0,0,112,144,192,192,192,128,0,0,0,192,96,96,224,128],[0,0,0,0,16,112,48,48,48,48,55,56,48,48,48,48,48,48,48,48,121,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,192,224,0,0,0],[0,0,0,0,0,6,6,0,0,0,62,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,1,1,0,0,0,15,1,1,1,1,1,1,1,1,1,1,1,51,62,0,0,0,0,0,128,128,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,0,0],[0,0,0,0,16,112,48,48,48,48,51,49,51,50,54,62,59,51,49,49,121,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,128,128,224,0,0,0],[0,0,0,0,2,62,6,6,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,0,0,0,0,0,238,119,102,102,102,102,102,102,102,102,247,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,96,96,96,96,96,96,96,96,112,0,0,0],[0,0,0,0,0,0,0,0,0,0,115,60,48,48,48,48,48,48,48,48,121,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,192,192,192,192,192,192,192,192,224,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,25,48,96,96,96,96,96,48,48,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,192,192,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,119,56,48,48,48,48,48,48,48,56,55,48,48,124,0,0,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,96,192,192,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,30,49,48,96,96,96,96,96,32,49,30,0,0,3,0,0,0,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,192,192,192,224],[0,0,0,0,0,0,0,0,0,0,249,26,28,24,24,24,24,24,24,24,255,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,15,24,48,48,28,15,1,32,32,48,63,0,0,0,0,0,0,0,0,0,0,0,0,0,224,96,32,0,0,128,192,96,96,192,128,0,0,0],[0,0,0,0,0,0,4,4,12,12,127,12,12,12,12,12,12,12,12,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,64,64,128,0,0,0],[0,0,0,0,0,0,0,0,0,16,113,48,48,48,48,48,48,48,48,57,30,0,0,0,0,0,0,0,0,0,0,0,0,64,192,192,192,192,192,192,192,192,192,224,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,124,56,24,24,12,12,12,7,7,7,2,0,0,0,0,0,0,0,0,0,0,0,0,0,240,96,64,64,128,128,128,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,247,99,99,103,55,53,57,57,57,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,176,32,32,32,32,192,192,192,192,128,128,0,0,0],[0,0,0,0,0,0,0,0,0,0,125,24,25,13,14,6,7,11,25,17,123,0,0,0,0,0,0,0,0,0,0,0,0,0,224,128,128,0,0,0,0,0,128,192,224,0,0,0],[0,0,0,0,0,0,0,0,0,0,125,56,24,24,13,13,13,6,6,2,4,4,40,56,0,0,0,0,0,0,0,0,0,0,224,128,128,128,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,63,33,35,3,7,6,14,12,28,24,63,0,0,0,0,0,0,0,0,0,0,0,0,0,192,128,128,0,0,0,0,32,32,96,192,0,0,0],[0,0,0,0,0,6,6,14,11,11,19,17,17,17,31,32,32,32,32,96,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,192,192,192,96,96,240,0,0,0],[0,0,0,0,0,255,97,96,96,96,96,97,127,96,96,96,96,96,96,96,255,0,0,0,0,0,0,0,0,0,128,192,192,192,192,128,0,192,64,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,7,24,48,48,32,96,96,96,96,96,96,96,48,48,24,15,0,0,0,0,0,0,0,0,224,96,32,32,0,0,0,0,0,0,0,32,32,64,128,0,0,0,0],[0,0,0,0,0,254,97,96,96,96,96,96,96,96,96,96,96,96,96,99,254,0,0,0,0,0,0,0,0,0,128,192,192,96,96,96,96,96,96,96,96,192,192,128,0,0,0,0],[0,0,0,0,0,255,96,96,96,96,97,97,127,97,97,96,96,96,96,96,255,0,0,0,0,0,0,0,0,192,64,32,0,0,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,255,96,96,96,96,97,97,127,97,97,96,96,96,96,96,240,0,0,0,0,0,0,0,0,192,192,32,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,15,24,48,48,32,96,96,96,96,99,96,96,48,48,24,15,0,0,0,0,0,0,0,0,64,192,64,64,0,0,0,0,0,240,192,192,192,192,192,0,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,127,96,96,96,96,96,96,96,240,0,0,0,0,0,0,0,0,240,96,96,96,96,96,96,224,96,96,96,96,96,96,96,240,0,0,0],[0,0,0,0,0,63,6,6,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,15,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,97,99,62,0,0,0,0,0,240,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,0,0],[0,0,0,0,0,243,96,97,98,98,100,108,124,118,103,99,99,97,96,96,241,0,0,0,0,0,0,0,0,224,128,0,0,0,0,0,0,0,0,0,128,128,192,224,240,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,96,96,96,96,96,96,96,96,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,240,112,112,112,89,89,89,89,90,78,78,78,78,68,68,228,0,0,0,0,0,0,0,0,240,224,224,224,96,96,96,96,96,96,96,96,96,96,96,240,0,0,0],[0,0,0,0,0,224,112,112,88,88,76,70,70,67,67,65,64,64,64,64,224,0,0,0,0,0,0,0,0,112,32,32,32,32,32,32,32,32,32,160,224,224,96,96,32,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,96,48,48,25,15,0,0,0,0,0,0,0,0,0,128,192,64,96,96,96,96,96,96,96,96,64,192,128,0,0,0,0],[0,0,0,0,0,255,96,96,96,96,96,96,96,127,96,96,96,96,96,96,240,0,0,0,0,0,0,0,0,128,192,96,96,96,96,96,192,128,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,110,50,49,17,15,1,0,0,0,0,0,0,0,0,128,192,64,96,96,96,96,96,96,96,96,64,192,128,128,224,192,0],[0,0,0,0,0,255,96,96,96,96,96,96,127,102,99,99,97,97,96,96,240,0,0,0,0,0,0,0,0,128,192,96,96,96,96,192,0,0,0,0,128,128,192,192,112,0,0,0],[0,0,0,0,0,31,48,96,96,96,112,60,15,3,0,0,64,64,96,112,79,0,0,0,0,0,0,0,0,32,224,32,32,0,0,0,0,192,192,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,127,70,134,134,6,6,6,6,6,6,6,6,6,6,6,15,0,0,0,0,0,0,0,0,224,32,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,240,96,96,96,96,96,96,96,96,96,96,96,96,96,48,31,0,0,0,0,0,0,0,0,112,32,32,32,32,32,32,32,32,32,32,32,32,32,64,128,0,0,0],[0,0,0,0,0,248,112,48,48,48,48,24,24,24,24,13,13,13,15,6,6,0,0,0,0,0,0,0,0,240,96,64,64,64,128,128,128,128,128,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,247,102,102,102,102,103,55,55,59,59,59,59,57,17,17,17,0,0,0,0,0,0,0,0,112,32,32,64,64,64,64,64,128,128,128,128,128,0,0,0,0,0,0],[0,0,0,0,0,121,48,24,24,25,13,14,6,6,7,11,11,25,17,48,121,0,0,0,0,0,0,0,0,224,192,128,128,0,0,0,0,0,0,0,128,128,128,192,224,0,0,0],[0,0,0,0,0,248,112,48,48,24,24,13,13,14,6,6,6,6,6,6,31,0,0,0,0,0,0,0,0,240,96,64,128,128,128,0,0,0,0,0,0,0,0,0,128,0,0,0],[0,0,0,0,0,63,32,65,1,3,3,3,6,6,12,12,24,24,56,48,127,0,0,0,0,0,0,0,0,224,192,192,128,128,0,0,0,0,0,0,0,32,32,64,192,0,0,0],[0,0,0,0,0,15,25,48,48,96,96,96,96,96,96,96,96,48,48,25,15,0,0,0,0,0,0,0,0,0,128,192,192,96,96,96,96,96,96,96,96,192,192,128,0,0,0,0],[0,0,0,0,0,2,6,62,6,6,6,6,6,6,6,6,6,6,6,6,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0],[0,0,0,0,0,31,33,64,96,96,0,1,1,3,4,8,16,32,64,127,127,0,0,0,0,0,0,0,0,0,128,192,192,192,192,128,128,0,0,0,64,64,64,192,192,0,0,0],[0,0,0,0,0,30,35,97,97,97,1,3,14,1,0,0,96,96,96,33,31,0,0,0,0,0,0,0,0,0,0,128,128,128,128,0,0,128,128,192,192,192,192,128,0,0,0,0],[0,0,0,0,0,1,3,3,5,9,9,17,33,33,65,127,1,1,1,1,7,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,224,128,128,128,128,224,0,0,0],[0,0,0,0,0,63,63,32,32,32,32,47,49,32,0,0,96,96,65,33,31,0,0,0,0,0,0,0,0,192,192,0,0,0,0,0,128,192,192,192,192,192,128,128,0,0,0,0],[0,0,0,0,0,7,24,48,48,32,96,103,104,112,96,96,96,32,48,24,15,0,0,0,0,0,0,0,0,128,192,192,0,0,0,128,192,96,96,96,96,96,64,192,0,0,0,0],[0,0,0,0,0,31,63,48,32,32,0,1,1,2,2,2,6,6,6,6,6,0,0,0,0,0,0,0,0,224,224,64,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,31,48,96,96,96,112,60,15,51,32,96,96,96,96,48,15,0,0,0,0,0,0,0,0,128,192,96,96,96,64,192,0,128,192,96,96,96,96,192,128,0,0,0],[0,0,0,0,0,15,48,48,96,96,96,96,96,49,30,0,0,0,48,49,30,0,0,0,0,0,0,0,0,0,128,192,64,96,96,96,224,96,96,96,192,192,128,128,0,0,0,0]]},e.font16x32={w:16,h:32,fonts:n,data:[[0,0,0,0,0,0,0,0,0,0,0,0,0,15,24,48,48,0,1,14,56,48,96,96,96,48,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,96,48,48,48,240,48,48,48,48,48,50,242,28,0,0,0,0,0],[0,0,0,0,0,8,120,24,24,24,24,24,24,24,27,28,28,24,24,24,24,24,24,24,28,30,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,6,6,6,6,6,6,6,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,24,24,48,48,48,48,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,48,24,24,24,0,0,0,0,4,4,8,16,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,7,12,24,24,48,48,48,48,48,48,16,24,12,7,0,0,0,0,0,0,0,0,0,0,8,120,24,24,24,24,24,24,216,56,24,24,24,24,24,24,24,24,24,56,94,144,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,24,16,48,48,63,48,48,48,24,24,14,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,48,24,8,12,12,252,0,0,0,4,8,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,3,3,3,3,63,3,3,3,3,3,3,3,3,3,3,3,3,31,0,0,0,0,0,0,0,0,0,0,0,124,195,3,3,0,0,0,248,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,8,24,24,24,8,12,15,24,24,15,15,16,48,48,48,28,7,0,0,0,0,0,0,0,0,0,0,0,0,0,238,54,24,24,24,24,24,48,224,0,0,240,252,14,6,6,6,28,240],[0,0,0,0,0,8,120,24,24,24,24,24,24,25,27,28,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,12,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,0,192,192,192,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,24,15,0,0,0,0,0,0,28,28,28,0,0,0,8,248,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,48,96,192],[0,0,0,0,0,8,120,24,24,24,24,24,24,24,24,24,24,24,25,27,28,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,48,96,192,128,128,128,192,224,96,48,56,24,62,0,0,0,0,0],[0,0,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,16,119,57,49,49,49,49,49,49,49,49,49,49,49,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,204,140,140,140,140,140,140,140,140,140,140,140,222,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,120,27,28,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,12,12,12,12,12,12,12,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,8,24,48,48,48,48,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,56,12,12,6,6,6,6,6,6,12,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,121,26,28,24,24,24,24,24,24,24,24,28,30,25,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,0,0,240,24,12,4,6,6,6,6,6,6,12,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,3,12,24,24,48,48,48,48,48,48,16,24,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,60,28,12,12,12,12,12,12,12,12,28,60,204,12,12,12,12,63],[0,0,0,0,0,0,0,0,0,0,0,0,6,126,6,6,7,7,6,6,6,6,6,6,6,6,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,102,134,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,7,12,24,24,24,14,7,1,0,32,32,48,56,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,0,0,192,240,56,12,12,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,1,1,1,3,7,63,3,3,3,3,3,3,3,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,0,0,0,0,0,0,0,0,4,4,136,240,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,120,24,24,24,24,24,24,24,24,24,24,24,12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,60,12,12,12,12,12,12,12,12,12,12,28,47,200,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,126,24,24,28,12,12,14,6,6,7,3,3,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,24,16,16,32,32,64,64,64,128,128,128,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,251,113,48,49,49,25,25,26,26,14,14,14,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,198,196,196,196,200,200,104,104,112,112,112,32,32,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,63,14,14,7,3,3,1,1,2,6,4,8,24,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,16,32,32,64,128,192,192,224,96,48,48,24,126,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,126,24,24,12,12,12,6,6,3,3,3,1,1,1,1,1,1,50,60,0,0,0,0,0,0,0,0,0,0,0,0,0,62,24,16,16,16,32,32,32,64,64,64,128,128,128,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,63,48,32,32,0,1,1,3,7,14,12,28,56,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,48,112,96,192,192,128,0,0,4,4,12,24,248,0,0,0,0,0],[0,0,0,0,0,0,3,3,3,2,6,4,4,4,12,8,8,8,31,16,16,16,48,32,32,96,248,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,192,192,192,192,96,96,96,96,240,48,48,48,48,24,24,24,62,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,224,56,28,12,12,12,12,24,48,224,24,12,4,6,6,6,6,6,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,3,6,8,24,48,48,32,96,96,96,96,96,96,96,96,48,48,48,24,12,3,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,2,2,0,0,0,0,0,0,0,0,0,2,2,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,192,112,24,12,12,12,6,6,6,6,6,6,6,6,6,12,12,8,24,112,192,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,252,12,4,6,2,0,16,16,48,240,48,16,16,0,0,0,2,2,4,12,252,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,254,14,2,3,1,0,8,8,24,248,24,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,3,14,8,24,48,48,32,96,96,96,96,96,96,96,96,48,48,24,24,12,3,0,0,0,0,0,0,0,0,0,0,0,200,56,8,8,4,4,0,0,0,0,0,0,63,12,12,12,12,12,12,16,224,0,0,0,0,0],[0,0,0,0,0,0,252,48,48,48,48,48,48,48,48,48,63,48,48,48,48,48,48,48,48,48,252,0,0,0,0,0,0,0,0,0,0,0,126,24,24,24,24,24,24,24,24,24,248,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0],[0,0,0,0,0,0,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,31,0,0,0,0,0,0,0,0,0,0,0,248,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,248,0,0,0,0,0],[0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,112,113,63,0,0,0,0,0,0,254,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,192,128,0],[0,0,0,0,0,0,126,24,24,24,24,24,24,25,25,27,29,28,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,62,24,16,32,96,64,128,128,128,128,192,192,224,96,112,48,56,24,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,126,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,4,12,252,0,0,0,0,0],[0,0,0,0,0,0,248,56,56,56,56,44,44,44,44,46,38,38,38,38,35,35,35,35,35,33,249,0,0,0,0,0,0,0,0,0,0,0,31,28,28,28,60,44,44,44,108,76,76,76,76,140,140,140,140,12,12,12,63,0,0,0,0,0],[0,0,0,0,0,0,248,56,60,44,44,46,38,39,35,35,33,33,32,32,32,32,32,32,32,32,248,0,0,0,0,0,0,0,0,0,0,0,62,8,8,8,8,8,8,8,8,136,136,200,200,232,104,120,56,56,56,24,24,0,0,0,0,0],[0,0,0,0,0,0,3,12,24,16,48,48,96,96,96,96,96,96,96,96,96,48,48,16,24,12,3,0,0,0,0,0,0,0,0,0,0,0,192,48,24,8,12,12,6,6,6,6,6,6,6,6,6,4,12,8,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,24,31,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,240,24,12,6,6,6,6,6,12,24,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,3,12,24,48,48,48,96,96,96,96,96,96,96,96,96,39,52,56,24,12,3,0,0,0,0,0,0,0,0,0,0,0,192,48,24,8,12,4,6,6,6,6,6,6,6,6,6,134,204,76,104,112,224,50,62,28,0,0],[0,0,0,0,0,0,127,24,24,24,24,24,24,24,24,31,25,24,24,24,24,24,24,24,24,24,126,0,0,0,0,0,0,0,0,0,0,0,224,56,28,12,12,12,12,24,48,224,192,192,224,96,96,112,48,48,56,24,30,0,0,0,0,0],[0,0,0,0,0,0,7,12,24,48,48,48,48,24,30,7,1,0,0,0,0,32,32,16,24,28,19,0,0,0,0,0,0,0,0,0,0,0,228,28,12,4,4,0,0,0,0,192,240,120,28,14,6,6,6,6,12,24,240,0,0,0,0,0],[0,0,0,0,0,0,63,49,33,65,65,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0,252,132,134,130,130,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,224,0,0,0,0,0],[0,0,0,0,0,0,252,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,16,28,7,0,0,0,0,0,0,0,0,0,0,0,62,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,32,192,0,0,0,0,0],[0,0,0,0,0,0,124,24,24,24,12,12,12,12,6,6,6,7,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,31,4,4,4,8,8,8,8,16,16,16,48,32,32,32,192,192,192,192,128,128,0,0,0,0,0],[0,0,0,0,0,0,251,97,97,97,49,48,49,49,49,49,50,26,26,26,28,28,28,12,8,8,8,0,0,0,0,0,0,0,0,0,0,0,207,134,132,132,132,132,196,200,200,200,200,72,104,112,112,112,112,48,32,32,32,0,0,0,0,0],[0,0,0,0,0,0,126,24,28,12,12,14,6,7,3,3,1,1,2,2,4,4,8,8,16,16,124,0,0,0,0,0,0,0,0,0,0,0,124,16,16,32,32,64,64,128,128,128,128,192,192,224,96,96,48,48,24,24,62,0,0,0,0,0],[0,0,0,0,0,0,126,56,24,24,12,12,14,6,6,3,3,3,1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0,62,8,8,16,16,48,32,32,64,64,64,128,128,128,128,128,128,128,128,128,224,0,0,0,0,0],[0,0,0,0,0,0,31,24,16,32,32,0,0,0,1,1,3,3,7,6,14,12,28,24,56,48,127,0,0,0,0,0,0,0,0,0,0,0,252,24,24,48,112,96,224,192,192,128,128,0,0,0,0,0,4,4,8,24,248,0,0,0,0,0],[0,0,0,0,0,0,3,6,12,24,24,24,48,48,48,48,48,48,48,48,48,24,24,24,12,6,3,0,0,0,0,0,0,0,0,0,0,0,224,48,24,12,12,4,6,6,6,6,6,6,6,6,6,4,12,12,24,48,224,0,0,0,0,0],[0,0,0,0,0,0,0,1,31,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,31,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,192,248,0,0,0,0,0],[0,0,0,0,0,0,7,8,16,32,32,48,48,0,0,0,0,0,0,1,2,4,8,16,32,63,63,0,0,0,0,0,0,0,0,0,0,0,224,56,24,12,12,12,12,12,24,16,32,64,128,0,0,4,4,4,12,248,248,0,0,0,0,0],[0,0,0,0,0,0,7,24,48,48,48,48,0,0,0,3,0,0,0,0,0,48,48,48,48,24,7,0,0,0,0,0,0,0,0,0,0,0,192,112,48,24,24,24,24,48,96,192,112,24,8,12,12,12,12,8,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,1,1,2,6,4,8,8,16,32,32,127,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,48,112,112,240,112,112,112,112,112,112,112,112,112,112,254,112,112,112,112,112,112,254,0,0,0,0],[0,0,0,0,0,0,15,15,8,8,8,16,16,19,20,24,16,0,0,0,0,48,48,32,32,16,15,0,0,0,0,0,0,0,0,0,0,0,252,252,0,0,0,0,0,224,48,24,8,12,12,12,12,12,12,24,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,1,3,4,8,24,24,16,48,49,54,60,56,48,48,48,48,24,24,12,6,3,0,0,0,0,0,0,0,0,0,0,0,240,8,12,12,0,0,0,0,240,24,12,6,6,6,6,6,6,4,12,24,224,0,0,0,0,0],[0,0,0,0,0,0,31,31,56,48,32,32,0,0,0,0,0,0,1,1,1,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,252,252,8,16,16,32,32,64,64,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,7,12,24,48,48,48,56,28,14,7,13,24,48,96,96,96,96,96,48,24,7,0,0,0,0,0,0,0,0,0,0,0,224,48,24,12,12,12,12,24,16,224,224,112,56,28,12,12,12,12,24,48,192,0,0,0,0,0],[0,0,0,0,0,0,7,24,48,48,96,96,96,96,96,96,48,24,15,0,0,0,0,48,48,48,15,0,0,0,0,0,0,0,0,0,0,0,192,32,16,24,8,12,12,12,12,28,60,108,140,12,24,24,24,48,96,192,128,0,0,0,0,0]]}}));r(i);i.font16x32,i.font12x24,i.font8x16;var a=o((function(t,r){var o=n&&n.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},a=n&&n.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]>16&255,green:n>>8&255,blue:255&n})},t.prototype.drawPointRGB=function(t,e,n){if(!(t>=this.w||e>=this.h||t<0||e<0)){var r=this.h-e-1,o=54+3*t+this._lineByteNum*r;this._data.writeUInt8(n.blue,o),this._data.writeUInt8(n.green,o+1),this._data.writeUInt8(n.red,o+2)}},t.prototype.getPointRGB=function(t,e){if(t>=this.w||e>=this.h||t<0||e<0)throw new Error("out of range");var n=this.h-e-1,r=54+3*t+this._lineByteNum*n;return{blue:this._data.readUInt8(r),green:this._data.readUInt8(r+1),red:this._data.readUInt8(r+2)}},t.prototype.drawLineH=function(t,e,n,r){if(t>e){var o=e;e=t,t=o}for(;t<=e;t++)this.drawPoint(t,n,r)},t.prototype.drawLineV=function(t,e,n,r){if(t>e){var o=e;e=t,t=o}for(;t<=e;t++)this.drawPoint(n,t,r)},t.prototype.drawLine=function(t,e,n,r,o){var i=t,a=e,c=n>t?n-t:t-n,s=r>e?r-e:e-r,d=!1,f=n>t?1:-1,u=r>e?1:-1;if(s>c){var h=c;c=s,s=h,d=!0}for(var l=(s<<1)-c,w=0;w<=c;w++)this.drawPoint(i,a,o),l>=0&&(d?i+=f:a+=u,l-=c<<1),d?a+=u:i+=f,l+=s<<1},t.prototype.drawRect=function(t,e,n,r,o){var i=t+n-1,a=e+r-1;this.drawLineH(t,i,e,o),this.drawLineH(t,i,a,o),this.drawLineV(e,a,t,o),this.drawLineV(e,a,i,o)},t.prototype.fillRect=function(t,e,n,r,o){var i=t+n-1,a=e+r-1;if(t>i){var c=i;i=t,t=c}if(e>a){c=a;a=e,e=c}for(;e<=a;e++)for(var s=t;s<=i;s++)this.drawPoint(s,e,o)},t.prototype.drawCircle=function(t,e,n,r){for(var o=0,i=n,a=3-2*n;o0;f<<=1)128&f&&this.drawPoint(c,a,o),c++;++a-n>=r.h&&(a=n,e+=8)}},t.prototype.drawString=function(t,e,n,r,o){for(var i=0,a=t;i(t.includes(r)&&n.push(e[r]),n),[]);return n[Math.random()*n.length|0]}function u(t={}){const e=["small","medium","big"],n={backgroundColor:16775912,size:4,noise:4,width:100,height:40,fontSize:["medium","big"]};let{backgroundColor:r,size:o,noise:i,width:a,height:s,fontSize:f}=Object.assign({},n,t);"string"==typeof r&&(r=r.replace("#","0x")),f instanceof Array||(f=[]),f.filter(t=>e.includes(t)),f.length||(f=n.fontSize),o=o>6?6:o;const u=new c(a,s);u.fillRect(0,0,a,s,r),function(t,e){for(let n=1;n>16,r=e>>8&255,o=255&e,i=Math.max(n,r,o),a=Math.min(n,r,o);return(i+a)/510}(t):1;let o,i;r>=.5?(o=Math.round(100*r)-45,i=Math.round(100*r)-25):(o=Math.round(100*r)+25,i=Math.round(100*r)+45);const a=h(o,i)/100,c=a<.5?a*(a+n):a+n-a*n,s=2*a-c,d=Math.floor(255*w(s,c,e+1/3)),f=Math.floor(255*w(s,c,e));return"#"+(Math.floor(255*w(s,c,e-1/3))|f<<8|d<<16|1<<24).toString(16).slice(1)};function w(t,e,n){return 6*(n=(n+1)%1)<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}const p=Object.prototype.toString;function g(t){return"[object Object]"===p.call(t)}function y(){"development"===process.env.NODE_ENV&&console.log(...arguments)}const v=async function(){};function m(t){return v.constructor===t.constructor?async function(){const e=await t.apply(this,arguments);return g(e)&&e.msg&&(e.message=e.msg),e}:function(){const e=t.apply(this,arguments);return g(e)&&e.msg&&(e.message=e.msg),e}}const b=uniCloud.database().collection("opendb-verify-codes"),_={};var I=Object.freeze({__proto__:null,create:async function(t={}){let{scene:e,expiresDate:n,deviceId:r,...o}=t;if(r=r||__ctx__.DEVICEID,!r)throw new Error("deviceId不可为空");if(!e)throw new Error("scene验证码场景不可为空");try{const{text:i,base64:a}=u(o),c=await this.setVerifyCode({deviceId:r,code:i,expiresDate:n,scene:e});return c.code>0?{...c,code:10001}:(_[r]=t,{code:0,msg:"验证码获取成功",captchaBase64:a})}catch(t){return{code:10001,msg:"验证码生成失败:"+t.message}}},verify:async function({deviceId:t,captcha:e,scene:n}){if(!(t=t||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");try{const r=await this.verifyCode({deviceId:t,code:e,scene:n});return r.code>0?{...r,code:10002}:{code:0,msg:"验证码通过"}}catch(t){return{code:10002,msg:"验证码校验失败:"+t.message}}},refresh:async function(t={}){let{scene:e,expiresDate:n,deviceId:r,...o}=t;if(r=r||__ctx__.DEVICEID,!r)throw new Error("deviceId不可为空");if(!e)throw new Error("scene验证码场景不可为空");const i=await b.where({deviceId:r,scene:e}).orderBy("created_date","desc").limit(1).get();if(i&&i.data&&i.data.length>0){const t=i.data[0];await b.doc(t._id).update({state:2});let a={};Object.keys(o).length>0&&(_[r]=Object.assign({},_[r],o)),a=_[r];let c={};try{c=await this.create(Object.assign({},a,{deviceId:r,scene:e,expiresDate:n}))}catch(t){return{code:50403,msg:t.message}}return c.code>0?{...c,code:10003}:{code:0,msg:"验证码刷新成功",captchaBase64:c.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在${e}场景信息,请重新获取`}},setVerifyCode:async function({deviceId:t,code:e,expiresDate:n,scene:r}){if(!t)return{code:10101,msg:"deviceId不可为空"};if(!e)return{code:10102,msg:"验证码不可为空"};n||(n=180);const o=Date.now(),i={deviceId:t,scene:r,code:e.toLocaleLowerCase(),state:0,ip:__ctx__.CLIENTIP,created_date:o,expired_date:o+1e3*n};return y("addRes",await b.add(i)),{code:0,deviceId:t}},verifyCode:async function({deviceId:t,code:e,scene:n}){if(!t)return{code:10101,msg:"deviceId不可为空"};if(!e)return{code:10102,msg:"验证码不可为空"};const r=Date.now(),o={deviceId:t,scene:n,code:e.toLocaleLowerCase(),state:0},i=await b.where(o).orderBy("created_date","desc").limit(1).get();if(y("verifyRecord:",i),i&&i.data&&i.data.length>0){const t=i.data[0];if(t.expired_date=1)throw RangeError("spliteCurveAt requires position > 0 && position < 1");return u=[],p=0,i={},l={},c={},i.x=t,i.y=n,l.x=o,l.y=s,c.x=r,c.y=a,h=e,u[p++]=i.x,u[p++]=i.y,u[p++]=i.x+=(l.x-i.x)*h,u[p++]=i.y+=(l.y-i.y)*h,l.x+=(c.x-l.x)*h,l.y+=(c.y-l.y)*h,u[p++]=i.x+(l.x-i.x)*h,u[p++]=i.y+(l.y-i.y)*h,u[p++]=l.x,u[p++]=l.y,u[p++]=c.x,u[p++]=c.y,u}function i(e,t){return Math.random()*(t-e)+e}var l=function(e,t){const n=e[0];o.default(n,"expect a string");const s=t.fontSize,l=s/t.font.unitsPerEm,c=t.font.charToGlyph(n),u=c.advanceWidth?c.advanceWidth*l:0,p=t.x-u/2,h=(t.ascender+t.descender)*l,f=t.y+h/2,d=c.getPath(p,f,s);d.commands.forEach(r),d.commands=function(e,t){const n=[];for(let o=0;ot.truncateLineProbability){const e=i(-.1,.1);n.push(s),n.push({type:"L",x:(s.x+r.x)/2+e,y:(s.y+r.y)/2+e})}else n.push(s)}else if("Q"===s.type&&o>=1){const r=e[o-1];if(("L"===r.type||"M"===r.type)&&Math.random()>t.truncateCurveProbability){const e=r.x,o=r.y,l=i(-.1,.1),c=s.x1+l,u=s.y1+l,p=s.x+l,h=s.y+l,f=a(i(t.truncateCurvePositionMin,t.truncateCurvePositionMax),e,o,c,u,p,h),d={type:"Q",x1:f[2],y1:f[3],x:f[4],y:f[5]},g={type:"L",x:f[4],y:f[5]},m={type:"Q",x1:f[6],y1:f[7],x:f[8],y:f[9]},y={type:"L",x:f[8],y:f[9]};n.push(d),n.push(g),n.push(m),n.push(y)}}else n.push(s)}return n}(d.commands,t);return d.toPathData()};function c(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function u(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new c,this.dtree=new c}var p=new c,h=new c,f=new Uint8Array(30),d=new Uint16Array(30),g=new Uint8Array(30),m=new Uint16Array(30),y=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),v=new c,b=new Uint8Array(320);function S(e,t,n,o){var s,r;for(s=0;s>>=1,t}function E(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,o+n}function O(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++s,n+=t.table[s],o-=t.table[s]}while(o>=0);return e.tag=r,e.bitcount-=s,t.trans[n+o]}function w(e,t,n){var o,s,r,a,i,l;for(o=E(e,5,257),s=E(e,5,1),r=E(e,4,4),a=0;a<19;++a)b[a]=0;for(a=0;a8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(p,h),S(f,d,4,3),S(g,m,2,1),f[28]=0,d[28]=258;var D=function(e,t){var n,o,s=new u(e,t);do{switch(n=T(s),E(s,2,0)){case 0:o=R(s);break;case 1:o=k(s,p,h);break;case 2:w(s,s.ltree,s.dtree),o=k(s,s.ltree,s.dtree);break;default:o=-3}if(0!==o)throw new Error("Data error")}while(!n);return s.destLenthis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},L.prototype.addX=function(e){this.addPoint(e,null)},L.prototype.addY=function(e){this.addPoint(null,e)},L.prototype.addBezier=function(e,t,n,o,s,r,a,i){const l=[e,t],c=[n,o],u=[s,r],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*c[e]+6*u[e],n=-3*l[e]+9*c[e]-9*u[e]+3*p[e],o=3*c[e]-3*l[e];if(0===n){if(0===t)continue;const n=-o/t;0=0&&n>0&&(e+=" "),e+=t(o)}return e}e=void 0!==e?e:2;let o="";for(let e=0;e=0&&e<=255,"Byte value should be between 0 and 255."),[e]},A.BYTE=F(1),P.CHAR=function(e){return[e.charCodeAt(0)]},A.CHAR=F(1),P.CHARARRAY=function(e){const t=[];for(let n=0;n>8&255,255&e]},A.USHORT=F(2),P.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=F(2),P.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=F(3),P.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=F(4),P.LONG=function(e){return e>=2147483648&&(e=-(4294967296-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=F(4),P.FIXED=P.ULONG,A.FIXED=A.ULONG,P.FWORD=P.SHORT,A.FWORD=A.SHORT,P.UFWORD=P.USHORT,A.UFWORD=A.USHORT,P.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=F(8),P.TAG=function(e){return G.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=F(4),P.Card8=P.BYTE,A.Card8=A.BYTE,P.Card16=P.USHORT,A.Card16=A.USHORT,P.OffSize=P.BYTE,A.OffSize=A.BYTE,P.SID=P.USHORT,A.SID=A.USHORT,P.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?P.NUMBER16(e):P.NUMBER32(e)},A.NUMBER=function(e){return P.NUMBER(e).length},P.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=F(3),P.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=F(5),P.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let o="";for(let e=0,n=t.length;e>8&255,t[t.length]=255&o}return t},A.UTF16=function(e){return 2*e.length};const H={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};N.MACSTRING=function(e,t,n,o){const s=H[o];if(void 0===s)return;let r="";for(let o=0;o=-128&&e<=127}function q(e,t,n){let o=0;const s=e.length;for(;t>8&255,t+256&255)}return r}P.MACSTRING=function(e,t){const n=function(e){if(!W){W={};for(let e in H)W[e]=new String(e)}const t=W[e];if(void 0===t)return;if(z){const e=z.get(t);if(void 0!==e)return e}const n=H[e];if(void 0===n)return;const o={};for(let e=0;e=128&&(s=n[s],void 0===s))return;o[t]=s}return o},A.MACSTRING=function(e,t){const n=P.MACSTRING(e,t);return void 0!==n?n.length:0},P.VARDELTAS=function(e){let t=0;const n=[];for(;t=-128&&o<=127?X(e,t,n):V(e,t,n)}return n},P.INDEX=function(e){let t=1;const n=[t],o=[];for(let s=0;s>8,t[r+1]=255&a,t=t.concat(o[n])}return t},A.TABLE=function(e){let t=0;const n=e.fields.length;for(let o=0;o0)return new le(this.data,this.offset+t).parseStruct(e)},le.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,o=this.relativeOffset,s=new Array(n);for(let o=0;o=0;s-=1){const n=ue.getUShort(e,t+4+8*s),r=ue.getUShort(e,t+4+8*s+2);if(3===n&&(0===r||1===r||10===r)){o=ue.getULong(e,t+4+8*s+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");const s=new ue.Parser(e,t+o);if(n.format=s.parseUShort(),12===n.format)!function(e,t){let n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(let o=0;o>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new ue.Parser(n,o+s+14),i=new ue.Parser(n,o+s+16+2*r),l=new ue.Parser(n,o+s+16+4*r),c=new ue.Parser(n,o+s+16+6*r);let u=o+s+16+8*r;for(let t=0;t0?(r=e.parseByte(),0==(t&s)&&(r=-r),r=n+r):r=(t&s)>0?n:n+e.parseShort(),r}function Te(e,t,n){const o=new ue.Parser(t,n);let s,r;if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),e.numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n0){const t=o.parseByte();for(let n=0;n0){const a=[];let i;if(n>0){for(let e=0;e=0,a.push(i);let e=0;for(let t=0;t0?(2&s)>0?(n.dx=o.parseShort(),n.dy=o.parseShort()):n.matchedPoints=[o.parseUShort(),o.parseUShort()]:(2&s)>0?(n.dx=o.parseChar(),n.dy=o.parseChar()):n.matchedPoints=[o.parseByte(),o.parseByte()],(8&s)>0?n.xScale=n.yScale=o.parseF2Dot14():(64&s)>0?(n.xScale=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()):(128&s)>0&&(n.xScale=o.parseF2Dot14(),n.scale01=o.parseF2Dot14(),n.scale10=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()),e.components.push(n),t=!!(32&s)}if(256&s){e.instructionLength=o.parseUShort(),e.instructions=[];for(let t=0;tt.points.length-1||o.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[o.matchedPoints[0]];let r=s.points[o.matchedPoints[1]];const a={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0};r=Ee([r],a)[0],a.dx=n.x-r.x,a.dy=n.y-r.y,e=Ee(s.points,a)}t.points=t.points.concat(e)}}return Oe(t.points)}var ke={getPath:Oe,parse:function(e,t,n,o){const s=new Le.GlyphSet(o);for(let r=0;r>4,r=15&o;if(15===s)break;if(t+=n[s],15===r)break;t+=n[r]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function Ne(e,t,n){t=void 0!==t?t:0;const o=new ue.Parser(e,t),s=[];let r=[];for(n=void 0!==n?n:e.length;o.relativeOffset>1,l.length=0,d=!0}return function n(p){let x,U,T,E,O,w,k,R,D,C,L,I,M=0;for(;M1&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),b(m,y);break;case 5:for(;l.length>0;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 6:for(;l.length>0&&(m+=l.shift(),i.lineTo(m,y),0!==l.length);)y+=l.shift(),i.lineTo(m,y);break;case 7:for(;l.length>0&&(y+=l.shift(),i.lineTo(m,y),0!==l.length);)m+=l.shift(),i.lineTo(m,y);break;case 8:for(;l.length>0;)o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a+l.shift(),i.curveTo(o,s,r,a,m,y);break;case 10:O=l.pop()+u,w=c[O],w&&n(w);break;case 11:return;case 12:switch(B=p[M],M+=1,B){case 35:o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),k=r+l.shift(),R=a+l.shift(),D=k+l.shift(),C=R+l.shift(),L=D+l.shift(),I=C+l.shift(),m=L+l.shift(),y=I+l.shift(),l.shift(),i.curveTo(o,s,r,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 34:o=m+l.shift(),s=y,r=o+l.shift(),a=s+l.shift(),k=r+l.shift(),R=a,D=k+l.shift(),C=a,L=D+l.shift(),I=y,m=L+l.shift(),i.curveTo(o,s,r,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 36:o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),k=r+l.shift(),R=a,D=k+l.shift(),C=a,L=D+l.shift(),I=C+l.shift(),m=L+l.shift(),i.curveTo(o,s,r,a,k,R),i.curveTo(D,C,L,I,m,y);break;case 37:o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),k=r+l.shift(),R=a+l.shift(),D=k+l.shift(),C=R+l.shift(),L=D+l.shift(),I=C+l.shift(),Math.abs(L-m)>Math.abs(I-y)?m=L+l.shift():y=I+l.shift(),i.curveTo(o,s,r,a,k,R),i.curveTo(D,C,L,I,m,y);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+B),l.length=0}break;case 14:l.length>0&&!d&&(v=l.shift()+h,d=!0),g&&(i.closePath(),g=!1);break;case 18:S();break;case 19:case 20:S(),M+=f+7>>3;break;case 21:l.length>2&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),m+=l.pop(),b(m,y);break;case 22:l.length>1&&!d&&(v=l.shift()+h,d=!0),m+=l.pop(),b(m,y);break;case 23:S();break;case 24:for(;l.length>2;)o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a+l.shift(),i.curveTo(o,s,r,a,m,y);m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 25:for(;l.length>6;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);o=m+l.shift(),s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a+l.shift(),i.curveTo(o,s,r,a,m,y);break;case 26:for(l.length%2&&(m+=l.shift());l.length>0;)o=m,s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r,y=a+l.shift(),i.curveTo(o,s,r,a,m,y);break;case 27:for(l.length%2&&(y+=l.shift());l.length>0;)o=m+l.shift(),s=y,r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a,i.curveTo(o,s,r,a,m,y);break;case 28:x=p[M],U=p[M+1],l.push((x<<24|U<<16)>>16),M+=2;break;case 29:O=l.pop()+e.gsubrsBias,w=e.gsubrs[O],w&&n(w);break;case 30:for(;l.length>0&&(o=m,s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,s,r,a,m,y),0!==l.length);)o=m+l.shift(),s=y,r=o+l.shift(),a=s+l.shift(),y=a+l.shift(),m=r+(1===l.length?l.shift():0),i.curveTo(o,s,r,a,m,y);break;case 31:for(;l.length>0&&(o=m+l.shift(),s=y,r=o+l.shift(),a=s+l.shift(),y=a+l.shift(),m=r+(1===l.length?l.shift():0),i.curveTo(o,s,r,a,m,y),0!==l.length);)o=m,s=y+l.shift(),r=o+l.shift(),a=s+l.shift(),m=r+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,s,r,a,m,y);break;default:B<32?console.log("Glyph "+t.index+": unknown operator "+B):B<247?l.push(B-139):B<251?(x=p[M],M+=1,l.push(256*(B-247)+x+108)):B<255?(x=p[M],M+=1,l.push(256*-(B-251)-x-108)):(x=p[M],U=p[M+1],T=p[M+2],E=p[M+3],M+=4,l.push((x<<24|U<<16|T<<8|E)/65536))}}}(n),t.advanceWidth=v,i}function Xe(e,t){let n,o=fe.indexOf(e);return o>=0&&(n=o),o=t.indexOf(e),o>=0?n=o+fe.length:(n=fe.length+t.length,t.push(e)),n}function Ve(e,t,n){const o={};for(let s=0;s=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+o+")");s.push(r)}else{if(3!==i)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+i);{const e=a.parseCard16();let t,i=a.parseCard16();if(0!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+i);for(let l=0;l=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+o+")");if(t>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+t);for(;i=1&&(n.ulCodePageRange1=o.parseULong(),n.ulCodePageRange2=o.parseULong()),n.version>=2&&(n.sxHeight=o.parseShort(),n.sCapHeight=o.parseShort(),n.usDefaultChar=o.parseUShort(),n.usBreakChar=o.parseUShort(),n.usMaxContent=o.parseUShort()),n},make:function(e){return new ne.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:dt,getUnicodeRange:function(e){for(let t=0;t=n.begin&&e=me.length){const e=o.parseChar();n.names.push(o.parseString(e))}break;case 2.5:n.numberOfGlyphs=o.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;et.value.tag?1:-1})),t.fields=t.fields.concat(o),t.fields=t.fields.concat(s),t}function wt(e,t,n){for(let n=0;n0){return e.glyphs.get(o).getMetrics()}}return n}function kt(e){let t=0;for(let n=0;nm||void 0===l)&&m>0&&(l=m),c 123 are reserved for internal usage");f|=1<0?et.make(w):void 0,D=mt.make(),C=Qe.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:x,weightName:U,postScriptName:E,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax]}),L=e.metas&&Object.keys(e.metas).length>0?xt.make(e.metas):void 0,I=[g,m,y,v,k,S,D,C,b];R&&I.push(R),e.tables.gsub&&I.push(St.make(e.tables.gsub)),L&&I.push(L);const M=Ot(I),B=Tt(M.encode()),G=M.fields;let N=!1;for(let e=0;e>>1,r=e[s].tag;if(r===t)return s;r>>1,r=e[s];if(r===t)return s;r=0)return o[s].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return o.splice(-1-s,0,t),t.script}}},getLangSysTable:function(e,t,n){const o=this.getScriptTable(e,n);if(o){if(!t||"dflt"===t||"DFLT"===t)return o.defaultLangSys;const e=Dt(o.langSysRecords,t);if(e>=0)return o.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return o.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,o){const s=this.getLangSysTable(e,t,o);if(s){let e;const t=s.featureIndexes,r=this.font.tables[this.tableName].features;for(let o=0;o=r[o-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},r.push(e),t.push(o),e.feature}}},getLookupTables:function(e,t,n,o,s){const r=this.getFeatureTable(e,t,n,s),a=[];if(r){let e;const t=r.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let s=0;s=0){const e=r.ligatureSets[c];for(let t=0;t0&&e<0?n:o<0&&e>0?-n:e*o},Yt={x:1,y:0,axis:"x",distance:function(e,t,n,o){return(n?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,n,o){let s,r,a,i,l,c,u;if(!o||o===this)return s=e.xo-t.xo,r=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,a=Math.abs(s),i=Math.abs(r),u=a+i,0===u?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*i+c*a)/u);s=o.distance(e,t,!0,!0),r=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(s),i=Math.abs(r),u=a+i,0!==u?Yt.setRelative(e,e,(l*i+c*a)/u,o,!0):Yt.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,o,s){if(!o||o===this)return void(e.x=(s?t.xo:t.x)+n);const r=s?t.xo:t.x,a=s?t.yo:t.y,i=r+n*o.x,l=a+n*o.y;e.x=i+(e.y-l)/o.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Zt={x:0,y:1,axis:"y",distance:function(e,t,n,o){return(n?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,n,o){let s,r,a,i,l,c,u;if(!o||o===this)return s=e.yo-t.yo,r=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,a=Math.abs(s),i=Math.abs(r),u=a+i,0===u?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*i+c*a)/u);s=o.distance(e,t,!0,!0),r=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(s),i=Math.abs(r),u=a+i,0!==u?Zt.setRelative(e,e,(l*i+c*a)/u,o,!0):Zt.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:0,setRelative:function(e,t,n,o,s){if(!o||o===this)return void(e.y=(s?t.yo:t.y)+n);const r=s?t.xo:t.x,a=s?t.yo:t.y,i=r+n*o.x,l=a+n*o.y;e.y=l+o.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Qt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function $t(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Yt:0===e&&1===t?Zt:new Qt(e,t)}function Kt(e,t,n,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Yt),Object.freeze(Zt),Qt.prototype.distance=function(e,t,n,o){return this.x*Yt.distance(e,t,n,o)+this.y*Zt.distance(e,t,n,o)},Qt.prototype.interpolate=function(e,t,n,o){let s,r,a,i,l,c,u;a=o.distance(e,t,!0,!0),i=o.distance(e,n,!0,!0),s=o.distance(t,t,!1,!0),r=o.distance(n,n,!1,!0),l=Math.abs(a),c=Math.abs(i),u=l+c,0!==u?this.setRelative(e,e,(s*c+r*l)/u,o,!0):this.setRelative(e,e,(s+r)/2,o,!0)},Qt.prototype.setRelative=function(e,t,n,o,s){o=o||this;const r=s?t.xo:t.x,a=s?t.yo:t.y,i=r+n*o.x,l=a+n*o.y,c=o.normalSlope,u=this.slope,p=e.x,h=e.y;e.x=(u*p-c*i+l-h)/(u-c),e.y=u*(e.x-p)+h},Qt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Kt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Kt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};const Jt=Object.freeze(new Kt(0,0)),en={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function tn(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Yt,this.round=Wt}}function nn(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=2*(o-184+1);else if(t&&1===r&&27===o)break}while(r>0);e.ip=s}function sn(e,t){exports.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function rn(e,t){exports.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function an(e,t){exports.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function ln(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],a=t.z1[s];let i,l;exports.DEBUG&&console.log("SPVTL["+e+"]",o,s),e?(i=r.y-a.y,l=a.x-r.x):(i=a.x-r.x,l=a.y-r.y),t.pv=t.dpv=$t(i,l)}function cn(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],a=t.z1[s];let i,l;exports.DEBUG&&console.log("SFVTL["+e+"]",o,s),e?(i=r.y-a.y,l=a.x-r.x):(i=a.x-r.x,l=a.y-r.y),t.fv=$t(i,l)}function un(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function pn(e,t){const n=t.stack.pop(),o=t.z0[n],s=t.fv,r=t.pv;exports.DEBUG&&console.log(t.step,"MDAP["+e+"]",n);let a=r.distance(o,Jt);e&&(a=t.round(a)),s.setRelative(o,Jt,a,r),s.touch(o),t.rp0=t.rp1=n}function hn(e,t){const n=t.z2,o=n.length-2;let s,r,a;exports.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(let t=0;t1?"loop "+(t.loop-i)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",o)}t.loop=1}function dn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[o],r=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let c=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",i);const u=a.distance(s,s,!1,!0);do{c!==s&&r.setRelative(c,c,u,a),c=c.nextPointOnContour}while(c!==l)}function gn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[o],r=t.fv,a=t.pv,i=n.pop();let l,c;switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",i),i){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(s,s,!1,!0),p=l.length-2;for(let e=0;e",i),t.stack.push(Math.round(64*i))}function Sn(e,t){const n=t.stack,o=n.pop(),s=t.fv,r=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,c=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,n);for(let e=0;e>4)!==a)continue;let u=(15&o)-8;u>=0&&u++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",e,"by",u*l);const p=c[e];s.setRelative(p,p,u*l,r)}}function xn(e,t){const n=t.stack,o=n.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),n.push(64*t.round(o/64))}function Un(e,t){const n=t.stack,o=n.pop(),s=t.ppem,r=t.deltaBase+16*(e-1),a=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,n);for(let e=0;e>4)!==s)continue;let i=(15&o)-8;i>=0&&i++;const l=i*a;exports.DEBUG&&console.log(t.step,"DELTACFIX",e,"by",l),t.cvt[e]+=l}}function Tn(e,t){const n=t.stack,o=n.pop(),s=n.pop(),r=t.z2[o],a=t.z1[s];let i,l;exports.DEBUG&&console.log("SDPVTL["+e+"]",o,s),e?(i=r.y-a.y,l=a.x-r.x):(i=a.x-r.x,l=a.y-r.y),t.dpv=$t(i,l)}function En(e,t){const n=t.stack,o=t.prog;let s=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(let t=0;t=0?1:-1,m=Math.abs(m),e&&(v=r.cvt[i],o&&Math.abs(m-v)":"_")+(o?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",e?i+"("+r.cvt[i]+","+v+")":"",l,"(d =",g,"->",y*m,")"),r.rp1=r.rp0,r.rp2=l,t&&(r.rp0=l)}function kn(e){(e=e||{}).empty||(Gt(e.familyName,"When creating a new Font object, familyName is required."),Gt(e.styleName,"When creating a new Font object, styleName is required."),Gt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Gt(e.ascender,"When creating a new Font object, ascender is required."),Gt(e.descender,"When creating a new Font object, descender is required."),Gt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Le.GlyphSet(this,e.glyphs||[]),this.encoding=new ye(this),this.substitution=new Lt(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Ht(this):void 0}})}function Rn(e,t){const n=JSON.stringify(e);let o=256;for(let e in t){let s=parseInt(e);if(s&&!(s<256)){if(JSON.stringify(t[e])===n)return s;o<=s&&(o=s+1)}}return t[o]=e,o}function Dn(e,t,n){const o=Rn(t.name,n);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:o}]}function Cn(e,t,n){const o={},s=new ue.Parser(e,t);return o.tag=s.parseTag(),o.minValue=s.parseFixed(),o.defaultValue=s.parseFixed(),o.maxValue=s.parseFixed(),s.skip("uShort",1),o.name=n[s.parseUShort()]||{},o}function Ln(e,t,n,o){const s=[{name:"nameID_"+e,type:"USHORT",value:Rn(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o2)return;const n=this.font;let o=this._prepState;if(!o||o.ppem!==t){let e=this._fpgmState;if(!e){tn.prototype=en,e=this._fpgmState=new tn("fpgm",n.tables.fpgm),e.funcs=[],e.font=n,exports.DEBUG&&(console.log("---EXEC FPGM---"),e.step=-1);try{Pt(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}tn.prototype=e,o=this._prepState=new tn("prep",n.tables.prep),o.ppem=t;const s=n.tables.cvt;if(s){const e=o.cvt=new Array(s.length),r=t/n.unitsPerEm;for(let t=0;t1))try{return At(e,o)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},At=function(e,t){const n=t.ppem/t.font.unitsPerEm,o=n;let s,r,a,i=e.components;if(tn.prototype=t,i){const l=t.font;r=[],s=[];for(let e=0;e1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,s),o.setRelative(i,i,s),o.touch(i)}e.loop=1},function(e){const t=e.stack,n=e.rp1,o=e.rp2;let s=e.loop;const r=e.z0[n],a=e.z1[o],i=e.fv,l=e.dpv,c=e.z2;for(;s--;){const u=t.pop(),p=c[u];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"IP[]",u,n,"<->",o),i.interpolate(p,r,a,l),i.touch(p)}e.loop=1},mn.bind(void 0,0),mn.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,o=e.z0[n];let s=e.loop;const r=e.fv,a=e.pv,i=e.z1;for(;s--;){const n=t.pop(),l=i[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"ALIGNRP[]",n),r.setRelative(l,o,0,a),r.touch(l)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=_t},yn.bind(void 0,0),yn.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const o=e.stack,s=t[++n];exports.DEBUG&&console.log(e.step,"NPUSHB[]",s);for(let e=0;en?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",n,o),t.push(o>=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",n,o),t.push(n===o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",n,o),t.push(n!==o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",n),t.push(Math.trunc(n)%2?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",n),t.push(Math.trunc(n)%2?0:1)},function(e){let t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(on(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",n,o),t.push(n&&o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",n,o),t.push(n||o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",n),t.push(n?0:1)},Sn.bind(void 0,1),function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",n,o),t.push(o+n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",n,o),t.push(o-n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",n,o),t.push(64*o/n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",n,o),t.push(o*n/64)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",n),t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",n),t.push(-n)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",n),t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",n),t.push(64*Math.ceil(n/64))},xn.bind(void 0,0),xn.bind(void 0,1),xn.bind(void 0,2),xn.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",n,o),e.cvt[o]=n*e.ppem/e.font.unitsPerEm},Sn.bind(void 0,2),Sn.bind(void 0,3),Un.bind(void 0,1),Un.bind(void 0,2),Un.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=jt,192&n){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=jt,192&n){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=zt},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Xt},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Vt},un,un,void 0,void 0,void 0,void 0,void 0,function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},Tn.bind(void 0,0),Tn.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let o=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(o=35),32&n&&(o|=4096),t.push(o)},void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop(),s=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(n),t.push(s)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",n,o),t.push(Math.max(o,n))},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",n,o),t.push(Math.min(o,n))},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,n),t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,En.bind(void 0,1),En.bind(void 0,2),En.bind(void 0,3),En.bind(void 0,4),En.bind(void 0,5),En.bind(void 0,6),En.bind(void 0,7),En.bind(void 0,8),On.bind(void 0,1),On.bind(void 0,2),On.bind(void 0,3),On.bind(void 0,4),On.bind(void 0,5),On.bind(void 0,6),On.bind(void 0,7),On.bind(void 0,8),wn.bind(void 0,0,0,0,0,0),wn.bind(void 0,0,0,0,0,1),wn.bind(void 0,0,0,0,0,2),wn.bind(void 0,0,0,0,0,3),wn.bind(void 0,0,0,0,1,0),wn.bind(void 0,0,0,0,1,1),wn.bind(void 0,0,0,0,1,2),wn.bind(void 0,0,0,0,1,3),wn.bind(void 0,0,0,1,0,0),wn.bind(void 0,0,0,1,0,1),wn.bind(void 0,0,0,1,0,2),wn.bind(void 0,0,0,1,0,3),wn.bind(void 0,0,0,1,1,0),wn.bind(void 0,0,0,1,1,1),wn.bind(void 0,0,0,1,1,2),wn.bind(void 0,0,0,1,1,3),wn.bind(void 0,0,1,0,0,0),wn.bind(void 0,0,1,0,0,1),wn.bind(void 0,0,1,0,0,2),wn.bind(void 0,0,1,0,0,3),wn.bind(void 0,0,1,0,1,0),wn.bind(void 0,0,1,0,1,1),wn.bind(void 0,0,1,0,1,2),wn.bind(void 0,0,1,0,1,3),wn.bind(void 0,0,1,1,0,0),wn.bind(void 0,0,1,1,0,1),wn.bind(void 0,0,1,1,0,2),wn.bind(void 0,0,1,1,0,3),wn.bind(void 0,0,1,1,1,0),wn.bind(void 0,0,1,1,1,1),wn.bind(void 0,0,1,1,1,2),wn.bind(void 0,0,1,1,1,3),wn.bind(void 0,1,0,0,0,0),wn.bind(void 0,1,0,0,0,1),wn.bind(void 0,1,0,0,0,2),wn.bind(void 0,1,0,0,0,3),wn.bind(void 0,1,0,0,1,0),wn.bind(void 0,1,0,0,1,1),wn.bind(void 0,1,0,0,1,2),wn.bind(void 0,1,0,0,1,3),wn.bind(void 0,1,0,1,0,0),wn.bind(void 0,1,0,1,0,1),wn.bind(void 0,1,0,1,0,2),wn.bind(void 0,1,0,1,0,3),wn.bind(void 0,1,0,1,1,0),wn.bind(void 0,1,0,1,1,1),wn.bind(void 0,1,0,1,1,2),wn.bind(void 0,1,0,1,1,3),wn.bind(void 0,1,1,0,0,0),wn.bind(void 0,1,1,0,0,1),wn.bind(void 0,1,1,0,0,2),wn.bind(void 0,1,1,0,0,3),wn.bind(void 0,1,1,0,1,0),wn.bind(void 0,1,1,0,1,1),wn.bind(void 0,1,1,0,1,2),wn.bind(void 0,1,1,0,1,3),wn.bind(void 0,1,1,1,0,0),wn.bind(void 0,1,1,1,0,1),wn.bind(void 0,1,1,1,0,2),wn.bind(void 0,1,1,1,0,3),wn.bind(void 0,1,1,1,1,0),wn.bind(void 0,1,1,1,1,1),wn.bind(void 0,1,1,1,1,2),wn.bind(void 0,1,1,1,1,3)],kn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},kn.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;const n=[];for(let t=0;t>1;e1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let o=0;o{const t=Vn.loadSync(e);Zn.font=t,Zn.ascender=t.ascender,Zn.descender=t.descender}};const $n=Qn.options,Kn=function(e,t){return Math.round(e+Math.random()*(t-e))};const Jn=function(e,t){return{text:(e+t).toString(),equation:e+"+"+t}},eo=function(e,t){return{text:(e-t).toString(),equation:e+"-"+t}};function to(e,t,n){return 6*(n=(n+1)%1)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}var no={int:Kn,greyColor:function(e,t){const n=Kn(e=e||1,t=t||9).toString(16);return`#${n}${n}${n}`},captchaText:function(e){"number"==typeof e&&(e={size:e});const t=(e=e||{}).size||4,n=e.ignoreChars||"";let o=-1,s="",r=e.charPreset||$n.charPreset;n&&(r=function(e,t){return e.split("").filter(e=>-1===t.indexOf(e))}(r,n));const a=r.length-1;for(;++o>16,o=t>>8&255,s=255&t,r=Math.max(n,o,s),a=Math.min(n,o,s);return(r+a)/510}(e):1;let s,r;o>=.5?(s=Math.round(100*o)-45,r=Math.round(100*o)-25):(s=Math.round(100*o)+25,r=Math.round(100*o)+45);const a=Kn(s,r)/100,i=a<.5?a*(a+n):a+n-a*n,l=2*a-i,c=Math.floor(255*to(l,i,t+1/3)),u=Math.floor(255*to(l,i,t));return"#"+(Math.floor(255*to(l,i,t-1/3))|u<<8|c<<16|1<<24).toString(16).slice(1)}};const oo=Qn.options,so=function(e,t){e=e||no.captchaText();const n=(t=Object.assign({},oo,t)).width,o=t.height,s=t.background||t.backgroundColor;s&&(t.color=!0);const r=s?``:"",a=[].concat(function(e,t,n){const o=n.color,s=[],r=n.inverse?7:1,a=n.inverse?15:9;let i=-1;for(;++i`)}return s}(n,o,t)).concat(function(e,t,n,o,s){const r=e.length,a=(t-2)/(r+1),i=o.inverse?10:0,c=o.inverse?14:4;let u=-1;const p=[],h=s||o.color?no.color(o.background):no.greyColor(i,c);for(;++u`)}return p}(e,n,o,t)).sort(()=>Math.random()-.5).join("");return`${``}${r}${a}`};var ro=so,ao=no.captchaText,io=function(e){const t=e.text||no.captchaText(e);return{text:t,data:so(t,e)}},lo=function(e){const t=no.mathExpr(e.mathMin,e.mathMax,e.mathOperator);return{text:t.text,data:so(t.equation,e)}},co=oo,uo=Qn.loadFont;ro.randomText=ao,ro.create=io,ro.createMathExpr=lo,ro.options=co,ro.loadFont=uo;var po=ro;const ho=Object.prototype.toString;function fo(e){return"[object Object]"===ho.call(e)}function go(){"development"===process.env.NODE_ENV&&console.log(...arguments)}const mo=async function(){};function yo(e){return mo.constructor===e.constructor?async function(){const t=await e.apply(this,arguments);return fo(t)&&(t.msg&&(t.message=t.msg,t.errMsg=t.msg),t.errCode=t.code),t}:function(){const t=e.apply(this,arguments);return fo(t)&&(t.msg&&(t.message=t.msg,t.errMsg=t.msg),t.errCode=t.code),t}}const vo=uniCloud.database().collection("opendb-verify-codes");class bo{async setVerifyCode({deviceId:e,code:t,expiresDate:n,scene:o}){if(!e)return{code:10101,msg:"deviceId不可为空"};if(!t)return{code:10102,msg:"验证码不可为空"};n||(n=180);const s=Date.now(),r={deviceId:e,scene:o,code:t.toLocaleLowerCase(),state:0,ip:__ctx__.CLIENTIP,created_date:s,expired_date:s+1e3*n};return go("addRes",await vo.add(r)),{code:0,deviceId:e}}async verifyCode({deviceId:e,code:t,scene:n}){if(!e)return{code:10101,msg:"deviceId不可为空"};if(!t)return{code:10102,msg:"验证码不可为空"};const o=Date.now(),s={deviceId:e,scene:n,code:t.toLocaleLowerCase(),state:0},r=await vo.where(s).orderBy("created_date","desc").limit(1).get();if(go("verifyRecord:",r),r&&r.data&&r.data.length>0){const e=r.data[0];if(e.expired_date{e.scene&&delete e.scene,this.pluginConfig.scene[n]=Object.assign({},t,e[n])})}}}{constructor(){super(),this.DEVICEID2opts={}}mergeConfig(e){const t=fo(this.pluginConfig.scene)?this.pluginConfig.scene[e.scene]:e.scene;return Object.assign({},fo(t)?t:this.pluginConfig,e)}async create(e={}){if(!e.scene)throw new Error("scene验证码场景不可为空");e=this.mergeConfig(e);let{scene:t,expiresDate:n,deviceId:o,...s}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");const r=new bo;try{const{text:a,base64:i}=function(e={}){const{uniPlatform:t=""}=e;let n;n=e.mathExpr?po.createMathExpr(e):po.create(e);let o="data:image/svg+xml;utf8,"+n.data.replace(/#/g,"%23");return(!t||"string"==typeof t&&-1===t.indexOf("mp-"))&&(o=o.replace(/"/g,"'").replace(//g,"%3E")),{text:n.text,base64:o}}(s),l=await r.setVerifyCode({deviceId:o,code:a,expiresDate:n,scene:t});return l.code>0?{...l,code:10001}:(this.DEVICEID2opts[o]=e,{code:0,msg:"验证码获取成功",captchaBase64:i})}catch(e){return{code:10001,msg:"验证码生成失败:"+e.message}}}async verify({deviceId:e,captcha:t,scene:n}){if(!(e=e||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");const o=new bo;try{const s=await o.verifyCode({deviceId:e,code:t,scene:n});return s.code>0?s:{code:0,msg:"验证码通过"}}catch(e){return{code:10002,msg:"验证码校验失败:"+e.message}}}async refresh(e={}){let{scene:t,expiresDate:n,deviceId:o,...s}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");if(!t)throw new Error("scene验证码场景不可为空");const r=await vo.where({deviceId:o,scene:t}).orderBy("created_date","desc").limit(1).get();if(r&&r.data&&r.data.length>0){const e=r.data[0];await vo.doc(e._id).update({state:2}),Object.keys(s).length>0&&(this.DEVICEID2opts[o]=Object.assign({},this.DEVICEID2opts[o],s));let a={};try{a=await this.create(Object.assign({},this.DEVICEID2opts[o],{deviceId:o,scene:t,expiresDate:n}))}catch(e){return{code:50403,msg:e.message}}return a.code>0?{...a,code:10003}:{code:0,msg:"验证码刷新成功",captchaBase64:a.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在 ${t} 场景信息,请重新获取`}}}const Uo=new bo;Object.keys(Uo).forEach(e=>{xo.prototype[e]=yo(Uo[e])});const To=new xo,Eo=new Proxy(To,{get(e,t){if(t in e)return"function"==typeof e[t]?yo(e[t]).bind(Eo):e[t]}});module.exports=Eo; diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json index f5e9cd9e34135384a20303bcffc85863fd3bbc65..2bb07ec8c0d0da397669bd1854637b12cf4d7bc9 100644 --- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json @@ -1,6 +1,6 @@ { "name": "uni-captcha", - "version": "0.1.1", + "version": "0.2.2", "description": "uni-captcha", "main": "index.js", "homepage": "https://ext.dcloud.net.cn/plugin?id=4048", @@ -9,5 +9,8 @@ "url": "git+https://gitee.com/dcloud/uni-captcha" }, "author": "DCloud", - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center" + } } \ No newline at end of file diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..09b36ac9ecaef591b568dfcd6518f3f788267898 --- /dev/null +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js @@ -0,0 +1,32 @@ +// 开发文档: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj +//导入验证码公共模块 +const uniCaptcha = require('uni-captcha') +//获取数据库对象 +const db = uniCloud.database(); +//获取数据表opendb-verify-codes对象 +const verifyCodes = db.collection('opendb-verify-codes') +module.exports = { + async getImageCaptcha({ + scene + }) { + //获取设备id + let { + deviceId, + platform + } = this.getClientInfo(); + //根据:设备id、场景值、状态,查找记录是否存在 + let res = await verifyCodes.where({ + scene, + deviceId, + state: 0 + }).limit(1).get() + //如果已存在则调用刷新接口,反之调用插件接口 + let action = res.data.length ? 'refresh' : 'create' + //执行并返回结果 + //导入配置,配置优先级说明:此处配置 > uni-config-center + return await uniCaptcha[action]({ + scene, //来源客户端传递,表示:使用场景值,用于防止不同功能的验证码混用 + uniPlatform: platform + }) + } +} diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b5188c3ff1d1c0f44665bd437fa7017dd20cf866 --- /dev/null +++ b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json @@ -0,0 +1,10 @@ +{ + "name": "uni-captcha-co", + "dependencies": { + "uni-captcha": "file:../common/uni-captcha", + "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center" + }, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/opendb-verify-codes.schema.json b/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json similarity index 72% rename from uniCloud-aliyun/database/opendb-verify-codes.schema.json rename to uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json index 8f86479d5508ed71158be14fe685a9e0c7de7b83..1f3be590712e9eb110bd753c8392d784be9aad6d 100644 --- a/uniCloud-aliyun/database/opendb-verify-codes.schema.json +++ b/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json @@ -1,41 +1,45 @@ -{ - "bsonType": "object", - "required": [], - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "mobile": { - "bsonType": "string", - "description": "手机号码" - }, - "email": { - "bsonType": "string", - "description": "邮箱" - }, - "code": { - "bsonType": "string", - "description": "验证码" - }, - "type": { - "bsonType": "string", - "description": "验证类型:login, bind, unbind, pay" - }, - "state": { - "bsonType": "int", - "description": "验证状态:0 未验证、1 已验证、2 已作废" - }, - "ip": { - "bsonType": "string", - "description": "请求时客户端IP地址" - }, - "created_at": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "expired_at": { - "bsonType": "timestamp", - "description": "过期时间" - } - } -} +{ + "bsonType": "object", + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "code": { + "bsonType": "string", + "description": "验证码" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + }, + "device_uuid": { + "bsonType": "string", + "description": "设备UUID,常用于图片验证码" + }, + "email": { + "bsonType": "string", + "description": "邮箱" + }, + "expired_date": { + "bsonType": "timestamp", + "description": "过期时间" + }, + "ip": { + "bsonType": "string", + "description": "请求时客户端IP地址" + }, + "mobile": { + "bsonType": "string", + "description": "手机号码" + }, + "scene": { + "bsonType": "string", + "description": "使用验证码的场景,如:login, bind, unbind, pay" + }, + "state": { + "bsonType": "int", + "description": "验证状态:0 未验证、1 已验证、2 已作废" + } + }, + "required": [] +} \ No newline at end of file diff --git a/uni_modules/uni-card/changelog.md b/uni_modules/uni-card/changelog.md index c84f1ace5d86ce7b0105d5ff6228c52d2423ee25..c3cd8c45ace0d5838a3f1c1eff8ea0fc349afb9c 100644 --- a/uni_modules/uni-card/changelog.md +++ b/uni_modules/uni-card/changelog.md @@ -1,12 +1,26 @@ +## 1.3.1(2021-12-20) +- 修复 在vue页面下略缩图显示不正常的bug +## 1.3.0(2021-11-19) +- 重构插槽的用法 ,header 替换为 title +- 新增 actions 插槽 +- 新增 cover 封面图属性和插槽 +- 新增 padding 内容默认内边距离 +- 新增 margin 卡片默认外边距离 +- 新增 spacing 卡片默认内边距 +- 新增 shadow 卡片阴影属性 +- 取消 mode 属性,可使用组合插槽代替 +- 取消 note 属性 ,使用actions插槽代替 +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-card](https://uniapp.dcloud.io/component/uniui/uni-card) ## 1.2.1(2021-07-30) - 优化 vue3下事件警告的问题 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.8(2021-07-01) -- 优化 图文卡片无图片加载时,提供占位图标 -- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) -- 修复 thumbnail 不存在仍然占位的 bug -## 1.1.7(2021-05-12) -- 新增 组件示例地址 -## 1.1.6(2021-02-04) -- 调整为uni_modules目录规范 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.8(2021-07-01) +- 优化 图文卡片无图片加载时,提供占位图标 +- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) +- 修复 thumbnail 不存在仍然占位的 bug +## 1.1.7(2021-05-12) +- 新增 组件示例地址 +## 1.1.6(2021-02-04) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-card/components/uni-card/uni-card.vue b/uni_modules/uni-card/components/uni-card/uni-card.vue index 7458b777f1368d1802b2b3d77103e5a742149639..045c082a7933d7832c1f1694eda421162dac9594 100644 --- a/uni_modules/uni-card/components/uni-card/uni-card.vue +++ b/uni_modules/uni-card/components/uni-card/uni-card.vue @@ -1,58 +1,36 @@ @@ -63,22 +41,22 @@ * @description 卡片视图组件 * @tutorial https://ext.dcloud.net.cn/plugin?id=22 * @property {String} title 标题文字 - * @property {String} subTitle 副标题(仅仅mode=title下生效) + * @property {String} subTitle 副标题 + * @property {Number} padding 内容内边距 + * @property {Number} margin 卡片外边距 + * @property {Number} spacing 卡片内边距 * @property {String} extra 标题额外信息 - * @property {String} note 底部信息 + * @property {String} cover 封面图(本地路径需要引入) * @property {String} thumbnail 标题左侧缩略图 - * @property {String} mode = [basic|style|title] 卡片模式 - * @value basic 基础卡片 - * @value style 图文卡片 - * @value title 标题卡片 - * @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 - * @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影 + * @property {Boolean} is-full = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 + * @property {Boolean} is-shadow = [true | false] 卡片内容是否开启阴影 + * @property {String} shadow 卡片阴影 + * @property {Boolean} border 卡片边框 * @event {Function} click 点击 Card 触发事件 - * @example 内容主体,可自定义内容及样式 */ export default { name: 'UniCard', - emits:['click'], + emits: ['click'], props: { title: { type: String, @@ -88,11 +66,23 @@ type: String, default: '' }, + padding: { + type: String, + default: '10px' + }, + margin: { + type: String, + default: '15px' + }, + spacing: { + type: String, + default: '0 10px' + }, extra: { type: String, default: '' }, - note: { + cover: { type: String, default: '' }, @@ -100,10 +90,6 @@ type: String, default: '' }, - mode: { - type: String, - default: 'basic' - }, isFull: { // 内容区域是否通栏 type: Boolean, @@ -111,300 +97,157 @@ }, isShadow: { // 是否开启阴影 - type: [Boolean, String], - default: false + type: Boolean, + default: true + }, + shadow: { + type: String, + default: '0px 0px 3px 1px rgba(0, 0, 0, 0.08)' + }, + border: { + type: Boolean, + default: true } }, methods: { - onClick() { - this.$emit('click') + onClick(type) { + this.$emit('click', type) } } } - diff --git a/uni_modules/uni-card/package.json b/uni_modules/uni-card/package.json index 79533648372c7bd339e04d86911da660ce844ea0..f16224de2b73a95a4f4708243b9b5818ba53ff3d 100644 --- a/uni_modules/uni-card/package.json +++ b/uni_modules/uni-card/package.json @@ -1,85 +1,90 @@ -{ - "id": "uni-card", - "displayName": "uni-card 卡片", - "version": "1.2.1", - "description": "Card 组件,提供常见的卡片样式。", - "keywords": [ - "uni-ui", - "uniui", - "card", - "", - "卡片" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} +{ + "id": "uni-card", + "displayName": "uni-card 卡片", + "version": "1.3.1", + "description": "Card 组件,提供常见的卡片样式。", + "keywords": [ + "uni-ui", + "uniui", + "card", + "", + "卡片" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-icons", + "uni-scss" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-card/readme.md b/uni_modules/uni-card/readme.md index 6f72c837d0df7a5022e84c11257a47e79992f12a..7434e71d2897720b157a92ee90c6f51a7d2bbf98 100644 --- a/uni_modules/uni-card/readme.md +++ b/uni_modules/uni-card/readme.md @@ -4,101 +4,9 @@ > **组件名:uni-card** > 代码块: `uCard` - 卡片视图组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 因为平台兼容问题 , 目前 APP-NVUE 安卓平台下不支持阴影 - - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - 内容主体,可自定义内容及样式 - - - - - - - - - - uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。 - - - - - uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。 - - - - - 默认内容 - - -``` - -## API - -### Card Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|title |String |- |标题文字 | -|extra |String |- |标题额外信息 | -|note |String |- |底部信息 | -|thumbnail |String |- |标题左侧缩略图,支持网络图片,本地图片,本图片需要传入一个绝对路径,如:`/static/xxx.png` | -|mode |String |basic |卡片模式 ,可选值, basic:基础卡片 ;style :图文卡片 ; title :标题卡片 | -|isFull |Boolean|false |卡片内容是否通栏,为true时将去除padding值 | -|isShadow |Boolean|false |卡片内容是否开启阴影 | - - -### Card Events - -|事件称名 |事件说明 |返回参数 | -|:-: |:-: |:-: | -|@click |点击 Card 触发事件 |- | - - -### Card Slots - -|插槽称名 |说明 | -|:-: |:-: | -|header |卡片头部插槽( 图文卡片 mode="style" 时,不支持)| -|footer |卡片底部插槽 | +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-card) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -## 组件示例 -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/card/card](https://hellouniapp.dcloud.net.cn/pages/extUI/card/card) \ No newline at end of file diff --git a/uni_modules/uni-collapse/changelog.md b/uni_modules/uni-collapse/changelog.md index c0dba72e0ede34c4b8922c78684c63281578b02a..292e4c79f34d8291119fc98bedf97c40b12dd015 100644 --- a/uni_modules/uni-collapse/changelog.md +++ b/uni_modules/uni-collapse/changelog.md @@ -1,27 +1,36 @@ +## 1.4.3(2022-01-25) +- 修复 初始化的时候 ,open 属性失效的bug +## 1.4.2(2022-01-21) +- 修复 微信小程序resize后组件收起的bug +## 1.4.1(2021-11-22) +- 修复 vue3中个别scss变量无法找到的问题 +## 1.4.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse) ## 1.3.3(2021-08-17) - 优化 show-arrow 属性默认为true -## 1.3.2(2021-08-17) -- 新增 show-arrow 属性,控制是否显示右侧箭头 -## 1.3.1(2021-07-30) -- 优化 vue3下小程序事件警告的问题 -## 1.3.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.2.2(2021-07-21) -- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug -## 1.2.1(2021-07-21) -- 优化 组件示例 -## 1.2.0(2021-07-21) -- 新增 组件折叠动画 -- 新增 value\v-model 属性 ,动态修改面板折叠状态 -- 新增 title 插槽 ,可定义面板标题 -- 新增 border 属性 ,显示隐藏面板内容分隔线 -- 新增 title-border 属性 ,显示隐藏面板标题分隔线 -- 修复 resize 方法失效的Bug -- 修复 change 事件返回参数不正确的Bug -- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法 -## 1.1.7(2021-05-12) -- 新增 组件示例地址 -## 1.1.6(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.1.5(2021-02-05) +## 1.3.2(2021-08-17) +- 新增 show-arrow 属性,控制是否显示右侧箭头 +## 1.3.1(2021-07-30) +- 优化 vue3下小程序事件警告的问题 +## 1.3.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.2(2021-07-21) +- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug +## 1.2.1(2021-07-21) +- 优化 组件示例 +## 1.2.0(2021-07-21) +- 新增 组件折叠动画 +- 新增 value\v-model 属性 ,动态修改面板折叠状态 +- 新增 title 插槽 ,可定义面板标题 +- 新增 border 属性 ,显示隐藏面板内容分隔线 +- 新增 title-border 属性 ,显示隐藏面板标题分隔线 +- 修复 resize 方法失效的Bug +- 修复 change 事件返回参数不正确的Bug +- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法 +## 1.1.7(2021-05-12) +- 新增 组件示例地址 +## 1.1.6(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.1.5(2021-02-05) - 调整为uni_modules目录规范 \ No newline at end of file diff --git a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue index 32d63739cc75aaad1d35b30c869434441e7e5049..b2aad1fd0bbe4190e674506216f35613b54c9e74 100644 --- a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue +++ b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue @@ -11,11 +11,10 @@ - - + { + this.$nextTick(() => { this.init(true) }) }, - created(){ + created() { this.collapse = this.getCollapse() this.oldHeight = 0 - }, - // #ifndef VUE3 - // TODO vue2 - destroyed() { - if (this.__isUnmounted) return - this.uninstall() - }, + this.onClick(this.open, 'init') + }, + // #ifndef VUE3 + // TODO vue2 + destroyed() { + if (this.__isUnmounted) return + this.uninstall() + }, // #endif - // #ifdef VUE3 - // TODO vue3 - unmounted() { - this.__isUnmounted = true - this.uninstall() - }, + // #ifdef VUE3 + // TODO vue3 + unmounted() { + this.__isUnmounted = true + this.uninstall() + }, // #endif mounted() { if (!this.collapse) return @@ -181,14 +181,14 @@ }) } }, - onClick(isOpen,type) { + onClick(isOpen, type) { if (this.disabled) return this.isOpen = isOpen if (this.isOpen && this.collapse) { this.collapse.setAccordion(this) } - if(type !== 'init'){ - this.collapse.onChange(isOpen,this) + if (type !== 'init') { + this.collapse.onChange(isOpen, this) } }, getCollapseHeight(type, index = 0) { @@ -213,7 +213,7 @@ // #endif this.isheight = true if (type) return - this.onClick(this.open,'init') + this.onClick(this.isOpen, 'init') }) .exec() }, @@ -228,7 +228,7 @@ // #endif this.isheight = true if (type) return - this.onClick(this.open,'init') + this.onClick(this.open, 'init') } }) }, @@ -249,7 +249,7 @@ } - + diff --git a/uni_modules/uni-collapse/package.json b/uni_modules/uni-collapse/package.json index 59731d5b9abd39d5058be5eb78ad0562b8a7a7fb..65349cf9f7056e882abba6128c0dfc66fc244a91 100644 --- a/uni_modules/uni-collapse/package.json +++ b/uni_modules/uni-collapse/package.json @@ -1,88 +1,89 @@ -{ - "id": "uni-collapse", - "displayName": "uni-collapse 折叠面板", - "version": "1.3.3", - "description": "Collapse 组件,可以折叠 / 展开的内容区域。", - "keywords": [ - "uni-ui", - "折叠", - "折叠面板", - "手风琴" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } -} \ No newline at end of file +{ + "id": "uni-collapse", + "displayName": "uni-collapse 折叠面板", + "version": "1.4.3", + "description": "Collapse 组件,可以折叠 / 展开的内容区域。", + "keywords": [ + "uni-ui", + "折叠", + "折叠面板", + "手风琴" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-collapse/readme.md b/uni_modules/uni-collapse/readme.md index 12e872fb1d6f51bdb6fb8259043b1fa3c04b47a2..bc758ebc4f3eee187ee494de5745fe33b69bd3e0 100644 --- a/uni_modules/uni-collapse/readme.md +++ b/uni_modules/uni-collapse/readme.md @@ -8,269 +8,5 @@ 折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - `App` 端默认关闭组件动画 ,因为 `height` 动画开销比较大,会导致页面卡顿,请酌情使用动画 -> - 如在使用组件过程从发现卡顿严重,请尝试停用组件动画,问题原因如上 -> - 在小程序端组件内容发生变化,需要手动调用 resize() 方法,手动更新几点信息,避免出现内容错位 -> - 如需自定义组件默认边框颜色等,请使用插槽自定义内容并合理使用 `border ` 和 `title-border` 属性 -> - 折叠面板仅支持嵌套使用,请勿单独使用 -> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - - -### 基本用法 - -使用 `title` 属性指定面板显示内容 - -使用 `open` 属性默认打开当前面板 - -使用 `disabled` 属性禁用面板 - - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 手风琴效果 - -使用 `accordion` 属性,可以仅打开一个面板并关闭其他已经打开的面板,效果类似手风琴 - -设置 `accordion` 属性时,`open` 属性则生效在最后一个组件 - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 动态设置折叠面板打开状态 - -使用 `v-model` 属性,动态设置面板的显示状态 - -使用 `name` 属性设置每个面板的唯一标识,如不设置使用默认索引,从字符串 `"0"` 开始记数 - -**注意** - -- 如果 `accordion` 属性为 `true` 则 `v-model` 类型为 `String` -- 如果 `accordion` 属性为 `false` 则 `v-model` 类型为 `Array` -- 请注意 `v-model` 属性与 `open` 属性请勿一起使用 ,建议只使用 `v-model` - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -```javascript -export default { - data(){ - return { - value:['key1','key2'], - // 如果设置了 accordion 属性,则使用 string 类型 - // value:'key1' - } - } -} -``` - -### 使用动画 - -使用 `show-animation` 属性开启或关闭面板折叠动画,默认动画开启 - -**注意** - -- `App` 端默认关闭组件动画 ,因为 height 动画开销比较大,会导致页面卡顿,请酌情使用动画,如出现明显卡顿,尝试关闭动画 - - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 配置图片 - -使用 `thumb` 配置图片地址, 可在面板左侧显示一个图片 - -如需显示更多内容,如图标等,请见下方自定义插槽的说明 - -```html - - - - 折叠内容主体,可自定义内容及样式 - - - -``` - -### 自定义插槽 - -如果需要自定义面板显示,可以使用 `title` 插槽达成完全自定义。下面是一个使用 `uni-list` 的列表示例,需要引入 `uni-list` 组件 - -```html - - - - - - 折叠内容主体,可自定义内容及样式 - - - -``` - -**注意** - -- 在折叠面板组件中使用list时,在 App-Nvue 下请勿单独使用 uni-list-item,会导致组件无法正常显示,其他平台不做限制 -- 在默认插槽里使用 uni-list 组件与上方示例一样,直接写在默认插槽里即可 - -## API - -### Collapse Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|value/v-model|String/Array|-|当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)| -|accordion|Boolean|false|是否开启手风琴效果 | - -### Collapse Event - -|事件称名|说明|返回值| -|:-:|:-:|:-:| -|@change|切换面板时触发 |切换面板时触发,如果是手风琴模式,返回类型为string,否则为array| - -### Collapse Methods - -|方法名称|说明| -|:-:|:-:| -|resize |更新当前列表高度| - -> **提示** -> - resize 方法解决动态添加数据,带动画的折叠面板高度不更新的问题 -> - 需要在数据渲染完毕之后使用 `resize` 方法。推荐在 `this.$nextTick()` 中使用 -> - 当前只有小程序端需要调用此方法,H5\App 端已经做了处理,不需要手动更新高度 -> ```html -> -> -> -> -> {{content}} -> -> -> -> -> 折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。 -> -> -> -> -> -> ``` -> ```javascript -> export default { -> data() { -> return { -> value:['0'], -> content: '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。', -> } -> }, -> methods: { -> add() { -> if (this.content.length > 35) { -> this.content = '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。' -> } else { -> this.content = '折叠内容主体,这是一段比较长内容。通过点击按钮修改后内容后,使组件高度发生变化,在次点击按钮恢复之前的内容和高度。' -> } -> // TODO 小程序中不支持自动更新 ,需要手动resize 更新组件高度 -> // #ifdef MP -> this.$nextTick(() => { -> this.$refs.collapse.resize() -> }) -> // #endif -> } -> } -> } -> ``` - - -### CollapseItem Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|title|String|-|标题文字| -|thumb|String|-|标题左侧缩略图| -|disabled|Boolean|false|是否禁用| -|open|Boolean|false|是否展开面板| -|show-animation|Boolean|false|开启动画| -|border|Boolean|true|折叠面板内容分隔线| -|title-border|String|auto|折叠面板标题分隔线可选值见下方 **TitleBorder Params**| -|show-arrow|Boolean|true|是否显示右侧箭头| - -#### TitleBorder Params - -|参数名|说明| -|:-:|:-:| -|auto|分隔线自动显示| -|none|不显示分隔线| -|show|一直显示分隔线| - -### Collapse Slots - -|插槽名|说明| -|:-:| :-:| -|default|默认插槽| -|title|面板标题插槽,如使用此插槽禁用样式效果将失效| - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse](https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-combox/changelog.md b/uni_modules/uni-combox/changelog.md index 77cedbd7cc4b66c4dcb920ca4026f69ca4cc363c..15256a2e79a8bb35f08b25e22338183edd47a09f 100644 --- a/uni_modules/uni-combox/changelog.md +++ b/uni_modules/uni-combox/changelog.md @@ -1,5 +1,10 @@ -## 0.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.1(2021-11-23) +- 优化 label、label-width 属性 +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-combox](https://uniapp.dcloud.io/component/uniui/uni-combox) +## 0.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 0.0.6(2021-05-12) - 新增 组件示例地址 ## 0.0.5(2021-04-21) diff --git a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue index 3c201d3a2a178309089ddd3d9530dc6af9b06c02..98bf152e30457eb9c037d82859c69af4bdfb9fec 100644 --- a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue +++ b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue @@ -1,22 +1,26 @@ @@ -35,8 +39,12 @@ */ export default { name: 'uniCombox', - emits:['input','update:modelValue'], + emits: ['input', 'update:modelValue'], props: { + border: { + type: Boolean, + default: true + }, label: { type: String, default: '' @@ -81,11 +89,9 @@ computed: { labelStyle() { if (this.labelWidth === 'auto') { - return {} - } - return { - width: this.labelWidth + return "" } + return `width: ${this.labelWidth}` }, filterCandidates() { return this.candidates.filter((item) => { @@ -144,10 +150,15 @@ diff --git a/uni_modules/uni-combox/package.json b/uni_modules/uni-combox/package.json index 951a901598afdd9aac83954b290f6aca402fcbec..3fed6140a9c50c12004ce4f5f169e0d57d4efe1e 100644 --- a/uni_modules/uni-combox/package.json +++ b/uni_modules/uni-combox/package.json @@ -1,7 +1,7 @@ { "id": "uni-combox", "displayName": "uni-combox 组合框", - "version": "0.1.0", + "version": "1.0.1", "description": "可以选择也可以输入的表单项 ", "keywords": [ "uni-ui", @@ -42,6 +42,7 @@ }, "uni_modules": { "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -78,6 +79,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-combox/readme.md b/uni_modules/uni-combox/readme.md index edab4d409d273103f364792c5b891f9da57644bf..ffa2cc864bd3b883cede1b9243b114ecf608a275 100644 --- a/uni_modules/uni-combox/readme.md +++ b/uni_modules/uni-combox/readme.md @@ -7,46 +7,5 @@ 组合框组件。 -### 平台兼容性说明 - -**暂不支持nvue** - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 -```html - -``` - -## API - -### Combox Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|label |String |- |标签文字 | -|value |String |- |combox的值 | -|labelWidth |String |auto |标签宽度,有单位字符串,如:'100px' | -|placeholder|String |- |输入框占位符 | -|candidates |Array/String |[] |候选字段 | -|emptyTips |String |无匹配项 |无匹配项时的提示语 | - -### Combox Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@input |combox输入事件 |返回combox值| - - - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox](https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-combox) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-countdown/changelog.md b/uni_modules/uni-countdown/changelog.md index e551725b461a2e2b5e52dec681e5585e6705794a..f25beefca64d4da9c8617324d652dff3b2ab3f36 100644 --- a/uni_modules/uni-countdown/changelog.md +++ b/uni_modules/uni-countdown/changelog.md @@ -1,3 +1,13 @@ +## 1.2.2(2022-01-19) +- 修复 在微信小程序中样式不生效的bug +## 1.2.1(2022-01-18) +- 新增 update 方法 ,在动态更新时间后,刷新组件 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-countdown](https://uniapp.dcloud.io/component/uniui/uni-countdown) +## 1.1.3(2021-10-18) +- 重构 +- 新增 font-size 支持自定义字体大小 ## 1.1.2(2021-08-24) - 新增 支持国际化 ## 1.1.1(2021-07-30) diff --git a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue index 1f916bd5e8ac788c749b0f8882bd69fc7e31dd86..5f63365e338108d39d1b8b7e4cd98ae70df7faf8 100644 --- a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue +++ b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue @@ -1,25 +1,23 @@ + diff --git a/uni_modules/uni-countdown/package.json b/uni_modules/uni-countdown/package.json index 7960b62e9ff41de8976a2f4e3ba1d2ea00f06668..70e99ee7cf615d5a60a69c3dc9495cdf0d75de7b 100644 --- a/uni_modules/uni-countdown/package.json +++ b/uni_modules/uni-countdown/package.json @@ -1,7 +1,7 @@ { "id": "uni-countdown", "displayName": "uni-countdown 倒计时", - "version": "1.1.2", + "version": "1.2.2", "description": "CountDown 倒计时组件", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-countdown/readme.md b/uni_modules/uni-countdown/readme.md index 25c2a3a2756009668fe23208a4aab6048f088d10..4bcb1aa71694bf71daad7a822897d29485f5b74d 100644 --- a/uni_modules/uni-countdown/readme.md +++ b/uni_modules/uni-countdown/readme.md @@ -4,54 +4,7 @@ > **组件名:uni-countdown** > 代码块: `uCountDown` - 倒计时组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - - -``` - -## API - -### Countdown Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|backgroundColor |String |#FFFFFF|背景色 | -|color |String |#000000|文字颜色 | -|splitorColor |String |#000000|分割符号颜色 | -|day |Number |0 |天数 | -|hour |Number |0 |小时 | -|minute |Number |0 |分钟 | -|second |Number |0 |秒 | -|showDay |Boolean|true |是否显示天数 | -|showColon |Boolean|true |是否以冒号为分隔符 | -|start |Boolean|true |是否初始化组件后就开始倒计时| - -### Countdown Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@timeup|倒计时时间到触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown](https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-countdown) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md index 47e9f4c23dc963643fed6b72abda998b61656360..d8f420b9a6cfec68b7fd755ab516f26f8f2dfd39 100644 --- a/uni_modules/uni-data-checkbox/changelog.md +++ b/uni_modules/uni-data-checkbox/changelog.md @@ -1,36 +1,41 @@ +## 1.0.1(2022-02-07) +- 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-checkbox](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox) ## 0.2.5(2021-08-23) - 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题 ## 0.2.4(2021-08-17) - 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题 -## 0.2.3(2021-08-11) -- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 -## 0.2.2(2021-07-30) -- 优化 在uni-forms组件,与label不对齐的问题 -## 0.2.1(2021-07-27) -- 修复 单选默认值为0不能选中的Bug -## 0.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 0.1.11(2021-07-06) -- 优化 删除无用日志 -## 0.1.10(2021-07-05) -- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题 -## 0.1.9(2021-07-05) -- 修复 nvue 黑框样式问题 -## 0.1.8(2021-06-28) -- 修复 selectedTextColor 属性不生效的Bug -## 0.1.7(2021-06-02) -- 新增 map 属性,可以方便映射text/value属性 -## 0.1.6(2021-05-26) -- 修复 不关联服务空间的情况下组件报错的Bug -## 0.1.5(2021-05-12) -- 新增 组件示例地址 -## 0.1.4(2021-04-09) -- 修复 nvue 下无法选中的问题 -## 0.1.3(2021-03-22) -- 新增 disabled属性 -## 0.1.2(2021-02-24) -- 优化 默认颜色显示 -## 0.1.1(2021-02-24) -- 新增 支持nvue -## 0.1.0(2021-02-18) -- “暂无数据”显示居中 +## 0.2.3(2021-08-11) +- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 +## 0.2.2(2021-07-30) +- 优化 在uni-forms组件,与label不对齐的问题 +## 0.2.1(2021-07-27) +- 修复 单选默认值为0不能选中的Bug +## 0.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 0.1.11(2021-07-06) +- 优化 删除无用日志 +## 0.1.10(2021-07-05) +- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题 +## 0.1.9(2021-07-05) +- 修复 nvue 黑框样式问题 +## 0.1.8(2021-06-28) +- 修复 selectedTextColor 属性不生效的Bug +## 0.1.7(2021-06-02) +- 新增 map 属性,可以方便映射text/value属性 +## 0.1.6(2021-05-26) +- 修复 不关联服务空间的情况下组件报错的Bug +## 0.1.5(2021-05-12) +- 新增 组件示例地址 +## 0.1.4(2021-04-09) +- 修复 nvue 下无法选中的问题 +## 0.1.3(2021-03-22) +- 新增 disabled属性 +## 0.1.2(2021-02-24) +- 优化 默认颜色显示 +## 0.1.1(2021-02-24) +- 新增 支持nvue +## 0.1.0(2021-02-18) +- “暂无数据”显示居中 diff --git a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue index 7d3d52ece4b778e5521347aeaa737bb16aef5d90..300cb5fe6e7e31a60b2bc2c9a15b48dc15ac4315 100644 --- a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue +++ b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue @@ -65,15 +65,9 @@ * @event {Function} change 选中发生变化触发 */ - // import clientdb from './clientdb.js' export default { name: 'uniDataChecklist', - // mixins: [clientdb], mixins: [uniCloud.mixinDatacom || {}], - // model: { - // prop: 'modelValue', - // event: 'update:modelValue' - // }, emits:['input','update:modelValue','change'], props: { mode: { @@ -185,8 +179,8 @@ }, isLocal:true, styles: { - selectedColor: '#007aff', - selectedTextColor: '#333', + selectedColor: '#2979ff', + selectedTextColor: '#666', }, isTop:0 }; @@ -381,7 +375,7 @@ selectedArr.push(item[this.map.value]) } }) - return this.dataValue.length > 0 ? this.dataValue : selectedArr + return this.dataValue && this.dataValue.length > 0 ? this.dataValue : selectedArr }, /** @@ -389,7 +383,7 @@ */ setStyleBackgroud(item) { let styles = {} - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' if (this.mode !== 'list') { styles['border-color'] = item.selected?selectedColor:'#DCDFE6' } @@ -405,7 +399,7 @@ setStyleIcon(item) { let styles = {} let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' styles['background-color'] = item.selected?selectedColor:'#fff' styles['border-color'] = item.selected?selectedColor:'#DCDFE6' @@ -422,11 +416,11 @@ setStyleIconText(item) { let styles = {} let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' if (this.mode === 'tag') { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#333' + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666' } else { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#333' + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666' } if(!item.selected && item.disabled){ styles.color = '#999' @@ -454,7 +448,7 @@ + + /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ + /* #ifndef APP-NVUE */ + .uni-popper__arrow, + .uni-popper__arrow::after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 6px; + } + + .uni-popper__arrow { + filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); + top: -6px; + left: 10%; + margin-right: 3px; + border-top-width: 0; + border-bottom-color: #EBEEF5; + } + + .uni-popper__arrow::after { + content: " "; + top: 1px; + margin-left: -6px; + border-top-width: 0; + border-bottom-color: #fff; + } + /* #endif */ + diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue index 8efd48390ca4792c60746ce822591b964dcafa76..e1803010e673e1b6338bffd60de977af6f39923d 100644 --- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue +++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue @@ -58,10 +58,10 @@ managedMode: { type: Boolean, default: false - }, - ellipsis: { - type: Boolean, - default: true + }, + ellipsis: { + type: Boolean, + default: true } }, data() { @@ -177,7 +177,7 @@ } } - + diff --git a/uni_modules/uni-data-picker/package.json b/uni_modules/uni-data-picker/package.json index 0647354f763695637a2be5949772fdb225ade9c0..d1af059e314d3646ab68969579428ce30bef8172 100644 --- a/uni_modules/uni-data-picker/package.json +++ b/uni_modules/uni-data-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-data-picker", "displayName": "uni-data-picker 数据驱动的picker选择器", - "version": "0.4.9", + "version": "1.0.4", "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", "keywords": [ "uni-ui", @@ -44,7 +44,8 @@ "uni_modules": { "dependencies": [ "uni-load-more", - "uni-icons" + "uni-icons", + "uni-scss" ], "encrypt": [], "platforms": { diff --git a/uni_modules/uni-data-picker/readme.md b/uni_modules/uni-data-picker/readme.md index d466274845937e7252a71fbba177b8aff548e736..6cda22406a331df00284904e3955b0d2a2cb37e9 100644 --- a/uni_modules/uni-data-picker/readme.md +++ b/uni_modules/uni-data-picker/readme.md @@ -18,269 +18,5 @@ 在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。 - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -> - `` 内部包含了弹出层组件 `` 外层的布局可能会影响弹出层,[详情](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Common_CSS_Questions) - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`componets`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -## API - -### DataPicker Props - -|属性名 | 类型 | 可选值 | 默认值 | 说明| -|:-: | :-: |:-: | :-: | :-: | -|v-model |String/ Number | - | - |绑定数据| -|spaceInfo |Object | | |服务空间配置,[详情](https://uniapp.dcloud.net.cn/uniCloud/init)| -|localdata |Array | | |数据,[详情](https://gitee.com/dcloud/datacom)| -|preload |Boolean | true/false | false |预加载数据| -|readonly |Boolean | true/false | false |是否禁用| -|clear-icon |Boolean | true/false | true |是否显示清除按钮| -|ellipsis |Boolean | true/false | true |是否隐藏 tab 标签过长的文本| -|step-searh |Boolean | true/false | true |分步查询时,点击节点请求数据| -|step-search-url |String | | |分步查询时,动态加载云端数据url格式,`https://xxx.com/{parentValue}`(当前版本暂不支持,下版支持)| -|self-field |String | | |分步查询时当前字段名称| -|parent-field |String | | |分步查询时父字段名称| -|collection |String | | |表名。支持输入多个表名,用 `,` 分割| -|field |String | | |查询字段,多个字段用 `,` 分割| -|where |String | | |查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=jsquery)| -|orderby |String | | |排序字段及正序倒叙设置| -|popup-title |String | | |弹出层标题| -|map |Object | |{text:'text',value:'value'}|字段映射,将text/value映射到数据中的其他字段| - -> **** -> `collection/where/orderby` 和 `` 的用法一致,[详情](https://uniapp.dcloud.net.cn/uniCloud/unicloud-db) - - - -### DataPicker Events - -|事件称名 | 类型 | 说明 | -|:-: | :-: | :-: | -|@change |EventHandle | 选择完成时触发 {detail: {value}} | -|@nodeclick |EventHandle | 节点被点击时触发 | -|@stepsearch |EventHandle | 动态加载节点数据前触发(当前版本暂不支持,下版支持) | -|@popupopened |EventHandle | 弹出层弹出时触发 | -|@popupclosed |EventHandle | 弹出层关闭时触发 | - -### DataPicker Methods - -|方法称名 |说明|参数| -|:-:|:-:|:-:| -|show|打开弹出层|-| -|hide|关闭弹出层|-| -|clear|清除已选项|-| - -**使用方法:** -```js -this.$refs.picker.show() // `picker` 为组件的 ref 名称 -``` - -### DataPicker Slots - -|名称|说明| -|:-:|:-:| -|default|覆盖显示框内容| - - -### 基本用法 - -#### 云端数据 - -> **注意事项** -> - 云端数据需要关联服务空间 -> - 下面示例中使用的表 `opendb-city-china`(中国城市省市区数据,含港澳台), 在[uniCloud控制台](https://unicloud.dcloud.net.cn/)使用opendb创建,[详情](https://gitee.com/dcloud/opendb) - - -```html - -``` - -```js - - -``` - - - - - -#### 本地数据 - -```html - -``` - -```js - - -``` - - -#### 自定义solt - -```html - - - {{error}} - - - - {{item.text}} - - - - 请选择 - - -``` - - -> **注意事项** -> `localdata` 和 `collection` 同时配置时,`localdata` 优先 - - - -#### 完整示例 - -```html - -``` - -```js - - -``` - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-dateformat/changelog.md b/uni_modules/uni-dateformat/changelog.md index 7006d13a0854c4f636bef64670a4de41526789db..d551d7b88687002c2177d9bcba31b7ae2c3fca44 100644 --- a/uni_modules/uni-dateformat/changelog.md +++ b/uni_modules/uni-dateformat/changelog.md @@ -1,3 +1,6 @@ +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat) ## 0.0.5(2021-07-08) - 调整 默认时间不再是当前时间,而是显示'-'字符 ## 0.0.4(2021-05-12) diff --git a/uni_modules/uni-dateformat/package.json b/uni_modules/uni-dateformat/package.json index 93023ad9aa63054e368339ae0407d1f97abf584d..99b9df35ac51f1426cd90d96cd764b9d7a3d3dfa 100644 --- a/uni_modules/uni-dateformat/package.json +++ b/uni_modules/uni-dateformat/package.json @@ -1,7 +1,7 @@ { "id": "uni-dateformat", "displayName": "uni-dateformat 日期格式化", - "version": "0.0.5", + "version": "1.0.0", "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式", "keywords": [ "uni-ui", @@ -42,7 +42,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -77,6 +77,10 @@ "快应用": { "华为": "y", "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-dateformat/readme.md b/uni_modules/uni-dateformat/readme.md index 7d2da4aa033e718269d8d3d662ce98b4e788c234..37ddb6ecef2875ce33687da3f815de4274d25914 100644 --- a/uni_modules/uni-dateformat/readme.md +++ b/uni_modules/uni-dateformat/readme.md @@ -7,71 +7,5 @@ 日期格式化组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - -``` - -## API - -### Dateformat Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|date |Object|String|Number |Date.now() |要格式化的日期对象/日期字符串/时间戳 | -|threshold |Array |[0, 0] |转化类型阈值 | -|format |String |'yyyy/MM/dd hh:mm:ss' |格式字符串 | -|locale |String |zh |格式化使用的语言,目前支持zh(中文)、en(英文) | - - -#### Threshold Options - -格式化组件会对时间进行用户友好转化,threshold就是用来控制转化的时间阈值的。 - -以`[60000, 3600000]`为例,将传入时间与当前时间差的绝对值记为delta(单位毫秒) - -- `delta < 60000`时,时间会被转化为“刚刚|马上” -- `delta >= 60000 && delta < 3600000`时,时间会被转化为“xx分钟前|xx分钟后”,如果超过1小时会显示成“xx小时前|xx小时后”,以此类推 -- `delta >= 3600000`时,会按照format参数传入的格式进行格式化 - -如果不想转化为“马上|刚刚”可以传入`:threshold = "[0,3600000]"`。默认值`[0,0]`既不会转换为“马上|刚刚”也不会转化为“xx分钟前|xx分钟后” - -#### Format Options - -format接收字符以及含义如下: - -|字符 |说明 | -|:-: |:-: | -|yyyy |四位年份 | -|yy |两位年份 | -|MM |两位月份(不足两位在前面补0) | -|M |月份,不自动补0 | -|dd |两位天(不足两位在前面补0) | -|d |天,不自动补0 | -|hh |两位小时(不足两位在前面补0) | -|h |小时,不自动补0 | -|mm |两位分钟(不足两位在前面补0) | -|m |分钟,不自动补0 | -|ss |两位秒(不足两位在前面补0) | -|s |秒,不自动补0 | -|SSS |三位毫秒(不足三位在前面补0) | -|S |毫秒,不自动补0 | - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat](https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md index 4182e0c2148f2f6a623c69fddb1d06a778170689..9611a30e6268e12a6e6612f793243608c4e34acd 100644 --- a/uni_modules/uni-datetime-picker/changelog.md +++ b/uni_modules/uni-datetime-picker/changelog.md @@ -1,3 +1,16 @@ +## 2.2.4(2022-03-31) +- 修复 Vue3 下动态赋值,单选类型未响应的 bug +## 2.2.3(2022-03-28) +- 修复 Vue3 下动态赋值未响应的 bug +## 2.2.2(2021-12-10) +- 修复 clear-icon 属性在小程序平台不生效的 bug +## 2.2.1(2021-12-10) +- 修复 日期范围选在小程序平台,必须多点击一次才能取消选中状态的 bug +## 2.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-datetime-picker](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) +## 2.1.5(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 ## 2.1.4(2021-09-10) - 修复 hide-second 在移动端的 bug - 修复 单选赋默认值时,赋值日期未高亮的 bug diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue index 7c9a093c898e3b039f65c3f67e1449d529b80685..1c95c68decb8f8deead93caf8f750f0c87721e43 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue @@ -6,7 +6,6 @@ 'uni-calendar-item--after-checked-x':weeks.afterMultiple, }" @click="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)"> - {{weeks.date}} + {{weeks.date}} + @@ -61,7 +61,7 @@ } - diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue index d04b9cf23ba1d2aec7082721506bdd3ac6d4f835..548849d84637cb25828dbc27e3dfe777f3e0d741 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue @@ -3,26 +3,30 @@ - - + :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}"> + - {{ (nowDate.year||'') +' / '+( nowDate.month||'')}} + {{ (nowDate.year||'') + ' 年 ' + ( nowDate.month||'') +' 月'}} - + + + + + {{nowDate.month}} - + {{SUNText}} @@ -66,22 +70,23 @@ {{tempRange.before ? tempRange.before : startDateText}} - + {{tempRange.after ? tempRange.after : endDateText}} - + - - + + + 确认 @@ -187,10 +192,10 @@ checkHover: { type: Boolean, default: true - }, - hideSecond: { - type: [Boolean], - default: false + }, + hideSecond: { + type: [Boolean], + default: false }, pleStatus: { type: Object, @@ -228,25 +233,25 @@ date: { immediate: true, handler(newVal, oldVal) { - if (!this.range) { + if (!this.range) { this.tempSingleDate = newVal setTimeout(() => { this.init(newVal) }, 100) } } - }, - defTime: { - immediate: true, - handler(newVal, oldVal) { - if (!this.range) { - this.time = newVal - } else { - // console.log('-----', newVal); - this.timeRange.startTime = newVal.start - this.timeRange.endTime = newVal.end - } - } + }, + defTime: { + immediate: true, + handler(newVal, oldVal) { + if (!this.range) { + this.time = newVal + } else { + // console.log('-----', newVal); + this.timeRange.startTime = newVal.start + this.timeRange.endTime = newVal.end + } + } }, startDate(val) { this.cale.resetSatrtDate(val) @@ -361,7 +366,6 @@ }) // 选中某一天 // this.cale.setDate(this.date) - this.init(this.date) // this.setDay }, @@ -411,8 +415,8 @@ } else { this.time = '' this.tempSingleDate = '' - } - this.calendar.fullDate = '' + } + this.calendar.fullDate = '' this.setDate() }, @@ -425,7 +429,6 @@ * @param {Object} date */ init(date) { - this.cale.setDate(date) this.weeks = this.cale.weeks this.nowDate = this.calendar = this.cale.getInfo(date) @@ -591,7 +594,7 @@ } - + + .dialog-close { + position: absolute; + top: 0; + right: 0; + bottom: 0; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + align-items: center; + padding: 0 25px; + margin-top: 10px; + } + + .dialog-close-plus { + width: 16px; + height: 2px; + background-color: #737987; + border-radius: 2px; + transform: rotate(45deg); + } + + .dialog-close-rotate { + position: absolute; + transform: rotate(-45deg); + } + + .uni-datetime-picker--btn { + border-radius: 100px; + height: 40px; + line-height: 40px; + background-color: #007aff; + color: #fff; + font-size: 16px; + letter-spacing: 5px; + } + + /* #ifndef APP-NVUE */ + .uni-datetime-picker--btn:active { + opacity: 0.7; + } + /* #endif */ + diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue index 362b4f8fec775694bbea28c913f763400f15623f..987bba61ccf05ffb0ae20bed64553dcc192e5752 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue @@ -5,16 +5,12 @@ - + - + @@ -23,9 +19,8 @@ - - + + @@ -34,7 +29,8 @@ - + + - + {{okText}} @@ -54,7 +50,8 @@ - + + @@ -77,14 +74,13 @@ - - + + {{clearText}} @@ -92,7 +88,7 @@ - @@ -104,10 +100,10 @@ * @description 同时支持 PC 和移动端使用日历选择日期和日期范围 * @tutorial https://ext.dcloud.net.cn/plugin?id=3962 * @property {String} type 选择器类型 - * @property {String|Array} value 绑定值 + * @property {String|Number|Array|Date} value 绑定值 * @property {String} placeholder 单选择时的占位内容 * @property {String} start 起始时间 - * @property {String} start 终止时间 + * @property {String} end 终止时间 * @property {String} start-placeholder 范围选择时开始日期的占位内容 * @property {String} end-placeholder 范围选择时结束日期的占位内容 * @property {String} range-separator 选择范围时的分隔符 @@ -115,6 +111,9 @@ * @property {Boolean} disabled = [true|false] 是否禁用 * @property {Boolean} clearIcon = [true|false] 是否显示清除按钮(仅PC端适用) * @event {Function} change 确定日期时触发的事件 + * @event {Function} show 打开弹出层 + * @event {Function} close 关闭弹出层 + * @event {Function} clear 清除上次选中的状态和值 **/ import calendar from './calendar.vue' import timePicker from './time-picker.vue' @@ -180,7 +179,6 @@ isEmitValue: false, isPhone: false, isFirstShow: true, - iconBase64: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAACVklEQVRoge2Zv2vTQRTAP4oWJQQskmolBAnSQVMcSxbp4ubmIEWETu0oIjg5iIOgpLNunfQfMHToUgpOVgfRqRAL4q8WRLQVq4sOdyHPL9/7evfNJReS+8DB433v7r37fl/eu9xBJBKUB0BLt+uDaOOQZb8SUNXyuKuRftg46NeXcBww6M8AC0ANOAycAyb1s7e6+SbNxi/gBfAQ2HadcA7YB/4MUPsKzLos4jzwewAcNy3mhMnx5I/9BiqUAD4DDWAXmAfqWt8Enlq+GBfSbEwAt4AicAxYBO7aTPaGzhu4KvTLQn/Hh9cpmGzcFvqmaXAyaxWE/MGTg93yXsgFUyfbOrJCJ2s8y+tRP21s0fmMTlmih8zT8WnN1GloCmJWaF0CpvrlSAb1/3fJXshNT470hZEIrZeoahqaU8BZ10Exa4XGtiCaKKL+EIHaMX8U81ZEP7ntrwi7n4CfWi7p+UCFdFdh7Rpaps9+mn93rjY2THut0QqtoVlIkpi1QjNyCzEdnl0W+idCXxb6VmKudaGfsbBhRbcHdEWhf5eYt0o6FVR6BjhqYcOKoQkt2y/SAB5rWVbpVeCilmUl3hb6JNeAI1p+ZWEjFzH9hsY2tEwHdHX9DGATWNLyceCeGL/YhY+58LWhy9o0uhJDKw3T4dlr4L6WZab5JvRBGJqs9UPI5R44lQfpx56pUzK0NlA3R6AK1Engu1+/nGhfK7R5bjtwGnXdFfpSJ6190Quz5grqQCC048lFXMhy2nQZWkUVsRowZv8OvLOPCvdHwE5APyKRSMQzfwE22DtT3T5PPwAAAABJRU5ErkJggg==' } }, props: { @@ -235,10 +233,10 @@ clearIcon: { type: [Boolean], default: true - }, - hideSecond: { - type: [Boolean], - default: false + }, + hideSecond: { + type: [Boolean], + default: false } }, watch: { @@ -257,6 +255,7 @@ } } }, + // #ifndef VUE3 value: { immediate: true, handler(newVal, oldVal) { @@ -267,7 +266,19 @@ this.initPicker(newVal) } }, - + // #endif + // #ifdef VUE3 + modelValue: { + immediate: true, + handler(newVal, oldVal) { + if (this.isEmitValue) { + this.isEmitValue = false + return + } + this.initPicker(newVal) + } + }, + // #endif start: { immediate: true, handler(newVal, oldVal) { @@ -282,7 +293,6 @@ } } }, - end: { immediate: true, handler(newVal, oldVal) { @@ -309,7 +319,7 @@ const res = activeDate === this.caleRange.endDate ? this.caleRange.endTime : '' return res }, - reactMobDefTime() { + reactMobDefTime() { const times = { start: this.tempRange.startTime, end: this.tempRange.endTime @@ -363,6 +373,16 @@ }, clearText() { return t("uni-datetime-picker.clear") + }, + showClearIcon() { + const { + clearIcon, + disabled, + singleVal, + range + } = this + const bool = clearIcon && !disabled && (singleVal || (range.startDate && range.endDate)) + return bool } }, created() { @@ -377,7 +397,7 @@ // } }, mounted() { - this.platform() + this.platform() }, methods: { /** @@ -437,7 +457,7 @@ }) this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, { which: 'left' - }) + }) } }, updateLeftCale(e) { @@ -493,7 +513,7 @@ } } - }, 20) + }, 50) }, close() { @@ -685,9 +705,9 @@ this.tempSingleDate = '' this.time = '' if (this.isPhone) { - this.$refs.mobile.clearCalender() + this.$refs.mobile && this.$refs.mobile.clearCalender() } else { - this.$refs.pcSingle.clearCalender() + this.$refs.pcSingle && this.$refs.pcSingle.clearCalender() } if (needEmit) { this.formItem && this.formItem.setValue('') @@ -698,16 +718,16 @@ } else { this.range.startDate = '' this.range.endDate = '' - this.tempRange.startDate= '' - this.tempRange.startTime= '' - this.tempRange.endDate= '' - this.tempRange.endTime= '' + this.tempRange.startDate = '' + this.tempRange.startTime = '' + this.tempRange.endDate = '' + this.tempRange.endTime = '' if (this.isPhone) { - this.$refs.mobile.clearCalender() + this.$refs.mobile && this.$refs.mobile.clearCalender() } else { - this.$refs.left.clearCalender() - this.$refs.right.clearCalender() - this.$refs.right.next() + this.$refs.left && this.$refs.left.clearCalender() + this.$refs.right && this.$refs.right.clearCalender() + this.$refs.right && this.$refs.right.next() } if (needEmit) { this.formItem && this.formItem.setValue([]) @@ -728,7 +748,8 @@ const minute = defVal.getMinutes() const second = defVal.getSeconds() const defDate = year + '-' + this.lessTen(month) + '-' + this.lessTen(day) - const defTime = this.lessTen(hour) + ':' + this.lessTen(minute) + (this.hideSecond ? '' : (':' + this.lessTen(second))) + const defTime = this.lessTen(hour) + ':' + this.lessTen(minute) + (this.hideSecond ? '' : (':' + this + .lessTen(second))) return { defDate, defTime @@ -782,12 +803,11 @@ .uni-date-editor--x .uni-date__icon-clear { position: absolute; - top: 5px; + top: 0; right: 0; display: inline-block; box-sizing: border-box; - border: 6px solid transparent; - margin-right: 6px; + border: 9px solid transparent; /* #ifdef H5 */ cursor: pointer; /* #endif */ @@ -846,8 +866,8 @@ position: absolute; top: 0; z-index: 999; - border: 1px solid #e4e7ed; - box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%); + border: 1px solid #EBEEF5; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 4px; } @@ -857,8 +877,8 @@ position: absolute; top: 0; z-index: 999; - border: 1px solid #e4e7ed; - box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%); + border: 1px solid #EBEEF5; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 4px; } @@ -899,7 +919,7 @@ border-top-color: #F1F1F1; border-top-style: solid; border-top-width: 1px; - background-color: #fff; + /* background-color: #fff; */ line-height: 40px; text-align: right; color: #666; @@ -917,7 +937,7 @@ } .uni-date-changed { - background-color: #fff; + /* background-color: #fff; */ text-align: center; color: #333; border-bottom-color: #F1F1F1; @@ -946,7 +966,32 @@ margin-right: 50px; } - .uni-date_calendar-pc { - padding: 0 6px; + /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ + .uni-popper__arrow, + .uni-popper__arrow::after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 6px; + } + + .uni-popper__arrow { + filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); + top: -6px; + left: 10%; + margin-right: 3px; + border-top-width: 0; + border-bottom-color: #EBEEF5; + } + + .uni-popper__arrow::after { + content: " "; + top: 1px; + margin-left: -6px; + border-top-width: 0; + border-bottom-color: #fff; } - + diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js index 18b91c36d5177db28f7a36fcad300a06973be3b5..882f006419cca0145b8ec3c775b86547de16f930 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js @@ -1,5 +1,3 @@ -import CALENDAR from './calendar.js' - class Calendar { constructor({ date, @@ -112,7 +110,6 @@ class Calendar { dateArr.push({ date: beforeDate, month: full.month - 1, - lunar: this.getlunar(full.year, full.month - 1, beforeDate), disable: true }) } @@ -123,7 +120,7 @@ class Calendar { */ _currentMonthDys(dateData, full) { let dateArr = [] - let fullDate = this.date.fullDate + let fullDate = this.date.fullDate for (let i = 1; i <= dateData; i++) { let isinfo = false let nowDate = full.year + '-' + (full.month < 10 ? @@ -164,16 +161,15 @@ class Calendar { if (multiplesStatus !== -1) { checked = true } - } + } let data = { fullDate: nowDate, year: full.year, date: i, multiple: this.range ? checked : false, - beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate), - afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate), + beforeMultiple: this.isLogicBefore(nowDate, this.multipleStatus.before, this.multipleStatus.after), + afterMultiple: this.isLogicAfter(nowDate, this.multipleStatus.before, this.multipleStatus.after), month: full.month, - lunar: this.getlunar(full.year, full.month, i), disable: !(disableBefore && disableAfter), isDay, userChecked: false @@ -195,7 +191,6 @@ class Calendar { dateArr.push({ date: i, month: Number(full.month) + 1, - lunar: this.getlunar(full.year, Number(full.month) + 1, i), disable: true }) } @@ -243,7 +238,26 @@ class Calendar { return false } } - + + /** + * 比较真实起始日期 + */ + + isLogicBefore(currentDay, before, after) { + let logicBefore = before + if (before && after) { + logicBefore = this.dateCompare(before, after) ? before : after + } + return this.dateEqual(logicBefore, currentDay) + } + + isLogicAfter(currentDay, before, after) { + let logicAfter = after + if (before && after) { + logicAfter = this.dateCompare(before, after) ? after : before + } + return this.dateEqual(logicAfter, currentDay) + } /** * 获取日期范围内所有日期 @@ -266,19 +280,6 @@ class Calendar { } return arr } - /** - * 计算阴历日期显示 - */ - getlunar(year, month, date) { - return CALENDAR.solar2lunar(year, month, date) - } - /** - * 设置打点 - */ - setSelectInfo(data, value) { - this.selected = value - this._getWeek(data) - } /** * 获取多选状态 @@ -287,8 +288,7 @@ class Calendar { let { before, after - } = this.multipleStatus - + } = this.multipleStatus if (!this.range) return if (before && after) { if (!this.lastHover) { @@ -301,9 +301,9 @@ class Calendar { this.multipleStatus.fulldate = '' this.lastHover = false } else { - this.lastHover = false if (!before) { - this.multipleStatus.before = fullDate + this.multipleStatus.before = fullDate + this.lastHover = false } else { this.multipleStatus.after = fullDate if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) { @@ -312,7 +312,8 @@ class Calendar { } else { this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus .before); - } + } + this.lastHover = true } } this._getWeek(fullDate) diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json index 5c3f88af904d968676dc85190e678c1ff9d279f1..0e441033789e2b94eb848d35a67131213b78cda2 100644 --- a/uni_modules/uni-datetime-picker/package.json +++ b/uni_modules/uni-datetime-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-datetime-picker", "displayName": "uni-datetime-picker 日期选择器", - "version": "2.1.4", + "version": "2.2.4", "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", "keywords": [ "uni-datetime-picker", @@ -42,6 +42,7 @@ }, "uni_modules": { "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], diff --git a/uni_modules/uni-datetime-picker/readme.md b/uni_modules/uni-datetime-picker/readme.md index 37b5344b918841aaeda9d64495e624b9e2d86ccf..162fbefaa37da718b549160cfe60c8a2fd30d4e6 100644 --- a/uni_modules/uni-datetime-picker/readme.md +++ b/uni_modules/uni-datetime-picker/readme.md @@ -1,6 +1,9 @@ + > `重要通知:组件升级更新 2.0.0 后,支持日期+时间范围选择,组件 ui 将使用日历选择日期,ui 变化较大,同时支持 PC 和 移动端。此版本不向后兼容,不再支持单独的时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)。若仍需使用旧版本,可在插件市场下载*非uni_modules版本*,旧版本将不再维护` + ## DatetimePicker 时间选择器 + > **组件名:uni-datetime-picker** > 代码块: `uDatetimePicker` @@ -9,151 +12,10 @@ 若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。 - -___点击 picker 默认值规则:___ +**_点击 picker 默认值规则:_** - 若设置初始值 value, 会显示在 picker 显示框中 - 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - -``` - -## API - -### DatetimePicker Props - -|属性名 |类型 |默认值 |值域 |说明 | -|:-: |:-: |:-: | |:-: | -|type |String |datetime |date/daterange/datetime/datetimerange|选择器类型 | -|value |String、Number、Array(范围选择)、Date|- |- |输入框当前值 | -|start |String、Number |- |- |最小值,可以使用日期的字符串(String)、时间戳(Number) | -|end |String、Number |- |- |最大值,可以使用日期的字符串(String)、时间戳(Number) | -|return-type |String |string |timestamp 、string、date |返回值格式 | -|border |Boolean |true | |是否有边框 | -|rangeSeparator |String |'-' |- |选择范围时的分隔符 | -|placeholder |String |- |- |非范围选择时的占位内容 | -|start-placeholder|String |- |- |范围选择时开始日期的占位内容 | -|end-placeholder |String |- |- |范围选择时结束日期的占位内容 | -|disabled |Boolean |false | |是否不可选择 | -|clear-icon |Boolean |true | |是否显示清除按钮 | -|hide-second |Boolean |false | |是否显示秒,只显示时分 | - - - - -### DatetimePicker Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|change |确定日期时间时触发的事件,参数为当前选择的日期对象 |单选返回日期字符串,如:'2010-02-3';范围选返回日期字符串数组,如:['2020-10-1', '2021-4-1'] | -|maskClick|点击遮罩层触发 |- | - -### Popup Methods - -|方法称名 |说明|参数| -|:-:|:-:|:-:| -|show|打开弹出层|-| -|close|关闭弹出层 |-| -|clear|清除上次选中的状态和值|-| - - ### - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/datetime-picker/datetime-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/datetime-picker/datetime-picker) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-drawer/changelog.md b/uni_modules/uni-drawer/changelog.md index 4077ce1c7bc2395b11e54e36fe987409da90d421..b9e7637ed06e631102495c11b01ba577f2617b37 100644 --- a/uni_modules/uni-drawer/changelog.md +++ b/uni_modules/uni-drawer/changelog.md @@ -1,5 +1,10 @@ -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.2.1(2021-11-22) +- 修复 vue3中个别scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-drawer](https://uniapp.dcloud.io/component/uniui/uni-drawer) +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.1.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) diff --git a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue index 253d7f502cf32ba8cc27b95d46f98ae5c76514b7..5b551e3c3bcdf735367ef054c7a1730436613435 100644 --- a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue +++ b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue @@ -105,7 +105,8 @@ } - + diff --git a/uni_modules/uni-easyinput/package.json b/uni_modules/uni-easyinput/package.json index 408a182e8574e75949901b52ff531ceb5fc3e506..15482b246dffeec4b073388a786cb9f7a38f2c8f 100644 --- a/uni_modules/uni-easyinput/package.json +++ b/uni_modules/uni-easyinput/package.json @@ -1,89 +1,90 @@ -{ - "id": "uni-easyinput", - "displayName": "uni-easyinput 增强输入框", - "version": "0.1.4", - "description": "Easyinput 组件是对原生input组件的增强", - "keywords": [ - "uni-ui", - "uniui", - "input", - "uni-easyinput", - "输入框" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } +{ + "id": "uni-easyinput", + "displayName": "uni-easyinput 增强输入框", + "version": "1.0.5", + "description": "Easyinput 组件是对原生input组件的增强", + "keywords": [ + "uni-ui", + "uniui", + "input", + "uni-easyinput", + "输入框" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-easyinput/readme.md b/uni_modules/uni-easyinput/readme.md index ab6c50bf4107aff9cff2e01c44e1f89b949657e1..f1faf8fbbba31f9f404116b32078b1603487d279 100644 --- a/uni_modules/uni-easyinput/readme.md +++ b/uni_modules/uni-easyinput/readme.md @@ -7,192 +7,5 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能 - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 平台差异说明 - -暂不支持在nvue页面中使用 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -输入内容后,输入框尾部会显示清除按钮,点击可清除内容,如不需要展示图标,`clearable` 属性设置为 `false` 即可 - -`clearable` 属性设置为 `true` ,输入框聚焦且内容不为空时,才会显示内容 - -```html - -``` - - -### 输入框带左右图标 - -设置 `prefixIcon` 属性来显示输入框的头部图标 - -设置 `suffixIcon` 属性来显示输入框的尾部图标 - -注意图标当前只支持 `uni-icons` 内置的图标,当配置 `suffixIcon` 属性后,会覆盖 `:clearable="true"` 和 `type="password"` 时的原有图标 - -绑定 `@iconClick` 事件可以触发图标的点击 ,返回 `prefix` 表示点击左侧图标,返回 `suffix` 表示点击右侧图标 - -```html - - - - - -``` - -### 输入框禁用 - -设置 `disable` 属性可以禁用输入框,此时输入框不可编辑 - -```html - -``` - -### 密码框 - -设置 `type="password"` 时,输入框内容将会不可见,由实心点代替,同时输入框尾部会显示眼睛图标,点击可切换内容显示状态 - -```html - -``` - -### 输入框聚焦 - -设置 `focus` 属性可以使输入框聚焦 - -如果页面存在多个设置 `focus` 属性的输入框,只有最后一个输入框的 `focus` 属性会生效 - -```html - -``` - - -### 多行文本 - -设置 `type="textarea"` 时可输入多行文本 - -```html - -``` - -### 多行文本自动高度 - -设置 `type="textarea"` 时且设置 `autoHeight` 属性,可使用多行文本的自动高度,会跟随内容调整输入框的显示高度 - -```html - -``` - -### 取消边框 - -设置 `:inputBorder="false"` 时可取消输入框的边框显示,同时搭配 `uni-forms` 的 `:border="true"` 有较好的效果 - -```html - - - - - - - - -``` - - -## API - -### Easyinput Props - -|属性名| 类型| 可选值|默认值|说明| -|:-:|:-:|:-:|:-:|:-:| -|value|String/ Number|-|-|输入内容| -|type|String|见 type Options|text|输入框的类型(默认text)| -|clearable|Boolean|-|true| 是否显示右侧清空内容的图标控件(输入框有内容且不禁用时显示),点击可清空输入框内容| -|autoHeight|Boolean|-|false| 是否自动增高输入区域,type为textarea时有效| -|placeholder|String |-| - | 输入框的提示文字| -|placeholderStyle|String| - | - | placeholder的样式(内联样式,字符串),如"color: #ddd"| -|focus|Boolean|-|false|是否自动获得焦点| -|disabled|Boolean|-|false|是否不可输入| -|maxlength|Number|-|140|最大输入长度,设置为 -1 的时候不限制最大长度| -|confirmType|String|-|done|设置键盘右下角按钮的文字,仅在type="text"时生效| -|clearSize|Number|-|15|清除图标的大小,单位px| -|prefixIcon|String|-|-|输入框头部图标 | -|suffixIcon|String|-|-|输入框尾部图标| -|trim|Boolean/String|见 trim Options | false | 是否自动去除空格,传入类型为 Boolean 时,自动去除前后空格| -|inputBorder|Boolean|-|true|是否显示input输入框的边框| -|styles|Object|-|-| 样式自定义| -|passwordIcon|Boolean|-| true | type=password 时,是否显示小眼睛图标| - - -#### Type Options - -|属性名| 说明| -|:-:| :-:| -|text|文本输入键盘| -|textarea |多行文本输入键盘| -|password |密码输入键盘| -|number|数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式 | -|idcard|身份证输入键盘,仅支持微信、支付宝、百度、QQ小程序| -|digit|带小数点的数字键盘,仅支持微信、支付宝、百度、头条、QQ小程序 | - -#### ConfirmType Options - -平台差异与 [input](https://uniapp.dcloud.io/component/input) 相同 - -|属性名 | 说明| -|:-:| :-:| -|send|右下角按钮为“发送” | -|search |右下角按钮为“搜索” | -|next|右下角按钮为“下一个”| -|go|右下角按钮为“前往” | -|done|右下角按钮为“完成” | - - -#### Styles Options - -|属性名| 默认值 |说明| -|:-:| :-:| :-:| -|color| #333| 输入文字颜色| -|disableColor |#eee| 输入框禁用背景色| -|borderColor |#e5e5e5 | 边框颜色| - -#### Trim Options - -传入类型为 `Boolean` 时,自动去除前后空格,传入类型为 `String` 时,可以单独控制,下面是可选值 - -|属性名|说明| -|:-:| :-:| -|both|去除两端空格| -|left|去除左侧空格| -|right|去除右侧空格| -|all|去除所有空格| -|none|不去除空格| - - -### Easyinput Events - -|事件称名| 说明|返回值| -|:-:| :-:|:-:| -|@input|输入框内容发生变化时触发| -| -|@focus|输入框获得焦点时触发| -| -|@blur|输入框失去焦点时触发| -| -|@confirm|点击完成按钮时触发| -| -|@iconClick |点击图标时触发| prefix/suffix | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/easyinput/easyinput](https://hellouniapp.dcloud.net.cn/pages/extUI/easyinput/easyinput) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-fab/changelog.md b/uni_modules/uni-fab/changelog.md index 1895c7d7acf1dad0da2edebf9dd4e41b8ce51f9e..24e26b1671be9fdec8bff65c3a7895f31719aace 100644 --- a/uni_modules/uni-fab/changelog.md +++ b/uni_modules/uni-fab/changelog.md @@ -1,8 +1,17 @@ +## 1.2.2(2021-12-29) +- 更新 组件依赖 +## 1.2.1(2021-11-19) +- 修复 阴影颜色不正确的bug +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fab](https://uniapp.dcloud.io/component/uniui/uni-fab) +## 1.1.1(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-02-05) -- 调整为uni_modules目录规范 -- 优化 按钮背景色调整 -- 优化 兼容pc端 +## 1.0.7(2021-05-12) +- 新增 组件示例地址 +## 1.0.6(2021-02-05) +- 调整为uni_modules目录规范 +- 优化 按钮背景色调整 +- 优化 兼容pc端 diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue index 599a2d4996d50263e5514f02d38aac6879b758a1..6143a0552a6eedb00697954dde93bf595ab6426c 100644 --- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue +++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue @@ -5,8 +5,7 @@ 'uni-fab--rightBottom': rightBottom, 'uni-fab--leftTop': leftTop, 'uni-fab--rightTop': rightTop - }" - class="uni-fab"> + }" class="uni-fab"> + }" :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }" + class="uni-fab__content" elevation="5"> - - - {{ item.text }} + + + {{ item.text }} @@ -32,10 +32,11 @@ 'uni-fab__circle--leftTop': leftTop, 'uni-fab__circle--rightTop': rightTop, 'uni-fab__content--other-platform': !isAndroidNvue - }" - class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick"> - - + }" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick"> + + @@ -67,7 +68,7 @@ */ export default { name: 'UniFab', - emits:['fabClick','trigger'], + emits: ['fabClick', 'trigger'], props: { pattern: { type: Object, @@ -111,16 +112,17 @@ color: '#3c3e49', selectedColor: '#007AFF', backgroundColor: '#fff', - buttonColor: '#007AFF' + buttonColor: '#007AFF', + iconColor: '#fff' } } }, computed: { contentWidth(e) { - return (this.content.length + 1) * 55 + 10 + 'px' + return (this.content.length + 1) * 55 + 15 + 'px' }, contentWidthMin() { - return 55 + 'px' + return '55px' }, // 动态计算宽度 boxWidth() { @@ -159,9 +161,11 @@ } }, watch: { - pattern(newValue, oldValue) { - //console.log(JSON.stringify(newValue)) - this.styles = Object.assign({}, this.styles, newValue) + pattern: { + handler(val, oldVal) { + this.styles = Object.assign({}, this.styles, val) + }, + deep: true } }, created() { @@ -173,7 +177,7 @@ this.styles = Object.assign({}, this.styles, this.pattern) }, methods: { - _onClick() { + _onClick() { this.$emit('fabClick') if (!this.popMenu) { return @@ -213,7 +217,9 @@ } - + diff --git a/uni_modules/uni-fab/package.json b/uni_modules/uni-fab/package.json index 9e71b42a16e7a81e74174a06029f29182e971299..0f27daa58062cd50946e73006091d621c90f0fd4 100644 --- a/uni_modules/uni-fab/package.json +++ b/uni_modules/uni-fab/package.json @@ -1,83 +1,87 @@ -{ - "id": "uni-fab", - "displayName": "uni-fab 悬浮按钮", - "version": "1.1.0", - "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", - "keywords": [ - "uni-ui", - "uniui", - "按钮", - "悬浮按钮", - "fab" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} +{ + "id": "uni-fab", + "displayName": "uni-fab 悬浮按钮", + "version": "1.2.2", + "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", + "keywords": [ + "uni-ui", + "uniui", + "按钮", + "悬浮按钮", + "fab" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["uni-scss","uni-icons"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-fab/readme.md b/uni_modules/uni-fab/readme.md index 0ed6ce815e18c9df82034c4318051ab34ce72902..9a444e880929df1b9f7efa692b98ebf4f3ed3d8d 100644 --- a/uni_modules/uni-fab/readme.md +++ b/uni_modules/uni-fab/readme.md @@ -1,5 +1,3 @@ - - ## Fab 悬浮按钮 > **组件名:uni-fab** > 代码块: `uFab` @@ -7,85 +5,5 @@ 点击可展开一个图形按钮菜单 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 不建议动态修改属性,可能会耗损部分性能。 -> - 展开菜单暂不支持字体图标,使用图片路径时建议使用绝对路径,相对路径可能会有问题。 -> - 选中状态要通过自己控制,如果不希望有选中状态,不处理 `active` 即可。 -> - 展开菜单建议最多显示四个,如果过多对于小屏手机可能会超出屏幕。 - - -### 基本用法 - -在 `template` 中使用组件 - -```html - -``` - - -## API - -### Fab Props - -| 属性名 | 类型 | 默认值 | 说明 | -| :-: | :-: | :-: | :-: | -| pattern | Object | - | 可选样式配置项 | -| horizontal| String | 'left' | 水平对齐方式。`left`:左对齐,`right`:右对齐 | -| vertical | String | 'bottom' | 垂直对齐方式。`bottom`:下对齐,`top`:上对齐 | -| direction | String | 'horizontal' | 展开菜单显示方式。`horizontal`:水平显示,`vertical`:垂直显示 | -| popMenu | Boolean | true | 是否使用弹出菜单 | -| content | Array | - | 展开菜单内容配置项 | - - - -**pattern配置项:** - -| 参数 | 类型 | 默认值 | 说明 | -| :-: | :-: | :-: | :-: | -| color | String | #3c3e49 | 文字默认颜色 | -| selectedColor | String | #007AFF | 文字选中时的颜色 | -| backgroundColor | String | #ffffff | 背景色 | -| buttonColor | String | #3c3e49 | 按钮背景色 | - -**content配置项:** - -| 参数 | 类型 | 说明 | -| :-: | :-: | :-: | :-: | -| iconPath | String | 图片路径 | -| selectedIconPath | String | 选中后图片路径| -| text | String | 文字 | -| active | Boolean | 是否选中当前 | - -### Fab Events - -| 参数 | 类型 | 说明 | -| :-: | :-: | :-: | -| @trigger | Function | 展开菜单点击事件,返回点击信息| -| @fabClick | Function | 悬浮按钮点击事件 | - - - - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/fab/fab](https://hellouniapp.dcloud.net.cn/pages/extUI/fab/fab) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fab) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-fav/changelog.md b/uni_modules/uni-fav/changelog.md index f35b81748e84866247f8d42fd67e10fbf59584da..d8a08d4366e6aeb6571b1331f4783cd641ba912a 100644 --- a/uni_modules/uni-fav/changelog.md +++ b/uni_modules/uni-fav/changelog.md @@ -1,3 +1,8 @@ +## 1.2.1(2022-05-30) +- 新增 stat 属性 ,是否开启uni统计功能 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fav](https://uniapp.dcloud.io/component/uniui/uni-fav) ## 1.1.1(2021-08-24) - 新增 支持国际化 ## 1.1.0(2021-07-13) diff --git a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue index b86424586d3596d8c7a11ec35285d402783b6924..8e391c20216c651d864522b1ca597222f2941732 100644 --- a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue +++ b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue @@ -15,28 +15,29 @@ - diff --git a/uni_modules/uni-fav/package.json b/uni_modules/uni-fav/package.json index 0556086716f4f1f4035bdfdb781d0ed1d5712939..cc1469716a21aa57d6fb8165cbbae421e5296dbe 100644 --- a/uni_modules/uni-fav/package.json +++ b/uni_modules/uni-fav/package.json @@ -1,7 +1,7 @@ { "id": "uni-fav", "displayName": "uni-fav 收藏按钮", - "version": "1.1.1", + "version": "1.2.1", "description": " Fav 收藏组件,可自定义颜色、大小。", "keywords": [ "fav", @@ -41,6 +41,7 @@ }, "uni_modules": { "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -80,7 +81,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-fav/readme.md b/uni_modules/uni-fav/readme.md index 83a01fca35e333c3f942680915632fa0c99a5a8b..4de125d2819979260ad83fa2218e19d7d4754025 100644 --- a/uni_modules/uni-fav/readme.md +++ b/uni_modules/uni-fav/readme.md @@ -4,47 +4,7 @@ > **组件名:uni-fav** > 代码块: `uFav` - 用于收藏功能,可点击切换选中、不选中的状态。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - -``` - -## API - -### Fav Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|star |Boolean|true |按钮是否带星星 | -|bgColor |String |#eeeeee |未收藏时的背景色 | -|bgColorChecked |String |#007aff |已收藏时的背景色 | -|fgColor |String |#666666 |未收藏时的文字颜色 | -|fgColorChecked |String |#FFFFFF |已收藏时的文字颜色 | -|circle |Boolean|false |是否为圆角 | -|checked |Boolean|false |是否为已收藏 | -|contentText |Object |```{contentDefault: '收藏',contentFav: '已收藏'}```|收藏按钮文字 | - - -### Fav Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|click |点击 fav按钮 触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/fav/fav](https://hellouniapp.dcloud.net.cn/pages/extUI/fav/fav) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fav) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-feedback/changelog.md b/uni_modules/uni-feedback/changelog.md index 57c13b89d8bcfe95c907caaef24304a6624980bf..00d331fce4a42e46c17ebb491920a7bbb61623b2 100644 --- a/uni_modules/uni-feedback/changelog.md +++ b/uni_modules/uni-feedback/changelog.md @@ -1,2 +1,4 @@ +## 1.0.4(2021-09-26) +为了数据安全,`opendb-feedback`表的`permission`中`delete`,`update`的值默认为`false` ## 1.0.3(2021-08-26) -删除多余的云函数test2 +删除多余的云函数test2 \ No newline at end of file diff --git a/uni_modules/uni-feedback/package.json b/uni_modules/uni-feedback/package.json index fb20e7a1bfc276d8de38e66bc21912e430295d7c..a564d08505e9f9346c944aee87a71930e0431e07 100644 --- a/uni_modules/uni-feedback/package.json +++ b/uni_modules/uni-feedback/package.json @@ -1,10 +1,10 @@ { "id": "uni-feedback", - "displayName": "问题反馈用户端页面模板", - "version": "1.0.3", - "description": "问题反馈用户端页面模板,方便开发者快速搭建问题反馈界面", + "displayName": "问题反馈页面模板", + "version": "1.0.4", + "description": "问题反馈页面模板,方便开发者快速搭建问题反馈界面", "keywords": [ - "问题反馈用户端页面模板" + "问题反馈页面模板" ], "repository": "", "engines": { diff --git a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue index 9c30b673f484ec0f120b7efabfd67178b0746358..40db16bf6d4144e07035b376df32e8e92aa1ee53 100644 --- a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue +++ b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue @@ -26,6 +26,7 @@ import { validator } from '../../js_sdk/validator/opendb-feedback.js'; + console.log(validator); const db = uniCloud.database(); const dbCollectionName = 'opendb-feedback'; diff --git a/uni_modules/uni-feedback/readme.md b/uni_modules/uni-feedback/readme.md index aa0ede5e64cc25f1fab0f667d2e2bf5522571d01..65d91928ee5dd77fc5f6ebf5bff7c21f777f73cf 100644 --- a/uni_modules/uni-feedback/readme.md +++ b/uni_modules/uni-feedback/readme.md @@ -1,2 +1 @@ -这是一个问题反馈客户端插件,admin端插件:[https://ext.dcloud.net.cn/plugin?id=4992](https://ext.dcloud.net.cn/plugin?id=4992) -> 参考案例 [uni-starter](https://ext.dcloud.net.cn/plugin?id=5057) \ No newline at end of file +这是一个问题反馈客户端插件,admin端插件:[https://ext.dcloud.net.cn/plugin?id=4992](https://ext.dcloud.net.cn/plugin?id=4992) \ No newline at end of file diff --git a/uni_modules/uni-file-picker/changelog.md b/uni_modules/uni-file-picker/changelog.md index 82bc093d931e4ed56b37b79ab9a90f8b7a1443f9..a01f9bab203f9eb2869e32d89e742ced0bfdfcf4 100644 --- a/uni_modules/uni-file-picker/changelog.md +++ b/uni_modules/uni-file-picker/changelog.md @@ -1,5 +1,14 @@ -## 0.2.14(2021-08-23) -- 新增 参数中返回 fileID 字段 +## 1.0.1(2021-11-23) +- 修复 参数为对象的情况下,url在某些情况显示错误的bug +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker) +## 0.2.16(2021-11-08) +- 修复 传入空对象 ,显示错误的Bug +## 0.2.15(2021-08-30) +- 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug +## 0.2.14(2021-08-23) +- 新增 参数中返回 fileID 字段 ## 0.2.13(2021-08-23) - 修复 腾讯云传入fileID 不能回显的bug - 修复 选择图片后,不能放大的问题 diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue index ba4d742e367ba4e38e705d2371d1b9f15d6606e9..48c834ab5e2be094e265cb954bad8b714d5825d9 100644 --- a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue +++ b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue @@ -278,7 +278,6 @@ files.push(Object.assign({}, v)) } }) - this.uploadFiles(files) }, async setValue(newVal, oldVal) { @@ -293,8 +292,8 @@ if (reg.test(url)) { v.fileID = url v.url = await this.getTempFileURL(url) - } - v.path = v.url + } + if(v.url) v.path = v.url return v } if (this.returnType === 'object') { @@ -439,7 +438,7 @@ for (let i = 0; i < res.length; i++) { const item = res[i] const index = item.uuid ? this.files.findIndex(p => p.uuid === item.uuid) : item.index - + if (index === -1 || !this.files) break if (item.errMsg === 'request:fail') { this.files[index].url = item.path @@ -457,7 +456,7 @@ }else{ this.files[index].url = item.url } - + this.files[index].status = 'success' this.files[index].progress += 1 successData.push(this.files[index]) @@ -521,7 +520,7 @@ this.setEmit() }) }, - + /** * 获取文件名和后缀 * @param {Object} name @@ -542,8 +541,7 @@ let data = [] if (this.returnType === 'object') { data = this.backObject(this.files)[0] - this.localValue = {} - Object.assign(this.localValue, data) + this.localValue = data?data:null } else { data = this.backObject(this.files) if (!this.localValue) { diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue index 6b1741d9a1acae86e978225a414380b3ddd4ca93..51ace0b4e385a6577c4386738516b6a4cefe1574 100644 --- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue +++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue @@ -116,13 +116,15 @@ let { border } = this.styles - let obj = {} + let obj = {} + const widthDefaultValue = 1 + const radiusDefaultValue = 3 if (typeof border === 'boolean') { obj.border = border ? '1px #eee solid' : 'none' } else { - let width = (border && border.width) || 1 + let width = (border && border.width) || widthDefaultValue width = this.value2px(width) - let radius = (border && border.radius) || 5 + let radius = (border && border.radius) || radiusDefaultValue radius = this.value2px(radius) obj = { 'border-width': width, @@ -206,7 +208,7 @@ left: 0; margin: 5px; border: 1px #eee solid; - border-radius: 8px; + border-radius: 5px; overflow: hidden; } @@ -271,8 +273,8 @@ align-items: center; justify-content: center; position: absolute; - top: 5px; - right: 5px; + top: 3px; + right: 3px; height: 26px; width: 26px; border-radius: 50%; diff --git a/uni_modules/uni-file-picker/package.json b/uni_modules/uni-file-picker/package.json index 1379d29b9814e1858e6eddc4a055f92db3c64e31..29df9f7220eb9d7fe45764b891bc4ec04081c185 100644 --- a/uni_modules/uni-file-picker/package.json +++ b/uni_modules/uni-file-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-file-picker", "displayName": "uni-file-picker 文件选择上传", - "version": "0.2.14", + "version": "1.0.1", "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-file-picker/readme.md b/uni_modules/uni-file-picker/readme.md index 496327b7f2e9961d2333a315ca7af8a4bf743c75..c8399a5e7e8bbb91f6697170e1783e5d87852057 100644 --- a/uni_modules/uni-file-picker/readme.md +++ b/uni_modules/uni-file-picker/readme.md @@ -7,299 +7,5 @@ 文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如不绑定服务空间,`autoUpload`默认为`false`且不可更改 -> - 选择文件目前只支持 `H5` 和 `微信小程序平台` ,且 `微信小程序平台` 使用 `wx.chooseMessageFile()` -> - v-model 值需要自动上传成功后才会绑定值,一般只用来回显数据 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - -## API - -### FilePicker Props - -| 属性名 | 类型 | 默认值 | 可选值 | 说明 | -| :-: | :-: | :-: | :-: | :-: | -| v-model/value | Array\Object | - | - | 组件数据,通常用来回显 ,类型由`return-type`属性决定 ,**格式见下文** | -| disabled | Boolean | false | - | 组件禁用 | -| readonly | Boolean | false | - | 组件只读,不可选择,不显示进度,不显示删除按钮 | -| return-type | String | array | array/object | 限制 `value` 格式,当为 `object` 时 ,组件只能单选,且会覆盖 | -| disable-preview| Boolean | false | - | 禁用图片预览,仅 `mode:grid`生效 | -| del-icon | Boolean | true | - | 是否显示删除按钮 | -| auto-upload | Boolean | true | - | 是否自动上传,值为`true`则只触发@select,可自行上传| -| limit | Number\String | 9 | - | 最大选择个数 ,h5 会自动忽略多选的部分 | -| title | String | - | - | 组件标题,右侧显示上传计数 | -| mode | String | list | list/grid | 选择文件后的文件列表样式 | -| file-mediatype| String | image | image/video/all | 选择文件类型,all 只支持 H5 和微信小程序平台 | -| file-extname | Array\String | - | - | 选择文件后缀,字符串的情况下需要用逗号分隔(推荐使用字符串),根据 `file-mediatype` 属性而不同| -| list-styles | Object | - | - | `mode:list` 时的样式 | -| image-styles | Object | - | - | `mode:grid` 时的样式 | - - -### value 格式 - -三个属性必填,否则影响组件显示 - -```json -[ - { - "name":"file.txt", - "extname":"txt", - "url":"https://xxxx", - // ... - } -] - -``` - -### list-styles 格式 - -```json -{ - "borderStyle":{ - "color":"#eee", // 边框颜色 - "width":"1px", // 边框宽度 - "style":"solid", // 边框样式 - "radius":"5px" // 边框圆角,不支持百分比 - }, - "border":false, // 是否显示边框 - "dividline":true // 是否显示分隔线 -} -``` - -### image-styles 格式 - -```json -{ - "height": 60, // 边框高度 - "width": 60, // 边框宽度 - "border":{ // 如果为 Boolean 值,可以控制边框显示与否 - "color":"#eee", // 边框颜色 - "width":"1px", // 边框宽度 - "style":"solid", // 边框样式 - "radius":"50%" // 边框圆角,支持百分比 - } -} -``` - -### FilePicker Events - -|事件称名 |说明 | 返回值 | -|:-: |:-: | :-: | -|@select | 选择文件后触发 | 见下文| -|@progress|文件上传时触发 | 见下文| -|@success |上传成功触发 | 见下文| -|@fail |上传失败触发 | 见下文| -|@delete |文件从列表移除时触发| 见下文| - - -#### Callback Params - -`**注意**:如果绑定的是腾讯云的服务空间 ,tempFilePaths 将返回 fileID` - -```json -{ - "progress" : Number, // 上传进度 ,仅 @progress 事件包含此字段 - "index" : Number, // 上传文件索引 ,仅 @progress 事件包含此字段 - "tempFile" : file, // 当前文件对象 ,包含文件流,文件大小,文件名称等,仅 @progress 事件包含此字段 - "tempFiles" : files, // 文件列表,包含文件流,文件大小,文件名称等 - "tempFilePaths" : filePaths, // 文件地址列表,@sucess 事件为上传后的线上文件地址 -} - -``` - - -### FilePicker Methods - -通过 `$ref` 调用 - -| 方法称名 | 说明 | 参数 | -| :-: | :-: | :-: | -| upload() | 手动上传 ,如`autoUpload`为`false` ,必须调用此方法| - | -| clearFiles(index:Number) | 清除选择结果| 传如 Number 为删除指定下标的文件 ,不传为删除所有| - -### FilePicker Slots - -插槽可定义上传按钮显示样式 - -| 插槽名 | 说明 | -| :-: | :-: | -| default |默认插槽| - -## 组件用法 - -### 基础用法 - -```html - -``` - -```javascript -export default { - data() { - return { - imageValue:[] - } - }, - methods:{ - // 获取上传状态 - select(e){ - console.log('选择文件:',e) - }, - // 获取上传进度 - progress(e){ - console.log('上传进度:',e) - }, - - // 上传成功 - success(e){ - console.log('上传成功') - }, - - // 上传失败 - fail(e){ - console.log('上传失败:',e) - } - } -} - -``` - -### 选择指定后缀图片,且限制选择个数 - -配置 `file-mediatype` 属性为 `image`,限定只选择图片 - -配置 `file-extname` 属性为 `'png,jpg'`,限定只选择 `png`和`jpg`后缀的图片 - -配置 `limit` 属性为 1 ,则最多选择一张图片 - -配置 `mode` 属性为 `grid` ,可以使用九宫格样式选择图片 - - -```html - -``` - -### 手动上传 - -配置 `auto-upload` 属性为 `false` ,可以停止自动上传,通过`ref`调用`upload`方法自行选择上传时机 - -```html - - - - -``` - -```javascript -export default { - data() {}, - methods:{ - upload(){ - this.$refs.files.upload() - } - } -} - -``` - -### 单选图片且点击再次选择 - -配置 `disable-preview` 属性为 `true`,禁用点击预览图片功能 - -配置 `del-icon` 属性为 `false`,隐藏删除按钮 - -配置 `return-type` 属性为 `object`,设置 `value` 类型 ,如需绑定 `array`类型 ,则设置`limit:1`,可达到一样的效果 - - - -```html -选择头像 -``` - -### 自定义样式 - -配置 `image-styles` 属性,可以自定义`mode:image`时的回显样式 - -配置 `list-styles` 属性,可以自定义`mode:video|| mode:all`时的回显样式 - -```html - - - - -``` - -```javascript -export default { - data() { - imageStyles:{ - width:64, - height:64, - border:{ - color:"#ff5a5f", - width:2, - style:'dashed', - radius:'2px' - } - }, - listStyles:{ - // 是否显示边框 - border: true, - // 是否显示分隔线 - dividline: true, - // 线条样式 - borderStyle: { - width:1, - color:'blue', - radius:2 - } - } - } -} - -``` - - - -### 使用插槽 - -使用默认插槽可以自定义选择文件按钮样式 - -```html - - - -``` - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-file-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-forms/changelog.md b/uni_modules/uni-forms/changelog.md index 1d19e70603b92d713220f7e9bf422343a9348863..26e120b5c0878e5d3bc2916063da30603f3c87a7 100644 --- a/uni_modules/uni-forms/changelog.md +++ b/uni_modules/uni-forms/changelog.md @@ -1,53 +1,60 @@ +## 1.3.2(2021-12-09) +- +## 1.3.1(2021-11-19) +- 修复 label 插槽不生效的bug +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-forms](https://uniapp.dcloud.io/component/uniui/uni-forms) ## 1.2.7(2021-08-13) - 修复 没有添加校验规则的字段依然报错的Bug -## 1.2.6(2021-08-11) -- 修复 重置表单错误信息无法清除的问题 -## 1.2.5(2021-08-11) -- 优化 组件文档 -## 1.2.4(2021-08-11) -- 修复 表单验证只生效一次的问题 -## 1.2.3(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.2.2(2021-07-26) -- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug -- 修复 1.2.1 引起的示例在小程序平台报错的Bug -## 1.2.1(2021-07-22) -- 修复 动态校验表单,默认值为空的情况下校验失效的Bug -- 修复 不指定name属性时,运行报错的Bug -- 优化 label默认宽度从65调整至70,使required为true且四字时不换行 -- 优化 组件示例,新增动态校验示例代码 -- 优化 组件文档,使用方式更清晰 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.2(2021-06-25) -- 修复 pattern 属性在微信小程序平台无效的问题 -## 1.1.1(2021-06-22) -- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug -## 1.1.0(2021-06-22) -- 修复 只写setRules方法而导致校验不生效的Bug -- 修复 由上个办法引发的错误提示文字错位的Bug -## 1.0.48(2021-06-21) -- 修复 不设置 label 属性 ,无法设置label插槽的问题 -## 1.0.47(2021-06-21) -- 修复 不设置label属性,label-width属性不生效的bug -- 修复 setRules 方法与rules属性冲突的问题 -## 1.0.46(2021-06-04) -- 修复 动态删减数据导致报错的问题 -## 1.0.45(2021-06-04) -- 新增 modelValue 属性 ,value 即将废弃 -## 1.0.44(2021-06-02) -- 新增 uni-forms-item 可以设置单独的 rules -- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤 -- 优化 submit 事件重命名为 validate -## 1.0.43(2021-05-12) -- 新增 组件示例地址 -## 1.0.42(2021-04-30) -- 修复 自定义检验器失效的问题 -## 1.0.41(2021-03-05) -- 更新 校验器 -- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug -## 1.0.40(2021-03-04) -- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug -## 1.0.39(2021-02-05) -- 调整为uni_modules目录规范 -- 修复 校验器传入 int 等类型 ,返回String类型的Bug +## 1.2.6(2021-08-11) +- 修复 重置表单错误信息无法清除的问题 +## 1.2.5(2021-08-11) +- 优化 组件文档 +## 1.2.4(2021-08-11) +- 修复 表单验证只生效一次的问题 +## 1.2.3(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.2.2(2021-07-26) +- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug +- 修复 1.2.1 引起的示例在小程序平台报错的Bug +## 1.2.1(2021-07-22) +- 修复 动态校验表单,默认值为空的情况下校验失效的Bug +- 修复 不指定name属性时,运行报错的Bug +- 优化 label默认宽度从65调整至70,使required为true且四字时不换行 +- 优化 组件示例,新增动态校验示例代码 +- 优化 组件文档,使用方式更清晰 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.2(2021-06-25) +- 修复 pattern 属性在微信小程序平台无效的问题 +## 1.1.1(2021-06-22) +- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug +## 1.1.0(2021-06-22) +- 修复 只写setRules方法而导致校验不生效的Bug +- 修复 由上个办法引发的错误提示文字错位的Bug +## 1.0.48(2021-06-21) +- 修复 不设置 label 属性 ,无法设置label插槽的问题 +## 1.0.47(2021-06-21) +- 修复 不设置label属性,label-width属性不生效的bug +- 修复 setRules 方法与rules属性冲突的问题 +## 1.0.46(2021-06-04) +- 修复 动态删减数据导致报错的问题 +## 1.0.45(2021-06-04) +- 新增 modelValue 属性 ,value 即将废弃 +## 1.0.44(2021-06-02) +- 新增 uni-forms-item 可以设置单独的 rules +- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤 +- 优化 submit 事件重命名为 validate +## 1.0.43(2021-05-12) +- 新增 组件示例地址 +## 1.0.42(2021-04-30) +- 修复 自定义检验器失效的问题 +## 1.0.41(2021-03-05) +- 更新 校验器 +- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug +## 1.0.40(2021-03-04) +- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug +## 1.0.39(2021-02-05) +- 调整为uni_modules目录规范 +- 修复 校验器传入 int 等类型 ,返回String类型的Bug diff --git a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue index b75459b3e6d72b180de8f644444e72f8672bfd73..679b12f9349692459f9fcce0932668a43a5dfa90 100644 --- a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue +++ b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue @@ -2,8 +2,8 @@ - - + + * {{ label }} @@ -180,32 +180,32 @@ export default { } this.init(); }, - // #ifndef VUE3 - destroyed() { - if(this.__isUnmounted) return - this.unInit() - }, - // #endif - // #ifdef VUE3 - unmounted(){ - this.__isUnmounted = true - this.unInit() - }, + // #ifndef VUE3 + destroyed() { + if(this.__isUnmounted) return + this.unInit() + }, + // #endif + // #ifdef VUE3 + unmounted(){ + this.__isUnmounted = true + this.unInit() + }, // #endif methods: { init() { if (this.form) { let { formRules, validator, formData, value, labelPosition, labelWidth, labelAlign, errShowType } = this.form; - this.labelPos = this.labelPosition ? this.labelPosition : labelPosition; - - if(this.label){ - this.labelWid = (this.labelWidth ? this.labelWidth : (labelWidth||70)) - }else{ - this.labelWid =( this.labelWidth ? this.labelWidth : (labelWidth||'auto')) - } - if(this.labelWid && this.labelWid !=='auto') { - this.labelWid +='px' - } + this.labelPos = this.labelPosition ? this.labelPosition : labelPosition; + + if(this.label){ + this.labelWid = (this.labelWidth ? this.labelWidth : (labelWidth||70)) + }else{ + this.labelWid =( this.labelWidth ? this.labelWidth : (labelWidth||'auto')) + } + if(this.labelWid && this.labelWid !=='auto') { + this.labelWid +='px' + } this.labelAli = this.labelAlign ? this.labelAlign : labelAlign; // 判断第一个 item @@ -241,16 +241,16 @@ export default { this.labelWid = this.labelWidth || 65; this.labelAli = this.labelAlign || 'left'; } - }, - unInit(){ - if (this.form) { - this.form.childrens.forEach((item, index) => { - if (item === this) { - this.form.childrens.splice(index, 1) - delete this.form.formData[item.name] - } - }) - } + }, + unInit(){ + if (this.form) { + this.form.childrens.forEach((item, index) => { + if (item === this) { + this.form.childrens.splice(index, 1) + delete this.form.formData[item.name] + } + }) + } }, /** * 获取父元素实例 @@ -293,7 +293,7 @@ export default { */ async triggerCheck(value,formTrigger) { let promise = null; - this.errMsg = ''; + this.errMsg = ''; // fix by mehaotian 解决没有检验规则的情况下,抛出错误的问题 if (!this.validator || Object.keys(this.formRules).length === 0) return; const isNoField = this.isRequired(this.formRules.rules || []); @@ -379,7 +379,7 @@ export default { }; - + diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue index d15b505b0f4dee7f43fa128e462edc44e8e290cf..dff823bb09d7681708bfe3f1be932dcdfb09efe0 100644 --- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue +++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue @@ -245,8 +245,8 @@ item.errMsg = ''; const inputComp = this.inputChildrens.find(child => child.rename === item.name); if (inputComp) { - inputComp.errMsg = ''; - // fix by mehaotian 不触发其他组件的 setValue + inputComp.errMsg = ''; + // fix by mehaotian 不触发其他组件的 setValue inputComp.is_reset = true inputComp.$emit('input', inputComp.multiple ? [] : ''); inputComp.$emit('update:modelValue', inputComp.multiple ? [] : ''); @@ -459,7 +459,7 @@ }; - + diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json index d791aeb99add3868ac16de57752944b5b5e42fa8..dfa7af4c459063564c2ad3942a96a79503e6a905 100644 --- a/uni_modules/uni-forms/package.json +++ b/uni_modules/uni-forms/package.json @@ -1,89 +1,90 @@ -{ - "id": "uni-forms", - "displayName": "uni-forms 表单", - "version": "1.2.7", - "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", - "keywords": [ - "uni-ui", - "表单", - "校验", - "表单校验", - "表单验证" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } -} +{ + "id": "uni-forms", + "displayName": "uni-forms 表单", + "version": "1.3.2", + "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", + "keywords": [ + "uni-ui", + "表单", + "校验", + "表单校验", + "表单验证" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-forms/readme.md b/uni_modules/uni-forms/readme.md index e8352620b6f85056593f571568f6cdfb8dc11406..63d5a043ee8c43c48d21de1af4855cbef4e0ce50 100644 --- a/uni_modules/uni-forms/readme.md +++ b/uni_modules/uni-forms/readme.md @@ -19,812 +19,5 @@ uni-app的内置组件已经有了 `
`组件,用于提交表单内容。 另外,``组件下面的各个表单项,可以通过``包裹为不同的分组。同一``下的不同表单项目将聚拢在一起,同其他group保持垂直间距。``仅影响视觉效果。 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - `resetFields` 方法不会重置原生组件和三方组件的值 -> - 如果配置 `validateTrigger` 属性为 `bind` 且表单域组件使用 `input` 事件触发会耗损部分性能,请谨慎使用 -> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` -> - uni-forms 中不包含其他表单组件,如需使用 uni-easyinput、uni-data-checkbox 等组件,需要自行引入 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -`uni-forms` 组件通常用来做表单校验和提交。每一个 `uni-forms-item` 是它的一个表单域组件,用来承载表单具体内容,`uni-forms-item` 中可以嵌套 `uni-easyinput`、`uni-data-checkbox` 和 uni-app内置的表单组件 ,不过 uni-app 的内置表单组件需要通过 `binddata` 或者 `uni-forms` 提供的 `setValue` 方法,将内容与 `uni-forms` 关联,才可完成表单的校验与提交(详见后文`表单校验` 部分) - -```html - -``` - -### 对齐方式 - -使用 `label-position` 属性可以设置所有表单域的位置,默认在左侧 - -```html - -``` - -## 表单校验 - -表单校验还可以直接通过 `uniCloud web 控制台` 快速根据 `schema` 自动生成表单维护界面,比如新建页面和编辑页面,自动处理校验规则,更多参考[DB Schema](https://uniapp.dcloud.io/uniCloud/schema) - -### 如何使用 - -1. `uni-forms` 需要通过 `rules` 属性传入约定的校验规则,详细描述下文`校验规则说明`。 -```html - - - ... - -``` - -2. `uni-forms` 需要绑定`modelValue`属性,值为表单的key\value 组成的对象。 -```html - - - ... - -``` - -3. `uni-forms-item` 需要设置 `name` 属性为当前字段名,字段为 `String` 类型而非变量。 -```html - - - - - - - - - -``` - -4. 如果使用`uni-easyinput` 和 `uni-data-checkbox` 等关联组件,只需绑定 v-model,无需其他操作。 -5. 如果使用原生 input、checkbox 或三方组件等,只需要给组件绑定 `binddata` 方法即可触发表单校验,无需绑定事件到 `methods` 中,见下方完整示例。 -6. `binddata('name',$event.detail.value,'form')"` 方法接受三个值, - - 第一个参数传入当前表单组件所在的 name,同当前父组件 `uni-forms-item` 绑定属性 `name` 的值 - - 第二个参数传入需要校验的值,内置组件可以通过 `$event.detail.value` 获取到组件的返回值,自定义组件传入需要校验的值即可 - - 第三个参数传入 `uni-forms` 组件绑定属性 `ref` 的值,通常在多表单的时候需要传入,用来区分表单,如页面中仅有一个 `uni-forms` 可忽略 -7. 如果内置 `binddata` 方法无法满足需求,在当前页面的 `methods` 中复写此方法即可,复写此方法需要调用 `uni-forms` 的 `setValue` 来触发表单校验,见下方 `setValue`方法说明 - -**完整示例** - -```html - - -``` - -```javascript -export default { - data() { - return { - // 表单数据 - formData: { - name: 'LiMing', - email: 'dcloud@email.com' - }, - rules: { - // 对name字段进行必填验证 - name: { - rules: [{ - required: true, - errorMessage: '请输入姓名', - }, - { - minLength: 3, - maxLength: 5, - errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', - } - ] - }, - // 对email字段进行必填验证 - email: { - rules: [{ - format: 'email', - errorMessage: '请输入正确的邮箱地址', - }] - } - } - } - }, - methods: { - /** - * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法 - * @param {String} name 字段名称 - * @param {String} value 表单域的值 - */ - // binddata(name,value){ - // 通过 input 事件设置表单指定 name 的值 - // this.$refs.form.setValue(name, value) - // }, - // 触发提交表单 - submit() { - this.$refs.form.validate().then(res=>{ - console.log('表单数据信息:', res); - }).catch(err =>{ - console.log('表单错误信息:', err); - }) - } - } -} -``` - -> **注意** -> `modelValue` 对象目前有比较严格的格式要求: -> - 尽量不要使用嵌套的数据结构,因为表单域指定的`name`值与 modeValue 的 key 是一一对应的,只有一种情况例外,那就是动态校验表单,见下方`动态校验表单`章节 - - -### 校验规则说明 - -校验规则接受一个 `Object` 类型的值,通过传入不同的规则来表示每个表单域的值该如何校验 - -对象的 `key` 表示当前表单域的字段名,`value` 为具体的校验规则 - -以下为 `value` 所包含的内容: - -|属性名|类型|说明| -|:-:|:-:|:-:| -|rules|Array|校验规则,见下方 `rules 属性说明`| -|validateTrigger| String| 表单校验时机| -|label|String|当前表单域的字段中文名,多用于 `errorMessage` 的显示,可不填| - - -```javascript -rules: { - // 对name字段进行必填验证 - name: { - // name 字段的校验规则 - rules:[ - // 校验 name 不能为空 - { - required: true, - message: '请填写姓名', - }, - // 对name字段进行长度验证 - { - minLength: 3, - maxLength: 5, - message: '{label}长度在 {minLength} 到 {maxLength} 个字符', - } - ], - // 当前表单域的字段中文名,可不填写 - label:'姓名', - validateTrigger:'submit' - } -} - -``` - - -### rules 属性说明 -每一个验证规则中,可以配置多个属性,下面是一些常见规则属性。实际上这里的规范,与uniCloud的[DB Schema](https://uniapp.dcloud.io/uniCloud/schema?id=validator)规范相同。 - -|属性名|类型|默认值|可选值|说明 | -|:-:|:-:|:-:|:-:|:-:| -|required|Boolean|-|-|是否必填,配置此参数不会显示输入框左边的必填星号,如需要,请配置`uni-forms-item`组件的的required为true| -|range|Array|-|-|数组至少要有一个元素,且数组内的每一个元素都是唯一的。 | -|format|String|-|-|内置校验规则,如这些规则无法满足需求,可以使用正则匹配或者自定义规则 | -|pattern|RegExp|-|-|正则表达式,注意事项见下方说明| -|maximum|Number|-|-| 校验最大值(大于)| -|minimum|Number|-|-| 校验最小值(小于) | -|maxLength|Number|-|-| 校验数据最大长度 | -|errorMessage|String|-|-|校验失败提示信息语,可添加属性占位符,当前表格内属性都可用作占位符| -|trigger|String|bind| bind/submit|校验触发时机| -|validateFunction|Function|-|-|自定义校验规则 | - - -**format属性值说明** - -|属性名|说明| -|:-:|:-:| -|string|必须是 string 类型,默认类型| -|number|必须是 number 类型| -|boolean|必须是 boolean 类型| -|array|必须是 array 类型| -|object|必须是 object 类型| -|url|必须是 url 类型| -|email|必须是 email 类型| - - -> **pattern属性说明** -> 在小程序中,json 中不能使用正则对象,如:`/^\S+?@\S+?\.\S+?$/`,使用正则对象会被微信序列化,导致正则失效。 -> 所以建议统一使用字符串的方式来使用正则 ,如`'^\\S+?@\\S+?\\.\\S+?$'` ,需要注意 `\` 需要使用 `\\` 来转译。 -> 如验证邮箱:/^\S+?@\S+?\.\S+?$/ (注意不带引号),或使用 "^\\S+?@\\S+?\\.\\S+?$"(注意带引号需要使用 `\` 转义) - - - -### validateFunction 自定义校验规则使用说明 -`uni-forms` 的 `rules` 基础规则有时候不能满足项目的所有使用场景,这时候可以使用 `validateFunction` 来自定义校验规则 - -`validateFunction` 方法返回四个参数 `validateFunction:function(rule,value,data,callback){}` ,当然返回参数名开发者可以自定义: - - rule : 当前校验字段在 rules 中所对应的校验规则 - - value : 当前校验字段的值 - - data : 所有校验字段的字段和值的对象 - - callback : 校验完成时的回调,一般无需执行callback,返回true(校验通过)或者false(校验失败)即可 ,如果需要显示不同的 `errMessage`,如果校验不通过需要执行 callback('提示错误信息'),如果校验通过,执行callback()即可 - - -> **注意** -> 需要注意,如果需要使用 `validateFunction` 自定义校验规则,则不能采用 `uni-forms` 的 `rules` 属性来配置校验规则,这时候需要通过`ref`,在`onReady`生命周期调用组件的`setRules`方法绑定验证规则 -> 无法通过props传递变量,是因为微信小程序会过滤掉对象中的方法,导致自定义验证规则无效。 -> - - - - - -```html - - -``` - -```javascript -export default { - data() { - return { - formData:{ - - }, - rules: { - hobby: { - rules: [{ - required: true, - errorMessage: '请选择兴趣', - },{ - validateFunction:function(rule,value,data,callback){ - if (value.length < 2) { - callback('请至少勾选两个兴趣爱好') - } - return true - } - }] - } - } - } - }, - onReady() { - // 需要在onReady中设置规则 - this.$refs.form.setRules(this.rules) - }, - methods: { - submit(form) { - this.$refs.form.validate().then(res=>{ - console.log('表单数据信息:', res); - }).catch(err =>{ - console.log('表单错误信息:', err); - }) - } - } -} - -``` - - -### validateFunction 异步校验 - -上面的自定义校验方式为同步校验 ,如果需要异步校验,`validateFunction` 需要返回一个 `Promise` ,校验不通过 执行 `reject(new Error('错误信息'))` 返回对应的错误信息,如果校验通过则直接执行 `resolve()` 即可,在异步校验方法中,不需要使用 `callback` 。 - -```html - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - age: { - rules: [{ - required: true, - errorMessage: '请输入年龄', - },{ - validateFunction: (rule, value, data, callback) => { - // 异步需要返回 Promise 对象 - return new Promise((resolve, reject) => { - setTimeout(() => { - if (value > 10 ) { - // 通过返回 resolve - resolve() - } else { - // 不通过返回 reject(new Error('错误信息')) - reject(new Error('年龄必须大于十岁')) - } - }, 2000) - }) - } - }] - } - } - } - }, - onReady() { - // 需要在onReady中设置规则 - this.$refs.form.setRules(this.rules) - }, - methods: { - /** - * 表单提交 - * @param {Object} event - */ - submit() { - uni.showLoading() - this.$refs.form.validate().then(res => { - uni.hideLoading() - console.log('表单数据信息:', res); - }).catch(err => { - uni.hideLoading() - console.log('表单错误信息:', err); - }) - } - } -} - -``` - - -### 动态表单校验 - -`uni-forms v1.0.44` 开始增加了动态校验表单的相关内容。 - -多用于同一个字段需要添加多次的场景,如需要动态创建多个域名参与检验。 - -1. 在 `formData` 中定义个变量用来接受同一个字段的多个结果。 -```javascript -dynamicFormData: { - email: '', - // domains 字段下会有多个结果 - domains: {} -} -``` - - -2. 使用 `uni-forms-item` 的 `rules` 属性定义单个表单域的校验规则。 -```html - - ... - -``` - -3. `name` 需要动态指定,格式为: `字段[唯一值]` -```html - - ... - -``` - -4. 需要绑定值的组件的 v-model 也需要动态指定,格式为:`数据源.字段[唯一值]` -```html - - - -``` - -**完整示例** - -```html - - - - - - - - - - - - - -``` - -```javascript -export default { - data() { - return { - // 数据源 - dynamicFormData: { - email: '', - domains: {} - }, - // 动态表单数据 - dynamicLists: [], - // 规则 - dynamicRules: { - email: { - rules: [{ - required: true, - errorMessage: '域名不能为空' - }, { - format: 'email', - errorMessage: '域名格式错误' - }] - } - } - } - }, - methods: { - // 新增表单域 - add() { - this.dynamicLists.push({ - label: '域名', - id: Date.now() - }) - }, - // 删除表单域 - del(id) { - let index = this.dynamicLists.findIndex(v => v.id === id) - this.dynamicLists.splice(index, 1) - }, - // 提交 - submit(ref) { - this.$refs[ref].validate((err,value)=>{ - console.log(err,value); - }) - }, - } -} - -// 返回值格式 ,根据自有业务,自行处理数据 -{ - emial:'', - domains:{ - id1:'', - id2:'', - ... - } -} -``` - - -### 表单校验时机说明 - -不管是在规则里还是`uni-forms`、`uni-forms-item`里,都有 `validateTrigger` 属性, `validateTrigger` 属性规定了表单校验时机,当前只有 `bind`、`submit` 两个值域 - -- `bind` : 数据绑定时触发校验,`uni-esayinput` 、`uni-data-checkbox` 组件表现为数据发生变化时。其他内置或三方组件为 `binddata` 事件执行时机 - -```html - - - -``` - -- `submit`: 只有提交表单才会触发表单校验 - - -对于表单校验时机,同时只会有一个 `validateTrigger` 发生作用,它的作用权重为 - -**`规则 > uni-forms-item > uni-forms `** - -- 如果规则里配置 `validateTrigger` ,则优先使用规则里的 `validateTrigger` 属性来决定表单校验时机 -- 如果规则里没有配置 `validateTrigger` ,则优先使用 `uni-forms-item` 的 `validateTrigger` 属性来决定表单校验时机 -- 如果 `uni-forms-item` 组件里没有配置 `validateTrigger` ,则优先使用 `uni-forms` 的 `validateTrigger` 属性来决定表单校验时机 -- 以此类推,如果都没有使用 `validateTrigger` 属性,则会使用 `uni-forms` 的 `validateTrigger` 属性默认值来决定表单校验时机 - - -## API - -### Forms Props - -|属性名|类型|默认值|可选值|说明| -|:-:|:-:|:-:|:-:|:-:| -|value [即将废弃]|Object|-|-| 表单数据| -|modelValue|Object|-|-| 表单数据| -|rules|Object|-|-|表单校验规则| -|validate-trigger|String|submit|bind/submit| 表单校验时机| -|label-position|String|left|top/left|label 位置| -|label-width|String/Number|75|-|label 宽度,单位 px| -|label-align|String|left| left/center/right|label 居中方式| -|err-show-type|String|undertext| undertext/toast/modal|表单错误信息提示方式| -|border|Boolean|false|-|是否显示分格线| - -### Forms Events - -|事件称名|说明| -|:-:|:-:| -|validate|任意表单项被校验后触发,返回表单校验信息| - -### Forms Methods - -|方法称名|说明| -|:-:| :-:| -|submit[即将废弃]| 对整个表单进行校验的方法,会返回一个 promise| -|validate|对整个表单进行校验的方法,会返回一个 promise| -|setValue|设置表单某一项 name 的对应值,通常在 uni-forms-item 和自定表单组件中使用| -|validateField|部分表单进行校验| -|clearValidate|移除表单的校验结果| -|resetFields|重置表单, 需要把 `uni-forms` 的`modelValue`属性改为 `v-model` ,且对内置组件可能不生效| - - - -### validate(keepItem:Array,callback:Function) 方法说明 -`validate` 方法是对整个表单进行校验,方法接受两个参数 - -|参数称名|类型|说明| -|:-:| :-:|:-:| -|keepItem|Array|保留不参与校验的字段| -|callback|Function|校验完成返回函数| - -校验成功后,校验对象只保留指定了`name`的字段(只要 ``uni-forms-item` 绑定了 `name`,哪怕不校验,也会返回),如果需要保留其他字段,则需要 `keepItem` 属性 - -```html - - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - // ... - } - } - }, - onLoad(){ - this.formData.id = 'testId' - }, - methods: { - submit() { - // 在 onLoad 生命周期中,formData添加了一个 id 字段 ,此时这个字段是不参数校验的,所以结果中不返回 - // 在 validate(['id']) 方法中,指定第一个参数 ,即可返回id字段 - this.$refs.form.validate(['id'],(err,formData)=>{ - if(!err){ - console.log('success',formData) - } - }) - } - } -} - -``` - - -`validate` 方法还可以返回一个 `Promise` 对象,如果使用了 `callback` 则`Promise` 返回 `null`,`validate` 方法会优先使用 `callback`。 - -`callback` 方法会返回两个返回值 : -- 第一个返回值为检验结果,如果校验失败,则返回失败信息,如果成功,返回 `null` -- 第二个返回值校验数据 - - -```javascript - -// 使用 callback -// 如果不需要 keepItem 参数 ,则可以省略 -this.$refs.form.validate((err,formData)=>{ - // 如果校验成功 ,err 返回 null - if(!err){ - console.log('success',formData) - return - } - console.log('error',err) -}).then(res=>{ - // res 返回 null -}) - -// 使用 Promise -// 对整个表单进行校验,返回一个 Promise -this.$refs.form.validate().then((res)=>{ - // 成功返回,res 为表单数据 - // 其他逻辑处理 - // ... -}).catch((err)=>{ - // 表单校验验失败,err 为具体错误信息 - // 其他逻辑处理 - // ... -}) - -``` - -### setValue(name:String,value:any) 方法说明 - -`setValue` 方法通常用于内置组件或三方组件返回值的校验,因为`uni-esayinput` 等 uni 开头的组件内置了对 `uni-forms`的支持,所以这些组件返回的值可以直接使用,但是比如像`input` 这些内置组件值的变化,无法及时通知 `uni-forms` ,从而无法正常的校验,这时就需要我们手动将这些值加入到`uni-forms`的校验。 - -`setValue` 方法接受两个参数: -- name: 表单域对应的name -- value: 表单域对应的值 - -```html - - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - // ... - } - } - }, - methods: { - setValue(name,value){ - // 设置表单某项对应得值来触发表单校验 - // 接受两个参数,第一个参数为表单域的 name ,第二个参数为表单域的值 - this.$refs.form.setValue(name,value) - }, - submit() { - this.$refs.form.validate(['id'],(err,formData)=>{ - if(!err){ - console.log('success',formData) - } - }) - } - } -} - -``` - -### 其他方法说明 - -```javascript - -// 部分表单进行校验,接受一个参数,类型为 String 或 Array ,只校验传入 name 表单域的值 -this.$refs.form.validateField(['name', 'email']).then((res)=>{ - // 成功返回,res 为对应表单数据 - // 其他逻辑处理 - // ... -}).catch((err)=>{ - // 表单校验验失败,err 为具体错误信息 - // 其他逻辑处理 - // ... -}) - -// 移除表单校验,接受一个参数,类型为 String 或 Array ,只移除传入 name 表单域的值,如果不传入参数,则移除所有 -this.$refs.form.clearValidate(['name', 'email']) - -``` - - -### FormsItem Props - -|属性名|类型|默认值|可选值 |说明| -|:-:|:-:|:-:|:-:|:-:| -|name|String|-|-|表单域的属性名,在使用校验规则时必填| -|required|Boolean|false|-|label 右边显示红色"*"号,样式显示不会对校验规则产生效果| -|validate-trigger|String|submit|bind/submit|表单校验时机| -|left-icon|String|-|-| label左边的图标,限uni-ui的图标名称| -|icon-color|String|#606266|-| 左边通过icon配置的图标的颜色| -|label|String|-|-| 输入框左边的文字提示| -|label-width|Number|70|-| label的宽度,单位px| -|label-align|String|left|left/center/right|label的文字对齐方式| -|label-position|String|left|top/left|label的文字的位置| -|error-message|String|-|-|显示的错误提示内容,如果为空字符串或者false,则不显示错误信息| - - -### FormsItem Slots -|插槽名|说明| -|:-:| :-:| -|default|默认插槽| -|left(已经失效,请使用label代替)|label插槽,自定义label显示内容| -|label|label插槽,自定义label显示内容| - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/forms/forms](https://hellouniapp.dcloud.net.cn/pages/extUI/forms/forms) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-forms) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-goods-nav/changelog.md b/uni_modules/uni-goods-nav/changelog.md index b0212bbb6032d390ac36afd730c469cff087af91..c6264c67eb60f25b3438f12332249b2166f8ebb8 100644 --- a/uni_modules/uni-goods-nav/changelog.md +++ b/uni_modules/uni-goods-nav/changelog.md @@ -1,3 +1,8 @@ +## 1.2.1(2022-05-30) +- 新增 stat属性,是否开启uni统计功能 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-goods-nav](https://uniapp.dcloud.io/component/uniui/uni-goods-nav) ## 1.1.1(2021-08-24) - 新增 支持国际化 ## 1.1.0(2021-07-13) diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json index 4494f2a5c21ee4bb41f977eb9720302346e20168..94f18684066d02d1ba2cdb5aa63b15d432c1f739 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "cart", "uni-goods-nav.buttonGroup.addToCart": "add to cart", "uni-goods-nav.buttonGroup.buyNow": "buy now" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js index fa8f0f3734de6effb137592fce6c0f722c048432..d2afd081707d24a8b92a8b1c2a30d8e2f19d89f6 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js @@ -5,4 +5,4 @@ export default { en, 'zh-Hans': zhHans, 'zh-Hant': zhHant -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json index 806913a70603b8171525cec67677454ba756e893..84243b03d826f0743c7ee021dcf5412696c9bc86 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "购物车", "uni-goods-nav.buttonGroup.addToCart": "加入购物车", "uni-goods-nav.buttonGroup.buyNow": "立即购买" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json index e862171d0a0889a7e35409b44567befd3fb45f3b..bfd405e5b2559a72a9b0b6606483411953dd0656 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "購物車", "uni-goods-nav.buttonGroup.addToCart": "加入購物車", "uni-goods-nav.buttonGroup.buyNow": "立即購買" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue index e2a6baf233db64f27af688ac355eb00b1c2846f6..e7f28b6dc346e1ea061f1a31d88480eb123f2f4d 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue @@ -18,7 +18,7 @@ - {{ item.text }} @@ -37,7 +37,8 @@ * @tutorial https://ext.dcloud.net.cn/plugin?id=865 * @property {Array} options 组件参数 * @property {Array} buttonGroup 组件按钮组参数 - * @property {Boolean} fill = [true | false] 组件按钮组参数 + * @property {Boolean} fill = [true | false] 组件按钮组参数 + * @property {Boolean} stat 是否开启统计功能 * @event {Function} click 左侧点击事件 * @event {Function} buttonClick 右侧按钮组点击事件 * @example @@ -63,12 +64,12 @@ default () { return [{ text: t("uni-goods-nav.buttonGroup.addToCart"), - backgroundColor: '#ffa200', + backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)', color: '#fff' }, { text: t("uni-goods-nav.buttonGroup.buyNow"), - backgroundColor: '#ff0000', + backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)', color: '#fff' } ] @@ -77,6 +78,10 @@ fill: { type: Boolean, default: false + }, + stat:{ + type: Boolean, + default: false } }, methods: { @@ -87,7 +92,7 @@ }) }, buttonClick(index, item) { - if (uni.report) { + if (uni.report && this.stat) { uni.report(item.text, item.text) } this.$emit('buttonClick', { @@ -99,7 +104,7 @@ } - diff --git a/uni_modules/uni-goods-nav/package.json b/uni_modules/uni-goods-nav/package.json index d7d56ee0c151a95d8144272b20037f0bd996132c..636e45e7e1430ab7c2137e4f523a4eb0fb12546f 100644 --- a/uni_modules/uni-goods-nav/package.json +++ b/uni_modules/uni-goods-nav/package.json @@ -1,7 +1,7 @@ { "id": "uni-goods-nav", "displayName": "uni-goods-nav 商品导航", - "version": "1.1.1", + "version": "1.2.1", "description": "商品导航组件主要用于电商类应用底部导航,可自定义加入购物车,购买等操作", "keywords": [ "uni-ui", @@ -40,7 +40,8 @@ }, "uni_modules": { "dependencies": [ - "uni-icons" + "uni-scss", + "uni-icons" ], "encrypt": [], "platforms": { @@ -79,9 +80,9 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } } -} \ No newline at end of file +} diff --git a/uni_modules/uni-goods-nav/readme.md b/uni_modules/uni-goods-nav/readme.md index 4e47bfda746815456ecb75a35f0ebd6b7f31f127..07df93f55bb4d3e5320cba0f403a58174e1801c2 100644 --- a/uni_modules/uni-goods-nav/readme.md +++ b/uni_modules/uni-goods-nav/readme.md @@ -1,111 +1,10 @@ -### GoodsNav 商品导航 -*已经支持在nvue页面中使用* +## GoodsNav 商品导航 +> **组件名:uni-goods-nav** +> 代码块: `uGoodsNav` -商品加入购物车,立即购买,组件名:`uni-goods-nav`,代码块: uGoodsNav。 +商品加入购物车,立即购买等。 -### 使用方式 - -引用组件 - -```javascript -import uniGoodsNav from '@/components/uni-goods-nav/uni-goods-nav.vue' -export default { - components: {uniGoodsNav} -} -``` - -使用组件 - -```html - -``` - -```javascript -export default { - data () { - return { - options: [{ - icon: 'headphones', - text: '客服' - }, { - icon: 'shop', - text: '店铺', - info: 2, - infoBackgroundColor:'#007aff', - infoColor:"red" - }, { - icon: 'cart', - text: '购物车', - info: 2 - }], - buttonGroup: [{ - text: '加入购物车', - backgroundColor: '#ff0000', - color: '#fff' - }, - { - text: '立即购买', - backgroundColor: '#ffa200', - color: '#fff' - } - ] - } - }, - methods: { - onClick (e) { - uni.showToast({ - title: `点击${e.content.text}`, - icon: 'none' - }) - }, - buttonClick (e) { - console.log(e) - this.options[2].info++ - } - } -} -``` - -### 属性说明 - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|options |Array |- |组件参数 | -|buttonGroup|Array |- |组件按钮组参数 | -|fill |Boolean|false |按钮是否平铺 | - - -**options 参数说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |显示文字 | -|icon |String | |图标,[参考](https://ext.dcloud.net.cn/plugin?id=28) | -|info |Number |0 |右上角数字角标 | -|infoBackgroundColor|String |#ff0000|角标背景色 | -|infoColor |String |#fff |角标前景色 | - -**buttonGroup 参数说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |按钮文字 | -|backgroundColor |String |- |按钮背景色 | -|color |String |- |字体颜色 | - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@click |左侧点击事件 |e = {index,content}| -|@buttonClick |右侧按钮组点击事件 |e = {index,content}| - -### 插件预览地址 - -[https://uniapp.dcloud.io/h5/pages/extUI/goods-nav/goods-nav](https://uniapp.dcloud.io/h5/pages/extUI/goods-nav/goods-nav) - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/goods-nav/goods-nav](https://hellouniapp.dcloud.net.cn/pages/extUI/goods-nav/goods-nav) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-goods-nav) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-grid/changelog.md b/uni_modules/uni-grid/changelog.md index 8fc506d7f63d4483173d7dba2444e84a5cac3132..184941db61b1cdfcf51ff01e2a79237cdce374a6 100644 --- a/uni_modules/uni-grid/changelog.md +++ b/uni_modules/uni-grid/changelog.md @@ -1,5 +1,10 @@ -## 1.3.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.4.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-grid](https://uniapp.dcloud.io/component/uniui/uni-grid) +## 1.3.2(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.3.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.3.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.2.4(2021-05-12) diff --git a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue index c63bbc2ba9e9f1fa5e6cd7921f9e75f265ce752a..ab86a04e76b5c9daf52b85c86f6ad1e5b70327d2 100644 --- a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue +++ b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue @@ -94,34 +94,34 @@ .uni-grid-item--border { position: relative; /* #ifdef APP-NVUE */ - border-bottom-color: $uni-border-color; + border-bottom-color: #D2D2D2; border-bottom-style: solid; border-bottom-width: 0.5px; - border-right-color: $uni-border-color; + border-right-color: #D2D2D2; border-right-style: solid; border-right-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ z-index: 0; - border-bottom: 1px $uni-border-color solid; - border-right: 1px $uni-border-color solid; + border-bottom: 1px #D2D2D2 solid; + border-right: 1px #D2D2D2 solid; /* #endif */ } .uni-grid-item--border-top { position: relative; /* #ifdef APP-NVUE */ - border-top-color: $uni-border-color; + border-top-color: #D2D2D2; border-top-style: solid; border-top-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ - border-top: 1px $uni-border-color solid; + border-top: 1px #D2D2D2 solid; z-index: 0; /* #endif */ } .uni-highlight:active { - background-color: $uni-bg-color-hover; + background-color: #f1f1f1; } diff --git a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue index b7cc9a4973f06babfa051cb85e9b4de444036605..71edf41d00d64734e05067a9950d501c55d148a7 100644 --- a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue +++ b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue @@ -39,7 +39,7 @@ // 边框颜色 borderColor: { type: String, - default: '#e5e5e5' + default: '#D2D2D2' }, // 是否正方形显示,默认为 true square: { @@ -130,13 +130,13 @@ .uni-grid--border { position: relative; /* #ifdef APP-NVUE */ - border-left-color: $uni-border-color; + border-left-color: #D2D2D2; border-left-style: solid; border-left-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ z-index: 1; - border-left: 1px $uni-border-color solid; + border-left: 1px #D2D2D2 solid; /* #endif */ } diff --git a/uni_modules/uni-grid/package.json b/uni_modules/uni-grid/package.json index 90306f59842ac39934bc6e17d973ca290490257b..c68c9524a4049b068c116b20bb5753defa228fe7 100644 --- a/uni_modules/uni-grid/package.json +++ b/uni_modules/uni-grid/package.json @@ -1,7 +1,7 @@ { "id": "uni-grid", "displayName": "uni-grid 宫格", - "version": "1.3.1", + "version": "1.4.0", "description": "Grid 宫格组件,提供移动端常见的宫格布局,如九宫格。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss","uni-icons"], "encrypt": [], "platforms": { "cloud": { @@ -75,8 +75,12 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } } -} \ No newline at end of file +} diff --git a/uni_modules/uni-grid/readme.md b/uni_modules/uni-grid/readme.md index a748954791c56f14bc6108bffc9f62c99d282c82..0aa44cc13ef465ddef4b714bb2beada21837fae2 100644 --- a/uni_modules/uni-grid/readme.md +++ b/uni_modules/uni-grid/readme.md @@ -7,89 +7,5 @@ 宫格组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 删除组件自带圆点角标效果,完全交给用户实现,示例有简单角标效果实现 -> - Grid 组件仅在自定义组件模式下支持 -> - column 属性最大值最好不要超过 5 个,如果超过,需要注意内容显示 -> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: `详情 --> 项目配置 --> 启用 component2 编译` -> - 为了避免高度显示错误组件内必须要有内容 - - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - 文本 - - - 文本 - - - 文本 - - - - - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - -``` - -## API - -### Grid Props - -**uni-grid 属性说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|column |Number |3 |每列显示个数 | -|borderColor|String |#d0dee5|边框颜色 | -|showBorder |Boolean|true |是否显示边框 | -|square |Boolean|true |是否方形显示 | -|highlight |Boolean|true |点击背景是否高亮 | - -### Grid Events -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@change|点击 grid 触发 |e={detail:{index:0}},index 为当前点击 gird 下标| - - -### GridItem Props - -|属性名|类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|index|Number |- |子组件的唯一标识 ,点击gird会返回当前的标识| - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/grid/grid](https://hellouniapp.dcloud.net.cn/pages/extUI/grid/grid) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-grid) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-group/changelog.md b/uni_modules/uni-group/changelog.md index 6a36f7dfd096b34e82946b9eb8ae1574b04918b1..a7024fdf847c21e4385061cf0e5e62e9e73f9e5d 100644 --- a/uni_modules/uni-group/changelog.md +++ b/uni_modules/uni-group/changelog.md @@ -1,8 +1,16 @@ +## 1.2.2(2022-05-30) +- 新增 stat属性,是否开启uni统计功能 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-group](https://uniapp.dcloud.io/component/uniui/uni-group) +## 1.1.7(2021-11-08) ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 优化 组件文档 -## 1.0.3(2021-05-12) -- 新增 组件示例地址 -## 1.0.2(2021-02-05) -- 调整为uni_modules目录规范 -- 优化 兼容 nvue 页面 +## 1.0.3(2021-05-12) +- 新增 组件示例地址 +## 1.0.2(2021-02-05) +- 调整为uni_modules目录规范 +- 优化 兼容 nvue 页面 diff --git a/uni_modules/uni-group/components/uni-group/uni-group.vue b/uni_modules/uni-group/components/uni-group/uni-group.vue index eaae7f0c0615f9e98bca1f34bc6fb9a8281b8761..40494e98d591e91f6a3d57b9c2d36cf13b8bf458 100644 --- a/uni_modules/uni-group/components/uni-group/uni-group.vue +++ b/uni_modules/uni-group/components/uni-group/uni-group.vue @@ -35,6 +35,10 @@ mode: { type: String, default: 'default' + }, + stat:{ + type: Boolean, + default: false } }, data() { @@ -45,7 +49,7 @@ }, watch: { title(newVal) { - if (uni.report && newVal !== '') { + if (uni.report && this.stat && newVal !== '') { uni.report('title', newVal) } } @@ -53,7 +57,7 @@ created() { this.form = this.getForm() if (this.form) { - this.margin = true + this.margin = true this.border = this.form.border } }, @@ -77,43 +81,43 @@ } } - + diff --git a/uni_modules/uni-group/package.json b/uni_modules/uni-group/package.json index ec178634a892db382e2c5d80e290dffce916cdfd..ea00a08c2bfcfe6aa827bcbcd02d7b2af60ea9ed 100644 --- a/uni_modules/uni-group/package.json +++ b/uni_modules/uni-group/package.json @@ -1,83 +1,87 @@ -{ - "id": "uni-group", - "displayName": "uni-group 分组", - "version": "1.1.0", - "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块", - "keywords": [ - "uni-ui", - "uniui", - "group", - "分组", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } +{ + "id": "uni-group", + "displayName": "uni-group 分组", + "version": "1.2.2", + "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块", + "keywords": [ + "uni-ui", + "uniui", + "group", + "分组", + "" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-group/readme.md b/uni_modules/uni-group/readme.md index deefb22cd115448fcf7f41e50f01bc8f44c62154..bae67f4681bdf53194164e553c1107237bc1cf90 100644 --- a/uni_modules/uni-group/readme.md +++ b/uni_modules/uni-group/readme.md @@ -1,54 +1,9 @@ +## Group 分组 +> **组件名:uni-group** +> 代码块: `uGroup` -### Group 分组 +分组组件可用于将组件分组,添加间隔,以产生明显的区块。 -分组组件可用于将组件分组,添加间隔,以产生明显的区块,组件名:``uni-group``,代码块: uGroup。 - -### 平台差异说明 - -如无特殊说明,则全平台可用 - -### 组件使用注意事项 - -为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 - -- 组件需要依赖 `sass` 插件 ,请自行手动安装 -- 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - - -### 使用方式 - -在 ``template`` 中使用组件 - -```html - - 分组1 的内容 - 分组1 的内容 - - - - 分组2 的内容 - 分组2 的内容 - -``` - -### 属性说明 - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|title|String|-|主标题| -|top|Number|-|分组间隔| -|mode|String|''|模式 ,card 为卡片模式| - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/group/group](https://hellouniapp.dcloud.net.cn/pages/extUI/group/group) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-group) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-icons/changelog.md b/uni_modules/uni-icons/changelog.md index 3c01efc160aa64547fb95a8ef75d308eef891cfa..64498853cdd91577d9cb5646bf50b307a83d58fe 100644 --- a/uni_modules/uni-icons/changelog.md +++ b/uni_modules/uni-icons/changelog.md @@ -1,3 +1,9 @@ +## 1.3.5(2022-01-24) +- 优化 size 属性可以传入不带单位的字符串数值 +## 1.3.4(2022-01-24) +- 优化 size 支持其他单位 +## 1.3.3(2022-01-17) +- 修复 nvue 有些图标不显示的bug,兼容老版本图标 ## 1.3.2(2021-12-01) - 优化 示例可复制图标名称 ## 1.3.1(2021-11-23) diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js index d18973786f37e0f4193ff9052a398a2bdd464e3a..78899364ed8043d4ac7051a5b6c3821bfd1e802a 100644 --- a/uni_modules/uni-icons/components/uni-icons/icons.js +++ b/uni_modules/uni-icons/components/uni-icons/icons.js @@ -173,6 +173,13 @@ export default { "unicode": "e6bb", "unicode_decimal": 59067 }, + { + "icon_id": "24923353", + "name": "arrowthinright", + "font_class": "arrowthinright", + "unicode": "e6bb", + "unicode_decimal": 59067 + }, { "icon_id": "24923354", "name": "arrowthinleft", @@ -180,6 +187,13 @@ export default { "unicode": "e6bc", "unicode_decimal": 59068 }, + { + "icon_id": "24923354", + "name": "arrowthinleft", + "font_class": "arrowthinleft", + "unicode": "e6bc", + "unicode_decimal": 59068 + }, { "icon_id": "24923355", "name": "arrowthinup", @@ -187,12 +201,25 @@ export default { "unicode": "e6bd", "unicode_decimal": 59069 }, + { + "icon_id": "24923355", + "name": "arrowthinup", + "font_class": "arrowthinup", + "unicode": "e6bd", + "unicode_decimal": 59069 + }, { "icon_id": "24923356", "name": "arrowthindown", "font_class": "arrow-down", "unicode": "e6be", "unicode_decimal": 59070 + },{ + "icon_id": "24923356", + "name": "arrowthindown", + "font_class": "arrowthindown", + "unicode": "e6be", + "unicode_decimal": 59070 }, { "icon_id": "24923349", @@ -200,6 +227,12 @@ export default { "font_class": "bottom", "unicode": "e6b8", "unicode_decimal": 59064 + },{ + "icon_id": "24923349", + "name": "arrowdown", + "font_class": "arrowdown", + "unicode": "e6b8", + "unicode_decimal": 59064 }, { "icon_id": "24923346", @@ -208,6 +241,13 @@ export default { "unicode": "e6b5", "unicode_decimal": 59061 }, + { + "icon_id": "24923346", + "name": "arrowright", + "font_class": "arrowright", + "unicode": "e6b5", + "unicode_decimal": 59061 + }, { "icon_id": "24923347", "name": "arrowup", @@ -215,6 +255,13 @@ export default { "unicode": "e6b6", "unicode_decimal": 59062 }, + { + "icon_id": "24923347", + "name": "arrowup", + "font_class": "arrowup", + "unicode": "e6b6", + "unicode_decimal": 59062 + }, { "icon_id": "24923348", "name": "arrowleft", @@ -222,6 +269,13 @@ export default { "unicode": "e6b7", "unicode_decimal": 59063 }, + { + "icon_id": "24923348", + "name": "arrowleft", + "font_class": "arrowleft", + "unicode": "e6b7", + "unicode_decimal": 59063 + }, { "icon_id": "24923334", "name": "eye", diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue index a9f271d7ff1297e6aa697766f42d6b6f645293da..a87f68e428cd685f8e2235754b208014966d2ed3 100644 --- a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue +++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue @@ -1,14 +1,18 @@ - + diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue index 9f8796f821dd17457e567ee2164f67b0bf46c4c6..04e56b82f9902b0a23740e69d93e46133cc5ea7a 100644 --- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue @@ -7,7 +7,7 @@ - + @@ -217,7 +217,11 @@ }; - + diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue index 71f16a4d77a5b5f0d2b8fa1521803f7b10d42acc..2c7d9ea7cec731113cce0f3e76301e6f5e37b181 100644 --- a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue +++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue @@ -1,461 +1,454 @@ - - - - - diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue index 389178b2b09e45e936e20b7f3aea68b35f6ca5f9..7940afc4c1da9f3f5f8a1876249b8963d8a41cf9 100644 --- a/uni_modules/uni-list/components/uni-list/uni-list.vue +++ b/uni_modules/uni-list/components/uni-list/uni-list.vue @@ -54,7 +54,9 @@ export default { } }; - + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.vue b/uni_modules/uni-list/components/uni-list/uni-refresh.vue index 2c64158a6293c4c9d67c8e551d8365a90fcfcd80..3b4c5a230061935d31d8332663b8a511b5143759 100644 --- a/uni_modules/uni-list/components/uni-list/uni-refresh.vue +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.vue @@ -1,65 +1,65 @@ - - - - - + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs index 9ef364e092dbae2ec45dcd6a279a27263c890103..818a6b721b1172073d91c1f6a456d2b54d772f77 100644 --- a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs @@ -1,87 +1,87 @@ -var pullDown = { - threshold: 95, - maxHeight: 200, - callRefresh: 'onrefresh', - callPullingDown: 'onpullingdown', - refreshSelector: '.uni-refresh' -}; - -function ready(newValue, oldValue, ownerInstance, instance) { - var state = instance.getState() - state.canPullDown = newValue; - // console.log(newValue); -} - -function touchStart(e, instance) { - var state = instance.getState(); - state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); - state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); - if (!state.canPullDown) { - return - } - - // console.log("touchStart"); - - state.height = 0; - state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; - state.refreshInstance.setStyle({ - 'height': 0 - }); - state.refreshInstance.callMethod("onchange", true); -} - -function touchMove(e, ownerInstance) { - var instance = e.instance; - var state = instance.getState(); - if (!state.canPullDown) { - return - } - - var oldHeight = state.height; - var endY = e.touches[0].pageY || e.changedTouches[0].pageY; - var height = endY - state.touchStartY; - if (height > pullDown.maxHeight) { - return; - } - - var refreshInstance = state.refreshInstance; - refreshInstance.setStyle({ - 'height': height + 'px' - }); - - height = height < pullDown.maxHeight ? height : pullDown.maxHeight; - state.height = height; - refreshInstance.callMethod(pullDown.callPullingDown, { - height: height - }); -} - -function touchEnd(e, ownerInstance) { - var state = e.instance.getState(); - if (!state.canPullDown) { - return - } - - state.refreshInstance.callMethod("onchange", false); - - var refreshInstance = state.refreshInstance; - if (state.height > pullDown.threshold) { - refreshInstance.callMethod(pullDown.callRefresh); - return; - } - - refreshInstance.setStyle({ - 'height': 0 - }); -} - -function propObserver(newValue, oldValue, instance) { - pullDown = newValue; -} - -module.exports = { - touchmove: touchMove, - touchstart: touchStart, - touchend: touchEnd, - propObserver: propObserver -} +var pullDown = { + threshold: 95, + maxHeight: 200, + callRefresh: 'onrefresh', + callPullingDown: 'onpullingdown', + refreshSelector: '.uni-refresh' +}; + +function ready(newValue, oldValue, ownerInstance, instance) { + var state = instance.getState() + state.canPullDown = newValue; + // console.log(newValue); +} + +function touchStart(e, instance) { + var state = instance.getState(); + state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); + state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); + if (!state.canPullDown) { + return + } + + // console.log("touchStart"); + + state.height = 0; + state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; + state.refreshInstance.setStyle({ + 'height': 0 + }); + state.refreshInstance.callMethod("onchange", true); +} + +function touchMove(e, ownerInstance) { + var instance = e.instance; + var state = instance.getState(); + if (!state.canPullDown) { + return + } + + var oldHeight = state.height; + var endY = e.touches[0].pageY || e.changedTouches[0].pageY; + var height = endY - state.touchStartY; + if (height > pullDown.maxHeight) { + return; + } + + var refreshInstance = state.refreshInstance; + refreshInstance.setStyle({ + 'height': height + 'px' + }); + + height = height < pullDown.maxHeight ? height : pullDown.maxHeight; + state.height = height; + refreshInstance.callMethod(pullDown.callPullingDown, { + height: height + }); +} + +function touchEnd(e, ownerInstance) { + var state = e.instance.getState(); + if (!state.canPullDown) { + return + } + + state.refreshInstance.callMethod("onchange", false); + + var refreshInstance = state.refreshInstance; + if (state.height > pullDown.threshold) { + refreshInstance.callMethod(pullDown.callRefresh); + return; + } + + refreshInstance.setStyle({ + 'height': 0 + }); +} + +function propObserver(newValue, oldValue, instance) { + pullDown = newValue; +} + +module.exports = { + touchmove: touchMove, + touchstart: touchStart, + touchend: touchEnd, + propObserver: propObserver +} diff --git a/uni_modules/uni-list/package.json b/uni_modules/uni-list/package.json index d9453a92d0c22bf345aaa95cab7fe404f5d2da0d..66e8bef0c687903d3d0ca857ac97450f34a07565 100644 --- a/uni_modules/uni-list/package.json +++ b/uni_modules/uni-list/package.json @@ -1,91 +1,91 @@ -{ - "id": "uni-list", - "displayName": "uni-list 列表", - "version": "1.1.3", - "description": "List 组件 ,帮助使用者快速构建列表。", - "keywords": [ - "", - "uni-ui", - "uniui", - "列表", - "", - "list" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-badge", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } +{ + "id": "uni-list", + "displayName": "uni-list 列表", + "version": "1.2.1", + "description": "List 组件 ,帮助使用者快速构建列表。", + "keywords": [ + "", + "uni-ui", + "uniui", + "列表", + "", + "list" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-badge", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-list/readme.md b/uni_modules/uni-list/readme.md index e4a5d73d81b4811aee609bc7ba37bdded964cd26..32c28654eb9654bfa833a5de6012f44c4fe854db 100644 --- a/uni_modules/uni-list/readme.md +++ b/uni_modules/uni-list/readme.md @@ -1,5 +1,3 @@ - - ## List 列表 > **组件名:uni-list** > 代码块: `uList`、`uListItem` @@ -125,7 +123,7 @@ uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-l - + @@ -204,7 +202,8 @@ thumb |String |- | 左侧缩略图,若thumb有值,则不会显示扩展 thumbSize |String |medium | 略缩图尺寸,可选值,lg:大图; medium:一般; sm:小图; showBadge |Boolean |false | 是否显示数字角标 badgeText |String |- | 数字角标内容 -badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21) +badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21) +badgeStyle |Object |- | 数字角标样式,使用uni-badge的custom-style参数 rightText |String |- | 右侧文字内容 disabled |Boolean |false | 是否禁用 showArrow |Boolean |true | 是否显示箭头图标 diff --git a/uni_modules/uni-load-more/changelog.md b/uni_modules/uni-load-more/changelog.md index 5b60375335474b0dbc300db3765c0fa90ea61d36..8f03f1d57a158042a6c3f0ce254569f37447e845 100644 --- a/uni_modules/uni-load-more/changelog.md +++ b/uni_modules/uni-load-more/changelog.md @@ -1,3 +1,12 @@ +## 1.3.3(2022-01-20) +- 新增 showText属性 ,是否显示文本 +## 1.3.2(2022-01-19) +- 修复 nvue 平台下不显示文本的bug +## 1.3.1(2022-01-19) +- 修复 微信小程序平台样式选择器报警告的问题 +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more) ## 1.2.1(2021-08-24) - 新增 支持国际化 ## 1.2.0(2021-07-30) diff --git a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue index b20dea5e026bbd68c465d42e053ba367b09747cf..ededbc20d39978894c42cf4a62954c5f67ba6951 100644 --- a/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue +++ b/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue @@ -1,43 +1,52 @@ - diff --git a/uni_modules/uni-load-more/package.json b/uni_modules/uni-load-more/package.json index 062ee5deb222929b361aecc31e2dc866ad659e77..2fa6f040a8952a8246f9dd9a875f6b95e21996f6 100644 --- a/uni_modules/uni-load-more/package.json +++ b/uni_modules/uni-load-more/package.json @@ -1,7 +1,7 @@ { "id": "uni-load-more", "displayName": "uni-load-more 加载更多", - "version": "1.2.1", + "version": "1.3.3", "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-load-more/readme.md b/uni_modules/uni-load-more/readme.md index b781fafd5accab29b9b7cbfe8dfec66618e3594a..54dc1fad29ca3906f3498530878791679e63a7bf 100644 --- a/uni_modules/uni-load-more/readme.md +++ b/uni_modules/uni-load-more/readme.md @@ -7,64 +7,8 @@ 用于列表中,做滚动加载使用,展示 loading 的各种状态。 -### 安装方式 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) -### 使用方式 - -在 ``template`` 中使用组件 - -```html - -``` - -## API - -### LoadMore Props - -|属性名 |类型 | 可选值 |默认值 |说明 | -|:-: |:-: |:-: |:-: |:-: | -|iconSize |Number |- |24 |指定图标大小 | -|status |String |more/loading/noMore |more |loading 的状态 | -|showIcon |Boolean|- |true |是否显示 loading 图标 | -|iconType |String |snow/circle/auto |auto |指定图标样式| -|color |String |- |#777777 |图标和文字颜色 | -|contentText|Object|- |{contentdown: "上拉显示更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"}|各状态文字说明 | - - -#### Status Options -|参数名称 |说明 | -|:-: |:-: | -|more |loading前 | -|loading|loading前中 | -|more |没有更多数据 | - -#### IconType Options -|参数名称 |说明 | -|:-: |:-: | -|snow |ios雪花加载样式 | -|circle |安卓环形加载样式 | -|auto |根据平台自动选择加载样式 | - - - - -> **说明** -> `iconType`为`snow`时,在`APP-NVUE`平台不可设置大小,在非`APP-NVUE`平台不可设置颜色 - - - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|clickLoadMore |点击加载更多时触发 |e.detail={status:'loading'}| - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more](https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more) \ No newline at end of file diff --git a/uni_modules/uni-nav-bar/changelog.md b/uni_modules/uni-nav-bar/changelog.md index 70b3c488026ca64c47a6d00000fa3d0d82fdcdee..c2d841b6b3ea2227ae534d0607af974c2bed6b16 100644 --- a/uni_modules/uni-nav-bar/changelog.md +++ b/uni_modules/uni-nav-bar/changelog.md @@ -1,19 +1,39 @@ +## 1.3.5(2022-05-24) +- 新增 stat 属性 ,可开启统计title 上报 ,仅使用了title 属性且项目开启了uni统计生效 +## 1.3.4(2022-01-24) +- 更新 组件示例 +## 1.3.3(2022-01-24) +- 新增 left-width/right-width属性 ,可修改左右两侧的宽度 +## 1.3.2(2022-01-18) +- 修复 在vue下,标题不垂直居中的bug +## 1.3.1(2022-01-18) +- 修复 height 属性类型错误 +## 1.3.0(2022-01-18) +- 新增 height 属性,可修改组件高度 +- 新增 dark 属性可可开启暗黑模式 +- 优化 标题字数过多显示省略号 +- 优化 插槽,插入内容可完全覆盖 +## 1.2.1(2022-01-10) +- 修复 color 属性不生效的bug +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-nav-bar](https://uniapp.dcloud.io/component/uniui/uni-nav-bar) ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.11(2021-05-12) -- 新增 组件示例地址 -## 1.0.10(2021-04-30) -- 修复 在nvue下fixed为true,宽度不能撑满的Bug -## 1.0.9(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 1.0.8(2021-04-14) -- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug - -## 1.0.7(2021-02-25) -- 修复 easycom 下,找不到 uni-status-bar 的bug - -## 1.0.6(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.5(2021-02-05) -- 调整为uni_modules目录规范 +## 1.0.11(2021-05-12) +- 新增 组件示例地址 +## 1.0.10(2021-04-30) +- 修复 在nvue下fixed为true,宽度不能撑满的Bug +## 1.0.9(2021-04-21) +- 优化 添加依赖 uni-icons, 导入后自动下载依赖 +## 1.0.8(2021-04-14) +- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug + +## 1.0.7(2021-02-25) +- 修复 easycom 下,找不到 uni-status-bar 的bug + +## 1.0.6(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.5(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue index 0df773fecb496747b7996d60362f98405fa8194a..4a46b870554ef03d6be7b1c11bbddc4d3e187e0b 100644 --- a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue +++ b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue @@ -1,52 +1,59 @@ - + diff --git a/uni_modules/uni-nav-bar/package.json b/uni_modules/uni-nav-bar/package.json index caf0ed4b12e8d0a9b3ecd984f347d9a05a40700a..a69ed4f19095bfedcabae723c00c56ab2fbd340f 100644 --- a/uni_modules/uni-nav-bar/package.json +++ b/uni_modules/uni-nav-bar/package.json @@ -1,84 +1,89 @@ -{ - "id": "uni-nav-bar", - "displayName": "uni-nav-bar 自定义导航栏", - "version": "1.1.0", - "description": "自定义导航栏组件,主要用于头部导航。", - "keywords": [ - "uni-ui", - "导航", - "导航栏", - "自定义导航栏" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } +{ + "id": "uni-nav-bar", + "displayName": "uni-nav-bar 自定义导航栏", + "version": "1.3.5", + "description": "自定义导航栏组件,主要用于头部导航。", + "keywords": [ + "uni-ui", + "导航", + "导航栏", + "自定义导航栏" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-nav-bar/readme.md b/uni_modules/uni-nav-bar/readme.md index fa34c8e6357b1d4ef1e103e037c617a6cb895a8a..3934b3277583a4a8073d2b42a367d237f748157a 100644 --- a/uni_modules/uni-nav-bar/readme.md +++ b/uni_modules/uni-nav-bar/readme.md @@ -1,71 +1,15 @@ -### NavBar 导航栏 -*已经支持在nvue页面中使用* +## NavBar 导航栏 +> **组件名:uni-nav-bar** +> 代码块: `uNavBar` -导航栏组件,主要用于头部导航,组件名:``uni-nav-bar``,代码块: uNavBar。 +导航栏组件,主要用于头部导航。 -### 使用方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-nav-bar) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -在 ``script`` 中引用组件 -```javascript -import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue' -export default { - components: {uniNavBar} -} -``` -在 ``template`` 中使用组件 -```html - -``` -### 属性说明 - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|title |String |- |标题文字 | -|leftText |String |- |左侧按钮文本 | -|rightText |String |- |右侧按钮文本 | -|leftIcon |String |- |左侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性) | -|rightIcon |String |- |右侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性) | -|color |String |#000000|图标和文字颜色 | -|backgroundColor |String |#FFFFFF|导航栏背景颜色 | -|fixed |Boolean|false |是否固定顶部 | -|statusBar |Boolean|false |是否包含状态栏 | -|shadow |Boolean|false |导航栏下是否有阴影 | - -### 插槽说明 - -开发者使用 NavBar 时,支持向 NavBar 里插入不同内容,以达到自定义的目的。 - -|slot名 |说明 | -|:-: |:-: | -|left |向导航栏左侧插入 | -|right |向导航栏右侧插入 | -|default|向导航栏中间插入 | - -```html - - 标题栏 - left - right - -``` - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@clickLeft |左侧按钮点击时触发 |- | -|@clickRight |右侧按钮点击时触发 |- | - -### 插件预览地址 - -[https://uniapp.dcloud.io/h5/pages/extUI/nav-bar/nav-bar](https://uniapp.dcloud.io/h5/pages/extUI/nav-bar/nav-bar) - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/nav-bar/nav-bar](https://hellouniapp.dcloud.net.cn/pages/extUI/nav-bar/nav-bar) \ No newline at end of file diff --git a/uni_modules/uni-notice-bar/changelog.md b/uni_modules/uni-notice-bar/changelog.md index 37d7319e1f7a1392f2b1fdbdabede28e3dca51b4..b5581226acb2e2a168189f1dc1b6aa587768c88d 100644 --- a/uni_modules/uni-notice-bar/changelog.md +++ b/uni_modules/uni-notice-bar/changelog.md @@ -1,5 +1,10 @@ -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) +## 1.1.1(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.9(2021-05-12) - 新增 组件示例地址 ## 1.0.8(2021-04-21) diff --git a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue index 914ebe2c6d0d6fe02cd121938badb3c842cc195e..0a50ce2578c7b625cc5bd0971589bedd1b0715d0 100644 --- a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue +++ b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue @@ -1,28 +1,24 @@ @@ -31,31 +27,31 @@ // #ifdef APP-NVUE const dom = weex.requireModule('dom'); const animation = weex.requireModule('animation'); - // #endif - - /** - * NoticeBar 自定义导航栏 - * @description 通告栏组件 - * @tutorial https://ext.dcloud.net.cn/plugin?id=30 - * @property {Number} speed 文字滚动的速度,默认100px/秒 - * @property {String} text 显示文字 - * @property {String} backgroundColor 背景颜色 - * @property {String} color 文字颜色 - * @property {String} moreColor 查看更多文字的颜色 - * @property {String} moreText 设置“查看更多”的文本 - * @property {Boolean} single = [true|false] 是否单行 - * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行 - * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标 - * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮 - * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行 - * @event {Function} click 点击 NoticeBar 触发事件 - * @event {Function} close 关闭 NoticeBar 触发事件 - * @event {Function} getmore 点击”查看更多“时触发事件 - */ + // #endif + + /** + * NoticeBar 自定义导航栏 + * @description 通告栏组件 + * @tutorial https://ext.dcloud.net.cn/plugin?id=30 + * @property {Number} speed 文字滚动的速度,默认100px/秒 + * @property {String} text 显示文字 + * @property {String} backgroundColor 背景颜色 + * @property {String} color 文字颜色 + * @property {String} moreColor 查看更多文字的颜色 + * @property {String} moreText 设置“查看更多”的文本 + * @property {Boolean} single = [true|false] 是否单行 + * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行 + * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标 + * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮 + * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行 + * @event {Function} click 点击 NoticeBar 触发事件 + * @event {Function} close 关闭 NoticeBar 触发事件 + * @event {Function} getmore 点击”查看更多“时触发事件 + */ export default { name: 'UniNoticeBar', - emits:['click','getmore','close'], + emits: ['click', 'getmore', 'close'], props: { text: { type: String, @@ -67,7 +63,7 @@ }, backgroundColor: { type: String, - default: '#fffbe8' + default: '#FFF9EA' }, speed: { // 默认1s滚动100px @@ -76,11 +72,11 @@ }, color: { type: String, - default: '#de8c17' + default: '#FF9A43' }, moreColor: { type: String, - default: '#999999' + default: '#FF9A43' }, single: { // 是否单行 @@ -132,10 +128,10 @@ var pages = getCurrentPages(); var page = pages[pages.length - 1]; var currentWebview = page.$getAppWebview(); - currentWebview.addEventListener('hide',()=>{ + currentWebview.addEventListener('hide', () => { this.webviewHide = true }) - currentWebview.addEventListener('show',()=>{ + currentWebview.addEventListener('show', () => { this.webviewHide = false }) // #endif @@ -156,9 +152,9 @@ boxWidth = 0, textWidth = 0; let textQuery = new Promise((resolve, reject) => { - uni.createSelectorQuery() + uni.createSelectorQuery() // #ifndef MP-ALIPAY - .in(this) + .in(this) // #endif .select(`#${this.elId}`) .boundingClientRect() @@ -168,9 +164,9 @@ }) }) let boxQuery = new Promise((resolve, reject) => { - uni.createSelectorQuery() + uni.createSelectorQuery() // #ifndef MP-ALIPAY - .in(this) + .in(this) // #endif .select(`#${this.elIdBox}`) .boundingClientRect() @@ -267,7 +263,6 @@ + diff --git a/uni_modules/uni-notice-bar/package.json b/uni_modules/uni-notice-bar/package.json index e11a41793fd9944fc36873d338dfafc9c352ed3f..37c22302cad869171c45fa5881263953e2d6aa8b 100644 --- a/uni_modules/uni-notice-bar/package.json +++ b/uni_modules/uni-notice-bar/package.json @@ -1,7 +1,7 @@ { "id": "uni-notice-bar", "displayName": "uni-notice-bar 通告栏", - "version": "1.1.0", + "version": "1.2.0", "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告", "keywords": [ "uni-ui", @@ -41,7 +41,8 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [ + "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -78,6 +79,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-notice-bar/readme.md b/uni_modules/uni-notice-bar/readme.md index f65c5788b4d88ac33a0b887ad26b8e7caaa2a754..fb2ede244adc00c5f777b9f6580e7c0c7729252e 100644 --- a/uni_modules/uni-notice-bar/readme.md +++ b/uni_modules/uni-notice-bar/readme.md @@ -7,65 +7,7 @@ 通告栏组件 。 -### 安装方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - - - - - - - - - -``` - -> **注意** -> 如果需要异步获取内容后展示需要使用`v-if`进行控制,`` - - -## NoticeBar API - -### NoticeBar Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|speed |Number |100 |文字滚动的速度,默认100px/秒 | -|text |String |- |显示文字 | -|background-color |String |#fffbe8|背景颜色 | -|color |String |#de8c17|文字颜色 | -|moreColor |String |#999999|查看更多文字的颜色 | -|moreText |String |- |设置“查看更多”的文本 | -|single |Boolean|false |是否单行 | -|scrollable |Boolean|false |是否滚动,为true时,NoticeBar为单行 | -|showIcon |Boolean|false |是否显示左侧喇叭图标 | -|showClose |Boolean|false |是否显示左侧关闭按钮 | -|showGetMore |Boolean|false |是否显示右侧查看更多图标,为true时,NoticeBar为单行| - -### NoticeBar Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|@click |点击 NoticeBar 触发事件 |- | -|@close |关闭 NoticeBar 触发事件 |- | -|@getmore |点击”查看更多“时触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/notice-bar/notice-bar](https://hellouniapp.dcloud.net.cn/pages/extUI/notice-bar/notice-bar) \ No newline at end of file diff --git a/uni_modules/uni-number-box/changelog.md b/uni_modules/uni-number-box/changelog.md index 1b73c791692966abf8bba034bb7b6b7cdc93e633..82b8656f0b07014636ebbcde6bed0ad07c5b2089 100644 --- a/uni_modules/uni-number-box/changelog.md +++ b/uni_modules/uni-number-box/changelog.md @@ -1,5 +1,12 @@ -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-number-box](https://uniapp.dcloud.io/component/uniui/uni-number-box) +## 1.1.2(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.1.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) diff --git a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue index aee1742d8b532d6f5242deeb3a99b551113761b6..738fe3b7fdb1c8838ef365eb9294222f0393de53 100644 --- a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue +++ b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue @@ -1,11 +1,12 @@ @@ -18,19 +19,23 @@ * @property {Number} min 最小值 * @property {Number} max 最大值 * @property {Number} step 每次点击改变的间隔大小 + * @property {String} background 背景色 + * @property {String} color 字体颜色(前景色) * @property {Boolean} disabled = [true|false] 是否为禁用状态 * @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value + * @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象 + * @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象 */ export default { name: "UniNumberBox", - emits:['change','input','update:modelValue','blur','focus'], + emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'], props: { value: { type: [Number, String], default: 1 }, - modelValue:{ + modelValue: { type: [Number, String], default: 1 }, @@ -45,6 +50,14 @@ step: { type: Number, default: 1 + }, + background: { + type: String, + default: '#f5f5f5' + }, + color: { + type: String, + default: '#333' }, disabled: { type: Boolean, @@ -60,15 +73,15 @@ value(val) { this.inputValue = +val; }, - modelValue(val){ + modelValue(val) { this.inputValue = +val; - } + } }, created() { - if(this.value === 1){ + if (this.value === 1) { this.inputValue = +this.modelValue; } - if(this.modelValue === 1){ + if (this.modelValue === 1) { this.inputValue = +this.value; } }, @@ -141,91 +154,67 @@ }; + diff --git a/uni_modules/uni-number-box/package.json b/uni_modules/uni-number-box/package.json index 940a29574b7a0dbe195036d64bb950e9c97f0360..e774c3f811a0909215c8ddd87a5ca047de2e2a78 100644 --- a/uni_modules/uni-number-box/package.json +++ b/uni_modules/uni-number-box/package.json @@ -1,7 +1,7 @@ { "id": "uni-number-box", "displayName": "uni-number-box 数字输入框", - "version": "1.1.1", + "version": "1.2.1", "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。", "keywords": [ "uni-ui", @@ -39,7 +39,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -74,6 +74,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-number-box/readme.md b/uni_modules/uni-number-box/readme.md index 9c951e4840d8caa16fde972bdf4fd61151672fa3..affc56fa7b79a879370d9ab915004a505f4fccea 100644 --- a/uni_modules/uni-number-box/readme.md +++ b/uni_modules/uni-number-box/readme.md @@ -7,44 +7,7 @@ 带加减按钮的数字输入框。 -### 安装方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-number-box) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - -``` - -## API - -### NumberBox Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|value/v-model|Number |0 |输入框当前值 | -|min |Number |0 |最小值 | -|max |Number |100 |最大值 | -|step |Number |1 |每次点击改变的间隔大小 | -|disabled |Boolean|false |是否为禁用状态 | - -### NumberBox Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|change |输入框值改变时触发的事件,参数为输入框当前的 value |- | -|focus |输入框聚焦时触发的事件,参数为 event 对象 |- | -|blur |输入框失焦时触发的事件,参数为 event 对象 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/number-box/number-box](https://hellouniapp.dcloud.net.cn/pages/extUI/number-box/number-box) \ No newline at end of file diff --git a/uni_modules/uni-pagination/changelog.md b/uni_modules/uni-pagination/changelog.md index 9c4fde2f2bef380063ee30ede424af8e34317175..5459dde48126a7cddcfa9cbdbf778c98a7af30a4 100644 --- a/uni_modules/uni-pagination/changelog.md +++ b/uni_modules/uni-pagination/changelog.md @@ -1,5 +1,14 @@ -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination) +## 1.1.2(2021-10-08) +- 修复 current 、value 属性未监听,导致高亮样式失效的 bug +## 1.1.1(2021-08-20) +- 新增 支持国际化 +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) - 新增 组件示例地址 ## 1.0.6(2021-04-12) diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json new file mode 100644 index 0000000000000000000000000000000000000000..a57becdcd04f533578cb5e59cd779fbaf725acfb --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "prev", + "uni-pagination.nextText": "next" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json new file mode 100644 index 0000000000000000000000000000000000000000..ccbba2f63e93690836d95b3b2f8474737cdd70f0 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "anterior", + "uni-pagination.nextText": "próxima" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json new file mode 100644 index 0000000000000000000000000000000000000000..9b5f2d92d91a23eeaed47c17dbdbb8b79efab92f --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "précédente", + "uni-pagination.nextText": "suivante" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js b/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2469dd02b259a09267f4a6443b856670b9a26e4a --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js @@ -0,0 +1,12 @@ +import en from './en.json' +import es from './es.json' +import fr from './fr.json' +import zhHans from './zh-Hans.json' +import zhHant from './zh-Hant.json' +export default { + en, + es, + fr, + 'zh-Hans': zhHans, + 'zh-Hant': zhHant +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json new file mode 100644 index 0000000000000000000000000000000000000000..fedbe82a935864f882525145746ad9a51948f43b --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "上一页", + "uni-pagination.nextText": "下一页" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json new file mode 100644 index 0000000000000000000000000000000000000000..133b3404b081fe0942b18eff9a7268dd06ff1615 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "上一頁", + "uni-pagination.nextText": "下一頁" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue index 4f07c0eb359076805620022a05061c7452ee19a9..32fd4147a899f42188624d1d0c3fe9e64b9054ca 100644 --- a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue +++ b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue @@ -1,404 +1,409 @@ - diff --git a/uni_modules/uni-pagination/package.json b/uni_modules/uni-pagination/package.json index b0e9501aa473e26a51e3e9c50d9f271338da5a2e..c24a2e86b0391e5364360ace06f5763e1fc58bfd 100644 --- a/uni_modules/uni-pagination/package.json +++ b/uni_modules/uni-pagination/package.json @@ -1,7 +1,7 @@ { "id": "uni-pagination", "displayName": "uni-pagination 分页器", - "version": "1.1.0", + "version": "1.2.1", "description": "Pagination 分页器组件,用于展示页码、请求数据等。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": ["uni-icons"], + "dependencies": ["uni-scss","uni-icons"], "encrypt": [], "platforms": { "cloud": { @@ -75,6 +75,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-pagination/readme.md b/uni_modules/uni-pagination/readme.md index c8e47e3ebd4841a2fea259839349c647536c630c..eefa26348d901f39fa9d25ceec1b51908b5e8584 100644 --- a/uni_modules/uni-pagination/readme.md +++ b/uni_modules/uni-pagination/readme.md @@ -7,42 +7,7 @@ 分页器组件,用于展示页码、请求数据等。 -### 安装方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - -``` - -## API - -### Pagination Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|prevText |String |上一页 |左侧按钮文字 | -|nextText |String |下一页 |右侧按钮文字 | -|current |Number |1 |当前页 | -|total |Number |0 |数据总量 | -|pageSize |Number |10 |每页数据量 | -|showIcon |Boolean|false |是否以 icon 形式展示按钮 | - - -### Pagination Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@change|点击页码按钮时触发 |e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个 | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/pagination/pagination](https://hellouniapp.dcloud.net.cn/pages/extUI/pagination/pagination) \ No newline at end of file diff --git a/uni_modules/uni-popup/changelog.md b/uni_modules/uni-popup/changelog.md index a5d6a798e808aeec2251926d012e6ff9f13aeffb..a9e2d668244f888b84bbf7d881c25280e637c25f 100644 --- a/uni_modules/uni-popup/changelog.md +++ b/uni_modules/uni-popup/changelog.md @@ -1,44 +1,60 @@ +## 1.7.9(2022-04-02) +- 修复 弹出层内部无法滚动的bug +## 1.7.8(2022-03-28) +- 修复 小程序中高度错误的bug +## 1.7.7(2022-03-17) +- 修复 快速调用open出现问题的Bug +## 1.7.6(2022-02-14) +- 修复 safeArea 属性不能设置为false的bug +## 1.7.5(2022-01-19) +- 修复 isMaskClick 失效的bug +## 1.7.4(2022-01-19) +- 新增 cancelText \ confirmText 属性 ,可自定义文本 +- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 +- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 +## 1.7.3(2022-01-13) +- 修复 设置 safeArea 属性不生效的bug ## 1.7.2(2021-11-26) - 优化 组件示例 ## 1.7.1(2021-11-26) - 修复 vuedoc 文字错误 -## 1.7.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) -## 1.6.2(2021-08-24) -- 新增 支持国际化 -## 1.6.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.6.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.5.0(2021-06-23) -- 新增 mask-click 遮罩层点击事件 -## 1.4.5(2021-06-22) -- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.4(2021-06-18) -- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.3(2021-06-08) -- 修复 错误的 watch 字段 -- 修复 safeArea 属性不生效的问题 -- 修复 点击内容,再点击遮罩无法关闭的Bug -## 1.4.2(2021-05-12) -- 新增 组件示例地址 -## 1.4.1(2021-04-29) -- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 -## 1.4.0 (2021-04-29) -- 新增 type 属性的 left\right 值,支持左右弹出 -- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 -- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 -- 新增 safeArea 属性,是否适配底部安全区 -- 修复 App\h5\微信小程序底部安全区占位不对的Bug -- 修复 App 端弹出等待的Bug -- 优化 提升低配设备性能,优化动画卡顿问题 -- 优化 更简单的组件自定义方式 -## 1.2.9(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.2.8(2021-02-05) -- 调整为uni_modules目录规范 -## 1.2.7(2021-02-05) -- 调整为uni_modules目录规范 -- 新增 支持 PC 端 -- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 +## 1.7.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) +## 1.6.2(2021-08-24) +- 新增 支持国际化 +## 1.6.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.6.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.5.0(2021-06-23) +- 新增 mask-click 遮罩层点击事件 +## 1.4.5(2021-06-22) +- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.4(2021-06-18) +- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.3(2021-06-08) +- 修复 错误的 watch 字段 +- 修复 safeArea 属性不生效的问题 +- 修复 点击内容,再点击遮罩无法关闭的Bug +## 1.4.2(2021-05-12) +- 新增 组件示例地址 +## 1.4.1(2021-04-29) +- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 +## 1.4.0 (2021-04-29) +- 新增 type 属性的 left\right 值,支持左右弹出 +- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 +- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 +- 新增 safeArea 属性,是否适配底部安全区 +- 修复 App\h5\微信小程序底部安全区占位不对的Bug +- 修复 App 端弹出等待的Bug +- 优化 提升低配设备性能,优化动画卡顿问题 +- 优化 更简单的组件自定义方式 +## 1.2.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.2.8(2021-02-05) +- 调整为uni_modules目录规范 +## 1.2.7(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持 PC 端 +- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue index aeeb3efdcd69883c5ee73efc57660855897eb49a..c20df4a8e923d48804e7935af39baeb67e637a5f 100644 --- a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -15,7 +15,7 @@ - {{cancelText}} + {{closeText}} {{okText}} @@ -31,7 +31,7 @@ initVueI18n } from '@dcloudio/uni-i18n' import messages from '../uni-popup/i18n/index.js' - const { t } = initVueI18n(messages) + const { t } = initVueI18n(messages) /** * PopUp 弹出层-对话框样式 * @description 弹出层-对话框样式 @@ -84,6 +84,14 @@ beforeClose: { type: Boolean, default: false + }, + cancelText:{ + type: String, + default: '' + }, + confirmText:{ + type: String, + default: '' } }, data() { @@ -95,10 +103,10 @@ }, computed: { okText() { - return t("uni-popup.ok") + return this.confirmText || t("uni-popup.ok") }, - cancelText() { - return t("uni-popup.cancel") + closeText() { + return this.cancelText || t("uni-popup.cancel") }, placeholderText() { return this.placeholder || t("uni-popup.placeholder") @@ -162,7 +170,7 @@ } - diff --git a/uni_modules/uni-popup/package.json b/uni_modules/uni-popup/package.json index a214e474a8ce66bf702edd52a5db8bacab99ad20..069e9ce514c0772845417e9287ddb5cd44fb1e44 100644 --- a/uni_modules/uni-popup/package.json +++ b/uni_modules/uni-popup/package.json @@ -1,90 +1,90 @@ -{ - "id": "uni-popup", - "displayName": "uni-popup 弹出层", - "version": "1.7.2", - "description": " Popup 组件,提供常用的弹层", - "keywords": [ - "uni-ui", - "弹出层", - "弹窗", - "popup", - "弹框" - ], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-transition" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} +{ + "id": "uni-popup", + "displayName": "uni-popup 弹出层", + "version": "1.7.9", + "description": " Popup 组件,提供常用的弹层", + "keywords": [ + "uni-ui", + "弹出层", + "弹窗", + "popup", + "弹框" + ], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-popup/readme.md b/uni_modules/uni-popup/readme.md index fb661e7d0cda7dc4df2db62ef29b61df4887f36c..fdad4b3d7031e1165d6904d32b9f00e1ad011a51 100644 --- a/uni_modules/uni-popup/readme.md +++ b/uni_modules/uni-popup/readme.md @@ -1,17 +1,17 @@ - - -## Popup 弹出层 -> **组件名:uni-popup** -> 代码块: `uPopup` -> 关联组件:`uni-transition` - - -弹出层组件,在应用中弹出一个消息提示窗口、提示框等 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - - - + + +## Popup 弹出层 +> **组件名:uni-popup** +> 代码块: `uPopup` +> 关联组件:`uni-transition` + + +弹出层组件,在应用中弹出一个消息提示窗口、提示框等 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + + + + diff --git a/uni_modules/uni-rate/changelog.md b/uni_modules/uni-rate/changelog.md index 9fe0e841fb2ccf3533a5621bb5f54144ee3ad96c..8a98a61274d4ce67bd653b16e16cb3a9bf2aa2f8 100644 --- a/uni_modules/uni-rate/changelog.md +++ b/uni_modules/uni-rate/changelog.md @@ -1,18 +1,25 @@ +## 1.3.1(2022-02-25) +- 修复 条件判断 `NaN` 错误的 bug +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-rate](https://uniapp.dcloud.io/component/uniui/uni-rate) +## 1.2.2(2021-09-10) +- 优化 默认值修改为 0 颗星 ## 1.2.1(2021-07-30) - 优化 vue3下事件警告的问题 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.2(2021-05-12) -- 新增 组件示例地址 -## 1.1.1(2021-04-21) -- 修复 布局变化后 uni-rate 星星计算不准确的 bug -- 优化 添加依赖 uni-icons, 导入 uni-rate 自动下载依赖 -## 1.1.0(2021-04-16) -- 修复 uni-rate 属性 margin 值为 string 组件失效的 bug - -## 1.0.9(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.8(2021-02-05) -- 调整为uni_modules目录规范 -- 支持 pc 端 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.2(2021-05-12) +- 新增 组件示例地址 +## 1.1.1(2021-04-21) +- 修复 布局变化后 uni-rate 星星计算不准确的 bug +- 优化 添加依赖 uni-icons, 导入 uni-rate 自动下载依赖 +## 1.1.0(2021-04-16) +- 修复 uni-rate 属性 margin 值为 string 组件失效的 bug + +## 1.0.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.8(2021-02-05) +- 调整为uni_modules目录规范 +- 支持 pc 端 diff --git a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue index 082f6767c793e141754f4b7a2876322a3392bb21..e53540620403da4e6672d3f5cd4b788c4fb9932b 100644 --- a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue +++ b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue @@ -1,49 +1,20 @@ - diff --git a/uni_modules/uni-swiper-dot/package.json b/uni_modules/uni-swiper-dot/package.json index 31393d778ce2e3ca2c4db5f4d08f257964d07dc4..b9b126a57d1b16a92399be8770c13787fdb3af06 100644 --- a/uni_modules/uni-swiper-dot/package.json +++ b/uni_modules/uni-swiper-dot/package.json @@ -1,7 +1,7 @@ { "id": "uni-swiper-dot", "displayName": "uni-swiper-dot 轮播图指示点", - "version": "1.1.0", + "version": "1.2.0", "description": "自定义轮播图指示点组件", "keywords": [ "uni-ui", @@ -41,7 +41,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -76,6 +76,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-swiper-dot/readme.md b/uni_modules/uni-swiper-dot/readme.md index 5ccfab8f9a24b98e22b439e4027230216e90ea6d..7d397e2cc6b0c6cfecd1250ea8c08611885f6846 100644 --- a/uni_modules/uni-swiper-dot/readme.md +++ b/uni_modules/uni-swiper-dot/readme.md @@ -7,85 +7,5 @@ 自定义轮播图指示点 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 本组件依赖 `swiper` 组件,请与`swiper`组件配合使用 -> - `width` 与 `height` 如非必要,请勿设置过大,或者过小 -> - `swiper-item` 尽量控制在一定数量之内,否则指示点可能会超出屏幕 -> - 暂不支持垂直方向的指示点 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中的使用 - -```html - - - - - {{item.content}} - - - - -``` - -```javascript -export default { - data() { - return { - info: [{ - content: '内容 A' - }, { - content: '内容 B' - }, { - content: '内容 C' - }], - current: 0, - mode: 'round', - } - }, - methods: { - change(e) { - this.current = e.detail.current; - } - } -} -``` - -## API - -### SwiperDod Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|current |Number |0 |当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`| -|mode |String |default|指示点的类型,可选值:default 、round 、nav 、 indexes | -|field |String |- | mode 为 nav 时,显示的内容字段(mode = nav 时必填) | -|info |Array |- |轮播图的数据,通过数组长度决定指示点个数 | -|dotsStyles |Object |- |指示点样式 | - -#### dotsStyles Options - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|width |Number | 8 |指示点宽度 **在 mode = nav、mode = indexes 时不生效** | -|bottom |Number | 10 |指示点距 `swiper` 底部的高度 | -|color |Color | '#fff' |指示点前景色,**只在 mode = nav ,mode = indexes 时生效** | -|backgroundColor |Color | 'rgba(0, 0, 0, .3)' |未选择指示点背景色 | -|border |Border | '1px rgba(0, 0, 0, .3) solid' |未选择指示点边框样式 | -|selectedBackgroundColor|Color | '#333' |已选择指示点背景色,**在 mode = nav 时不生效** | -|selectedBorder |Border | '1px rgba(0, 0, 0, .9) solid' |已选择指示点边框样式,**在 mode = nav 时不生效** | - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/swiper-dot/swiper-dot](https://hellouniapp.dcloud.net.cn/pages/extUI/swiper-dot/swiper-dot) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-swiper-dot) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-table/changelog.md b/uni_modules/uni-table/changelog.md index d8743f25565da79362ba0fc9342c80e176f760f6..8233b20f171fdc8f069b3be8b99a7ad55d45388a 100644 --- a/uni_modules/uni-table/changelog.md +++ b/uni_modules/uni-table/changelog.md @@ -1,18 +1,23 @@ +## 1.2.1(2022-06-06) +- 修复 微信小程序存在无使用组件的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-table](https://uniapp.dcloud.io/component/uniui/uni-table) ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-07-08) -- 新增 uni-th 支持 date 日期筛选范围 -## 1.0.6(2021-07-05) -- 新增 uni-th 支持 range 筛选范围 -## 1.0.5(2021-06-28) -- 新增 uni-th 筛选功能 -## 1.0.4(2021-05-12) -- 新增 示例地址 -- 修复 示例项目缺少组件的Bug -## 1.0.3(2021-04-16) -- 新增 sortable 属性,是否开启单列排序 -- 优化 表格多选逻辑 -## 1.0.2(2021-03-22) -- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制 -## 1.0.1(2021-02-05) -- 调整为uni_modules目录规范 +## 1.0.7(2021-07-08) +- 新增 uni-th 支持 date 日期筛选范围 +## 1.0.6(2021-07-05) +- 新增 uni-th 支持 range 筛选范围 +## 1.0.5(2021-06-28) +- 新增 uni-th 筛选功能 +## 1.0.4(2021-05-12) +- 新增 示例地址 +- 修复 示例项目缺少组件的Bug +## 1.0.3(2021-04-16) +- 新增 sortable 属性,是否开启单列排序 +- 优化 表格多选逻辑 +## 1.0.2(2021-03-22) +- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制 +## 1.0.1(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-table/components/uni-th/filter-dropdown.vue b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue index 0045f965e444412dc7b80809efa332c05da6b157..bc9a0e3b0b9ed23e7299115b678b2a69c23c0ec8 100644 --- a/uni_modules/uni-table/components/uni-th/filter-dropdown.vue +++ b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue @@ -1,503 +1,503 @@ - - - - - + + + + + diff --git a/uni_modules/uni-table/components/uni-th/uni-th.vue b/uni_modules/uni-table/components/uni-th/uni-th.vue index d87f1e821ae34e945ec7e2064959cfae3f60613a..121e13cb3abed2652b6c28cb7e402e3fbca06c3d 100644 --- a/uni_modules/uni-table/components/uni-th/uni-th.vue +++ b/uni_modules/uni-table/components/uni-th/uni-th.vue @@ -1,6 +1,6 @@ - -``` - - - - -## API - -### Table Props - -|属性名 | 类型 |默认值 | 可选值 | 说明| -|:-: | :-: |:-: | :-: | :-: | -|border | Boolean | false | - | 是否带有纵向边框 | -|stripe | Boolean | false | - | 是否显示斑马线样式 | -|type | String | '' | - | 值为type="selection" 时开启多选| -|emptyText | String | 没有更多数据 | - | 空数据时显示的文本内容 | -|loading | Boolean | false | - | 显示加载中| - -### Table Events - -事件称名 |说明 | 返回参数 -:-: |:-: | :-: -selection-change | 开启多选时,当选择项发生变化时会触发该事件 | Function(Object) - -### Table Methods -**Tips: 因微信小程序框架问题,暂不支持如下方法** - -|方法称名 |说明 |参数| -|:-: |:-: |:-:| -|selectionAll |选中全部行 |- | -|toggleRowSelection |用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) | Function(Array:[行索引],Boolean:selected) | -|clearSelection |用于多选表格,清空用户的选择 |- | -|toggleAllSelection |用于多选表格,切换所有行的选中状态 |- | - - - -### Th Props - -|属性名 |类型 |默认值 |可选值 |说明| -|:-: |:-: |:-: | :-: |:-:| -|width |String | - |- | 单元格宽度| -|align |String | left |left/center/right | 表头对齐方式| -|filter-type |String | |search/select/range/date | 筛选类型,search关键字搜索,select类别选择| -|filter-data |Array | || 筛选数据| -|sortable |Boolean| false |- | 是否启用排序| - -filter-data 示例 -```json -[{ - text: "", //显示 - value: "" // 值 -}] -``` - - -### Th Events - -|事件称名 |说明 | 返回参数 | -|:-: |:-: | :-: | -||sort-change | 点击排序时会触发该事件 | Function(Object)| -||filter-change | 筛选数据时会触发该事件 | Function(Object)| - -filter-change(e) 说明 -```json -e = { - filterType: "", //筛选类型 search/select/range 和传入的相同 - filter: "" // 值, filterType=search字符串类型,filterType=select数组类型,filterType=range数组类型,[0]开始值, [1]结束值 -} -``` - - -### Td Props - -|属性名 |类型 |默认值 |可选值 |说明| -|:-: |:-: |:-: |:-: |:-:| -|align |Boolean| left |left/center/right | 单元格对齐方式| - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/table/table](https://hellouniapp.dcloud.net.cn/pages/extUI/table/table) \ No newline at end of file diff --git a/uni_modules/uni-tag/changelog.md b/uni_modules/uni-tag/changelog.md index 591ec197ae4b494b1c7ef9fa723f315dbb0e34b7..c0c5839b1e76d820591b44d22e60740b15bdf51b 100644 --- a/uni_modules/uni-tag/changelog.md +++ b/uni_modules/uni-tag/changelog.md @@ -1,3 +1,10 @@ +## 2.1.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-tag](https://uniapp.dcloud.io/component/uniui/uni-tag) +## 2.0.0(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +- 移除 插槽 +- 移除 type 属性的 royal 选项 ## 1.1.1(2021-08-11) - type 不是 default 时,size 为 small 字体大小显示不正确 ## 1.1.0(2021-07-30) diff --git a/uni_modules/uni-tag/components/uni-tag/uni-tag.vue b/uni_modules/uni-tag/components/uni-tag/uni-tag.vue index 917492417183f5d353e870a33cbb3ac45c82d6f4..6c744551e489929eaf497e84cc706d4ba94ff51e 100644 --- a/uni_modules/uni-tag/components/uni-tag/uni-tag.vue +++ b/uni_modules/uni-tag/components/uni-tag/uni-tag.vue @@ -1,5 +1,5 @@ diff --git a/uni_modules/uni-tag/package.json b/uni_modules/uni-tag/package.json index cf3475164fe76cdd5df059f41e10faeb91504aec..187808863418f22552c1048346b6ec93577cecb2 100644 --- a/uni_modules/uni-tag/package.json +++ b/uni_modules/uni-tag/package.json @@ -1,7 +1,7 @@ { "id": "uni-tag", "displayName": "uni-tag 标签", - "version": "1.1.1", + "version": "2.1.0", "description": "Tag 组件,用于展示1个或多个文字标签,可点击切换选中、不选中的状态。", "keywords": [ "uni-ui", @@ -41,7 +41,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -79,7 +79,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-tag/readme.md b/uni_modules/uni-tag/readme.md index b8c1938e5f4fed63557ddc4f9bbac80ccfb742f2..6e78ff5e42ad09f4fc05e3898b16531f2372c781 100644 --- a/uni_modules/uni-tag/readme.md +++ b/uni_modules/uni-tag/readme.md @@ -7,43 +7,7 @@ 用于展示1个或多个文字标签,可点击切换选中、不选中的状态 。 -### 安装方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tag) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 -```html - - - -``` - -## API - -### Tag Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |标签内容 | -|size |String |normal |大小尺寸,可选值:normal、small | -|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)、royal(紫色) | -|disabled |Boolean|false |是否为禁用状态 | -|inverted |Boolean|false |是否无需背景颜色(空心标签) | -|circle |Boolean|false |是否为圆角 | - - -### Tag Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@click |点击 Tag 触发事件 |- | - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/tag/tag](https://hellouniapp.dcloud.net.cn/pages/extUI/tag/tag) \ No newline at end of file diff --git a/uni_modules/uni-title/changelog.md b/uni_modules/uni-title/changelog.md index 588ea1a74dec884d1dd6a000ba5038ab5292d80b..76262165345ff7aeb8bd34b1f5ff83aa5b88259f 100644 --- a/uni_modules/uni-title/changelog.md +++ b/uni_modules/uni-title/changelog.md @@ -1,5 +1,10 @@ +## 1.1.1(2022-05-19) +- 修改组件描述 +## 1.1.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-title](https://uniapp.dcloud.io/component/uniui/uni-title) ## 1.0.2(2021-05-12) - 新增 示例地址 - 修复 示例项目缺少组件的Bug -## 1.0.1(2021-02-05) -- 调整为uni_modules目录规范 +## 1.0.1(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-title/components/uni-title/uni-title.vue b/uni_modules/uni-title/components/uni-title/uni-title.vue index f428f037b05e72fe8eb7cabbefdc418126431653..0d5b8480dc7243d190514304b46a78914708eb57 100644 --- a/uni_modules/uni-title/components/uni-title/uni-title.vue +++ b/uni_modules/uni-title/components/uni-title/uni-title.vue @@ -6,8 +6,8 @@ - -> ``` - - -## API -### Title Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|type |String |- |标题类型,可选值 h1、h2、h3、h4、h5 ,章节标题字体会比正常字长字体粗,不指定 type 值,默认为上报统计数据 | -|title |String |- |章节标题内容 | -|align |String |- |对齐方式,可选值 left:左对齐;center:居中;right:右对齐; | -|color |String |- |字体颜色 | -|stat |Boolean|- |是否开启统计功能呢,如不填写type值,默认为开启,填写 type 属性,默认为关闭 | - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/title/title](https://hellouniapp.dcloud.net.cn/pages/extUI/title/title) \ No newline at end of file diff --git a/uni_modules/uni-ui/changelog.md b/uni_modules/uni-ui/changelog.md index 4e47272267a95e4a4b60aa67b6eceae839665c2c..4eabdd71a1a3dc04d781aed7057164a62e086359 100644 --- a/uni_modules/uni-ui/changelog.md +++ b/uni_modules/uni-ui/changelog.md @@ -1,4 +1,158 @@ -## 1.4.1(2021-08-20) +## 1.4.16(2022-06-06) +- uni-breadcrumb 新增 支持 uni.scss 修改颜色 +- uni-data-select 修复 localdata 赋值不生效的 bug +- uni-data-select 新增 支持选项禁用(数据选项设置 disabled: true 即禁用) +- uni-data-select 修复 当 value 为 0 时选择不生效的 bug +- uni-easyinput 修复 关闭图标某些情况下无法取消的bug +- uni-fav 新增 stat 属性 ,是否开启uni统计功能 +- uni-goods-nav 新增 stat属性,是否开启uni统计功能 +- uni-group 新增 stat属性,是否开启uni统计功能 +- uni-nav-bar 新增 stat 属性 ,可开启统计 title 上报 ,仅使用了title 属性且项目开启了uni统计生效 +- uni-search-bar 新增 readonly 属性,组件只读 +- uni-swipe-action 修复 isPC 找不到的Bug +- uni-swipe-action 修复 在 nvue 下 disabled 失效的bug +- uni-tooltip 修复 content 为空时仍然弹出的bug +## 1.4.15(2022-05-07) +- uni-data-picker 修复 字节小程序 本地数据无法选择下一级的Bug +- uni-data-select 新增 记住上次的选项(仅 collection 存在时有效) +- uni-search-bar 修复 vue3 input 事件不生效的bug +- uni-search-bar 修复 多余代码导致的bug +- uni-tooltip 更新 text 属性变更为 content +- uni-tooltip 更新 移除 width 属性 +- uni-tooltip 修复 组件根 text 嵌套组件 warning +## 1.4.14(2022-04-18) +- uni-datetime-picker 修复 Vue3 下动态赋值,单选类型未响应的 bug +- uni-easyinput 修复 默认值不生效的bug +## 1.4.13(2022-04-02) +- uni-calendar 修复 条件编译 nvue 不支持的 css 样式 +- uni-calendar 修复 startDate、 endDate 属性失效的 bug +- uni-data-picker 修复 nvue 不支持的 v-show 的 bug +- uni-data-picker 修复 条件编译 nvue 不支持的 css 样式 +- uni-datetime-picker 修复 Vue3 下动态赋值未响应的 bug +- uni-easyinput 修复 value不能为0的bug +- uni-popup 修复 弹出层内部无法滚动的bug +- uni-popup 修复 小程序中高度错误的bug +- uni-popup 修复 快速调用open出现问题的Bug +- uni-rate 修复 条件判断 `NaN` 错误的 bug +- uni-swipe-action 修复 按钮字体大小不能设置的bug +- uni-swipe-action 修复 h5和app端下报el错误的bug +- uni-swipe-action 修复 HBuilderX 1.4.X 版本中,h5和app端下报错的bug +## 1.4.12(2022-02-19) +- uni-collapse 修复 初始化的时候 ,open 属性失效的bug +- uni-data-checkbox 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug +- uni-icons 优化 size 属性可以传入不带单位的字符串数值 +- uni-icons 优化 size 支持其他单位 +- uni-nav-bar 新增 left-width/right-width属性 ,可修改左右两侧的宽度 +- uni-popup 修复 safeArea 属性不能设置为false的bug +## 1.4.11(2022-01-21) +- uni-collapse 修复 微信小程序resize后组件收起的bug +- uni-countdown 修复 在微信小程序中样式不生效的bug +- uni-countdown 新增 update 方法 ,在动态更新时间后,刷新组件 +- uni-load-more 新增 showText属性 ,是否显示文本 +- uni-load-more 修复 nvue 平台下不显示文本的bug +- uni-load-more 修复 微信小程序平台样式选择器报警告的问题 +- uni-nav-bar 修复 在vue下,标题不垂直居中的bug +- uni-nav-bar 修复 height 属性类型错误 +- uni-nav-bar 新增 height 属性,可修改组件高度 +- uni-nav-bar 新增 dark 属性可可开启暗黑模式 +- uni-nav-bar 优化 标题字数过多显示省略号 +- uni-nav-bar 优化 插槽,插入内容可完全覆盖 +- uni-popup 修复 isMaskClick 失效的bug +- uni-popup 新增 cancelText \ confirmText 属性 ,可自定义文本 +- uni-popup 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 +- uni-popup 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 + +## 1.4.10(2022-01-17) +- uni-card 修复 在vue页面下略缩图显示不正常的bug +- uni-datetime-picker 修复 clear-icon 属性在小程序平台不生效的 bug +- uni-datetime-picker 修复 日期范围选在小程序平台,必须多点击一次才能取消选中状态的 bug +- uni-fab 更新 组件依赖 +- +- uni-icons 修复 nvue 有些图标不显示的bug,兼容老版本图标 +- uni-icons 优化 示例可复制图标名称 +- uni-nav-bar 修复 color 属性不生效的bug +- uni-popup 修复 设置 safeArea 属性不生效的bug +- uni-popup 优化 组件示例 +- uni-popup 修复 vuedoc 文字错误 +## 1.4.9(2021-11-23) +- uni-ui 修复 vue3中某些scss变量无法找到的问题 +- uni-combox 优化 label、label-width 属性 +- uni-data-picker 修复 由上个版本引发的map、v-model等属性不生效的bug +- uni-file-picker 修复 参数为对象的情况下,url在某些情况显示错误的bug +- uni-icons 优化 兼容旧组件 type 值 +- uni-list 修复 在vue3中to属性在发行应用的时候报错的bug +- uni-scss 修复 vue3中scss语法兼容问题 +- uni-transition 修复 init 方法初始化问题 +## 1.4.8(2021-11-19) +- uni-fab 修复 阴影颜色不正确的bug +## 1.4.7(2021-11-19) +- uni-ui 新增 支持国际化 +- uni-ui 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- uni-ui 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-ui](https://uniapp.dcloud.io/component/uniui/uni-ui) +- uni-badge 修改 size 属性默认值调整为 small +- uni-badge 修改 type 属性,默认值调整为 error,info 替换 default +- uni-badge 修复 在字节小程序上样式不生效的 bug +- uni-calendar 修复 弹出层被 tabbar 遮盖 bug +- uni-card 重构插槽的用法 ,header 替换为 title +- uni-card 新增 actions 插槽 +- uni-card 新增 cover 封面图属性和插槽 +- uni-card 新增 padding 内容默认内边距离 +- uni-card 新增 margin 卡片默认外边距离 +- uni-card 新增 spacing 卡片默认内边距 +- uni-card 新增 shadow 卡片阴影属性 +- uni-card 取消 mode 属性,可使用组合插槽代替 +- uni-card 取消 note 属性 ,使用actions插槽代替 +- uni-collapse 优化 show-arrow 属性默认为true +- uni-collapse 新增 show-arrow 属性,控制是否显示右侧箭头 +- uni-countdown 新增 font-size 支持自定义字体大小 +- uni-data-checkbox 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题 +- uni-data-checkbox 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题 +- uni-data-checkbox 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 +- uni-dateformat 优化 默认时间不再是当前时间,而是显示'-'字符 +- uni-datetime-picker 修复 hide-second 在移动端的 bug +- uni-datetime-picker 修复 单选赋默认值时,赋值日期未高亮的 bug +- uni-datetime-picker 修复 赋默认值时,移动端未正确显示时间的 bug +- uni-datetime-picker 新增 hide-second 属性,支持只使用时分,隐藏秒 +- uni-datetime-picker 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次 +- uni-datetime-picker 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法 +- uni-datetime-picker 优化 调整字号大小,美化日历界面 +- uni-datetime-picker 优化 范围选择器在 pc 端过宽的问题 +- uni-datetime-picker 新增 支持作为 uni-forms 子组件相关功能 +- uni-datetime-picker 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的 bug +- uni-datetime-picker 修复 type 属性动态赋值无效的 bug +- uni-datetime-picker 修复 ‘确认’按钮被 tabbar 遮盖 bug +- uni-datetime-picker 修复 组件未赋值时范围选左、右日历相同的 bug +- uni-datetime-picker 修复 范围选未正确显示当前值的 bug +- uni-datetime-picker 修复 h5 平台(移动端)报错 'cale' of undefined 的 bug +- uni-easyinput 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug +- uni-easyinput 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 +- uni-file-picker 新增 参数中返回 fileID 字段 +- uni-file-picker 修复 腾讯云传入fileID 不能回显的bug +- uni-file-picker 修复 选择图片后,不能放大的问题 +- uni-file-picker 修复 由于 0.2.11 版本引起的不能回显图片的Bug +- uni-file-picker 新增 clearFiles(index) 方法,可以手动删除指定文件 +- uni-file-picker 修复 v-model 值设为 null 报错的Bug +- uni-file-picker 修复 return-type="object" 时,无法删除文件的Bug +- uni-file-picker 修复 auto-upload 属性失效的Bug +- uni-forms 修复 label 插槽不生效的bug +- uni-forms 修复 没有添加校验规则的字段依然报错的Bug +- uni-forms 修复 重置表单错误信息无法清除的问题 +- uni-forms 修复 表单验证只生效一次的问题 +- uni-icons 新增 更多图标 +- uni-icons 优化 自定义图标使用方式 +- uni-link 修复 在 nvue 下不显示的 bug +- uni-pagination 修复 current 、value 属性未监听,导致高亮样式失效的 bug +- uni-rate 优化 默认值修改为 0 颗星 +- uni-search-bar 修复 value 属性与 modelValue 属性不兼容的Bug +- uni-swipe-action 新增 close-all 方法,关闭所有已打开的组件 +- uni-swipe-action 新增 resize() 方法,在非微信小程序、h5、app-vue端出现不能滑动的问题的时候,重置组件 +- uni-swipe-action 修复 app 端偶尔出现类似 Page[x][-x,xx;-x,xx,x,x-x] 的问题 +- uni-swipe-action 优化 微信小程序、h5、app-vue 滑动逻辑,避免出现动态新增组件后不能滑动的问题 +- uni-tag 新增 提供组件设计资源,组件样式调整 +- uni-tag 移除 插槽 +- uni-tag 移除 type 属性的 royal 选项 +- uni-tag type 不是 default 时,size 为 small 字体大小显示不正确 +## 1.4.2(2021-08-20) - 新增 uni-ui 组件支持国际化 i18n - uni-collapse 优化 show-arrow 属性默认为true - uni-collapse 新增 show-arrow 属性,控制是否显示右侧箭头 diff --git a/uni_modules/uni-ui/package.json b/uni_modules/uni-ui/package.json index 3fc8714b439ab48ef201fdfa405ac9d7a2fd3235..de80aad61ca23bd2c10969b2b44fc8a93ca96f85 100644 --- a/uni_modules/uni-ui/package.json +++ b/uni_modules/uni-ui/package.json @@ -1,8 +1,8 @@ { "id": "uni-ui", "displayName": "uni-ui", - "version": "1.4.1", - "description": "uni-ui 是一个基于uni-app全端兼容的高性能UI框架", + "version": "1.4.16", + "description": "uni-ui 是基于uni-app的、全端兼容的、高性能UI框架", "keywords": [ "uni-ui", "uniui", @@ -12,7 +12,7 @@ ], "repository": "https://github.com/dcloudio/uni-ui", "engines": { - "HBuilderX": "" + "HBuilderX": "^3.2.10" }, "directories": { "example": "../../temps/example_temps" @@ -120,7 +120,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-ui/readme.md b/uni_modules/uni-ui/readme.md index 35315e568c29e1e1555fe6d81de8fe0f97ad9dc6..23f8456872f45ab29ae0ebf87d1c9baada1ac181 100644 --- a/uni_modules/uni-ui/readme.md +++ b/uni_modules/uni-ui/readme.md @@ -1,3 +1,11 @@ +> 当前插件不包含示例页面 ,如需示例请在 HBuiderX 中新建 `hello uni-app > 扩展组件` 中查看 +> +> 代码示例地址 :[https://ext.dcloud.net.cn/plugin?id=4941](https://ext.dcloud.net.cn/plugin?id=4941) +> +> 组件演示地址:[https://hellouniapp.dcloud.net.cn](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) +> +> 组件文档地址:[https://uniapp.dcloud.io/component/uniui/uni-ui](https://uniapp.dcloud.io/component/uniui/uni-ui) + # uni-ui 介绍 ## uni-ui产品特点 @@ -50,9 +58,67 @@ ui是一种需求非常发散的产品,DCloud官方也无意用 `uni-ui` 压 我们欢迎更多优秀的ui组件出现,也欢迎更多人贡献 `uni-ui` 的主题风格,满足更多用户的需求。 -# 快速开始 +## 快速开始 + +uni-ui支持 HBuilderX直接新建项目模板、npm安装和单独导入个别组件等多种使用方式 + +### 在HBuilderX 新建uni-app项目的模板中,选择uni-ui模板 +![HBuilderX内创建uni-ui项目](https://img.cdn.aliyun.dcloud.net.cn/uni-app/doc/create-uni-ui-project.jpg) + +由于uni-app独特的[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)技术,可以免引用、注册,直接使用各种符合规则的vue组件。 + +在代码区键入`u`,拉出各种内置或uni-ui的组件列表,选择其中一个,即可使用该组件。 + +光标放在组件名称上,按F1,可以查阅组件的文档。 + +![uni-ui代码块](https://img.cdn.aliyun.dcloud.net.cn/uni-app/doc/uni-ui-snippet.jpg) + +### 通过 uni_modules 单独安装组件 +如果你没有创建uni-ui项目模板,也可以在你的工程里,通过 uni_modules 单独安装需要的某个组件。下表为uni-ui的扩展组件清单,点击每个组件在详情页面可以导入组件到项目下,导入后直接使用即可,无需import和注册。 + +|组件名|组件说明| +|---|---| +|uni-badge|[数字角标](https://ext.dcloud.net.cn/plugin?name=uni-badge)| +|uni-calendar|[日历](https://ext.dcloud.net.cn/plugin?name=uni-calendar)| +|uni-card|[卡片](https://ext.dcloud.net.cn/plugin?name=uni-card)| +|uni-collapse|[折叠面板](https://ext.dcloud.net.cn/plugin?name=uni-collapse)| +|uni-combox|[组合框](https://ext.dcloud.net.cn/plugin?name=uni-combox)| +|uni-countdown|[倒计时](https://ext.dcloud.net.cn/plugin?name=uni-countdown)| +|uni-data-checkbox|[数据选择器](https://ext.dcloud.net.cn/plugin?name=uni-data-checkbox)| +|uni-data-picker|[数据驱动的picker选择器](https://ext.dcloud.net.cn/plugin?name=uni-data-picker)| +|uni-dateformat|[日期格式化](https://ext.dcloud.net.cn/plugin?name=uni-dateformat)| +|uni-datetime-picker|[日期选择器](https://ext.dcloud.net.cn/plugin?name=uni-datetime-picker)| +|uni-drawer|[抽屉](https://ext.dcloud.net.cn/plugin?name=uni-drawer)| +|uni-easyinput|[增强输入框](https://ext.dcloud.net.cn/plugin?name=uni-easyinput)| +|uni-fab|[悬浮按钮](https://ext.dcloud.net.cn/plugin?name=uni-fab)| +|uni-fav|[收藏按钮](https://ext.dcloud.net.cn/plugin?name=uni-fav)| +|uni-file-picker|[文件选择上传](https://ext.dcloud.net.cn/plugin?name=uni-file-picker)| +|uni-forms|[表单](https://ext.dcloud.net.cn/plugin?name=uni-forms)| +|uni-goods-nav|[商品导航](https://ext.dcloud.net.cn/plugin?name=uni-goods-nav)| +|uni-grid|[宫格](https://ext.dcloud.net.cn/plugin?name=uni-grid)| +|uni-group|[分组](https://ext.dcloud.net.cn/plugin?name=uni-group)| +|uni-icons|[图标](https://ext.dcloud.net.cn/plugin?name=uni-icons)| +|uni-indexed-list|[索引列表](https://ext.dcloud.net.cn/plugin?name=uni-indexed-list)| +|uni-link|[超链接](https://ext.dcloud.net.cn/plugin?name=uni-link)| +|uni-list|[列表](https://ext.dcloud.net.cn/plugin?name=uni-list)| +|uni-load-more|[加载更多](https://ext.dcloud.net.cn/plugin?name=uni-load-more)| +|uni-nav-bar|[自定义导航栏](https://ext.dcloud.net.cn/plugin?name=uni-nav-bar)| +|uni-notice-bar|[通告栏](https://ext.dcloud.net.cn/plugin?name=uni-notice-bar)| +|uni-number-box|[数字输入框](https://ext.dcloud.net.cn/plugin?name=uni-number-box)| +|uni-pagination|[分页器](https://ext.dcloud.net.cn/plugin?name=uni-pagination)| +|uni-popup|[弹出层](https://ext.dcloud.net.cn/plugin?name=uni-popup)| +|uni-rate|[评分](https://ext.dcloud.net.cn/plugin?name=uni-rate)| +|uni-row|[布局-行](https://ext.dcloud.net.cn/plugin?name=uni-row)| +|uni-search-bar|[搜索栏](https://ext.dcloud.net.cn/plugin?name=uni-search-bar)| +|uni-segmented-control|[分段器](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control)| +|uni-steps|[步骤条](https://ext.dcloud.net.cn/plugin?name=uni-steps)| +|uni-swipe-action|[滑动操作](https://ext.dcloud.net.cn/plugin?name=uni-swipe-action)| +|uni-swiper-dot|[轮播图指示点](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot)| +|uni-table|[表格](https://ext.dcloud.net.cn/plugin?name=uni-table)| +|uni-tag|[标签](https://ext.dcloud.net.cn/plugin?name=uni-tag)| +|uni-title|[章节标题](https://ext.dcloud.net.cn/plugin?name=uni-title)| +|uni-transition|[过渡动画](https://ext.dcloud.net.cn/plugin?name=uni-transition)| -## 方式一:使用 uni_modules 安装(推荐) 使用 `uni_modules` 方式安装组件库,可以直接通过插件市场导入,通过右键菜单快速更新组件,不需要引用、注册,直接在页面中使用 `uni-ui` 组件。[点击安装 uni-ui 组件库](https://ext.dcloud.net.cn/plugin?id=55) @@ -62,8 +128,10 @@ ui是一种需求非常发散的产品,DCloud官方也无意用 `uni-ui` 压 例如需更新 `uni-list`和`uni-badge` ,将 `uni_modules>uni-list>components`和`uni_modules>uni-badege>components`下所有目录拷贝到如下目录即可: + **目录示例** -```json {2,3,4,5,6,7} + +```json ┌─components 组件目录 │ ├─uni-list list 列表目录 │ │ └─uni-list.vue list 组件文件 @@ -82,10 +150,15 @@ ui是一种需求非常发散的产品,DCloud官方也无意用 `uni-ui` 压 ``` +### 通过 `uni_modules` 导入全部组件 +如果想一次把所有uni-ui组件导入到项目中,只需要导入一个 `uni-ui` 组件即可 [点击去导入](https://ext.dcloud.net.cn/plugin?id=55)。 + +如果没有自动导入其他组件,可以在 uni-ui 组件目录上右键选择 `安装三方插件依赖` 即可。 -## 方式二:使用 npm 安装 -在 `vue-cli` 项目中可以使用 `npm` 安装 `uni-ui` 库 ,或者直接在 `HBuilderX` 项目中使用 `npm` 。(不推荐后一种方式) + +### npm安装 +在 `vue-cli` 项目中可以使用 `npm` 安装 `uni-ui` 库 ,或者直接在 `HBuilderX` 项目中使用 `npm` 。 > **注意** > cli 项目默认是不编译 `node_modules` 下的组件的,导致条件编译等功能失效 ,导致组件异常 @@ -113,8 +186,8 @@ ui是一种需求非常发散的产品,DCloud官方也无意用 `uni-ui` 压 npm i sass-loader@10.1.1 -D 或 yarn add sass-loader@10.1.1 -D ``` -> sass-loader 请使用低于 @11.0.0 的版本,[sass-loader@11.0.0 不支持 vue@2.6.12 ](https://stackoverflow.com/questions/66082397/typeerror-this-getoptions-is-not-a-function) - +> 如果 `node` 版本小于 16 ,sass-loader 请使用低于 @11.0.0 的版本,[sass-loader@11.0.0 不支持 vue@2.6.12 ](https://stackoverflow.com/questions/66082397/typeerror-this-getoptions-is-not-a-function) +> 如果 `node` 版本大于 16 , `sass-loader` 建议使用 `v8.x` 版本 **安装 uni-ui** @@ -124,44 +197,14 @@ npm i @dcloudio/uni-ui 或 yarn add @dcloudio/uni-ui -在 ``script`` 中引用组件: - -```javascript -import {uniBadge} from '@dcloudio/uni-ui' -//import uniBadge from '@dcloudio/uni-ui/lib/uni-badge/uni-badge.vue' //也可使用此方式引入组件 -export default { - components: {uniBadge} -} -``` - - -在 ``template`` 中使用组件: - -```html - - - -``` -> **注意** -> - `CLI` 引用方式, `H5` 端不支持在 `main.js` 中全局注册组件,如有需求请使用([easyCom](https://uniapp.dcloud.io/collocation/pages?id=easycom)) 的方式引用组件 -> - 使用 npm 安装的组件,默认情况下 babel-loader 会忽略所有 node_modules 中的文件 ,导致条件编译失效,需要通过配置 `vue.config.js` 解决: -> ```javascript -> // 在根目录创建 vue.config.js 文件,并配置如下 -> module.exports = { -> transpileDependencies: ['@dcloudio/uni-ui'] -> } -> ``` - - -## 使用 npm + easycom +**配置easycom** 使用 `npm` 安装好 `uni-ui` 之后,需要配置 `easycom` 规则,让 `npm` 安装的组件支持 `easycom` 打开项目根目录下的 `pages.json` 并添加 `easycom` 节点: -```javascript {8} +```javascript // pages.json - { "easycom": { "autoscan": true, @@ -179,61 +222,25 @@ export default { ``` -### uni-ui 已支持的组件列表 -|组件名|组件说明| -|---|---| -|uni-badge|[数字角标](https://ext.dcloud.net.cn/plugin?name=uni-badge)| -|uni-calendar|[日历](https://ext.dcloud.net.cn/plugin?name=uni-calendar)| -|uni-card|[卡片](https://ext.dcloud.net.cn/plugin?name=uni-card)| -|uni-collapse|[折叠面板](https://ext.dcloud.net.cn/plugin?name=uni-collapse)| -|uni-combox|[组合框](https://ext.dcloud.net.cn/plugin?name=uni-combox)| -|uni-countdown|[倒计时](https://ext.dcloud.net.cn/plugin?name=uni-countdown)| -|uni-data-checkbox|[数据选择器](https://ext.dcloud.net.cn/plugin?name=uni-data-checkbox)| -|uni-data-picker|[数据驱动的picker选择器](https://ext.dcloud.net.cn/plugin?name=uni-data-picker)| -|uni-dateformat|[日期格式化](https://ext.dcloud.net.cn/plugin?name=uni-dateformat)| -|uni-datetime-picker|[日期选择器](https://ext.dcloud.net.cn/plugin?name=uni-datetime-picker)| -|uni-drawer|[抽屉](https://ext.dcloud.net.cn/plugin?name=uni-drawer)| -|uni-easyinput|[增强输入框](https://ext.dcloud.net.cn/plugin?name=uni-easyinput)| -|uni-fab|[悬浮按钮](https://ext.dcloud.net.cn/plugin?name=uni-fab)| -|uni-fav|[收藏按钮](https://ext.dcloud.net.cn/plugin?name=uni-fav)| -|uni-file-picker|[文件选择上传](https://ext.dcloud.net.cn/plugin?name=uni-file-picker)| -|uni-forms|[表单](https://ext.dcloud.net.cn/plugin?name=uni-forms)| -|uni-goods-nav|[商品导航](https://ext.dcloud.net.cn/plugin?name=uni-goods-nav)| -|uni-grid|[宫格](https://ext.dcloud.net.cn/plugin?name=uni-grid)| -|uni-group|[分组](https://ext.dcloud.net.cn/plugin?name=uni-group)| -|uni-icons|[图标](https://ext.dcloud.net.cn/plugin?name=uni-icons)| -|uni-indexed-list|[索引列表](https://ext.dcloud.net.cn/plugin?name=uni-indexed-list)| -|uni-link|[超链接](https://ext.dcloud.net.cn/plugin?name=uni-link)| -|uni-list|[列表](https://ext.dcloud.net.cn/plugin?name=uni-list)| -|uni-load-more|[加载更多](https://ext.dcloud.net.cn/plugin?name=uni-load-more)| -|uni-nav-bar|[自定义导航栏](https://ext.dcloud.net.cn/plugin?name=uni-nav-bar)| -|uni-notice-bar|[通告栏](https://ext.dcloud.net.cn/plugin?name=uni-notice-bar)| -|uni-number-box|[数字输入框](https://ext.dcloud.net.cn/plugin?name=uni-number-box)| -|uni-pagination|[分页器](https://ext.dcloud.net.cn/plugin?name=uni-pagination)| -|uni-popup|[弹出层](https://ext.dcloud.net.cn/plugin?name=uni-popup)| -|uni-rate|[评分](https://ext.dcloud.net.cn/plugin?name=uni-rate)| -|uni-row|[布局-行](https://ext.dcloud.net.cn/plugin?name=uni-row)| -|uni-search-bar|[搜索栏](https://ext.dcloud.net.cn/plugin?name=uni-search-bar)| -|Section|[标题栏](https://ext.dcloud.net.cn/plugin?name=uni-section)| -|uni-segmented-control|[分段器](https://ext.dcloud.net.cn/plugin?name=uni-segmented-control)| -|uni-steps|[步骤条](https://ext.dcloud.net.cn/plugin?name=uni-steps)| -|uni-swipe-action|[滑动操作](https://ext.dcloud.net.cn/plugin?name=uni-swipe-action)| -|uni-swiper-dot|[轮播图指示点](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot)| -|uni-table|[表格](https://ext.dcloud.net.cn/plugin?name=uni-table)| -|uni-tag|[标签](https://ext.dcloud.net.cn/plugin?name=uni-tag)| -|uni-title|[章节标题](https://ext.dcloud.net.cn/plugin?name=uni-title)| -|uni-transition|[过渡动画](https://ext.dcloud.net.cn/plugin?name=uni-transition)| - - -### 其他 - -- uni-ui 是全端兼容的基于flex布局的、无dom的ui库 -- uni-ui 是uni-app内置组件的扩展。注意与web开发不同,uni-ui不包括基础组件,它是基础组件的补充。web开发中有的开发者习惯用一个ui库完成所有开发,但在uni-app体系中,推荐开发者首先使用性能更高的基础组件,然后按需引入必要的扩展组件。 - +在 ``template`` 中使用组件: -> **注意** -> - `uni-ui` 不支持使用 `Vue.use()` 的方式安装 +```html + + + +``` + **注意** + - uni-ui 现在只推荐使用 `easycom` ,如自己引用组件,可能会出现组件找不到的问题 + - 使用 npm 安装的组件,默认情况下 babel-loader 会忽略所有 node_modules 中的文件 ,导致条件编译失效,需要通过配置 `vue.config.js` 解决: + ```javascript + // 在根目录创建 vue.config.js 文件,并配置如下 + module.exports = { + transpileDependencies: ['@dcloudio/uni-ui'] + } + ``` + - uni-ui 是uni-app内置组件的扩展。注意与web开发不同,uni-ui不包括基础组件,它是基础组件的补充。web开发中有的开发者习惯用一个ui库完成所有开发,但在uni-app体系中,推荐开发者首先使用性能更高的基础组件,然后按需引入必要的扩展组件。 + - `uni-ui` 不支持使用 `Vue.use()` 的方式安装 ### 贡献代码 diff --git a/uni_modules/uni-upgrade-center-app/changelog.md b/uni_modules/uni-upgrade-center-app/changelog.md index fff3c115c159dd941f9a58044ce8e130f5c44afc..ed4ecf35613d8557b69fec35d772442facc14d28 100644 --- a/uni_modules/uni-upgrade-center-app/changelog.md +++ b/uni_modules/uni-upgrade-center-app/changelog.md @@ -1,3 +1,20 @@ +## 0.4.2(2022-06-02) +- 修复 wgt 包更新时错误处理的 bug +## 0.4.1(2022-05-27) +- 修复 上版引出的报错问题 +## 0.4.0(2022-05-27) +- 新增 Android 支持跳转手机自带商店,填写升级包地址时请填写跳转商店链接 +- 新增 改为云对象调用方式,使用更直观 +## 0.3.3(2022-04-14) +- 修复 调用 check-update,当 code 为 0 时没有回调 +## 0.3.2(2022-01-12) +- 优化显示逻辑 +## 0.3.1(2021-11-24) +- 修复 vue3 上图片不显示的Bug +## 0.3.0(2021-11-18) +- 移除 wgt 安装成功后提示,防止重启过快弹框不消失 +## 0.2.2(2021-08-25) +- 兼容vue3.0 ## 0.2.1(2021-07-26) - 修复 使用腾讯云并手动填写地址时,导致下载链接失效的bug ## 0.2.0(2021-07-13) diff --git a/uni_modules/uni-upgrade-center-app/images/app_update_close.png b/uni_modules/uni-upgrade-center-app/images/app_update_close.png new file mode 100644 index 0000000000000000000000000000000000000000..8b2ffe62cba2466f184ea9f8ee4f9395ed8cf37a Binary files /dev/null and b/uni_modules/uni-upgrade-center-app/images/app_update_close.png differ diff --git a/uni_modules/uni-upgrade-center-app/images/bg_top.png b/uni_modules/uni-upgrade-center-app/images/bg_top.png new file mode 100644 index 0000000000000000000000000000000000000000..015f698cdd8c8caa63486a2bd87f5a96f17df630 Binary files /dev/null and b/uni_modules/uni-upgrade-center-app/images/bg_top.png differ diff --git a/uni_modules/uni-upgrade-center-app/package.json b/uni_modules/uni-upgrade-center-app/package.json index e6b8bff8064290dfbd5df9c7da61fb40694767e1..ae194bd556a5e7e0a5d6aa1178e1bd5f80ec0de3 100644 --- a/uni_modules/uni-upgrade-center-app/package.json +++ b/uni_modules/uni-upgrade-center-app/package.json @@ -1,11 +1,10 @@ { "id": "uni-upgrade-center-app", "displayName": "升级中心 uni-upgrade-center - App", - "version": "0.2.1", - "description": "升级中心前台检查更新", + "version": "0.4.2", + "description": "uni升级中心 - 客户端检查更新", "keywords": [ "uniCloud", - "admin", "update", "升级", "wgt" @@ -47,21 +46,21 @@ }, "client": { "App": { - "app-vue": "u", + "app-vue": "y", "app-nvue": "u" }, "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" }, "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" }, "小程序": { "微信": "u", @@ -73,6 +72,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue index 21ab39086821e72c9d0f099122131d84029cf215..ba6babdc24976089659660388f7bbb1ec0bc9689 100644 --- a/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue +++ b/uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue @@ -3,7 +3,7 @@ {{title}} - + @@ -20,7 +20,7 @@ -