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

Page({
  data: {
    UserInfo: app.globalData.UserInfo,
    NavList: [{ // navlist数据
      value: '首页',
      icon: '/assets/images/icon1.png'
    }, {
      value: '楼盘',
      icon: '/assets/images/icon2.png'
    }, {
      value: '福利',
      icon: '/assets/images/icon3.png'
    }, {
      value: '我的',
      icon: '/assets/images/icon4.png'
    }],
    ScreenBottomHeight: app.globalData.ScreenBottomHeight,
    NavActiveIndex: 0 // nav焦点索引值
  },
  TriggerCutNav(e) {
    this.DealNavCut(e.detail.index)
  },
  DealNavCut(index) {
    if (index === 0) {
      wx.setNavigationBarTitle({
        title: '银城地产·江北公司'
      })
    } else if (index === 1) {
      wx.setNavigationBarTitle({
        title: '银城地产·江北公司'
      })
    } else if (index === 2) {
      wx.setNavigationBarTitle({
        title: '项目动态'
      })
    } else if (index === 3) {
      wx.setNavigationBarTitle({
        title: '我的'
      })
    }
    this.setData({
      NavActiveIndex: index
    })
  },
  CutNav(e) { // 切换Nav
    if (e.target.dataset.index !== undefined) {
      this.DealNavCut(e.target.dataset.index)
    }
  }
})