From 2faa6546a9f9ddb29f81cbc9770fc25b95703695 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 26 七月 2024 17:02:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
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