RegisterCenterHeader.vue 7.0 KB

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