Преглед изворни кода

店铺详情经纬度与首页一致

1410417013 пре 7 месеци
родитељ
комит
7ec8c5d3da
3 измењених фајлова са 17 додато и 7 уклоњено
  1. 2 2
      pages/index/index.vue
  2. 7 0
      pages/index/shop/confirmOrder.vue
  3. 8 5
      pages/index/shop/index.vue

+ 2 - 2
pages/index/index.vue

@@ -521,7 +521,7 @@
 
 				setTimeout(function() {
 					uni.navigateTo({
-						url: '/pages/index/shop/index?shopId=' + that.shopId +'&shopTypeId=' + shopTypeId
+						url: '/pages/index/shop/index?shopId=' + that.shopId +'&shopTypeId=' + shopTypeId+'&lat='+this.lat+'&lng='+this.lng
 					})
 				}, 100)
 			} else if (e.orderId) {
@@ -1240,7 +1240,7 @@
 				let items = encodeURIComponent(JSON.stringify(shuzu));
 				
 				uni.navigateTo({
-					url:'/pages/index/shop/index?shopId='+url+'&huoListss='+items+'&shopTypeId='+e.shopTypeId
+					url:'/pages/index/shop/index?shopId='+url+'&huoListss='+items+'&shopTypeId='+e.shopTypeId+'&lat='+this.lat+'&lng='+this.lng
 				})
 				
 			},

+ 7 - 0
pages/index/shop/confirmOrder.vue

@@ -1251,6 +1251,13 @@ export default {
 			if (this.remark) {
 				this.takeReark()
 			}
+			// if(this.orderType == 1){
+			// 	uni.showToast({
+			// 		title: '是否店内就餐?',
+			// 		icon: 'none'
+			// 	})
+			// 	return
+			// }
 			uni.showLoading({
 				title: '支付中...',
 				mask: true // 是否显示透明蒙层,防止触摸穿透

+ 8 - 5
pages/index/shop/index.vue

@@ -735,7 +735,7 @@ export default {
 		}
 	},
 	onLoad(option) {
-		// console.log(option)
+		console.log(option) 
 		this.shopTypeId = option.shopTypeId.split(',')
 		this.showShopTypeId = this.shopTypeId.includes('10')
 
@@ -755,6 +755,9 @@ export default {
 		}
 
 		this.shopId = option.shopId
+		this.lat = option.lat
+		this.lng = option.lng
+		this.getData()
 
 		uni.showLoading({
 			title: '加载中',
@@ -763,11 +766,11 @@ export default {
 
 		uni.getLocation({
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: (res) => {
+			success: (res) => { 
 				// console.log(res, '经纬度')
-				this.lat = res.latitude
-				this.lng = res.longitude
-				this.getData()
+				// this.lat = res.latitude
+				// this.lng = res.longitude
+				// this.getData()
 			}
 		})
 		this.orderId = uni.getStorageSync('orderId') ? uni.getStorageSync('orderId') : ''