<view class="global-card time-range" style='margin-bottom:0;'>
    <view class='left' bindtap="openActionSheet">
        <view class="iconfont icon-rili1">{{language['时间范围']||'时间范围'}}</view>
        <view class="{{per.query(dateTypes,dateType) ? 'blue dateType' : 'dateType'}}">
            {{language[dateType]||dateType||language['自选']||'自选'}}
        </view>
    </view>
    <view class="right" bindtap="openTimePicker">
        <view class="default" wx:if="{{ dateType=='全部' }}">{{language['选择时区']||'选择时区'}}</view>
        <view wx:else class="range">
            {{begdate}}
            <view class="middle">至</view>
            {{enddate}}
        </view>
        <view class="iconfont icon-xiangxiazhankai" />
    </view>
</view>
<van-action-sheet show="{{ showTimePicker }}" bind:click-overlay='cancelWhereType'>
    <view class="detePickerHeader">
        <text catchtap="cancelWhereType">{{language['取消']||'取消'}}</text>
        <view class="type" catchtap="changeDateType">
            <view class="option {{whereType.value=='begdate'?'active-op':''}}" data-name="begdate">
                <view data-name="begdate">{{language['开始']||'开始'}}</view>
                <view data-name="begdate" class="time">
                    {{whereType.begdate||language['开始时间']||'开始时间'}}
                </view>
            </view>
            <view class="option {{whereType.value=='enddate'?'active-op':''}}" data-name="enddate">
                <view data-name="enddate">{{language['结束']||'结束'}}</view>
                <view data-name="enddate" class="time">
                    {{whereType.enddate||language['结束时间']||'结束时间'}}
                </view>
            </view>
        </view>
        <text catchtap="confirmTimePicker">{{language['确定']||'确定'}}</text>
    </view>
    <block wx:if="{{showTimePicker}}">
        <van-datetime-picker wx:if="{{whereType.value=='begdate'}}" show-toolbar='{{false}}' type="year-month" value="{{  whereType.begTimestamp }}" data-name='begdate' bind:input="datetimeOnInput" />
        <van-datetime-picker wx:else show-toolbar='{{false}}' type="year-month" value="{{ whereType.endTimestamp ||  whereType.begTimestamp }}" minDate='{{whereType.begTimestamp}}' data-name='enddate' bind:input="datetimeOnInput" />
    </block>
</van-action-sheet>
<van-action-sheet show="{{  actionShow }}" actions="{{ actions }}" bind:select='onSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />
<wxs src='../../../utils/wxmlQueryPer.wxs' module="per" />