shaogen1995 2 years ago
parent
commit
ae590af5eb

+ 1 - 1
yfyc/src/api/interact.js

@@ -2,6 +2,6 @@ import axios from '../utils/request'
 // 登录----
 export const getCodeAPI = (code) => {
   return axios({
-    url: `wxMini/wxLogin/${code}`,
+    url: `wxMini/mp/wxLogin/${code}`,
   })
 }

+ 10 - 8
yfyc/src/views/Goods/components/GoodsMap.vue

@@ -11,16 +11,18 @@
 export default {
   name: "GoodsMap",
   components: {},
+  props:{
+    mapData:{
+      type:Object,
+      default:()=>{}
+    }
+  },
   data() {
     //这里存放数据
     return {
       keywords: "",
       arr: [],
-      map: {
-        name: "中江塔",
-        x: 118.363387,
-        y: 31.325179,
-      },
+      map: null,
     };
   },
   //监听属性 类似于data概念
@@ -33,11 +35,11 @@ export default {
       window.onLoad = () => {
         this.map = new AMap.Map("myMap", {
           zoom: 18,
-          center: [118.363387, 31.325179],
+          center: [this.mapData.x, this.mapData.y],
           // viewMode: '3D'
         });
         const marker = new AMap.Marker({
-          position: [118.363387, 31.325179], // 位置
+          position: [this.mapData.x, this.mapData.y], // 位置
           label: {
             offset: new AMap.Pixel(20, 20),
             content: "点击打开高德地图",
@@ -45,7 +47,7 @@ export default {
         });
         marker.on("click", function (e) {
           marker.markOnAMAP({
-            name: "中江塔",
+            name: this.mapData.name,
             position: marker.getPosition(),
           });
         });

+ 8 - 8
yfyc/src/views/Interact/components/interactLocation.vue

@@ -28,14 +28,14 @@ export default {
       txt: "",
       locationData:[
         {id:1,name:'芜湖市',loc:'中国安徽省芜湖市',num:''},
-        {id:2,name:'鸠兹广场',loc:'安徽省芜湖市镜湖区滨江路桥口',num:'247m'},
-        {id:3,name:'中江塔',loc:'安徽省芜湖市镜湖区滨江路桥口',num:'425m'},
-        {id:4,name:'方特旅游区',loc:'安徽省芜湖市镜湖区银湖北路80号',num:'692m'},
-        {id:5,name:'芜湖滨江公园',loc:'芜湖市镜湖区新芜路7号',num:'849m'},
-        {id:6,name:'芜湖长江三桥',loc:'安徽省芜湖市',num:'945m'},
-        {id:7,name:'鸠兹古镇',loc:'安徽省芜湖市鸠江区陈棱路与徽州路交汇处西北角',num:'1007m'},
-        {id:8,name:'临江桥',loc:'安徽省芜湖市',num:'1205m'},
-        {id:9,name:'芜湖大剧院',loc:'安徽芜湖市镜湖区滨江路17号',num:'2351m'}
+        {id:2,name:'鸠兹广场',loc:'安徽省芜湖市镜湖区滨江路桥口',num:''},
+        {id:3,name:'中江塔',loc:'安徽省芜湖市镜湖区滨江路桥口',num:''},
+        {id:4,name:'方特旅游区',loc:'安徽省芜湖市镜湖区银湖北路80号',num:''},
+        {id:5,name:'芜湖滨江公园',loc:'芜湖市镜湖区新芜路7号',num:''},
+        {id:6,name:'芜湖长江三桥',loc:'安徽省芜湖市',num:''},
+        {id:7,name:'鸠兹古镇',loc:'安徽省芜湖市鸠江区陈棱路与徽州路交汇处西北角',num:''},
+        {id:8,name:'临江桥',loc:'安徽省芜湖市',num:''},
+        {id:9,name:'芜湖大剧院',loc:'安徽芜湖市镜湖区滨江路17号',num:''}
       ]
     };
   },

+ 7 - 8
yfyc/src/views/Interact/index.vue

@@ -49,7 +49,7 @@
 </template>
 
 <script>
-import {getCodeAPI} from '@/api/interact.js'
+import { getCodeAPI } from "@/api/interact.js";
 export default {
   components: {},
   data() {
@@ -80,14 +80,13 @@ export default {
   watch: {},
   methods: {
     // 点击+号
-   async addInteract() {
+    async addInteract() {
+      //  this.$router.push("/layout/interact/issue");
       let code = this.getQueryCode();
       if (code) {
-        let res =await getCodeAPI(code)
-        console.log('-----',res);
-        // this.$router.push("/layout/interact/issue");
-        }
-      else {
+        let res = await getCodeAPI(code);
+        console.log("-----", res);
+      } else {
         //此处的ID是在文档的开发-基本配置里面
         let appid = "wx3255043d1b21a4f7";
         // let url = "http://192.168.20.48:8080/#/layout/interact";
@@ -111,7 +110,7 @@ export default {
     },
     // 获取地址栏参数的方法
     getQueryCode() {
-      return this.$route.query.code?this.$route.query.code:''
+      return this.$route.query.code ? this.$route.query.code : "";
     },
   },
   created() {