Pārlūkot izejas kodu

存merchantType

17755135699 1 gadu atpakaļ
vecāks
revīzija
4e586dd2c6
3 mainītis faili ar 11 papildinājumiem un 10 dzēšanām
  1. 4 2
      pages/home/index.vue
  2. 4 3
      pages/login/select.vue
  3. 3 5
      pagesHouse/home/index.vue

+ 4 - 2
pages/home/index.vue

@@ -196,18 +196,20 @@
 					if (t.merchantType == 2) { //酒店民宿
 						uni.setStorageSync('homestayId', t.merchantId);
 						uni.setStorageSync('merchantId', '');
+						uni.setStorageSync('merchantType',item.merchantType);
 						this.getDetails();
 						this.page = 1;
 						this.finished = false;
 						this.list = [];
 						this.getList();
-					} else {
+					} else { 
 						this.item = null;
 						this.list = [];
 						uni.setStorageSync('homestayId', '');
 						uni.setStorageSync('merchantId', t.merchantId);
+						uni.setStorageSync('merchantType',item.merchantType);
 						uni.navigateTo({
-							url: '/pagesHouse/home/index'
+							url: '/pagesHouse/home/index?merchantType='+t.merchantType
 						})
 					}
 				}

+ 4 - 3
pages/login/select.vue

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

+ 3 - 5
pagesHouse/home/index.vue

@@ -56,7 +56,7 @@
 				</view>
 			</view>
 			<view class="menus">
-				<view @click="toHref('/pagesHouse/home/bill?merchantType='+merchantType)">
+				<view @click="toHref('/pagesHouse/home/bill')">
 					<image :src="icons[0]"></image>
 					<text>商品管理</text>
 				</view>
@@ -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()