|
@@ -91,7 +91,6 @@ export default {
|
|
|
watch: {
|
|
|
timeArr: {
|
|
|
handler(newVal) {
|
|
|
- // console.log(newVal, '>>>>>>>时间范围');
|
|
|
let dateArr = newVal.map((item) => {
|
|
|
let day = new Date(item)
|
|
|
const daysOfWeek = [
|
|
@@ -115,7 +114,6 @@ export default {
|
|
|
},
|
|
|
timeHostArr: {
|
|
|
handler(newVal) {
|
|
|
- // console.log(newVal, '>>>>>>>时间更新');
|
|
|
// 当timeHostArr更新时,恢复之前的选择状态
|
|
|
if (newVal && newVal.length > 0) {
|
|
|
this.restoreSelections()
|
|
@@ -125,14 +123,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.businessTierName, "businessTierName from parent component")
|
|
|
},
|
|
|
computed: {
|
|
|
// 计算选中区域
|
|
|
selectRange() {
|
|
|
const reservations = this.timeHostArr[this.day_index]
|
|
|
- // console.log(reservations, '>>>>>reservations')
|
|
|
- // console.log(JSON.stringify(current), '>>>>>current');
|
|
|
// return current
|
|
|
const result = []
|
|
|
let currentGroup = null
|
|
@@ -172,17 +167,13 @@ export default {
|
|
|
methods: {
|
|
|
// 恢复选择状态
|
|
|
restoreSelections() {
|
|
|
- // console.log('>>>>>>执行了', this.selectedTimeSlots);
|
|
|
if (!this.timeHostArr[this.day_index]) return
|
|
|
|
|
|
- // console.log('>>>>>>执行了2', this.selectedTimeSlots);
|
|
|
|
|
|
// 遍历当前日期的时间槽
|
|
|
this.timeHostArr[this.day_index].forEach((slot) => {
|
|
|
// 检查这个时间槽是否在之前被选中
|
|
|
const dateKey = this.timeArr[this.day_index]
|
|
|
- // console.log(dateKey, '>>>>dateKey');
|
|
|
- // console.log(this.selectedTimeSlots[dateKey], '>>>>this.selectedTimeSlots[dateKey]');
|
|
|
if (
|
|
|
this.selectedTimeSlots[dateKey] &&
|
|
|
this.selectedTimeSlots[dateKey].includes(slot.timeStamp)
|
|
@@ -219,7 +210,6 @@ export default {
|
|
|
// 1. 判断当前时间是否在任何已预约时间段的服务时长范围内
|
|
|
// let inReservedRange = false
|
|
|
|
|
|
- // console.log(slots, '>>>>>>slots');
|
|
|
// for (let slot of slots) {
|
|
|
// if (slot.hasReservation === 1) {
|
|
|
// const reservedTime =
|
|
@@ -233,7 +223,6 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// if (inReservedRange) {
|
|
|
- // console.log('走到了这里');
|
|
|
|
|
|
// uni.showToast({ title: '服务时长不足,请选择其他时间段', icon: 'none' })
|
|
|
// return false
|