From b2d360d9113b6955287108ca9e90d76a1f3c1419 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期日, 29 九月 2024 15:05:11 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
wechat_jiaxuan/components/authCard/authCard.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/wechat_jiaxuan/components/authCard/authCard.js b/wechat_jiaxuan/components/authCard/authCard.js
index d44d311..6182d46 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,56 @@
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
+ },
+ capacity: 3,
+ page: 1
+ }).then(res => {
+ if (res.data && res.data.records) {
+ 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 +67,4 @@
})
}
}
-})
+})
\ No newline at end of file
--
Gitblit v1.9.3