Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
恪愚
yunUI
提交
7902ed82
Y
yunUI
项目概览
恪愚
/
yunUI
2022-11-02 05:11:01同步失败
通知
22
Star
9
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yunUI
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7902ed82
编写于
9月 26, 2020
作者:
恪愚
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化日历组件calendar显示
上级
e979565d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
7 deletion
+25
-7
components/calendar/calendar.js
components/calendar/calendar.js
+2
-0
components/calendar/calendar.wxml
components/calendar/calendar.wxml
+1
-1
components/calendar/calendar.wxss
components/calendar/calendar.wxss
+21
-5
pages/calendar/calendar.wxml
pages/calendar/calendar.wxml
+1
-1
未找到文件。
components/calendar/calendar.js
浏览文件 @
7902ed82
...
...
@@ -11,6 +11,7 @@ Component({
* 组件的初始数据
*/
data
:
{
now_selectedDate
:
''
,
//当前是几月几号
selectedDate
:
''
,
//选中的几月几号
selectedWeek
:
''
,
//选中的是星期几
curYear
:
2017
,
//当前年份
...
...
@@ -33,6 +34,7 @@ Component({
curYear
,
curMonth
,
selectedDate
,
now_selectedDate
:
selectedDate
,
selectedWeek
})
this
.
getDateList
(
curYear
,
curMonth
-
1
);
...
...
components/calendar/calendar.wxml
浏览文件 @
7902ed82
...
...
@@ -20,7 +20,7 @@
</view>
<view class="calendar_box" wx:for="{{dateList}}" wx:for-item="week"
style="{{index==0?'justify-content:flex-end':''}}">
<view class="weekday_label {{
item.value==selectedDate?'active_date
':''}}" wx:for="{{week}}">
<view class="weekday_label {{
(item.value==selectedDate)?'active_date':''}} {{(item.value==now_selectedDate)?'active_dates
':''}}" wx:for="{{week}}">
<view class="" bindtap="selectDate" data-date="{{item}}">
{{item.date}}</view>
</view>
...
...
components/calendar/calendar.wxss
浏览文件 @
7902ed82
...
...
@@ -29,14 +29,14 @@
overflow: hidden;
display: flex;
height: calc(100% / 6);
border-radius: 50%
;
align-items: center
;
}
.weekday_label{
width: calc(100% / 7);
/* float: left; */
/* text-align: center; */
font-size: 27rpx;
/* padding: 10rpx 0; */
padding: 12rpx 0;
display: flex;
justify-content: center;
align-items: center;
...
...
@@ -53,11 +53,27 @@
}
.active_date{
background: rgba(0,0,0,.12);
color:
#fff
;
color:
rgba(0,0,0,.6)
;
/* border-radius: 50%; */
padding: 12rpx;
box-sizing: border-box;
/* padding: 12rpx;
box-sizing: border-box; */
overflow: hidden;
position: relative;
}
.active_dates{
background: rgba(0,0,0,.12);
color: rgba(0,0,0,.6);
overflow: hidden;
position: relative;
}
.active_dates::before{
content: "今天";
position: absolute;
top: -2rpx;
left: 50%;
transform: translateX(-50%);
color: blue;
font-size: 20rpx;
}
.show_box{
padding: 20rpx;
...
...
pages/calendar/calendar.wxml
浏览文件 @
7902ed82
<view
style="width:50%;height:500rpx;border:1rpx solid red;"
>
<view>
<y-calendar 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录