From 46a53081713c4eb78cef7b5c71a2ce1327b0e770 Mon Sep 17 00:00:00 2001 From: wlxuqu <1416956117@qq.com> Date: Thu, 3 Sep 2020 22:13:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=9C=A8nvue=E4=B8=8B?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=9A=84=E8=AD=A6=E5=91=8A=E5=92=8C=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98=202.=20=E4=BF=AE=E5=A4=8Dgrid?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=9C=A8=E5=A4=B4=E6=9D=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=9A=84=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=203.=20=E4=BC=98=E5=8C=96tabs=E7=BB=84=E4=BB=B6=E5=9C=A8?= =?UTF-8?q?=E5=A4=B4=E6=9D=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98=204.=20=E4=BF=AE=E5=A4=8Dindex-list?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=9C=A8=E5=A4=B4=E6=9D=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=B8=8A=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=205.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlayout=E7=BB=84=E4=BB=B6=E5=9C=A8=E5=A4=B4?= =?UTF-8?q?=E6=9D=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=8A=E7=9A=84=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7=206.=20=E4=BF=AE=E5=A4=8Dtable=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=9C=A8=E5=A4=B4=E6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=BA=E7=9E=AC=E9=97=B4=E8=A2=AB=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=2016.=20=E4=BC=98=E5=8C=96empty?= =?UTF-8?q?=E6=BC=94=E7=A4=BA=E5=9C=A8=E5=A4=B4=E6=9D=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=B8=8A=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=2017.=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96tag=E7=BB=84=E4=BB=B6=E5=9C=A8=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=8A=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=A1=8C=E5=86=85=E6=A0=B7=E5=BC=8F=E5=8A=A0?= =?UTF-8?q?"!important"=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/componentsA/empty/index.vue | 40 ++++++------ pages/componentsA/modal/index.vue | 2 +- pages/componentsA/slider/index.vue | 2 +- pages/componentsB/line/index.vue | 3 +- pages/componentsB/tabbar/index.vue | 1 - pages/componentsC/test/index.vue | 65 +++++++------------ pages/example/components.config.js | 10 ++- uview-ui/components/u-link/u-link.vue | 8 +-- .../u-message-input/u-message-input.vue | 17 ++--- uview-ui/components/u-popup/u-popup.vue | 12 +++- uview-ui/components/u-rate/u-rate.vue | 10 +-- uview-ui/components/u-tag/u-tag.vue | 4 +- uview-ui/components/u-toast/u-toast.vue | 44 +++++++------ uview-ui/libs/config/config.js | 4 +- uview-ui/libs/css/style.mp.scss | 9 +++ uview-ui/package.json | 2 +- 17 files changed, 123 insertions(+), 112 deletions(-) diff --git a/manifest.json b/manifest.json index 38039e16..1a8c8980 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "uView", "appid" : "__UNI__60F4B81", "description" : "多平台快速开发的UI框架", - "versionName" : "1.6.5", + "versionName" : "1.6.6", "versionCode" : "100", "transformPx" : false, "app-plus" : { diff --git a/pages/componentsA/empty/index.vue b/pages/componentsA/empty/index.vue index 16d89fa5..8b9d42cc 100644 --- a/pages/componentsA/empty/index.vue +++ b/pages/componentsA/empty/index.vue @@ -17,58 +17,58 @@ 模式选择 - - + + 购物车为空 - + 页面不存在 - + 没有搜索结果 - - + + 没有收货地址 - + 没有WiFi - + 订单为空 - - + + 没有优惠券 - + 没有收藏 - + 无权限 - - + + 无历史记录 - + 无新闻列表 - + 消息列表为空 - - + + 列表为空 - + 数据为空 - + 待扩展 diff --git a/pages/componentsA/modal/index.vue b/pages/componentsA/modal/index.vue index 9c82295f..54f0ea77 100644 --- a/pages/componentsA/modal/index.vue +++ b/pages/componentsA/modal/index.vue @@ -9,7 +9,7 @@ :show-title="showTitle" :async-close="asyncClose" @confirm="confirm" :content="content" > - + diff --git a/pages/componentsA/slider/index.vue b/pages/componentsA/slider/index.vue index 6e53b1f6..4daf5e0c 100644 --- a/pages/componentsA/slider/index.vue +++ b/pages/componentsA/slider/index.vue @@ -11,7 +11,7 @@ @end="end" @moving="moving" > - + {{value}} diff --git a/pages/componentsB/line/index.vue b/pages/componentsB/line/index.vue index 23254bf0..9d54f54c 100644 --- a/pages/componentsB/line/index.vue +++ b/pages/componentsB/line/index.vue @@ -3,7 +3,8 @@ 演示效果 - + + diff --git a/pages/componentsB/tabbar/index.vue b/pages/componentsB/tabbar/index.vue index 909ffbaf..a1608535 100644 --- a/pages/componentsB/tabbar/index.vue +++ b/pages/componentsB/tabbar/index.vue @@ -28,7 +28,6 @@ - - - - + 打开弹窗 + + + + + + 确定 + + + @@ -11,42 +17,21 @@ export default { data() { return { - value1: 1, - value2: 2, - options1: [{ - label: '默认排序', - value: 1, - }, - { - label: '距离优先', - value: 2, - } - ], - options2: [{ - label: '去冰', - value: 1, - }, - { - label: '加冰', - value: 2, - }, - ], - } - }, - methods: { - open(index) { - // 展开某个下来菜单时,先关闭原来的其他菜单高亮 - // 同时内部会自动给当前展开项进行高亮 - this.$refs.uDropdown.highlight(); - }, - close(index) { - // 关闭的时候,给当前项加上高亮 - // 当然,您也可以通过监听dropdown-item的@change事件进行处理 - this.$refs.uDropdown.highlight(index); - }, - change() { - // 更多的细节,请自行实现 + show: true } } } - \ No newline at end of file + + + \ No newline at end of file diff --git a/pages/example/components.config.js b/pages/example/components.config.js index d5951a4c..ebc6f092 100644 --- a/pages/example/components.config.js +++ b/pages/example/components.config.js @@ -219,12 +219,16 @@ export default [{ icon: 'mask', title: 'Mask 遮罩层', title_en: 'Mask', - }, { + }, + // #ifndef MP-TOUTIAO + { path: '/pages/componentsA/noNetwork/index', icon: 'noNetwork', title: 'NoNetwork 无网络提示', title_en: 'NoNetwork', - }, { + }, + // #endif + { path: '/pages/componentsC/grid/index', icon: 'grid', title: 'Grid 宫格布局', @@ -250,12 +254,14 @@ export default [{ title: 'Sticky 吸顶', title_en: 'Sticky', }, + // #ifndef MP-TOUTIAO { path: '/pages/componentsB/waterfall/index', icon: 'waterfall', title: 'Waterfall 瀑布流', title_en: 'Waterfall', }, + // #endif { path: '/pages/componentsB/divider/index', icon: 'divider', diff --git a/uview-ui/components/u-link/u-link.vue b/uview-ui/components/u-link/u-link.vue index edb51bea..2dd2a735 100644 --- a/uview-ui/components/u-link/u-link.vue +++ b/uview-ui/components/u-link/u-link.vue @@ -67,13 +67,13 @@ // #ifdef MP uni.setClipboardData({ data: this.href, - success() { + success: () => { uni.hideToast(); + this.$nextTick(() => { + this.$u.toast(this.mpTips); + }) } }); - this.$nextTick(() => { - this.$u.toast(this.mpTips); - }) // #endif } } diff --git a/uview-ui/components/u-message-input/u-message-input.vue b/uview-ui/components/u-message-input/u-message-input.vue index 4ab7cec9..e0e99c94 100644 --- a/uview-ui/components/u-message-input/u-message-input.vue +++ b/uview-ui/components/u-message-input/u-message-input.vue @@ -2,7 +2,8 @@ - + + - + { this[param2] = status; this.$emit(status ? 'open' : 'close'); - }, 300); + }, this.duration); } } } @@ -351,7 +357,7 @@ export default { /* #endif */ position: absolute; z-index: 1003; - transition: all 0.3s linear; + transition: all 0.25s linear; } .u-drawer__scroll-view { diff --git a/uview-ui/components/u-rate/u-rate.vue b/uview-ui/components/u-rate/u-rate.vue index ebde0f9b..a4f8557c 100644 --- a/uview-ui/components/u-rate/u-rate.vue +++ b/uview-ui/components/u-rate/u-rate.vue @@ -123,14 +123,14 @@ export default { // 获取评分组件盒子的布局信息 getElRectById() { // uView封装的获取节点的方法,详见文档 - this.$u.getRect('#' + this.elId).then(res => { + this.$uGetRect('#' + this.elId).then(res => { this.starBoxLeft = res.left; }) }, // 获取单个星星的尺寸 getElRectByClass() { // uView封装的获取节点的方法,详见文档 - this.$u.getRect('.' + this.elClass).then(res => { + this.$uGetRect('.' + this.elClass).then(res => { this.starWidth = res.width; // 把每个星星右边到组件盒子左边的距离放入数组中 for (let i = 0; i < this.count; i++) { @@ -191,8 +191,10 @@ export default { } }, mounted() { - this.getElRectById(); - this.getElRectByClass(); + setTimeout(() => { + this.getElRectById(); + this.getElRectByClass(); + }, 100) } }; diff --git a/uview-ui/components/u-tag/u-tag.vue b/uview-ui/components/u-tag/u-tag.vue index 8be2cbfb..90ec3f41 100644 --- a/uview-ui/components/u-tag/u-tag.vue +++ b/uview-ui/components/u-tag/u-tag.vue @@ -112,9 +112,9 @@ customStyle() { let style = {}; // 文字颜色(如果有此值,会覆盖type值的颜色) - if(this.color) style.color = this.color+"!important"; + if(this.color) style.color = this.color; // tag的背景颜色(如果有此值,会覆盖type值的颜色) - if(this.bgColor) style.backgroundColor = this.bgColor+"!important"; + if(this.bgColor) style.backgroundColor = this.bgColor; // 如果是镂空型tag,没有传递边框颜色(borderColor)的话,使用文字的颜色(color属性) if(this.mode == 'plain' && this.color && !this.borderColor) style.borderColor = this.color; else style.borderColor = this.borderColor; diff --git a/uview-ui/components/u-toast/u-toast.vue b/uview-ui/components/u-toast/u-toast.vue index 8175943f..91d15936 100644 --- a/uview-ui/components/u-toast/u-toast.vue +++ b/uview-ui/components/u-toast/u-toast.vue @@ -1,11 +1,11 @@ @@ -42,14 +42,15 @@ position: 'center', // toast出现的位置 callback: null, // 执行完后的回调函数 back: false, // 结束toast是否自动返回上一页 - } + }, + tmpConfig: {}, // 将用户配置和内置配置合并后的临时配置变量 }; }, computed: { iconName() { // 只有不为none,并且type为error|warning|succes|info时候,才显示图标 - if (['error', 'warning', 'success', 'info'].indexOf(this.config.type) >= 0 && this.config.icon) { - let icon = this.$u.type2icon(this.config.type); + if (['error', 'warning', 'success', 'info'].indexOf(this.tmpConfig.type) >= 0 && this.tmpConfig.icon) { + let icon = this.$u.type2icon(this.tmpConfig.type); return icon; } }, @@ -61,7 +62,8 @@ methods: { // 显示toast组件,由父组件通过this.$refs.xxx.show(options)形式调用 show(options) { - this.config = this.$u.deepMerge(this.config, options); + // 不降结果合并到this.config变量,避免多次条用u-toast,前后的配置造成混论 + this.tmpConfig = this.$u.deepMerge(this.config, options); if (this.timer) { // 清除定时器 clearTimeout(this.timer); @@ -74,9 +76,9 @@ clearTimeout(this.timer); this.timer = null; // 判断是否存在callback方法,如果存在就执行 - typeof(this.config.callback) === 'function' && this.config.callback(); + typeof(this.tmpConfig.callback) === 'function' && this.tmpConfig.callback(); this.timeEnd(); - }, this.config.duration); + }, this.tmpConfig.duration); }, // 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用 hide() { @@ -90,35 +92,35 @@ // 倒计时结束之后,进行的一些操作 timeEnd() { // 如果带有url值,根据isTab为true或者false进行跳转 - if (this.config.url) { + if (this.tmpConfig.url) { // 如果url没有"/"开头,添加上,因为uni的路由跳转需要"/"开头 - if (this.config.url[0] != '/') this.config.url = '/' + this.config.url; + if (this.tmpConfig.url[0] != '/') this.tmpConfig.url = '/' + this.tmpConfig.url; // 判断是否有传递显式的参数 - if (Object.keys(this.config.params).length) { + if (Object.keys(this.tmpConfig.params).length) { // 判断用户传递的url中,是否带有参数 // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary" // 如果有params参数,转换后无需带上"?" let query = ''; - if (/.*\/.*\?.*=.*/.test(this.config.url)) { + if (/.*\/.*\?.*=.*/.test(this.tmpConfig.url)) { // object对象转为get类型的参数 - query = this.$u.queryParams(this.config.params, false); - this.config.url = this.config.url + "&" + query; + query = this.$u.queryParams(this.tmpConfig.params, false); + this.tmpConfig.url = this.tmpConfig.url + "&" + query; } else { - query = this.$u.queryParams(this.config.params); - this.config.url += query; + query = this.$u.queryParams(this.tmpConfig.params); + this.tmpConfig.url += query; } } // 如果是跳转tab页面,就使用uni.switchTab - if (this.config.isTab) { + if (this.tmpConfig.isTab) { uni.switchTab({ - url: this.config.url + url: this.tmpConfig.url }); } else { uni.navigateTo({ - url: this.config.url + url: this.tmpConfig.url }); } - } else if(this.config.back) { + } else if(this.tmpConfig.back) { // 回退到上一页 this.$u.route({ type: 'back' diff --git a/uview-ui/libs/config/config.js b/uview-ui/libs/config/config.js index 88d54890..97e0e401 100644 --- a/uview-ui/libs/config/config.js +++ b/uview-ui/libs/config/config.js @@ -1,5 +1,5 @@ -// 此版本发布于2020-08-25 -let version = '1.6.5'; +// 此版本发布于2020-09-03 +let version = '1.6.6'; export default { v: version, diff --git a/uview-ui/libs/css/style.mp.scss b/uview-ui/libs/css/style.mp.scss index 3b592b30..ca1d3e0e 100644 --- a/uview-ui/libs/css/style.mp.scss +++ b/uview-ui/libs/css/style.mp.scss @@ -56,6 +56,15 @@ u-icon { flex: 1; align-self: stretch; } + +// 避免小程序线条组件因为父组件display: flex;而失效 +.u-line { + flex: 1; +} + +.u-dropdown { + flex: 1; +} /* #endif */ /* end-头条小程序编译后页面有组件名的元素,特别处理--end */ diff --git a/uview-ui/package.json b/uview-ui/package.json index 7f0061a1..68a4ac36 100644 --- a/uview-ui/package.json +++ b/uview-ui/package.json @@ -1,6 +1,6 @@ { "name": "uview-ui", - "version": "1.6.5", + "version": "1.6.6", "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", "main": "index.js", "keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"],