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
25c1c0e3
Commit
25c1c0e3
authored
Jun 06, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纬度
parent
fccf3a1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
OfficeService.php
application/index/service/OfficeService.php
+9
-2
buildingDictionary.js
public/resource/js/buildingDictionary.js
+8
-11
No files found.
application/index/service/OfficeService.php
View file @
25c1c0e3
...
...
@@ -70,6 +70,8 @@ class OfficeService
//新增周边交通
if
(
!
empty
(
$data
[
'add_building_stations'
]))
{
$position_service
=
new
PositionService
();
$first_position
=
$data
[
'latitude'
]
.
','
.
[
'longitude'
];
$add_building_stations
=
json_decode
(
$data
[
'add_building_stations'
],
true
);
foreach
(
$add_building_stations
as
$k
=>
$v
)
{
if
(
empty
(
$v
[
'stations_id'
]))
{
...
...
@@ -88,7 +90,12 @@ class OfficeService
}
$save_stations
[
$k
][
'building_id'
]
=
$id
;
$save_stations
[
$k
][
'stations_id'
]
=
$v
[
'stations_id'
];
$save_stations
[
$k
][
'distance'
]
=
$v
[
'distance'
];
$end_position
=
$v
[
'latitude'
]
.
','
.
$v
[
'longitude'
];
$distance
=
$position_service
->
getPositionDistance
(
$first_position
,
$end_position
);
if
(
$distance
)
{
$save_stations
[
$k
][
'distance'
]
=
$distance
;
}
}
if
(
isset
(
$save_stations
))
{
...
...
@@ -162,7 +169,7 @@ class OfficeService
// $data['business_name'] = "";
// }
$field_stations
=
'a.id,b.line_name,name,distance,b.id as stations_id'
;
$field_stations
=
'a.id,b.line_name,name,distance,b.id as stations_id
,b.latitude,b.longitude
'
;
$data
[
'building_stations'
]
=
$this
->
m_building_stations
->
getListAll
(
$field_stations
,
[
'a.building_id'
=>
$id
]);
}
...
...
public/resource/js/buildingDictionary.js
View file @
25c1c0e3
...
...
@@ -13,7 +13,7 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
};
};
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
localStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
console
.
log
(
user_info_obj
);
business
=
{
initShopRong
:
false
,
//判断是否是需要加载商圈
pageNo
:
1
,
...
...
@@ -140,7 +140,6 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
$
(
'#business_circle_id'
).
html
(
''
);
//先清空
if
(
_id
&&
_id
!=
'0'
)
{
business
.
getBusinessCircle
(
_id
,
function
(
_data
)
{
console
.
log
(
22
)
var
_str
=
'<option value="">商圈</option>'
;
$
.
each
(
_data
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
name
+
'</option>'
;
...
...
@@ -175,7 +174,6 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
//搜索地址的回调
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
({
...
...
@@ -224,7 +222,6 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
_lat
=
Number
(
_this
.
data
(
'lat'
));
//纬度
getDistrict
(
_lng
,
_lat
,
function
(
data
)
{
console
.
log
(
data
);
if
(
data
[
'city'
])
{
_provinceInternalObj
.
val
(
data
[
'province'
]);
_cityInternalObj
.
val
(
data
[
'city'
]);
...
...
@@ -336,7 +333,6 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
function
getDistrict
(
str1
,
str2
,
fn
)
{
myGeo
.
getLocation
(
new
BMap
.
Point
(
str1
,
str2
),
function
(
result
)
{
if
(
result
)
{
console
.
log
(
result
);
fn
(
result
[
'addressComponents'
]);
}
});
...
...
@@ -456,10 +452,9 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
_doc
.
on
(
'input'
,
'.shop_city_choose_site_list_line'
,
function
()
{
// var arr_ = JSON.parse($(this).val());
var
arr_
=
JSON
.
parse
(
$
(
"option:selected"
,
this
).
attr
(
"data-id"
));
// console.log($("option:selected",this).attr("data-id"));
var
_str
=
'<option value="">请选择</option>'
;
$
.
each
(
arr_
,
function
(
i
,
item
)
{
_str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
name
+
'</option>'
;
_str
+=
'<option value="'
+
item
.
id
+
'"
data-latitude="'
+
item
.
latitude
+
'" data-longitude="'
+
item
.
longitude
+
'"
>'
+
item
.
name
+
'</option>'
;
});
$
(
this
).
next
().
html
(
_str
);
if
(
business
.
isAdd
==
0
){
...
...
@@ -547,8 +542,6 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
for
(
var
i
=
0
;
i
<
$
(
'.result2'
).
length
;
i
++
)
{
imgname2
[
i
]
=
$
(
'.result2>img'
).
eq
(
i
).
attr
(
'data-imgname'
);
};
console
.
log
(
imgname1
);
console
.
log
(
imgname2
);
//无新的图片上传 不调用接口
if
(
imgname1
.
join
(
','
))
{
// var imgOffice = imgname.join(',');
...
...
@@ -562,7 +555,9 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
$
.
each
(
$
(
'.detail-modal-bargaininfo-commission-sec'
),
function
(
i
,
v
)
{
detailArr
[
i
]
=
{
'stations_id'
:
$
.
trim
(
$
(
v
).
find
(
'select'
).
eq
(
1
).
val
()),
'distance'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
0
).
val
())
'distance'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
0
).
val
()),
'latitude'
:
$
.
trim
(
$
(
v
).
find
(
'select'
).
eq
(
1
).
find
(
'option:selected'
).
attr
(
'data-latitude'
)),
'longitude'
:
$
.
trim
(
$
(
v
).
find
(
'select'
).
eq
(
1
).
find
(
'option:selected'
).
attr
(
'data-longitude'
)),
};
});
...
...
@@ -716,11 +711,13 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
$
(
'.detail-modal-bargaininfo-commission-addarea'
).
html
(
''
);
business
.
addStr
=
_str
;
$
.
each
(
business
.
buildingStations
,
function
(
i
,
v
)
{
$
(
'.detail-modal-bargaininfo-commission-addarea'
).
append
(
'<div data-id="'
+
v
.
id
+
'" class="form-group detail-modal-bargaininfo-commission-sec"><label class="control-label" style="float: left;">距离</label><select class="form-control btn2-city shop_city_choose_site_list_line">'
+
_str
+
'</select><select class="form-control btn2-city shop_area_id_line"><option value="{3}" selected="selected">{1}</option></select><input type="number" class="form-control btn2-city" name="user_phone" autocomplete="off" class="" placeholder="请输入" value="{2}"><label class="control-label">米</label><span href="javascript:;"class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png"/></span></div>'
.
stringFormatObj
({
$
(
'.detail-modal-bargaininfo-commission-addarea'
).
append
(
'<div data-id="'
+
v
.
id
+
'" class="form-group detail-modal-bargaininfo-commission-sec"><label class="control-label" style="float: left;">距离</label><select class="form-control btn2-city shop_city_choose_site_list_line">'
+
_str
+
'</select><select class="form-control btn2-city shop_area_id_line"><option value="{3}" selected="selected"
data-latitude="{4}" data-longitude="{5}"
>{1}</option></select><input type="number" class="form-control btn2-city" name="user_phone" autocomplete="off" class="" placeholder="请输入" value="{2}"><label class="control-label">米</label><span href="javascript:;"class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png"/></span></div>'
.
stringFormatObj
({
'0'
:
v
.
line_name
,
'1'
:
v
.
name
,
'2'
:
v
.
distance
,
'3'
:
v
.
stations_id
,
'4'
:
v
.
latitude
,
'5'
:
v
.
longitude
}));
var
name_
=
v
.
line_name
?
v
.
line_name
.
substr
(
2
,
3
):
v
.
line_name
;
$
(
".shop_city_choose_site_list_line"
).
eq
(
i
).
val
(
name_
);
...
...
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