<template>
  <bml-cell link :title="title" :footer="value" @click="select()">
  </bml-cell>
</template>

<script>
    import bmlCell from './bml-cell.vue';
    const picker = weex.requireModule('picker')
    module.exports = {
        name: 'bml-time-picker',
        components: {bmlCell},
        props: {
            title: {
                type: String
            },
            // 是否可选
            disabled: {
                type: Boolean,
                default: false
            },
            value: {
                type: String
            }
        },
        data () {
            return {
            }
        },
        created () {
        },
        methods: {
          //点击筛选操作
          select(){
              if(this.disabled) return;
              let that = this
              let config = {}
              if(this.value){
                config.value = this.value
              }

              picker.pickTime(config,event => {
                  if(event.result==='success'){
                    this.value = event.data
                    this.$emit("input", this.value);
                    this.$emit("change", this.value);
                  }
              })
          }
        }
    }
</script>

<style lang="scss" src="../css/picker.scss"/>