<template>
  <div class="day-picker">
    <p @click="onShow">开始选择家庭成员</p>
    <iot-user-list title="我是标题" :params="params" :userList="userList" confirmBtn="确定" :show.sync="show" @confirm="onConfirm"></iot-user-list>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import { IotUserList } from '../../tunas'

export default Vue.extend({
  components: {
    IotUserList
  },
  data() {
    return {
      // 是否显示选择器
      show: false,
      params: {
        source: 'YOUPIN',
        additionJson: JSON.stringify({ 'returnAll': true })
      },
      // userList: [{
      //   familyUserDesc: 'label1',
      //   id: 1
      // },{
      //   familyUserDesc: 'label2',
      //   id: 2
      // },{
      //   familyUserDesc: 'label3',
      //   id: 3
      // }]
      userList: []
    }
  },
  methods: {
    onShow() {
      this.show = true
    },
    onConfirm(val) {
      console.warn('onConfirm', val)
    }
  },
  beforeCreate() {
    window['lib'].mtop.config.subDomain = 'wapa'
  }
})
</script>

<style lang="stylus" scoped>
.del {
  height: 100%;
  width: 50px;
  background: #f00;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
