地图跳转

parent 971fc199
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
}, },
"pages": [ // pages 数组中第一项表示应用启动页 "pages": [ // pages 数组中第一项表示应用启动页
{ {
"path": "pages/shop/shop", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "店铺首页", "navigationBarTitleText": "小程序平台"
"onReachBottomDistance": 50
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/shop/shop",
"style": { "style": {
"navigationBarTitleText": "小程序平台" "navigationBarTitleText": "店铺首页",
"onReachBottomDistance": 50
} }
}, },
{ {
......
...@@ -387,7 +387,11 @@ function sgyrddShopPageFn(categoryIds) { ...@@ -387,7 +387,11 @@ function sgyrddShopPageFn(categoryIds) {
function getLocationFn() { function getLocationFn() {
xma.getLocation({ xma.getLocation({
type: 'wgs84', type: 'wgs84',
isHighAccuracy: true,
success: function (res) { success: function (res) {
// 经纬度
console.log('res.latitude, res.longitude', res.latitude, res.longitude);
const myLatitude = currentLatitudeAndLongitude.value.latitude; const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude; const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1); const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
...@@ -402,21 +406,16 @@ function getLocationFn() { ...@@ -402,21 +406,16 @@ function getLocationFn() {
* 跳转地图 * 跳转地图
*/ */
function openMapApp(info) { function openMapApp() {
console.log('info', info);
uni.showActionSheet({ uni.showActionSheet({
itemList: ['高德地图', '百度地图'], itemList: ['高德地图', '百度地图'],
success: (res) => { success: (res) => {
const item = { const item = {
shopAddress: info.shopAddress, shopAddress: shopInfo.value.shopAddress,
// latitude: info.location.lat, latitude: shopInfo.value.location.lat,
latitude: '106.68650025025502', longitude: shopInfo.value.location.lon,
// longitude: info.location.lon, name: shopInfo.value.shopAddress,
longitude: '26.567192352601154',
name: '',
}; };
console.log('item', item);
switch (res.tapIndex) { switch (res.tapIndex) {
case 0: case 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment