2019-2-25 22:42:38

This commit is contained in:
Weilanwl
2019-02-25 22:42:42 +08:00
parent 56d35053cd
commit e2e35a2d72
24 changed files with 478 additions and 89 deletions

View File

@@ -4,7 +4,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;
}
})
},

View File

@@ -33,7 +33,8 @@
"pages/about/test/list",
"pages/about/test/filter",
"pages/about/home/home",
"custom-tab-bar/index"
"custom-tab-bar/index",
"pages/plugin/drawer/drawer"
],
"window": {
"navigationBarBackgroundColor": "#39b54a",

View File

@@ -1,6 +1,10 @@
@import "icon.wxss";
@import "colorui.wxss";
.cu-modal.show {
z-index: 99999;
}
.nav-list {
display: flex;
flex-wrap: wrap;

View File

@@ -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;

View File

@@ -64,17 +64,4 @@
</view>
</view>
<view class="cu-modal {{modalName=='QrcodeModal'?'show':''}}">
<view class="cu-dialog">
<view class="bg-img" style="background-image: url('https://image.weilanwl.com/color2.0/zanCode.jpg');height:544rpx;">
<view class="cu-bar justify-end none-bg text-white">
<view class='action' bindtap='hideModal'>
<text class='icon-close '></text>
</view>
</view>
</view>
<view class="cu-bar">
<view class='justify-center flex-sub' bindtap='SaveQrcode'>保存到相册</view>
</view>
</view>
</view>
<view class='cu-tabbar-height'></view>

View File

@@ -1,6 +1,3 @@
page{
padding-bottom: 100rpx;
}
.UCenter-bg {
background-image: url(https://image.weilanwl.com/color2.0/index.jpg);
background-size: cover;
@@ -36,4 +33,14 @@ page{
height: 100rpx;
}
map,.mapBox{
left: 0;
z-index: 99;
mix-blend-mode: screen;
height: 100rpx;
}
map,.mapBox{
width: 750rpx;
height: 300rpx;
}

View File

@@ -8,6 +8,18 @@
<view class="cu-timeline">
<view class='cu-item text-green'>
<view class="bg-gradual-green content shadow-blur">
<view class="cu-capsule radius">
<view class="cu-tag bg-white text-green">v2.0.7</view>
<view class="cu-tag line-white">2019/02/20</view>
</view>
<view class='margin-top-sm text-content'>
<view>1.新增操作条胶囊样式,优化全屏操作条</view>
<view>2.新增操垂直导航</view>
</view>
</view>
</view>
<view class='cu-item text-green'>
<view class="bg-green content shadow-blur">
<view class="cu-capsule radius">
<view class="cu-tag bg-white text-green">v2.0.6</view>
<view class="cu-tag line-white">2019/02/09</view>

View File

@@ -6,3 +6,4 @@
<text class='icon-{{item.icon}}'></text>
</navigator>
</view>
<view class='cu-tabbar-height'></view>

View File

@@ -1,3 +0,0 @@
page{
padding-bottom: 100rpx;
}

View File

@@ -3,6 +3,7 @@ Page({
data: {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom,
},
})

View File

@@ -1,9 +1,10 @@
<view class="cu-custom" style="height:{{CustomBar}}px;">
<view class="cu-bar fixed bg-gradual-pink" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
<navigator class='action' open-type="navigateBack" delta="1" hover-class="none">
<navigator class='action border-custom' open-type="navigateBack" delta="1" hover-class="none" style='width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)'>
<text class='icon-back'></text>
<text>操作条</text>
<text class='icon-homefill'></text>
</navigator>
<view class='content' style='top:{{StatusBar}}px;'>操作条</view>
</view>
</view>

View File

@@ -6,3 +6,4 @@
<text class='icon-{{item.icon}}'></text>
</navigator>
</view>
<view class='cu-tabbar-height'></view>

View File

@@ -1,3 +0,0 @@
page{
padding-bottom: 100rpx;
}

View File

@@ -5,10 +5,9 @@
</navigator>
</view>
</view>
<view class="cu-bar bg-white">
<view class="cu-bar bg-white margin-top">
<view class='action'>
<text class='icon-title text-orange '></text> 模态窗口
<text class='icon-title text-orange '></text> 普通窗口
</view>
<view class='action'>
<button class='cu-btn bg-green shadow' bindtap="showModal" data-target="Modal">Modal</button>

View File

@@ -71,17 +71,75 @@
<view class="cu-bar bg-white margin-top solid-bottom">
<view class='action'>
<text class='icon-title text-orange'></text> 定位
<text class='icon-title text-orange'></text> 垂直导航
</view>
</view>
<scroll-view scroll-x class="bg-green nav text-center">
<view class="cu-item {{0==TabCur?'text-white cur':''}}" bindtap='tabSelect' data-id="0">
<text class='icon-camerafill'></text> 数码
</view>
<view class="cu-item {{1==TabCur?'text-white cur':''}}" bindtap='tabSelect' data-id="1">
<text class='icon-upstagefill'></text> 排行榜
</view>
<view class="cu-item {{2==TabCur?'text-white cur':''}}" bindtap='tabSelect' data-id="2">
<text class='icon-clothesfill'></text> 皮肤
</view>
</scroll-view>
<view class="ScrollBox">
<scroll-view class="ScrollNav nav" scroll-y scroll-with-animation scroll-top="{{scrollNavTop}}" style="height:calc(100vh - 375rpx)">
<view class="cu-item {{index==TabCur?'text-green cur':''}}" wx:for="{{20}}" wx:key bindtap='tabSelect' data-id="{{index}}">
Tab{{index +1}}
</view>
</scroll-view>
<scroll-view class="ScrollMain" scroll-y scroll-with-animation style="height:calc(100vh - 375rpx)" scroll-into-view="main-id-{{TabCur}}" bindscroll="ScrollMain">
<view class="padding-top padding-lr" wx:for="{{20}}" wx:key id="main-id-{{index}}">
<view class='cu-bar solid-bottom bg-white'>
<view class='action'>
<text class='icon-title text-green'></text> Tab{{index +1}}</view>
</view>
<view class="cu-list menu menu-avatar">
<view class="cu-item">
<view class="cu-avatar round lg" style="background-image:url(https://image.weilanwl.com/img/square-1.jpg);"></view>
<view class='content'>
<view class='text-grey'>文晓港</view>
<view class='text-gray text-sm'>
<text class='icon-infofill text-red'></text> 消息未送达</view>
</view>
<view class='action'>
<view class='text-grey text-xs'>22:20</view>
<view class="cu-tag round bg-grey sm">5</view>
</view>
</view>
<view class="cu-item">
<view class="cu-avatar round lg" style="background-image:url(https://image.weilanwl.com/img/square-2.jpg);">
<view class="cu-tag badge">99+</view>
</view>
<view class='content'>
<view class='text-grey'>文晓港
<view class="cu-tag round bg-orange sm">SVIP</view>
</view>
<view class='text-gray text-sm'>
<text class='icon-redpacket_fill text-red'></text> 收到红包</view>
</view>
<view class='action'>
<view class='text-grey text-xs'>22:20</view>
<view class='icon-notice_forbid_fill text-gray'></view>
</view>
</view>
<view class="cu-item ">
<view class="cu-avatar radius lg" style="background-image:url(https://image.weilanwl.com/img/square-3.jpg);"></view>
<view class='content'>
<view>喵星人互动群</view>
<view class='text-gray text-sm'>
喵星酱:喵喵喵!</view>
</view>
<view class='action'>
<view class='text-grey text-xs'>22:20</view>
<view class="cu-tag round bg-red sm">5</view>
</view>
</view>
<view class="cu-item grayscale">
<view class="cu-avatar radius lg" style="background-image:url(https://image.weilanwl.com/img/square-3.jpg);"></view>
<view class='content'>
<view>喵星人互动群</view>
<view class='text-gray text-sm'>
喵星酱:喵喵喵!</view>
</view>
<view class='action'>
<view class='text-grey text-xs'>22:20</view>
<view class="cu-tag round bg-red sm">5</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>

View File

@@ -1 +1,37 @@
/* pages/component/nav/nav.wxss */
/* 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;
}

View File

@@ -0,0 +1,40 @@
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom,
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
TabCur: 1,
scrollLeft: 0
},
getUserInfo: function (e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
showModal(e) {
this.setData({
modalName: e.currentTarget.dataset.target
})
},
hideModal(e) {
this.setData({
modalName: null
})
},
tabSelect(e) {
console.log(e);
this.setData({
TabCur: e.currentTarget.dataset.id,
scrollLeft: (e.currentTarget.dataset.id - 1) * 60
})
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,93 @@
<view class="DrawerPage {{modalName=='viewModal'?'show':''}}">
<view class="cu-custom" style="height:{{CustomBar}}px;">
<view class="cu-bar tabbar bg-black fixed" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
<view class="action text-center" style='width: 100rpx'>
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo" class='cu-btn icon-my icon bg-green shadow'> </button>
<block wx:else>
<view class="cu-avatar round" style="background-image:url({{userInfo.avatarUrl}})" bindtap="showModal" data-target="viewModal"></view>
</block>
</view>
<!-- 样式1 -->
<view class="action {{1==TabCur?'cur':''}}" bindtap='tabSelect' data-id="1">
<view class='icon-cu-image'>
<image src='/images/tabbar/component{{1==TabCur?"_cur":""}}.png'></image>
</view>
</view>
<view class="action {{2==TabCur?'cur':''}}" bindtap='tabSelect' data-id="2">
<view class='icon-cu-image'>
<image src='/images/tabbar/plugin{{2==TabCur?"_cur":""}}.png'></image>
<view class='cu-tag badge'>99</view>
</view>
</view>
<view class="action {{3==TabCur?'cur':''}}" bindtap='tabSelect' data-id="3">
<view class='icon-cu-image'>
<image src='/images/tabbar/about{{3==TabCur?"_cur":""}}.png'></image>
<view class='cu-tag badge'></view>
</view>
</view>
<!-- 样式2 -->
<!-- <scroll-view scroll-x class="nav" scroll-with-animation scroll-left="{{scrollLeft}}" style='width:calc(100% - 440rpx)'>
<view class="cu-item {{index==TabCur?'text-green cur':''}}" wx:for="{{10}}" wx:key bindtap='tabSelect' data-id="{{index}}">
Tab{{index}}
</view>
</scroll-view> -->
</view>
</view>
<view wx:for="{{10}}" wx:key wx:if="{{index==TabCur}}" class='padding margin text-center'>
<view class='text-bold text-xxl margin-xl'>Tab{{index}}</view>
<view class='text-xl margin-xl'>点击头像打开抽屉</view>
<navigator class='cu-btn bg-green lg block shadow radius margin-xl' open-type="navigateBack" delta="1" hover-class="none">
<text class='icon-back'> </text> 返回上一页
</navigator>
</view>
</view>
<view class="DrawerClose {{modalName=='viewModal'?'show':''}}" bindtap='hideModal'><text class='icon-pullright'></text></view>
<view class="DrawerWindow {{modalName=='viewModal'?'show':''}}">
<view class='padding-xl text-center text-white'>
<image src='/images/logo.png' class='response' mode='widthFix' style='width:200rpx;margin-top:100rpx'></image>
<view class='text-xl'>ColorUI组件库
<text class='text-df'>v2.0</text>
</view>
<view class='margin-top-sm'>
<text>By:文晓港</text>
</view>
</view>
<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg">
<view class="cu-item arrow">
<view class='content' bindtap='CopyLink' data-link='https://github.com/weilanwl/ColorUI'>
<text class='icon-github text-grey'></text>
<text class='text-grey'>GitHub</text>
</view>
</view>
<view class="cu-item arrow">
<navigator class='content' url='../about/about' hover-class='none'>
<image src='/images/logo.png' class='png' mode='aspectFit'></image>
<text class='text-grey'>关于ColorUI组件库</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class='content' url='../log/log' hover-class='none'>
<text class='icon-formfill text-green'></text>
<text class='text-grey'>日志</text>
</navigator>
</view>
<view class="cu-item arrow">
<view class='content' bindtap="showQrcode">
<text class='icon-appreciatefill text-red'></text>
<text class='text-grey'>赞赏支持</text>
</view>
</view>
<view class="cu-item arrow">
<button class='cu-btn content' open-type='feedback'>
<text class='icon-writefill text-cyan'></text>
<text class='text-grey'>意见反馈</text>
</button>
</view>
<view class="cu-item arrow">
<navigator class='content' url='../test/list' hover-class='none'>
<text class='icon-creativefill text-orange'></text>
<text class='text-grey'>Bug测试</text>
</navigator>
</view>
</view>
</view>

View File

@@ -0,0 +1,101 @@
page {
background-color: #555;
background-size: 100%;
}
.DrawerPage {
position: absolute;
width: 100vw;
height: 100vh;
left: 0vw;
background-color: #f1f1f1;
transition: all 0.6s;
}
.DrawerPage.show {
transform: scale(0.9, 0.9);
left: 85vw;
box-shadow: 0 0 60rpx rgba(0, 0, 0, 0.2);
transform-origin: 0;
}
.DrawerWindow {
position: absolute;
width: 85vw;
height: 100vh;
left: 0;
top: 0;
transform: scale(0.9, 0.9) translateX(-100%);
opacity: 0;
pointer-events: none;
transition: all 0.6s;
}
.DrawerWindow.show {
transform: scale(1, 1) translateX(0%);
opacity: 1;
pointer-events: all;
}
.DrawerClose {
position: absolute;
width: 40vw;
height: 100vh;
right: 0;
top: 0;
color: transparent;
padding-bottom: 30rpx;
display: flex;
align-items: flex-end;
justify-content: center;
background-image: linear-gradient(90deg,rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
letter-spacing: 5px;
font-size: 50rpx;
opacity: 0;
pointer-events: none;
transition: all 0.6s;
}
.DrawerClose.show {
opacity: 1;
pointer-events: all;
width: 15vw;
color: #fff;
}
.DrawerPage .cu-bar.tabbar .action button.icon {
width: 64rpx;
height: 64rpx;
line-height: 64rpx;
margin: 0;
display: inline-block;
}
.DrawerPage .cu-bar.tabbar .action .cu-avatar {
margin: 0;
}
.DrawerPage .nav {
flex: 1;
}
.DrawerPage .nav .cu-item.cur {
border-bottom: 0;
position: relative;
}
.DrawerPage .nav .cu-item.cur::after {
content: "";
width: 10rpx;
height: 10rpx;
background-color: currentColor;
position: absolute;
bottom: 10rpx;
border-radius: 10rpx;
left: 0;
right: 0;
margin: auto;
}
.DrawerPage .cu-bar.tabbar .action {
flex: initial;
}

View File

@@ -7,11 +7,16 @@ Component({
title: '索引列表',
img: 'https://image.weilanwl.com/color2.0/plugin/sylb2244.jpg',
url: '../indexes/indexes'
},
},
{
title: '微动画',
img: 'https://image.weilanwl.com/color2.0/plugin/wdh2236.jpg',
url: '../animation/animation'
},
{
title: '全屏抽屉',
img: 'https://image.weilanwl.com/color2.0/plugin/qpct2148.jpg',
url: '../drawer/drawer'
}
]
},

View File

@@ -1,6 +1,6 @@
<view class="cu-custom" style="height:{{CustomBar}}px;">
<view class="cu-bar fixed none-bg text-white bg-img" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;background-image:url(https://image.weilanwl.com/color2.0/plugin/cjkz2329.jpg);">
<view class='content' open-type="navigateBack" delta="1" hover-class="none">
<view class='content' style='top:{{StatusBar}}px;'>
<image src="/images/cjkz.png" mode='widthFix'></image>
</view>
</view>
@@ -11,4 +11,5 @@
{{item.title}}
</view>
</view>
</view>
</view>
<view class='cu-tabbar-height'></view>

View File

@@ -1,6 +1,3 @@
page{
padding-bottom: 100rpx;
}
.cu-bar .content image{
height: 60rpx;
width: 240rpx;

View File

@@ -36,7 +36,7 @@
"list": []
},
"miniprogram": {
"current": 2,
"current": 31,
"list": [
{
"id": 0,
@@ -194,6 +194,13 @@
"pathName": "pages/plugin/animation/animation",
"query": ""
},
{
"id": 31,
"name": "3.3 扩展-全屏抽屉",
"pathName": "pages/plugin/drawer/drawer",
"query": "",
"scene": null
},
{
"id": -1,
"name": "-----关于-首页-----",