|
@@ -1,3 +1,15 @@
|
|
|
|
+<style type="text/css">
|
|
|
|
+ .amap-sug-result{
|
|
|
|
+ z-index:999999999;
|
|
|
|
+ }
|
|
|
|
+ #pickerInput{
|
|
|
|
+ z-index: 999999;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 30px;
|
|
|
|
+ top: 20px;
|
|
|
|
+ width: 200px;
|
|
|
|
+ }
|
|
|
|
+</style>
|
|
<div class="layui-fluid">
|
|
<div class="layui-fluid">
|
|
<div class="layui-row layui-col-space15">
|
|
<div class="layui-row layui-col-space15">
|
|
<div class="layui-col-md12">
|
|
<div class="layui-col-md12">
|
|
@@ -77,6 +89,21 @@
|
|
<input type="text" name="region" value="{$broker.region}" placeholder="请输入..." autocomplete="off" class="layui-input">
|
|
<input type="text" name="region" value="{$broker.region}" placeholder="请输入..." autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="layui-form-item">
|
|
|
|
+ <label class="layui-form-label"><span style="color:#f90c05;">*</span>经纬度</label>
|
|
|
|
+ <div class="layui-input-inline">
|
|
|
|
+ <input type="text" name="longitude" value="{$broker.longitude}" lay-verify="required" placeholder="经度"
|
|
|
|
+ autocomplete="off" class="layui-input">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-input-inline">
|
|
|
|
+ <input type="text" name="latitude" value="{$broker.latitude}" lay-verify="required" placeholder="纬度"
|
|
|
|
+ autocomplete="off" class="layui-input">
|
|
|
|
+ </div>
|
|
|
|
+ <div id="maplocation" style="width:500px;height:500px;display: none;">
|
|
|
|
+ <input id="pickerInput" class="layui-input" placeholder="输入关键字选取地点"/>
|
|
|
|
+ </div>
|
|
|
|
+ <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-map-lnglat">选择地理位置</button>
|
|
|
|
+ </div>
|
|
<div class="layui-form-item" id="formdetails">
|
|
<div class="layui-form-item" id="formdetails">
|
|
<label class="layui-form-label">基本介绍</label>
|
|
<label class="layui-form-label">基本介绍</label>
|
|
<div class="layui-input-block">
|
|
<div class="layui-input-block">
|
|
@@ -155,6 +182,36 @@
|
|
field: { idName: 'name', titleName: 'name', childName: 'child' }
|
|
field: { idName: 'name', titleName: 'name', childName: 'child' }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ var map = new AMap.Map('maplocation', {
|
|
|
|
+ center:[118.551494,24.781674],//地图中心位置
|
|
|
|
+ zoom: 12,
|
|
|
|
+ });
|
|
|
|
+ $('#layuiadmin-map-lnglat').on('click', function() {
|
|
|
|
+ var index = layer.open({
|
|
|
|
+ type: 1,
|
|
|
|
+ title: '点击获取地址坐标',
|
|
|
|
+ area: ['500px', '550px'],
|
|
|
|
+ content: $('#maplocation'),
|
|
|
|
+ success: function() {
|
|
|
|
+ //var map = new AMap.Map("maplocation", { resizeEnable: true });
|
|
|
|
+ map.on('click', function(e) {
|
|
|
|
+ $('input[name="longitude"]').val(e.lnglat.getLng());
|
|
|
|
+ $('input[name="latitude"]').val(e.lnglat.getLat());
|
|
|
|
+ layer.close(index);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var auto = new AMap.Autocomplete({ input: "pickerInput" });
|
|
|
|
+ var placeSearch = new AMap.PlaceSearch({ map: map });
|
|
|
|
+ window.select = function (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ placeSearch.setCity(e.poi.adcode);
|
|
|
|
+ placeSearch.search(e.poi.name);
|
|
|
|
+ };
|
|
|
|
+ AMap.event.addListener(auto, "select", select);
|
|
|
|
+
|
|
form.on('submit(LAY-broker-brokerform-edit-submit)', function(obj) {
|
|
form.on('submit(LAY-broker-brokerform-edit-submit)', function(obj) {
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
admin.req({
|
|
admin.req({
|