浏览代码

地图导航

pangqijun 1 年之前
父节点
当前提交
09a5ff2207
共有 2 个文件被更改,包括 22 次插入4 次删除
  1. 11 2
      pages/groupbuying_details/order_details_confirm/index.vue
  2. 11 2
      pages/order/index.vue

+ 11 - 2
pages/groupbuying_details/order_details_confirm/index.vue

@@ -51,7 +51,7 @@
 								</view>
 								<view class="am1-2">
 									距您{{selfTake.distanceDesc}}
-									<image src="http://www.gzzzyd.com/groupon/order_details/距离@2x.png" mode="scaleToFill" />
+									<image src="http://www.gzzzyd.com/groupon/order_details/导航图标@2x.png" mode="scaleToFill"  @click="openmap(selfTake)" />
 								</view>
 							</view>
 							<view class="am2">
@@ -463,7 +463,16 @@ export default {
 		})
 	},
 	methods: {
-
+		openmap(selfTake) {
+			uni.openLocation({
+				latitude: selfTake.latitude,
+				longitude: selfTake.longitude,
+				address: selfTake.address,
+				success: function () {
+					console.log('success');
+				}
+			});
+		},
 
 		clickSelfTake(item){
 			this.selfTakeShow =false;

+ 11 - 2
pages/order/index.vue

@@ -76,7 +76,7 @@
 								<view class="am1-1">
 									{{item.selfTakeName}}
 								</view>
-								<view class="am1-2">
+								<view class="am1-2" @click="openmap(item)">
 									<image src="http://www.gzzzyd.com/groupon/order_details/导航图标@2x.png" mode="scaleToFill" />
 								</view>
 							</view>
@@ -293,7 +293,16 @@ export default {
 	},
 
 	methods: {
-
+		openmap(selfTake) {
+			uni.openLocation({
+				latitude: selfTake.latitude,
+				longitude: selfTake.longitude,
+				address: selfTake.address,
+				success: function () {
+					console.log('success');
+				}
+			});
+		},
 		closePopup(){
 			this.$refs.popup.close()
 		},