JDHeader.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. <template>
  2. <div class="jd-header">
  3. <!-- 1. 始终吸顶的 44px 纯白背景顶部窄条 (无边框线,字号调大) -->
  4. <div class="header-top">
  5. <div class="top-inner flex-between w">
  6. <!-- 左侧区域:北京定位、部门/企业选择 (严格对齐图2左侧) -->
  7. <div class="top-left flex">
  8. <div class="loc-wrap">
  9. <svg class="loc-icon" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
  10. <path
  11. d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"
  12. ></path>
  13. </svg>
  14. <span>武汉</span>
  15. </div>
  16. <!-- 登录者公司下拉 (图2高奢重构) -->
  17. <div class="nav-item has-dropdown company-dropdown">
  18. <span class="dept-text">您好!{{ userInfo.companyName || '' }}</span>
  19. <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
  20. <polyline points="6 9 12 15 18 9" />
  21. </svg>
  22. <!-- 👑 尊贵企业公司与用户信息面板 (图2大气重构) -->
  23. <div class="dropdown-menu company-menu">
  24. <div class="user-info-card flex">
  25. <!-- 左侧头像与会员徽章 -->
  26. <div class="avatar-area flex-column align-center">
  27. <div class="avatar-circle">
  28. <!-- 使用精致的 Joy 狗头像,若图片加载失败则自动fallback -->
  29. <img src="@/assets/images/pcdiy/logo2.png" alt="" class="avatar-img" />
  30. </div>
  31. <span class="member-gold-badge">企业会员</span>
  32. </div>
  33. <!-- 右侧详细信息 -->
  34. <div class="info-area flex-column">
  35. <div class="user-row">
  36. 账号名称:<span class="user-red-name">{{ userInfo.user?.nickName || '' }}</span>
  37. </div>
  38. <div class="company-row">归属公司:{{ userInfo.companyName || '' }}</div>
  39. <div class="dept-row">所属部门:{{ userInfo.user?.deptName || '' }}</div>
  40. </div>
  41. </div>
  42. <!-- 底部操作区 -->
  43. <div class="card-divider"></div>
  44. <div class="action-bar flex-end">
  45. <span class="action-txt-btn">切换登录</span>
  46. <span class="action-txt-btn" @click="onlogout">退出</span>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- 右侧区域:工作台、采购合作、优易内购(键礼)、客户服务、手机慧采 (严格对齐图2右侧) -->
  52. <div class="top-right flex">
  53. <!-- 工作台 -->
  54. <div @click="onPath('/enterprise/companyInfo')" class="nav-item">工作台</div>
  55. <span class="spacer"></span>
  56. <!-- 采购合作 ∨ (紧凑美观重构) -->
  57. <div class="nav-item has-dropdown">
  58. <span>采购合作</span>
  59. <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
  60. <polyline points="6 9 12 15 18 9" />
  61. </svg>
  62. <!-- 采购合作下拉面板 -->
  63. <div class="dropdown-menu partner-menu">
  64. <div class="menu-sub-item">企业入驻</div>
  65. <div class="menu-sub-item">合作咨询</div>
  66. <div class="menu-sub-item">服务指南</div>
  67. </div>
  68. </div>
  69. <span class="spacer"></span>
  70. <!-- 优易内购(键礼) -->
  71. <div class="nav-item">优易内购(键礼)</div>
  72. <span class="spacer"></span>
  73. <!-- 客户服务 ∨ (紧凑美观重构) -->
  74. <div class="nav-item has-dropdown">
  75. <span>客户服务</span>
  76. <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
  77. <polyline points="6 9 12 15 18 9" />
  78. </svg>
  79. <!-- 客户服务下拉面板 -->
  80. <div class="dropdown-menu service-menu">
  81. <div class="menu-sub-item">帮助中心</div>
  82. <div class="menu-sub-item">售后服务</div>
  83. <div class="menu-sub-item">在线客服</div>
  84. </div>
  85. </div>
  86. <span class="spacer"></span>
  87. <!-- 手机慧采 ∨ (最右侧,图3大型高端卡片化布局) -->
  88. <div class="nav-item has-dropdown mobile-dropdown last-item">
  89. <span>手机慧采</span>
  90. <svg class="arrow" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
  91. <polyline points="6 9 12 15 18 9" />
  92. </svg>
  93. <!-- 手机慧采大型大气美观面板 (微信公众号+微信小程序双子星并列布局) -->
  94. <div class="dropdown-menu mobile-menu-panel">
  95. <div class="mobile-dual-cards flex">
  96. <!-- 左侧:微信公众号 -->
  97. <div class="mobile-card-col flex-column align-center">
  98. <div class="card-header-row flex align-center">
  99. <span class="wechat-badge-dot green"></span>
  100. <span class="card-header-title">微信公众号</span>
  101. </div>
  102. <div class="qr-box-container">
  103. <img :src="wechatLink" alt="" class="qr-box-img" />
  104. </div>
  105. <span class="qr-explain-text">扫码关注“微信公众号”<br />获取专享特惠与采购指南</span>
  106. </div>
  107. <!-- 中间竖直华丽分割线 -->
  108. <div class="vertical-divider"></div>
  109. <!-- 右侧:微信小程序 -->
  110. <div class="mobile-card-col flex-column align-center">
  111. <div class="card-header-row flex align-center">
  112. <span class="wechat-badge-dot red"></span>
  113. <span class="card-header-title">微信小程序</span>
  114. </div>
  115. <div class="qr-box-container">
  116. <img :src="weiboLink" alt="" class="qr-box-img" />
  117. </div>
  118. <span class="qr-explain-text">微信扫码“小易来了”<br />随时随地掌握采购与物流</span>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!-- 2. 中间搜索与Logo行 (透明背景,总高度锁死为 104px) -->
  127. <div :class="['header-mid-wrap', { 'is-fixed': isFixed }]">
  128. <div class="header-mid w flex">
  129. <!-- 双 Logo 设计:优易慧采 + 中国银行 (锁定物理尺寸为 127*40 与 144*40) -->
  130. <div class="logo-box flex">
  131. <!-- 优易慧采大红Logo (矢量渲染,锁定宽度 127px,高度 40px) -->
  132. <div class="logo-hucai">{{ dataInfo.mainTitle || '' }}</div>
  133. <!-- 中国银行真实图片 Logo (物理尺寸三层死锁为 144px * 40px) -->
  134. <img
  135. :src="dataInfo.logoUrl"
  136. alt=""
  137. class="logo-boc-img"
  138. width="144"
  139. height="40"
  140. style="
  141. width: 144px !important;
  142. height: 40px !important;
  143. min-width: 144px !important;
  144. max-width: 144px !important;
  145. min-height: 40px !important;
  146. max-height: 40px !important;
  147. "
  148. />
  149. </div>
  150. <!-- 搜索区域 -->
  151. <div class="search-box-wrap flex-1">
  152. <div class="search-bar flex">
  153. <div class="input-group flex-1 flex relative" style="position: relative">
  154. <!-- 真实的搜索输入框 -->
  155. <input
  156. type="text"
  157. v-model="userSearchValue"
  158. @focus="isSearchInputFocused = true"
  159. @blur="handleSearchInputBlur"
  160. ref="searchInput"
  161. style="width: 100%; height: 100%; border: none; outline: none; background: transparent"
  162. />
  163. <!-- 绝对定位的上下滚动占位词覆盖层 (仅当输入框未聚焦且用户没有输入内容时显示) -->
  164. <div class="search-scroll-swiper" v-if="!isSearchInputFocused && !userSearchValue" @click="focusSearchInput">
  165. <transition name="keyword-slide">
  166. <div :key="currentKeywordIndex" class="keyword-swiper-item">
  167. {{ scrollKeywords[currentKeywordIndex] }}
  168. </div>
  169. </transition>
  170. </div>
  171. </div>
  172. <button class="search-btn" @click="onPath('/search?type=1&input=' + userSearchValue)">搜 索</button>
  173. </div>
  174. <!-- 热搜词一比一完美复刻图2 -->
  175. <div class="hot-links">
  176. <span @click="onPath('/search?type=1&input=' + item.name)" class="red-link" v-for="(item, index) in dataInfo.hotWords" :key="index">{{
  177. item.name
  178. }}</span>
  179. </div>
  180. </div>
  181. <!-- 动作操作区 (AI采购管家 + 我的采购单) -->
  182. <div class="header-actions flex">
  183. <!-- AI采购管家 (带亮红 NEW 小胶囊) -->
  184. <!-- 隐形占位以保持“我的采购单”绝对位置零漂移 -->
  185. <div class="action-btn ai-manager-btn relative invisible-placeholder">
  186. <span class="new-badge">NEW</span>
  187. <span class="btn-text">Ai 采购管家</span>
  188. </div>
  189. <!-- 我的采购单 (带购物车和红点数字1) -->
  190. <div class="action-btn my-cart-btn relative">
  191. <svg class="cart-icon" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  192. <circle cx="9" cy="21" r="1"></circle>
  193. <circle cx="20" cy="21" r="1"></circle>
  194. <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
  195. </svg>
  196. <span class="btn-text">{{ dataInfo.mainTitle }}</span>
  197. <span v-if="cartCount > 0" class="cart-count-badge">{{ cartCount }}</span>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <!-- 占位符,防止中间栏吸顶时页面抖动跳跃 (高度统一为 104px) -->
  203. <div class="header-placeholder" v-show="isFixed"></div>
  204. </div>
  205. </template>
  206. <script setup lang="ts">
  207. import { onPath } from '@/utils/siteConfig';
  208. import { useUserStore } from '@/store/modules/user';
  209. import { getPlatformConfigList } from '@/api/breg/index';
  210. import { cartStore } from '@/store/modules/cart';
  211. import { currentSearchConfig } from '@/api/home/index-data';
  212. interface Props {
  213. userInfo?: any;
  214. }
  215. const props = defineProps<Props>();
  216. const dataInfo = ref<any>({});
  217. const wechatLink = ref<any>('');
  218. const weiboLink = ref<any>('');
  219. const cartStoreData = cartStore();
  220. const cartCount = computed(() => cartStoreData.cartCount);
  221. currentSearchConfig({}).then((res) => {
  222. if (res.code == 200) {
  223. document.documentElement.style.setProperty('--hover-data1', res.data.themeColor || '#E7000B');
  224. if (res.data.searchPlaceholder) {
  225. scrollKeywords.value = res.data.searchPlaceholder.split(',');
  226. }
  227. if (res.data.hotWords) {
  228. res.data.hotWords = JSON.parse(res.data.hotWords);
  229. }
  230. dataInfo.value = res.data;
  231. }
  232. });
  233. getPlatformConfigList({ configKey: 'wechatLink' }).then((res) => {
  234. if (res.code == 200) {
  235. if (res.rows && res.rows.length > 0) {
  236. wechatLink.value = res.rows[0].value;
  237. }
  238. }
  239. });
  240. getPlatformConfigList({ configKey: 'weiboLink' }).then((res) => {
  241. if (res.code == 200) {
  242. if (res.rows && res.rows.length > 0) {
  243. weiboLink.value = res.rows[0].value;
  244. }
  245. }
  246. });
  247. const onlogout = () => {
  248. useUserStore()
  249. .logout()
  250. .then(() => {
  251. onPath('/login');
  252. });
  253. };
  254. const isFixed = ref(false);
  255. const handleScroll = () => {
  256. // 当滚过 header-top 时,中间栏吸顶
  257. isFixed.value = window.scrollY > 44;
  258. };
  259. // 👑 多商品占位词上下滚动机制
  260. const scrollKeywords = ref<any>([]);
  261. const currentKeywordIndex = ref(0);
  262. const isSearchInputFocused = ref(false);
  263. const userSearchValue = ref('');
  264. const searchInput = ref(null);
  265. let keywordInterval = null;
  266. const startKeywordRotation = () => {
  267. keywordInterval = setInterval(() => {
  268. // 仅当输入框没有被聚焦且用户未输入内容时,才在后台和前台进行上下滚动播放
  269. if (!isSearchInputFocused.value && !userSearchValue.value) {
  270. currentKeywordIndex.value = (currentKeywordIndex.value + 1) % scrollKeywords.value.length;
  271. }
  272. }, 2500); // 2.5 秒完美滚动频次
  273. };
  274. const focusSearchInput = () => {
  275. if (searchInput.value) {
  276. searchInput.value.focus();
  277. }
  278. };
  279. const handleSearchInputBlur = () => {
  280. isSearchInputFocused.value = false;
  281. };
  282. onMounted(() => {
  283. window.addEventListener('scroll', handleScroll);
  284. startKeywordRotation();
  285. });
  286. onUnmounted(() => {
  287. window.removeEventListener('scroll', handleScroll);
  288. if (keywordInterval) {
  289. clearInterval(keywordInterval);
  290. }
  291. });
  292. </script>
  293. <style scoped>
  294. /* 整个Header容器背景清透 */
  295. .jd-header {
  296. background: transparent;
  297. padding-top: 44px; /* 最新 44px 顶栏高撑开 */
  298. }
  299. /* ==================== 👑 版心控制 (遵守全局媒体查询宽度,确保任何设备视口下双向垂直绝对铅垂线切平对齐) ==================== */
  300. .w {
  301. margin: 0 auto;
  302. padding: 0 !important;
  303. box-sizing: border-box;
  304. }
  305. /* ==================== 👑 44px 吸顶顶部窄条 ==================== */
  306. .header-top {
  307. position: fixed;
  308. top: 0;
  309. left: 0;
  310. right: 0;
  311. height: 44px;
  312. background: #ffffff;
  313. border-bottom: none;
  314. font-size: 13.5px;
  315. color: #666;
  316. line-height: 44px;
  317. z-index: 10000;
  318. }
  319. .top-inner {
  320. height: 100%;
  321. box-sizing: border-box;
  322. }
  323. /* Flex 布局助手 */
  324. .flex {
  325. display: flex;
  326. align-items: center;
  327. }
  328. .flex-between {
  329. display: flex;
  330. justify-content: space-between;
  331. align-items: center;
  332. }
  333. .flex-column {
  334. display: flex;
  335. flex-direction: column;
  336. }
  337. .flex-center {
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. }
  342. /* 导航小分割线 */
  343. .spacer {
  344. width: 1px;
  345. height: 12px;
  346. background: #e5e5e5;
  347. margin: 0 10px;
  348. display: inline-block;
  349. align-self: center;
  350. }
  351. /* 定位样式 */
  352. .loc-wrap {
  353. display: flex;
  354. align-items: center;
  355. color: #e1251b;
  356. cursor: pointer;
  357. font-weight: bold;
  358. padding: 0 12px 0 0;
  359. transition: opacity 0.2s;
  360. }
  361. .loc-wrap:hover {
  362. opacity: 0.8;
  363. }
  364. .loc-icon {
  365. color: #e1251b;
  366. margin-right: 4px;
  367. }
  368. /* 导航项通用样式 */
  369. .nav-item {
  370. padding: 0 10px;
  371. cursor: pointer;
  372. transition: all 0.2s ease;
  373. height: 100%;
  374. display: flex;
  375. align-items: center;
  376. position: relative;
  377. user-select: none;
  378. color: #666;
  379. }
  380. .nav-item:hover {
  381. color: #e1251b;
  382. background: #f9f9f9;
  383. }
  384. /* 最右侧项微调,把 padding-right 设为 0 以保证与“我的采购单”右边缘完美垂直对齐 */
  385. .nav-item.last-item {
  386. padding-right: 0 !important;
  387. }
  388. .red-link {
  389. color: #e1251b !important;
  390. }
  391. .font-bold {
  392. font-weight: bold;
  393. }
  394. /* 下拉小箭头 */
  395. .arrow {
  396. width: 20px !important;
  397. height: 20px !important;
  398. font-size: 20px !important;
  399. margin-left: 5px;
  400. color: #a0a0a0;
  401. transition:
  402. transform 0.2s ease,
  403. color 0.2s ease;
  404. vertical-align: middle !important;
  405. display: inline-block !important;
  406. }
  407. .has-dropdown:hover .arrow {
  408. transform: rotate(180deg);
  409. color: #e1251b;
  410. }
  411. /* ==================== 👑 悬停下拉浮现菜单 (高奢大气商务重构) ==================== */
  412. .dropdown-menu {
  413. position: absolute;
  414. top: 100%;
  415. left: 50%;
  416. transform: translateX(-50%) translateY(8px); /* 留出 8px 精致桥接悬空格局 */
  417. background: #ffffff;
  418. border: 1px solid rgba(0, 0, 0, 0.06); /* 超细呼吸细灰边框 */
  419. box-shadow:
  420. 0 10px 30px rgba(0, 0, 0, 0.08),
  421. 0 1px 4px rgba(0, 0, 0, 0.02); /* 高奢多层立体虚化投影 */
  422. border-radius: 8px; /* 大气圆润 8px 圆角 */
  423. opacity: 0;
  424. visibility: hidden;
  425. transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  426. z-index: 10001;
  427. min-width: 140px; /* 大气加宽 */
  428. padding: 4px 0 !important; /* 紧凑设计:缩减上下边距,消除松垮感 */
  429. box-sizing: border-box;
  430. }
  431. /* 加上桥接热区以保证悬浮进入顺畅无漂移 */
  432. .dropdown-menu::before {
  433. content: '';
  434. position: absolute;
  435. top: -12px;
  436. left: 0;
  437. right: 0;
  438. height: 12px;
  439. background: transparent;
  440. }
  441. .has-dropdown:hover .dropdown-menu {
  442. opacity: 1;
  443. visibility: visible;
  444. transform: translateX(-50%) translateY(2px);
  445. }
  446. /* 👑 1. 尊贵企业公司与用户信息面板样式 (图2高奢大气重塑) */
  447. .company-dropdown .dropdown-menu.company-menu {
  448. width: 380px !important; /* 拓宽至高大气 380px 宽度,防止公司和部门换行 */
  449. padding: 16px !important;
  450. left: 0;
  451. transform: translateY(8px);
  452. }
  453. .company-dropdown:hover .dropdown-menu.company-menu {
  454. transform: translateY(2px);
  455. }
  456. .user-info-card {
  457. width: 100% !important;
  458. align-items: center !important;
  459. gap: 16px !important;
  460. box-sizing: border-box !important;
  461. }
  462. /* 左侧头像与黑金标签 */
  463. .avatar-area {
  464. flex-shrink: 0 !important;
  465. align-items: center !important;
  466. }
  467. .avatar-circle {
  468. width: 56px !important;
  469. height: 56px !important;
  470. border-radius: 50% !important;
  471. background: #fff5f5 !important;
  472. border: 2px solid #fff1f0 !important; /* 精致红粉边框突显立体感 */
  473. overflow: hidden !important;
  474. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04) !important;
  475. display: flex !important;
  476. align-items: center !important;
  477. justify-content: center !important;
  478. }
  479. .avatar-img {
  480. width: 100% !important;
  481. height: 100% !important;
  482. object-fit: cover !important;
  483. }
  484. .member-gold-badge {
  485. margin-top: 5px !important;
  486. background: #222222 !important; /* 黑金质感 */
  487. color: #fad18f !important; /* 尊贵金黄字 */
  488. font-size: 10px !important;
  489. font-weight: bold !important;
  490. padding: 1px 7px !important;
  491. border-radius: 10px !important;
  492. border: 1px solid #333333 !important;
  493. line-height: 1.2 !important;
  494. white-space: nowrap !important;
  495. transform: scale(0.9) !important;
  496. }
  497. /* 右侧公司与账号 */
  498. .info-area {
  499. flex: 1 !important;
  500. justify-content: center !important;
  501. text-align: left !important;
  502. }
  503. .user-row {
  504. font-size: 13.5px !important;
  505. color: #555555 !important;
  506. font-weight: 500 !important;
  507. line-height: 1.4 !important;
  508. }
  509. .user-red-name {
  510. color: #e1251b !important; /* 醒目优易红 */
  511. font-weight: bold !important;
  512. }
  513. .company-row,
  514. .dept-row {
  515. font-size: 12px !important;
  516. color: #666666 !important;
  517. margin-top: 5px !important;
  518. line-height: 1.4 !important;
  519. word-break: break-all !important;
  520. }
  521. /* 底部操作区细分割线 */
  522. .card-divider {
  523. height: 1px !important;
  524. background: rgba(0, 0, 0, 0.05) !important;
  525. width: 100% !important;
  526. margin: 8px 0 6px 0 !important; /* 深度紧缩:缩小间距 */
  527. }
  528. .action-bar {
  529. width: 100% !important;
  530. display: flex !important;
  531. justify-content: flex-end !important;
  532. gap: 16px !important;
  533. height: 20px !important; /* 锁死精致高度 */
  534. line-height: 20px !important;
  535. margin-bottom: -4px !important; /* 精巧向上拉伸,消除下方残留的过大留白 */
  536. }
  537. .action-txt-btn {
  538. font-size: 13.5px !important; /* 文字调大:极佳的辨识度 */
  539. color: #666666 !important;
  540. cursor: pointer !important;
  541. transition: color 0.2s ease !important;
  542. font-weight: 500 !important;
  543. }
  544. .action-txt-btn:hover {
  545. color: #e1251b !important; /* Hover 时大红 */
  546. }
  547. /* 👑 2. 高端紧凑子项:5px 24px padding,消灭太大的间距,充满精细感 */
  548. .menu-sub-item {
  549. position: relative !important;
  550. padding: 4px 16px 4px 24px !important; /* 深度紧缩上下字距:精细精神,消灭丑态 */
  551. line-height: 1.6 !important; /* 强制优雅紧凑行高,杜绝任何外部撑大 */
  552. color: #333333 !important; /* 经典深沉灰黑 */
  553. font-size: 13px !important; /* 极其大气清晰 */
  554. white-space: nowrap !important;
  555. text-align: left !important;
  556. transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  557. cursor: pointer !important;
  558. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
  559. font-weight: 500 !important;
  560. margin: 1px 0 !important; /* 保持项与项之间的极细呼吸 */
  561. }
  562. /* 左侧若隐若现的大红微圆点 */
  563. .menu-sub-item::before {
  564. content: '' !important;
  565. position: absolute !important;
  566. left: 12px !important; /* 随着padding缩减微调 */
  567. top: 50% !important;
  568. transform: translateY(-50%) scale(0.4) !important;
  569. width: 4.5px !important;
  570. height: 4.5px !important;
  571. background: #e1251b !important;
  572. border-radius: 50% !important;
  573. opacity: 0 !important;
  574. transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  575. }
  576. .menu-sub-item:hover,
  577. .menu-sub-item.active {
  578. background: rgba(225, 37, 27, 0.04) !important; /* 高端淡红高亮背景 */
  579. color: #e1251b !important; /* 高亮变为优易经典红色 */
  580. padding-left: 27px !important; /* 悬浮时微向右推 3px,展现物理解耦的弹性滑动 */
  581. }
  582. /* 悬浮时让微圆点优雅滑出并变大 */
  583. .menu-sub-item:hover::before,
  584. .menu-sub-item.active::before {
  585. opacity: 1 !important;
  586. transform: translateY(-50%) scale(1) !important;
  587. left: 14px !important;
  588. }
  589. /* 👑 3. 手机慧采公众号与小程序并排卡片 (超宽420px,大气白净设计) */
  590. .mobile-dropdown .dropdown-menu.mobile-menu-panel {
  591. width: 420px !important; /* 物理宽度锁定为霸气的 420px */
  592. padding: 20px !important; /* 内边距舒张开朗 */
  593. left: auto;
  594. right: 0;
  595. transform: translateY(8px);
  596. }
  597. .mobile-dropdown:hover .dropdown-menu.mobile-menu-panel {
  598. transform: translateY(2px);
  599. }
  600. /* 👑 双子星公众号与小程序并排大气格局 */
  601. .mobile-dual-cards {
  602. width: 100% !important;
  603. display: flex !important;
  604. justify-content: space-between !important;
  605. align-items: stretch !important;
  606. }
  607. .mobile-card-col {
  608. width: 47% !important;
  609. display: flex !important;
  610. flex-direction: column !important;
  611. align-items: center !important;
  612. text-align: center !important;
  613. box-sizing: border-box !important;
  614. }
  615. .card-header-row {
  616. display: flex !important;
  617. align-items: center !important;
  618. gap: 6px !important;
  619. margin-bottom: 2px !important;
  620. }
  621. .wechat-badge-dot {
  622. width: 6px !important;
  623. height: 6px !important;
  624. border-radius: 50% !important;
  625. display: inline-block !important;
  626. }
  627. .wechat-badge-dot.green {
  628. background: #07c160 !important;
  629. box-shadow: 0 0 6px rgba(7, 193, 96, 0.4) !important;
  630. }
  631. .wechat-badge-dot.red {
  632. background: #e1251b !important;
  633. box-shadow: 0 0 6px rgba(225, 37, 27, 0.4) !important;
  634. }
  635. .card-header-title {
  636. font-size: 13.5px !important;
  637. font-weight: bold !important;
  638. color: #333333 !important;
  639. }
  640. /* 精致白净的二维码框架 */
  641. .qr-box-container {
  642. width: 116px !important; /* 高能放大:由 100px 显著拉大至 116px,视觉气派震撼 */
  643. height: 116px !important; /* 高度同步放大 */
  644. border: 1px solid rgba(0, 0, 0, 0.05) !important;
  645. border-radius: 8px !important;
  646. padding: 6px !important;
  647. background: #ffffff !important;
  648. box-sizing: border-box !important;
  649. display: flex !important;
  650. align-items: center !important;
  651. justify-content: center !important;
  652. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
  653. margin: 8px 0 !important; /* 上下间隙微调以保持极佳比例 */
  654. }
  655. .qr-box-img {
  656. width: 100% !important;
  657. height: 100% !important;
  658. object-fit: contain !important;
  659. }
  660. /* 扫码说明描述文字 */
  661. .qr-explain-text {
  662. font-size: 11.5px !important;
  663. color: #777777 !important;
  664. line-height: 1.45 !important;
  665. text-align: center !important;
  666. }
  667. /* 中间高雅的竖直实线分割线 */
  668. .vertical-divider {
  669. width: 1px !important;
  670. background: rgba(0, 0, 0, 0.06) !important;
  671. align-self: stretch !important;
  672. margin: 4px 5px !important;
  673. }
  674. /* ==================== 👑 中间搜索与Logo行 (高保真高度 104px) ==================== */
  675. .header-mid-wrap {
  676. height: 104px; /* 锁死为 104px */
  677. background: transparent; /* 搜索栏是没有白色背景的 */
  678. transition: all 0.2s;
  679. box-sizing: border-box;
  680. }
  681. /* 当页面向下滚动时吸顶配合 */
  682. .header-mid-wrap.is-fixed {
  683. position: fixed;
  684. top: 44px !important; /* 锁紧在 44px 顶栏的正下方 */
  685. left: 0;
  686. right: 0;
  687. height: 64px !important; /* 高度在吸顶时收缩为精致扁平的 64px */
  688. z-index: 9999 !important;
  689. background: #ffffff !important; /* 完美复刻图1纯白通栏吸顶背景 */
  690. border-bottom: 1px solid #ededed !important; /* 精致底边细分割线,完美分割下方内容 */
  691. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  692. animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  693. }
  694. .header-mid-wrap.is-fixed .header-mid {
  695. height: 64px !important; /* 主容器高度同步收缩 */
  696. }
  697. /* 吸顶时隐藏热词,释放珍贵的垂直视口空间 */
  698. .header-mid-wrap.is-fixed .hot-links {
  699. display: none !important;
  700. }
  701. @keyframes slideDown {
  702. from {
  703. transform: translateY(-10%);
  704. opacity: 0.8;
  705. }
  706. to {
  707. transform: translateY(0);
  708. opacity: 1;
  709. }
  710. }
  711. /* 占位符高度升级为 104px */
  712. .header-placeholder {
  713. height: 104px;
  714. }
  715. .header-mid {
  716. height: 104px;
  717. padding: 0 !important; /* 取消原本 padding,通过 flex 水平垂直居中 */
  718. display: flex;
  719. align-items: center;
  720. justify-content: flex-start;
  721. box-sizing: border-box;
  722. }
  723. /* ==================== 👑 双 Logo 排版样式 ==================== */
  724. .logo-box {
  725. width: 340px; /* 锁死为符合图3的 340px 宽度,确保搜索栏左边缘到优易慧采左侧为 340px */
  726. height: 40px; /* 锁死为符合图3的 40px 高度 */
  727. display: flex;
  728. align-items: center;
  729. justify-content: flex-start; /* 改为 flex-start 以便利用 margin 精准定位间距 */
  730. margin-right: 0px !important; /* 彻底清除右边距,满足 340px 的物理几何 */
  731. flex-shrink: 0;
  732. padding-left: 0 !important; /* 确保首个 Logo 左侧边缘与顶栏完美对齐 */
  733. user-select: none;
  734. box-sizing: border-box;
  735. }
  736. /* 1. 优易慧采 Logo (锁定 127*40 物理尺寸) */
  737. .logo-hucai {
  738. min-width: 127px;
  739. height: 40px;
  740. display: flex;
  741. align-items: center;
  742. justify-content: flex-start;
  743. font-size: 27px;
  744. font-weight: 900;
  745. color: var(--hover-data1); /* 优易经典红色 */
  746. font-family: 'Microsoft YaHei', sans-serif;
  747. letter-spacing: 0.5px;
  748. line-height: 40px;
  749. box-sizing: border-box;
  750. flex-shrink: 0;
  751. }
  752. /* 3. 中国银行真实图片 Logo (物理尺寸锁定为 144px * 40px) */
  753. .logo-boc-img {
  754. width: 144px !important;
  755. height: 40px !important;
  756. min-width: 144px !important;
  757. max-width: 144px !important;
  758. min-height: 40px !important;
  759. max-height: 40px !important;
  760. object-fit: fill !important; /* 采用完全填充(fill)的方式显示,百分之百铺满 144*40 */
  761. display: block !important;
  762. flex-shrink: 0 !important;
  763. margin-left: 30px !important; /* 精准保留与左侧优易慧采的 30px 物理间距! */
  764. }
  765. /* 搜索输入框 */
  766. .search-box-wrap {
  767. margin: 0 24px 0 0;
  768. flex: 1; /* 弹性容器,自适应宽度 */
  769. min-width: 0; /* 允许收缩 */
  770. position: relative; /* 赋予热词以 absolute 定位上下文,消除对齐向下拉扯 */
  771. height: 42px; /* 高度设为 42px,使整个容器物理文档流与搜索框一致 */
  772. display: flex;
  773. align-items: center;
  774. }
  775. .search-bar {
  776. width: 100%; /* 自适应宽度 */
  777. height: 42px; /* 锁死为符合图1的 42px 高度 */
  778. border: 2px solid var(--hover-data1);
  779. border-radius: 8px;
  780. background: #fff;
  781. padding: 2px;
  782. box-sizing: border-box;
  783. display: flex;
  784. align-items: center;
  785. }
  786. .input-group {
  787. padding: 0 12px;
  788. align-items: center;
  789. height: 100%;
  790. position: relative !important;
  791. }
  792. .input-group input {
  793. width: 100%;
  794. height: 100%;
  795. border: none;
  796. outline: none;
  797. font-size: 13.5px;
  798. color: #333;
  799. }
  800. .input-group input::placeholder {
  801. color: #a5a5a5;
  802. }
  803. /* 👑 高品质多商品上下滚动占位词样式 */
  804. .search-scroll-swiper {
  805. position: absolute !important;
  806. left: 12px !important;
  807. top: 0 !important;
  808. bottom: 0 !important;
  809. right: 40px !important;
  810. display: flex !important;
  811. align-items: center !important;
  812. pointer-events: none !important; /* 穿透鼠标事件,使点击直接穿透给底层的 input 输入框以聚焦 */
  813. overflow: hidden !important;
  814. background: transparent !important;
  815. }
  816. .keyword-swiper-item {
  817. font-size: 13.5px !important;
  818. color: #a5a5a5 !important; /* 经典高保真灰色占位词颜色 */
  819. white-space: nowrap !important;
  820. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
  821. line-height: 1 !important;
  822. display: flex;
  823. align-items: center;
  824. }
  825. /* 👑 向上翻页滑动 Transition 动画 */
  826. .keyword-slide-enter-active,
  827. .keyword-slide-leave-active {
  828. transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
  829. position: absolute !important;
  830. }
  831. .keyword-slide-enter-from {
  832. opacity: 0 !important;
  833. transform: translateY(20px) !important; /* 从正下方 20px 滑入 */
  834. }
  835. .keyword-slide-leave-to {
  836. opacity: 0 !important;
  837. transform: translateY(-20px) !important; /* 向上滑出 20px 彻底淡出 */
  838. }
  839. .search-btn {
  840. width: 80px;
  841. height: 100%;
  842. background: var(--hover-data1);
  843. color: #fff;
  844. border: none;
  845. font-size: 15px;
  846. font-weight: bold;
  847. border-radius: 6px;
  848. cursor: pointer;
  849. transition: background 0.2s;
  850. letter-spacing: 1.5px;
  851. }
  852. .search-btn:hover {
  853. background: var(--hover-data1);
  854. }
  855. /* 完美高保真热搜词 */
  856. .hot-links {
  857. position: absolute;
  858. top: 47px !important; /* 完美在 42px 搜索框的下方 5px 处 (42 + 5 = 47px),保留 5px 间距,死锁定位! */
  859. left: 0;
  860. font-size: 12px !important; /* 字体大小锁定为 12px */
  861. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif !important; /* 字体锁定为图2所示 */
  862. color: #00000073 !important; /* 字体颜色锁定为图2所示的 #00000073 */
  863. padding-left: 12px;
  864. display: flex;
  865. align-items: center;
  866. width: 100%;
  867. box-sizing: border-box;
  868. overflow: hidden !important; /* 强制单行且超出隐藏 */
  869. white-space: nowrap !important; /* 强制单行且超出隐藏 */
  870. }
  871. .hot-links span {
  872. margin-right: 14px;
  873. cursor: pointer;
  874. transition: color 0.2s;
  875. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif !important; /* 字体锁定为图2所示 */
  876. color: #00000073 !important; /* 字体颜色锁定为图2所示的 #00000073 */
  877. white-space: nowrap !important; /* 强制每个热词不换行 */
  878. flex-shrink: 0 !important; /* 保证文字不因拉伸而缩水 */
  879. }
  880. .hot-links span:hover {
  881. color: var(--hover-data1) !important; /* 悬停保持优易经典红色 */
  882. }
  883. /* ==================== 👑 动作功能区 (AI采购管家 + 我的采购单) ==================== */
  884. .header-actions {
  885. align-items: center;
  886. gap: 12px;
  887. padding-right: 0 !important; /* 确保右侧“我的采购单”右边缘完美对齐“手机慧采” */
  888. }
  889. /* 通用按钮样式 */
  890. .action-btn {
  891. height: 40px; /* 锁死为符合图1的 40px 高度 */
  892. display: flex;
  893. align-items: center;
  894. padding: 0 16px;
  895. border: 1.5px solid #d9d9d9;
  896. border-radius: 8px;
  897. background: #ffffff;
  898. cursor: pointer;
  899. transition: all 0.25s ease;
  900. user-select: none;
  901. box-sizing: border-box;
  902. position: relative; /* 强行赋予定位上下文,锁定右上角标位置 */
  903. white-space: nowrap; /* 强行禁止文字折行换行 */
  904. flex-shrink: 0; /* 强行禁止按钮被挤压变窄 */
  905. }
  906. /* 隐形占位,保持原有的物理排版宽度但完全隐形,防采购单按钮漂移 */
  907. .invisible-placeholder {
  908. visibility: hidden !important;
  909. pointer-events: none !important;
  910. }
  911. /* 1. AI采购管家 (圆角淡蓝框线) */
  912. .ai-manager-btn {
  913. border-color: #2f72ff;
  914. color: #2f72ff;
  915. }
  916. .ai-manager-btn:hover {
  917. background: #f0f5ff;
  918. }
  919. .ai-manager-btn .btn-text {
  920. font-size: 13.5px;
  921. font-weight: bold;
  922. }
  923. /* 亮红色 NEW 胶囊 */
  924. .new-badge {
  925. position: absolute;
  926. top: -9px;
  927. right: -5px;
  928. background: #ff2b2b;
  929. color: #ffffff;
  930. font-size: 9px;
  931. font-weight: 900;
  932. padding: 1px 4px;
  933. border-radius: 6px;
  934. line-height: 1;
  935. box-shadow: 0 2px 4px rgba(255, 43, 43, 0.3);
  936. transform: scale(0.95);
  937. font-family: 'Arial', sans-serif;
  938. }
  939. /* 2. 我的采购单 (带小推车和气泡数1) */
  940. .my-cart-btn {
  941. border-color: #d9d9d9;
  942. color: #333;
  943. }
  944. .my-cart-btn:hover {
  945. border-color: var(--hover-data1);
  946. color: var(--hover-data1);
  947. }
  948. .my-cart-btn .cart-icon {
  949. margin-right: 6px;
  950. flex-shrink: 0;
  951. }
  952. .my-cart-btn .btn-text {
  953. font-size: 13.5px;
  954. font-weight: 500;
  955. }
  956. /* 红色购物车计数气泡 */
  957. .cart-count-badge {
  958. position: absolute;
  959. top: -10px; /* 随着气泡变大,微调 top 偏移 */
  960. right: -10px; /* 随着气泡变大,微调 right 偏移 */
  961. background: var(--hover-data1);
  962. color: #ffffff;
  963. font-size: 13px; /* 调大数字 */
  964. font-weight: normal; /* 彻底去除加粗,不要加粗 */
  965. width: 20px; /* 圆圈加大到 20px */
  966. height: 20px; /* 圆圈加大到 20px */
  967. border-radius: 50%;
  968. display: flex;
  969. justify-content: center;
  970. align-items: center;
  971. line-height: 1;
  972. /* box-shadow: 0 2px 4px rgba(255, 43, 43, 0.3); */
  973. font-family: 'Arial', sans-serif;
  974. pointer-events: none; /* 保证悬停在红点上依然完美触发按钮 Hover */
  975. z-index: 10;
  976. }
  977. </style>