Commit ed19259b authored by xishifeng's avatar xishifeng

新增商铺图片修改

parent 557006a1
......@@ -916,7 +916,12 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
alert('新增成功!');
if(_tempTableObj.attr('data-type') === 'edit'){
alert('编辑成功!');
}else{
alert('新增成功!');
};
bargain.taxShow();
} else {
layerTipsX(_data['msg']);
......
......@@ -179,8 +179,9 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
//独家合同
var exclusive_img_str = '';
for(var i in _data['exclusive_img']) {
exclusive_img_str += '<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['exclusive_img'][i]
exclusive_img_str += '<li data-imgid="{id}"><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['exclusive_img'][i]['img_name'],
'id': _data['exclusive_img'][i]['id']
});
};
_imgUploadDujia.html(exclusive_img_str);
......@@ -299,15 +300,17 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
//详情页轮播图
for(var i in _data['slide_show']) {
_imgUploadLunbo.append('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['slide_show'][i]
_imgUploadLunbo.append('<li data-imgid="{id}"><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['slide_show'][i]['img_name'],
'id': _data['slide_show'][i]['id']
}));
};
//楼层平面图
for(var i in _data['plan']) {
_imgUploadLouceng.append('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['plan'][i]
_imgUploadLouceng.append('<li data-imgid="{id}"><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['plan'][i]['img_name'],
'id': _data['plan'][i]['id']
}));
};
......@@ -377,9 +380,47 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
//图片上传删除键事件
_doc.on('click', '.delet-pic-btn', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
confirm('确定删除该文件吗?') && $(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': _id
},
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();
}
};
});
//图片预览点击放大事件
......
......@@ -362,7 +362,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
var _html = ' <option value="" selected="selected">请选择</option>';
$.each(data.data, function(i, n) {
if (n.district_name == name && (typeof name != undefined)) {
_html += '<option value="' + n.id + '">' + n.district_name + '</option>';
_html += '<option selected="selected" value="' + n.id + '">' + n.district_name + '</option>';
} else {
_html += '<option value="' + n.id + '">' + n.district_name + '</option>';
}
......
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