Commit d3a4a685 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents e9163ecd c7aafb04
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<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 dataList"
:key="index" :key="index"
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
...@@ -16,18 +16,33 @@ ...@@ -16,18 +16,33 @@
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps, onMounted } from 'vue';
import { getStartDate, getTour } from '@/api/assistingAgriculture/village';
const items = reactive(['日期不限', '今天', '明天', '一周内', '一月内', '本周末', '七夕节']); const items = reactive(['日期不限', '今天', '明天', '一周内', '一月内', '本周末', '七夕节']);
const selectedItem = ref(null); const selectedItem = ref(null);
const dataList = ref([]);
const params = {
current: 1,
size: 10,
};
const props = defineProps({ const props = defineProps({
width: { width: {
type: String, type: String,
default: '100%', default: '100%',
}, },
}); });
onMounted(async () => {
getStartDateList();
});
const selectItem = (selectItem) => { const selectItem = (selectItem) => {
selectedItem.value = selectItem; selectedItem.value = selectItem;
}; };
// 查询景点
const getStartDateList = () => {
getStartDate(params).then((res) => {
dataList.value = res.data;
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
> >
{{ item.brief }} {{ item.attractionName }}
</li> </li>
</ul> </ul>
</view> </view>
...@@ -35,7 +35,7 @@ const selectItem = (index, item) => { ...@@ -35,7 +35,7 @@ const selectItem = (index, item) => {
}; };
// 查询景点 // 查询景点
const getTourList = () => { const getTourList = () => {
getTour({ prodId: 0 }).then((res) => { getTour().then((res) => {
placeList.value = res.data; placeList.value = res.data;
}); });
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
v-for="(item, index) in items" v-for="(item, index) in items"
:key="index" :key="index"
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index, item)"
> >
{{ item.name }} {{ item.name }}
</li> </li>
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps } from 'vue';
const items = ref([ const items = ref([
{ name: '距离优先', sortModel: 1 }, { name: '距离优先', sortMode: 1 },
{ name: '好评优先', sortModel: 2 }, { name: '好评优先', sortMode: 2 },
{ name: '销量优先', sortModel: 3 }, { name: '销量优先', sortMode: 3 },
{ name: '低价优先', sortModel: 4 }, { name: '低价优先', sortMode: 4 },
{ name: '高价优先', sortModel: 5 }, { name: '高价优先', sortMode: 5 },
]); ]);
const emit = defineEmits(['sortParams']); const emit = defineEmits(['sortParams']);
const selectedItem = ref(null); const selectedItem = ref(null);
......
...@@ -3,7 +3,7 @@ import { request } from '../../utils/request'; ...@@ -3,7 +3,7 @@ import { request } from '../../utils/request';
// 查询景点 // 查询景点
export function getTour(data) { export function getTour(data) {
return request({ return request({
url: `/sgyrdd/znprod/tour/list`, url: `/sgyrdd/znprod/attraction/list`,
method: 'GET', method: 'GET',
data, data,
}); });
...@@ -24,3 +24,11 @@ export function getProdList(data) { ...@@ -24,3 +24,11 @@ export function getProdList(data) {
data, data,
}); });
} }
// 查询出发日期
export function getStartDate(data) {
return request({
url: `/sgyrdd/prod/startDate/page`,
method: 'GET',
data,
});
}
...@@ -55,3 +55,21 @@ export function receiveCoupon(data) { ...@@ -55,3 +55,21 @@ export function receiveCoupon(data) {
data, data,
}); });
} }
// 商家评论列表
export function getCommentList(data) {
return request({
url: `/sgyrdd/evaluation/page`,
method: 'GET',
data,
});
}
// 评论列表数量统计和相同好评最多的评语
export function getEvalStatis(data) {
return request({
url: `/sgyrdd/evaluation/getEvalStatis`,
method: 'GET',
data,
});
}
...@@ -255,7 +255,8 @@ ...@@ -255,7 +255,8 @@
{ {
"path": "pages/assistingAgriculture/detail/comment", "path": "pages/assistingAgriculture/detail/comment",
"style": { "style": {
"navigationBarTitleText": "评论" "navigationBarTitleText": "评论",
"enablePullDownRefresh": true
} }
} }
], ],
......
...@@ -171,10 +171,6 @@ const rotate3 = ref(false); ...@@ -171,10 +171,6 @@ const rotate3 = ref(false);
const rotate4 = ref(false); const rotate4 = ref(false);
const cardList = ref([]); const cardList = ref([]);
const popularRouterData = ref([]); const popularRouterData = ref([]);
const params = ref({
current: 1,
size: 10,
});
const sortType = ref(null); const sortType = ref(null);
const locationFiltering = (index) => { const locationFiltering = (index) => {
switch (index) { switch (index) {
...@@ -203,6 +199,9 @@ const locationFiltering = (index) => { ...@@ -203,6 +199,9 @@ const locationFiltering = (index) => {
rotate3.value = false; rotate3.value = false;
break; break;
} }
if (index === 0) {
sortType.value = null;
}
}; };
// 查询热门路线 // 查询热门路线
const getPopular = () => { const getPopular = () => {
...@@ -213,9 +212,20 @@ const getPopular = () => { ...@@ -213,9 +212,20 @@ const getPopular = () => {
popularRouterData.value = res.data.records; popularRouterData.value = res.data.records;
}); });
}; };
const sortParams = (sortMode) => {
sortType.value = sortMode;
console.log(sortType.value, 211);
getProd();
};
// 查询列表 // 查询列表
const getProd = () => { const getProd = () => {
getProdList({ current: 1, size: 10 }).then((res) => { const params = {
current: 1,
size: 10,
...(sortType.value !== null && { sortType: sortType.value.sortMode }),
};
console.log(params, 222);
getProdList(params).then((res) => {
res.data.records.forEach((item) => { res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic; item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
}); });
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import card from './card.vue'; import card from './card.vue';
import { getCommentList } from '../../../api/packageDetail';
const commentTypeList = [ const commentTypeList = [
{ {
text: '图/视频', text: '图/视频',
...@@ -114,7 +115,20 @@ const tagList = [ ...@@ -114,7 +115,20 @@ const tagList = [
value: 514, value: 514,
}, },
]; ];
const commentParameters = {
shopId: '1818876196597334017',
current: 1,
size: 10,
};
onLoad((options) => {
getCommentListFn();
});
const showMoreTag = ref(false); const showMoreTag = ref(false);
const getCommentListFn = () => {
getCommentList(commentParameters).then((res) => {
console.log('打印评论', res);
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -35,37 +35,33 @@ ...@@ -35,37 +35,33 @@
</view> </view>
<view class="comment-list"> <view class="comment-list">
<view class="comment-item" v-for="item in 3" :key="item"> <view class="comment-item" v-for="(item, index) in commentData" :key="index">
<view class="top"> <view class="top">
<view class="row"> <view class="row">
<image <image class="headPortrait" mode="aspectFill" :src="fileDomain + item.avatar"></image>
class="headPortrait"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
></image>
<view class="right"> <view class="right">
<text class="name">略略略</text> <text class="name">{{ item.nickName }}</text>
<view class="ratebox"> <view class="ratebox">
<image <image
class="rate-img" class="rate-img"
src="@/static/assistingAgriculture/detail/fiveStars.png" src="../static/assistingAgriculture/index/fiveStars.png"
></image> ></image>
<text>5.0分</text> <text>{{ item.merchantServices }}.0分</text>
<text>好评</text> <text>{{ rateList[item.merchantServices].text }}</text>
</view> </view>
</view> </view>
</view> </view>
<text class="detail">2024-08-03 筑农散养虫子土鸡(未下蛋小母鸡)x2</text> <text class="detail">{{ item.createTime.slice(0, 10) }} {{ item.prodName }}x2</text>
</view> </view>
<view class="info"> <view class="info">
<text class="text">味道鲜美,煲出来的汤非常好喝,值得购买!</text> <text class="text">{{ item.evaluation }}</text>
<view class="imgbox"> <view class="imgbox" v-if="item.images.length > 0">
<image <image
class="img" class="img"
mode="aspectFill" mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png" :src="fileDomain + img"
v-for="item in 6" v-for="img in item.images"
:key="item" :key="img"
></image> ></image>
</view> </view>
</view> </view>
...@@ -76,6 +72,8 @@ ...@@ -76,6 +72,8 @@
</template> </template>
<script setup> <script setup>
import { getCommentList } from '@/api/packageDetail';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const searchValue = ref(''); const searchValue = ref('');
const tab = ref(0); const tab = ref(0);
...@@ -102,33 +100,67 @@ const tabs = ref([ ...@@ -102,33 +100,67 @@ const tabs = ref([
}, },
]); ]);
const rateList = ref([ const rateList = ref({
{ 1: {
value: 1, url: '../../static/assistingAgriculture/index/oneStar.png',
url: '@/static/assistingAgriculture/index/oneStar.png',
text: '很糟', text: '很糟',
}, },
{ 2: {
value: 2, url: '../../static/assistingAgriculture/index/twoStars.png',
url: '@/static/assistingAgriculture/index/twoStars.png',
text: '较差', text: '较差',
}, },
{ 3: {
value: 3, url: '../../static/assistingAgriculture/index/threeStars.png',
url: '@/static/assistingAgriculture/index/threeStars.png',
text: '一般', text: '一般',
}, },
{ 4: {
value: 4, url: '../../static/assistingAgriculture/index/fourStars.png',
url: '@/static/assistingAgriculture/index/fourStars.png',
text: '还行', text: '还行',
}, },
{ 5: {
value: 5, url: '../../static/assistingAgriculture/index/fiveStars.png',
url: '@/static/assistingAgriculture/index/fiveStars.png',
text: '超赞', text: '超赞',
}, },
]); });
/**
* 获取用户优惠券列表
*/
const isEnd = ref(false);
const total = ref(0);
const commentData = ref([]);
const catalog = reactive({
current: 0,
size: 10,
shopId: '1818876196597334017',
evaluation: '', // 关键字搜索
type: '', // img-图片,append-追评,diff-中差评,good-好评
});
const getList = async () => {
catalog.current++;
xma.showLoading({
title: '加载中...',
mask: true,
});
const res = await getCommentList(catalog);
if (res.data.records.length < catalog.size) {
isEnd.value = true;
}
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
if (item.images === '') {
item.images = [];
} else {
item.images = item.images.split(',');
}
});
commentData.value.push(...res.data.records);
total.value = res.data.total;
console.log(commentData.value);
}
xma.hideLoading();
};
getList();
const handleChangeTab = (e) => { const handleChangeTab = (e) => {
if (e === tab.value) return; if (e === tab.value) return;
......
<template> <template>
<view class="container"> <view class="container">
<Header title="全部订单"></Header> <!-- 顶部搜索框-->
<view class="tabs"> <view class="top">
<wd-tabs v-model="tab" animated :lineWidth="38" :lineHeight="3" @change="handleChange"> <wd-icon
class="icon"
name="thin-arrow-left"
color="#000"
size="32rpx"
@click="handleBack"
></wd-icon>
<view class="searchBox">
<view class="search">
<wd-icon name="search" size="30rpx" color="#999"></wd-icon>
<input
type="text"
:value="catalog.keyword"
class="text"
placeholder="搜索我的订单"
placeholder-style="font-size:28rpx;"
@confirm="handleSearch"
@input="handleInput"
confirm-type="搜索"
/>
</view>
<wd-icon
name="error-fill"
size="30rpx"
color="#999"
v-if="catalog.keyword"
@tap="handleClear"
></wd-icon>
</view>
</view>
<view class="tabs" v-if="orderDic">
<wd-tabs v-model="tab" animated :lineWidth="38" :lineHeight="3" @change="handleChange" sticky>
<block v-for="item in tabs" :key="item.value"> <block v-for="item in tabs" :key="item.value">
<wd-tab :title="`${item.name}`" :name="item.value"> <wd-tab :title="`${item.name}`" :name="item.value">
<view class="content" v-if="dataList.length > 0"> <view class="content" v-if="dataList.length > 0">
<view class="box" v-for="(item, index) in dataList" :key="index"> <view class="box" v-for="(item, index) in dataList" :key="index">
<view class="header" @click="toShopDetail(item)"> <view class="header" @click="handleDetail(item)">
<view class="left"> <view class="left">
<image src="@/static/order/shop.png" /> <text
class="icon"
:style="{ 'background-color': iconList[item.orderType].color }"
>
{{ iconList[item.orderType].text }}
</text>
<!-- <image src="@/static/order/shop.png" /> -->
<view class="title">{{ item.shopName }}</view> <view class="title">{{ item.shopName }}</view>
</view> </view>
<view class="right"> <view class="right">
<span class="status">{{ stateList[item.status].label }}</span> <span class="status">{{ stateList[item.orderType][item.status].label }}</span>
<wd-count-down <wd-count-down
:time="item.countDown" :time="item.countDown"
:format="format" :format="format"
...@@ -23,7 +60,7 @@ ...@@ -23,7 +60,7 @@
</view> </view>
</view> </view>
<view class="info" @click="handleDetail(item.orderNumber)"> <view class="info" @click="handleDetail(item)">
<image mode="aspectFill" :src="fileDomain + item.orderItems[0].pic" /> <image mode="aspectFill" :src="fileDomain + item.orderItems[0].pic" />
<view class="info-box"> <view class="info-box">
<view class="text">下单时间:{{ item.createTime.slice(0, 16) }}</view> <view class="text">下单时间:{{ item.createTime.slice(0, 16) }}</view>
...@@ -122,7 +159,7 @@ ...@@ -122,7 +159,7 @@
</template> </template>
<script setup> <script setup>
import Header from './components/Header/index.vue'; // import Header from './components/Header/index.vue';
import Payment from './components/Payment/index.vue'; import Payment from './components/Payment/index.vue';
import { import {
getOrderList, getOrderList,
...@@ -132,19 +169,32 @@ import { ...@@ -132,19 +169,32 @@ import {
getOrderDetail, getOrderDetail,
} from '@/api/order'; } from '@/api/order';
import { getOrderDic } from '@/utils/orderDic'; import { getOrderDic } from '@/utils/orderDic';
import { orderStatus, signIn } from '@/utils/signIn';
import testJson from '@/static/json/test.json';
import { getTokenUser } from '@/api/index';
import { getToken } from '@/utils/auth';
const fileDomain = import.meta.env.VITE_APP_IMG_URL; const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const stateList = ref(); const stateList = ref({});
onLoad((options) => { const orderDic = ref();
const orderDic = getOrderDic(); onLoad(async (options) => {
stateList.value = orderDic.reduce((obj, item) => { // await signIn();
obj[item.baseStatus] = item; if (!getToken()) await signIn2();
return obj; if (!getOrderDic()) await orderStatus();
}, {}); orderDic.value = getOrderDic();
orderDic.value.baseOrder[0].value = 'all';
for (const key in orderDic.value) {
const data = orderDic.value[key].reduce((obj, item) => {
obj[item.baseStatus] = item;
return obj;
}, {});
stateList.value[key] = data;
}
if (options.status) { if (options.status) {
tab.value = options.status; tab.value = options.status;
} }
getList(); await getList();
}); });
const tabs = ref([ const tabs = ref([
...@@ -164,10 +214,10 @@ const tabs = ref([ ...@@ -164,10 +214,10 @@ const tabs = ref([
name: '待评价', name: '待评价',
value: 'not_eval', value: 'not_eval',
}, },
{ // {
name: '已完成', // name: '已完成',
value: 'complete', // value: 'complete',
}, // },
{ {
name: '退款/售后', name: '退款/售后',
value: 'after_sales', value: 'after_sales',
...@@ -175,6 +225,21 @@ const tabs = ref([ ...@@ -175,6 +225,21 @@ const tabs = ref([
]); ]);
const tab = ref('all'); const tab = ref('all');
const iconList = ref({
logistics: {
color: '#FF0909',
text: '物流',
},
store: {
color: '#FF4C0D',
text: '到店',
},
takeaway: {
color: '#FFB023',
text: '外卖',
},
});
onShow(() => { onShow(() => {
if (pendingPaymentOrder.value) { if (pendingPaymentOrder.value) {
// 查询订单状态决定是否支付 // 查询订单状态决定是否支付
...@@ -292,6 +357,26 @@ const initDataList = () => { ...@@ -292,6 +357,26 @@ const initDataList = () => {
}); });
}; };
/**
* 搜索订单
*/
const handleSearch = (e) => {
catalog.keyword = e.detail.value;
initDataList().then(() => {
getList();
});
};
const handleInput = (e) => {
catalog.keyword = e.detail.value;
};
const handleClear = () => {
catalog.keyword = '';
initDataList().then(() => {
getList();
});
};
/** /**
* 删除订单 * 删除订单
* @param {*} orderNumber * @param {*} orderNumber
...@@ -415,11 +500,16 @@ const onFinish = async (orderNumber) => { ...@@ -415,11 +500,16 @@ const onFinish = async (orderNumber) => {
}); });
}; };
const handleDetail = (id) => { const handleDetail = (item) => {
// 清空查询待付款状态 // 清空查询待付款状态
pendingPaymentOrder.value = null; pendingPaymentOrder.value = null;
if (item.orderType === 'logistics') {
uni.navigateTo({
url: `pages/assistingAgriculture/order/detail?orderNumber=${item.orderNumber}`,
});
}
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/detail?orderNumber=${id}`, url: `/pages/order/detail?orderNumber=${item.orderNumber}`,
}); });
}; };
...@@ -489,6 +579,25 @@ const toShopDetail = (item) => { ...@@ -489,6 +579,25 @@ const toShopDetail = (item) => {
url: `/pages/shop/shop?shopId=${item.shopId}`, url: `/pages/shop/shop?shopId=${item.shopId}`,
}); });
}; };
// 登录
const signIn2 = () => {
xma.showLoading({
title: '加载中',
mask: true,
});
return getTokenUser(testJson).then((res) => {
const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
};
const handleBack = () => {
uni.navigateBack();
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -501,9 +610,9 @@ page { ...@@ -501,9 +610,9 @@ page {
margin: 0 auto; margin: 0 auto;
.tabs { .tabs {
padding-top: 88rpx; padding-top: 108rpx;
.wd-tabs { &:deep(.wd-tabs) {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
...@@ -518,12 +627,52 @@ page { ...@@ -518,12 +627,52 @@ page {
} }
} }
.top {
height: 108rpx;
position: fixed;
width: 100%;
z-index: 999;
display: flex;
background-color: #f5f5f5;
margin: 0 auto;
align-items: center;
padding: 0 30rpx;
gap: 14rpx;
.searchBox {
width: 492rpx;
height: 66rpx;
background: #f3f3f3;
border-radius: 33rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0rpx 28rpx;
background-color: #fff;
.search {
gap: 10rpx;
display: flex;
align-items: center;
.text {
margin-left: 10rpx;
font-family:
PingFang SC,
PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
}
}
}
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 20rpx; padding: 10rpx 20rpx 20rpx;
gap: 24rpx; gap: 24rpx;
.box { .box {
...@@ -544,7 +693,7 @@ page { ...@@ -544,7 +693,7 @@ page {
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6rpx; gap: 12rpx;
font-weight: bold; font-weight: bold;
image { image {
...@@ -552,6 +701,15 @@ page { ...@@ -552,6 +701,15 @@ page {
width: 38rpx; width: 38rpx;
} }
.icon {
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #ffffff;
border-radius: 8rpx;
padding: 2rpx 8rpx;
}
.title { .title {
color: #333; color: #333;
font-size: 32rpx; font-size: 32rpx;
......
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