Feat:修改入住时间

This commit is contained in:
LinCyJang
2025-10-21 01:49:30 +08:00
parent fe3c8fec6d
commit 46ef8c90cb
2 changed files with 55 additions and 6 deletions
+41 -5
View File
@@ -96,12 +96,17 @@
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
</view>
</view>
<Calendar ref="calendar" @dateSelected="handleDateSelected"></Calendar>
</view>
</template>
<script>
import { fetchSojoumOrderDetail } from "@/api/sojoumOrder";
import { fetchSojoumOrderDetail,sojoumOrderCheckInTime, sojoumOrderCalendar } from "@/api/sojoumOrder";
import Calendar from "../components/Calendar.vue";
export default {
components: {
Calendar
},
data() {
return {
key: '',
@@ -116,6 +121,40 @@ export default {
this.getSojoumOrderDetail();
},
methods: {
handleDateSelected(dateRange) {
console.log('selectedRange', dateRange);
const params = {
orderId: this.orderInfo.travelGroupOrderInfo.travelGroupProduct.id,
orderStartDate: dateRange.startDate,
orderEndDate: dateRange.endDate
}
uni.showLoading({
title: '加载中...',
mask: true,
})
sojoumOrderCheckInTime(params).then(res => {
if (res.status === 200) {
uni.showToast({
title: '入住时间修改成功',
icon: 'success'
})
}
}).finally(() => {
uni.hideLoading();
})
},
getMonthDay() {
const currentMonth = new Date().toISOString().slice(0, 7)
sojoumOrderCalendar({
travelGroupProductId: this.orderInfo.travelGroupOrderInfo.travelGroupProduct.id,
month: currentMonth
}).then(res => {
if (res.status === 200) {
this.$refs.calendar.showCalendar(res.data);
}
})
},
/**
* 获取旅居团购订单详情
*/
@@ -196,10 +235,7 @@ export default {
},
modifyStayTime() {
// 这里可以添加修改入住时间的逻辑,比如打开日期选择器
uni.showToast({
title: '即将开放此功能',
icon: 'none'
})
this.getMonthDay();
},
applyRefund() {
// 这里可以添加申请退款的逻辑,比如跳转到退款页面