Commit 644c672e authored by 蔡亮华(贵阳日报)'s avatar 蔡亮华(贵阳日报)
parents aa26a40c 94f7a11e
...@@ -37,6 +37,10 @@ const props = defineProps({ ...@@ -37,6 +37,10 @@ const props = defineProps({
}, },
}); });
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
onMounted(async () => { onMounted(async () => {
getStartDateList(); getStartDateList();
}); });
......
...@@ -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, item)" @click="selectItem(index, item)"
> >
{{ item.name }} {{ item.name }}
</li> </li>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { ref } from 'vue';
const items = ref([ const items = ref([
{ name: '距离优先', sortMode: 1 }, { name: '距离优先', sortMode: 1 },
{ name: '好评优先', sortMode: 2 }, { name: '好评优先', sortMode: 2 },
...@@ -31,8 +31,13 @@ const props = defineProps({ ...@@ -31,8 +31,13 @@ const props = defineProps({
}, },
}); });
const selectItem = (index, item) => { const selectItem = (index, item) => {
selectedItem.value = index; if (selectedItem.value === index) {
emit('sortParams', item); selectedItem.value = null;
emit('sortParams', null);
} else {
selectedItem.value = index;
emit('sortParams', item);
}
}; };
const reset = () => { const reset = () => {
selectedItem.value = null; selectedItem.value = null;
...@@ -44,8 +49,6 @@ defineExpose({ reset }); ...@@ -44,8 +49,6 @@ defineExpose({ reset });
.sort { .sort {
position: absolute; position: absolute;
top: 100%; top: 100%;
// width: 100%;
// min-height: 212rpx;
border-radius: 0rpx 0rpx 16rpx 16rpx; border-radius: 0rpx 0rpx 16rpx 16rpx;
background: #ffffff; background: #ffffff;
box-shadow: 0rpx 16rpx 16rpx 0rpx rgba(73, 73, 73, 0.14); box-shadow: 0rpx 16rpx 16rpx 0rpx rgba(73, 73, 73, 0.14);
...@@ -55,12 +58,13 @@ defineExpose({ reset }); ...@@ -55,12 +58,13 @@ defineExpose({ reset });
padding-bottom: 20rpx; padding-bottom: 20rpx;
box-sizing: border-box; box-sizing: border-box;
.ul { .ul {
padding-left: 60rpx; padding-left: 30rpx;
li { li {
list-style-type: none; list-style-type: none;
font-size: 22rpx; font-size: 22rpx;
color: #3d3d3d; color: #3d3d3d;
margin-top: 20rpx; margin-top: 20rpx;
cursor: pointer;
} }
.active { .active {
color: #fa5151; color: #fa5151;
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
/> />
</view> </view>
<view class="right-offer"> <view class="right-offer">
<text class="left-title">日游直播</text> <text class="left-title">日游播放</text>
<img <img
class="special-icon" class="special-icon"
src="/static/assistingAgriculture/rural/dayTOur.png" src="/static/assistingAgriculture/rural/dayTOur.png"
...@@ -178,11 +178,11 @@ ...@@ -178,11 +178,11 @@
</view> </view>
<view class="all-info"> <view class="all-info">
<view class="detail-score"> <view class="detail-score">
<text class="score">{{ item.score }}</text> <text class="score" v-if="item.score !== null">{{ item.score }}</text>
<text class="num">月销{{ item.monthSoldNum }}</text> <text class="num">月销{{ item.monthSoldNum }}</text>
</view> </view>
<view class="venue"> <view class="venue">
<text class="place">{{ item.tripArea }}出发</text> <text class="place" v-if="item.tripArea !== null">{{ item.tripArea }}出发</text>
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
</view> </view>
</view> </view>
...@@ -373,6 +373,9 @@ const toSearch = () => { ...@@ -373,6 +373,9 @@ const toSearch = () => {
const currentPage = ref(1); const currentPage = ref(1);
// 查询列表 // 查询列表
const getProd = (searchKeyword = '') => { const getProd = (searchKeyword = '') => {
xma.showLoading({
title: '加载中',
});
const params = { const params = {
current: currentPage.value, current: currentPage.value,
size: 3, size: 3,
...@@ -394,6 +397,7 @@ const getProd = (searchKeyword = '') => { ...@@ -394,6 +397,7 @@ const getProd = (searchKeyword = '') => {
...(searchKeyword && { keyword: searchKeyword }), ...(searchKeyword && { keyword: searchKeyword }),
}; };
getProdList(params).then((res) => { getProdList(params).then((res) => {
xma.hideLoading();
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;
item.serveList = item.serviceList.slice(0, 3); item.serveList = item.serviceList.slice(0, 3);
......
...@@ -86,10 +86,10 @@ ...@@ -86,10 +86,10 @@
<wd-icon size="24rpx" class="icons"></wd-icon> <wd-icon size="24rpx" class="icons"></wd-icon>
</view> </view>
</view> </view>
<Sort v-show="rotate" @sortParams="sortParams" /> <Sort v-show="rotate" ref="sortRef" @sortParams="sortParams" />
<DepartureDate v-show="rotate2" @dataParams="dataParams" /> <DepartureDate v-show="rotate2" ref="departureDateRef" @dataParams="dataParams" />
<ScenicSpots v-show="rotate3" @placeParams="placeParams" /> <ScenicSpots v-show="rotate3" ref="scenicSpotsRef" @placeParams="placeParams" />
<Screen v-show="rotate4" @screenParams="screenParams" /> <Screen v-show="rotate4" ref="screenRef" @screenParams="screenParams" />
</view> </view>
<view class="list"> <view class="list">
<view @click="jumpPage(item)" class="item" v-for="(item, index) in cardData" :key="index"> <view @click="jumpPage(item)" class="item" v-for="(item, index) in cardData" :key="index">
...@@ -140,6 +140,10 @@ const textColor = ref('#ffffff'); ...@@ -140,6 +140,10 @@ const textColor = ref('#ffffff');
const backIconColor = ref('white'); const backIconColor = ref('white');
const current = ref(0); const current = ref(0);
const isLoadReachBottom = ref(null); const isLoadReachBottom = ref(null);
const sortRef = ref(null);
const departureDateRef = ref(null);
const scenicSpotsRef = ref(null);
const screenRef = ref(null);
const params = ref({ const params = ref({
current: 1, current: 1,
size: 15, size: 15,
...@@ -235,6 +239,12 @@ const screenParams = (item, type) => { ...@@ -235,6 +239,12 @@ const screenParams = (item, type) => {
}); });
}; };
const resetParams = () => { const resetParams = () => {
if (sortRef.value || departureDateRef.value || scenicSpotsRef.value || screenRef.value) {
sortRef.value.reset();
departureDateRef.value.reset();
scenicSpotsRef.value.reset();
screenRef.value.reset();
}
params.value = { params.value = {
size: 15, size: 15,
current: 1, current: 1,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 点评详情页面 --> <!-- 点评详情页面 -->
<search style="z-index: 99; width: 100%" :type="2" backgroundBox="#fff"> <search style="z-index: 99; width: 100%" :type="2" backgroundBox="#fff">
<view style="width: 100%; text-align: center; font-size: 36rpx; font-weight: bold"> <view style="width: 100%; text-align: center; font-size: 36rpx; font-weight: bold">
点评详情 景点详情
</view> </view>
</search> </search>
<view class="review-details-pages"> <view class="review-details-pages">
......
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