sys 1 éve
szülő
commit
3d5e6fd2f9
2 módosított fájl, 15 hozzáadás és 2 törlés
  1. 1 0
      api/discovery.js
  2. 14 2
      pages/index/model/attachment-list.vue

+ 1 - 0
api/discovery.js

@@ -4,6 +4,7 @@ const goodsUrl = '/admin/discovery/'
 // 猜你喜欢
 export const getMoments = (data) => request(goodsUrl + 'moments', 'get', { ...data })
 export const getDiscoverList = (data) => request(goodsUrl + 'list', 'get', { ...data })
+export const getNearbyList = (data) => request(goodsUrl + 'nearby', 'get', { ...data })
 export const setLike = (data) => request(goodsUrl + 'right/'+data, 'get', {  })
 export const setDislike = (data) => request(goodsUrl + 'left/'+data, 'get', {  })
 

+ 14 - 2
pages/index/model/attachment-list.vue

@@ -28,13 +28,19 @@
 </template>
 
 <script>
+import {getNearbyList} from "@/api/discovery";
+import tools from "@/service/tools";
+
 export default {
   name: "attachment-list",
   components: {},
   props: {},
   data() {
     return {
-      list:[]
+      page:1,
+      total:undefined,
+      isAjax:false,
+      list:[],
     }
   },
   watch: {},
@@ -42,7 +48,13 @@ export default {
     this.getAttachmentList()
   },
   methods: {
-    getAttachmentList(){
+    async  getAttachmentList(){
+      let locationData=await tools.getLocation()
+      getNearbyList({'pageNo':this.page,'pageSize':20,'longitude':locationData.longitude,'latitude':locationData.latitude}).then((res)=>{
+        if(res.code===0){
+
+        }
+      })
       let list=[
         {'name':'仰看辉煌仰看辉煌仰看辉煌仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
         {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},