|
@@ -6,7 +6,10 @@
|
|
|
shape="round"
|
|
|
placeholder="搜小区、学校"
|
|
|
background="transparent"
|
|
|
- @search="onSearch"/>
|
|
|
+ show-action
|
|
|
+ @search="onSearch">
|
|
|
+ <div slot="action" @click="onSearch">搜索</div>
|
|
|
+ </van-search>
|
|
|
<el-amap :zoom="zoom" :events="amapEvents()" :plugin="plugin" :center="center">
|
|
|
<el-amap-marker :clickable="true"
|
|
|
:events="marker.events"
|
|
@@ -36,12 +39,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import AMap from 'vue-amap'
|
|
|
-AMap.initAMapApiLoader({
|
|
|
- key: 'c7856e7c812d299cff150e74d60ea608',
|
|
|
- plugin: ['AMap.Geolocation', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.ToolBar'],
|
|
|
- v: '1.4.4'
|
|
|
-})
|
|
|
+// import AMap from 'vue-amap'
|
|
|
+// AMap.initAMapApiLoader({
|
|
|
+// key: 'c7856e7c812d299cff150e74d60ea608',
|
|
|
+// plugin: ['Geolocation', 'PlaceSearch', 'Geocoder', 'ToolBar'],
|
|
|
+// v: '1.4.4'
|
|
|
+// })
|
|
|
import MHeader from '@/components/MHeader'
|
|
|
import { schoolAdd, schoolUpdate } from '@/api/teacher'
|
|
|
export default {
|
|
@@ -161,6 +164,7 @@ export default {
|
|
|
if(!this.search_value) return
|
|
|
this.markers = [] // 重置位置
|
|
|
let mapSearch = new AMap.PlaceSearch(this.searchOption)
|
|
|
+
|
|
|
// 目前只需要搜索第一条数据
|
|
|
mapSearch.search(this.search_value, (status, sr) => {
|
|
|
if(sr && sr.poiList && sr.poiList.count) {
|
|
@@ -231,6 +235,12 @@ export default {
|
|
|
font-weight: bold;
|
|
|
color: @mColor;
|
|
|
}
|
|
|
+ .van-search__action {
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 0.15rem;
|
|
|
+ position: absolute;
|
|
|
+ right: 0.35rem;
|
|
|
+ }
|
|
|
}
|
|
|
.button-group {
|
|
|
margin: .3rem .26rem .2rem;
|