|
@@ -3,9 +3,12 @@ import item from '@/student/coupons/item'
|
|
|
import dayjs from 'dayjs'
|
|
|
// import isBetween from 'dayjs/plugin/isBetween'
|
|
|
// dayjs.extend(isBetween)
|
|
|
-import { Button, Cell, CellGroup, Popup, showToast, Sticky, TimePicker } from 'vant'
|
|
|
+import { Button, Cell, CellGroup, Icon, Popup, showToast, Sticky, TimePicker } from 'vant'
|
|
|
import { defineComponent, onMounted, reactive, watch } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
+import iconSuccessPlan from '../../images/icon-success-plan.png'
|
|
|
+import iconErrorPlan from '../../images/icon-error-plan.png'
|
|
|
+import iconPayingPlan from '../../images/icon-paying-plan.png'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'timer',
|
|
@@ -190,28 +193,48 @@ export default defineComponent({
|
|
|
|
|
|
{/* <div class={styles.selectTimer}>{dayjs(state.calendarDate).format('YYYY年MM月DD日')}</div> */}
|
|
|
|
|
|
- <CellGroup inset class={styles.cellGroup} style={{ marginTop: '12px' }}>
|
|
|
- {state.useTimer.map((item: any) => (
|
|
|
- <Cell
|
|
|
- center
|
|
|
- title={`${dayjs(item.startTime).format('HH:mm')}~${dayjs(item.endTime).format(
|
|
|
- 'HH:mm'
|
|
|
- )}`}
|
|
|
- value="可排课时间段"
|
|
|
- ></Cell>
|
|
|
- ))}
|
|
|
-
|
|
|
- {state.usedTimer.map((item: any) => (
|
|
|
- <Cell
|
|
|
- center
|
|
|
- value="冲突时间"
|
|
|
- title={`${dayjs(item.startTime).format('HH:mm')}~${dayjs(item.endTime).format(
|
|
|
- 'HH:mm'
|
|
|
- )}`}
|
|
|
- class={styles.noTime}
|
|
|
- ></Cell>
|
|
|
- ))}
|
|
|
- </CellGroup>
|
|
|
+ {state.useTimer && state.useTimer.length > 0 && (
|
|
|
+ <CellGroup inset class={styles.cellGroup} style={{ marginTop: '12px' }}>
|
|
|
+ <Cell>
|
|
|
+ {{
|
|
|
+ icon: () => <Icon name={iconSuccessPlan} class={styles.cellIcon} />,
|
|
|
+ title: () => (
|
|
|
+ <div class={styles.cellTimers}>
|
|
|
+ <h3>可排课时间段</h3>
|
|
|
+ <div>
|
|
|
+ {state.useTimer.map((item: any) => (
|
|
|
+ <span>{`${dayjs(item.startTime).format('HH:mm')}~${dayjs(
|
|
|
+ item.endTime
|
|
|
+ ).format('HH:mm')}`}</span>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Cell>
|
|
|
+ </CellGroup>
|
|
|
+ )}
|
|
|
+ {state.usedTimer && state.usedTimer.length > 0 && (
|
|
|
+ <CellGroup inset class={styles.cellGroup} style={{ marginTop: '12px' }}>
|
|
|
+ <Cell>
|
|
|
+ {{
|
|
|
+ icon: () => <Icon name={iconErrorPlan} class={styles.cellIcon} />,
|
|
|
+ title: () => (
|
|
|
+ <div class={styles.cellTimers}>
|
|
|
+ <h3>冲突时间</h3>
|
|
|
+ <div>
|
|
|
+ {state.usedTimer.map((item: any) => (
|
|
|
+ <span>{`${dayjs(item.startTime).format('HH:mm')}~${dayjs(
|
|
|
+ item.endTime
|
|
|
+ ).format('HH:mm')}`}</span>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Cell>
|
|
|
+ </CellGroup>
|
|
|
+ )}
|
|
|
|
|
|
<CellGroup inset class={styles.cellGroup}>
|
|
|
<Cell
|
|
@@ -220,7 +243,9 @@ export default defineComponent({
|
|
|
value={state.selectTime ? dayjs(state.selectTime).format('HH:mm') : ''}
|
|
|
isLink
|
|
|
onClick={() => (state.selectTimeStatus = true)}
|
|
|
- ></Cell>
|
|
|
+ >
|
|
|
+ {{ icon: () => <Icon name={iconPayingPlan} class={styles.cellIcon} /> }}
|
|
|
+ </Cell>
|
|
|
</CellGroup>
|
|
|
|
|
|
<Sticky position="bottom">
|