Commit d8e32148 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents cb9c41f1 fdab40c4
......@@ -55,6 +55,13 @@ const selectItem = (index, item) => {
emit('dataParams', item, datePart);
}
};
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} 00:00:00`;
}
const getStartDateList = () => {
getStartDate(params).then((res) => {
dataList.value = res.data;
......@@ -64,13 +71,6 @@ function handleConfirm({ value }) {
const datePart = timestampToDateBasic(value);
emit('dataParams', null, datePart);
}
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>
<style lang="scss" scoped>
......
......@@ -257,6 +257,12 @@
"navigationBarTitleText": "商品详情页"
}
},
{
"path": "pages/assistingAgriculture/order/refund",
"style": {
"navigationBarTitleText": "申请售后"
}
},
{
"path": "pages/assistingAgriculture/detail/comment",
"style": {
......
......@@ -324,6 +324,8 @@ function handleFullscreenChange(event) {
// };
// 智能排序
const sortParams = (sortMode) => {
currentPage.value = 1;
hasMoreData.value = true;
sortType.value = sortMode;
getProd();
};
......@@ -340,9 +342,14 @@ const sortParams = (sortMode) => {
// };
const dataParams = (item, datePart) => {
if (item) {
dateType.value = item.key.toString();
currentPage.value = 1;
hasMoreData.value = true;
console.log(item, 212);
dateType.value = String(item.key);
getProd();
} else {
currentPage.value = 1;
hasMoreData.value = true;
dateType.value = '8';
if (datePart && datePart !== 'NaN/NaN/NaN') {
allocateDate.value = datePart;
......@@ -353,30 +360,54 @@ 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();
currentPage.value = 1;
hasMoreData.value = true;
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);
currentPage.value = 1;
hasMoreData.value = true;
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 +422,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 +433,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 +445,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.records];
}
// 判断是否还有更多数据
if (res.data.records.length < params.size) {
......@@ -450,16 +477,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 +699,8 @@ page {
white-space: nowrap;
}
.tag .wd-tag {
margin-right: 10px;
margin-bottom: 5px;
margin-right: 10rpx;
margin-bottom: 10rpx;
}
.score,
.num,
......@@ -714,7 +731,7 @@ page {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 90rpx;
width: 80rpx;
text-align: center;
}
.tag {
......
......@@ -190,10 +190,17 @@ function onChange(e) {
}
// 智能排序
const sortParams = (sortMode) => {
params.value.sortType = sortMode.sortMode;
refresh().then(() => {
queryOfferProdListFn();
});
if (sortMode) {
params.value.sortType = sortMode.sortMode;
refresh().then(() => {
queryOfferProdListFn();
});
} else {
delete params.value.sortType;
refresh().then(() => {
queryOfferProdListFn();
});
}
};
// 出发日期
const dataParams = (item, datePart) => {
......@@ -203,7 +210,7 @@ const dataParams = (item, datePart) => {
queryOfferProdListFn();
});
} else {
params.value.dateType = 8;
params.value.dateType = '8';
if (datePart && datePart !== 'NaN/NaN/NaN') {
params.value.allocateDate = datePart;
rotate2.value = false;
......
......@@ -166,6 +166,8 @@
<script setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { onShow } from '@dcloudio/uni-app';
import {
getProdDetail,
......@@ -177,6 +179,7 @@ import {
receiveCoupon,
} from '@/api/packageDetail';
import fab from '../../../components/fab/fab.vue';
const router = useRoute();
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
// 图片
const swiperList = ref([
......@@ -215,7 +218,7 @@ function handleClick(e) {
}
function jumpPjPgae() {
xma.navigateTo({
url: `/pages/assistingAgriculture/detail/comment?shopId=${dataDetails.value.prod.shopId}&prodId=${dataDetails.value.prodPresale.prodId}`,
url: `/pages/assistingAgriculture/detail/comment?shopId=${dataDetails.value.prod.shopId}&prodId=${router.query.prodId}`,
});
}
function onChange(e) {
......
This diff is collapsed.
......@@ -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