PcHeader.vue 46 KB

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