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