// components/navBar/navBar.js
const app = getApp()
Component({
  properties: {
    title: {
      type: String,
      value: '跨境电商专利小助手'
    },
    control: {
        type: Boolean,
        value: true,
    },
    bgcolor: {
        type: String,
        value: "",
    },
    color: {
        type: String,
        value: "",
    }
  },
  data: {
    opacity: 0,
    navBarHeight: app.globalData.navBarHeight,
    menuRight: app.globalData.menuRight,
    menuTop: app.globalData.menuTop,
    menuHeight: app.globalData.menuHeight,
    menuWidth: app.globalData.menuWidth,
  },
  attached: function () {
 
  },
  methods: {
    //返回
    clickBack(){
      var pages = getCurrentPages()
      if (pages.length >= 2) {
          wx.navigateBack()
      } else {
          wx.switchTab({
              url: pages[0].route
          });
      }
  },
  // 胶囊--首页
   clickHome() {
      wx.switchTab({
          url: "/pages/index/index"
      });
  }

 
  }
})