diff --git a/Reject.html b/Reject.html index 4f217f2..207314f 100644 --- a/Reject.html +++ b/Reject.html @@ -3408,23 +3408,9 @@ window.confirmTerminate = confirmTerminate; window.confirmSupplierToCooperation = confirmSupplierToCooperation; window.loadSuppliers = loadSuppliers; - // 修复showImageViewer未定义问题,先定义函数再赋值 -function showImageViewer(imageUrl) { - const viewer = document.getElementById('imageViewer'); - const viewerImage = document.getElementById('viewerImage'); - viewerImage.src = imageUrl; - viewer.classList.add('active'); - viewer.style.display = 'flex'; - document.body.style.overflow = 'hidden'; // 阻止背景滚动 - - // 重置缩放和位置 - scale = 1; - translateX = 0; - translateY = 0; - - if (viewerImage.style.transform) { - viewerImage.style.transform = 'scale(1) translate(0, 0)'; - } + // 修复showImageViewer未定义问题,直接调用openImageViewer函数 +function showImageViewer(imgElement) { + openImageViewer(imgElement); } @@ -3472,29 +3458,17 @@ function showImageViewer(imageUrl) { const supplyItem = imgElement.closest('.supply-item'); if (supplyItem) { - // 获取该产品项中所有图片 - const allImages = supplyItem.querySelectorAll('.supply-images img'); + // 获取该产品项中所有带有data-product-image属性的图片,包括证明材料 + const allImages = supplyItem.querySelectorAll('img[data-product-image="true"]'); currentImageUrls = Array.from(allImages).map(img => img.src.split('?')[0]); // 找到当前图片在数组中的索引 currentImageIndex = currentImageUrls.findIndex(url => url === currentImageUrl); if (currentImageIndex === -1) currentImageIndex = 0; } else { - // 检查是否是供应商证明材料的图片 - const proofItem = imgElement.closest('.proof-item'); - if (proofItem && proofItem.closest('.supplier-detail-content')) { - // 查找同一份供应商证明中的所有图片 - const allSupplierImages = document.querySelectorAll('.supplier-detail-content .proof-item img[data-product-image="true"]'); - currentImageUrls = Array.from(allSupplierImages).map(img => img.src.split('?')[0]); - - // 找到当前图片在数组中的索引 - currentImageIndex = currentImageUrls.findIndex(url => url === currentImageUrl); - if (currentImageIndex === -1) currentImageIndex = 0; - } else { - // 其他情况,只显示当前图片 - currentImageUrls = [currentImageUrl]; - currentImageIndex = 0; - } + // 其他情况,只显示当前图片 + currentImageUrls = [currentImageUrl]; + currentImageIndex = 0; } viewerImage.src = currentImageUrls[currentImageIndex]; diff --git a/supply.html b/supply.html index 294355a..efe4faf 100644 --- a/supply.html +++ b/supply.html @@ -1672,7 +1672,7 @@ let editAllSourceTypes = ['平台货源', '三方认证', '三方未认证']; let editFilteredSourceTypes = [...editAllSourceTypes]; let editSelectedSourceType = ''; - let editAllCategories = ['粉壳', '红壳', '绿壳', '白壳']; + let editAllCategories = ['粉壳', '褐壳', '绿壳', '白壳']; let editFilteredCategories = [...editAllCategories]; let editSelectedCategory = ''; let editAllProductNames = ['罗曼粉', '伊莎粉', '罗曼灰', '海蓝灰', '海蓝褐', '绿壳', '双黄蛋']; @@ -1851,7 +1851,7 @@ let selectedYolk = ''; // 种类选择功能 - let allCategoryOptions = ['粉壳', '红壳', '绿壳', '白壳']; + let allCategoryOptions = ['粉壳', '褐壳', '绿壳', '白壳']; let filteredCategoryOptions = [...allCategoryOptions]; let selectedCategory = '';