Просмотр исходного кода

form表单点选事件问题修改;
团餐的底部栏在APP的获取当前路由地址的问题修改;

郭鹏飞 10 месяцев назад
Родитель
Сommit
a25e834001
2 измененных файлов с 13 добавлено и 3 удалено
  1. 9 2
      pages/groupMeal/goods/form-step1.vue
  2. 4 1
      pages/groupMeal/tabbar/index.vue

+ 9 - 2
pages/groupMeal/goods/form-step1.vue

@@ -8,8 +8,8 @@
 				labelPosition="left" labelWidth="auto"
 				:error-type="['toast', 'border-bottom']"
 			> 
-				<u-form-item prop="category" label="商品分类" required borderBottom>
-					<u-input v-model="form.categoryName" placeholder="去设置" height="41" inputAlign="right" @click="show = true"></u-input>
+				<u-form-item prop="category" label="商品分类" required borderBottom @click="show = true">
+					<u-input v-model="form.categoryName" class="form-input" disabled placeholder="去设置" height="41" inputAlign="right"></u-input>
 					<u-icon slot="right" name="arrow-right" color="#C7C6CA"></u-icon>
 				</u-form-item>
 				
@@ -322,6 +322,13 @@ $uni-color-primary: #2979ff;
 		}
 	}
 
+	.form-input {
+		pointer-events: none;
+	}
+	::v-deep .uni-input-input:disabled {
+		pointer-events: none;
+	}
+
 	.input-suffix {
 		color: #232832;
 		font-size: 26rpx;

+ 4 - 1
pages/groupMeal/tabbar/index.vue

@@ -40,7 +40,10 @@ export default {
 		};
 	},
 	mounted() {
-        this.current = this.list.findIndex(item => item.urlPath === this.$route.path);
+		const pages = getCurrentPages();
+		// 获取当前页面实例(栈顶页面)
+		const currentPage = pages[pages.length - 1];
+        this.current = this.list.findIndex(item => item.urlPath === `/${currentPage.route}`);
 	},
 	methods: {
 		onChange(e) {