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 |   66 ++++++++++++++++++++++++++------
 1 files changed, 53 insertions(+), 13 deletions(-)

diff --git a/wechat_jiaxuan/components/authCard/authCard.js b/wechat_jiaxuan/components/authCard/authCard.js
index 8eb15ab..97e2db3 100644
--- a/wechat_jiaxuan/components/authCard/authCard.js
+++ b/wechat_jiaxuan/components/authCard/authCard.js
@@ -1,4 +1,6 @@
-// components/authCard/authCard.js
+import {
+  getShopPage
+} from '../../api/index'
 Component({
   /**
    * 缁勪欢鐨勫睘鎬у垪琛�
@@ -6,21 +8,59 @@
   properties: {
     type: { // 灞炴�у悕
       type: String,
-      value: '0'
+      value: '0',
+      observer(val) {
+        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(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({
+        url: '/pages/store/store',
+      })
+    }
   }
-})
+})
\ No newline at end of file

--
Gitblit v1.9.3