// components/house-item/house-item.js
import loginFn from '../../../utils/login'
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    imglist: Array,
    vrLink: String,
    isAgency: Boolean,
    avatar: String

  },

  /**
   * 组件的初始数据
   */
  data: {
    currentIndex: 0,
    preIndex: 1,

  },

  /**
   * 组件的方法列表
   */
  methods: {
    swiperchange(e) {
      this.setData({
        preIndex: e.detail.current + 1
      })
    },
    HandleImgClick(e) {

    },
    onlineWatch() {
      this.triggerEvent('onlineWatch')
    },
    toVrHouse() {
      this.triggerEvent('toVrHouse')
    },
    getPhoneNumber(e) {
      this.triggerEvent('toVrHouse')

      loginFn(e, app.globalData.user_code, this.properties.isAgency ? true : false).then(res => {

        this.setData({
          loginStatus: app.globalData.token ? true : false,
          userinfo: app.globalData.userinfo,
        })
        // this.getHouseFocusStatus().then(res => {
        //   if (!res) {
        //     this.changeFocusStatus()
        //   }
        // })
      })
    }
  }
})