Commit 65f9965d authored by 张娇(东信)'s avatar 张娇(东信)

乡村旅居筛选

parent f4060838
...@@ -64,6 +64,10 @@ function timestampToDateBasic(timestamp) { ...@@ -64,6 +64,10 @@ function timestampToDateBasic(timestamp) {
const day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0');
return `${year}/${month}/${day}`; return `${year}/${month}/${day}`;
} }
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -50,6 +50,10 @@ const getTourList = () => { ...@@ -50,6 +50,10 @@ const getTourList = () => {
placeList.value = res.data; placeList.value = res.data;
}); });
}; };
const reset = () => {
selectedItem.value = [];
};
defineExpose({ reset });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -89,7 +89,12 @@ const getScreeningConditions = () => { ...@@ -89,7 +89,12 @@ const getScreeningConditions = () => {
peopleList.value = res.data.forPeopleList; peopleList.value = res.data.forPeopleList;
}); });
}; };
const reset = () => {}; const reset = () => {
selectedItem.value = [];
selectedItem1.value = [];
selectedItem2.value = [];
};
defineExpose({ reset });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -34,6 +34,10 @@ const selectItem = (index, item) => { ...@@ -34,6 +34,10 @@ const selectItem = (index, item) => {
selectedItem.value = index; selectedItem.value = index;
emit('sortParams', item); emit('sortParams', item);
}; };
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -124,10 +124,10 @@ ...@@ -124,10 +124,10 @@
<wd-icon size="24rpx" class="icons"></wd-icon> <wd-icon size="24rpx" class="icons"></wd-icon>
</view> </view>
</view> </view>
<Sort v-show="rotate" @sortParams="sortParams" /> <Sort v-show="rotate" ref="sortRef" @sortParams="sortParams" />
<DepartureDate v-show="rotate2" @dataParams="dataParams" /> <DepartureDate v-show="rotate2" ref="departureDateRef" @dataParams="dataParams" />
<ScenicSpots v-show="rotate3" @placeParams="placeParams" /> <ScenicSpots v-show="rotate3" ref="scenicSpotsRef" @placeParams="placeParams" />
<Screen v-show="rotate4" @screenParams="screenParams" /> <Screen v-show="rotate4" ref="screenRef" @screenParams="screenParams" />
</view> </view>
<view class="list-card"> <view class="list-card">
<view <view
...@@ -193,7 +193,10 @@ const allocateDate = ref(null); ...@@ -193,7 +193,10 @@ const allocateDate = ref(null);
const serviceList = ref([]); const serviceList = ref([]);
const keyword = ref(''); const keyword = ref('');
const forPeopleList = ref([]); const forPeopleList = ref([]);
const sortRef = ref(null);
const departureDateRef = ref(null);
const scenicSpotsRef = ref(null);
const screenRef = ref(null);
const locationFiltering = (index) => { const locationFiltering = (index) => {
switch (index) { switch (index) {
case 0: case 0:
...@@ -331,17 +334,32 @@ const getProd = (searchKeyword = '') => { ...@@ -331,17 +334,32 @@ const getProd = (searchKeyword = '') => {
cardList.value = res.data.records; cardList.value = res.data.records;
}); });
}; };
const resetParams = () => { const resetParams = () => {
if (sortRef.value || departureDateRef.value || scenicSpotsRef.value || screenRef.value) {
sortType.value = null; sortType.value = null;
attractionIdList.value = [];
dateType.value = null; dateType.value = null;
allocateDate.value = null;
attractionIdList.value = [];
startCityList.value = []; startCityList.value = [];
serviceList.value = []; serviceList.value = [];
forPeopleList.value = []; forPeopleList.value = [];
allocateDate.value = null; sortRef.value.reset();
departureDateRef.value.reset();
scenicSpotsRef.value.reset();
screenRef.value.reset();
getProd(); getProd();
}
}; };
// const resetParams = () => {
// sortType.value = null;
// attractionIdList.value = [];
// dateType.value = null;
// startCityList.value = [];
// serviceList.value = [];
// forPeopleList.value = [];
// allocateDate.value = null;
// getProd();
// };
function toRouteDetails(item) { function toRouteDetails(item) {
console.log(item, 22222); console.log(item, 22222);
// TODO: 跳转到线路详情 // TODO: 跳转到线路详情
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment