PlantExperts.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. style=" width: fit-content; height: 180px; margin: 10px;"
  35. src="@/assets/images/farm.png"
  36. class="avatar user"
  37. />
  38. </p>
  39. <p>期待你的画作喔~</p>
  40. </div>
  41. </div>
  42. <!-- 右侧图生视频组件 -->
  43. <ImageToVideo />
  44. </div>
  45. </template>
  46. <script setup>
  47. import { ref } from 'vue'
  48. import { useRouter } from 'vue-router'
  49. import { ArrowLeftBold } from '@element-plus/icons-vue'
  50. import LeftPanel from '@/components/LeftPanel.vue'
  51. import ImageToVideo from '@/components/ai/video/ImageToVideo.vue'
  52. import {homeRoutes} from "@/router/index.js";
  53. const router = useRouter()
  54. const leftPanelRef = ref(null)
  55. const drawerVisible = ref(true)
  56. // 返回首页
  57. const goBack = () => {
  58. router.push(homeRoutes.home);
  59. }
  60. // 添加切换抽屉显示状态的函数
  61. const toggleDrawer = () => {
  62. drawerVisible.value = !drawerVisible.value
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. @use 'sass:math';
  67. // 定义rpx转换函数
  68. @function rpx($px) {
  69. @return math.div($px, 750) * 100vw;
  70. }
  71. .home-container {
  72. position: fixed;
  73. top: 0;
  74. left: 0;
  75. right: 0;
  76. bottom: 0;
  77. display: flex;
  78. flex-direction: row;
  79. gap: rpx(0);
  80. background: linear-gradient(
  81. to bottom,
  82. #e2ddfc,
  83. #f1effd
  84. );
  85. }
  86. .icon-expand {
  87. width: rpx(8);
  88. height: rpx(35);
  89. border-top-right-radius: rpx(5);
  90. border-bottom-right-radius: rpx(5);
  91. z-index: 9999;
  92. position: absolute;
  93. top: 50%;
  94. left: 18%;
  95. transform: translateY(-50%);
  96. background-color: #44449c;
  97. cursor: pointer;
  98. clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
  99. display: flex;
  100. justify-content: center;
  101. align-items: center;
  102. transition: all 0.3s ease;
  103. }
  104. .icon-expand .vertical-lines {
  105. color: #8a78d0;
  106. font-size: rpx(10);
  107. }
  108. .left-group2 {
  109. width: rpx(150);
  110. height: 100%;
  111. background-color: #ece9fd;
  112. }
  113. .left-group2 img {
  114. width: rpx(110);
  115. height: auto;
  116. margin-top: rpx(30);
  117. }
  118. .title-box {
  119. height: rpx(50);
  120. }
  121. .box-icon {
  122. width: 100%;
  123. height: 100%;
  124. flex: 1;
  125. display: flex;
  126. align-items: center;
  127. color: black;
  128. padding-left: rpx(15);
  129. font-size: rpx(10);
  130. cursor: pointer;
  131. }
  132. // .box-icon .left-icon {
  133. // margin-left: rpx(10);
  134. // margin-right: rpx(5);
  135. // }
  136. .img-box {
  137. margin-top: rpx(50);
  138. color: #a39dce;
  139. }
  140. </style>