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