|
@@ -239,8 +239,23 @@ const open = (item: any, num?: number, orderNumber?: any) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+watch(search, (value) => {
|
|
|
+ if (!value) {
|
|
|
+ dishList.value = dishListall.filter((ele) => {
|
|
|
+ return ele.category == buttonType.value
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ dishList.value = dishList.value.filter((ele) => {
|
|
|
+ return ele.title.includes(value)
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
const clickSortButton = (name: any) => {
|
|
|
+ //重复点击不处理
|
|
|
+ if(buttonType.value == name){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ search.value = "";
|
|
|
buttonType.value = name
|
|
|
if (name == 'all') {
|
|
|
dishList.value = dishListall
|
|
@@ -405,6 +420,7 @@ const reduceHandle = (item: { summary: number })=>{
|
|
|
orderData.sumNumSum = 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
dishCateAll().then((res) => {
|
|
|
dishCate.value = res
|