Browse Source

feat 地图优化

Funny 3 years ago
parent
commit
c88846640e

+ 2 - 2
src/components/merchantAdd.vue

@@ -126,13 +126,13 @@ export default {
       if (!this.form.merchantName.trim()) {
         return this.$message({
           type: "error",
-          message: "请输入门店名称!",
+          message: "请输入商家名称!",
         });
       }
       if (!String(this.form.categoryId).trim()) {
         return this.$message({
           type: "error",
-          message: "请选择主营类别!",
+          message: "请选择主营业务!",
         });
       }
       if (!this.form.address.trim()) {

+ 36 - 16
src/components/orderComponents/orderAMap.vue

@@ -2,20 +2,20 @@
   <el-dialog v-loading='loading' element-loading-text="拼命加载中" width="80%" destroy-on-close :visible.sync="dialogTableVisible" append-to-body>
     <el-form v-if="showSearch" ref="ruleForm" class="demo-form-inline" :inline="true">
       <el-form-item class="search-box">
-        <el-input @keydown.enter.native="seachEnterFun" v-model="searchKey" type="search" id="search" style="width: 219px" placeholder="请输入关键字进行搜索" />
+        <el-input size="small" @keydown.enter.native="seachEnterFun" v-model="searchKey" type="search" id="search" style="width: 219px" placeholder="请输入关键字进行搜索" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" class="map-btn" @click="searchMap">搜索</el-button>
+        <el-button size="small" type="primary" class="map-btn" @click="searchMap">搜索</el-button>
       </el-form-item>
       <div class="tip-box" id="searchTip"></div>
       <el-form-item label="经度" prop="lng">
-        <el-input maxlength="11" v-model="lng" style="width: 140px" disabled></el-input>
+        <el-input size="small" maxlength="11" v-model="lng" style="width: 140px" disabled></el-input>
       </el-form-item>
       <el-form-item label="纬度:" prop="lat">
-        <el-input maxlength="10" v-model="lat" style="width: 140px" disabled></el-input>
+        <el-input size="small"  maxlength="10" v-model="lat" style="width: 140px" disabled></el-input>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" class="map-btn" @click="clickSureMap">确定</el-button>
+        <el-button size="small" type="primary" class="map-btn" @click="clickSureMap">确定</el-button>
       </el-form-item>
       <div v-show="showAddressList" class="address-list">
         <div class="address" @click="getGeoCode(v)" v-for="(v,i) in promptList" :key="i">
@@ -239,16 +239,30 @@ export default {
       }
     },
     getLocation() {
-      getLocation({
-        location: `${this.lng},${this.lat}`,
-        radius: 500,
-        page: 1,
-        offset: 20,
-      }).then((res) => {
-        console.log("数据", res);
-        this.promptList = res.data;
-        this.showAddressList = true;
-      });
+      this.$axios
+        .get("https://restapi.amap.com/v3/geocode/regeo", {
+          params: {
+            key: "5ae8644771ef9abf9cfb3ea23b1df6ca",
+            location: `${this.lng},${this.lat}`,
+            extensions: "all",
+          },
+        })
+        .then(function (res) {
+          console.log("数据", res);
+        })
+        .catch(function (res) {
+          console.log(res);
+        });
+      // getLocation({
+      //   location: `${this.lng},${this.lat}`,
+      //   radius: 500,
+      //   page: 1,
+      //   offset: 20,
+      // }).then((res) => {
+      //   console.log("数据", res);
+      //   this.promptList = res.data;
+      //   this.showAddressList = true;
+      // });
     },
     // 定位
     getCurrentLocation() {
@@ -346,8 +360,14 @@ export default {
   width: 100%;
   height: 400px;
 }
+// /deep/ .amap-marker {
+//   top: -139px !important;
+//   left: 83px !important;
+// }
 /deep/ .amap-marker img {
   width: 40px !important;
-  height: 40px !important;
+  height: 66px !important;
+  top: -25px !important;
+  left: -10px !important;
 }
 </style>

+ 1 - 1
src/main.js

@@ -23,7 +23,7 @@ Vue.prototype.$get = get;
 Vue.prototype.$post = post;
 Vue.prototype.$postJson = postJson;
 
-AmapVue.config.key = '610161977d2e2632eb34aff3e88a079f';
+AmapVue.config.key = '5ae8644771ef9abf9cfb3ea23b1df6ca';
 Vue.use(AmapVue);
 Vue.use(Elementui)
 

BIN
static/image/map-fa.png


BIN
static/image/map-rider.png


BIN
static/image/map-shou.png


BIN
static/image/map_current.png