Commit 3f8a8dae authored by agping's avatar agping

收款记录收款图片修改

parent eb13437a
......@@ -272,7 +272,7 @@
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>-->
<button type="button" class="btn btn-primary submit_edit" id=" " data-dismiss="modal">
<button type="button" class="btn btn-primary" id="saveBtn" data-dismiss="modal">
保存
</button>
</div>
......
......@@ -21,7 +21,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
event: function() {
var _doc = $(document);
var _imgMaskObj = $('#img_mask_area'); //预览大图的mask
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
_doc.on('click', 'a[href="#modal-time"]', function(e){
follow.house_id = $ (this).attr ("data-id");
e.preventDefault();
......@@ -32,6 +32,14 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$("#search").click(function() {
follow.getList(1);
});
//点击收款图片 2.2版本
// $(".add-pic").click(function() {
// follow.getaddPicList();
// });
_doc.on('click', '.add-pic', function(){
follow.getaddPicList();
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
......@@ -109,7 +117,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
url: '/index/delHouseFile',
data: {
'id': _imgId,
'house_id': _id
'house_id': 3104,
},
timeout: 30000,
dataType: 'json',
......@@ -140,17 +148,55 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}
};
});
//图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src);
});
_imgMaskObj.click(function(e) {
this.style.display = 'none';
});
//图片上传 2.2版本
});
//保存上传的图片
_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 = location.origin + '/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版本
},
addphone2:function(obj){
......@@ -202,6 +248,34 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}
});
},
//点击收款图片 调用的接口
getaddPicList: function() { //提交
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
_imgUploadLunbo.empty();
$.ajax({
'type': 'GET',
'url': '/index/houseEdit',
data: {
"id": 3104,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
var _data = data['data'];
for(var i in _data['slide_show']) {
_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']
}));
};
// follow.getList(0);
} else {
}
}
});
},
// 导出列表
exportList: function(pageNo) {
console.log(2);
......
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