<template>
    <div class='offlineLog'>
        <div class='flex f_y_c p10 c-f14 c-border-b'>
            <div style='flex:1' class='flex f_y_c'>
                <div class='bgc-fff c-border lh44 h44 plr15 cbr' @click="show1=true">{{$moment(beginDate).format('YYYY-MM-DD')}}</div>
                <div class='mlr15 c-333'>至</div>
                <div class='bgc-fff c-border lh44 h44 plr15 cbr' @click="show2=true">{{$moment(endDate).format('YYYY-MM-DD')}}</div>
            </div>
            <van-button class='c-border-r-5 w80' type="info" @click="onSearch">搜索</van-button>
        </div>
        <div v-for='(item, index) in list'>
            <div class='c-border-b bgc-fff p10 c-333 c-f14 flex f_y_c'>
                <div style='flex: 1;width:0;' class='mr20'>
                    <div>{{item.time}}</div>
                </div>
                <div>{{item.online}}</div>
            </div>
        </div>
        <van-overlay :show="show1||show2" @click="show1=false,show2 = false" >
            <van-datetime-picker
                class='c-position-a'
                style='bottom:0;width:100%'
                v-show='show1'
                v-model="beginDate"
                type="date"
                title="选择开始日期"
                :min-date="minDate"
                :max-date="maxDate"
            />
            <van-datetime-picker
                class='c-position-a'
                style='bottom:0;width:100%'
                v-show='show2'
                v-model="endDate"
                type="date"
                title="选择截止日期"
                :min-date="minDate"
                :max-date="maxDate"
            />
        </van-overlay>
    </div>
</template>
<script>
export default{
    name: 'offlineLog',
    data(){
        return {
            beginDate: new Date(),
            endDate: new Date(),
            minDate: this.$moment().add(-1,'years').toDate(),
            maxDate: new Date(),
            currentDate: '',
            list: [],
            show1: false,
            show2: false,
        }
    },
    methods:{
        onSearch(){

        },
    },
    created(){
        this.list = [{online:'离线',time:'2020/09/01 10:03:00'},{online:'离线',time:'2020/09/01 10:03:00'}]
    }
}
</script>
<style scoped lang='scss'>
.offlineLog{
    .cbr{
        border-radius: 22px;
    }
}
</style>