日期时间段选择 - picker之日期选择器

wxml

<view class="page">  
   <!-- 时间段 -->  
    <view class="picker_group">  
      <picker mode="date" value="{{date}}"  end="{{date2}}" bindchange="bindDateChange">  
        <view class="picker">  
          {{date}}  
        </view>  
      </picker>  
      至  
      <picker mode="date" value="{{date2}}" start="{{date}}" end="2050-01-01" bindchange="bindDateChange2">  
        <view class="picker">  
          {{date2}}  
        </view>  
      </picker>        
    </view>  
  </view> 

js

const util = require('../../utils/util.js')

Page({
  data: {
    date: '2018-01-01',//默认起始时间  
    date2: '2018-01-24',//默认结束时间 

  },

  // 时间段选择  
  bindDateChange(e) {
    let that = this;
    console.log(e.detail.value)
    that.setData({
      date: e.detail.value,
    })
  },
  bindDateChange2(e) {
    let that = this;
    that.setData({
      date2: e.detail.value,
    })

  },

wxss

/* 日期选择 */
.picker_group {
  height: 85rpx;
  line-height: 85rpx;
  justify-content: center;
  display: flex;
  align-items: center;
  font-size: 30rpx;
  color: #888;
  border-bottom: 1rpx solid #efefef;

}

.picker_group picker {
  /* background-color: yellow; */
  color: #64bff1;
  height: 55rpx;
  line-height: 55rpx;
  margin: 0 2%;
  padding: 0 2%;
  border: 1rpx solid #64bff1;
  border-radius: 30rpx;
}

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值