|
@@ -43,9 +43,9 @@ function Message() {
|
|
|
var headerNavMini = {
|
|
|
headerNav: $('#public-nav'),
|
|
|
headerNavPlaceholder: $('#header-nav-mini-placeholder'),
|
|
|
+ headerNavSecond: $('#pc-header-nav-second'),
|
|
|
headerHeight: $('#public-nav').height(),
|
|
|
init: function () {
|
|
|
- this.initStyle()
|
|
|
this.initEvents()
|
|
|
},
|
|
|
initStyle: function () {},
|
|
@@ -57,6 +57,26 @@ var headerNavMini = {
|
|
|
this.headerNavPlaceholder.hide()
|
|
|
}
|
|
|
},
|
|
|
+ // 登陆前不展示。登陆后工作台外的页面顶部统一展示(除了首页)
|
|
|
+ secondHeaderShow: function (login) {
|
|
|
+ if (!login) return
|
|
|
+ // exclude中的页面不会显示第二个头部
|
|
|
+ var pathname = location.pathname
|
|
|
+ var excludeReg = [
|
|
|
+ /^\/$/, // 首页
|
|
|
+ // new RegExp('/brand/index'),
|
|
|
+ ]
|
|
|
+ var findTarget = false
|
|
|
+ for (var i = 0; i < excludeReg.length; i++) {
|
|
|
+ if (excludeReg[i].test(pathname)) {
|
|
|
+ findTarget = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!findTarget) {
|
|
|
+ this.headerNavSecond.show()
|
|
|
+ }
|
|
|
+ },
|
|
|
initEvents: function () {
|
|
|
this.initLoginButtonEvent()
|
|
|
this.initHeaderNavMenuEvents()
|
|
@@ -127,6 +147,9 @@ var headerNavMini = {
|
|
|
$('.login-register-button').show()
|
|
|
$('.go-to-workspace').hide()
|
|
|
}
|
|
|
+ this.initStyle()
|
|
|
+ this.changeHeaderPlaceholder(true)
|
|
|
+ this.secondHeaderShow(login)
|
|
|
},
|
|
|
changeMenuActive: function (name) {
|
|
|
this.headerNav.find('[name='+name+']').addClass('active')
|
|
@@ -142,7 +165,7 @@ $(function () {
|
|
|
})
|
|
|
|
|
|
headerNavMini.checkLogin(false)
|
|
|
-function loginCallback () {
|
|
|
+function loginCallbackHeader (data) {
|
|
|
headerNavMini.checkLogin(loginflag)
|
|
|
window.message = new Message()
|
|
|
try {
|