Feat:修改入住时间
This commit is contained in:
+14
-1
@@ -27,7 +27,20 @@ export function sojoumOrderRefund(params) {
|
||||
* @returns
|
||||
*/
|
||||
export function sojoumOrderCheckInTime(params) {
|
||||
return request.post("/travel/travelGroupOrder/changeDate", params, {
|
||||
return request.put("/travel/travelGroupOrder/changeDate", params, {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品指定月份的预约日历
|
||||
* @param {*} params
|
||||
* travelGroupProductId int 旅居团购产品ID
|
||||
month string 月份(yyyy-MM)
|
||||
* @returns
|
||||
*/
|
||||
export function sojoumOrderCalendar(params) {
|
||||
return request.get("/travel/product/calendar", params, {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
@@ -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() {
|
||||
// 这里可以添加申请退款的逻辑,比如跳转到退款页面
|
||||
|
||||
Reference in New Issue
Block a user