PlantExperts.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!-- 植物专家|图生视频 -->
  2. <template>
  3. <!-- 植物专家 -->
  4. <div class="home-container">
  5. <!-- 展开收起侧边栏 -->
  6. <div
  7. class="icon-expand"
  8. :style="{
  9. backgroundColor: drawerVisible ? '#44449c' : '#7F70C840',
  10. left: drawerVisible ? '18%' : '0'
  11. }"
  12. @click="toggleDrawer"
  13. >
  14. <span
  15. class="vertical-lines"
  16. :style="{
  17. color: drawerVisible ? '#8a78d0' : 'white'
  18. }"
  19. >||</span
  20. >
  21. </div>
  22. <!-- 左侧折叠面板 -->
  23. <LeftPanel ref="leftPanelRef" v-if="drawerVisible"/>
  24. <div class="left-group2">
  25. <div class="title-box">
  26. <div class="box-icon" @click="goBack">
  27. <el-icon class="left-icon"><ArrowLeftBold /></el-icon>
  28. 返回首页|植物专家
  29. </div>
  30. </div>
  31. <div class="img-box">
  32. <p>
  33. <img
  34. src="@/assets/images/farm.png"
  35. class="avatar user"
  36. />
  37. </p>
  38. <p>一起来认识神奇的植物吧~</p>
  39. </div>
  40. </div>
  41. <!-- 右侧图生视频组件 -->
  42. <VisionThink />
  43. </div>
  44. </template>
  45. <script setup>
  46. import { ref } from 'vue'
  47. import { useRouter } from 'vue-router'
  48. import { ArrowLeftBold } from '@element-plus/icons-vue'
  49. import LeftPanel from '@/components/LeftPanel.vue'
  50. import {homeRoutes} from "@/router/index.js";
  51. import VisionThink from "@/components/ai/vision/VisionThink.vue";
  52. const router = useRouter()
  53. const leftPanelRef = ref(null)
  54. const drawerVisible = ref(true)
  55. // 返回首页
  56. const goBack = () => {
  57. router.push(homeRoutes.home);
  58. }
  59. // 添加切换抽屉显示状态的函数
  60. const toggleDrawer = () => {
  61. drawerVisible.value = !drawerVisible.value
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. @use 'sass:math';
  66. // 定义rpx转换函数
  67. @function rpx($px) {
  68. @return math.div($px, 750) * 100vw;
  69. }
  70. .home-container {
  71. position: fixed;
  72. top: 0;
  73. left: 0;
  74. right: 0;
  75. bottom: 0;
  76. display: flex;
  77. flex-direction: row;
  78. gap: rpx(0);
  79. background: linear-gradient(
  80. to bottom,
  81. #e2ddfc,
  82. #f1effd
  83. );
  84. }
  85. .icon-expand {
  86. width: rpx(8);
  87. height: rpx(35);
  88. border-top-right-radius: rpx(5);
  89. border-bottom-right-radius: rpx(5);
  90. z-index: 50;
  91. position: absolute;
  92. top: 50%;
  93. left: 18%;
  94. transform: translateY(-50%);
  95. background-color: #44449c;
  96. cursor: pointer;
  97. clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. transition: all 0.3s ease;
  102. }
  103. .icon-expand .vertical-lines {
  104. color: #8a78d0;
  105. font-size: rpx(10);
  106. }
  107. .left-group2 {
  108. width: rpx(150);
  109. height: 100%;
  110. background-color: #ece9fd;
  111. }
  112. .left-group2 img {
  113. width: fit-content;
  114. height: rpx(100);
  115. margin: rpx(5);
  116. }
  117. .title-box {
  118. height: rpx(50);
  119. }
  120. .box-icon {
  121. width: 100%;
  122. height: 100%;
  123. flex: 1;
  124. display: flex;
  125. align-items: center;
  126. color: black;
  127. padding-left: rpx(15);
  128. font-size: rpx(10);
  129. cursor: pointer;
  130. }
  131. // .box-icon .left-icon {
  132. // margin-left: rpx(10);
  133. // margin-right: rpx(5);
  134. // }
  135. .img-box {
  136. margin-top: rpx(50);
  137. color: #a39dce;
  138. }
  139. .img-box p {
  140. font-size: rpx(10);
  141. }
  142. </style>