StoreHeader.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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/home/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. }
  111. #nav_fragment .btn-nav .watch {
  112. font-size: 12px;
  113. color: white;
  114. }
  115. #nav_fragment .btn-nav .message {
  116. font-size: 12px;
  117. color: rgb(50,50,50);
  118. }
  119. #nav_fragment div.dropdown {
  120. margin-top: -5px;
  121. padding: 5px;
  122. }
  123. #nav_fragment .shop-contact {
  124. font-size: 14px;
  125. color: rgb(120,120,120);
  126. line-height: 25px;
  127. }
  128. #nav_fragment .shop-contact a{
  129. color: rgb(33,71,151);
  130. }
  131. #nav_fragment #search_input {
  132. height: 40px;
  133. font-size: 16px;
  134. font-family: '微软雅黑';
  135. border: 2px solid #5078cb;
  136. border-top-left-radius: 0px;
  137. border-bottom-left-radius: 0px;
  138. line-height: 40px;
  139. }
  140. #nav_fragment #search_input:focus {
  141. border-color: #5078cb;
  142. outline: 0;
  143. -webkit-box-shadow: none;
  144. box-shadow: none;
  145. }
  146. #nav_fragment #search_btn {
  147. background-color: #5078cb;
  148. color: rgb(255, 255, 255);
  149. font-size: 16px;
  150. width: 78px;
  151. height: 40px;
  152. border: 2px solid #5078cb;
  153. border-radius: 0;
  154. }
  155. #nav_fragment #search_btn_this {
  156. height: 36px;
  157. line-height: 36px;
  158. padding-top: 0px;
  159. padding-bottom: 0px;
  160. font-size: 16px;
  161. font-weight: 600;
  162. color: #5078cb;
  163. background: #fff;
  164. border-radius: 0;
  165. border: 1px #5078cb solid;
  166. }
  167. #nav_fragment .my-cart {
  168. margin-top: 20px;
  169. margin-left: 20px;
  170. }
  171. #nav_fragment .my-cart #my-cart{
  172. font-size: 14px;
  173. color: #5078cb;
  174. }
  175. #nav_fragment .my-cart .badge {
  176. background-color: #ff0000;
  177. position: absolute;
  178. top: -10px;
  179. }
  180. #nav_fragment .list-unstyled {
  181. list-style: none;
  182. }
  183. #nav_fragment a:hover,a:focus {
  184. text-decoration: none;
  185. }
  186. #nav_fragment .row>div {
  187. float: left;
  188. }
  189. #nav_fragment #shop {
  190. width: 100%;
  191. position: absolute;
  192. float: left;
  193. }
  194. #nav_fragment #search-group {
  195. padding-top: 20px;
  196. margin-left: 10px;
  197. padding-left: 20px;
  198. top: -12px;
  199. position: relative;
  200. }
  201. #nav_fragment #search-group .input-group {
  202. margin-right: 10px;
  203. float: left;
  204. width: 480px;
  205. }
  206. #nav_fragment .dropdown .dropdown-menu .dropdown-btn {
  207. float: left;
  208. margin-top: 30px;
  209. }
  210. #nav_fragment .dropdown .dropdown-score .description {
  211. padding-top: 10px;
  212. color: #323232;
  213. font-size: 12px;
  214. }
  215. #nav_fragment .dropdown .dropdown-score .score {
  216. display: inline-block;
  217. padding-top: 5px;
  218. color: #FF6868;
  219. font-size: 12px;
  220. }
  221. #nav_fragment .dropdown .dropdown-menu .dropdown-score>div>div {
  222. margin-top: 0px;
  223. width: 25px;
  224. margin-right: 10px;
  225. }
  226. #nav_fragment .shop-score {
  227. margin-top: 20px;
  228. margin-left: 70px;
  229. }
  230. #nav_fragment .shop-score>div>div {
  231. margin-right: 10px;
  232. width: 25px;
  233. }
  234. #nav_fragment .hot-search .active-search-item {
  235. color: #ff0101;
  236. font-size: 13px;
  237. display: inline-block;
  238. margin-right: 1em;
  239. }
  240. #nav_fragment .hot-search .resources {
  241. font-size: 12px;
  242. font-family: "Microsoft Yahei", "微软雅黑";
  243. color: rgb(250,50,50);
  244. }
  245. #nav_fragment .hot-search .hot-word {
  246. font-size: 12px;
  247. color: rgb(50,50,50);
  248. margin-left: 20px;
  249. }
  250. #nav_fragment .drop-down-active {
  251. z-index: 20;
  252. -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 2px rgba(210,209,209,.9);
  253. box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 2px rgba(210,209,209,.9);
  254. border: #f5f5f5 1px solid;
  255. background-color: white;
  256. transition: dispaly .5s ease;
  257. }
  258. .hot-search{
  259. margin-top: 5px;
  260. }
  261. .hot-search .static{
  262. color: #f00;
  263. }
  264. .hot-search a{
  265. color: #838383;
  266. }
  267. .hot-search a:hover{
  268. color: #f00;
  269. }
  270. .my-cart .btn{
  271. top: -8px;
  272. position: relative;
  273. }
  274. #search-group .association {
  275. position: absolute;
  276. left: 0;
  277. top: 100%;
  278. right: 61px;
  279. list-style: none;
  280. -webkit-padding-start: 0;
  281. background: #ffffff;
  282. border: 1px solid #dddddd;
  283. z-index: 21;
  284. }
  285. #search-group .association li {
  286. padding: 0 15px;
  287. line-height: 30px;
  288. text-align: left;
  289. font-family: "Microsoft Yahei";
  290. }
  291. #search-group .association li:hover {
  292. background: #EEEEEE;
  293. cursor: pointer;
  294. }
  295. .text-right{
  296. text-align: right;
  297. }
  298. .text-right a:hover{
  299. color: #d32526 !important;
  300. text-decoration: underline;
  301. }
  302. .icon-style img{
  303. vertical-align: top;
  304. position: relative;
  305. top: -9px;
  306. }
  307. </style>