diff --git a/src/pages/course/list/list.vue b/src/pages/course/list/list.vue index 4d229d3..6cf9378 100644 --- a/src/pages/course/list/list.vue +++ b/src/pages/course/list/list.vue @@ -109,6 +109,7 @@ export default { date: '', startTime: '', endTime: '', + time_dimension: 0 // 课程时长 } } }, @@ -141,8 +142,18 @@ export default { }) }, 300, 300), modalStartTime(e){ - console.warn(e); - this.orderInfo.startTime = e.detail.value; + let { orderInfo } = this; + let _value = e.detail.value; + // 结束时间根据时长计算填充···· + let _timeArr = _value.split(':'); + let _dimension = orderInfo.time_dimension; + let _end_hour = util.formatNumber(+_timeArr[0]+(parseInt((+_dimension*60+(+_timeArr[1]))/60))); + let _end_min = util.formatNumber((+_dimension*60+(+_timeArr[1]))%60) + let _endTime = `${_end_hour}:${_end_min}` + // 结束时间根据时长计算填充···· + + this.orderInfo.startTime = _value; + this.orderInfo.endTime = _endTime; this.$nextTick(_=>this.$forceUpdate()); }, modalEndTime(e){ @@ -189,6 +200,7 @@ export default { date: '', startTime: '', endTime: '', + time_dimension: e.time_dimension } util.showLoad(); servers.get({