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
c84bb4bb
Commit
c84bb4bb
authored
Jul 31, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口
parent
571bbf6c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
shop.js
src/api/shop.js
+25
-1
shop.vue
src/pages/shop/shop.vue
+0
-0
common.js
src/utils/common.js
+22
-0
No files found.
src/api/shop.js
View file @
c84bb4bb
import
{
request
}
from
'../utils/request'
;
import
{
request
}
from
'../utils/request'
;
//
分类
//
店铺信息
export
function
getStoreInformation
(
data
)
{
export
function
getStoreInformation
(
data
)
{
return
request
({
return
request
({
url
:
`/sgyrdd/shop/getById?shopId=
${
data
}
`
,
url
:
`/sgyrdd/shop/getById?shopId=
${
data
}
`
,
method
:
'GET'
,
method
:
'GET'
,
});
});
}
}
// 店铺信息
export
function
groupBuyList
(
data
)
{
return
request
({
url
:
`/sgyrdd/prod/groupBuyList?shopId=
${
data
}
`
,
method
:
'GET'
,
});
}
// 商家评论列表分页
export
function
getEvaluationPage
(
data
)
{
return
request
({
url
:
`/sgyrdd/evaluation/page`
,
method
:
'GET'
,
data
,
});
}
// 获取商家优惠券
export
function
couponShopList
(
data
)
{
return
request
({
url
:
`/sgyrdd/coupon/couponShopList/
${
data
}
`
,
method
:
'GET'
,
});
}
src/pages/shop/shop.vue
View file @
c84bb4bb
This diff is collapsed.
Click to expand it.
src/utils/common.js
0 → 100644
View file @
c84bb4bb
// 根据经纬度计算距离,参数分别为第一点的纬度、经度;第二点的纬度、经度
export
function
getDistance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
const
R
=
6371
;
// 地球半径,单位为千米
const
dLat
=
deg2rad
(
lat2
-
lat1
);
const
dLng
=
deg2rad
(
lng2
-
lng1
);
const
a
=
Math
.
sin
(
dLat
/
2
)
*
Math
.
sin
(
dLat
/
2
)
+
Math
.
cos
(
deg2rad
(
lat1
))
*
Math
.
cos
(
deg2rad
(
lat2
))
*
Math
.
sin
(
dLng
/
2
)
*
Math
.
sin
(
dLng
/
2
);
const
c
=
2
*
Math
.
atan2
(
Math
.
sqrt
(
a
),
Math
.
sqrt
(
1
-
a
));
const
distance
=
R
*
c
;
if
(
distance
>=
1
)
{
return
distance
.
toFixed
(
2
)
+
'千米'
;
}
else
{
return
(
distance
*
1000
).
toFixed
(
2
)
+
'米'
;
}
}
// 将角度转换为弧度
function
deg2rad
(
deg
)
{
return
deg
*
(
Math
.
PI
/
180
);
}
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