56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
var photos = [];
|
|
var id = localStorage.getItem("id");
|
|
$(function() {
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: smz_ht_url + '/OwnCertificate/getIdCard',
|
|
data: {id:id},
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
console.log(data)
|
|
if(data.filePath !="null"){
|
|
/*for( var i = 0; i < data.length; i++) {
|
|
photos.push(data[i].filePath);
|
|
}*/
|
|
getDisPhotoList(data);
|
|
}else{
|
|
getDisPhotoList(null);
|
|
}
|
|
console.log(data)
|
|
}
|
|
})
|
|
});
|
|
|
|
// 加载图片
|
|
function getDisPhotoList(data) {
|
|
$("#dowebok").empty();
|
|
var results = data;
|
|
if(results!=null&&results.length>0){
|
|
var html="";
|
|
for(var i=0;i<results.length;i++){
|
|
var l = '';
|
|
if(results[i].filePath.indexOf("http")!=-1){
|
|
l = results[i].filePath;
|
|
}else{
|
|
l =smz_ht_url +"/"+ results[i].filePath;
|
|
}
|
|
var path=l;
|
|
html+="<li class='disPhotoLi'>";
|
|
html += '<img data-original="'+path+'" src="' + path + '" class="img" />';
|
|
html += `<h4 style="display: flex; justify-content: center; margin-top: 3px">${data[i].name}</h4>`;
|
|
html += `<h4 style="display: flex; justify-content: center; margin-top: 3px">${data[i].updateTime}</h4>`;
|
|
html+=" </li>";
|
|
}
|
|
$("#dowebok").append(html);
|
|
var viewer = new Viewer(document.getElementById('dowebok'), {
|
|
url: 'data-original',
|
|
show: function (){
|
|
viewer.update();
|
|
}
|
|
});
|
|
}else{
|
|
var html="<li style='color:black;float: left;border: none; font-size: 20px;height: 20%;position: absolute;\n" + "left: 315px;\n" + "top: 170px;'>没有相关数据</li>";
|
|
$("#dowebok").append(html);
|
|
}
|
|
}
|