Commit 379cb7d4 authored by 张娇(东信)'s avatar 张娇(东信)

筛选修改

parent f1a30881
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{{ item.startDate }} {{ item.startDate }}
</li> </li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm"> <wd-calendar use-default-slot v-model="value" @confirm="handleConfirm">
<li @tap="selectItem(index, item)">选择日期</li> <li>选择日期</li>
</wd-calendar> </wd-calendar>
</ul> </ul>
</view> </view>
...@@ -37,11 +37,14 @@ const props = defineProps({ ...@@ -37,11 +37,14 @@ const props = defineProps({
}, },
}); });
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
onMounted(async () => { onMounted(async () => {
getStartDateList(); getStartDateList();
}); });
const selectItem = (index, item) => { const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value); const datePart = timestampToDateBasic(value.value);
if (index === selectedItem.value) { if (index === selectedItem.value) {
selectedItem.value = null; selectedItem.value = null;
...@@ -59,8 +62,7 @@ const getStartDateList = () => { ...@@ -59,8 +62,7 @@ const getStartDateList = () => {
}; };
function handleConfirm({ value }) { function handleConfirm({ value }) {
const datePart = timestampToDateBasic(value); const datePart = timestampToDateBasic(value);
console.log(datePart, 'datePart---111'); emit('dataParams', null, datePart);
selectItem(undefined, undefined);
} }
function timestampToDateBasic(timestamp) { function timestampToDateBasic(timestamp) {
const date = new Date(timestamp); const date = new Date(timestamp);
...@@ -69,10 +71,6 @@ function timestampToDateBasic(timestamp) { ...@@ -69,10 +71,6 @@ 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>
......
...@@ -328,14 +328,27 @@ const sortParams = (sortMode) => { ...@@ -328,14 +328,27 @@ const sortParams = (sortMode) => {
getProd(); getProd();
}; };
// 出发日期 // 出发日期
// const dataParams = (item, datePart) => {
// if (item !== undefined) {
// dateType.value = item.key;
// getProd();
// } else if (item === undefined) {
// dateType.value = 8;
// allocateDate.value = datePart;
// getProd();
// }
// };
const dataParams = (item, datePart) => { const dataParams = (item, datePart) => {
if (item !== undefined) { if (item) {
dateType.value = item.key; dateType.value = item.key;
getProd(); getProd();
} else if (item === undefined) { } else {
dateType.value = 8; dateType.value = 8;
allocateDate.value = datePart; if (datePart && datePart !== 'NaN/NaN/NaN') {
getProd(); allocateDate.value = datePart;
rotate2.value = false;
getProd();
}
} }
}; };
// 景点 // 景点
......
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