|
|
@@ -33,6 +33,7 @@
|
|
|
border: #cccccc solid 1px;
|
|
|
display: flex;
|
|
|
justify-content: left;
|
|
|
+ margin-bottom: 20px;
|
|
|
}
|
|
|
.img-style{
|
|
|
width: 90px;
|
|
|
@@ -51,14 +52,9 @@
|
|
|
<div class="title-div">
|
|
|
<div class="title-font" >产品技术资料</div>
|
|
|
</div>
|
|
|
- <div class="margin-style">
|
|
|
- <div class="div-border">
|
|
|
- <img src="./img/word.svg" class="img-style">
|
|
|
- <div class="content-style">BLGX支耳式蜗轮型中线蝶阀DN50-600 PN16送审图(自制整轴)</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="margin-style" id="boxContainer"></div>
|
|
|
+ <div class="margin-style" id="dataContainer"></div>
|
|
|
<script>
|
|
|
+ let dataList = []
|
|
|
window.onload = async function(){
|
|
|
var loc=location.href;
|
|
|
var n1=loc.length;
|
|
|
@@ -76,13 +72,34 @@
|
|
|
.then(function (response) {
|
|
|
console.log(response)
|
|
|
console.log(response.data.data.length)
|
|
|
- for (var i=0;i<response.data.data.length -1;i++){
|
|
|
- a='<div class="div-border">';
|
|
|
- a += '<img src="./img/word.svg" class="img-style">';
|
|
|
- a += '<div class="content-style">'+response.data.data[i].remarks+'</div>';
|
|
|
- a+='</div>';
|
|
|
- $(".boxContainer").append(a);
|
|
|
- }
|
|
|
+ response.data.data.forEach(item => {
|
|
|
+ const div = document.createElement('div');
|
|
|
+ div.className = 'div-border';
|
|
|
+ let iconSrc = '';
|
|
|
+ if (item.attinfos[0].postfix == 'word' || item.attinfos[0].postfix == 'Word') {
|
|
|
+ iconSrc = './img/word.svg';
|
|
|
+ } else if (item.attinfos[0].postfix == 'pdf' || item.attinfos[0].postfix == 'PDF') {
|
|
|
+ iconSrc = './img/pdfType.svg';
|
|
|
+ } else if (item.attinfos[0].postfix == 'png' || item.attinfos[0].postfix == 'PNG' || item.attinfos[0].postfix == 'JPG' || item.attinfos[0].postfix == 'jpg') {
|
|
|
+ iconSrc = './img/pngType.svg';
|
|
|
+ }else if (item.attinfos[0].postfix == 'ppt' || item.attinfos[0].postfix == 'PPT') {
|
|
|
+ iconSrc = './img/ppt.svg';
|
|
|
+ }else if (item.attinfos[0].postfix == 'mp3' || item.attinfos[0].postfix == 'MP3' || item.attinfos[0].postfix == 'MP4' || item.attinfos[0].postfix == 'mp4'
|
|
|
+ || item.attinfos[0].postfix == 'mov' || item.attinfos[0].postfix == 'MOV') {
|
|
|
+ iconSrc = './img/mov.svg';
|
|
|
+ }else if (item.attinfos[0].postfix == 'EXCEL' || item.attinfos[0].postfix == 'excel' || item.attinfos[0].postfix == 'xlsx' || item.attinfos[0].postfix == 'XLSX') {
|
|
|
+ iconSrc = './img/excel.svg';
|
|
|
+ } else {
|
|
|
+ iconSrc = './img/default.svg';
|
|
|
+ }
|
|
|
+ div.innerHTML = `
|
|
|
+ <div class="div-border" >
|
|
|
+ <img src="${iconSrc}" class="img-style">
|
|
|
+ <div class="content-style">${item.remarks}</div>
|
|
|
+ </div>
|
|
|
+ `;
|
|
|
+ dataContainer.appendChild(div);
|
|
|
+ })
|
|
|
})
|
|
|
.catch(function (error) {
|
|
|
console.log(error);
|