Commit ce9449d2 authored by agping's avatar agping

后台修改

parent dbf5c1de
......@@ -131,8 +131,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
imgname[i]=$('.result>img').get(i).getAttribute("class");
}
console.log(imgname.join(','));
var id_pic;
if(follow.house_fatherid>0){
id_pic=follow.house_fatherid;
}else{
id_pic=follow.house_id;
}
var _data = {
img_id: follow.house_id,
img_id: id_pic,
img_name: imgname.join(',')
};
......@@ -230,14 +237,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
getaddPicList: function() {//获取收款图片
// container_body
$('.result2,.result').remove();
var id_pic;
var id_pic;
if(follow.house_fatherid>0){
id_pic=follow.house_fatherid;
}else{
id_pic=follow.house_id;
}
$('.result2,.result').remove();
$.ajax({
'type': 'GET',
'url': '/index/receiptImgList',
......
......@@ -225,43 +225,10 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
var _this = $(this);
e.preventDefault();
e.stopPropagation();
_this.parent().remove();
if(confirm('确定删除该文件吗?')){
var _imgId = _this.parent().attr('data-imgid');
if(_imgId){
$.ajax({
type: 'POST',
url: '/index/delHouseFile',
data: {
'id': _imgId,
'house_id': 3104,
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
_this.parent().remove();
} else {
alert(_data['msg']);
}
} else {
alert('数据错误');
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
}else{
_this.parent().remove();
}
};
});
//图片预览点击放大事件
......@@ -271,48 +238,6 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
_imgMaskObj.click(function(e) {
this.style.display = 'none';
});
//保存上传的图片 详情页多张
_doc.on('click', '#saveBtn', function(e) {
var _this = $(this);
var _data={
id:3104,
};
e.preventDefault();
e.stopPropagation();
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _xiangqingPicObj = _imgUploadLunbo.find('li>img');
var _urlCut ='/resource/lib/Attachments/images/';//要截取的部分url
$.each(_xiangqingPicObj, function(i, item) {
_data['slide_show[' + i + ']'] = item.src.replace(_urlCut, '');
});
var _imgId = _this.parent().attr('data-imgid');
$.ajax({
type: 'POST',
url: '/index/houseEdit',
data: _data,
// timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
} else {
alert('数据错误');
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//图片上传 2.2版本
},
addphone:function(obj){
var user_ht=$(obj).html();
......@@ -468,7 +393,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
var news_id = getUrlParam('id');//地址栏获取的商铺或者街铺id
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
var _urlCut ='/resource/lib/Attachments/images/';//要截取的部分url
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
var _dajiangtangObj = $('#dajiangtang'); //大讲堂
$.ajax({
'type': 'GET',
......@@ -521,7 +446,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
add_news : function () {//新增文章 编辑文章
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
var _liebiaoPicObj = _imgUploadLiebiao.find('li>img');
var _urlCut ='/resource/lib/Attachments/images/';//要截取的部分url
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
var _dajiangtangObj = $('#dajiangtang'); //大讲堂
var _dajiangtangVal = _dajiangtangObj.find('iframe').contents().find('body').html();
......@@ -529,15 +454,8 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
alert('列表页封面图需要上传');
return false;
};
var _data = {};
//字符串形式 传过去
// $.each(_liebiaoPicObj, function(i, item) {
// _data['file_img'] = item.src.replace(_urlCut, '');
//// _data['file_img[' + i + ']'] = item.src;
//
// });
console.log(55);
if(getUrlParam('id')){
_data.id = getUrlParam('id');
......@@ -546,32 +464,6 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
_data.s_label_id = $("#district_id2").val();//商学院标签id
_data.file_img = _liebiaoPicObj[0].src.replace(_urlCut, '');//封面图 剪切后的字符串
_data.content = _dajiangtangVal;
// if (params.title == '') {
// alert('标题不能为空');
// $("#announcement_title").focus();
// return ;
// }
// if (params.title.length > 20) {
// alert('标题字数20以内');
// $("#announcement_title").focus();
// return ;
// }
// if (params.content == '') {
// alert('内容不能为空');
// $("#announcement_content").focus();
// return ;
// }
// if (params.content.length > 250) {
// alert('公告内容字数250以内');
// $("#announcement_content").focus();
// return ;
// }
//判断有没有图片
// if(_liebiaoPicObj.length < 1) {
// alert('列表页封面图需要上传');
// return false;
// };
$.ajax ({
url: '/index/addNews',
type: 'POST',
......
......@@ -18,7 +18,6 @@
<td>[%= it[item]["comment_number"] %]</td>
<td>
_data.title = $("#announcement_title").val();
<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]["id"] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_blank">
编辑
</a>
......
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