Accept Merge Request #131: (feature/hant -> develop)
Merge Request: 燕国地图修改 Created By: @todayswind Accepted By: @todayswind URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/131?initial=true
This commit is contained in:
commit
a1b7ff5b1f
|
|
@ -111,7 +111,7 @@
|
|||
var center = [lng,lat]
|
||||
//加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
|
||||
|
||||
console.log(center)
|
||||
// console.log(center)
|
||||
map = new AMap.Map('container', {
|
||||
zoom: parseInt('{$zoom}'),
|
||||
center: center
|
||||
|
|
@ -121,15 +121,15 @@
|
|||
radius: 1000, //范围,默认:500,
|
||||
});
|
||||
if (city_code){
|
||||
// console.log(111,city_code);
|
||||
// // console.log(111,city_code);
|
||||
geocoder.getLocation(city_code, function(status, result) {
|
||||
if (status === 'complete' && result.info === 'OK') {
|
||||
lat = result.geocodes[0].location.lat;
|
||||
lng = result.geocodes[0].location.lng;
|
||||
map.setCenter(result.geocodes[0].location);
|
||||
console.log(result.geocodes[0],2222);
|
||||
// console.log(result.geocodes[0],2222,result);
|
||||
} else {
|
||||
console.log(result)
|
||||
// console.log(result)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -147,6 +147,7 @@
|
|||
lat = lnglat.lat;
|
||||
map.panTo([lng, lat]);
|
||||
positionPicker.start(lnglat);
|
||||
// console.log(lnglat,addr)
|
||||
if (addr) {
|
||||
// var label = '<div class="info">地址:' + addr + '<br>经度:' + lng + '<br>纬度:' + lat + '</div>';
|
||||
var label = '<div class="info">地址:' + addr + '</div>';
|
||||
|
|
@ -159,11 +160,12 @@
|
|||
var address = result.regeocode.formattedAddress;
|
||||
// var label = '<div class="info">地址:' + address + '<br>经度:' + lng + '<br>纬度:' + lat + '</div>';
|
||||
var label = '<div class="info">地址:' + address + '</div>';
|
||||
city_code = result.regeocode.addressComponent.adcode
|
||||
positionPicker.marker.setLabel({
|
||||
content: label //显示内容
|
||||
});
|
||||
} else {
|
||||
console.log(JSON.stringify(result));
|
||||
// console.log(JSON.stringify(result));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -211,7 +213,7 @@
|
|||
});
|
||||
|
||||
positionPicker.on('success', function (positionResult) {
|
||||
console.log(positionResult);
|
||||
// console.log(positionResult);
|
||||
as = positionResult.position;
|
||||
address = positionResult.address;
|
||||
lat = as.lat;
|
||||
|
|
@ -260,12 +262,13 @@
|
|||
//点击搜索按钮
|
||||
$(document).on('click', '.confirm', function () {
|
||||
var zoom = map.getZoom();
|
||||
var data = {lat: lat, lng: lng, zoom: zoom, address: address};
|
||||
console.log(map)
|
||||
var data = {lat: lat, lng: lng, zoom: zoom, address: address,city_code:city_code};
|
||||
if (fromtype !== totype) {
|
||||
var result = gcoord.transform([data.lng, data.lat], gcoord[fromtype], gcoord[totype]);
|
||||
data.lng = (result[0] || data.lng).toFixed(5);
|
||||
data.lat = (result[1] || data.lat).toFixed(5);
|
||||
console.log(data, result, fromtype, totype);
|
||||
// console.log(data, result, fromtype, totype);
|
||||
}
|
||||
close(data);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ class Order extends Backend
|
|||
}
|
||||
$area = new \app\admin\model\Area();
|
||||
$area_name = $area->getNameByCode($order->area_id);
|
||||
$order->area_name = str_replace(',', '/', $area_name);
|
||||
$order->area_name = str_replace(',', '/', $area_name ?? '');
|
||||
// dd($area_name);
|
||||
// 将订单数据传递到视图
|
||||
$this->assign('row', $order);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sb">
|
||||
<div class="line flex-sb" style="display: none">
|
||||
<div class="title flex-c"><span class="required">*</span>地区:</div>
|
||||
<div class='value col-sm-12 flex-c'>
|
||||
<input id="c-city" class="form-control" data-toggle="city-picker" type="text" value="" />
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sb">
|
||||
<div class="line flex-sb" style="display: none">
|
||||
<div class="title flex-c"><span class="required">*</span>地区:</div>
|
||||
<div class='value col-sm-12 flex-c'>
|
||||
<input id="c-city" value="{$row.area_name}" class="form-control" data-toggle="city-picker" type="text" value="{$row.address}" />
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sb">
|
||||
<div class="line flex-sb" style="display: none">
|
||||
<div class="title flex-c"><span class="required">*</span>地区:</div>
|
||||
<div class='value col-sm-12 flex-c'>
|
||||
<input id="c-city" value="{$row.area_name}" class="form-control" data-toggle="city-picker" type="text" value="{$row.address}" />
|
||||
|
|
|
|||
|
|
@ -546,11 +546,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
|||
// Form.api.target($('#c-address'));
|
||||
// });
|
||||
$(document).on('click', "#area_map", function (e) {
|
||||
const data = $("#c-city").val();
|
||||
if (!data) {
|
||||
Toastr.error('请先选择区域');
|
||||
return false;
|
||||
}
|
||||
// const data = $("#c-city").val();
|
||||
// if (!data) {
|
||||
// Toastr.error('请先选择区域');
|
||||
// return false;
|
||||
// }
|
||||
|
||||
var that = this;
|
||||
var callback = $(that).data('callback');
|
||||
|
|
@ -572,12 +572,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
|||
}
|
||||
// console.log(url);
|
||||
Fast.api.open(url, '位置选择', {
|
||||
callback: function (res) {
|
||||
callback: function (res,data) {
|
||||
input_id && $("#" + input_id).val(res.address).trigger("change");
|
||||
lat_id && $("#" + lat_id).val(res.lat).trigger("change");
|
||||
lng_id && $("#" + lng_id).val(res.lng).trigger("change");
|
||||
zoom_id && $("#" + zoom_id).val(res.zoom).trigger("change");
|
||||
|
||||
$('#area_id').val(res.city_code);
|
||||
try {
|
||||
//执行回调函数
|
||||
if (typeof callback === 'function') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user