国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 熱點 > 微信 > 正文

微信小程序日歷彈窗選擇器代碼實例

2024-07-22 01:18:31
字體:
來源:轉載
供稿:網友

應公司需求,寫了一個彈窗日歷選擇器,感覺用著還不錯,封裝了一下,分享給大家,希望大家有什么意見可以指出來相互交流共同改進!

先上一個效果圖:(當天日期為2018-4-18)

時間改為5月份的效果圖:

直接上代碼:

wxml:

<view class="weui-cells weui-cells_after-title" style='margin-top:100rpx;'> <view class="weui-cell weui-cell_access" hover-class="weui-cell_active" catchtap='showModalBtn'>  <view class="weui-cell__bd">選擇時間</view>  <view class="weui-cell__ft weui-cell__ft_in-access">{{chooseDate}}</view> </view></view> <view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" hidden="{{showModal}}"></view><view class="modal-dialog" hidden="{{showModal}}"> <view class='modalBox'>  <view class='box'>   <view class='calendarBox'>    <view class='calendarTitle'>     當前月份:     <text style='font-size:46rpx;'>{{thisMonth}}</text> 月    </view>    <block wx:for="{{week}}" wx:key="item">     <view class="week">{{week[index]}}</view>    </block>    <block wx:for="{{weekNum}}" wx:key="item">     <view class="week" style="border-bottom:0;color:transparent">0</view>    </block>    <block wx:for="{{dayList}}" wx:key="item">     <view class='week' style="border-bottom:0;background-color:{{dayIndex>index?'#f1f1f1':(tapThis==index?'#1296db':'')}};color:{{tapThis==index?'white':''}}" catchtap="chooseDate" data-index="{{index}}" data-value="{{item}}">{{item}}</view>    </block>   </view>  </view> </view></view>

wxss:

.modalBox{ width: 100%; font-size: 32rpx;}.box{ margin: 0 auto; width: 630rpx;}.calendarTitle{ /* margin: 0 auto; width: 630rpx; */ width: 100%; height: 80rpx; line-height: 80rpx; text-align: center; border-bottom: 1rpx solid #ddd;}.calendarBox{ /* width: 630rpx; */ width:100%; margin: 0 auto; border:1rpx solid #ddd;}.week{ display: inline-block; width:90rpx; height: 80rpx; text-align: center; line-height: 80rpx; border-bottom: 1rpx solid #ddd;}.dateBtn{ width:100%; height: 80rpx; display: flex; justify-content: space-between; margin-top: 20rpx; } .dateBtn>button{ width: 45%; height: 100%; display:flex; justify-content: center; align-items: center; margin: 0; font-size: 36rpx;} /* 模態框 */  .modal-mask {  width: 100%;  height: 100%;  position: fixed;  top: 0;  left: 0;  background: #000;  opacity: 0.5;  overflow: hidden;  z-index: 9000; }  .modal-dialog {  width: 85%;  padding: 100rpx 30rpx 30rpx 30rpx;  overflow: hidden;  position: fixed;  top: 20%;  left: 0;  right: 0;  margin: 0 auto;  z-index: 9999;  background: rgba(255, 255, 255, 1);  border-radius: 5rpx; }             
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沐川县| 西贡区| 丹东市| 金山区| 忻城县| 永平县| 黎平县| 乌兰县| 澄迈县| 泸定县| 萨嘎县| 东乡| 南和县| 农安县| 利辛县| 舒城县| 隆化县| 泰兴市| 博爱县| 淮南市| 河西区| 英山县| 诸城市| 闵行区| 双峰县| 东乌珠穆沁旗| 肥东县| 秭归县| 江阴市| 彭阳县| 宣恩县| 墨竹工卡县| 剑河县| 长治市| 招远市| 上虞市| 繁峙县| 龙州县| 台中市| 额济纳旗| 乌拉特中旗|