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

Component({
  behaviors: [],
  properties: {},
  data: {
    UserInfo: app.globalData.UserInfo,
    TopNavList: [{
      value: '楼盘展示',
      icon: '/assets/images/icon5.png',
      remark: '银城在售全部楼盘'
    }, {
      value: '购房工具',
      icon: '/assets/images/icon6.png',
      remark: '查公积金、算房贷、看政策'
    }, {
      value: '电话咨询',
      icon: '/assets/images/icon7.png',
      remark: '24小时电话客服热线：025-12345678'
    }],
    EstateList: [{
      Name: '示例数据',
      CreateDate: '19-02-02',
      Img: '/assets/images/img1.jpg',
      Org: '悦见山'
    }, {
      Name: '示例数据',
      CreateDate: '19-02-02',
      Img: '/assets/images/img1.jpg',
      Org: '悦见山'
    }, {
      Name: '示例数据',
      CreateDate: '19-02-02',
      Img: '/assets/images/img1.jpg',
      Org: '悦见山'
    }]
  },
  lifetimes: {},
  ready: function() {
    wx.setNavigationBarTitle({
      title: '银城地产·江北公司'
    })
  },
  pageLifetimes: {
    show: function() {},
  },
  methods: {
    TopNavTap(e) { // topnav点击事件
      if (e.target.dataset.type === 0) { // 楼盘展示
        this.triggerEvent('myevent', {
          index: 1
        })
      } else if (e.target.dataset.type === 1) { // 购房工具
        wx.navigateTo({
          url: '/pages/SelfServiceTool/index'
        })
      } else if (e.target.dataset.type === 2) { // 电话咨询
        wx.makePhoneCall({
          phoneNumber: '025-12345678'
        })
      }
    }
  }
})