新增教练端,实现业务闭环:会员登录注册→查询团课→预约团课→扫码签到→教练端开课→记录实际开课时间→教练端结课→记录实际结课时间→后台查询数据
This commit is contained in:
@@ -233,10 +233,28 @@
|
||||
let canBook = false
|
||||
let btnText = '立即预约'
|
||||
|
||||
// 检查是否距离课程开始至少30分钟
|
||||
const nowTime = new Date()
|
||||
const minutesUntilStart = dt && !isNaN(dt) ? Math.round((dt - nowTime) / 60000) : 0
|
||||
const isTooLate = minutesUntilStart < 30
|
||||
const isPastStart = minutesUntilStart <= 0
|
||||
|
||||
if (statusStr === 0) {
|
||||
canBook = !isFull
|
||||
btnText = isFull ? '已约满' : '立即预约'
|
||||
statusText = isFull ? '已约满' : ''
|
||||
if (isPastStart) {
|
||||
canBook = false
|
||||
btnText = '课程已开始'
|
||||
statusText = '课程已开始'
|
||||
} else if (isTooLate) {
|
||||
canBook = false
|
||||
btnText = '需提前30分钟预约'
|
||||
} else if (isFull) {
|
||||
canBook = false
|
||||
btnText = '已约满'
|
||||
statusText = '已约满'
|
||||
} else {
|
||||
canBook = true
|
||||
btnText = '立即预约'
|
||||
}
|
||||
} else if (statusStr === 1) {
|
||||
statusText = '已取消'
|
||||
statusClass = 'status-cancel'
|
||||
|
||||
Reference in New Issue
Block a user