//index.js
//获取应用实例
const app = getApp()

Component({
  behaviors: [],
  properties: {},
  data: {
    UserInfo: app.globalData.UserInfo,
    UserSetList: [{
      value: '个人资料',
      icon: '/assets/images/icon16.png',
      router: ''
    }, {
      value: '我的福利社',
      icon: '/assets/images/icon17.png',
      router: ''
    }, {
      value: '预约记录',
      icon: '/assets/images/icon18.png',
      router: ''
    }, {
      value: '收藏的楼盘',
      icon: '/assets/images/icon19.png',
      router: ''
    }, {
      value: '楼盘展示',
      icon: '/assets/images/icon20.png',
      router: ''
    }, {
      value: '购房工具',
      icon: '/assets/images/icon21.png',
      router: ''
    }, {
      value: '电话咨询',
      icon: '/assets/images/icon22.png',
      router: ''
    }]
  },
  lifetimes: {},
  ready: function() {},
  pageLifetimes: {
    show: function() {},
  },
  methods: {
    ListTap(e) { // 用户选项点击事件
      if (e.target.dataset.type === 0) { // 个人资料
        wx.navigateTo({
          url: '/pages/UserCenter/UserInfo/index'
        })
      } else if (e.target.dataset.type === 1) { // 我的福利社
        this.triggerEvent('myevent', {
          index: 2
        })
      } else if (e.target.dataset.type === 2) { // 预约记录
        wx.navigateTo({
          url: '/pages/AppointmentHistory/index'
        })
      } else if (e.target.dataset.type === 3) { // 收藏的楼盘
        wx.navigateTo({
          url: '/pages/MyCollectEstateList/index'
        })
      } else if (e.target.dataset.type === 4) { // 楼盘展示
        this.triggerEvent('myevent', {
          index: 1
        })
      } else if (e.target.dataset.type === 5) { // 购房工具
        wx.navigateTo({
          url: '/pages/SelfServiceTool/index'
        })
      } else if (e.target.dataset.type === 6) { // 电话咨询

      }
    }
  }
})