AIGeneralCourse.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. <template>
  2. <!-- AI智能课 -->
  3. <div class="home-container">
  4. <!-- 展开收起侧边栏 -->
  5. <div class="sidebar-container">
  6. <div class="sidebar-layout">
  7. <div
  8. class="icon-expand"
  9. :style="{
  10. backgroundColor: drawerVisible ? '#44449c' : '#7F70C840',
  11. left: drawerVisible ? '18%' : '0'
  12. }"
  13. @click="toggleDrawer"
  14. >
  15. <span
  16. class="vertical-lines"
  17. :style="{
  18. color: drawerVisible ? '#8a78d0' : 'white'
  19. }"
  20. >||</span
  21. >
  22. </div>
  23. </div>
  24. <transition name="drawer-slide">
  25. <div class="main-content" v-if="drawerVisible">
  26. <!-- 菜单栏 -->
  27. <div class="drawer-box">
  28. <el-row class="tac">
  29. <el-col :span="15">
  30. <span class="mb-2">
  31. <img :src="teachingImg" alt="教学" />
  32. 教学大纲
  33. </span>
  34. <el-menu
  35. default-active="1"
  36. :class="{ 'el-menu-vertical-demo': true }"
  37. >
  38. <el-menu-item
  39. v-for="(title, index) in courseTitles"
  40. :key="index + 1"
  41. :index="(index + 1).toString()"
  42. @click="goToAIExperience(classOutlineData[index])"
  43. >
  44. {{ title }}
  45. </el-menu-item>
  46. </el-menu>
  47. </el-col>
  48. </el-row>
  49. </div>
  50. </div>
  51. </transition>
  52. </div>
  53. <div class="content-box">
  54. <div class="box-1">
  55. <div class="inner-box left-box">
  56. <div class="box-icon" @click="goBack">
  57. <el-icon class="left-icon"><ArrowLeftBold /></el-icon>
  58. {{ pageTitle }}
  59. </div>
  60. <div class="dropdown-box">
  61. <!-- 下拉菜单 -->
  62. <el-dropdown v-model="selectedGrade" @command="handleGradeSelect">
  63. <el-button type="primary">
  64. {{ selectedGrade
  65. }}<el-icon class="el-icon--right"><arrow-down /></el-icon>
  66. </el-button>
  67. <template #dropdown>
  68. <el-dropdown-menu class="dropdown-menu">
  69. <el-dropdown-item
  70. v-for="item in classData"
  71. :key="item.id"
  72. :command="item.ctType"
  73. >{{ item.ctType }}</el-dropdown-item
  74. >
  75. </el-dropdown-menu>
  76. </template>
  77. </el-dropdown>
  78. </div>
  79. </div>
  80. <div class="inner-box right-box">
  81. <div class="top-right-box">
  82. <el-autocomplete
  83. v-model="SearchInput"
  84. :fetch-suggestions="querySearch"
  85. placeholder="搜索"
  86. @select="handleSearchSelect"
  87. class="search-input"
  88. value-key="ctType"
  89. :trigger-on-focus="false"
  90. >
  91. <template #prefix>
  92. <el-icon class="el-input__icon"><search /></el-icon>
  93. </template>
  94. <!-- 添加下拉项模板 -->
  95. <template #popper-append-to-body>
  96. <el-option
  97. class="scrollbar"
  98. v-for="item in filteredTitles"
  99. :key="item.id"
  100. :label="item.ctType"
  101. :value="item"
  102. ></el-option>
  103. </template>
  104. </el-autocomplete>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="box-2">
  109. <div
  110. class="small-box"
  111. v-for="(outlineData, index) in classOutlineData"
  112. :key="index"
  113. @click="goToAIExperience(outlineData)"
  114. >
  115. <div
  116. class="nested-box"
  117. :style="{
  118. backgroundImage: `url(${outlineData.ctTypeImage})`,
  119. backgroundSize: 'cover'
  120. }"
  121. ></div>
  122. <div class="additional-text">
  123. 0{{ outlineData.ctTypeSort }} {{ outlineData.ctType }}
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </template>
  130. <script setup>
  131. import { ref, onMounted, computed, watch } from 'vue'
  132. import { ClassList, ClassOutline } from '@/api/class.js'
  133. // 添加 Element Plus 组件引入
  134. import {
  135. ArrowDown,
  136. ArrowRightBold,
  137. Expand,
  138. Reading,
  139. Fold,
  140. Tickets
  141. } from '@element-plus/icons-vue'
  142. import { Search, ArrowLeftBold } from '@element-plus/icons-vue'
  143. import { ElAutocomplete } from 'element-plus' // 导入ElAutocomplete组件
  144. import { useRouter } from 'vue-router'
  145. import teachingImg from '@/assets/icon/teaching.png'
  146. const router = useRouter() // 获取当前路由对象
  147. // 添加下拉菜单选中项
  148. const selectedGrade = ref('')
  149. // 添加抽屉显示状态
  150. const drawerVisible = ref(true)
  151. // 处理下拉菜单选择
  152. const handleGradeSelect = command => {
  153. selectedGrade.value = command
  154. // 保存选中值到localStorage
  155. localStorage.setItem('selectedGrade', command)
  156. // 年级切换时重新加载数据的逻辑
  157. const selectedItem = classData.value.find(item => item.ctType === command)
  158. // 存储年级id
  159. if (selectedItem) {
  160. localStorage.setItem('selectedGradeId', selectedItem.id)
  161. }
  162. if (selectedItem) {
  163. ClassOutline(selectedItem.id).then(res => {
  164. if (res.code === 0) {
  165. classOutlineData.value = res.data
  166. }
  167. })
  168. }
  169. }
  170. // 添加切换抽屉显示状态的函数
  171. const toggleDrawer = () => {
  172. drawerVisible.value = !drawerVisible.value
  173. }
  174. // 获取年级
  175. const classData = ref([])
  176. // 添加接口返回的数据引用,用于存储 ClassOutline 结果
  177. const classOutlineData = ref([])
  178. const fetchCtTypes = async () => {
  179. try {
  180. const response = await ClassList()
  181. if (response.code === 0) {
  182. classData.value = response.data
  183. // 获取到数据,优先从localStorage读取选中值
  184. const savedGrade = localStorage.getItem('selectedGrade')
  185. selectedGrade.value =
  186. savedGrade ||
  187. (classData.value.length > 0 ? classData.value[0].ctType : '')
  188. // 初始化时获取课程大纲数据
  189. const selectedItem =
  190. classData.value.find(item => item.ctType === selectedGrade.value) ||
  191. classData.value[0]
  192. if (selectedItem) {
  193. ClassOutline(selectedItem.id).then(res => {
  194. console.log(res);
  195. if (res.code === 0) {
  196. classOutlineData.value = res.data
  197. }
  198. })
  199. }
  200. }
  201. } catch (error) {
  202. console.error('获取 ctType 数据失败:', error)
  203. }
  204. }
  205. // 添加获取课程标题
  206. const getCourseTitle = index => {
  207. if (
  208. classOutlineData.value.length > 0 &&
  209. index > 0 &&
  210. index <= classOutlineData.value.length
  211. ) {
  212. return classOutlineData.value[index - 1].ctType
  213. }
  214. return ''
  215. }
  216. // 课程标题数组,依赖修改后的 getCourseTitle 函数 修改课程标题数组为 computed 属性
  217. const courseTitles = computed(() => {
  218. return classOutlineData.value.map((item, index) => {
  219. return `0${index + 1} ${item.ctType}`;
  220. });
  221. })
  222. // 首页点击渲染后的页面title
  223. const pageTitle = ref('')
  224. onMounted(() => {
  225. fetchCtTypes()
  226. const title = router.currentRoute.value.query.title
  227. if (title) {
  228. pageTitle.value = title
  229. }
  230. })
  231. import { Message } from '@/utils/message/Message.js'
  232. // 搜索框
  233. const SearchInput = ref('')
  234. // 添加搜索建议查询方法
  235. const querySearch = (queryString, cb) => {
  236. const results = queryString
  237. ? classOutlineData.value.filter(item => {
  238. return item.ctType.toLowerCase().includes(queryString.toLowerCase())
  239. })
  240. : classOutlineData.value
  241. cb(results)
  242. }
  243. // 添加搜索选择处理方法
  244. const handleSearchSelect = item => {
  245. goToAIExperience(item)
  246. // 添加以下代码清空输入框
  247. SearchInput.value = '';
  248. }
  249. // 修改过滤逻辑,直接使用classOutlineData
  250. const filteredTitles = computed(() => {
  251. if (!SearchInput.value) {
  252. return classOutlineData.value
  253. }
  254. return classOutlineData.value.filter(title =>
  255. title.ctType.toLowerCase().includes(SearchInput.value.toLowerCase())
  256. )
  257. })
  258. // 添加按钮显示状态
  259. const buttonVisible = ref(false)
  260. const goBack = () => {
  261. router.go(-1) // 返回上一页
  262. }
  263. const goToAIExperience = outlineData => {
  264. // if (outlineData.ctTypeSort === 2) {
  265. router.push({
  266. path: '/ai-develop', // 跳转视频页面
  267. query: { typeId: outlineData.id, typeName: outlineData.ctType }
  268. })
  269. // } else {
  270. // Message().notifyWarning(localStorage.getItem('userName') === "aiTest" ? '您的账号并未开放此课程!' : '演示版未开放此课程!', true)
  271. // }
  272. }
  273. </script>
  274. <style scoped lang="scss">
  275. @use 'sass:math';
  276. // 定义rpx转换函数
  277. @function rpx($px) {
  278. @return math.div($px, 750) * 100vw;
  279. }
  280. /* 添加过渡样式 */
  281. .drawer-slide-enter-active,
  282. .drawer-slide-leave-active {
  283. transition: all 0.3s ease;
  284. }
  285. .drawer-slide-enter-from,
  286. .drawer-slide-leave-to {
  287. transform: translateX(-100%);
  288. opacity: 0;
  289. transition: all 0.3s ease;
  290. }
  291. .home-container {
  292. position: fixed;
  293. top: 0;
  294. left: 0;
  295. right: 0;
  296. bottom: 0;
  297. display: flex;
  298. flex-direction: row;
  299. background: linear-gradient(
  300. to bottom,
  301. #e2ddfc,
  302. #f1effd
  303. ); /* 设置悬停、聚焦、点击状态下的背景色 */
  304. gap: rpx(0);
  305. }
  306. .sidebar-layout {
  307. display: flex;
  308. flex-direction: row;
  309. align-items: flex-start;
  310. }
  311. .icon-wrapper {
  312. width: 40px; /* 根据实际需要调整宽度 */
  313. flex-shrink: 0;
  314. background-color: saddlebrown;
  315. }
  316. .main-content {
  317. width: rpx(135);
  318. height: 100%;
  319. flex-grow: 1;
  320. background: linear-gradient(to bottom, hsl(230, 100%, 21%), #8a78d0); position: relative;
  321. overflow-y: auto; /* 添加垂直滚动条 */
  322. max-height: 100%; /* 设置最大高度 */
  323. transition: all 0.3s ease;
  324. // 自定义滚动条样式
  325. &::-webkit-scrollbar {
  326. width: rpx(0); // 滚动条宽度
  327. }
  328. &::-webkit-scrollbar-track {
  329. background-color: rgba(255, 255, 255, 0.1); // 滚动条轨道背景色
  330. border-radius: rpx(2); // 滚动条轨道圆角
  331. }
  332. &::-webkit-scrollbar-thumb {
  333. background-color: rgba(255, 255, 255, 0.3); // 滚动条滑块颜色
  334. border-radius: rpx(2); // 滚动条滑块圆角
  335. transition: background-color 0.3s ease; // 滑块颜色过渡效果
  336. }
  337. &::-webkit-scrollbar-thumb:hover {
  338. background-color: rgba(255, 255, 255, 0.5); // 鼠标悬停时的滑块颜色
  339. }
  340. }
  341. .icon-expand {
  342. width: rpx(8);
  343. height: rpx(35);
  344. border-top-right-radius: rpx(5);
  345. border-bottom-right-radius: rpx(5);
  346. z-index: 9999;
  347. position: absolute;
  348. top: 50%;
  349. transform: translateY(-50%);
  350. cursor: pointer; // 添加鼠标指针样式
  351. // 修改裁剪路径使右侧边缘垂直无缝贴合
  352. clip-path: polygon(0 0, 100% 15%, 100% 90%, 0 100%);
  353. display: flex;
  354. justify-content: center;
  355. align-items: center;
  356. // 统一过渡时间与菜单保持同步
  357. transition: all 0.3s ease;
  358. }
  359. .icon-expand .vertical-lines {
  360. color: #8a78d0;
  361. font-size: rpx(10);
  362. }
  363. .content-box {
  364. flex: 1;
  365. height: 100%;
  366. display: flex;
  367. flex-direction: column; /* 子元素上下排列 */
  368. background: linear-gradient(
  369. to bottom,
  370. #e2ddfc,
  371. #f1effd
  372. ); /* 设置悬停、聚焦、点击状态下的背景色 */
  373. }
  374. .tac .el-menu {
  375. background-color: transparent;
  376. border: none;
  377. width: 100%;
  378. margin-left: rpx(10);
  379. margin-top: rpx(10);
  380. }
  381. .mb-2 {
  382. color: white;
  383. font-size: rpx(9);
  384. margin-left: rpx(10);
  385. }
  386. .mb-2 img {
  387. width: rpx(15);
  388. height: rpx(15);
  389. vertical-align: middle;
  390. margin-top: rpx(-2);
  391. margin-left: rpx(-5);
  392. }
  393. .el-menu-item {
  394. width: rpx(115);
  395. // height: rpx(20);
  396. margin-bottom: rpx(5);
  397. border-radius: rpx(6);
  398. color: white;
  399. font-size: rpx(8);
  400. }
  401. .el-menu ::v-deep(.el-menu-item:hover),
  402. .el-menu ::v-deep(.el-menu-item:focus),
  403. .el-menu ::v-deep(.el-menu-item:active) {
  404. background: linear-gradient(
  405. to bottom,
  406. #ffefb0,
  407. #ffcc00
  408. ); /* 设置悬停、聚焦、点击状态下的背景色 */
  409. box-shadow: 0 8px 8px rgb(0, 0, 0, 0.3);
  410. color: black;
  411. }
  412. .drawer-box {
  413. position: absolute;
  414. display: flex;
  415. // align-items: center;
  416. margin-top: rpx(30);
  417. height: 100%;
  418. width: 100%;
  419. }
  420. .drawer-box .toggle-button {
  421. width: rpx(10);
  422. height: rpx(50);
  423. background-color: rgba(165, 209, 247, 0.2);
  424. border: none;
  425. position: relative;
  426. writing-mode: vertical-lr; // 文字垂直排列,从左到右
  427. text-orientation: upright; // 文字保持正立
  428. }
  429. .toggle-button:hover {
  430. left: 0;
  431. }
  432. .drawer-box ::v-deep(.el-drawer.ltr) {
  433. background-color: rgb(255, 255, 255, 0.7);
  434. box-shadow: 0 8px 8px rgba(202, 52, 52, 0.1);
  435. }
  436. .drawer-box ::v-deep(.el-drawer__header) {
  437. margin-bottom: rpx(0);
  438. }
  439. .drawer-box ::v-deep(.el-drawer__body)::-webkit-scrollbar {
  440. width: rpx(4);
  441. }
  442. .drawer-box ::v-deep(.el-drawer__body)::-webkit-scrollbar-thumb {
  443. background-color: rgba(0, 0, 0, 0.2);
  444. border-radius: 8px;
  445. }
  446. .drawer-box ::v-deep(.el-drawer__body)::-webkit-scrollbar-track {
  447. background-color: rgba(0, 0, 0, 0.05);
  448. border-radius: 8px;
  449. }
  450. .toggle-button.is-active,
  451. .toggle-button:active,
  452. .toggle-button:focus {
  453. background-color: rgba(165, 209, 247, 0.8);
  454. color: black;
  455. border: none; // 移除点击时的边框
  456. outline: none; // 移除点击时的外边框
  457. }
  458. .box-1 {
  459. width: 100%;
  460. height: rpx(50);
  461. display: flex;
  462. justify-content: center;
  463. align-items: center;
  464. box-sizing: border-box;
  465. font-size: rpx(16); // 默认字体大小
  466. }
  467. .inner-box {
  468. height: 100%;
  469. display: flex;
  470. justify-content: center;
  471. align-items: center;
  472. font-size: rpx(16); // 默认字体大小
  473. }
  474. .left-box {
  475. position: relative;
  476. justify-content: flex-start;
  477. align-items: flex-start;
  478. flex: 1; // 设置左侧盒子占比为 2
  479. }
  480. .box-icon {
  481. width: 100%;
  482. height: 100%;
  483. flex: 0.6;
  484. display: flex; // 添加 flex 布局
  485. align-items: center; // 垂直居中
  486. color: black; // 设置图标颜色为白色
  487. padding-left: rpx(15);
  488. font-size: rpx(10); // 设置图标大小,可按需调整
  489. cursor: pointer; // 添加鼠标指针样式
  490. z-index: 999;
  491. }
  492. .box-icon .left-icon {
  493. margin-left: rpx(10);
  494. margin-right: rpx(5); // 设置图标和文字之间的间距 ;
  495. }
  496. .left-box span {
  497. position: absolute;
  498. top: 20px;
  499. left: 20px;
  500. font-size: rpx(11); // 默认字体大小
  501. color: white;
  502. }
  503. .dropdown-box {
  504. width: 100%;
  505. height: 100%;
  506. display: flex; // 添加 flex 布局;
  507. flex: 1;
  508. align-items: center; // 垂直居中;
  509. // padding-right: rpx(0); // 添加右侧内边距;
  510. }
  511. .dropdown-box .el-button {
  512. width: rpx(60); // 设置按钮宽度;
  513. height: rpx(15); // 设置按钮高度;
  514. background-color: rgb(255, 255, 255, 0.7);
  515. border: 1px white solid;
  516. box-shadow: 0 4px 8px rgb(0, 0, 0, 0.3);
  517. color: black;
  518. border: none;
  519. margin-left: rpx(10);
  520. border-radius: rpx(12);
  521. font-size: rpx(8); // 设置字体大小;
  522. }
  523. .dropdown-box .el-button:hover,
  524. .dropdown-box .el-button:focus,
  525. .dropdown-box .el-button:active {
  526. border: none; /* 移除悬停、聚焦、点击状态下的边框 */
  527. outline: none; /* 移除悬停、聚焦、点击状态下的轮廓线 el-scrollbar__view el-dropdown__list */
  528. }
  529. .dropdown-menu {
  530. width: rpx(100);
  531. // height: rpx(60);
  532. border-radius: rpx(5);
  533. border: 1px white solid;
  534. background-color: rgb(255, 255, 255, 0.5);
  535. backdrop-filter: blur(rpx(5));
  536. box-shadow: 0 4px 8px rgba(202, 52, 52, 0.1);
  537. margin-left: rpx(40);
  538. }
  539. .dropdown-menu ::v-deep(.el-dropdown-menu__item) {
  540. font-size: rpx(8);
  541. color: black;
  542. border-radius: rpx(5);
  543. width: rpx(78);
  544. height: rpx(20);
  545. margin-left: rpx(4);
  546. margin-bottom: rpx(8);
  547. }
  548. .dropdown-menu ::v-deep(.el-dropdown-menu__item:hover),
  549. .dropdown-menu ::v-deep(.el-dropdown-menu__item:focus),
  550. .dropdown-menu ::v-deep(.el-dropdown-menu__item:active) {
  551. background: linear-gradient(
  552. to bottom,
  553. #fee78a,
  554. #ffce1b
  555. ); /* 设置悬停、聚焦、点击状态下的背景色 */
  556. }
  557. .right-box {
  558. flex: 2;
  559. position: relative; // 添加相对定位;
  560. }
  561. .top-right-box {
  562. position: absolute; // 添加绝对定位
  563. margin-left: rpx(260); // 调整右边距离
  564. width: rpx(100);
  565. display: flex;
  566. justify-content: flex-end;
  567. }
  568. .top-right-box {
  569. ::v-deep(.el-input__wrapper) {
  570. height: rpx(15);
  571. font-size: rpx(6);
  572. background-color: rgb(255, 255, 255, 0.5);
  573. border-radius: rpx(12);
  574. border: white 1px solid;
  575. color: #aaa5c5;
  576. }
  577. ::v-deep(.el-input__icon) {
  578. color: #aaa5c5; // 设置输入框图标颜色为白色
  579. }
  580. // 添加占位符样式
  581. ::v-deep(.el-input__inner::placeholder) {
  582. color: #aaa5c5;
  583. }
  584. // 添加输入框文字颜色样式
  585. ::v-deep(.el-input__inner) {
  586. color: black;
  587. }
  588. }
  589. // 搜索
  590. .search-input {
  591. width: rpx(200); // 增加搜索框宽度
  592. height: rpx(30); // 增加搜索框高度
  593. font-size: rpx(9);
  594. border-radius: rpx(8); // 添加圆角
  595. border: 1px solid #dcdfe6; // 添加边框
  596. }
  597. ::v-deep(.el-input__inner) {
  598. color: #333; // 调整文字颜色
  599. }
  600. .box-2 {
  601. width: 100%;
  602. flex: 1;
  603. box-sizing: border-box;
  604. display: flex; // 确保子元素水平排列
  605. flex-wrap: wrap; // 允许子元素换行;
  606. cursor: pointer; // 添加鼠标指针样式
  607. margin: rpx(10) 0;
  608. overflow-y: auto;
  609. }
  610. // Chrome、Edge等浏览器的滚动条样式
  611. .box-2::-webkit-scrollbar {
  612. width: rpx(2);
  613. }
  614. .box-2::-webkit-scrollbar-track {
  615. background: transparent; // 设置滚动条轨道背景
  616. border-radius: rpx(3); // 设置滚动条轨道圆角
  617. }
  618. .box-2::-webkit-scrollbar-thumb {
  619. background: linear-gradient(to bottom, hsl(230, 100%, 21%), #8a78d0);
  620. border-radius: rpx(3); // 设置滚动条滑块圆角
  621. }
  622. .box-2::-webkit-scrollbar-thumb:hover {
  623. background: linear-gradient(to bottom, hsl(230, 100%, 21%), #8a78d0);
  624. }
  625. .small-box {
  626. flex: 0 0 calc(33.333% - rpx(10)); // 每个小盒子占三分之一宽度,减去间距
  627. margin-left: rpx(10); // 设置小盒子间距
  628. margin-top: rpx(3); // 设置小盒子间距
  629. display: flex;
  630. flex-direction: column;
  631. justify-content: flex-start;
  632. align-items: center;
  633. color: black;
  634. font-size: rpx(8);
  635. }
  636. .nested-box {
  637. width: rpx(150);
  638. height: rpx(80);
  639. border-radius: rpx(10);
  640. margin-top: rpx(5);
  641. display: flex;
  642. border: 1px solid white; // 添加边框;
  643. justify-content: center;
  644. align-items: center;
  645. }
  646. .nested-box:hover,
  647. .nested-box:active {
  648. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  649. }
  650. .additional-text {
  651. margin-top: auto;
  652. margin-bottom: rpx(4);
  653. font-size: rpx(8);
  654. }
  655. </style>
  656. <style lang="scss">
  657. /* 消除小三角 */
  658. .el-popper__arrow {
  659. display: none;
  660. }
  661. .el-popper.is-light,
  662. .el-dropdown__popper.el-popper {
  663. background: transparent;
  664. border: none;
  665. box-shadow: none;
  666. }
  667. .el-dropdown__popper {
  668. --el-dropdown-menuItem-hover-color: none;
  669. }
  670. </style>
  671. <style lang='scss'>
  672. // 搜索下拉框样式
  673. @use 'sass:math';
  674. // 定义rpx转换函数
  675. @function rpx($px) {
  676. @return math.div($px, 750) * 100vw;
  677. }
  678. .el-autocomplete-suggestion .el-scrollbar__wrap{
  679. margin: 0 auto;
  680. background-color: rgba(255, 255, 255, 0.7);
  681. border: 2px solid white;
  682. border-radius: rpx(5);
  683. backdrop-filter: blur(rpx(5));
  684. }
  685. .el-autocomplete-suggestion li{
  686. color: black;
  687. font-size: rpx(7);
  688. padding: rpx(5) rpx(8); // 调整下拉项内边距
  689. }
  690. .el-autocomplete-suggestion li:hover{
  691. background: linear-gradient(
  692. to bottom,
  693. #ffefb0,
  694. #ffcc00
  695. );
  696. }
  697. </style>