...
|
...
|
@@ -58,7 +58,6 @@ function previewImage(file) { |
|
|
text += '<div class="evaluate_pic_item" style="float:left">' +
|
|
|
'<img src="' + pic + '" class="delimg"/>' +
|
|
|
'<div class="icon">' +
|
|
|
'<img src="../img/10拷贝2@2x_59.png" />' +
|
|
|
'</div>' +
|
|
|
'</div>'
|
|
|
$(".addimg").append(text);
|
...
|
...
|
@@ -72,124 +71,6 @@ function previewImage(file) { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//图片2
|
|
|
//function previewImage1(file) {
|
|
|
// var MAXWIDTH = 60;
|
|
|
// var MAXHEIGHT = 60;
|
|
|
// var div = document.getElementById('preview1');
|
|
|
// if(file.files && file.files[0]) {
|
|
|
// div.innerHTML = '<img id=imghead1 onclick=$("#previewImg1").click()>';
|
|
|
// var img = document.getElementById('imghead1');
|
|
|
// img.onload = function() {
|
|
|
// var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
|
|
// img.width = rect.width;
|
|
|
// img.height = rect.height;
|
|
|
// // img.style.marginLeft = rect.left+'px';
|
|
|
// img.style.marginTop = rect.top + 'px';
|
|
|
// }
|
|
|
// var reader = new FileReader();
|
|
|
// reader.onload = function(evt) {
|
|
|
// img.src = evt.target.result;
|
|
|
// }
|
|
|
// reader.readAsDataURL(file.files[0]);
|
|
|
// } else //兼容IE
|
|
|
// {
|
|
|
// var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
|
|
|
// file.select();
|
|
|
// var src = document.selection.createRange().text;
|
|
|
// div.innerHTML = '<img id=imghead>';
|
|
|
// var img = document.getElementById('imghead');
|
|
|
// img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
|
|
|
// var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
|
|
// status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
|
|
|
// div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
|
|
|
// }
|
|
|
// var formData = new FormData();
|
|
|
// var fileM=document.querySelector("#previewImg");
|
|
|
// var fileObj=fileM.files[0];
|
|
|
//
|
|
|
// formData.append("files",fileObj);
|
|
|
//
|
|
|
// $.ajax({
|
|
|
// url: 'http://hula.wx.bronet.cn/index.php/MyComment/upload',
|
|
|
// type: 'POST',
|
|
|
// data: formData,
|
|
|
// async: false,
|
|
|
// cache: false,
|
|
|
// contentType: false,
|
|
|
// processData: false,
|
|
|
// success: function(res) {
|
|
|
// console.log(res);
|
|
|
// pic1=res.data;
|
|
|
// console.log(pic1);
|
|
|
// $(".pic1").val(pic1);
|
|
|
// imgurl.push(pic1);
|
|
|
//
|
|
|
// },
|
|
|
// error: function() {
|
|
|
//
|
|
|
// }
|
|
|
// });
|
|
|
//}
|
|
|
//
|
|
|
////图片3
|
|
|
//function previewImage2(file) {
|
|
|
// var MAXWIDTH = 60;
|
|
|
// var MAXHEIGHT = 60;
|
|
|
// var div = document.getElementById('preview2');
|
|
|
// if(file.files && file.files[0]) {
|
|
|
// div.innerHTML = '<img id=imghead2 onclick=$("#previewImg2").click()>';
|
|
|
// var img = document.getElementById('imghead2');
|
|
|
// img.onload = function() {
|
|
|
// var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
|
|
// img.width = rect.width;
|
|
|
// img.height = rect.height;
|
|
|
// // img.style.marginLeft = rect.left+'px';
|
|
|
// img.style.marginTop = rect.top + 'px';
|
|
|
// }
|
|
|
// var reader = new FileReader();
|
|
|
// reader.onload = function(evt) {
|
|
|
// img.src = evt.target.result;
|
|
|
// }
|
|
|
// reader.readAsDataURL(file.files[0]);
|
|
|
// } else //兼容IE
|
|
|
// {
|
|
|
// var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
|
|
|
// file.select();
|
|
|
// var src = document.selection.createRange().text;
|
|
|
// div.innerHTML = '<img id=imghead>';
|
|
|
// var img = document.getElementById('imghead');
|
|
|
// img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
|
|
|
// var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
|
|
// status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
|
|
|
// div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
|
|
|
// }
|
|
|
// var formData = new FormData();
|
|
|
// var fileM=document.querySelector("#previewImg");
|
|
|
// var fileObj=fileM.files[0];
|
|
|
//
|
|
|
// formData.append("files",fileObj);
|
|
|
//
|
|
|
// $.ajax({
|
|
|
// url: 'http://hula.wx.bronet.cn/index.php/MyComment/upload',
|
|
|
// type: 'POST',
|
|
|
// data: formData,
|
|
|
// async: false,
|
|
|
// cache: false,
|
|
|
// contentType: false,
|
|
|
// processData: false,
|
|
|
// success: function(res) {
|
|
|
// console.log(res);
|
|
|
// pic2=res.data;
|
|
|
// console.log(pic2);
|
|
|
// $(".pic2").val(pic2);
|
|
|
// imgurl.push(pic1);
|
|
|
// },
|
|
|
// error: function() {
|
|
|
//
|
|
|
// }
|
|
|
// });
|
|
|
//}
|
|
|
|
|
|
function clacImgZoomParam(maxWidth, maxHeight, width, height) {
|
|
|
var param = {
|
...
|
...
|
@@ -261,7 +142,7 @@ $(".footer").click(function() { |
|
|
console.log(res);
|
|
|
if(res.status == true) {
|
|
|
alert("评论成功");
|
|
|
window.location.reload();
|
|
|
window.location.href='/index.php?g=&m=template&a=finishdetails&oid='+oid;
|
|
|
} else {
|
|
|
alert(res.msg);
|
|
|
}
|
...
|
...
|
|