// components/house-item/house-item.js
var day = require('./../../utils/day.js');
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    room: Object
  },
  options: {
    addGlobalClass: true,
  },
  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    gotoWV(e) {
      let {
        id,
        index,
        roomid
      } = e.currentTarget.dataset
      console.log(id)
      let data = {
        id: id,
        index: index,
        roomId: roomid,
      }
      this.triggerEvent('gotoWV', data)

    },

    covertTime(time) {
      console.log('covertTime', time)
      return day(time).format('DD/MM/YYYY')
    }
    // toDetail () {
    //   getApp().autoSubcrebe && getApp().autoSubcrebe()
    //   getApp().globalData.lastHouse = this.properties.house
    //   console.log(this.properties.house)
    //   wx.navigateTo({
    //     url: `/pages/detail/detail?house_id=${this.properties.house.house_id}`
    //   })
    // }
  }
})