Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
7476e3e6
Commit
7476e3e6
authored
Apr 20, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺编辑
parent
6e8c0431
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
61 deletions
+119
-61
edit.html
application/index/view/houses/edit.html
+13
-2
edit.js
public/resource/js/edit.js
+100
-59
public.js
public/resource/js/public.js
+6
-0
No files found.
application/index/view/houses/edit.html
View file @
7476e3e6
...
@@ -293,6 +293,14 @@
...
@@ -293,6 +293,14 @@
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
/*房东手机号样式调整*/
.landlord-form-group
{
margin-top
:
0
!important
;
}
.input-add-tel-landlord
{
margin-top
:
8px
!important
;
}
</style>
</style>
<div
id=
"page-content-wrapper"
>
<div
id=
"page-content-wrapper"
>
...
@@ -441,9 +449,12 @@
...
@@ -441,9 +449,12 @@
</label>
</label>
</li>
</li>
<li
class=
"list-group-item"
>
<li
class=
"list-group-item"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
id=
"li_landlord_phone_input"
>
<label
for=
"internalName"
>
房东手机号
</label>
<label
for=
"internalName"
>
房东手机号
</label>
<input
type=
"tel"
class=
"form-control"
placeholder=
"请输入"
name=
"landlordPhone"
id=
"landlordPhone"
data-alert=
"请填写房东手机号!"
>
<div
class=
"form-group phone-list-container landlord-form-group"
>
<input
type=
"tel"
class=
"form-control phone_jia"
placeholder=
"请输入"
name=
"landlordPhone"
id=
"landlordPhone"
data-alert=
"请填写房东手机号!"
>
</div>
<img
src=
"/resource/image/jia2@2x.png"
class=
"input-add-tel input-add-tel-landlord"
data-addtype=
"landlord"
id=
"landlord_tel_jia"
/>
</div><br>
</div><br>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"internalName"
>
对内商铺名称
</label>
<label
for=
"internalName"
>
对内商铺名称
</label>
...
...
public/resource/js/edit.js
View file @
7476e3e6
...
@@ -14,10 +14,10 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -14,10 +14,10 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_exclusiveTypeObj
=
$
(
'#exclusiveType'
),
//是否独家
_exclusiveTypeObj
=
$
(
'#exclusiveType'
),
//是否独家
_yetaiObj
=
$
(
'.yetai'
),
//业态
_yetaiObj
=
$
(
'.yetai'
),
//业态
_roomTagObj
=
$
(
'.roomTag'
),
//商铺标签
_roomTagObj
=
$
(
'.roomTag'
),
//商铺标签
_landlordPhoneObj
=
$
(
'#landlordPhone'
),
//房东手机号
//_landlordPhoneObj = $('#landlordPhone'),//房东手机号
_landlordPhoneObj
=
$
(
'.li_landlord_phone input'
),
//房东手机号
_internalNameObj
=
$
(
'#internalName'
),
//对内商铺名称
_internalNameObj
=
$
(
'#internalName'
),
//对内商铺名称
_foreignNameObj
=
$
(
'#foreignName'
),
//对外商铺名称
_foreignNameObj
=
$
(
'#foreignName'
),
//对外商铺名称
_landlordPhoneObj
=
$
(
'#landlordPhone'
),
//房东手机号
_zujinTypeObj
=
$
(
'#zujinType'
),
//租金模式
_zujinTypeObj
=
$
(
'#zujinType'
),
//租金模式
_moonPriceObj
=
$
(
'#moonPrice'
),
//月租均价
_moonPriceObj
=
$
(
'#moonPrice'
),
//月租均价
_wuyePriceObj
=
$
(
'#wuyePrice'
),
//物业管理费
_wuyePriceObj
=
$
(
'#wuyePrice'
),
//物业管理费
...
@@ -168,6 +168,30 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -168,6 +168,30 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
~
_data
[
'shop_sign'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
~
_data
[
'shop_sign'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
});
});
//房东手机号
var
_landlordNum
=
0
;
$
.
each
(
_data
[
'landlord_phone'
].
split
(
','
),
function
(
i
,
item
)
{
if
(
_landlordNum
===
0
){
$
(
'#landlord_tel_jia'
).
prev
().
find
(
'input'
).
val
(
item
);
}
else
{
$
(
'#landlord_tel_jia'
).
before
(
'<div class="form-group phone-list-container landlord-form-group"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}"><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
item
}));
};
_landlordNum
++
;
});
for
(
var
i
in
_data
[
'agents_name'
]){
if
(
_acqxNum
==
0
){
$
(
'#acqx_tel_jia'
).
prev
().
find
(
'input'
).
val
(
_data
[
'agents_name'
][
i
]).
attr
(
'data-id'
,
_data
[
'agents_name'
][
i
].
split
(
'-'
)[
0
]);
}
else
{
$
(
'#acqx_tel_jia'
).
before
(
'<div class="form-group phone-list-container"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}" data-id="{1}"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
_data
[
'agents_name'
][
i
],
'1'
:
_data
[
'agents_name'
][
i
].
split
(
'-'
)[
0
]
}));
};
_landlordNum
++
;
};
_landlordPhoneObj
.
val
(
_data
[
'landlord_phone'
]);
//房东手机号
_landlordPhoneObj
.
val
(
_data
[
'landlord_phone'
]);
//房东手机号
_internalNameObj
.
val
(
_data
[
'internal_title'
]);
//对内商铺名称
_internalNameObj
.
val
(
_data
[
'internal_title'
]);
//对内商铺名称
_zujinTypeObj
.
val
(
_data
[
'rent_type'
]);
//租金模式
_zujinTypeObj
.
val
(
_data
[
'rent_type'
]);
//租金模式
...
@@ -555,10 +579,16 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -555,10 +579,16 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
//输入框联系人模糊搜索相关事件添加
//输入框联系人模糊搜索相关事件添加
$
(
'.input-add-tel'
).
click
(
function
(){
$
(
'.input-add-tel'
).
click
(
function
(){
var
_this
=
$
(
this
);
var
_this
=
$
(
this
);
if
(
_this
.
parent
().
find
(
'.phone_jia'
).
length
<
5
){
var
_addType
=
_this
.
attr
(
'data-addtype'
);
_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>'
);
var
_maxLen
=
_addType
===
'landlord'
?
3
:
5
;
var
_htmlStrTemp
=
_addType
===
'landlord'
?
''
:
'<ul></ul>'
;
if
(
_this
.
parent
().
find
(
'.phone_jia'
).
length
<
_maxLen
){
_this
.
before
(
'<div class="form-group phone-list-container{0}"><input type="tel" class="form-control phone_jia" placeholder="请输入">{1}<img src="/resource/image/search_gb.png" class="input-cancel-pic" /></div>'
.
stringFormatObj
({
'0'
:
_addType
===
'landlord'
?
' landlord-form-group'
:
''
,
'1'
:
_addType
===
'landlord'
?
''
:
'<ul></ul>'
}));
}
else
{
}
else
{
alert
(
'最多添加
5
个'
);
alert
(
'最多添加
'
+
_maxLen
+
'
个'
);
return
false
;
return
false
;
};
};
});
});
...
@@ -576,53 +606,57 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -576,53 +606,57 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
var
_ajaxObjTel
=
null
;
var
_ajaxObjTel
=
null
;
_doc
.
on
(
'input'
,
'.phone_jia'
,
function
(){
_doc
.
on
(
'input'
,
'.phone_jia'
,
function
(){
var
_this
=
$
(
this
),
var
_this
=
$
(
this
),
_thisVal
=
$
.
trim
(
_this
.
val
());
_thisVal
=
$
.
trim
(
_this
.
val
()),
_this
.
removeAttr
(
'data-id'
);
//移除之前携带的信息
_addType
=
_this
.
attr
(
'data-addtype'
);
if
(
_thisVal
!=
''
){
if
(
_addType
!==
'landlord'
){
_ajaxObjTel
&&
_ajaxObjTel
.
abort
();
_this
.
removeAttr
(
'data-id'
);
//移除之前携带的信息
_ajaxObjTel
=
$
.
ajax
({
if
(
_thisVal
!=
''
){
type
:
'GET'
,
_ajaxObjTel
&&
_ajaxObjTel
.
abort
();
url
:
'/index/getBroker_new'
,
_ajaxObjTel
=
$
.
ajax
({
data
:
{
type
:
'GET'
,
'phone'
:
$
.
trim
(
_this
.
val
())
url
:
'/index/getBroker_new'
,
},
data
:
{
timeout
:
30000
,
'phone'
:
$
.
trim
(
_this
.
val
())
dataType
:
'json'
,
},
beforeSend
:
function
()
{},
timeout
:
30000
,
success
:
function
(
data
)
{
dataType
:
'json'
,
if
(
typeof
data
===
'object'
)
{
beforeSend
:
function
()
{},
if
(
data
.
code
==
200
)
{
success
:
function
(
data
)
{
if
(
data
[
'data'
].
length
>
0
){
if
(
typeof
data
===
'object'
)
{
var
_htmlTemp
=
''
;
if
(
data
.
code
==
200
)
{
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
if
(
data
[
'data'
].
length
>
0
){
_htmlTemp
+=
'<li data-id="{3}">{2}{0}-{1}<li>'
.
stringFormatObj
({
var
_htmlTemp
=
''
;
'0'
:
item
[
'name'
],
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
'1'
:
item
[
'phone'
],
_htmlTemp
+=
'<li data-id="{3}">{2}{0}-{1}<li>'
.
stringFormatObj
({
'2'
:
_this
.
parent
().
nextAll
(
'.input-add-tel'
).
data
(
'hideid'
)?
''
:(
item
[
'id'
]
+
'-'
),
'0'
:
item
[
'name'
],
'3'
:
item
[
'id'
]
'1'
:
item
[
'phone'
],
});
'2'
:
_this
.
parent
().
nextAll
(
'.input-add-tel'
).
data
(
'hideid'
)?
''
:(
item
[
'id'
]
+
'-'
),
});
'3'
:
item
[
'id'
]
_this
.
next
().
show
().
html
(
_htmlTemp
);
});
}
else
{
});
_this
.
next
().
html
(
''
);
_this
.
next
().
show
().
html
(
_htmlTemp
);
};
}
else
{
}
else
{
_this
.
next
().
html
(
''
);
alert
(
data
[
'msg'
]);
};
};
}
else
{
}
else
{
alert
(
data
[
'msg'
]);
alert
(
'数据错误'
);
};
};
}
else
{
},
alert
(
'数据错误'
);
error
:
function
()
{
};
//alert('error');
},
},
error
:
function
()
{
complete
:
function
(
xhr
,
textStatus
){
//alert('error');
if
(
textStatus
===
'timeout'
){
},
alert
(
'请求超时'
);
complete
:
function
(
xhr
,
textStatus
){
};
if
(
textStatus
===
'timeout'
){
}
alert
(
'请求超时'
);
});
};
}
});
};
};
};
});
});
/***************************************************电话号码输入相关交互处理***************************************************/
/***************************************************电话号码输入相关交互处理***************************************************/
...
@@ -762,14 +796,21 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -762,14 +796,21 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
return
false
;
return
false
;
};
};
var
_landlordPhoneVal
=
$
.
trim
(
_landlordPhoneObj
.
val
());
var
_landlordPhoneArr
=
[];
if
(
_landlordPhoneVal
==
''
){
$
.
each
(
$
(
'#li_landlord_phone_input input'
),
function
(
i
,
item
)
{
alert
(
'请输入房东手机号码'
);
var
_valTemp
=
$
.
trim
(
$
(
item
).
val
());
return
false
;
if
(
_valTemp
!==
''
){
}
else
if
(
!
/^
[
1
][
0-9
]{10}
$/
.
test
(
_landlordPhoneVal
)){
if
(
is_mobile
(
_valTemp
)){
alert
(
'输入的房东手机号格式有误'
);
_landlordPhoneArr
.
push
(
_valTemp
);
}
else
{
alert
(
'填写的第'
+
(
i
+
1
)
+
'个房东手机号格式有误'
);
}
};
});
if
(
_landlordPhoneArr
.
length
<
1
){
alert
(
'房东手机号至少需要选择一个!'
);
return
false
;
return
false
;
}
}
;
//多个input输入框验证
//多个input输入框验证
$
.
each
([
$
.
each
([
...
@@ -876,7 +917,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
...
@@ -876,7 +917,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
'agent_dish'
:
_pfPhoneArr
.
join
(
','
),
'agent_dish'
:
_pfPhoneArr
.
join
(
','
),
'agent_data'
:
_acqxPhoneArr
.
join
(
','
),
'agent_data'
:
_acqxPhoneArr
.
join
(
','
),
'internal_title'
:
$
.
trim
(
_internalNameObj
.
val
()),
'internal_title'
:
$
.
trim
(
_internalNameObj
.
val
()),
'landlord_phone'
:
_landlordPhone
Val
,
'landlord_phone'
:
_landlordPhone
Arr
.
join
(
','
)
,
'rent_type'
:
_zujinTypeObj
.
val
(),
'rent_type'
:
_zujinTypeObj
.
val
(),
'rent_price'
:
_moonPriceObj
.
val
(),
'rent_price'
:
_moonPriceObj
.
val
(),
'management_fee'
:
_wuyePriceObj
.
val
(),
'management_fee'
:
_wuyePriceObj
.
val
(),
...
...
public/resource/js/public.js
View file @
7476e3e6
...
@@ -118,3 +118,8 @@ function PaginationX(obj){
...
@@ -118,3 +118,8 @@ function PaginationX(obj){
var
_preHtml
=
'<div class="ui-page-x"><span class="ui-page ui-page-prev"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><path d="M85.876,100.5l49.537-50.526c4.089-4.215,4.089-11.049,0-15.262 c-4.089-4.218-10.719-4.218-14.808,0L63.586,92.868c-4.089,4.215-4.089,11.049,0,15.264l57.018,58.156 c4.089,4.215,10.719,4.215,14.808,0c4.089-4.215,4.089-11.049,0-15.262L85.876,100.5z"></path></svg></span>'
;
var
_preHtml
=
'<div class="ui-page-x"><span class="ui-page ui-page-prev"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><path d="M85.876,100.5l49.537-50.526c4.089-4.215,4.089-11.049,0-15.262 c-4.089-4.218-10.719-4.218-14.808,0L63.586,92.868c-4.089,4.215-4.089,11.049,0,15.264l57.018,58.156 c4.089,4.215,10.719,4.215,14.808,0c4.089-4.215,4.089-11.049,0-15.262L85.876,100.5z"></path></svg></span>'
;
var
_aftHtml
=
''
;
var
_aftHtml
=
''
;
};
};
//手机号码格式正则验证 by xishifeng
function
is_mobile
(
text
)
{
return
/^1
[
1234567890
]\d{9}
$/
.
test
(
text
)?
true
:
false
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment