AccountCenterHeader.vue 6.8 KB

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