时间:2021-05-18
本文实例为大家分享了小程序日历展示的具体代码,供大家参考,具体内容如下
根据前面的日历,又遇到到个好玩的日历需求,分享给大家
这是个带年月左右选取的日历展示!并且当天的对应日会被高亮显示!下面看下实现代码!
1.wxml代码结构
<view class='wrap'> <view> <view class='date-show'> <view class='lt-arrow' bindtap='lastMonth'> <image src='../images/nextMonth.png' mode='aspectFit'></image> </view> {{year}}年{{month}}月 <view class='rt-arrow' bindtap='nextMonth'> <image src='../images/nextMonth.png' mode='aspectFit'></image> </view> </view> </view> <view class='header'> <view wx:for='{{date}}' class='{{(index == todayIndex) && isTodayWeek ? "weekMark" : ""}}'>{{item}}<view></view></view> </view> <view class='date-box'> <view wx:for='{{dateArr}}' class='{{isToday == item.isToday ? "nowDay" : ""}}' data-date='{{item.isToday}}'> <view class='date-head'> <view>{{item.dateNum}}</view> </view> <view class='date-weight'>{{item.weight}}</view> </view> </view> </view>2.wxss代码结构
.date-show{ position: relative; width: 250rpx; font-family: PingFang-SC-Regular; font-size: 40rpx; color: #282828; text-align: center; margin: 59rpx auto 10rpx; } .lt-arrow,.rt-arrow{ position: absolute; top: 1rpx; width: 60rpx; height: 60rpx; } .lt-arrow image,.rt-arrow image{ width: 14rpx; height: 26rpx; } .lt-arrow{ left: -110rpx; transform: rotate(180deg); } .rt-arrow{ right: -100rpx; } .header{ font-size: 0; padding: 0 24rpx; } .header>view{ display: inline-block; width: 14.285%; color: #333; font-size: 30rpx; text-align: center; border-bottom: 1px solid #D0D0D0; padding: 39rpx 0; } .weekMark{ position: relative; } .weekMark view{ position: absolute; bottom: 0; left: 0; width: 100%; border-bottom: 1px solid #22A7F6; } .date-box{ font-size: 0; padding: 10rpx 0; } .date-box>view{ position: relative; display: inline-block; width: 14.285%; color: #020202; font-size: 40rpx; text-align: center; vertical-align: middle; margin: 15rpx 0; } .date-head{ height: 60rpx; line-height: 60rpx; font-size: 26rpx; } .nowDay .date-head{ width: 60rpx; border-radius: 50%; text-align: center; color: #fff; background-color: #22A7F6; margin: 0 auto; } .date-weight{ font-size: 22rpx; padding: 15rpx 0; } .nowDay .date-weight{ color: #22A7F6; } .one{ position: absolute; bottom: 0; right: 5rpx; width: 20rpx; height: 20rpx; border-radius: 50%; background-color: red; } .two{ position: absolute; bottom: 30rpx; right: 5rpx; width: 20rpx; height: 20rpx; border-radius: 50%; background-color: blue; }index.js
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例为大家分享了Java打印指定年月日历的具体代码,供大家参考,具体内容如下日历如下:程序如下://打印指定年月的日历publicclassPrintCal
本文实例为大家分享了JavaScript实现简单日历效果的具体代码,供大家参考,具体内容如下实现效果:根据所选择的年月,列出当月对应是周几,效果图如下:实现思路
微信小程序日历选择器插件点击日历日期可以获取到年月日,具体内容如下wxml《{{cur_year||"--"}}年{{cur_month||"--"}}月》{{
本文实例为大家分享了java实现打印日历的具体代码,供大家参考,具体内容如下效果图代码:/***需要实现的目标:根据输入的年月打印出本月的日历表*说明:1900
一、简介编写一个会动的日历,日历上面有年月日,周几,时分秒,效果如下:年月日,周几,时分秒都会随着系统时间的走动而改变二、代码Document*{margin: