From d59a310071dcbcb81bb2dbf42101728ba5094cae Mon Sep 17 00:00:00 2001 From: Weilanwl <1273753708@qq.com> Date: Mon, 25 Feb 2019 23:40:33 +0800 Subject: [PATCH] v2.0.7 v2.0.7 --- demo/app.json | 3 +- demo/pages/about/log/log.wxml | 6 +- demo/pages/component/nav/nav.wxml | 75 ----------- demo/pages/component/nav/nav.wxss | 37 ------ demo/pages/plugin/drawer/drawer.wxml | 46 ++++--- demo/pages/plugin/home/home.js | 5 + demo/pages/plugin/verticalnav/verticalnav.js | 19 +++ .../pages/plugin/verticalnav/verticalnav.json | 3 + .../pages/plugin/verticalnav/verticalnav.wxml | 82 +++++++++++++ .../pages/plugin/verticalnav/verticalnav.wxss | 37 ++++++ demo/project.config.json | 15 ++- template/app.js | 4 +- template/colorui.wxss | 116 ++++++++++++------ template/pages/index/index.wxml | 2 +- 14 files changed, 270 insertions(+), 180 deletions(-) create mode 100644 demo/pages/plugin/verticalnav/verticalnav.js create mode 100644 demo/pages/plugin/verticalnav/verticalnav.json create mode 100644 demo/pages/plugin/verticalnav/verticalnav.wxml create mode 100644 demo/pages/plugin/verticalnav/verticalnav.wxss diff --git a/demo/app.json b/demo/app.json index 94d4348..b327cc3 100644 --- a/demo/app.json +++ b/demo/app.json @@ -34,7 +34,8 @@ "pages/about/test/filter", "pages/about/home/home", "custom-tab-bar/index", - "pages/plugin/drawer/drawer" + "pages/plugin/drawer/drawer", + "pages/plugin/verticalnav/verticalnav" ], "window": { "navigationBarBackgroundColor": "#39b54a", diff --git a/demo/pages/about/log/log.wxml b/demo/pages/about/log/log.wxml index f7cc276..9ff77b9 100644 --- a/demo/pages/about/log/log.wxml +++ b/demo/pages/about/log/log.wxml @@ -10,11 +10,13 @@ v2.0.7 - 2019/02/20 + 2019/02/25 1.新增操作条胶囊样式,优化全屏操作条 - 2.新增操垂直导航 + 2.优化iPhone X的Tabbar样式 + 3.新增全屏抽屉插件 + 4.新增垂直导航插件 diff --git a/demo/pages/component/nav/nav.wxml b/demo/pages/component/nav/nav.wxml index e4e2cd2..db8c9cd 100644 --- a/demo/pages/component/nav/nav.wxml +++ b/demo/pages/component/nav/nav.wxml @@ -68,78 +68,3 @@ 皮肤 - - - - 垂直导航 - - - - - - Tab{{index +1}} - - - - - - - Tab{{index +1}} - - - - - - 文晓港 - - 消息未送达 - - - 22:20 - 5 - - - - - 99+ - - - 文晓港 - SVIP - - - 收到红包 - - - 22:20 - - - - - - - 喵星人互动群 - - 喵星酱:喵喵喵! - - - 22:20 - 5 - - - - - - 喵星人互动群 - - 喵星酱:喵喵喵! - - - 22:20 - 5 - - - - - - \ No newline at end of file diff --git a/demo/pages/component/nav/nav.wxss b/demo/pages/component/nav/nav.wxss index 67f03f3..e69de29 100644 --- a/demo/pages/component/nav/nav.wxss +++ b/demo/pages/component/nav/nav.wxss @@ -1,37 +0,0 @@ -/* pages/component/nav/nav.wxss */ -.ScrollNav.nav { - width: 200rpx; - white-space: initial; -} - -.ScrollNav.nav .cu-item { - width: 100%; - text-align: center; - background-color: #fff; - margin: 0; - border: none; - height: 50px; - position: relative; -} - -.ScrollNav.nav .cu-item.cur { - background-color: #f1f1f1; -} -.ScrollNav.nav .cu-item.cur::after { - content: ""; - width: 8rpx; - height: 30rpx; - border-radius: 10rpx 0 0 10rpx; - position: absolute; - background-color: currentColor; - top: 0; - right: 0rpx; - bottom: 0; - margin: auto; -} -.ScrollBox{ - display: flex; -} -.ScrollMain{ - background-color: #f1f1f1; -} \ No newline at end of file diff --git a/demo/pages/plugin/drawer/drawer.wxml b/demo/pages/plugin/drawer/drawer.wxml index 559d64b..1812905 100644 --- a/demo/pages/plugin/drawer/drawer.wxml +++ b/demo/pages/plugin/drawer/drawer.wxml @@ -8,29 +8,33 @@ - - - + + + + + - - - - - 99 + + + + 99 + - - - - - + + + + + - + - + + + + Tab{{index}} + + + @@ -41,7 +45,9 @@ - + + + diff --git a/demo/pages/plugin/home/home.js b/demo/pages/plugin/home/home.js index 42c9af4..7602848 100644 --- a/demo/pages/plugin/home/home.js +++ b/demo/pages/plugin/home/home.js @@ -17,6 +17,11 @@ Component({ title: '全屏抽屉', img: 'https://image.weilanwl.com/color2.0/plugin/qpct2148.jpg', url: '../drawer/drawer' + }, + { + title: '垂直导航', + img: 'https://image.weilanwl.com/color2.0/plugin/qpczdh2307.jpg', + url: '../verticalnav/verticalnav' } ] }, diff --git a/demo/pages/plugin/verticalnav/verticalnav.js b/demo/pages/plugin/verticalnav/verticalnav.js new file mode 100644 index 0000000..50f81a6 --- /dev/null +++ b/demo/pages/plugin/verticalnav/verticalnav.js @@ -0,0 +1,19 @@ +const app = getApp() +Page({ + data: { + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom, + TabCur: 0, + VerticalNavTop: 0 + }, + tabSelect(e) { + this.setData({ + TabCur: e.currentTarget.dataset.id, + VerticalNavTop: (e.currentTarget.dataset.id - 1) * 50 + }) + }, + VerticalMain(e) { + console.log(e.detail); + } +}) diff --git a/demo/pages/plugin/verticalnav/verticalnav.json b/demo/pages/plugin/verticalnav/verticalnav.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/demo/pages/plugin/verticalnav/verticalnav.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/demo/pages/plugin/verticalnav/verticalnav.wxml b/demo/pages/plugin/verticalnav/verticalnav.wxml new file mode 100644 index 0000000..559154b --- /dev/null +++ b/demo/pages/plugin/verticalnav/verticalnav.wxml @@ -0,0 +1,82 @@ + + + + 返回 + + Tab索引 + + + + + + + + + + + Tab{{index +1}} + + + + + + + Tab{{index +1}} + + + + + + 文晓港 + + 消息未送达 + + + 22:20 + 5 + + + + + 99+ + + + 文晓港 + SVIP + + + 收到红包 + + + 22:20 + + + + + + + 喵星人互动群 + + 喵星酱:喵喵喵! + + + 22:20 + 5 + + + + + + 喵星人互动群 + + 喵星酱:喵喵喵! + + + 22:20 + 5 + + + + + + \ No newline at end of file diff --git a/demo/pages/plugin/verticalnav/verticalnav.wxss b/demo/pages/plugin/verticalnav/verticalnav.wxss new file mode 100644 index 0000000..1f651a4 --- /dev/null +++ b/demo/pages/plugin/verticalnav/verticalnav.wxss @@ -0,0 +1,37 @@ +/* pages/component/nav/nav.wxss */ +.VerticalNav.nav { + width: 200rpx; + white-space: initial; +} + +.VerticalNav.nav .cu-item { + width: 100%; + text-align: center; + background-color: #fff; + margin: 0; + border: none; + height: 50px; + position: relative; +} + +.VerticalNav.nav .cu-item.cur { + background-color: #f1f1f1; +} +.VerticalNav.nav .cu-item.cur::after { + content: ""; + width: 8rpx; + height: 30rpx; + border-radius: 10rpx 0 0 10rpx; + position: absolute; + background-color: currentColor; + top: 0; + right: 0rpx; + bottom: 0; + margin: auto; +} +.VerticalBox{ + display: flex; +} +.VerticalMain{ + background-color: #f1f1f1; +} \ No newline at end of file diff --git a/demo/project.config.json b/demo/project.config.json index caa23e8..c975017 100644 --- a/demo/project.config.json +++ b/demo/project.config.json @@ -36,7 +36,7 @@ "list": [] }, "miniprogram": { - "current": 31, + "current": 32, "list": [ { "id": 0, @@ -194,10 +194,17 @@ "pathName": "pages/plugin/animation/animation", "query": "" }, + { + "id": 31, + "name": "3.3 扩展-全屏抽屉", + "pathName": "pages/plugin/drawer/drawer", + "query": "", + "scene": null + }, { - "id": 31, - "name": "3.3 扩展-全屏抽屉", - "pathName": "pages/plugin/drawer/drawer", + "id": -1, + "name": "3.4 扩展-垂直导航", + "pathName": "pages/plugin/home/home", "query": "", "scene": null }, diff --git a/template/app.js b/template/app.js index e04bf49..0dfc0b7 100644 --- a/template/app.js +++ b/template/app.js @@ -36,7 +36,9 @@ App({ wx.getSystemInfo({ success: e => { this.globalData.StatusBar = e.statusBarHeight; - this.globalData.CustomBar = e.platform == 'android' ? e.statusBarHeight + 50 : e.statusBarHeight + 45; + let custom = wx.getMenuButtonBoundingClientRect(); + this.globalData.Custom = custom; + this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight; } }) }, diff --git a/template/colorui.wxss b/template/colorui.wxss index d78b289..a027af1 100644 --- a/template/colorui.wxss +++ b/template/colorui.wxss @@ -1,5 +1,5 @@ /* - Color UI v2.0.6 修复v1 | by 文晓港 + Color UI v2.0.7 | by 文晓港 仅供学习交流,如作它用所承受的法律责任一概与作者无关 (QQ交流群:240787041) 文档:http://www.color-ui.com/ @@ -774,6 +774,7 @@ button.icon.lg { height: 28rpx; color: #fff; } + .cu-tag.badge:not([class*="bg-"]) { background: #dd514c; } @@ -1464,10 +1465,11 @@ button.icon.lg { .cu-bar .content { position: absolute; text-align: center; - width: 400rpx; + width: calc(100% - 340rpx); left: 0; right: 0; - bottom: 20rpx; + bottom: 0; + top: 0; margin: auto; height: 60rpx; font-size: 32rpx; @@ -1479,6 +1481,13 @@ button.icon.lg { overflow: hidden; } +.cu-bar.ios .content { + bottom: 7px; + height: 30px; + font-size: 32rpx; + line-height: 30px; +} + .cu-bar.btn-group { justify-content: space-around; } @@ -1543,6 +1552,14 @@ button.icon.lg { .cu-bar.tabbar { padding: 0; + z-index: 0; + height: calc(100rpx + env(safe-area-inset-bottom) / 2); + padding-bottom: calc(env(safe-area-inset-bottom) / 2); +} + +.cu-tabbar-height { + min-height: 100rpx; + height: calc(100rpx + env(safe-area-inset-bottom) / 2); } .cu-bar.tabbar.shadow { @@ -1716,51 +1733,72 @@ button.icon.lg { margin-left: 0rpx; } -/* -.cu-bar.tabbar .action { - flex: 1; - text-align: center; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} -.cu-bar.tabbar .action .tabbar-icon { - width: 54rpx; - height: 54rpx; - position: relative; -} -.cu-bar.tabbar .action image { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - margin: auto; -} -.cu-bar.tabbar .action .tabbar-icon image:first-child,.cu-bar.tabbar .action.cur .tabbar-icon image:last-child { - width: 0rpx; - height: 0rpx; -} -.cu-bar.tabbar .action .tabbar-icon image:last-child,.cu-bar.tabbar .action.cur .tabbar-icon image:first-child { - width: 54rpx; - height: 54rpx; -} - -.cu-bar.tabbar .action view { - font-size: 20rpx; -} */ - .cu-custom { display: block; position: relative; } +.cu-custom .cu-bar .content { + width: calc(100% - 440rpx); +} + +.cu-custom .cu-bar { + min-height: 0px; +} + .cu-custom .cu-bar { padding-right: 220rpx; box-shadow: 0rpx 0rpx 0rpx; } +.cu-custom .cu-bar .border-custom { + position: relative; + background: rgba(0, 0, 0, 0.15); + border-radius: 1000rpx; + height: 30px; +} + +.cu-custom .cu-bar .border-custom::after { + content: " "; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + border: 1rpx solid #fff; + opacity: 0.5; +} + +.cu-custom .cu-bar .border-custom::before { + content: " "; + width: 1rpx; + height: 110%; + position: absolute; + top: 22.5%; + left: 0; + right: 0; + margin: auto; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + opacity: 0.6; + background-color: #fff; +} + +.cu-custom .cu-bar .border-custom text { + display: block; + flex: 1; + margin: auto !important; + text-align: center; + font-size: 34rpx; +} + /* ================== 导航栏 ==================== */ @@ -2010,7 +2048,7 @@ button.icon.lg { .cu-card>.cu-item { display: block; - background: #fff; + background-color: #fff; overflow: hidden; border-radius: 10rpx; margin: 30rpx; diff --git a/template/pages/index/index.wxml b/template/pages/index/index.wxml index babb67e..daf23b1 100644 --- a/template/pages/index/index.wxml +++ b/template/pages/index/index.wxml @@ -1,6 +1,6 @@ - ColorUI 空白模板 + ColorUI 空白模板