Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
493cd4a5
Commit
493cd4a5
authored
Aug 12, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
乡村旅居筛选优化
parent
23189d75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
12 deletions
+34
-12
DepartureDate.vue
src/Components/assistingAgriculture/index/DepartureDate.vue
+20
-7
RuralTravel.vue
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
+14
-5
No files found.
src/Components/assistingAgriculture/index/DepartureDate.vue
View file @
493cd4a5
...
@@ -10,16 +10,17 @@
...
@@ -10,16 +10,17 @@
>
>
{{
item
.
startDate
}}
{{
item
.
startDate
}}
</li>
</li>
<wd-calendar
use-default-slot
v-model=
"value"
@
confirm=
"handleConfirm
4
"
>
<wd-calendar
use-default-slot
v-model=
"value"
@
confirm=
"handleConfirm"
>
<li>
选择日期
</li>
<li
@
tap=
"selectItem(index, item)"
>
选择日期
</li>
</wd-calendar>
</wd-calendar>
</ul>
</ul>
</view>
</view>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
defineProps
,
onMounted
}
from
'vue'
;
import
{
defineProps
,
onMounted
,
ref
}
from
'vue'
;
import
{
getStartDate
}
from
'@/api/assistingAgriculture/village'
;
import
{
getStartDate
}
from
'@/api/assistingAgriculture/village'
;
const
selectedItem
=
ref
(
null
);
const
selectedItem
=
ref
(
null
);
const
emit
=
defineEmits
([
'dataParams'
]);
const
emit
=
defineEmits
([
'dataParams'
]);
const
dataList
=
ref
([]);
const
dataList
=
ref
([]);
...
@@ -35,21 +36,33 @@ const props = defineProps({
...
@@ -35,21 +36,33 @@ const props = defineProps({
default
:
'100%'
,
default
:
'100%'
,
},
},
});
});
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getStartDateList
();
getStartDateList
();
});
});
const
selectItem
=
(
index
,
item
)
=>
{
const
selectItem
=
(
index
,
item
)
=>
{
console
.
log
(
item
,
323
);
const
datePart
=
timestampToDateBasic
(
value
.
value
);
selectedItem
.
value
=
index
;
selectedItem
.
value
=
index
;
emit
(
'dataParams'
,
item
);
emit
(
'dataParams'
,
item
,
datePart
);
console
.
log
(
datePart
,
'datePart'
);
};
};
// 查询出发日期
const
getStartDateList
=
()
=>
{
const
getStartDateList
=
()
=>
{
getStartDate
(
params
).
then
((
res
)
=>
{
getStartDate
(
params
).
then
((
res
)
=>
{
dataList
.
value
=
res
.
data
;
dataList
.
value
=
res
.
data
;
});
});
};
};
function
handleConfirm4
({
value
})
{
function
handleConfirm
({
value
})
{
formatValue
.
value
=
new
Date
(
value
).
toString
();
const
datePart
=
timestampToDateBasic
(
value
);
console
.
log
(
datePart
,
'datePart---111'
);
selectItem
(
undefined
,
undefined
);
}
function
timestampToDateBasic
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
/
${
month
}
/
${
day
}
`
;
}
}
</
script
>
</
script
>
...
...
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
View file @
493cd4a5
...
@@ -180,6 +180,7 @@ const sortType = ref(null);
...
@@ -180,6 +180,7 @@ const sortType = ref(null);
const
attractionId
=
ref
(
null
);
const
attractionId
=
ref
(
null
);
const
startCity
=
ref
(
null
);
const
startCity
=
ref
(
null
);
const
dateType
=
ref
(
null
);
const
dateType
=
ref
(
null
);
const
allocateDate
=
ref
(
null
);
const
serviceCommitment
=
ref
(
null
);
const
serviceCommitment
=
ref
(
null
);
const
labelId
=
ref
(
null
);
const
labelId
=
ref
(
null
);
const
locationFiltering
=
(
index
)
=>
{
const
locationFiltering
=
(
index
)
=>
{
...
@@ -233,10 +234,16 @@ const sortParams = (sortMode) => {
...
@@ -233,10 +234,16 @@ const sortParams = (sortMode) => {
getProd
();
getProd
();
};
};
// 出发日期
// 出发日期
const
dataParams
=
(
item
)
=>
{
const
dataParams
=
(
item
,
datePart
)
=>
{
console
.
log
(
item
,
item
.
key
,
22322323
);
if
(
item
!==
undefined
)
{
dateType
.
value
=
item
.
key
;
dateType
.
value
=
item
.
key
;
getProd
();
getProd
();
}
else
if
(
item
===
undefined
)
{
console
.
log
(
item
,
3333333
);
dateType
.
value
=
8
;
allocateDate
.
value
=
datePart
;
getProd
();
}
};
};
// 景点
// 景点
const
placeParams
=
(
id
)
=>
{
const
placeParams
=
(
id
)
=>
{
...
@@ -262,10 +269,11 @@ const getProd = () => {
...
@@ -262,10 +269,11 @@ const getProd = () => {
size
:
10
,
size
:
10
,
...(
sortType
.
value
!==
null
&&
{
sortType
:
sortType
.
value
.
sortMode
}),
...(
sortType
.
value
!==
null
&&
{
sortType
:
sortType
.
value
.
sortMode
}),
...(
attractionId
.
value
!==
null
&&
{
attractionId
:
attractionId
.
value
.
id
}),
...(
attractionId
.
value
!==
null
&&
{
attractionId
:
attractionId
.
value
.
id
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
.
key
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
}),
...(
startCity
.
value
!==
null
&&
{
startCity
:
startCity
.
value
}),
...(
startCity
.
value
!==
null
&&
{
startCity
:
startCity
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...(
dateType
.
value
===
8
&&
{
allocateDate
:
allocateDate
.
value
}),
};
};
getProdList
(
params
).
then
((
res
)
=>
{
getProdList
(
params
).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
...
@@ -274,6 +282,7 @@ const getProd = () => {
...
@@ -274,6 +282,7 @@ const getProd = () => {
cardList
.
value
=
res
.
data
.
records
;
cardList
.
value
=
res
.
data
.
records
;
});
});
};
};
function
toRouteDetails
(
item
)
{
function
toRouteDetails
(
item
)
{
console
.
log
(
item
,
22222
);
console
.
log
(
item
,
22222
);
// TODO: 跳转到线路详情
// TODO: 跳转到线路详情
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment