1.绑定手机号样式

2.添加课时学习记录时间段
3.学员无学习记录的显示
main
king 1 year ago
parent 289240d179
commit c9afe27986
  1. 5
      src/components/lineChart/lineChart.tsx
  2. 8
      src/pages/business/hourHistory/hourHistory.tsx
  3. 9
      src/pages/business/videoInfo/videoInfo.tsx
  4. 11
      src/pages/check/check.tsx
  5. 9
      src/pages/manage/depAdmin/depAdmin.tsx
  6. 1
      src/utils/time.ts

@ -30,11 +30,12 @@ const LineChart: FC<Props> = ({data}) => {
return (
<>
<ScrollView scrollX={!!maxHeight.value}>
<View>{maxHeight.time}{formatMinute(maxHeight.value)}</View>
{maxHeight.time && <View>{maxHeight.time}{formatMinute(maxHeight.value)}</View>}
<View className={style.lineChart}>
{!maxHeight.value && <View className={style.empty}></View>}
{
maxHeight.value && lineChartList.map(d => <View key={d.time}>
!!maxHeight.value && lineChartList.map(d => <View key={d.time}>
<View className={style.columnBox} style={{width: "100px"}}>
<View className={style.line}
style={{height: height - 10 - (d.value / maxHeight.value * height) + "px"}}></View>

@ -52,10 +52,14 @@ const HourHistory: FC = () => {
<View className={styles.progressBox}>
{
times.map(d => <View key={d.id} className={styles.recordItem}>
<View>{formatDateTime(new Date(d.start_at), 'MM-dd')}</View>
<View>
{formatDateTime(new Date(d.start_at), 'MM-dd')}
{formatDateTime(new Date(d.start_at), 'HH:mm:ss')} -
{formatDateTime(new Date(d.end_at), 'HH:mm:ss')}
</View>
<Progress
className={styles.progress}
percent={Number((d.duration / (hour?.duration || 0)).toFixed(2))}
percent={Number((d.duration / (hour?.duration || 0) * 100).toFixed(2))}
showInfo
borderRadius={10}
active

@ -34,9 +34,10 @@ const VideoInfo: FC = () => {
}
}
function setHors(is_complete: boolean, play_id: number) {
function setHors(preview: boolean, play_id: number) {
console.log(preview)
setPlaying(true)
setPreview(is_complete)
setPreview(preview)
setPlayId(play_id)
}
@ -48,7 +49,7 @@ const VideoInfo: FC = () => {
/** 播放下一个视频 */
const playNext = useCallback(() => {
const flats: Hour[] = Object.values(data?.hours || {}).flat(Infinity) as Hour[]
if (playId === flats?.[flats.length - 1]?.id) {
if (playId === flats?.[flats.length - 1]?.id && !preview) {
Taro.showModal({title: '当前课程结束'})
eventsIndex.trigger({id: Number(id)})
return;
@ -70,7 +71,7 @@ const VideoInfo: FC = () => {
return
}
}
}, [playId, data])
}, [playId, data, preview])
/**
*

@ -1,5 +1,5 @@
import {FC, useCallback, useEffect, useRef, useState} from "react";
import {Button, Form, Image, Input, View} from "@tarojs/components";
import { Form, Image, Input, View} from "@tarojs/components";
import {Profile} from "@/store";
import {userApi} from "@/api";
import Taro from "@tarojs/taro";
@ -7,6 +7,7 @@ import {regexTel} from "@/utils/regu";
import styles from './check.module.scss'
import code from '@/static/img/vCode.png'
import tel from '@/static/img/tel.png'
import MyButton from "@/components/button/MyButton";
const Bing: FC = () => {
const form = useRef<HTMLFormElement | null>(null)
@ -66,7 +67,7 @@ const Bing: FC = () => {
}, [codeTime, phone_number])
return (
<View className='h-10 pt-6 px-3 bg-white'>
<View className='px-3 bg-white h-10'>
<Form onSubmit={Submit} ref={form}>
<View className={styles.formItem}>
@ -94,14 +95,14 @@ const Bing: FC = () => {
</View>
</View>
<Button
className={'button ' + styles.submit}
<MyButton
className={styles.submit}
style={{margin: '30px auto'}}
formType='submit'
disabled={loading}
>
</Button>
</MyButton>
</Form>
</View>
)

@ -16,16 +16,21 @@ const DepAdmin: FC = () => {
const [users, setUsers] = useState<User[]>([])
const [isPut, setIsPut] = useState(false)
const [depName, setDepName] = useState('')
const [reset, setReset] = useState(false)
const {company} = Profile.useContainer()
async function getData() {
show && setShow(false)
try {
const res = await ManageApi.depList(router.params.dep_id || 0)
if (res) {
setReset(true)
setManages(res.department)
setUsers(res.data)
}
} catch (e) {
}
}
function showPop(name: string | undefined) {
@ -127,9 +132,7 @@ const DepAdmin: FC = () => {
}, [])
Taro.useDidShow(() => {
if (manages.length) {
getData()
}
reset && getData()
})
return (

@ -108,6 +108,7 @@ export function everyDay(start_time: number, end_time: number, data: Record<numb
try {
const days = Math.floor((end_time - start_time) / time)
if (isNaN(days)) return [];
return new Array(days === 1 ? 1 : days + 1).fill(0).map((_, index) => {
const day = start_time + index * time
return {

Loading…
Cancel
Save