소스 검색

projectImage改成逗号分割的多张,样式修改

gcz 1 주 전
부모
커밋
9f1fb387f5
2개의 변경된 파일19개의 추가작업 그리고 10개의 파일을 삭제
  1. 8 5
      src/pages/home/Index.vue
  2. 11 5
      src/pages/products/Index.vue

+ 8 - 5
src/pages/home/Index.vue

@@ -384,7 +384,7 @@ export default {
           // 更新发展历程的描述
           if (data.courseList && Array.isArray(data.courseList)) {
             const historyHtml = data.courseList.map(item => {
-              const time = item.createTime ? new Date(item.createTime).getFullYear() : '未知时间'
+              const time = item.courseDate ? item.courseDate : new Date(item.createTime).getFullYear()
               const description = item.courseDescribe || '暂无描述'
               return `<p><strong>${time}年</strong> - ${description}</p>`
             }).join('')
@@ -430,7 +430,8 @@ export default {
           if (currentCategory && data.rows.length > 0) {
             // 可以根据API返回的数据更新分类的描述信息
             currentCategory.description = data.rows[0].projectProfile || currentCategory.classifyDesc || '为您提供专业的解决方案';
-            currentCategory.projectImage = data.rows[0].projectImage
+            // 从逗号分隔的图片字符串中获取第一张图片
+            currentCategory.projectImage = data.rows[0].projectImage ? data.rows[0].projectImage.split(',')[0].trim() : ''
             // console.log('currentCategory', currentCategory)
           }
         }
@@ -867,7 +868,7 @@ export default {
 
 // 产品中心
 .products-section {
-  background: url('@assets/index-products-bg.png') no-repeat center center;
+  background: url('@assets/index-products-bg.png') no-repeat left center;
   background-size: cover;
   padding: 80px 0;
   position: relative;
@@ -974,8 +975,10 @@ export default {
     }
 
     .detail-image {
+      max-height: 695px;
+      overflow-y: auto;
       img {
-        width: 100%;
+        max-width: 100%;
         object-fit: cover;
         border-radius: 8px;
         box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
@@ -1682,7 +1685,7 @@ export default {
       gap: 25px;
 
       .content-left {
-        flex: none;
+        flex: none!important;
         width: 100%;
 
         img {

+ 11 - 5
src/pages/products/Index.vue

@@ -231,11 +231,17 @@ export default {
               platforms.value[activePlatform.value].subtitle = data.rows[0].projectProfile
             }
 
-            // 使用API返回的产品数据中的projectImage字段
-            const images = data.rows
-              .filter(item => item.projectImage) // 过滤掉没有图片的项目
-              .map(item => imgHost + item.projectImage)
-              .slice(0, 5) // 最多取5张图片
+            // 使用API返回的产品数据中的projectImage字段(处理逗号分隔的图片)
+            const images = []
+            data.rows.forEach(item => {
+              if (item.projectImage) {
+                // 分割逗号分隔的图片字符串
+                const imageList = item.projectImage.split(',').map(img => img.trim()).filter(img => img)
+                imageList.forEach(img => {
+                  images.push(imgHost + img)
+                })
+              }
+            })
 
             if (images.length > 0) {
               platforms.value[activePlatform.value].images = images