AccountCenterHeader.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <header class="header">
  3. <nav class="navbar">
  4. <div class="navbar-container container">
  5. <div class="navbar-header">
  6. <a href="http://www.ubtob.com" class="item navbar-link">
  7. <img :src="loginStyle.logoUrl" class="navbar-logo">
  8. </a>
  9. <a href=""><span class="navbar-slogan">账号中心</span></a>
  10. </div>
  11. </div>
  12. </nav>
  13. </header>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'AccountCenterHeader',
  18. data () {
  19. return {}
  20. },
  21. computed: {
  22. loginStyle () {
  23. console.log('3333', this.$store.state.login.loginStyle.data)
  24. return this.$store.state.login.loginStyle.data.content
  25. }
  26. // user () {
  27. // return this.$store.state.option.user
  28. // },
  29. // enterprise () {
  30. // let ens = this.user.data.enterprises
  31. // if (ens && ens.length) {
  32. // return ens.find(item => item.current) || {enName: '个人账户'}
  33. // } else {
  34. // return {enName: '个人账户'}
  35. // }
  36. // },
  37. // sortEnterprises () {
  38. // let ens = this.user.data.enterprises
  39. // if (ens && ens.length) {
  40. // ens.sort(function (a, b) {
  41. // return b.lastLoginTime - a.lastLoginTime
  42. // })
  43. // }
  44. // return ens
  45. // },
  46. // url () {
  47. // return this.$store.state.option.url
  48. // }
  49. },
  50. methods: {
  51. // logout () {
  52. // this.$http.get('/logout/crossBefore').then(response => {
  53. // if (response.data) {
  54. // window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  55. // }
  56. // })
  57. // },
  58. // onLoginClick () {
  59. // this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
  60. // if (response.data) {
  61. // window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  62. // }
  63. // })
  64. // },
  65. // onRegisterClick () {
  66. // this.$http.get('/register/page').then(response => {
  67. // if (response.data) {
  68. // window.location.href = response.data.content
  69. // }
  70. // })
  71. // },
  72. // // 切换当前企业
  73. // switchEnterprise (en) {
  74. // this.showEnterpriseToggle = false
  75. // this.$http.get(`/user/authentication/${en.uu}`).then(() => {
  76. // this.$store.dispatch('loadUserInfo')
  77. // window.location.href = '/'
  78. // })
  79. // },
  80. // toVendor: function () {
  81. // let isSelf = true
  82. // let tempEnterprise = {}
  83. // let ens = this.user.data.enterprises
  84. // if (ens && ens.length) {
  85. // ens.forEach(function (item) {
  86. // if (item.current) {
  87. // isSelf = false
  88. // tempEnterprise = item
  89. // }
  90. // })
  91. // } else {
  92. // isSelf = true
  93. // }
  94. // if (isSelf) {
  95. // window.location.href = '/register-saler'
  96. // } else {
  97. // if (tempEnterprise.isVendor === 313) {
  98. // window.location.href = '/vendor#/index'
  99. // } else {
  100. // window.location.href = '/register-saler'
  101. // }
  102. // }
  103. // }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. @import '~assets/scss/mixins';
  109. @import '~assets/scss/variables';
  110. $nav-height: 60px;
  111. $nav-boxshadow: 2px 2px 5px rgba(0,0,0,.12);
  112. $nav-color: #3c3c3c;
  113. .header .navbar{
  114. min-height: inherit;
  115. border-radius: 0;
  116. }
  117. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
  118. font-size: 12px;
  119. }
  120. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
  121. width: 100%;
  122. display: inline-block;
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. white-space: nowrap;
  126. height: 25px;
  127. }
  128. .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
  129. height: 30px;
  130. }
  131. .dropdown-menu>li>a{
  132. padding: 0;
  133. line-height: 30px;
  134. }
  135. .dropdown-menu>li a:hover{
  136. background: none;
  137. text-decoration: underline !important;
  138. }
  139. .header {
  140. height: $nav-height;
  141. .navbar {
  142. width: 100%;
  143. height: 100%;
  144. font-size: $font-size-small;
  145. background-color: $black-light;
  146. box-shadow: $nav-boxshadow;
  147. -o-box-shadow: $nav-boxshadow;
  148. -moz-box-shadow: $nav-boxshadow;
  149. -webkit-box-shadow: $nav-boxshadow;
  150. .navbar-container {
  151. .item-wrap {
  152. display: inline-block;
  153. }
  154. .item {
  155. color: $nav-color;
  156. display: inline-block;
  157. height: $nav-height;
  158. line-height: $nav-height;
  159. }
  160. a {
  161. position: relative;
  162. color: $nav-color;
  163. font-weight: bold;
  164. font-size: 16px;
  165. > span:before{
  166. content: '';
  167. position: absolute;
  168. top: 5px;
  169. left: 16px;
  170. width: 1px;
  171. height: 14px;
  172. background: #bfbfbf;
  173. }
  174. }
  175. .navbar-header {
  176. float: left;
  177. .navbar-logo {
  178. margin-bottom: 2px;
  179. }
  180. .navbar-slogan {
  181. margin-left: $sm-pad;
  182. }
  183. }
  184. .navbar-right {
  185. float: right;
  186. .item {
  187. padding: 0 $pad;
  188. }
  189. .dropdown {
  190. .dropdown-toggle {
  191. line-height: $nav-height;
  192. border-left: 1px solid $black-light;
  193. border-right: 1px solid $black-light;
  194. height: 35px;
  195. a {
  196. margin-left: 15px;
  197. float: right;
  198. &:hover {
  199. color: $red !important;
  200. }
  201. }
  202. &:hover {
  203. border-left: 1px solid #999;
  204. border-right: 1px solid #999;
  205. }
  206. span {
  207. display: inline-block;
  208. max-width: 190px;
  209. overflow: hidden;
  210. text-overflow: ellipsis;
  211. white-space: nowrap;
  212. float: right;
  213. }
  214. }
  215. .menu-item-first {
  216. background: #eee;
  217. padding: 0 12px;
  218. line-height: 30px;
  219. font-size: 12px;
  220. >span:nth-child(1) {
  221. cursor: default;
  222. font-weight: bold;
  223. }
  224. input {
  225. width: 174px;
  226. height: 24px;
  227. margin-left: 35px;
  228. background: #fff;
  229. border: 1px solid #5078cb;
  230. padding-left: 4px;
  231. }
  232. .search-enterprise {
  233. display: inline-block;
  234. width: 36px;
  235. height: 24px;
  236. color: #fff;
  237. background: #5078cb;
  238. text-align: center;
  239. line-height: 24px;
  240. cursor: pointer;
  241. }
  242. }
  243. .dropdown-menu {
  244. padding: 0 6px 13px;
  245. margin:0;
  246. border-radius: 0;
  247. right: unset;
  248. background: #fff;
  249. border: 1px solid #999999;
  250. border-top: none;
  251. -webkit-box-shadow: none;
  252. -moz-box-shadow: none;
  253. box-shadow: none;
  254. ::-webkit-scrollbar {
  255. background: #f6f6f6;
  256. }
  257. ul {
  258. max-height: 300px;
  259. overflow-y: auto;
  260. background: #f6f6f6;
  261. }
  262. .menu-item {
  263. padding: 0 12px;
  264. a {
  265. color: #333;
  266. max-width: 300px;
  267. line-height: 30px;
  268. width: auto;
  269. &:hover {
  270. color: #5078cb;
  271. text-decoration: none!important;
  272. }
  273. }
  274. }
  275. }
  276. &:hover {
  277. background-color: $white;
  278. .dropdown-toggle {
  279. color: $text;
  280. }
  281. a {
  282. color: $text
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }
  289. }
  290. </style>