Commit 543151ed authored by xinyuandu's avatar xinyuandu

商学院修改

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