Explorar o código

feat: 订单bug

2912631854@qq.com hai 8 meses
pai
achega
82c7aefa81
Modificáronse 3 ficheiros con 9 adicións e 12 borrados
  1. 3 2
      pages/home/index.vue
  2. 3 3
      pages/login/select.vue
  3. 3 7
      pagesHouse/home/index.vue

+ 3 - 2
pages/home/index.vue

@@ -193,6 +193,7 @@
 				let t = this.shList.find(d => d.merchantName == this.name);
 				console.log('000', t);
 				if (t) {
+					uni.setStorageSync('merchantType',t.merchantType);
 					if (t.merchantType == 2) { //酒店民宿
 						uni.setStorageSync('homestayId', t.merchantId);
 						uni.setStorageSync('merchantId', '');
@@ -201,13 +202,13 @@
 						this.finished = false;
 						this.list = [];
 						this.getList();
-					} else {
+					} else { 
 						this.item = null;
 						this.list = [];
 						uni.setStorageSync('homestayId', '');
 						uni.setStorageSync('merchantId', t.merchantId);
 						uni.navigateTo({
-							url: '/pagesHouse/home/index'
+							url: '/pagesHouse/home/index?merchantType='+t.merchantType
 						})
 					}
 				}

+ 3 - 3
pages/login/select.vue

@@ -51,14 +51,14 @@
 				})
 			},
 			toHome(item) { //1711268640588517378   1721450548101648385
-				//uni.setStorageSync('userInfo', JSON.stringify(this.userInfo));
-				if (item.merchantType == 2) {
+			uni.setStorageSync('merchantType',item.merchantType);
+				if (item.merchantType == 2) {//民宿
 					uni.setStorageSync('homestayId', item.merchantId);
 					uni.setStorageSync('merchantId','');
 					uni.reLaunch({
 						url: '/pages/home/index'
 					})
-				} else {
+				} else {//渔家乐和餐饮
 					uni.setStorageSync('homestayId', '');
 					uni.setStorageSync('merchantId', item.merchantId);
 					uni.setStorageSync('merchantName', item.merchantName);

+ 3 - 7
pagesHouse/home/index.vue

@@ -122,10 +122,8 @@
 			}
 		},
 		onLoad(opt) {
-			// if(opt.merchantName ){
-			// 	this.merchantName =opt.merchantName ;
-			// }
-			this.merchantType = opt.merchantType || 4;
+			this.merchantType=uni.getStorageSync('merchantType');
+			console.log(merchantType);
 			this.getData();
 			this.getList();
 			this.getType()
@@ -146,13 +144,11 @@
 				})
 			},
 			confirm(e) {
-				console.log(e);
 				this.name = e.value[0];
 				this.shShow = false;
-
 				let t = this.shList.find(d => d.merchantName == this.name);
-				console.log('000', t);
 				if (t) {
+					uni.setStorageSync('merchantType',t.merchantType);
 					if (t.merchantType != 2) { //酒店民宿
 						uni.setStorageSync('homestayId', '');
 						uni.setStorageSync('merchantId', t.merchantId);