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
ff9265c3
Commit
ff9265c3
authored
Aug 02, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图跳转
parent
971fc199
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
pages.json
src/pages.json
+5
-5
shop.vue
src/pages/shop/shop.vue
+9
-10
No files found.
src/pages.json
View file @
ff9265c3
...
...
@@ -7,16 +7,16 @@
},
"pages"
:
[
//
pages
数组中第一项表示应用启动页
{
"path"
:
"pages/
shop/shop
"
,
"path"
:
"pages/
index/index
"
,
"style"
:
{
"navigationBarTitleText"
:
"店铺首页"
,
"onReachBottomDistance"
:
50
"navigationBarTitleText"
:
"小程序平台"
}
},
{
"path"
:
"pages/
index/index
"
,
"path"
:
"pages/
shop/shop
"
,
"style"
:
{
"navigationBarTitleText"
:
"小程序平台"
"navigationBarTitleText"
:
"店铺首页"
,
"onReachBottomDistance"
:
50
}
},
{
...
...
src/pages/shop/shop.vue
View file @
ff9265c3
...
...
@@ -387,7 +387,11 @@ function sgyrddShopPageFn(categoryIds) {
function
getLocationFn
()
{
xma
.
getLocation
({
type
:
'wgs84'
,
isHighAccuracy
:
true
,
success
:
function
(
res
)
{
// 经纬度
console
.
log
(
'res.latitude, res.longitude'
,
res
.
latitude
,
res
.
longitude
);
const
myLatitude
=
currentLatitudeAndLongitude
.
value
.
latitude
;
const
myLongitude
=
currentLatitudeAndLongitude
.
value
.
longitude
;
const
distance
=
getDistance
(
res
.
latitude
,
res
.
longitude
,
myLatitude
,
myLongitude
,
1
);
...
...
@@ -402,21 +406,16 @@ function getLocationFn() {
* 跳转地图
*/
function
openMapApp
(
info
)
{
console
.
log
(
'info'
,
info
);
function
openMapApp
()
{
uni
.
showActionSheet
({
itemList
:
[
'高德地图'
,
'百度地图'
],
success
:
(
res
)
=>
{
const
item
=
{
shopAddress
:
info
.
shopAddress
,
// latitude: info.location.lat,
latitude
:
'106.68650025025502'
,
// longitude: info.location.lon,
longitude
:
'26.567192352601154'
,
name
:
''
,
shopAddress
:
shopInfo
.
value
.
shopAddress
,
latitude
:
shopInfo
.
value
.
location
.
lat
,
longitude
:
shopInfo
.
value
.
location
.
lon
,
name
:
shopInfo
.
value
.
shopAddress
,
};
console
.
log
(
'item'
,
item
);
switch
(
res
.
tapIndex
)
{
case
0
:
...
...
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