PcHeader.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610
  1. <template>
  2. <header>
  3. <div class="topbar com-margin-auto com-flex com-width-1400">
  4. <nuxt-link :to="{ name: 'index' }">
  5. <img
  6. src="@/assets/img/logo.png"
  7. alt="PromoCollection Logo"
  8. id="logo" />
  9. </nuxt-link>
  10. <div class="search-input">
  11. <el-input
  12. v-model="keyword"
  13. placeholder="Search item here"
  14. @focus="focus"
  15. @blur="blur"
  16. @keyup.enter.native="goSearchResultPage">
  17. <i
  18. slot="suffix"
  19. class="el-input__icon el-icon-search"
  20. @click="goSearchResultPage"></i>
  21. </el-input>
  22. <div
  23. v-loading="loading"
  24. class="search-detail flex column stretch"
  25. :style="{ display: showType }">
  26. <div
  27. class="flex-auto flex center stretch no-result"
  28. v-if="
  29. !loading && result.cate.length < 1 && productsList.length < 1
  30. ">
  31. No results found for “{{ keyword }}”
  32. </div>
  33. <div
  34. v-else
  35. class="flex-auto flex stretch"
  36. style="overflow: hidden">
  37. <div class="category-list flex column start stretch">
  38. <p class="autocomplete-title sub">CATEGORIES</p>
  39. <ul class="stretch">
  40. <li
  41. v-for="item in result.firstCate"
  42. :key="item.id"
  43. class="flex column stretch">
  44. <nuxt-link
  45. :to="{
  46. name: 'category-firstCategory',
  47. params: {
  48. firstCategory: item.name
  49. .replace(/\s+/g, '-')
  50. .replace('-&', '')
  51. .toLowerCase(),
  52. },
  53. }">
  54. <p>{{ item.name }}</p>
  55. </nuxt-link>
  56. </li>
  57. <p
  58. v-if="result.subCate.length"
  59. class="autocomplete-title">
  60. SUB CATEGORIES
  61. </p>
  62. <li
  63. v-for="item in result.subCate"
  64. :key="item.id"
  65. class="flex column stretch">
  66. <nuxt-link
  67. v-if="item.lev === 2"
  68. :to="{
  69. name: 'category-firstCategory-secondCategory',
  70. params: {
  71. firstCategory: item.parentName
  72. .replace(/\s+/g, '-')
  73. .replace('-&', '')
  74. .toLowerCase(),
  75. secondCategory: item.name
  76. .replace(/\s+/g, '-')
  77. .replace('-&', '')
  78. .toLowerCase(),
  79. },
  80. }">
  81. <p>{{ item.name }}</p>
  82. </nuxt-link>
  83. <nuxt-link
  84. v-else
  85. :to="{
  86. name: 'category-firstCategory-secondCategory-thirdCategory',
  87. params: {
  88. firstCategory: item.grandName
  89. .replace(/\s+/g, '-')
  90. .replace('-&', '')
  91. .toLowerCase(),
  92. secondCategory: item.parentName
  93. .replace(/\s+/g, '-')
  94. .replace('-&', '')
  95. .toLowerCase(),
  96. thirdCategory: item.name
  97. .replace(/\s+/g, '-')
  98. .replace('-&', '')
  99. .toLowerCase(),
  100. },
  101. }">
  102. <p>{{ item.name }}</p>
  103. </nuxt-link>
  104. </li>
  105. </ul>
  106. </div>
  107. <div class="product-list flex-auto flex column stretch">
  108. <div class="flex between start">
  109. <p class="autocomplete-title">PRODUCTS</p>
  110. <nuxt-link
  111. v-if="result.total"
  112. :to="{
  113. name: 'category-searchResult',
  114. query: { keyword: keyword },
  115. }">
  116. <div class="seeAllResult">
  117. Show all {{ result.total }} Results
  118. </div>
  119. </nuxt-link>
  120. </div>
  121. <ul
  122. class="flex-auto flex column stretch"
  123. style="overflow-y: auto">
  124. <li
  125. v-for="item in productsList"
  126. :key="item.id">
  127. <nuxt-link
  128. :to="{
  129. name: 'product-code',
  130. params: { code: item.product_code },
  131. }">
  132. <img
  133. :src="
  134. item.image && !$mediaRegExp.test(item.image)
  135. ? $OSS_PREFIX + item.image
  136. : $utils.generateResizedImageUrl(item.image, 100)
  137. "
  138. alt="" />
  139. <div class="product-info">
  140. <p style="width:94%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.alias_name || item.product_name }}</p>
  141. <p>{{ item.product_code }}</p>
  142. </div>
  143. </nuxt-link>
  144. </li>
  145. <div
  146. class="no-result"
  147. v-if="!loading && productsList.length < 1">
  148. No results found for “{{ keyword }}”
  149. </div>
  150. </ul>
  151. </div>
  152. </div>
  153. <div class="sth-else">
  154. <span>Can't find what you're looking for?</span>
  155. <nuxt-link
  156. :to="{
  157. name: 'news-newsName',
  158. params: { newsName: 'indent-ideas', id: indentIdeasArticle.id },
  159. hash: '#formTag',
  160. }">
  161. click here
  162. </nuxt-link>
  163. </div>
  164. </div>
  165. </div>
  166. <div
  167. class="topbar-item com-flex"
  168. style="cursor: default"
  169. v-if="email">
  170. <img
  171. src="@/assets/img/help.png"
  172. alt="help" />
  173. <div class="topbar-item-right com-flex-item">
  174. <p style="margin-bottom: 6px">(+44)203 916 5098</p>
  175. <p>info@promocollection.uk</p>
  176. </div>
  177. </div>
  178. <div class="topbar-item com-flex">
  179. <div
  180. class="topbar-item com-flex"
  181. v-if="!email">
  182. <img src="@/assets/img/login.png" />
  183. <div class="topbar-item-right com-flex-item">
  184. <p @click="openDialog">Login</p>
  185. </div>
  186. </div>
  187. <div
  188. class="topbar-item"
  189. v-else>
  190. <el-popover
  191. placement="bottom-end"
  192. width="292"
  193. trigger="click"
  194. ref="userPopover">
  195. <div
  196. slot="reference"
  197. class="topbar-item-right-myAccount">
  198. <!-- <div class="greeting">
  199. Hello {{ $store.state.userInfo.contacts }}
  200. </div> -->
  201. <div class="flex center">
  202. <img src="@/assets/img/login.png" />
  203. <p>Hello, {{ $store.state.userInfo.contacts }}</p>
  204. <span class="el-icon-caret-bottom"></span>
  205. </div>
  206. </div>
  207. <div
  208. class="user-menu-panel flex column center"
  209. @click="closePopoverAndNavigate">
  210. <!-- <div class="greeting">
  211. Hello {{ $store.state.userInfo.contacts }}
  212. </div> -->
  213. <div class="user-menu-wrap">
  214. <div class="user-menu">
  215. <div class="menu-title">Client Portal</div>
  216. <!-- <div class="sub-menu">
  217. <nuxt-link
  218. :to="{
  219. path: '/home/myDetail',
  220. query: { type: 'enquiry' },
  221. }">
  222. <div class="flex">
  223. <div class="icon order"></div>
  224. <div class="sub-title">My Enquires</div>
  225. </div>
  226. </nuxt-link>
  227. </div> -->
  228. <div class="sub-menu">
  229. <nuxt-link
  230. :to="{
  231. path: '/home/myDetail',
  232. query: { type: 'all-orders' },
  233. }">
  234. <div class="flex">
  235. <div class="icon order"></div>
  236. <div class="sub-title">My Orders</div>
  237. </div>
  238. </nuxt-link>
  239. </div>
  240. <div style="height: 4px; width: 1px"></div>
  241. <div class="menu-title">Marketing Resources</div>
  242. <!-- <div class="sub-menu">
  243. <nuxt-link to="/home/video">
  244. <div class="flex">
  245. <div class="icon video"></div>
  246. <div class="sub-title">Videos</div>
  247. </div>
  248. </nuxt-link>
  249. </div> -->
  250. <!-- <div class="sub-menu">
  251. <a
  252. href="https://www.flipsnack.com/promocollection/"
  253. target="_blank">
  254. <div class="flex">
  255. <div class="icon book"></div>
  256. <div class="sub-title">Catalogue</div>
  257. </div>
  258. </a>
  259. </div> -->
  260. <div class="sub-menu">
  261. <nuxt-link to="/media">
  262. <div class="flex">
  263. <div class="icon book"></div>
  264. <div class="sub-title">Media Centre</div>
  265. </div>
  266. </nuxt-link>
  267. </div>
  268. <div class="sub-menu">
  269. <a
  270. href="mailto:Info@promocollection.uk?subject=Sample%20Request">
  271. <div class="flex">
  272. <div class="icon mail"></div>
  273. <div class="sub-title">Sample Request</div>
  274. </div>
  275. </a>
  276. </div>
  277. <div class="sub-menu">
  278. <a
  279. href="mailto:Info@promocollection.uk?subject=Free%20Mockup%20Request">
  280. <div class="flex">
  281. <div class="icon mail"></div>
  282. <div class="sub-title">Mockup Request</div>
  283. </div>
  284. </a>
  285. </div>
  286. <div class="menu-title">
  287. <nuxt-link
  288. :to="{
  289. path: '/home/myDetail',
  290. query: { type: 'profile' },
  291. }">
  292. My Profile
  293. </nuxt-link>
  294. </div>
  295. <div class="menu-title">
  296. <div
  297. class="btn-logout"
  298. @click="logout">
  299. Sign Out
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. </el-popover>
  306. </div>
  307. </div>
  308. </div>
  309. <nav>
  310. <ul class="com-width-1400 com-minwidth-1024 com-margin-auto">
  311. <li class="nav-list">
  312. <div class="nav-list-title">
  313. <span
  314. class="shopProducts"
  315. @click.stop="openShopProduct">
  316. Shop Products
  317. <i
  318. :class="
  319. isShopBlock ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
  320. "></i>
  321. </span>
  322. </div>
  323. <Transition name="category">
  324. <div
  325. class="nav-menu border-radius"
  326. v-show="isShopBlock"
  327. @click="closeAllBlock">
  328. <div class="nav-menu-content">
  329. <div
  330. class="nav-menu-item"
  331. v-for="item1 in categoryList"
  332. :key="item1.id">
  333. <div class="primary-classification">
  334. <nuxt-link
  335. :to="{
  336. name: 'category-firstCategory',
  337. params: {
  338. firstCategory: item1.name
  339. .replace(/\s+/g, '-')
  340. .replace('-&', '')
  341. .toLowerCase(),
  342. },
  343. }">
  344. <div class="menu-item-icon">
  345. <img
  346. :src="
  347. item1.style && !$mediaRegExp.test(item1.style)
  348. ? $OSS_PREFIX + item1.style
  349. : item1.style
  350. "
  351. alt="" />
  352. </div>
  353. <div class="menu-item-title">
  354. {{ item1.name }}
  355. </div>
  356. </nuxt-link>
  357. <div class="menu-separator"></div>
  358. </div>
  359. <div
  360. class="secondary-classification"
  361. v-for="item2 in item1.child"
  362. :key="item2.id">
  363. <nuxt-link
  364. :to="{
  365. name: 'category-firstCategory-secondCategory',
  366. params: {
  367. firstCategory: item1.name
  368. .replace(/\s+/g, '-')
  369. .replace('-&', '')
  370. .toLowerCase(),
  371. secondCategory: item2.name
  372. .replace(/\s+/g, '-')
  373. .replace('-&', '')
  374. .toLowerCase(),
  375. },
  376. }">
  377. {{ item2.name }}
  378. </nuxt-link>
  379. </div>
  380. </div>
  381. </div>
  382. </div>
  383. </Transition>
  384. </li>
  385. <!-- <li class="nav-list">
  386. <div class="nav-list-title">
  387. <span
  388. class="LeadTime"
  389. @click.stop="openLeadTime">
  390. By Lead Time
  391. <i :class="isShopBlock?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
  392. </span>
  393. </div>
  394. <Transition name="leadTime">
  395. <ul
  396. class="leadTime-list border-radius"
  397. v-show="isLeadTimeBlock"
  398. @click="closeAllBlock">
  399. <li
  400. class="leadTime-list-item"
  401. v-for="item in leadTime"
  402. :key="item.id">
  403. <nuxt-link
  404. :to="{ name: 'category', query: { lead_time: item.id } }">
  405. {{ item.name }}
  406. </nuxt-link>
  407. </li>
  408. </ul>
  409. </Transition>
  410. </li>
  411. <li class="nav-list">
  412. <div class="nav-list-title">
  413. <span
  414. class="Budget"
  415. @click.stop="openBudget"
  416. >By Budget
  417. <i :class="isShopBlock?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
  418. </span>
  419. </div>
  420. <Transition name="budge">
  421. <ul
  422. class="budget-list border-radius"
  423. v-show="isBudgetBlock"
  424. @click.stop="closeAllBlock">
  425. <div
  426. class="budget-list-item"
  427. v-for="item in budget"
  428. :key="item.id">
  429. {{ item.name }}
  430. <div class="sub-item-wrap border-radius flex column stretch">
  431. <div class="budget-list-sub-item-title">QTY Needed</div>
  432. <div
  433. class="budget-list-item"
  434. v-for="(v, i2) in qtyList"
  435. :key="`${item.id}-${i2}`">
  436. <nuxt-link
  437. :to="{
  438. name: 'category',
  439. query: { pricetype: item.id, qty: v.value },
  440. }">
  441. {{ v.name }}
  442. </nuxt-link>
  443. </div>
  444. </div>
  445. </div>
  446. </ul>
  447. </Transition>
  448. </li> -->
  449. <li
  450. class="nav-list"
  451. @click="closeAllBlock">
  452. <!-- <a :href="'/category?feature=54'"> New products</a> -->
  453. <div class="nav-list-title">
  454. <nuxt-link
  455. :to="{ name: 'category', query: { feature: 54 } }"
  456. target="_self">
  457. New Products
  458. </nuxt-link>
  459. </div>
  460. </li>
  461. <li
  462. class="nav-list"
  463. @click="closeAllBlock">
  464. <div class="nav-list-title">
  465. <a href="/article/Compliance">
  466. Compliance
  467. </a>
  468. </div>
  469. </li>
  470. <li
  471. class="nav-list"
  472. @click="closeAllBlock">
  473. <div class="nav-list-title">
  474. <nuxt-link
  475. id="indentLink"
  476. :to="{
  477. name: 'news-newsName',
  478. params: { newsName: 'indent-ideas', id: indentIdeasArticle.id },
  479. }"
  480. target="_self">
  481. Bespoke Service
  482. </nuxt-link>
  483. </div>
  484. </li>
  485. <li
  486. class="nav-list"
  487. @click="closeAllBlock">
  488. <div class="nav-list-title">
  489. <nuxt-link
  490. :to="{ name: 'category', query: { feature: 282 } }"
  491. target="_self">
  492. Carbon Footprint
  493. </nuxt-link>
  494. </div>
  495. </li>
  496. <!-- <li
  497. class="nav-list"
  498. @click="closeAllBlock">
  499. <div class="nav-list-title">
  500. <nuxt-link
  501. to="/category/apparel/socks"
  502. target="_self">
  503. Sock Collection
  504. </nuxt-link>
  505. </div>
  506. </li> -->
  507. <!-- <li
  508. class="nav-list compare-list"
  509. @click="closeAllBlock">
  510. <div class="nav-list-title">
  511. <el-badge
  512. :value="compareList.length"
  513. class="item"
  514. v-show="compareList.length">
  515. </el-badge>
  516. <span>Wishlist</span>
  517. </div>
  518. <div class="compare-product">
  519. <div class="compare-product-title">
  520. <p>Product to Compare</p>
  521. <el-button
  522. class="compare-btn"
  523. size="mini"
  524. @click="compareAll">
  525. Compare All
  526. </el-button>
  527. </div>
  528. <div class="red-line"></div>
  529. <div
  530. class="prompt-info"
  531. v-show="!compareList.length">
  532. <ul>
  533. <li>
  534. Select products to compare by clicking the "Compare list +"
  535. batton on any product listing.
  536. </li>
  537. <li>You can compare up to 5 products.</li>
  538. <li>
  539. After selecting products, click on the "Compare All" button to
  540. view the comparison chart.
  541. </li>
  542. </ul>
  543. </div>
  544. <ul>
  545. <li
  546. v-for="item in compareList"
  547. :key="item.id">
  548. <div class="item-left">
  549. <img
  550. :src="
  551. item.main.image &&
  552. item.main.image.indexOf(
  553. 'http://promocollection.s3.ap-southeast-2.amazonaws.com'
  554. ) != -1
  555. ? item.main.image
  556. : 'https://www.promocollection.uk/' +
  557. item.main.image
  558. " />
  559. <p>{{ item.product_name }}</p>
  560. </div>
  561. <div
  562. class="item-right"
  563. @click="clearCompare(item.id)">
  564. <i class="el-icon-error"></i>
  565. </div>
  566. </li>
  567. </ul>
  568. <el-button
  569. class="clear-btn"
  570. size="mini"
  571. @click="clearAll"
  572. v-show="compareList.length">
  573. Clear All
  574. </el-button>
  575. </div>
  576. </li> -->
  577. </ul>
  578. </nav>
  579. <div class="header-redLine"></div>
  580. </header>
  581. </template>
  582. <script>
  583. import { mapMutations } from 'vuex'
  584. import cloneDeep from 'lodash.clonedeep'
  585. import algoliasearch from 'algoliasearch'
  586. export default {
  587. data() {
  588. return {
  589. // loaded: false,
  590. loading: false,
  591. timer: '',
  592. keyword: '',
  593. result: { cate: [], subCate: [], firstCate: [] },
  594. showType: 'none',
  595. matchingList: [],
  596. categoryList: [],
  597. // leadTime: [],
  598. budget: [],
  599. compareList: [],
  600. indentIdeasArticle: {},
  601. complianceArticle: {},
  602. isShopBlock: false,
  603. isLeadTimeBlock: false,
  604. isBudgetBlock: false,
  605. qtyList: [
  606. {
  607. value: 50,
  608. name: 50,
  609. },
  610. {
  611. value: 100,
  612. name: 100,
  613. },
  614. {
  615. value: 250,
  616. name: 250,
  617. },
  618. {
  619. value: 500,
  620. name: 500,
  621. },
  622. {
  623. value: 1000,
  624. name: '1,000',
  625. },
  626. {
  627. value: 2500,
  628. name: '2,500',
  629. },
  630. {
  631. value: 5000,
  632. name: '5,000',
  633. },
  634. {
  635. value: 10000,
  636. name: '10,000',
  637. },
  638. ],
  639. index: null,
  640. }
  641. },
  642. async fetch() {
  643. const p1 = this.$axios.post('/uk-api/common/shopProductList').then(res => {
  644. if (res.code === 1) {
  645. this.categoryList = res.result
  646. }
  647. })
  648. // const p2 = this.$axios.get('/api/home/lead_time').then(res => {
  649. // if (res.code === 1) {
  650. // this.leadTime = res.result.sort((a, b) => a.rank - b.rank)
  651. // }
  652. // })
  653. // const p3 = this.$axios
  654. // .post('/api/common/goodsFilterList', { pid: 2 })
  655. // .then(res => {
  656. // if (res.code === 1) {
  657. // this.budget = res.result
  658. // }
  659. // })
  660. const p4 = this.$axios
  661. .post('/uk-api/home/articleList', { keyword: 'Indent Ideas' })
  662. .then(res => {
  663. this.indentIdeasArticle = res.result.data[0] || {}
  664. })
  665. const p5 = this.$axios
  666. .post('/uk-api/home/articleList', { keyword: 'Compliance' })
  667. .then(res => {
  668. this.complianceArticle = res.result.data[0] || {}
  669. })
  670. // 并联异步操作,总耗时===耗时最长的单个请求。之前的逻辑是串联,总耗时为所有请求耗时的累加
  671. await Promise.all([p1, p4, p5])
  672. },
  673. computed: {
  674. email() {
  675. return this.$store.state.userInfo?.email
  676. },
  677. compareLists() {
  678. return this.$store.state.compareList
  679. },
  680. productsList() {
  681. if (this.result?.goods) {
  682. return this.result.goods.map(item => {
  683. const temp = {
  684. ...item,
  685. }
  686. if (item.img) {
  687. temp.image = !this.$mediaRegExp.test(item.img)
  688. ? this.$OSS_PREFIX + item.img
  689. : item.img
  690. }
  691. return temp
  692. })
  693. } else {
  694. return []
  695. }
  696. },
  697. },
  698. watch: {
  699. keyword: {
  700. handler(newValue, oldValue) {
  701. // if (newValue.length > 2 && this.loaded) {
  702. if (newValue.length > 2) {
  703. this.debounce(this.search, 700)
  704. } else {
  705. setTimeout(() => {
  706. this.showType = 'none'
  707. }, 501)
  708. }
  709. },
  710. deep: true,
  711. },
  712. compareLists: {
  713. handler(newValue, oldValue) {
  714. if (newValue) {
  715. this.compareList = cloneDeep(newValue)
  716. }
  717. },
  718. deep: true,
  719. immediate: true,
  720. },
  721. $route(to, from) {
  722. if (to.path == from.path && to.query.keyword != from.query.keyword) {
  723. location.reload()
  724. }
  725. if (!to.query.keyword) {
  726. this.keyword = ''
  727. }
  728. },
  729. },
  730. created() {},
  731. mounted() {
  732. // if (this.$route.query.keyword && this.$route.query.keyword.length) {
  733. // this.keyword = this.$route.query.keyword
  734. // }
  735. // setTimeout(() => {
  736. // this.loaded = true
  737. // }, 0)
  738. window.addEventListener('click', this.closeLeadtimeAndBudget)
  739. if (process.env.NODE_ENV === 'development') {
  740. const client = algoliasearch(
  741. '7KGEFE6I2Z',
  742. 'e39e202ace0a2fa12ea61095e6ede35d'
  743. )
  744. this.index = client.initIndex('test_uk')
  745. } else {
  746. const client = algoliasearch(
  747. '2340OWI595',
  748. '2d4c53cdcf2bab0c361e589c2c2272fa'
  749. )
  750. this.index = client.initIndex('product_uk')
  751. }
  752. },
  753. beforeDestroy() {
  754. window.removeEventListener('click', this.closeLeadtimeAndBudget)
  755. },
  756. methods: {
  757. ...mapMutations([
  758. 'openDialog',
  759. 'clearUserInfo',
  760. // 'clearCompareList',
  761. ]),
  762. debounce(fn, wait) {
  763. if (this.timer !== null) {
  764. clearTimeout(this.timer)
  765. }
  766. this.timer = setTimeout(fn, wait)
  767. },
  768. search() {
  769. this.result = { cate: [], subCate: [], firstCate: [] }
  770. this.showType = 'flex'
  771. this.loading = true
  772. const key = this.keyword ? this.keyword.trim() : ''
  773. if (this.index) {
  774. this.index
  775. .search(key, {
  776. hitsPerPage: 1000,
  777. })
  778. .then(({ nbHits, hits }) => {
  779. const temp = {
  780. goods: [],
  781. total: nbHits || hits.length || 0,
  782. cate: [],
  783. firstCate: [],
  784. subCate: [],
  785. }
  786. const t1 = []
  787. const t2 = []
  788. hits
  789. .filter(i => i.status === 1 || i.status === '1' || i.status)
  790. .forEach(item => {
  791. let colorImg = ''
  792. item.colour_imgs = JSON.parse(item.colour_imgs)
  793. item.colour_imgs.sort((a, b) => a.name.length - b.name.length)
  794. if (
  795. Array.isArray(item.colour_imgs) &&
  796. item.colour_imgs.length
  797. ) {
  798. item.colour_imgs.forEach(colorItem => {
  799. if (colorItem.name && colorItem.name.length) {
  800. if (
  801. new RegExp(colorItem.name.toLowerCase(), 'i').test(key)
  802. ) {
  803. console.log(
  804. item.product_code,
  805. colorItem.name,
  806. 'replace'
  807. )
  808. colorImg = colorItem.img
  809. } else if (
  810. /\s/.test(colorItem.name) &&
  811. colorItem.name
  812. .split(' ')
  813. .filter(a => a.length > 0)
  814. .some(b => new RegExp(b.toLowerCase(), 'i').test(key))
  815. ) {
  816. console.log(
  817. item.product_code,
  818. colorItem.name,
  819. 'advance replace'
  820. )
  821. colorImg = colorItem.img
  822. }
  823. }
  824. })
  825. item.colour_imgs.forEach(i => {
  826. if (i.name && i.name.length) {
  827. if (key.toLowerCase().includes(i.name.toLowerCase())) {
  828. console.log(
  829. item.product_code,
  830. i.name,
  831. 'complete replace'
  832. )
  833. colorImg = i.img
  834. }
  835. }
  836. })
  837. console.log('---')
  838. }
  839. temp.goods.push({
  840. ...item,
  841. img: colorImg || item.image || item.img,
  842. product_name: item.alias_name || item.product_name || item.name,
  843. })
  844. if (!item.category_id) return
  845. const id = parseInt(item.category_id)
  846. const categoryResult = this.getCategoryFromTree(
  847. id,
  848. this.categoryList
  849. )
  850. switch (categoryResult.lev) {
  851. case 1:
  852. if (!t1.includes(id)) {
  853. t1.push(id)
  854. temp.firstCate.push(categoryResult)
  855. }
  856. break
  857. case 2:
  858. case 3:
  859. if (!t2.includes(id)) {
  860. t2.push(id)
  861. temp.subCate.push(categoryResult)
  862. }
  863. // 当前商品在2 3 级, 搜索出来的分类里面应同时展示1级.
  864. if (!t1.includes(categoryResult.root.id)) {
  865. t1.push(categoryResult.root.id)
  866. temp.firstCate.push(categoryResult.root)
  867. }
  868. // no default
  869. }
  870. })
  871. this.result = temp
  872. })
  873. .finally(() => {
  874. this.loading = false
  875. })
  876. }
  877. },
  878. focus() {
  879. clearTimeout(this.timer)
  880. if (this.keyword) {
  881. this.showType = 'flex'
  882. }
  883. },
  884. blur() {
  885. this.timer = setTimeout(() => {
  886. this.showType = 'none'
  887. }, 200)
  888. },
  889. goSearchResultPage() {
  890. // 匹配同组件的路由更改query时, 页面不会被刷新
  891. // this.$router.push({
  892. // name: 'category-searchResult',
  893. // query: { keyword: this.keyword },
  894. // })
  895. location.href =
  896. location.origin +
  897. `/category/searchResult?keyword=${encodeURIComponent(this.keyword)}`
  898. },
  899. logout() {
  900. this.$store.dispatch('logout').then(() => {
  901. this.$router.push('/')
  902. })
  903. },
  904. compareAll() {
  905. if (this.compareList.length) {
  906. this.$router.push('/home/compareList')
  907. }
  908. },
  909. // clearCompare(id) {
  910. // this.$axios
  911. // .post('/api/home/compare_clear', {
  912. // id,
  913. // compare_keys: 'keys',
  914. // })
  915. // .then(res => {
  916. // if (res.code === 1) {
  917. // this.compareList.splice(
  918. // this.compareList.findIndex(item => item.id === id),
  919. // 1
  920. // )
  921. // }
  922. // })
  923. // },
  924. // clearAll() {
  925. // if (this.compareList.length) {
  926. // this.$axios
  927. // .post('/api/home/compare_clear', {
  928. // id: 0,
  929. // compare_keys: 'keys',
  930. // })
  931. // .then(res => {
  932. // if (res.code === 1) {
  933. // this.clearCompareList()
  934. // }
  935. // })
  936. // }
  937. // },
  938. openShopProduct() {
  939. this.isShopBlock = !this.isShopBlock
  940. this.isLeadTimeBlock = false
  941. this.isBudgetBlock = false
  942. },
  943. // openLeadTime() {
  944. // this.isLeadTimeBlock = !this.isLeadTimeBlock
  945. // this.isShopBlock = false
  946. // this.isBudgetBlock = false
  947. // },
  948. openBudget() {
  949. this.isBudgetBlock = !this.isBudgetBlock
  950. this.isLeadTimeBlock = false
  951. this.isShopBlock = false
  952. },
  953. closeAllBlock() {
  954. this.isShopBlock = false
  955. this.isLeadTimeBlock = false
  956. this.isBudgetBlock = false
  957. },
  958. closeLeadtimeAndBudget(e) {
  959. const className = e.target?.className
  960. if (!['shopProducts', 'LeadTime', 'Budget'].includes(className)) {
  961. this.isShopBlock = false
  962. this.isLeadTimeBlock = false
  963. this.isBudgetBlock = false
  964. }
  965. },
  966. closePopoverAndNavigate() {
  967. this.$refs.userPopover.doClose()
  968. },
  969. // 从分类树数据里面找到对应分类
  970. getCategoryFromTree(id, tree) {
  971. let result = {}
  972. if (!tree.length) return result
  973. tree.forEach(i => {
  974. if (i.id === id) {
  975. result = cloneDeep(i)
  976. result.lev = 1
  977. }
  978. if (!Array.isArray(i.child)) return
  979. i.child.forEach(secondCate => {
  980. if (secondCate.id === id) {
  981. result = cloneDeep(secondCate)
  982. result.parentName = i.name
  983. result.lev = 2
  984. result.root = {
  985. name: i.name,
  986. id: i.id,
  987. pid: 0,
  988. }
  989. }
  990. if (!Array.isArray(secondCate.child)) return
  991. secondCate.child.forEach(thirdCate => {
  992. if (thirdCate.id === id) {
  993. result = cloneDeep(thirdCate)
  994. result.parentName = secondCate.name
  995. result.grandName = i.name
  996. result.lev = 3
  997. result.root = {
  998. name: i.name,
  999. id: i.id,
  1000. pid: 0,
  1001. }
  1002. }
  1003. })
  1004. })
  1005. })
  1006. return result
  1007. },
  1008. },
  1009. }
  1010. </script>
  1011. <style lang="scss" scoped>
  1012. .product-info {width:100%;}
  1013. header {
  1014. width: 100%;
  1015. position: fixed;
  1016. top: 0px;
  1017. left: 0px;
  1018. z-index: 100;
  1019. background-color: #fff;
  1020. .topbar {
  1021. min-width: 800px;
  1022. height: 92px;
  1023. display: flex;
  1024. align-items: center;
  1025. #logo {
  1026. cursor: pointer;
  1027. }
  1028. .search-input {
  1029. flex: 1;
  1030. padding: 0 26px 0 50px;
  1031. position: relative;
  1032. .search-detail {
  1033. z-index: 101;
  1034. padding: 12px 0 8px;
  1035. box-sizing: border-box;
  1036. width: calc(100% - 76px);
  1037. height: 320px;
  1038. position: absolute;
  1039. top: 52px;
  1040. background: #ffffff;
  1041. border: 1px solid #bebebe;
  1042. border-radius: 4px;
  1043. font-size: 12px;
  1044. font-weight: 400;
  1045. color: #333333;
  1046. .autocomplete-title {
  1047. height: 36px;
  1048. line-height: 36px;
  1049. margin-bottom: 8px;
  1050. font-size: 14px;
  1051. font-weight: bold;
  1052. color: #000000;
  1053. }
  1054. .category-list {
  1055. box-sizing: border-box;
  1056. padding: 0 12px;
  1057. height: 100%;
  1058. width: 35%;
  1059. min-width: 35%;
  1060. border-right: 1px solid #7f7f7f;
  1061. position: relative;
  1062. ul {
  1063. overflow-y: auto;
  1064. li {
  1065. width: 100%;
  1066. position: relative;
  1067. p {
  1068. box-sizing: border-box;
  1069. padding: 0 8px;
  1070. width: 100%;
  1071. height: 50px;
  1072. line-height: 50px;
  1073. color: #333;
  1074. font-size: 14px;
  1075. cursor: pointer;
  1076. &:hover {
  1077. background-color: #f5f5f5;
  1078. color: #0b6dc9;
  1079. }
  1080. }
  1081. }
  1082. }
  1083. }
  1084. .product-list {
  1085. padding: 0 16px;
  1086. ul li {
  1087. margin-bottom: 10px;
  1088. a {
  1089. display: flex;
  1090. justify-content: flex-start;
  1091. align-items: center;
  1092. img {
  1093. width: 43px;
  1094. height: 43px;
  1095. }
  1096. p {
  1097. height: 24px;
  1098. line-height: 24px;
  1099. margin-left: 5px;
  1100. }
  1101. }
  1102. &:hover {
  1103. background: #f5f5f5;
  1104. p {
  1105. color: #0b6dc9;
  1106. }
  1107. }
  1108. }
  1109. .seeAllResult {
  1110. text-align: center;
  1111. font-size: 14px;
  1112. font-weight: bold;
  1113. background-color: #00213b;
  1114. color: #fff;
  1115. padding: 0 12px;
  1116. line-height: 26px;
  1117. height: 26px;
  1118. border-radius: 4px;
  1119. }
  1120. }
  1121. .sth-else {
  1122. margin-top: 4px;
  1123. text-align: center;
  1124. height: 24px;
  1125. line-height: 24px;
  1126. font-size: 18px;
  1127. font-weight: 600;
  1128. color: #00213b;
  1129. a {
  1130. display: inline-block;
  1131. padding: 0 6px;
  1132. border-radius: 4px;
  1133. background-color: #00213b;
  1134. color: #fff;
  1135. box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
  1136. }
  1137. a:hover {
  1138. background-color: #000;
  1139. }
  1140. }
  1141. }
  1142. }
  1143. .topbar-item {
  1144. font-weight: bold;
  1145. white-space: nowrap;
  1146. cursor: pointer;
  1147. .topbar-item-right {
  1148. padding: 0 30px 0 12px;
  1149. }
  1150. .topbar-item-right-myAccount {
  1151. // display: flex;
  1152. // align-items: center;
  1153. position: relative;
  1154. p {
  1155. margin-left: 10px;
  1156. }
  1157. .greeting {
  1158. position: absolute;
  1159. top: -20px;
  1160. left: 30px;
  1161. }
  1162. }
  1163. }
  1164. }
  1165. nav {
  1166. background-color: #00213b;
  1167. height: 52px;
  1168. // font-family: ProximaNova-Regular;
  1169. ul {
  1170. display: flex;
  1171. justify-content: space-between;
  1172. align-items: center;
  1173. li.nav-list {
  1174. width: 170px;
  1175. height: 52px;
  1176. font-size: 16px;
  1177. font-weight: 400;
  1178. color: #ffffff;
  1179. text-align: center;
  1180. line-height: 52px;
  1181. .nav-list-title {
  1182. font-weight: 600;
  1183. }
  1184. a {
  1185. display: block;
  1186. width: 100%;
  1187. color: #ffffff;
  1188. }
  1189. span {
  1190. display: inline-block;
  1191. cursor: pointer;
  1192. .el-icon-arrow-up,
  1193. .el-icon-arrow-down {
  1194. margin-left: 5px;
  1195. text-align: center;
  1196. }
  1197. }
  1198. .nav-menu {
  1199. width: 1400px;
  1200. height: 395px;
  1201. color: #fff;
  1202. background-color: RGB(56 54 55);
  1203. overflow: hidden;
  1204. .nav-menu-content {
  1205. box-sizing: border-box;
  1206. padding: 20px 0 0 20px;
  1207. margin: 0 auto;
  1208. display: flex;
  1209. justify-content: space-between;
  1210. .nav-menu-item {
  1211. position: relative;
  1212. width: 130px;
  1213. }
  1214. .primary-classification {
  1215. $width: 85px;
  1216. .menu-item-icon {
  1217. width: $width;
  1218. height: $width;
  1219. img {
  1220. width: 100%;
  1221. height: 100%;
  1222. }
  1223. }
  1224. &:hover {
  1225. .menu-item-title {
  1226. color: #0b6dc9;
  1227. }
  1228. }
  1229. .menu-item-title {
  1230. margin-top: 5px;
  1231. height: 24px;
  1232. font-size: 15px;
  1233. // font-size: 1.1rem;
  1234. font-weight: bold;
  1235. text-align: left;
  1236. line-height: 24px;
  1237. cursor: pointer;
  1238. white-space: normal;
  1239. word-break: keep-all;
  1240. overflow: hidden;
  1241. }
  1242. .menu-separator {
  1243. width: $width;
  1244. height: 1px;
  1245. background-color: #666;
  1246. margin: 12px 0;
  1247. }
  1248. }
  1249. .secondary-classification {
  1250. width: 100%;
  1251. font-size: 13px;
  1252. font-weight: 400;
  1253. line-height: 24px;
  1254. text-align: left;
  1255. cursor: pointer;
  1256. white-space: normal;
  1257. word-break: keep-all;
  1258. overflow: hidden;
  1259. }
  1260. }
  1261. }
  1262. .leadTime-list,
  1263. .budget-list {
  1264. display: flex;
  1265. flex-direction: column;
  1266. justify-content: flex-start;
  1267. color: #fff;
  1268. background-color: RGB(56 54 55);
  1269. text-align: center;
  1270. font-size: 14px;
  1271. width: 171px;
  1272. box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.15);
  1273. .budget-list-item,
  1274. .leadTime-list-item {
  1275. width: 171px;
  1276. height: 40px;
  1277. line-height: 40px;
  1278. min-height: 40px;
  1279. a {
  1280. display: block;
  1281. width: 100%;
  1282. height: 100%;
  1283. }
  1284. }
  1285. }
  1286. .sub-item-wrap {
  1287. display: none;
  1288. z-index: 1;
  1289. background-color: rgb(56 54 55);
  1290. position: absolute;
  1291. top: 0;
  1292. left: 170px;
  1293. .budget-list-item {
  1294. cursor: pointer;
  1295. }
  1296. .budget-list-sub-item-title {
  1297. width: 171px;
  1298. height: 40px;
  1299. line-height: 40px;
  1300. min-height: 40px;
  1301. }
  1302. // color: red;
  1303. }
  1304. .budget-list-item {
  1305. position: relative;
  1306. overflow: visible;
  1307. &:hover {
  1308. .sub-item-wrap {
  1309. display: flex;
  1310. }
  1311. }
  1312. }
  1313. .leadTime-list {
  1314. height: 280px;
  1315. }
  1316. .budget-list {
  1317. height: 360px;
  1318. }
  1319. .compare-product {
  1320. width: 543px;
  1321. background: #fff;
  1322. color: #333333;
  1323. box-shadow: 0px 1px 10px 0px rgba(7, 5, 5, 0.13);
  1324. margin-left: -372px;
  1325. padding: 31px 13px 14px 29px;
  1326. box-sizing: border-box;
  1327. visibility: hidden;
  1328. opacity: 0;
  1329. .compare-product-title {
  1330. display: flex;
  1331. justify-content: space-between;
  1332. align-items: center;
  1333. p {
  1334. font-size: 24px;
  1335. font-weight: bold;
  1336. }
  1337. .compare-btn {
  1338. width: 136px;
  1339. height: 38px;
  1340. background: #00213b;
  1341. border-radius: 4px;
  1342. color: #ffffff;
  1343. font-size: 14px;
  1344. }
  1345. }
  1346. .red-line {
  1347. width: 27px;
  1348. height: 7px;
  1349. background: #e90000;
  1350. }
  1351. .prompt-info {
  1352. font-size: 14px;
  1353. text-align: left;
  1354. line-height: 24px;
  1355. }
  1356. ul {
  1357. display: flex;
  1358. flex-direction: column;
  1359. justify-content: flex-start;
  1360. margin-top: 10px;
  1361. li {
  1362. display: flex;
  1363. justify-content: space-between;
  1364. align-items: center;
  1365. width: 500px;
  1366. .item-left {
  1367. display: flex;
  1368. justify-content: flex-start;
  1369. align-items: center;
  1370. img {
  1371. width: 30px;
  1372. height: 30px;
  1373. margin-right: 10px;
  1374. }
  1375. }
  1376. .el-icon-error {
  1377. color: #e90000;
  1378. font-size: 21px;
  1379. }
  1380. }
  1381. }
  1382. .clear-btn {
  1383. background: #e90000;
  1384. color: #fff;
  1385. font-size: 14px;
  1386. padding: 10px 20px;
  1387. }
  1388. }
  1389. &:hover {
  1390. div.nav-list-title {
  1391. color: #333333;
  1392. background-color: #e3e3e3;
  1393. a {
  1394. color: #333333;
  1395. background-color: #e3e3e3;
  1396. }
  1397. .el-icon-arrow-down {
  1398. color: #333333;
  1399. }
  1400. }
  1401. .compare-product {
  1402. opacity: 1;
  1403. visibility: visible;
  1404. transition: all 0.5s;
  1405. }
  1406. }
  1407. .menu-item-title:hover,
  1408. .secondary-classification:hover a {
  1409. color: #0b6dc9;
  1410. }
  1411. .leadTime-list-item:hover,
  1412. .budget-list-item:hover {
  1413. background: #0b6dc9;
  1414. color: #f5f5f5;
  1415. & > a {
  1416. background: #0b6dc9;
  1417. color: #f5f5f5;
  1418. width: 100%;
  1419. height: 100%;
  1420. }
  1421. }
  1422. }
  1423. }
  1424. }
  1425. :deep(.el-badge.item .el-badge__content) {
  1426. background-color: #e90000;
  1427. }
  1428. .header-redLine {
  1429. height: 4px;
  1430. background: #e90000;
  1431. }
  1432. }
  1433. :deep(.el-input) {
  1434. .el-input__inner {
  1435. border-radius: 18px;
  1436. }
  1437. }
  1438. :deep(.el-menu-item-group__title) {
  1439. padding: 0;
  1440. }
  1441. :deep(.el-submenu__title) {
  1442. font-family: Proxima Nova;
  1443. font-size: 14px;
  1444. color: #333333;
  1445. height: 40px;
  1446. line-height: 40px;
  1447. font-weight: bold;
  1448. &:hover {
  1449. color: #1a72b7;
  1450. }
  1451. }
  1452. :deep(.el-menu-item) {
  1453. font-family: Proxima Nova;
  1454. height: 40px;
  1455. line-height: 40px;
  1456. font-weight: bold;
  1457. color: #333333;
  1458. a {
  1459. display: inline-block;
  1460. width: 100%;
  1461. }
  1462. &:hover a {
  1463. color: #1a72b7;
  1464. }
  1465. }
  1466. :deep(.el-menu-item.is-active) {
  1467. a {
  1468. color: #1a72b7;
  1469. }
  1470. }
  1471. :deep(.el-menu-item-group) {
  1472. font-family: Proxima Nova;
  1473. .el-menu-item {
  1474. font-size: 12px;
  1475. font-weight: 400;
  1476. color: #333333;
  1477. &:hover a {
  1478. color: #1a72b7;
  1479. }
  1480. }
  1481. .is-active a {
  1482. color: #1a72b7;
  1483. font-size: 12px;
  1484. font-weight: 400;
  1485. }
  1486. }
  1487. @keyframes fade {
  1488. 0% {
  1489. height: 0;
  1490. }
  1491. }
  1492. .category-enter-active,
  1493. .leadTime-enter-active,
  1494. .budge-enter-active {
  1495. overflow: hidden;
  1496. animation: fade 0.3s ease-in-out;
  1497. }
  1498. .category-leave-active,
  1499. .leadTime-leave-active,
  1500. .budge-leave-active {
  1501. overflow: hidden;
  1502. animation: fade 0.3s ease-in-out reverse;
  1503. }
  1504. .border-radius {
  1505. border-radius: 6px;
  1506. }
  1507. .no-result {
  1508. margin-top: 120px;
  1509. font-size: 34px;
  1510. font-family: Proxima Nova;
  1511. font-weight: 600;
  1512. color: #797979;
  1513. }
  1514. .user-menu-panel {
  1515. width: 292px;
  1516. box-sizing: border-box;
  1517. padding: 0 0 20px;
  1518. font-size: 15px;
  1519. font-family: ProximaNova-Semibold, sans-serif;
  1520. color: #333;
  1521. & div {
  1522. box-sizing: border-box;
  1523. }
  1524. & > div {
  1525. padding-left: 27px;
  1526. padding-right: 27px;
  1527. }
  1528. .greeting {
  1529. width: 270px;
  1530. font-weight: 600;
  1531. padding-top: 18px;
  1532. padding-bottom: 18px;
  1533. padding-left: 11px;
  1534. padding-right: 11px;
  1535. border-bottom: 1px solid rgba(#002369, 0.3);
  1536. }
  1537. .btn-logout {
  1538. display: inline-block;
  1539. cursor: pointer;
  1540. }
  1541. }
  1542. .user-menu-wrap {
  1543. width: 100%;
  1544. padding-top: 6px;
  1545. padding-bottom: 24px;
  1546. }
  1547. .user-menu {
  1548. margin-top: 8px;
  1549. .menu-title {
  1550. font-weight: 600;
  1551. line-height: 36px;
  1552. }
  1553. .sub-menu {
  1554. font-family: Proxima Nova, sans-serif;
  1555. padding-left: 14px;
  1556. display: flex;
  1557. align-items: center;
  1558. .icon {
  1559. display: inline-block;
  1560. width: 20px;
  1561. height: 20px;
  1562. margin-right: 8px;
  1563. background-position: center;
  1564. background-repeat: no-repeat;
  1565. background-size: contain;
  1566. &.book {
  1567. background-image: url(~@/assets/img/header/book.png);
  1568. }
  1569. &.folder {
  1570. background-image: url(~@/assets/img/header/folder.png);
  1571. }
  1572. &.mail {
  1573. background-image: url(~@/assets/img/header/mail.png);
  1574. }
  1575. &.order {
  1576. background-image: url(~@/assets/img/header/order.png);
  1577. }
  1578. &.video {
  1579. background-image: url(~@/assets/img/header/video.png);
  1580. }
  1581. }
  1582. .sub-title {
  1583. display: inline-block;
  1584. line-height: 36px;
  1585. font-size: 14px;
  1586. }
  1587. &:hover {
  1588. .sub-title {
  1589. color: #409eff;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. </style>