Initial commit,修正
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '选择平台';
|
||||
$plats = [
|
||||
['pid'=>1,'title'=>'情景海湾','thumb'=>Yii::getAlias('@web').'/img/nopic.jpg']
|
||||
];
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<?php foreach($plats as $plat){?>
|
||||
<div class="col-sm-4 col-md-3">
|
||||
<a href="<?php echo Url::toRoute(['index/index','pid'=>$plat['pid']]);?>">
|
||||
<div class="thumbnail">
|
||||
<img alt="300x200" src="<?php echo $plat['thumb']?>"/>
|
||||
<div class="caption" style="text-align: center;">
|
||||
<h3>
|
||||
<?php echo $plat['title']?>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<?=Html::jsFile('@web/js/welcome.min.js?v=1.0.0')?>
|
||||
Executable
+204
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @Author: fm453
|
||||
* @Date: 2018-11-22 12:36:48
|
||||
* @Last Modified by: fm453
|
||||
* @Last Modified time: 2018-11-22 23:55:18
|
||||
* @Email: fm453@lukegzs.com
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '地理位置选择';
|
||||
|
||||
?>
|
||||
<style>
|
||||
body .wrapper{
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.map {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
float: left;
|
||||
z-index:99;
|
||||
}
|
||||
</style>
|
||||
<!-- 原始地址://webapi.amap.com/ui/1.0/ui/misc/PositionPicker/examples/positionPicker.html -->
|
||||
<!-- <base href="//webapi.amap.com/ui/1.0/ui/misc/PositionPicker/examples/" /> -->
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content" style="padding:0;width:100%;height:100%;">
|
||||
<form class="form-search" method="get" action="<?=Url::toRoute('index/map')?>" role="form">
|
||||
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
||||
<div class="form-group btn btn-block" style="position:fixed;top:10px;z-index: 100;background-color: rgba(0,0,0,.5);">
|
||||
<div class="col-sm-7">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn"> <button type="button" class="btn btn-primary">输入地址:
|
||||
</button> </span>
|
||||
<input type="text" class="form-control" id="keyword" name="keyword" value="<?=isset($search['keyword']) ? $search['keyword']:''?>" placeholder="输入地址关键词进行查询" autocomplete="off">
|
||||
<span class="hidden input-group-btn"> <button type="submit" class="btn btn-info">搜索
|
||||
</button> </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn"> <button type="button" class="btn btn-primary">纬度
|
||||
</button> </span>
|
||||
<input type="text" class="form-control" id="lat" name="lat" value="" autocomplete="off">
|
||||
<span class="input-group-btn"> <button type="button" class="btn btn-primary">经度
|
||||
</button> </span>
|
||||
<input type="text" class="form-control" id="lng" name="lng" value="" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="container" class="map" tabindex="0" style="z-index: 0;"></div>
|
||||
<div class="" style="position:fixed;bottom:10px;left:50%;margin-left:-75px;width:150px;z-index: 100;">
|
||||
<button onclick="callback();" class="btn btn-lg btn-primary" type="button">
|
||||
<i class="ace-icon fa fa-check bigger-110"></i>
|
||||
确定选择
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function callback(){
|
||||
parent.<?=$callback;?>($("#lat").val(),$("#lng").val(),$("#keyword").val());
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src='//webapi.amap.com/maps?v=1.4.10&key=fea3f28a32780b33d97b2afb9a5236fe&plugin=AMap.ToolBar'></script>
|
||||
<!-- UI组件库 1.0 -->
|
||||
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
|
||||
<script type="text/javascript">
|
||||
AMapUI.loadUI(['misc/PositionPicker'], function(PositionPicker) {
|
||||
var lng = "<?=$lng?>";
|
||||
var lat = "<?=$lat?>";
|
||||
if(lng != 0 && lat != 0){
|
||||
lnglatXY = [lng, lat]; //纬度,经度
|
||||
}else{
|
||||
lnglatXY = [109.512444,18.252986]; //三亚市政务中心
|
||||
}
|
||||
|
||||
var map = new AMap.Map('container', {
|
||||
zoom: 16,
|
||||
scrollWheel: true,
|
||||
resizeEnable: true,
|
||||
center: lnglatXY
|
||||
});
|
||||
var positionPicker = new PositionPicker({
|
||||
mode: 'dragMarker',
|
||||
map: map
|
||||
});
|
||||
|
||||
positionPicker.on('success', function(positionResult) {
|
||||
console.log(positionResult);
|
||||
$("#keyword").val(positionResult.address);
|
||||
var pos = positionResult.position;
|
||||
$("#lng").val(pos.lng);
|
||||
$("#lat").val(pos.lat);
|
||||
});
|
||||
positionPicker.on('fail', function(positionResult) {
|
||||
console.log(positionResult);
|
||||
$("#lng").val('');
|
||||
$("#lat").val('');
|
||||
});
|
||||
|
||||
positionPicker.start(map.getBounds().getSouthWest());
|
||||
// positionPicker.start();
|
||||
map.panBy(0, 1);
|
||||
map.addControl(new AMap.ToolBar({
|
||||
liteStyle: true
|
||||
}))
|
||||
|
||||
AMap.plugin(['AMap.Autocomplete','AMap.PlaceSearch'],function(){
|
||||
var autoOptions = {
|
||||
city: "三亚市", //城市,默认全国
|
||||
input: "keyword"//使用联想输入的input的id
|
||||
};
|
||||
autocomplete= new AMap.Autocomplete(autoOptions);
|
||||
|
||||
var placeSearch = new AMap.PlaceSearch({
|
||||
city:'三亚市',
|
||||
map:map
|
||||
})
|
||||
//下拉框选择
|
||||
AMap.event.addListener(autocomplete, "select", function(e){
|
||||
placeSearch.search(e.poi.name)
|
||||
});
|
||||
//关键字查询
|
||||
// placeSearch.search('<?=$search['keyword']?>');
|
||||
});
|
||||
|
||||
//设置初始化标注数据
|
||||
var geocoder = new AMap.Geocoder({
|
||||
radius: 1000,
|
||||
extensions: "all"
|
||||
});
|
||||
function getAddr(lnglatXY){
|
||||
geocoder.getAddress(lnglatXY, function(status, result) {
|
||||
// console.log(result);
|
||||
if (status === 'complete' && result.info === 'OK') {
|
||||
$("#keyword").val(result.regeocode.formattedAddress);
|
||||
}
|
||||
});
|
||||
}
|
||||
getAddr(lnglatXY);
|
||||
|
||||
//设置地图中心点
|
||||
map.setCenter(lnglatXY);
|
||||
var marker = new AMap.Marker({ //加点
|
||||
map: map,
|
||||
position: lnglatXY
|
||||
});
|
||||
// map.setFitView(); //自动调整视图范围
|
||||
|
||||
//绑定点选maker事件
|
||||
function showInfoClick(e){
|
||||
console.log(e);
|
||||
var lnglatXY = [e.lnglat.getLng(),e.lnglat.getLat()];
|
||||
getAddr(lnglatXY);
|
||||
map.setCenter(lnglatXY);
|
||||
map.clearMap(); // 清除地图覆盖物
|
||||
var marker = new AMap.Marker({ //加点
|
||||
map: map,
|
||||
position: lnglatXY
|
||||
});
|
||||
map.setFitView();
|
||||
$("#lng").val(e.lnglat.getLng());
|
||||
$("#lat").val(e.lnglat.getLat());
|
||||
var text = '您在 [ '+e.lnglat.getLng()+','+e.lnglat.getLat()+' ] 的位置单击了地图!'
|
||||
console.log(text);
|
||||
}
|
||||
|
||||
function showInfoDbClick(e){
|
||||
console.log(e);
|
||||
var lnglatXY = [e.lnglat.getLng(),e.lnglat.getLat()];
|
||||
getAddr(lnglatXY);
|
||||
map.setCenter(lnglatXY);
|
||||
map.clearMap(); // 清除地图覆盖物
|
||||
var marker = new AMap.Marker({ //加点
|
||||
map: map,
|
||||
position: lnglatXY
|
||||
});
|
||||
map.setFitView();
|
||||
$("#lng").val(e.lnglat.getLng());
|
||||
$("#lat").val(e.lnglat.getLat());
|
||||
var text = '您在 [ '+e.lnglat.getLng()+','+e.lnglat.getLat()+' ] 的位置双击了地图!'
|
||||
console.log(text);
|
||||
}
|
||||
|
||||
map.on('click', showInfoClick);
|
||||
map.on('dblclick', showInfoDbClick);
|
||||
|
||||
});
|
||||
</script>
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '系统入口界面';
|
||||
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<?php foreach($navs as $nav){?>
|
||||
<?php $entries = $nav['entries'];?>
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<a href="<?php echo Url::toRoute('index/index');?>" target=""><span class="label label-warning pull-right">主界面</span></a>
|
||||
<h5><?php echo $nav['name'];?></h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<?php foreach($entries as $item){?>
|
||||
<a class="btn btn-<?= trim(Html::encode($item['class']))?>" href="<?= trim(Html::encode($item['url']))?>" data-toggle="tooltip" data-placement="top" data-title="<?= trim(Html::encode($item['title']))?>" trigger="hover|focus|click"><i class="<?= trim(Html::encode($item['icon'])) ?>"></i> <?= trim(Html::encode($item['name'])) ?></a>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<?=Html::jsFile('@web/js/welcome.min.js?v=1.0.0')?>
|
||||
Reference in New Issue
Block a user