Commit 543151ed authored by xinyuandu's avatar xinyuandu

商学院修改

parent 3073d4ed
......@@ -178,7 +178,9 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
e.stopPropagation();
if(confirm('确定删除该文件吗?')) {
var _imgId = _this.parent().attr('data-imgid');
var file_id = $(this).parent('li').attr('id') - 0 ;
_this.parent().remove();
user.addDeleteNewsEvent(file_id);
};
});
//图片预览点击放大事件
......@@ -251,7 +253,6 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
//附件
var file_paths = _data['file'];
console.log(file_paths)
for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/');
......@@ -260,30 +261,24 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
}));
}
//添加删除附件事件
user.addDeleteNewsEvent();
} else {}
}
});
},
addDeleteNewsEvent :function(){
$('.delet-pic-btn').unbind('click').bind('click',function(){
var file_id = $(this).parent('li').attr('id') - 0 ;
$.ajax({
url: '/index/delNewsFile',
type: 'POST',
async: true,
data: {'file_id' : file_id},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
alert('文件删除成功');
}
addDeleteNewsEvent :function(id){
$.ajax({
url: '/index/delNewsFile',
type: 'POST',
async: true,
data: {'file_id' : id},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
alert('文件删除成功');
}
});
}
);
}
});
},
getDistrict: function(fn) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment