Commit 43aca4c6 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents e04e5760 e7b19a99
......@@ -340,7 +340,8 @@ const sortParams = (sortMode) => {
// };
const dataParams = (item, datePart) => {
if (item) {
dateType.value = item.key.toString();
console.log(item, 212);
dateType.value = String(item.key);
getProd();
} else {
dateType.value = '8';
......@@ -353,30 +354,50 @@ const dataParams = (item, datePart) => {
};
// 景点
const placeParams = (item) => {
const ids = item.map((i) => i.id);
const arr = ids.join(',');
attractionIdList.value = arr.split(',').map(String);
getProd();
if (item.length !== 0) {
const ids = item.map((i) => i.id);
const arr = ids.join(',');
attractionIdList.value = arr.split(',').map(String);
getProd();
} else if (item.length === 0) {
attractionIdList.value = [];
getProd();
}
};
// 筛选
const screenParams = (selectedItems, type) => {
console.log(selectedItems, type, 111);
console.log(selectedItems.length, type, 111);
if (type === 'screen') {
const ids = selectedItems.map((i) => i.tripCityId);
const arr = ids.join(',');
startCityList.value = arr.split(',').map(String);
getProd();
if (selectedItems.length !== 0) {
const ids = selectedItems.map((i) => i.tripCityId);
const arr = ids.join(',');
startCityList.value = arr.split(',').map(String);
getProd();
} else if (selectedItems.length === 0) {
startCityList.value = [];
getProd();
}
} else if (type === 'serve') {
const ids = selectedItems.map((i) => i.labelId);
const arr = ids.join(',');
serviceList.value = arr.split(',').map(String);
getProd();
if (selectedItems.length !== 0) {
const ids = selectedItems.map((i) => i.labelId);
const arr = ids.join(',');
serviceList.value = arr.split(',').map(String);
getProd();
} else if (selectedItems.length === 0) {
serviceList.value = [];
getProd();
}
} else if (type === 'people') {
const ids = selectedItems.map((i) => i.labelId);
const arr = ids.join(',');
forPeopleList.value = arr.split(',').map(String);
getProd();
if (selectedItems.length !== 0) {
const ids = selectedItems.map((i) => i.labelId);
const arr = ids.join(',');
forPeopleList.value = arr.split(',').map(String);
getProd();
} else if (selectedItems.length === 0) {
forPeopleList.value = [];
getProd();
}
}
};
// 搜索
......@@ -391,7 +412,7 @@ const getProd = (searchKeyword = '') => {
});
const params = {
current: currentPage.value,
size: 3,
size: 5,
...(sortType.value && { sortType: sortType.value.sortMode }),
...(attractionIdList.value &&
attractionIdList.value.length > 0 &&
......@@ -402,10 +423,6 @@ const getProd = (searchKeyword = '') => {
...(serviceList.value && serviceList.value.length > 0 && { serviceList: serviceList.value }),
...(forPeopleList.value &&
forPeopleList.value.length > 0 && { forPeopleList: forPeopleList.value }),
// ...(startCityList.value && { startCityList: startCityList.value.split(',') }),
// ...(serviceList.value && { serviceList: serviceList.value.split(',') }),
// ...(forPeopleList.value && { forPeopleList: forPeopleList.value.split(',') }),
...(dateType.value === '8' && { allocateDate: allocateDate.value }),
...(searchKeyword && { keyword: searchKeyword }),
};
......@@ -418,7 +435,7 @@ const getProd = (searchKeyword = '') => {
if (currentPage.value === 1) {
cardList.value = res.data.records;
} else {
cardList.value = cardList.value.concat(res.data.records);
cardList.value = [...cardList.value, ...res.data.content];
}
// 判断是否还有更多数据
if (res.data.records.length < params.size) {
......@@ -450,16 +467,6 @@ const resetParams = () => {
getProd();
}
};
// const resetParams = () => {
// sortType.value = null;
// attractionIdList.value = [];
// dateType.value = null;
// startCityList.value = [];
// serviceList.value = [];
// forPeopleList.value = [];
// allocateDate.value = null;
// getProd();
// };
function toRouteDetails(item) {
console.log(item, 22222);
// TODO: 跳转到线路详情
......@@ -682,8 +689,8 @@ page {
white-space: nowrap;
}
.tag .wd-tag {
margin-right: 10px;
margin-bottom: 5px;
margin-right: 10rpx;
margin-bottom: 10rpx;
}
.score,
.num,
......@@ -711,6 +718,11 @@ page {
::v-deep .wd-tag__text {
font-size: 20rpx;
margin-top: 4rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 80rpx;
text-align: center;
}
.tag {
margin-top: 10rpx;
......
......@@ -235,6 +235,7 @@ onLoad(() => {
getCouponMainList();
});
onPullDownRefresh(() => {
reset();
getClassification();
rotatingBroadcast();
nearbyFood();
......
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