From a75b18a4157ab486e0b51c438ac165ab3a08e3e0 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 25 七月 2024 18:10:00 +0800
Subject: [PATCH] 代码提交
---
 wechat_jiaxuan/components/authCard/authCard.js |   50 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/wechat_jiaxuan/components/authCard/authCard.js b/wechat_jiaxuan/components/authCard/authCard.js
index d44d311..97e2db3 100644
--- a/wechat_jiaxuan/components/authCard/authCard.js
+++ b/wechat_jiaxuan/components/authCard/authCard.js
@@ -1,4 +1,6 @@
-import { getShopPage } from '../../api/index'
+import {
+  getShopPage
+} from '../../api/index'
 Component({
   /**
    * 缁勪欢鐨勫睘鎬у垪琛�
@@ -8,18 +10,52 @@
       type: String,
       value: '0',
       observer(val) {
-        if(val === '1'){
-          this.getShops()
+        if (val === '1') {
+          let that = this
+          wx.getLocation({
+            type: 'wgs84',
+            success(res) {
+              const latitude = res.latitude
+              const longitude = res.longitude
+              that.getShops(latitude, longitude)
+            }
+          })
+
         }
       }
     },
   },
   data: {
-    
+    shopList: []
   },
   methods: {
-    getShops() {
-      getShopPage()
+    getShops(latitude, longitude) {
+      getShopPage({
+        model: {
+          longitude,
+          latitude
+        }
+      }).then(res => {
+        this.setData({
+          shopList: res.data.records
+        })
+      })
+    },
+    shopDetail(e) {
+      const id = e.currentTarget.dataset.id
+      wx.navigateTo({
+        url: `/pages/store/info?id=${id}`,
+      })
+    },
+    jumpStaff() {
+      wx.navigateTo({
+        url: '/pages/store/staffList',
+      })
+    },
+    jumpAuth() {
+      wx.navigateTo({
+        url: '/pages/auth/auth',
+      })
     },
     jumpStore() {
       wx.navigateTo({
@@ -27,4 +63,4 @@
       })
     }
   }
-})
+})
\ No newline at end of file
--
Gitblit v1.9.3