Commit da3afd1f authored by agping's avatar agping

收款修改 盘方修改

parent cd9cfdf8
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
<div class="modal-footer"> <div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭 <!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>--> </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> </button>
</div> </div>
......
...@@ -21,7 +21,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -21,7 +21,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
var _imgMaskObj = $('#img_mask_area'); //预览大图的mask var _imgMaskObj = $('#img_mask_area'); //预览大图的mask
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
_doc.on('click', 'a[href="#modal-time"]', function(e){ _doc.on('click', 'a[href="#modal-time"]', function(e){
follow.house_id = $ (this).attr ("data-id"); follow.house_id = $ (this).attr ("data-id");
e.preventDefault(); e.preventDefault();
...@@ -32,6 +32,20 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -32,6 +32,20 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$("#search").click(function() { $("#search").click(function() {
follow.getList(1); follow.getList(1);
}); });
//点击收款图片 2.2版本
// $(".add-pic").click(function() {
// follow.getaddPicList();
// });
_doc.on('click', '.add-pic', function(){
follow.getaddPicList();
});
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
}); });
...@@ -109,7 +123,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -109,7 +123,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
url: '/index/delHouseFile', url: '/index/delHouseFile',
data: { data: {
'id': _imgId, 'id': _imgId,
'house_id': _id 'house_id': 3104,
}, },
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
...@@ -140,17 +154,55 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -140,17 +154,55 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
} }
}; };
}); });
//图片预览点击放大事件 //图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) { _doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src); _imgMaskObj.show().find('img').attr('src', this.src);
}); });
_imgMaskObj.click(function(e) { _imgMaskObj.click(function(e) {
this.style.display = 'none'; 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){ addphone2:function(obj){
...@@ -202,6 +254,34 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -202,6 +254,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) { exportList: function(pageNo) {
console.log(2); console.log(2);
......
...@@ -592,6 +592,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -592,6 +592,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
business.getList(1);
console.log(666); console.log(666);
} }
} }
......
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