From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +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..5183248 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
+ },capacity: 3,page:1
+ }).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