347617796@qq.com 4 anni fa
parent
commit
7e620c923d

+ 2 - 2
component/newpoup.vue

@@ -162,7 +162,7 @@
         top: -80upx;
     }
  
-    .uni-close-bottom:after {
+/*    .uni-close-bottom:after {
         content: '';
         position: absolute;
         width: 0px;
@@ -172,7 +172,7 @@
         left: 50%;
         transform: translate(-50%, -0%);
         opacity: 0.8;
-    }
+    } */
  
     .uni-popup-top,
     .uni-popup-bottom {

+ 4 - 6
component/shopList.vue

@@ -23,7 +23,7 @@ export default {
 		  type: Array
 		},
 		// 酒店总id
-		goodId: {
+		store_id: {
 			type: Number
 		}
 	},
@@ -36,12 +36,10 @@ export default {
     },
     methods: {
        goshop(e) {
-		   let id = e.goods_commonid;
-		   let goodIds = e.store_id; // 商品单个酒店id
-		   let stoe_ids = this.goodId;
-		 
+		   let goods_commonid = e.goods_commonid; //商品公共ID
+		   let user_store_id = this.store_id; //酒店ID
 		   uni.navigateTo({
-		   	url:`/pages/index/shop?id=${id}&store_id=${stoe_ids}&goodId=${goodIds}`
+		   	url:`/pages/index/shop?id=${goods_commonid}&store_id=${user_store_id}`
 		   })
 	   }
     },

+ 13 - 13
pages/index/hotel.vue

@@ -107,7 +107,7 @@
 									<view class="spacedance" v-for="(item, index) in classify" :key="index" @click.stop="confirm(item)">{{ item.gc_name }}</view>
 								</view>
 								<!-- 商品列表 -->
-								<shopList :goodId="goodId" :productList="goods_list" />
+								<shopList :store_id="store_id" :productList="goods_list" />
 								<view v-if="isDetail == 1" class="fontcenter">加载中...</view>
 								<view v-if="isDetail == 2" class="fontcenter">暂无更多商品</view>
 							</view>
@@ -184,7 +184,7 @@ export default {
 			hotelitle: '', // 酒店名称
 			istopclick: 0,
 			page: 1,
-			goodId: 0,
+			store_id: 0,//酒店ID
 			page_size: 10,
 			gc_id_1: '', //	一级分类id
 			gc_id_2: '', //	二级分类id
@@ -234,7 +234,7 @@ export default {
 			withShareTicket: true
 		});
 		let that = this;
-		let id = this.goodId; // 酒店id
+		let id = this.store_id; // 酒店id
 		if (res.from === 'button') {
 			// 来自页面内分享按钮
 		}
@@ -251,9 +251,9 @@ export default {
 			var str = decodeURIComponent(options.q);
 			var num = str.indexOf('=');
 			var id = str.slice(num + 1);
-			this.goodId = id; // 商品和酒店Id
+			this.store_id = id; // 商品和酒店Id
 		} else {
-			this.goodId = options.id; // 商品和酒店Id
+			this.store_id = options.id; // 商品和酒店Id
 		}
 
 		if (options.isfx) {
@@ -303,14 +303,14 @@ export default {
 				this.$msg(this.hoteldetail.feedback_msg);
 				return;
 			}
-			let store_id = this.goodId;
+			let store_id = this.store_id;
 			uni.navigateTo({
 				url: `/pages/index/feedback?store_id=${store_id}`
 			});
 		},
 		// 搜说
 		gotosearch() {
-			let store_id = this.goodId;
+			let store_id = this.store_id;
 			uni.navigateTo({
 				url: `/pages/index/hotelsearch?store_id=${store_id}`
 			});
@@ -323,7 +323,7 @@ export default {
 					method: 'post',
 					data: {
 						type: 'store',
-						fav_id: this.goodId
+						fav_id: this.store_id
 					},
 					success: res => {
 						if (res.data.data.action == 'add') {
@@ -391,7 +391,7 @@ export default {
 		},
 		godetail(item) {
 			let id = item.gc_id; // 一级菜单id
-			let store_id = this.goodId;
+			let store_id = this.store_id;
 			let gc_name = item.gc_name;
 			uni.navigateTo({
 				url: `/pages/index/hoteldetail?id=${id}&gc_name=${gc_name}&store_id=${store_id}`
@@ -404,7 +404,7 @@ export default {
 				url: '/v2/entry/storeGoods',
 				method: 'get',
 				data: {
-					store_id: this.goodId,
+					store_id: this.store_id,
 					page: this.page,
 					goods_commonid: this.goods_commonid, // 上新排序
 					goods_price: this.goods_price,
@@ -433,7 +433,7 @@ export default {
 				url: '/v1/entry/storeCategory',
 				method: 'get',
 				data: {
-					store_id: this.goodId
+					store_id: this.store_id
 				},
 				success: function(res) {
 					let { category_list } = res.data.data;
@@ -475,7 +475,7 @@ export default {
 				data: {
 					page: this.page,
 					page_size: 10,
-					store_id: this.goodId
+					store_id: this.store_id
 				},
 				success: res => {
 					this.feedback_list = res.data.data.feedback_list;
@@ -495,7 +495,7 @@ export default {
 				url: '/v1/store/info',
 				method: 'get',
 				data: {
-					store_id: this.goodId
+					store_id: this.store_id
 				},
 				success: res => {
 					

+ 2 - 1
pages/index/hoteldetail.vue

@@ -53,7 +53,7 @@
 			@scrolltolower="lower"
 			:refresher-enabled="false"
 		>
-			<shopList :goodId="store_id" :productList="goods_list" />
+			<shopList :store_id="store_id" :productList="goods_list" />
 			<view v-if="ispill" class="fontcenter">加载中...</view>
 			<view v-if="!ispill" class="fontcenter">暂无更多商品</view>
 		</scroll-view>
@@ -101,6 +101,7 @@ export default {
 		this.title = options.gc_name;
 		this.gc_id_1 = options.id;
 		this.store_id = options.store_id;
+		
 		uni.setNavigationBarTitle({
 			title: options.gc_name
 		});

+ 4 - 3
pages/index/hotelsearch.vue

@@ -58,7 +58,7 @@ export default {
 		shopList
 	},
 	onLoad(a) {
-		this.goodId = a.store_id;
+		this.store_id = a.store_id;
 	},
 	data() {
 		return {
@@ -70,7 +70,8 @@ export default {
 			isDetail: 1,
 			isprice: 0,
 			page: 1,
-			goodId: 0,
+			store_id: 0,
+			
 			tabIndex: 1,
 			istopclick: 0,
 			goods_price: '',
@@ -133,7 +134,7 @@ export default {
 				url: '/v2/entry/storeGoods',
 				method: 'get',
 				data: {
-					store_id: this.goodId,
+					store_id: this.store_id,
 					page: this.page,
 					goods_commonid: this.goods_commonid, // 上新排序
 					goods_price: this.goods_price,

+ 13 - 11
pages/index/index.vue

@@ -48,7 +48,6 @@
 			:scroll-top="scrollTop"
 			scroll-y="true"
 			@scroll="scroll"
-			@scrolltoupper="upper"
 			@scrolltolower="lower"
 			:refresher-enabled="false"
 		>
@@ -181,10 +180,12 @@ export default {
 		this.isGetLocation();
 	},
 	onHide() {
+		console.log("显示了")
 		clearInterval(this.timer);
 		this.timer = null;
 	},
 	onLoad() {
+		console.log("加载了")
 		if (this.beginload) {
 			this.getpicture(); // 开机广告
 			this.amapPlugin = new amap.AMapWX({
@@ -198,7 +199,6 @@ export default {
 			this.firstget();
 		}
 	},
-
 	watch: {
 		beginload: function(val) {
 			this.getpicture(); // 开机广告
@@ -278,9 +278,6 @@ export default {
 				url: `/pages/index/searchresult?lat=${lat}&lon=${lon}`
 			});
 		},
-		// 滚动到顶部
-		upper(e) {},
-
 		getop() {
 			this.scrollTop = this.old.scrollTop;
 			this.$nextTick(function() {
@@ -313,12 +310,9 @@ export default {
 				success: res => {
 					if (!res.authSetting[a]) {
 						// 每次进入程序判断当前是否获得授权,如果没有就去获得授权,如果获得授权,就直接获取当前地理位置
-						console.log("未授权")
-						
 						this.getAuthorizeInfo();
 					} else {
 						if(this.allow){
-							console.log("授权了")
 							this.getRegeo();
 						}
 					}
@@ -438,9 +432,17 @@ export default {
 						this.$msg('二维码错误');
 					} else {
 						var obj = this.GetRequest(res.result);
-						uni.navigateTo({
-							url: `/pages/index/shop?id=${obj.goods_id}&store_id=${obj.store_id}`
-						});
+						console.log(res.result)
+						if(obj.qs){
+							var arr=obj.qs.split('--');
+							uni.navigateTo({
+								url: `/pages/index/shop?id=${arr[1]}&store_id=${arr[0]}`
+							});
+						}else{
+							uni.navigateTo({
+								url: `/pages/index/hotel?id=${obj.store_id}`
+							});
+						}
 					}
 				}
 			});

+ 16 - 10
pages/index/shop.vue

@@ -183,7 +183,7 @@ export default {
 			bottomtop: '55upx',
 			scopemapId: 0,
 			showdialog: false,
-			has_collected: false, // 是否收藏
+			has_collected: 0, // 是否收藏
 			cartnumber: 0, // 购物车数量
 			changnumber: 100,
 			ismax: false, // 输入狂禁止数量
@@ -212,7 +212,6 @@ export default {
 			imgList: [],
 			desc: '',
 			specList: [],
-			onlystoreId: 0, // 总酒店id
 			isfx: false,
 			isShowDetail:true,
 		};
@@ -230,14 +229,20 @@ export default {
 		uni.getSystemInfo({
 			success: function(res) {
 				_this.windowHeight = res.screenHeight;
-				// console.log("屏幕宽度:"+res.screenWidth);
-				// console.log("屏幕高度:"+res.screenHeight);
-				// console.log("可使用窗口宽度:"+res.windowWidth);
-				// console.log("可使用窗口高度:"+res.windowHeight);
 			}
 		});
 	},
 	async onLoad(options) {
+		if (options.q) {
+			var str = decodeURIComponent(options.q);
+			var num = str.indexOf('=');
+			var id = str.slice(num + 1);
+			// this.goodId = id; // 商品和酒店Id
+		} else {
+			// this.goodId = options.id; // 商品和酒店Id
+		}
+
+
 		if (options.isfx) {
 			this.isfx = true;
 		} else {
@@ -245,8 +250,8 @@ export default {
 		}
 		this.goodId = options.id; // 商品公共id
 		this.store_id = options.store_id; // 酒店id
-		this.onlystoreId = options.goodId;
-		// this.getshopdetail(); // 获取商品详情
+		console.log( options.store_id)
+		
 		uni.$on('changshow', e => {
 			this.changeshow();
 		});
@@ -336,8 +341,8 @@ export default {
 						setTimeout(function(){uni.navigateBack({delta: 1});},1000)
 					}else {
 						this.cartnumber = data.cart;
-						// this.getNum();
 						this.has_collected = data.has_collected;
+						
 						let array = data;
 						if(array.images){
 							array.images.forEach(item => {
@@ -383,6 +388,8 @@ export default {
 		//规格弹窗开关
 		toggleSpec() {
 			if (this.hasLogin && this.successlogion) {
+				// 是否本自营店 、//是否是正常出售,//是否还有库存
+				// console.log(this.datalist.store_id,this.datalist,this.store_id)
 				if (this.datalist.store_id != this.store_id || this.datalist.goods_state != 1 || this.datalist.goods_storage < 1) {
 					this.$msg('商品已售罄');
 					return;
@@ -577,7 +584,6 @@ export default {
 			}
 			if (e.detail.scrollTop > 250) {
 				this.isTop = true;
-				console.log(e.detail.scrollTop)
 			} else {
 				//当距离小于500时显示回到顶部按钮
 				this.isTop = false;

+ 0 - 2
pages/myOrder/index.vue

@@ -141,7 +141,6 @@ export default {
 			this.getlist();
 		});
 		if (this.successlogion && this.hasLogin) {
-			
 			this.getlist(); // 获取订单
 		} else {
 			uni.navigateTo({
@@ -286,7 +285,6 @@ export default {
 					}
 					this.firstloading = 1;
 					this.order_list = this.order_list.concat(res.data.data.order_list);
-					console.log(this.order_list);
 				}
 			});
 		},

+ 0 - 1
store/logion.js

@@ -9,7 +9,6 @@ const store = new Vuex.Store({
 		sessionId:'',
 		successlogion: false, // 同意授权手机号 成功登录
 		getcode: {}, // code 后获取的token session_key等值
-		//showModal: false, //登录授权弹窗
 		userInfo: {},
 		beginload: false,
 	},