// 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 () { wx.setStorageSync('isComponent', true) }, detached: function () { // 清理工作 wx.setStorageSync('isComponent', false) }, methods: { //返回 clickBack(){ var pages = getCurrentPages() if (pages.length >= 2) { // if(pages[pages.length-2].route == "pageIndex/mine/mine" && pages[pages.length-1].route == "pages/login/login"){ // // if(pages.length == 2){ // // wx.switchTab({ // // url: '/pageIndex/index/index' // // }); // // }else{ // wx.navigateBack({ // delta: 2 // }) // // } // }else{ wx.navigateBack() // } } else { wx.switchTab({ url: '/pageIndex/index/index' }); } }, // 胶囊--首页 clickHome() { wx.switchTab({ url: "/pageIndex/index/index" }); }, }, })