Commit 896454da authored by agping's avatar agping

商铺列表 换插件

parent 1bf53c5c
...@@ -7,8 +7,18 @@ ...@@ -7,8 +7,18 @@
.p-t-10{ .p-t-10{
margin-top:10px; margin-top:10px;
} }
#xiangqing_pic_btn{ .upload-image-btn{
margin-right: 141px; width: 82px;
height: 40px;
position: relative;
opacity: 0;
z-index: 66;
}
.btn-default-liu{
position: relative;
left: -80px;
z-index: 6;
} }
</style> </style>
<!--默认#page-content-wrapper是隐藏的--> <!--默认#page-content-wrapper是隐藏的-->
...@@ -544,7 +554,8 @@ ...@@ -544,7 +554,8 @@
<div class="form-group full-width-100 full-pic-area"> <div class="form-group full-width-100 full-pic-area">
<label for="">详情页轮播图(至少2张)</label> <label for="">详情页轮播图(至少2张)</label>
<input readonly="readonly" type="text" name="xiangqing_pic_input" class="form-control" style="display: none" id="xiangqing_pic_input" placeholder="请选择图片"> <input readonly="readonly" type="text" name="xiangqing_pic_input" class="form-control" style="display: none" id="xiangqing_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="xiangqing_pic_btn" type="button" data-limittop="20">选择图片</button> <input class="upload-image-btn" id="xiangqing_pic_btn" type="file" data-limittop="20" style="display: inline-block;">
<button class="btn btn-default btn-default-liu">选择图片</button>
<span class="tip"></span> <span class="tip"></span>
<label for="isShowShopDetail">是否对客户展示对内详情图</label> <label for="isShowShopDetail">是否对客户展示对内详情图</label>
<select class="form-control" name="isShowShopDetail" id="isShowShopDetail" data-alert="请选择是否对客户展示对内详情图"> <select class="form-control" name="isShowShopDetail" id="isShowShopDetail" data-alert="请选择是否对客户展示对内详情图">
...@@ -559,7 +570,9 @@ ...@@ -559,7 +570,9 @@
<div class="form-group full-width-100 full-pic-area"> <div class="form-group full-width-100 full-pic-area">
<label for="">楼层平面图(选填)</label> <label for="">楼层平面图(选填)</label>
<input readonly="readonly" type="text" name="louceng_pic_input" class="form-control" style="display: none" id="louceng_pic_input" placeholder="请选择图片"> <input readonly="readonly" type="text" name="louceng_pic_input" class="form-control" style="display: none" id="louceng_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="louceng_pic_btn" type="button" data-limittop="20">选择图片</button> <input readonly="readonly" class="upload-image-btn" id="louceng_pic_btn" type="file" data-limittop="20" style="display: inline-block;">
<button class="btn btn-default btn-default-liu">选择图片</button>
<span class="tip"></span> <span class="tip"></span>
</div> </div>
<ul class="img-pre-ul" id="louceng_pic_ul"></ul> <ul class="img-pre-ul" id="louceng_pic_ul"></ul>
...@@ -568,7 +581,9 @@ ...@@ -568,7 +581,9 @@
<div class="form-group full-width-100 full-pic-area"> <div class="form-group full-width-100 full-pic-area">
<label for="">附件上传(pdf格式,选填,1个)</label> <label for="">附件上传(pdf格式,选填,1个)</label>
<input readonly="readonly" type="text" name="fujian_pre" class="form-control" style="display: none" id="fujian_pre" placeholder="请选择图片"> <input readonly="readonly" type="text" name="fujian_pre" class="form-control" style="display: none" id="fujian_pre" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="fujian_btn" type="button" data-limittop="1" data-spfile="pdf">选择文件</button> <input class="upload-image-btn" id="fujian_btn" type="file" data-limittop="1" data-spfile="pdf" style="display: inline-block;">
<button class="btn btn-default btn-default-liu">选择附件</button>
<span class="tip"></span> <span class="tip"></span>
</div> </div>
<ul class="img-pre-ul" id="fujian_ul"></ul> <ul class="img-pre-ul" id="fujian_ul"></ul>
...@@ -613,7 +628,9 @@ ...@@ -613,7 +628,9 @@
<div class="form-group full-width-100 full-pic-area"> <div class="form-group full-width-100 full-pic-area">
<label for="">独家合同上传</label> <label for="">独家合同上传</label>
<input readonly="readonly" type="text" name="dujia_pic_input" class="form-control" style="display: none" id="dujia_pic_input" placeholder="请选择图片"> <input readonly="readonly" type="text" name="dujia_pic_input" class="form-control" style="display: none" id="dujia_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="dujia_pic_btn" type="button" data-limittop="20">选择图片</button> <input class="upload-image-btn" id="dujia_pic_btn" type="file" data-limittop="20" style="display: inline-block;">
<button class="btn btn-default btn-default-liu">选择图片</button>
<span class="tip"></span> <span class="tip"></span>
</div> </div>
<ul class="img-pre-ul" id="dujia_pic_ul"></ul> <ul class="img-pre-ul" id="dujia_pic_ul"></ul>
......
...@@ -366,3 +366,5 @@ function getTimeStamp(date){ ...@@ -366,3 +366,5 @@ function getTimeStamp(date){
if(location.origin === 'https://api.tonglianjituan.com') { if(location.origin === 'https://api.tonglianjituan.com') {
ServerHostImageLiu = 'http://images.tonglianjituan.com';//正式用正式域名 ServerHostImageLiu = 'http://images.tonglianjituan.com';//正式用正式域名
}; };
//共用新增商铺 全局上传图片
\ No newline at end of file
...@@ -19,7 +19,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function ...@@ -19,7 +19,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
_sublet_id = getUrlParam('sublet_id'), _sublet_id = getUrlParam('sublet_id'),
_doc = $(document), _doc = $(document),
_tpl_landlord_phone1 = $('#my_tpl_landlord_phone1').html(),//手机号码添加的位置模板 _tpl_landlord_phone1 = $('#my_tpl_landlord_phone1').html(),//手机号码添加的位置模板
_urlCut = location.origin + '/resource/lib/Attachments/images/', //要截取的部分url _urlCut = ServerHostImageLiu + '/resource/lib/Attachments/images/', //要截取的部分url
_loadMainItem = $('#main_loading_pic'), //整个页面的加载图标 _loadMainItem = $('#main_loading_pic'), //整个页面的加载图标
_shangpuTypeObj = $('#shangpuType'), //商铺类型 _shangpuTypeObj = $('#shangpuType'), //商铺类型
_showCdObj = $('#showCd'), //显示给C端用户看 _showCdObj = $('#showCd'), //显示给C端用户看
...@@ -466,36 +466,55 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function ...@@ -466,36 +466,55 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
}); });
//图片上传,附件上传处理事件 //图片上传,附件上传处理事件
$(".upload-image-btn").click(function() { $(".upload-image-btn").change(function() {
var _this = $(this), var _this = $(this),
_spFile = _this.data('spfile'), _spFile = _this.data('spfile'),
_limitTop = _this.data('limittop'), _limitTop = _this.data('limittop'),
_fileNum = _this.parent().next().find('.delet-pic-btn').length; //根据删除按钮的个数,确定文件的个数 _fileNum = _this.parent().next().find('.delet-pic-btn').length; //根据删除按钮的个数,确定文件的个数
if(_limitTop && (_fileNum < _limitTop)) { if(_limitTop && (_fileNum < _limitTop)) {
BrowseServer(_this.prev().attr('id'), function(url) { //区分图片 轮播图 平面图 pdf 独家合同
console.log(url); var formData = new FormData();
if(_spFile == 'pdf') { formData.append('type', 'house_img');
if(/(\.pdf)$/i.test(url)) { formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
if(_spFile == 'pdf'){
_this.parent().next().prepend('<li class="pdf-pre-li"><a class="pdf-pre-a" href="{0}" target="_blank" title="点击查看">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({ _this.parent().next().prepend('<li class="pdf-pre-li"><a class="pdf-pre-a" href="{0}" target="_blank" title="点击查看">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': url, '0': ServerHostImageLiu+'/resource/lib/Attachments/images/'+_data.data.internet_img_name,
'1': dealFileName(decodeURI(url.slice(url.lastIndexOf('/') + 1))) '1': _data.data.imgformer_name
})); }));
} else { }else{
alert('所选择的格式不是pdf,请重新选择');
return false;
}
} else {
if(/(\.jpg|\.jpeg|\.png|\.gif|\.bmp)$/i.test(url)) {
_this.parent().next().prepend('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({ _this.parent().next().prepend('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': url '0': ServerHostImageLiu+'/resource/lib/Attachments/images/'+_data.data.internet_img_name
})); }));
} else {
alert('所选择的格式不正确,请重新选择');
return false;
} }
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
}; };
}
}); });
} else { } else {
alert('上传上限为 ' + _limitTop); alert('上传上限为 ' + _limitTop);
return false; return false;
......
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