StoreHeader.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <div id="nav_fragment">
  3. <div class="container">
  4. <div class="row" style="height: 120px; padding-top: 30px; margin: 0;">
  5. <!-- 店铺信息以及下拉菜单 -->
  6. <div id = "shop" :class="{ 'drop-down-active' : isOpen }" @mouseleave="closeDropDown()">
  7. <div class="dropdown">
  8. <div style="width: 440px;">
  9. <div class="dropdown-btn" style="margin-top: 0;">
  10. <div style="margin-bottom: 15px;">
  11. <a role="button" class="dropdown-toggle" @mouseover="openDropDown()">
  12. <span class="shop-name" v-text="storeInfo.storeName || '店铺名称'"></span>
  13. <span><i class="fa fa-angle-down fa-fw" style="font-size: 20px;"></i></span>
  14. </a>
  15. </div>
  16. <div class="icon-style">
  17. <button class="btn btn-xs btn-danger btn-nav" v-if="!isFocus"><span class="watch">关注</span></button>
  18. <button class="btn btn-xs btn-default btn-nav" v-if="isFocus" style="width:50px"><span>已关注</span></button>
  19. <span v-if="storeInfo.type == 'ORIGINAL_FACTORY'">&nbsp;<img src="/images/store/icon/icon-factory.png"/></span>
  20. <span v-else-if="storeInfo.type == 'AGENCY'">&nbsp;<img src="/images/store/icon/icon-agent.png"/></span>
  21. <span v-else-if="storeInfo.type == 'DISTRIBUTION'">&nbsp;<img src="/images/store/icon/icon-distribution.png"/></span>
  22. <span v-else-if="storeInfo.type == 'CONSIGNMENT'">&nbsp;<img src="/images/store/icon/consignment.png"/></span>
  23. </div>
  24. </div>
  25. <div class="clearfix"></div>
  26. </div>
  27. <div style="background: #FFFFFF;" v-if="isOpen">
  28. <ul class = "shop-contact list-unstyled" style="padding: 15px 0; margin-bottom: 0; border-top: #e8e8e8 1px solid; margin-top: 20px;">
  29. <li ng-if="storeInfo.enterprise.enTel.length > 0">
  30. <span>电话:</span><span v-text="storeInfo.enterprise.enTel"></span>
  31. </li>
  32. <li ng-if="storeInfo.enterprise.enFax.length > 0">
  33. <span>传真:</span><span v-text="storeInfo.enterprise.enFax"></span>
  34. </li>
  35. <li ng-if="storeInfo.enterprise.enAddress.length > 0">
  36. <span>地址:</span><span v-text="storeInfo.enterprise.enAddress"></span>
  37. </li>
  38. <li class="text-right">
  39. <nuxt-link :to="{ name: 'store-uuid-description', params: { uuid: storeInfo.uuid } }">了解更多&gt;</nuxt-link>
  40. </li>
  41. </ul>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- 搜索框 -->
  46. <div id="search-group" style="margin-left: 450px;">
  47. <search-box/>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import SearchBox from '~components/main/Search.vue'
  55. export default {
  56. name: 'store-header',
  57. data () {
  58. return {
  59. isFocus: false,
  60. isOpen: false
  61. }
  62. },
  63. computed: {
  64. storeInfo () {
  65. return this.$store.state.shop.storeInfo.store.data
  66. }
  67. },
  68. components: {
  69. SearchBox
  70. },
  71. methods: {
  72. closeDropDown () {
  73. this.isOpen = false
  74. },
  75. openDropDown () {
  76. this.isOpen = true
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped>
  82. body{
  83. font-family: "Microsoft Yahei", "微软雅黑";
  84. }
  85. #nav_fragment {
  86. margin-bottom: 20px;
  87. }
  88. #nav_fragment .shop-name {
  89. font-size: 24px;
  90. color: RGB(50,50,50);
  91. }
  92. #nav_fragment div#shop {
  93. width: 440px;
  94. padding: 5px;
  95. }
  96. #nav_fragment .shop-info {
  97. font-size: 12px;
  98. color: rgb(50,50,50);
  99. }
  100. #nav_fragment .shop-data {
  101. font-size: 12px;
  102. line-height: 25px;
  103. font-weight: 600;
  104. color: RGB(255,0,0);
  105. }
  106. #nav_fragment .btn-nav{
  107. width: 40px;
  108. height: 20px;
  109. line-height: 14px;
  110. padding: 0;
  111. }
  112. #nav_fragment .btn-nav .watch {
  113. font-size: 12px;
  114. color: white;
  115. }
  116. #nav_fragment .btn-nav .message {
  117. font-size: 12px;
  118. color: rgb(50,50,50);
  119. }
  120. #nav_fragment div.dropdown {
  121. margin-top: -5px;
  122. padding: 5px;
  123. }
  124. #nav_fragment .shop-contact {
  125. font-size: 14px;
  126. color: rgb(120,120,120);
  127. line-height: 25px;
  128. }
  129. #nav_fragment .shop-contact a{
  130. color: rgb(33,71,151);
  131. }
  132. #nav_fragment #search_input {
  133. height: 40px;
  134. font-size: 16px;
  135. font-family: '微软雅黑';
  136. border: 2px solid #5078cb;
  137. border-top-left-radius: 0px;
  138. border-bottom-left-radius: 0px;
  139. line-height: 40px;
  140. }
  141. #nav_fragment #search_input:focus {
  142. border-color: #5078cb;
  143. outline: 0;
  144. -webkit-box-shadow: none;
  145. box-shadow: none;
  146. }
  147. #nav_fragment #search_btn {
  148. background-color: #5078cb;
  149. color: rgb(255, 255, 255);
  150. font-size: 16px;
  151. width: 78px;
  152. height: 40px;
  153. border: 2px solid #5078cb;
  154. border-radius: 0;
  155. }
  156. #nav_fragment #search_btn_this {
  157. height: 36px;
  158. line-height: 36px;
  159. padding-top: 0px;
  160. padding-bottom: 0px;
  161. font-size: 16px;
  162. font-weight: 600;
  163. color: #5078cb;
  164. background: #fff;
  165. border-radius: 0;
  166. border: 1px #5078cb solid;
  167. }
  168. #nav_fragment .my-cart {
  169. margin-top: 20px;
  170. margin-left: 20px;
  171. }
  172. #nav_fragment .my-cart #my-cart{
  173. font-size: 14px;
  174. color: #5078cb;
  175. }
  176. #nav_fragment .my-cart .badge {
  177. background-color: #ff0000;
  178. position: absolute;
  179. top: -10px;
  180. }
  181. #nav_fragment .list-unstyled {
  182. list-style: none;
  183. }
  184. #nav_fragment a:hover,a:focus {
  185. text-decoration: none;
  186. }
  187. #nav_fragment .row>div {
  188. float: left;
  189. }
  190. #nav_fragment #shop {
  191. width: 100%;
  192. position: absolute;
  193. float: left;
  194. }
  195. #nav_fragment #search-group {
  196. padding-top: 20px;
  197. margin-left: 10px;
  198. padding-left: 20px;
  199. top: -12px;
  200. position: relative;
  201. }
  202. #nav_fragment #search-group .input-group {
  203. margin-right: 10px;
  204. float: left;
  205. width: 480px;
  206. }
  207. #nav_fragment .dropdown .dropdown-menu .dropdown-btn {
  208. float: left;
  209. margin-top: 30px;
  210. }
  211. #nav_fragment .dropdown .dropdown-score .description {
  212. padding-top: 10px;
  213. color: #323232;
  214. font-size: 12px;
  215. }
  216. #nav_fragment .dropdown .dropdown-score .score {
  217. display: inline-block;
  218. padding-top: 5px;
  219. color: #FF6868;
  220. font-size: 12px;
  221. }
  222. #nav_fragment .dropdown .dropdown-menu .dropdown-score>div>div {
  223. margin-top: 0px;
  224. width: 25px;
  225. margin-right: 10px;
  226. }
  227. #nav_fragment .shop-score {
  228. margin-top: 20px;
  229. margin-left: 70px;
  230. }
  231. #nav_fragment .shop-score>div>div {
  232. margin-right: 10px;
  233. width: 25px;
  234. }
  235. #nav_fragment .hot-search .active-search-item {
  236. color: #ff0101;
  237. font-size: 13px;
  238. display: inline-block;
  239. margin-right: 1em;
  240. }
  241. #nav_fragment .hot-search .resources {
  242. font-size: 12px;
  243. font-family: "Microsoft Yahei", "微软雅黑";
  244. color: rgb(250,50,50);
  245. }
  246. #nav_fragment .hot-search .hot-word {
  247. font-size: 12px;
  248. color: rgb(50,50,50);
  249. margin-left: 20px;
  250. }
  251. #nav_fragment .drop-down-active {
  252. z-index: 20;
  253. -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 2px rgba(210,209,209,.9);
  254. box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 2px rgba(210,209,209,.9);
  255. border: #f5f5f5 1px solid;
  256. background-color: white;
  257. transition: dispaly .5s ease;
  258. }
  259. .hot-search{
  260. margin-top: 5px;
  261. }
  262. .hot-search .static{
  263. color: #f00;
  264. }
  265. .hot-search a{
  266. color: #838383;
  267. }
  268. .hot-search a:hover{
  269. color: #f00;
  270. }
  271. .my-cart .btn{
  272. top: -8px;
  273. position: relative;
  274. }
  275. #search-group .association {
  276. position: absolute;
  277. left: 0;
  278. top: 100%;
  279. right: 61px;
  280. list-style: none;
  281. -webkit-padding-start: 0;
  282. background: #ffffff;
  283. border: 1px solid #dddddd;
  284. z-index: 21;
  285. }
  286. #search-group .association li {
  287. padding: 0 15px;
  288. line-height: 30px;
  289. text-align: left;
  290. font-family: "Microsoft Yahei";
  291. }
  292. #search-group .association li:hover {
  293. background: #EEEEEE;
  294. cursor: pointer;
  295. }
  296. .text-right{
  297. text-align: right;
  298. }
  299. .text-right a:hover{
  300. color: #d32526 !important;
  301. text-decoration: underline;
  302. }
  303. .icon-style img{
  304. vertical-align: top;
  305. position: relative;
  306. top: -9px;
  307. }
  308. </style>