Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
40df2a4a
Commit
40df2a4a
authored
Aug 08, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跳转逻辑
parent
62c70bb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
shop.vue
src/pages/shop/shop.vue
+26
-16
No files found.
src/pages/shop/shop.vue
View file @
40df2a4a
...
@@ -351,7 +351,7 @@ const recommendedListOfPeripherals = ref([]);
...
@@ -351,7 +351,7 @@ const recommendedListOfPeripherals = ref([]);
onLoad
(
async
(
options
)
=>
{
onLoad
(
async
(
options
)
=>
{
params
.
value
.
shopId
=
options
.
shopId
;
params
.
value
.
shopId
=
options
.
shopId
;
shopId
.
value
=
options
.
shopId
;
shopId
.
value
=
options
.
shopId
;
scrollToTop
();
// 使用 Promise.all 并行请求,提升性能
// 使用 Promise.all 并行请求,提升性能
await
Promise
.
all
([
await
Promise
.
all
([
getStoreInformationFn
(
options
.
shopId
),
getStoreInformationFn
(
options
.
shopId
),
...
@@ -368,7 +368,13 @@ onLoad(async (options) => {
...
@@ -368,7 +368,13 @@ onLoad(async (options) => {
// 获取位置并计算距离
// 获取位置并计算距离
calculateDistance
();
calculateDistance
();
});
});
function
scrollToTop
()
{
// 使用 scrollTo 方法滚动到顶部
xma
.
pageScrollTo
({
scrollTop
:
0
,
duration
:
300
,
// 动画时间,可选
});
}
onShow
(
async
()
=>
{
onShow
(
async
()
=>
{
await
getStoreInformationFn
(
params
.
value
.
shopId
);
await
getStoreInformationFn
(
params
.
value
.
shopId
);
...
@@ -376,24 +382,28 @@ onShow(async () => {
...
@@ -376,24 +382,28 @@ onShow(async () => {
calculateDistance
();
calculateDistance
();
});
});
async
function
refreshShowDetail
(
item
)
{
async
function
refreshShowDetail
(
item
)
{
params
.
value
.
shopId
=
item
.
shopId
;
//
params.value.shopId = item.shopId;
shopId
.
value
=
item
.
shopId
;
//
shopId.value = item.shopId;
// 使用 Promise.all 并行请求,提升性能
//
//
使用 Promise.all 并行请求,提升性能
await
Promise
.
all
([
//
await Promise.all([
getStoreInformationFn
(
item
.
shopId
),
//
getStoreInformationFn(item.shopId),
groupBuyListFn
(
item
.
shopId
),
//
groupBuyListFn(item.shopId),
couponShopListFn
(
item
.
shopId
),
//
couponShopListFn(item.shopId),
]);
//
]);
// 获取周边推荐信息
//
//
获取周边推荐信息
peripheryRecomFn
();
//
peripheryRecomFn();
// 获取评价信息
//
//
获取评价信息
getEvaluationPageFn
();
//
getEvaluationPageFn();
// 获取位置并计算距离
// // 获取位置并计算距离
calculateDistance
();
// calculateDistance();
/// /////////////////////
xma
.
navigateTo
({
url
:
`/pages/shop/shop?shopId=
${
item
.
shopId
}
`
,
});
}
}
// 计算距离的函数封装
// 计算距离的函数封装
async
function
calculateDistance
()
{
async
function
calculateDistance
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment