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
6d140818
Commit
6d140818
authored
Jan 23, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增商铺暂存
parent
afa11a18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
281 additions
and
2 deletions
+281
-2
edit.html
application/index/view/houses/edit.html
+0
-0
jia2@2x.png
public/resource/image/jia2@2x.png
+0
-0
jz2.gif
public/resource/image/jz2.gif
+0
-0
search_gb.png
public/resource/image/search_gb.png
+0
-0
search_ic.png
public/resource/image/search_ic.png
+0
-0
edit.js
public/resource/js/edit.js
+281
-2
No files found.
application/index/view/houses/edit.html
View file @
6d140818
This diff is collapsed.
Click to expand it.
public/resource/image/jia2@2x.png
0 → 100644
View file @
6d140818
1.14 KB
public/resource/image/jz2.gif
0 → 100644
View file @
6d140818
33.6 KB
public/resource/image/search_gb.png
0 → 100644
View file @
6d140818
857 Bytes
public/resource/image/search_ic.png
0 → 100644
View file @
6d140818
1.8 KB
public/resource/js/edit.js
View file @
6d140818
define
([
'c
kfinder'
,
'ckfinderStart
'
],
function
()
{
define
([
'c
ss!style/home.css'
,
'ckfinder'
,
'ckfinderStart'
,
'bootstrapJs
'
],
function
()
{
var
user
=
{
init
:
function
()
{
//初始化dot
user
.
event
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
'#liebiao_pic_btn'
).
click
(
function
()
{
BrowseServer
(
'liebiao_pic_pre'
);
});
/************************************************百度地址定位相关*************************************************************/
//字符串格式化,参数为对象的形式 by xishifeng 2017-07-14
String
.
prototype
.
stringFormatObj
=
function
(){
var
formatted
=
this
;
for
(
var
i
in
arguments
[
0
]){
formatted
=
formatted
.
replace
(
new
RegExp
(
'
\\
{'
+
i
+
'
\\
}'
,
'gi'
),
arguments
[
0
][
i
]);
};
return
formatted
;
};
//从baidu-position.js移过来
var
ulHtml
=
$
(
'#main_ul>ul'
),
loadItem
=
$
(
"#loading_pic"
),
noMoreItem
=
$
(
"#no_more"
),
cityLimitItem
=
$
(
'#address_city_title'
),
_cityInputObj
=
$
(
'#city_internal'
),
_inputObj
=
$
(
'#search_input'
),
valueCurrent
=
''
;
//初始化,百度地图相关对象
var
LocalSearch
=
new
BMap
.
LocalSearch
(),
myGeo
=
new
BMap
.
Geocoder
();
$
(
'#position_btn'
).
click
(
function
(){
$
.
each
(
_cityInputObj
.
find
(
'option'
),
function
(
i
,
item
)
{
var
_item
=
$
(
item
);
if
(
_item
.
val
()
==
_cityInputObj
.
val
()){
cityLimitItem
.
html
(
_item
.
html
());
return
false
;
//jq跳出当前循环
};
});
});
//搜索地址的回调
LocalSearch
.
setSearchCompleteCallback
(
function
(
data
)
{
if
(
LocalSearch
.
getStatus
()
==
BMAP_STATUS_SUCCESS
)
{
console
.
log
(
data
);
var
_html
=
""
;
for
(
var
i
=
0
;
i
<
data
.
getCurrentNumPois
();
i
++
){
_html
+=
'<li data-city="{2}" data-lat="{3}" data-lng="{4}" data-dismiss="modal"><p>{0}</p><p>{1}</p></li>'
.
stringFormatObj
({
'0'
:
data
.
getPoi
(
i
)[
"title"
],
'1'
:
data
.
getPoi
(
i
)[
"address"
],
'2'
:
data
.
getPoi
(
i
)[
"city"
],
'3'
:
data
.
getPoi
(
i
)[
"point"
][
"lat"
],
'4'
:
data
.
getPoi
(
i
)[
"point"
][
"lng"
]
});
};
ulHtml
.
html
(
_html
);
loadItem
.
hide
();
noMoreItem
.
show
();
}
});
_inputObj
.
on
(
'input'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
valueCurrent
=
$
(
this
).
val
();
if
(
valueCurrent
!=
''
)
{
resetLoad
();
loadMain
(
valueCurrent
);
}
else
{
ulHtml
.
html
(
''
);
loadItem
.
hide
();
noMoreItem
.
show
();
return
false
;
}
});
//key搜索
$
(
document
).
keydown
(
function
(
event
)
{
if
(
event
.
keyCode
==
'13'
)
{
resetLoad
();
loadMain
(
valueCurrent
);
return
false
;
};
});
//输入框的取消图标点击事件
$
(
'.cancel-pic'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
_inputObj
.
val
(
''
).
focus
();
resetLoad
();
});
$
(
document
).
on
(
'click'
,
'#main_ul>ul>li'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
$
(
'#longitude'
).
val
(
Number
(
_this
.
data
(
'lng'
)));
$
(
'#latitude'
).
val
(
Number
(
_this
.
data
(
'lat'
)));
});
function
resetLoad
()
{
ulHtml
.
html
(
''
);
loadItem
.
hide
();
noMoreItem
.
show
();
};
function
loadMain
(
keyword
)
{
loadItem
.
show
();
noMoreItem
.
hide
();
LocalSearch
.
setLocation
(
cityLimitItem
.
html
());
LocalSearch
.
search
(
keyword
);
};
/************************************************百度地址定位相关*************************************************************/
//自动获取省列表,并追加后面的市和区
getCityDisc
({
'isGetProvince'
:
true
},
function
(
_data
){
var
_htmlTemp
=
''
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_htmlTemp
+=
'<option value="{0}">{1}</option>'
.
stringFormatObj
({
'0'
:
item
[
'code'
],
'1'
:
item
[
'name'
]
});
});
$
.
each
(
$
(
'#province_internal, #province_external'
),
function
()
{
var
_this
=
$
(
this
);
_this
.
html
(
_htmlTemp
).
val
(
'310000'
);
getCityDisc
({
'dom'
:
_this
,
'isGetProvince'
:
false
},
function
(){
getCityDisc
({
'dom'
:
_this
.
next
(),
'isGetProvince'
:
false
});
});
});
});
//获取省市区事件封装
function
getCityDisc
(
_obj
,
fn
){
var
_data
=
{};
if
(
!
_obj
[
'isGetProvince'
]){
if
(
!!
_obj
[
'dom'
].
val
()){
_data
[
'parent_code'
]
=
Number
(
_obj
[
'dom'
].
val
())
}
else
{
//处理没有市选项,区选项的内容
_obj
[
'dom'
].
next
().
html
(
''
);
fn
&&
fn
();
return
false
;
};
};
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/regions.html'
,
timeout
:
30000
,
data
:
_data
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
//如果是获取的省列表,直接直接返回数组
if
(
_obj
[
'isGetProvince'
]){
fn
(
data
[
'data'
]);
return
false
;
};
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<option value="{0}">{1}</option>'
.
stringFormatObj
({
'0'
:
item
[
'code'
],
'1'
:
item
[
'name'
]
});
});
_obj
[
'dom'
].
next
().
html
(
_htmlTemp
);
fn
&&
fn
();
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
alert
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
alert
(
'请求超时'
);
};
}
});
};
//省选择框事件添加
$
(
'#province_internal, #province_external'
).
change
(
function
(){
var
_this
=
$
(
this
);
getCityDisc
({
'dom'
:
_this
,
'isGetProvince'
:
false
},
function
(){
getCityDisc
({
'dom'
:
_this
.
next
(),
'isGetProvince'
:
false
});
});
});
//市选择框事件添加
$
(
'#city_internal, #city_external'
).
change
(
function
(){
var
_this
=
$
(
this
);
getCityDisc
({
'dom'
:
_this
,
'isGetProvince'
:
false
});
});
$
(
'#acr_tel_jia'
).
click
(
function
(){
var
_this
=
$
(
this
);
console
.
log
(
_this
.
parent
().
find
(
'.acqx_phone_jia'
).
length
);
if
(
_this
.
parent
().
find
(
'.acqx_phone_jia'
).
length
<
5
){
_this
.
before
(
'<div class="form-group phone-list-container"><input type="tel" class="form-control acqx_phone_jia" placeholder="请输入"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic" /></div>'
);
}
else
{
alert
(
'最多添加5个'
);
};
});
_doc
.
on
(
'click'
,
'.input-cancel-pic'
,
function
(){
$
(
this
).
parent
().
remove
();
});
_doc
.
on
(
'click'
,
'.phone-list-container>ul>li'
,
function
(){
var
_this
=
$
(
this
);
_this
.
parent
().
prev
().
val
(
_this
.
html
());
_this
.
parent
().
html
(
''
);
});
var
_ajaxObjAcr
=
null
;
_doc
.
on
(
'input'
,
'.acqx_phone_jia'
,
function
(){
var
_this
=
$
(
this
);
var
_thisVal
=
$
.
trim
(
_this
.
val
());
console
.
log
(
_thisVal
);
if
(
_thisVal
!=
''
){
_ajaxObjAcr
&&
_ajaxObjAcr
.
abort
();
_ajaxObjAcr
=
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getBroker_new'
,
data
:
{
'phone'
:
$
.
trim
(
_this
.
val
())
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
[
'data'
].
length
>
0
){
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li>{0}-{1}<li>'
.
stringFormatObj
({
'0'
:
item
[
'name'
],
'1'
:
item
[
'phone'
]
});
});
_this
.
next
().
html
(
_htmlTemp
);
}
else
{
_this
.
next
().
html
(
''
);
};
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
//alert('error');
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
alert
(
'请求超时'
);
};
}
});
};
});
}
};
return
user
;
...
...
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