提交 603722ec 编写于 作者: 恪愚's avatar 恪愚

优化组件展示、修复一些兼容性bug

上级 3dde83a9
......@@ -10,7 +10,7 @@
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTitleText": "yunUI—微信小程序自定义扩展组件库",
"navigationBarTextStyle":"black"
},
"style": "v2",
......
......@@ -7,6 +7,14 @@ Component({
dateTimes:{
type:Array,
value:[]
},
before_show:{ //是否作为日期组件由按钮触发弹出(为0时是)
type:Number,
value:1
},
task_show:{ //只有这个为1时,“和遮罩层有关的事件才会响应”
type:Number,
value:1
}
},
......@@ -42,7 +50,8 @@ Component({
selectedDate,
now_selectedDate:selectedDate,
selectedWeek,
now_date
now_date,
closed:true
})
this.getDateList(curYear,curMonth-1,now_date);
this.triggerEvent('timeload',{selectedDate,selectedWeek,event:this.data.now_event})
......@@ -131,6 +140,13 @@ Component({
curMonth
});
vm.getDateList(curYear,curMonth-1,this.data.now_date);
},
closed(){
if(this.properties.task_show==1){
this.setData({
closed:false
})
}
}
}
})
<view class="calendar_date {{(before_show==0)?'calendar_select_date':''}} {{(closed)?'':'calendar_unselect_date'}}">
<view class="selected_date">
<view bindtap="preMonth">
<i class="iconfont icon-fanhui-copy"></i>
......@@ -25,4 +25,6 @@
{{item.date}}</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
</view>
<view class="calendar_task" wx:if="{{task_show && closed}}" bindtap="closed"></view>
\ No newline at end of file
@import "./icon/icon.wxss";
.calendar_date{
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 100000 !important;
background-color: white;
padding-bottom: 3rpx;
}
.calendar_select_date{
animation: transfer 1.3s linear;
animation-delay: -.5s;
}
@keyframes transfer{
0%{
transform: translateY(100%);
}
100%{
transform: translateY(0);
}
}
.calendar_unselect_date{
transition: all .8s ease;
transform: translateY(100%);
}
.selected_date{
width: 100%;
......@@ -90,4 +115,14 @@
.show_box{
padding: 20rpx;
font-size: 26rpx;
}
.calendar_task{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 99999 !important;
background-color: rgba(0,0,0,.1);
}
\ No newline at end of file
......@@ -5,7 +5,14 @@ Page({
* 页面的初始数据
*/
data: {
dateTimes:[{day:'10-1',target:'国庆节'},{day:'10-2',target:'中秋节'}]
dateTimes:[{day:'10-1',target:'国庆节'},{day:'10-2',target:'中秋节'}],
selected:false
},
selected(){
this.setData({
selected:!this.data.selected
})
},
/**
......
<view>
<y-calendar dateTimes="{{dateTimes}}" bind:timeload="timeload" bind:timechanged="timechanged"></y-calendar>
<view class="select" bindtap="selected">选择时间</view>
<y-calendar wx:if="{{selected}}" before_show="0" task_show="1" dateTimes="{{dateTimes}}" bind:timeload="timeload" bind:timechanged="timechanged"></y-calendar>
</view>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册