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
eb53a660
Commit
eb53a660
authored
Aug 12, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
乡村旅居筛选
parent
ffa6035b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
26 deletions
+90
-26
Screen.vue
src/Components/assistingAgriculture/index/Screen.vue
+54
-21
village.js
src/api/assistingAgriculture/village.js
+8
-0
RuralTravel.vue
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
+28
-5
No files found.
src/Components/assistingAgriculture/index/Screen.vue
View file @
eb53a660
<
template
>
<
template
>
<view
class=
"sort"
:style=
"
{ width: width }">
<view
class=
"sort"
:style=
"
{ width: width }">
<view
class=
"date"
>
筛选
</view>
<view
class=
"date"
>
出发城市
</view>
<ul
class=
"ul"
>
<ul
class=
"ul"
>
<li
<li
v-for=
"(item, index) in
items
"
v-for=
"(item, index) in
screenList
"
:key=
"index"
:key=
"index"
:class=
"
{ active: selectedItem === index }"
:class=
"
{ active: selectedItem === index }"
@tap="selectItem(index)"
@tap="selectItem(index
, item, 'screen'
)"
>
>
{{
item
}}
{{
item
.
tripCity
}}
</li>
</ul>
<view
class=
"date"
>
服务承诺
</view>
<ul
class=
"ul"
>
<li
v-for=
"(item, index) in serveList"
:key=
"index"
:class=
"
{ active: selectedItem1 === index }"
@tap="selectItem(index, item, 'serve')"
>
{{
item
.
labelName
}}
</li>
</ul>
<view
class=
"date"
>
适用人群
</view>
<ul
class=
"ul"
>
<li
v-for=
"(item, index) in peopleList"
:key=
"index"
:class=
"
{ active: selectedItem2 === index }"
@tap="selectItem(index, item, 'people')"
>
{{
item
.
labelName
}}
</li>
</li>
</ul>
</ul>
</view>
</view>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
defineProps
}
from
'vue'
;
import
{
defineProps
,
onMounted
,
ref
}
from
'vue'
;
const
items
=
reactive
([
import
{
screeningConditions
}
from
'@/api/assistingAgriculture/village'
;
'智能排序'
,
const
emit
=
defineEmits
([
'screenParams'
]);
'距离优先'
,
'好评优先'
,
'销量优先'
,
'低价优先'
,
'低价优先'
,
'距离优先'
,
'好评优先'
,
'销量优先'
,
'低价优先'
,
'距离优先'
,
]);
const
selectedItem
=
ref
(
null
);
const
selectedItem
=
ref
(
null
);
const
selectedItem1
=
ref
(
null
);
const
selectedItem2
=
ref
(
null
);
const
screenList
=
ref
([]);
const
serveList
=
ref
([]);
const
peopleList
=
ref
([]);
const
props
=
defineProps
({
const
props
=
defineProps
({
width
:
{
width
:
{
type
:
String
,
type
:
String
,
default
:
'100%'
,
default
:
'100%'
,
},
},
});
});
const
selectItem
=
(
selectItem
)
=>
{
onMounted
(
async
()
=>
{
selectedItem
.
value
=
selectItem
;
getScreeningConditions
();
});
const
selectItem
=
(
index
,
item
,
type
)
=>
{
if
(
type
===
'screen'
)
{
selectedItem
.
value
=
index
;
}
else
if
(
type
===
'serve'
)
{
selectedItem1
.
value
=
index
;
}
else
if
(
type
===
'people'
)
{
selectedItem2
.
value
=
index
;
}
emit
(
'screenParams'
,
item
,
type
);
};
// 查询出发日期
const
getScreeningConditions
=
()
=>
{
screeningConditions
().
then
((
res
)
=>
{
screenList
.
value
=
res
.
data
.
startCityList
;
serveList
.
value
=
res
.
data
.
serviceList
;
peopleList
.
value
=
res
.
data
.
forPeopleList
;
});
};
};
</
script
>
</
script
>
...
@@ -68,7 +102,6 @@ const selectItem = (selectItem) => {
...
@@ -68,7 +102,6 @@ const selectItem = (selectItem) => {
letter-spacing
:
0em
;
letter-spacing
:
0em
;
font-variation-settings
:
'opsz'
auto
;
font-variation-settings
:
'opsz'
auto
;
font-feature-settings
:
'kern'
on
;
font-feature-settings
:
'kern'
on
;
color
:
#fa5151
;
margin-left
:
44rpx
;
margin-left
:
44rpx
;
margin-top
:
20rpx
;
margin-top
:
20rpx
;
}
}
...
...
src/api/assistingAgriculture/village.js
View file @
eb53a660
...
@@ -32,3 +32,11 @@ export function getStartDate(data) {
...
@@ -32,3 +32,11 @@ export function getStartDate(data) {
data
,
data
,
});
});
}
}
// 查询筛选
export
function
screeningConditions
(
data
)
{
return
request
({
url
:
`/sgyrdd/prod/screeningConditions/list`
,
method
:
'GET'
,
data
,
});
}
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
View file @
eb53a660
...
@@ -55,7 +55,12 @@
...
@@ -55,7 +55,12 @@
:scroll-with-animation=
"true"
:scroll-with-animation=
"true"
@
scroll=
"scroll"
@
scroll=
"scroll"
>
>
<view
class=
"foodCard"
v-for=
"(item, index) in popularRouterData"
:key=
"index"
>
<view
class=
"foodCard"
v-for=
"(item, index) in popularRouterData"
:key=
"index"
@
tap=
"toRouteDetails(item)"
>
<!--
<img-->
<!--
<img-->
<!-- class="img-icon"-->
<!-- class="img-icon"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"-->
...
@@ -120,7 +125,7 @@
...
@@ -120,7 +125,7 @@
class=
"card-detail"
class=
"card-detail"
v-for=
"(item, index) in cardList"
v-for=
"(item, index) in cardList"
:key=
"index"
:key=
"index"
@
tap=
"toRouteDetails"
@
tap=
"toRouteDetails
(item)
"
>
>
<img
class=
"card-img"
:src=
"item.img"
style=
"width: 248rpx; height: 240rpx"
/>
<img
class=
"card-img"
:src=
"item.img"
style=
"width: 248rpx; height: 240rpx"
/>
<view
class=
"detail-text"
>
<view
class=
"detail-text"
>
...
@@ -173,7 +178,10 @@ const cardList = ref([]);
...
@@ -173,7 +178,10 @@ const cardList = ref([]);
const
popularRouterData
=
ref
([]);
const
popularRouterData
=
ref
([]);
const
sortType
=
ref
(
null
);
const
sortType
=
ref
(
null
);
const
attractionId
=
ref
(
null
);
const
attractionId
=
ref
(
null
);
const
startCity
=
ref
(
null
);
const
dateType
=
ref
(
null
);
const
dateType
=
ref
(
null
);
const
serviceCommitment
=
ref
(
null
);
const
labelId
=
ref
(
null
);
const
locationFiltering
=
(
index
)
=>
{
const
locationFiltering
=
(
index
)
=>
{
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
...
@@ -223,7 +231,6 @@ const sortParams = (sortMode) => {
...
@@ -223,7 +231,6 @@ const sortParams = (sortMode) => {
};
};
// 出发日期
// 出发日期
const
dataParams
=
(
item
)
=>
{
const
dataParams
=
(
item
)
=>
{
console
.
log
(
item
,
333
);
dateType
.
value
=
item
;
dateType
.
value
=
item
;
getProd
();
getProd
();
};
};
...
@@ -232,6 +239,18 @@ const placeParams = (id) => {
...
@@ -232,6 +239,18 @@ const placeParams = (id) => {
attractionId
.
value
=
id
;
attractionId
.
value
=
id
;
getProd
();
getProd
();
};
};
// 筛选
const
screenParams
=
(
item
,
type
)
=>
{
console
.
log
(
item
,
type
,
111
);
if
(
type
===
'screen'
)
{
startCity
.
value
=
item
.
tripCity
;
}
else
if
(
type
===
'serve'
)
{
serviceCommitment
.
value
=
item
.
labelName
;
}
else
if
(
type
===
'people'
)
{
labelId
.
value
=
item
.
labelName
;
}
getProd
();
};
// 查询列表
// 查询列表
const
getProd
=
()
=>
{
const
getProd
=
()
=>
{
const
params
=
{
const
params
=
{
...
@@ -240,6 +259,9 @@ const getProd = () => {
...
@@ -240,6 +259,9 @@ const getProd = () => {
...(
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
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
}),
...(
startCity
.
value
!==
null
&&
{
startCity
:
startCity
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
};
};
getProdList
(
params
).
then
((
res
)
=>
{
getProdList
(
params
).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
...
@@ -248,10 +270,11 @@ const getProd = () => {
...
@@ -248,10 +270,11 @@ const getProd = () => {
cardList
.
value
=
res
.
data
.
records
;
cardList
.
value
=
res
.
data
.
records
;
});
});
};
};
function
toRouteDetails
()
{
function
toRouteDetails
(
item
)
{
console
.
log
(
item
,
22222
);
// TODO: 跳转到线路详情
// TODO: 跳转到线路详情
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/RouteDetails/RouteDetails'
,
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=
${
item
.
prodId
}
`
,
});
});
}
}
function
toSpecialOfferZoneList
()
{
function
toSpecialOfferZoneList
()
{
...
...
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