Feat:订单流程调整

This commit is contained in:
linxi
2025-10-24 18:03:07 +08:00
parent db23fb32a4
commit 670c6385e5
8 changed files with 24 additions and 217 deletions
+1
View File
@@ -635,6 +635,7 @@ export default {
isView: 1
}
});
return
}
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
-186
View File
@@ -1,186 +0,0 @@
<template>
<view class="calendar-wrapper">
<u-calendar
ref="ucalendar"
:show="show"
:mode="'range'"
:maxRange="999"
:defaultDate="defaultDate"
:minDate="minDate"
color="#C52733"
@confirm="handleDateChange"
@close="hideCalendar"
:monthNum="1"
>
<view slot="tooltip" class="calendar-tooltip">
{{ tooltipText }}
</view>
</u-calendar>
</view>
</template>
<script>
export default {
name: 'Calendar',
props: {
minDay: {
type: Number,
default: 1
}
},
data() {
return {
show: false,
defaultDate: null,
minDate: new Date().getTime(),
disabledDates: [], // 存储禁用日期
tooltipText: '请选择入住日期(最多连续5天)',
selectedRange: {
startDate: null,
endDate: null
},
dateList: []
}
},
onReady() {
// 如果需要兼容微信小程序的话,需要用此写法
this.$refs.ucalendar.setFormatter(this.formatter)
},
methods: {
formatter(day) {
// 将day.date转换为yyyy-MM-dd格式,用于与dateList中的日期比较
const currentDate = new Date(day.date)
const dateStr = `${currentDate.getFullYear()}-${String(currentDate.getMonth() + 1).padStart(2, '0')}-${String(currentDate.getDate()).padStart(2, '0')}`
// 在dateList中查找匹配的日期
const matchedDate = this.dateList.find(item => item.date === dateStr)
if (matchedDate) {
// 根据inventoryStatus设置bottomInfo和disabled状态
switch (matchedDate.inventoryStatus) {
case -1:
day.bottomInfo = '不可预约'
day.disabled = true
break
case 0:
day.bottomInfo = '可预约'
day.disabled = false
break
case 1:
day.bottomInfo = '已被预约'
day.disabled = true
break
case 2:
day.bottomInfo = '不可预约'
day.disabled = true
break
}
}
return day
},
showCalendar(days) {
this.show = true
this.dateList = days
},
hideCalendar() {
this.show = false
},
// 处理日期选择变化
handleDateChange(e) {
// e是选中的日期数组 ["2025-10-21", "2025-10-22", "2025-10-23", "2025-10-24", "2025-10-25"]
// 检查是否有不可选的日期
const hasInvalidDate = e.some(date => {
const matchedDate = this.dateList.find(item => item.date === date)
return matchedDate && (matchedDate.inventoryStatus === 1 || matchedDate.inventoryStatus === 2 || matchedDate.inventoryStatus === -1)
})
if (hasInvalidDate) {
uni.showToast({
title: '所选日期包含不可预约日期',
icon: 'none'
})
this.resetSelection()
return
}
// 更新选择状态
this.selectedRange = {
startDate: e[0],
endDate: e[e.length - 1]
}
if (e.length !== this.minDay) {
uni.showToast({
title: `团购天数必须为${this.minDay}`,
icon: 'none'
})
this.resetSelection()
return
}
// 触发父组件事件
this.$emit('dateSelected', this.selectedRange)
this.hideCalendar()
},
// 检查日期范围内是否有不可预约的日期
checkInvalidDatesInRange(start, end) {
// 遍历日期范围内的每一天
for (let d = new Date(start); d <= end; d.setDate(d.getDate() + 1)) {
const dateStr = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
const matchedDate = this.dateList.find(item => item.date === dateStr)
// 如果找到匹配的日期,且状态为已被预约(1)或不可预约(2)
if (matchedDate && (matchedDate.inventoryStatus === 1 || matchedDate.inventoryStatus === 2)) {
return true
}
}
return false
},
// 检查选择范围内是否有禁用日期
checkDisabledDatesInRange(start, end) {
return this.disabledDates.some(date => {
const disabledDate = new Date(date)
return disabledDate >= start && disabledDate <= end
})
},
// 重置选择
resetSelection() {
this.selectedRange = {
startDate: null,
endDate: null
}
this.defaultDate = null
},
// 处理月份切换
handleMonthSwitch(e) {
// 可以在这里处理月份切换逻辑,例如加载该月的禁用日期
this.$emit('monthChange', e)
},
// 设置禁用日期
setDisabledDates(dates) {
this.disabledDates = dates
}
}
}
</script>
<style lang="scss" scoped>
.calendar-wrapper {
width: 100%;
background-color: #fff;
border-radius: 12rpx;
overflow: hidden;
.calendar-tooltip {
padding: 20rpx;
font-size: 28rpx;
color: #666;
text-align: center;
}
}
</style>
-1
View File
@@ -1432,7 +1432,6 @@ export default {
uni.navigateTo({ url: `/pkg_product/views/famousQianxianTheme?id=${item.id}` })
},
sujoumeClickHandle(item) {
console.log(item);
uni.navigateTo({ url: '/pkg_product/views/sojoumStore?id=' + item.id })
},
industryTabItemClick(index) {
-2
View File
@@ -153,12 +153,10 @@
<script>
import { getJiaLouProductDetail, getJiaLouCalendar,getJiaLouBookingRules } from '@/api/qianxian'
import {getGiftCardSendBackground} from "@/api/gift"
import Calendar from '../components/Calendar.vue'
import DateRangePicker from '@/components/DateRangePicker/DateRangePicker.vue'
export default {
name: 'GroupBuyDetails',
components: {
Calendar,
DateRangePicker
},
data() {
+21 -24
View File
@@ -17,10 +17,10 @@
</view>
<swiper v-if="traveItems.length > 0" class="v12-justify-between swap" autoplay circular next-margin="300rpx" duration="10000" interval="3000" >
<swiper-item v-for="(item, index) in traveItems" :key="index" >
<view class="trave-item v12-mr-3 v12-mt-3" @click="toStore(item.hotelId)">
<view class="trave-item v12-mr-3 v12-mt-3" @click="toStore(item)">
<view class="trave-item">
<image class="trave-item" :src="item.cover" v-if="item.coverType === 1"></image>
<video class="trave-item" :src="item.cover" :show-fullscreen-btn="false" :show-center-play-btn="flase" :show-play-btn="false" v-if="item.coverType === 2"></video>
<image class="trave-item" :src="item.cover"></image>
<!-- <video class="trave-item" :src="item.cover" :show-fullscreen-btn="false" :show-center-play-btn="flase" :show-play-btn="false" v-if="item.coverType === 2"></video> -->
</view>
<view class="trave-btn">
<text>旅居预约</text>
@@ -41,10 +41,10 @@
</view>
</view>
<view class="v12-justify-between sanctup-items v12-mt-3">
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item.hotelId)">
<view v-for="(item, index) in items" :key="index" class="v12-pa-1" @click="toStore(item)">
<view class="img">
<image class="img" :src="item.cover" v-if="item.coverType === 1"></image>
<video
<image class="img" :src="item.cover"></image>
<!-- <video
class="img"
:src="item.cover"
:play-btn-position="center"
@@ -53,7 +53,7 @@
:show-play-btn="false"
:controls="false"
v-if="item.coverType === 2">
</video>
</video> -->
<view class="v12-white-text address">
<image
class="map-icon v12-mr-1"
@@ -62,12 +62,12 @@
<text class="v12-font-28">{{ item.areaName }}</text>
</view>
</view>
<view class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.content }}</view>
<view class="v12-font-bold v12-font-28 v12-mt-1 more-t desc-txt">{{ item.intro }}</view>
<view class="v12-justify-start v12-align-center v12-my-1">
<view class="atr">
<image class="atr" :src="item.logo"></image>
<image class="atr" :src="item.avatar"></image>
</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.hotelName }}</view>
<view class="v12-font-26 v12-ml-2 v12-dark-text one-t">{{ item.name }}</view>
</view>
</view>
</view>
@@ -80,6 +80,7 @@
</template>
<script>
import { getCategory,getWellnessPlace } from '@/api/health'
import { getJiaLouList } from '@/api/qianxian'
export default {
data() {
return {
@@ -95,6 +96,8 @@ export default {
}
},
onLoad(opts) {
console.log(opts);
this.cityId = opts.city
this.cityName = decodeURIComponent(decodeURIComponent(opts.cityName))
getCategory().then(res => {
@@ -122,13 +125,13 @@ export default {
},
getList() {
const params = {
goodCityId: this.cityId,
categoryId: this.categoryId,
keyword: this.keyword,
// countyId: this.cityId,
wellnessPlaceCateId : this.categoryId,
shopType: 'wellness',
page: 1,
limit: 9999
}
getWellnessPlace(params).then(res => {
getJiaLouList(params).then(res => {
// console.log(res);
this.items = res.data.records
})
@@ -140,23 +143,17 @@ export default {
},
getTop() {
const params = {
goodCityId: this.cityId,
categoryId: 0,
shopType: 'wellness',
page: 1,
limit: 9999
}
getWellnessPlace(params).then(res => {
getJiaLouList(params).then(res => {
// console.log(res);
this.traveItems = res.data.records
})
},
toStore(id) {
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: id
}
})
toStore(item) {
uni.navigateTo({ url: '/pkg_product/views/sojoumStore?id=' + item.id })
},
}
}
-2
View File
@@ -165,11 +165,9 @@
<script>
import { fetchSojoumOrderDetail,sojoumOrderCheckInTime, sojoumOrderCalendar } from "@/api/sojoumOrder";
import Calendar from "../components/Calendar.vue";
import DateRangePicker from '@/components/DateRangePicker/DateRangePicker.vue'
export default {
components: {
Calendar,
DateRangePicker
},
data() {
+1 -1
View File
@@ -114,7 +114,7 @@ export default {
title: '退款申请已提交',
icon: 'success'
})
uni.navigateBack({
uni.navigateTo({
url: '/pkg_product/views/sojoumOrderDetails?id=' + this.key
})
}
+1 -1
View File
@@ -352,7 +352,7 @@ export default {
{ text: '文化', value: 1, isShow: true },
{ text: '资质', value: 2, isShow: true }
],
activeIndex: 4,
activeIndex: 3,
isLoadInfoListSuccess: false,
picColumnWidth: '345rpx',
infoArray: [],