Commit 248b3c56 authored by xishifeng's avatar xishifeng

商铺编辑接口修改

parent bb7ec675
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="edit" />
<div id="page-content-wrapper">
<style type="text/css">
.form-group {
margin: 10px;
}
.input-100-width {
width: 100px!important;
}
.input-360-width {
width: 360px!important;
}
.textarea-500-width {
width: 500px!important;
}
.list-group-item>.full-width-100+.full-width-100 {
padding-top: 10px;
}
.list-group-item>.full-width-100>label {
width: 60px;
}
.list-group-item>.full-pic-area>label {
width: 120px;
}
.input-add-tel{
margin-top: 16px;
height: 20px;
}
.phone-list-container{
overflow: hidden;
width: 196px;
vertical-align: top!important;
position: relative;
}
.phone-list-container>label{
line-height: 30px;
}
.phone-list-container>input{
float: left;
}
.phone-list-container>ul{
width: 196px;
list-style: none;
padding-left: 0;
float: right;
border: 1px solid #ccc;
border-top: none;
background-color: white;
}
.phone-list-container>ul>li:hover{
background-color: #e0e0e0;
}
.phone-list-container>img{
position: absolute;
right: 5px;
top: 7px;
width: 20px;
}
/*获取百度经纬度样式*/
/*********************************************************百度定位页面iframe引入*************************************/
#position_box {
height: 750px;
background-color: #f0f0f0;
overflow: scroll;
position: relative;
}
div.address-header-bar {
overflow: hidden;
float: left;
}
#address_city_title {
float: left;
width: 150px;
line-height: 60px;
font-size: 30px;
color: #333;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.crile {
float: left;
width: 480px;
overflow: hidden;
position: relative;
}
.crile>input {
line-height: 60px;
box-sizing: border-box;
padding: 0;
border-width: 1px;
width: 100%;
display: block;
border-radius: 30px;
background: #f5f5f5 url('/resource/image/search_ic.png') no-repeat 30px center;
background-size: 28px;
text-indent: 60px;
font-size: 28px;
outline: none;
}
.crile>input::-webkit-search-cancel-button {
-webkit-appearance: none;
}
img.cancel-pic {
width: 28px;
height: 28px;
position: absolute;
right: 0;
top: 0;
box-sizing: content-box;
padding: 15px;
}
#main_ul {
padding: 0 30px;
background-color: white;
font-size: 30px;
}
#main_ul>ul {
padding-left: 0;
}
#main_ul>ul>li {
cursor: pointer;
list-style: none;
}
#main_ul>ul>li+li {
border-top: 1px solid #e0e0e0;
}
#main_ul>ul>li>p:nth-of-type(1) {
color: #333;
padding: 20px 0 10px;
margin: 0;
}
#main_ul>ul>li>p:nth-of-type(2) {
color: #999;
padding-bottom: 20px;
margin: 0;
}
.loading_pic {
font-size: 20px;
text-align: center;
width: 100%;
position: absolute;
top: 150px;
display: none;
}
.loading_pic>img {
width: 120px;
display: block;
margin: 0 auto;
}
.loading_pic>p {
font-size: 20px;
color: #333;
text-align: center;
margin-top: 10px;
color: rgb(51, 51, 51);
}
.no_more {
font-size: 30px;
height: 50px;
line-height: 50px;
text-align: center;
display: none;
}
/**/
#li_dujia_area{
display: none;
}
/*上传图片预览区域*/
.img-pre-ul{
padding-left: 0;
overflow: hidden;
/*width: 100%;*/
}
.img-pre-ul>li{
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.img-pre-ul>li.pdf-pre-li{
height: 70px;
}
.img-pre-ul>li>img{
float: left;
width: 210px;
height: 140px;
object-fit: contain;
}
.img-pre-ul>li>a{
float: left;
width: 210px;
text-align: center;
line-height: 30px;
}
.img-pre-ul>li>a.pdf-pre-a{
line-height: 20px;
word-break: break-all;
}
</style>
<!--不会有异步加载时,样式错乱的问题-->
<style type="text/css">
.form-group {
margin: 10px;
}
.input-100-width {
width: 100px!important;
}
.input-360-width {
width: 360px!important;
}
.textarea-500-width {
width: 500px!important;
}
.list-group-item>.full-width-100+.full-width-100 {
padding-top: 10px;
}
.list-group-item>.full-width-100>label {
width: 60px;
}
.list-group-item>.full-pic-area>label {
width: 120px;
}
.input-add-tel {
margin-top: 16px;
height: 20px;
}
.phone-list-container {
overflow: hidden;
width: 196px;
vertical-align: top!important;
position: relative;
}
.phone-list-container>label {
line-height: 30px;
}
.phone-list-container>input {
float: left;
}
.phone-list-container>ul {
width: 196px;
list-style: none;
padding-left: 0;
float: right;
border: 1px solid #ccc;
border-top: none;
background-color: white;
}
.phone-list-container>ul>li:hover {
background-color: #e0e0e0;
}
.phone-list-container>img {
position: absolute;
right: 5px;
top: 7px;
width: 20px;
}
/*获取百度经纬度样式*/
/*********************************************************百度定位页面iframe引入*************************************/
#position_box {
height: 750px;
background-color: #f0f0f0;
overflow: scroll;
position: relative;
}
div.address-header-bar {
overflow: hidden;
float: left;
}
#address_city_title {
float: left;
width: 150px;
line-height: 60px;
font-size: 30px;
color: #333;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.crile {
float: left;
width: 480px;
overflow: hidden;
position: relative;
}
.crile>input {
line-height: 60px;
box-sizing: border-box;
padding: 0;
border-width: 1px;
width: 100%;
display: block;
border-radius: 30px;
background: #f5f5f5 url('/resource/image/search_ic.png') no-repeat 30px center;
background-size: 28px;
text-indent: 60px;
font-size: 28px;
outline: none;
}
.crile>input::-webkit-search-cancel-button {
-webkit-appearance: none;
}
img.cancel-pic {
width: 28px;
height: 28px;
position: absolute;
right: 0;
top: 0;
box-sizing: content-box;
padding: 15px;
}
#main_ul {
padding: 0 30px;
background-color: white;
font-size: 30px;
}
#main_ul>ul {
padding-left: 0;
}
#main_ul>ul>li {
cursor: pointer;
list-style: none;
}
#main_ul>ul>li+li {
border-top: 1px solid #e0e0e0;
}
#main_ul>ul>li>p:nth-of-type(1) {
color: #333;
padding: 20px 0 10px;
margin: 0;
}
#main_ul>ul>li>p:nth-of-type(2) {
color: #999;
padding-bottom: 20px;
margin: 0;
}
.loading_pic {
font-size: 20px;
text-align: center;
width: 100%;
position: absolute;
top: 150px;
display: none;
}
.loading_pic>img {
width: 120px;
display: block;
margin: 0 auto;
}
.loading_pic>p {
font-size: 20px;
color: #333;
text-align: center;
margin-top: 10px;
color: rgb(51, 51, 51);
}
.no_more {
font-size: 30px;
height: 50px;
line-height: 50px;
text-align: center;
display: none;
}
/**/
#li_dujia_area {
display: none;
}
/*上传图片预览区域*/
.img-pre-ul {
padding-left: 0;
overflow: hidden;
/*width: 100%;*/
}
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.img-pre-ul>li.pdf-pre-li {
height: 70px;
}
.img-pre-ul>li>img {
float: left;
width: 210px;
height: 140px;
object-fit: contain;
cursor: pointer;
}
.img-pre-ul>li>a {
float: left;
width: 210px;
text-align: center;
line-height: 30px;
}
.img-pre-ul>li>a.pdf-pre-a {
line-height: 20px;
word-break: break-all;
}
/*图片点击放大预览区域的样式*/
#img_mask_area {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 1001;
background-color: rgba(0, 0, 0, .3);
display: none;
}
#img_mask_area>img {
width: 900px;
height: 700px;
object-fit: contain;
position: absolute;
left: 50%;
top: 50%;
margin-left: -450px;
margin-top: -350px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
......@@ -263,7 +301,7 @@
</select>
</div>
</li>
<li class="list-group-item" id="li_acr_phone">
<div class="form-group phone-list-container" style="width: 70px;">
<label for="">案场人电话</label>
......@@ -440,7 +478,7 @@
</div>
</div>
</li>
<li class="list-group-item">
<div class="form-group">
<label for="">对内地址</label>
......@@ -500,7 +538,7 @@
</select>
</div>
</li>
<li class="list-group-item">
<div class="form-group full-width-100">
<label for="">佣金规则</label>
......@@ -640,4 +678,10 @@
</div>
</div>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=RTimRTxtj23AYTCkSsPvNDuQkGpR2fPX"></script>
<!--图片点击查看大图-->
<div id="img_mask_area" title="点击任意位置可关闭">
<img />
</div>
</div>
\ No newline at end of file
......@@ -5,50 +5,16 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
user.event ();
},
event: function () {
var _id = getUrlParam('id');
if(_id != null){
$.ajax({
type: 'GET',
url: '/index/houseEdit',
data: {
'id': _id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
//fn(data);
}else {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
}else{
//fn();
};
var _doc = $(document),
var _id = getUrlParam('id'),//地址栏获取的商铺或者街铺id
_doc = $(document),
_shangpuTypeObj = $('#shangpuType'),//商铺类型
_showCdObj = $('#showCd'),//显示给C端用户看
_exclusiveTypeObj = $('#exclusiveType'),//是否独家
_yetaiObj = $('.yetai'),//业态
_roomTagObj = $('.roomTag'),//商铺标签
_landlordPhoneObj = $('#landlordPhone'),//房东手机号
_internalNameObj = $('#internalName'),//对内商铺名称
_foreignNameObj = $('#foreignName'),//对外商铺名称
_landlordPhoneObj = $('#landlordPhone'),//房东手机号
_zujinTypeObj = $('#zujinType'),//租金模式
_moonPriceObj = $('#moonPrice'),//月租均价
_wuyePriceObj = $('#wuyePrice'),//物业管理费
......@@ -86,8 +52,76 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_dajiangtangObj = $('#dajiangtang'),//大讲堂
_exclusiveDate1Obj = $('#exclusiveDate1'),//独家代理有效期开始时间
_exclusiveDate2Obj = $('#exclusiveDate2'),//独家代理有效期结束时间
_exclusiveTelObj = $('#exclusiveTel');//独家方电话
_exclusiveTelObj = $('#exclusiveTel'),//独家方电话
_imgUploadDujia = $('#dujia_pic_ul'),//独家合同ul
_imgMaskObj = $('#img_mask_area');//预览大图的mask
if(_id != null){
$.ajax({
type: 'GET',
url: '/index/houseEdit',
data: {
'id': _id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
_shangpuTypeObj.val(data['data']['shop_type']).change().attr({
'disabled': 'disabled',
'title': '商铺类型暂不支持修改'
});
_showCdObj.val(data['data']['is_show']).change();
_exclusiveTypeObj.val(data['data']['is_exclusive_type']).change();
if(data['data']['shop_type'] == '0'){
//如果是商场
_roomArea2Obj.val(data['data']['shop_area_end']);
};
if(data['data']['is_show'] == '0'){
//如果是显示给C端用户看(对商户公开)
_foreignNameObj.val(data['data']['external_title']);
_addressExternalObj.val(data['data']['external_address']);
_foreignYoushiObj.val(data['data']['external_item_advantage']);
};
if(data['data']['is_exclusive_type'] == '1'){
//如果是独家
// _exclusiveDate1Obj.val(data['data']['external_title']);
// _addressExternalObj.val(data['data']['external_address']);
// _foreignYoushiObj.val(data['data']['external_item_advantage']);
};
$.each(_yetaiObj, function(i, item) {
~data['data']['industry_type'].indexOf(item.value) && (item.checked = 'checked');
});
$.each(_roomTagObj, function(i, item) {
~data['data']['shop_sign'].indexOf(item.value) && (item.checked = 'checked');
});
_landlordPhoneObj.val(data['data']['landlord_phone']);
_internalNameObj.val(data['data']['internal_title']);
_zujinTypeObj.val(data['data']['rent_type']);
_moonPriceObj.val(data['data']['rent_price']);
}else {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
}else{
//fn();
};
//图片上传,附件上传处理事件
$(".upload-image-btn").click(function(){
......@@ -118,7 +152,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
}
}else{
if(/(\.jpg|\.jpeg|\.png|\.gif|\.bmp)$/i.test(url)){
_this.parent().next().prepend('<li><img 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
}));
}else{
......@@ -133,12 +167,20 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
};
});
//图片上传删除键事件
_doc.on('click','.img-pre-ul>li>a',function(e){
e.preventDefault();
e.stopPropagation();
confirm('确定删除该文件吗?') && $(this).parent().hide();
});
//图片预览点击放大事件
_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';
});
/************************************************百度地址定位相关*************************************************************/
//从baidu-position.js移过来
var ulHtml = $('#main_ul>ul'),
......@@ -380,6 +422,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_this.before('<div class="form-group phone-list-container"><input type="tel" class="form-control phone_jia" placeholder="请输入"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic" /></div>');
}else{
alert('最多添加5个');
return false;
};
});
......@@ -584,8 +627,10 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
var _landlordPhoneVal = $.trim(_landlordPhoneObj.val());
if(_landlordPhoneVal == ''){
alert('请输入房东手机号码');
return false;
}else if(!/^[1][0-9]{10}$/.test(_landlordPhoneVal)){
alert('输入的房东手机号格式有误');
return false;
}
//多个input输入框验证
......@@ -734,6 +779,9 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_data['agent_start_time'] = _exclusiveDate1Obj.val();
_data['agent_end_time'] = _exclusiveDate2Obj.val();
_data['exclusive_ids'] = _exclusiveTelObj.attr('data-id');
$.each(_dujiaPicObj, function(i, item) {
_data['exclusive_img['+i+']'] = item.src.replace(_urlCut ,'');
});
};
var _urlCut = location.origin + '/resource/lib/Attachments/';//要截取的部分url
$.each(_acrPhoneArr, function(i, item) {
......@@ -748,9 +796,6 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
$.each(_loucengPicObj, function(i, item) {
_data['plan['+i+']'] = item.src.replace(_urlCut ,'');
});
$.each(_dujiaPicObj, function(i, item) {
_data['exclusive_img['+i+']'] = item.src.replace(_urlCut ,'');
});
if(_fujianObj.length === 1){
_data['file_path'] = _fujianObj[0].href.replace(_urlCut ,'');//附件取得是herf值
};
......
......@@ -7,7 +7,7 @@ function BrowseServer(input_image,fun )
finder.selectActionData = input_image;
if($.isFunction(fun)){
window.fun = fun;
window.browseServerBackFun = fun;
}
finder.popup();
......@@ -26,8 +26,8 @@ function SetFileField( fileUrl , data )
document.getElementById( (data["selectActionData"] )).value = pic[1];
}
if($.isFunction(window.fun)){
window.fun(fileUrl);
if($.isFunction(window.browseServerBackFun)){
window.browseServerBackFun(fileUrl);
}
}
......
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