完善功能

This commit is contained in:
wangxiaowei
2025-12-10 21:30:49 +08:00
parent 5709317af2
commit 6cba10eb94
7 changed files with 621 additions and 384 deletions

View File

@ -365,8 +365,8 @@ export default {
// 处理导航
handleLocation() {
uni.openLocation({
latitude: this.venue.latitude,
longitude: this.venue.longitude,
latitude: Number(this.venue.latitude),
longitude: Number(this.venue.longitude),
name: this.venue.name,
address: this.venue.address,
scale: 18
@ -437,7 +437,6 @@ export default {
// 篮球场-立即预约
toReserve() {
let self = this
// 一进来就锁定,彻底防止高频点击
if (self.typeId == 1) {
if (self.selectedReserveTime.length === 0) {
@ -459,7 +458,8 @@ export default {
app_id: self.getAppId(),
ground_id: self.id,
room_list: JSON.stringify(self.selectedReserveTime),
type: this.typeId
type: this.typeId,
start_end: self.selectedReserveTime[0].start_time + '-' + self.selectedReserveTime[self.selectedReserveTime.length -1].end_time
},
function(res) {
self.loadding = false;
@ -515,54 +515,6 @@ export default {
},
handleSelectTime(title, time, status) {
// if (status == 1) {
// return;
// }
// // 多选逻辑selectedTime为对象按title区分
// if (!this.selectedTime[title]) {
// this.$set(this.selectedTime, title, []);
// }
// const idx = this.selectedTime[title].indexOf(time);
// if (idx > -1) {
// // 已选中则取消
// this.selectedTime[title].splice(idx, 1);
// } else {
// // 未选中则添加
// this.selectedTime[title].push(time);
// }
// this.countSelectedTime = Object.values(this.selectedTime).reduce((acc, times) => acc + times.length, 0);
// this.totalPrice()
// // 生成 room_list 数组格式weekList[this.currentWeek]?.value?.join('') || '';
// const day_title = this.weekList[this.currentWeek]?.day || '';
// // 遍历所有已选时间,生成 room_list
// const room_list = [];
// Object.keys(this.selectedTime).forEach(roomTitle => {
// const rid = this.cdList.find(cd => cd.title === roomTitle)?.id || 1;
// this.selectedTime[roomTitle].forEach(t => {
// // t 可能是 '09:00-10:00' 或 '09:00', 需拆分
// let start_time = t, end_time = '';
// if (t.includes('-')) {
// [start_time, end_time] = t.split('-');
// } else {
// start_time = t;
// // 假设每个时间段为1小时自动+1小时
// const [h, m] = t.split(':');
// const nextH = (parseInt(h, 10) + 1).toString().padStart(2, '0');
// end_time = `${nextH}:${m}`;
// }
// room_list.push({
// room_id: rid,
// // day_time,
// // day_title,
// start_time,
// end_time,
// hours: '1'
// });
// });
// });
// this.selectedReserveTime = room_list;
if (status == 1) {
return;
}