1.修改本地路由

2.修改见面会逻辑
main
king 1 year ago
parent 5096ba724d
commit 4b250d5acb
  1. 4
      src/app.config.ts
  2. 14
      src/components/showModel/showModel.module.scss
  3. 2
      src/components/showModel/showModel.tsx
  4. 11
      src/pages/business/test/test.tsx
  5. 12
      src/pages/business/userInfo/userInfo.tsx
  6. 5
      src/pages/business/videoInfo/videoInfo.tsx
  7. 9
      src/pages/check/check.tsx
  8. 11
      src/pages/manage/addStudent/addStudent.tsx
  9. 27
      src/pages/manage/bingUser/bingUser.tsx
  10. 9
      src/pages/manage/depAdmin/depAdmin.tsx
  11. 0
      src/pages/manage/spotMeeting/spotMeeting.config.ts
  12. 0
      src/pages/manage/spotMeeting/spotMeeting.module.scss
  13. 39
      src/pages/manage/spotMeeting/spotMeeting.tsx
  14. 0
      src/pages/manage/student/student.config.ts
  15. 0
      src/pages/manage/student/student.scss
  16. 6
      src/pages/manage/student/student.tsx
  17. 9
      src/pages/my/components/header/service.tsx
  18. 7
      src/pages/my/my.tsx

@ -54,12 +54,12 @@ export default defineAppConfig({
root: 'pages/manage', root: 'pages/manage',
pages: [ pages: [
'depAdmin/depAdmin', 'depAdmin/depAdmin',
'college/college', 'student/student',
'curriculum/curriculum', 'curriculum/curriculum',
'addStudent/addStudent', 'addStudent/addStudent',
'depCur/depCur', 'depCur/depCur',
'addCur/addCur', 'addCur/addCur',
'offline/offline', 'spotMeeting/spotMeeting',
'bingUser/bingUser', 'bingUser/bingUser',
] ]
} }

@ -1,11 +1,19 @@
.operation { .operation {
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
padding: 20px 0;
width: 100%; width: 100%;
border-top: 1px solid #eee; border-top: 1px solid #eee;
& > * { & > * {
background: red; padding: 20px 0;
flex: 1;
width: 50%;
text-align: center;
color: #45D4A8;
&:first-child {
color: #000;
border-right: 1px solid #ddd;
}
} }
} }

@ -15,7 +15,7 @@ interface Props {
const ShowModel: FC<Props> = (pros) => { const ShowModel: FC<Props> = (pros) => {
return ( return (
<CustomPageContainer position='center' round show={pros.show} onClickOverlay={pros.onClickOverlay}> <CustomPageContainer position='center' round show={pros.show} onClickOverlay={pros.onClickOverlay}>
<View className='text-center mt-2'>{pros.title}</View> <View className='text-center my-3'>{pros.title}</View>
{pros.children} {pros.children}
<View className={styles.operation}> <View className={styles.operation}>
<View className={styles.cancel} onClick={pros.onClickOverlay}></View> <View className={styles.cancel} onClick={pros.onClickOverlay}></View>

@ -1,7 +1,7 @@
import {Button, View} from "@tarojs/components"; import {Button, View} from "@tarojs/components";
import {getCurrentInstance} from "@tarojs/runtime"; import {getCurrentInstance} from "@tarojs/runtime";
import {curriculum} from "@/api"; import {curriculum} from "@/api";
import {FC, useEffect, useState} from "react"; import {useEffect, useState} from "react";
import ShortAnswer from "@/components/topic/shortAnswer"; import ShortAnswer from "@/components/topic/shortAnswer";
import Judge from "@/components/topic/judge"; import Judge from "@/components/topic/judge";
import Multi from "@/components/topic/multi"; import Multi from "@/components/topic/multi";
@ -111,12 +111,5 @@ const Test = () => {
) )
} }
const TestProfile: FC = () => {
return (
<Profile.Provider>
<Test/>
</Profile.Provider>
)
}
export default TestProfile export default Test

@ -1,4 +1,4 @@
import {FC, useState} from "react"; import {useState} from "react";
import {Profile} from '@/store' import {Profile} from '@/store'
import avatar from "@/static/img/avatar.png" import avatar from "@/static/img/avatar.png"
import PopPut from "@/components/popPut/popPut"; import PopPut from "@/components/popPut/popPut";
@ -68,12 +68,4 @@ const List = () => {
} }
const userInfo: FC = () => { export default List
return (
<Profile.Provider>
<List/>
</Profile.Provider>
)
}
export default userInfo

@ -2,7 +2,6 @@ import {Image, Text, View} from "@tarojs/components";
import {FC, useCallback, useEffect, useState} from "react"; import {FC, useCallback, useEffect, useState} from "react";
import {CourseDepData, curriculum} from "@/api"; import {CourseDepData, curriculum} from "@/api";
import './videoInfo.scss' import './videoInfo.scss'
import {Profile} from '@/store'
import Catalogue from "./components/catalogue"; import Catalogue from "./components/catalogue";
import Course from "./components/course"; import Course from "./components/course";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
@ -91,7 +90,7 @@ const VideoInfo: FC = () => {
return ( return (
<Profile.Provider> <>
<View className='content'> <View className='content'>
<View className='content-video'> <View className='content-video'>
{playId ? {playId ?
@ -112,7 +111,7 @@ const VideoInfo: FC = () => {
<Catalogue data={data} setHors={setHors} id={id}/> <Catalogue data={data} setHors={setHors} id={id}/>
</View> </View>
</Profile.Provider> </>
) )
} }

@ -79,12 +79,5 @@ const Bing: FC = () => {
) )
} }
const Index: FC = () => {
return (
<Profile.Provider>
<Bing/>
</Profile.Provider>
);
}
export default Index; export default Bing;

@ -1,5 +1,5 @@
import {Button, Form, Input, View} from "@tarojs/components"; import {Button, Form, Input, View} from "@tarojs/components";
import {FC, useEffect, useState} from "react"; import {useEffect, useState} from "react";
import {ManageApi, Student} from "@/api/manage"; import {ManageApi, Student} from "@/api/manage";
import Icon from "@/components/icon"; import Icon from "@/components/icon";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
@ -144,12 +144,5 @@ const AddStudent = () => {
) )
} }
const AddPage: FC = () => {
return (
<Profile.Provider>
<AddStudent/>
</Profile.Provider>
)
}
export default AddPage export default AddStudent

@ -9,6 +9,14 @@ const BingUser: FC = () => {
const {setUser, setToken, setCompany} = Profile.useContainer() const {setUser, setToken, setCompany} = Profile.useContainer()
const router = useRouter() const router = useRouter()
useLoad(() => {
if (!router.params.ticket) {
Taro.reLaunch({
url: "/pages/index/index"
})
}
})
// Taro.useLoad(() => { // Taro.useLoad(() => {
// const time = Date.now() // const time = Date.now()
@ -82,22 +90,5 @@ const BingUser: FC = () => {
) )
} }
const BingUserIndex = () => {
const router = useRouter()
useLoad(() => {
if (!router.params.ticket) {
Taro.reLaunch({
url: "/pages/index/index"
})
}
})
return (
<Profile.Provider>
<BingUser/>
</Profile.Provider>
)
}
export default BingUserIndex export default BingUser

@ -234,12 +234,5 @@ const DepAdmin: FC = () => {
) )
} }
const DepAdminIndex: FC = () => {
return (
<Profile.Provider>
<DepAdmin/>
</Profile.Provider>
)
}
export default DepAdminIndex export default DepAdmin

@ -1,6 +1,6 @@
import {FC, useCallback, useEffect, useState} from "react"; import {FC, useCallback, useEffect, useState} from "react";
import {Image, Picker, View} from "@tarojs/components"; import {Image, Picker, View} from "@tarojs/components";
import styles from './offline.module.scss' import styles from './spotMeeting.module.scss'
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import {curriculum} from "@/api"; import {curriculum} from "@/api";
import {formatDate} from "@/utils/time"; import {formatDate} from "@/utils/time";
@ -8,7 +8,7 @@ import {getSetting, authorize} from "@tarojs/taro";
import PopPut from "@/components/popPut/popPut"; import PopPut from "@/components/popPut/popPut";
import MyButton from "@/components/button/MyButton"; import MyButton from "@/components/button/MyButton";
const Offline: FC = () => { const SpotMeeting: FC = () => {
const [manages, setManages] = useState<Manage[]>([]) const [manages, setManages] = useState<Manage[]>([])
const [start, setStart] = useState<string>(formatDate(new Date(), "YY-MM-dd 08:00:00")) const [start, setStart] = useState<string>(formatDate(new Date(), "YY-MM-dd 08:00:00"))
const [end, setEnd] = useState<string>(formatDate(new Date(), "YY-MM-dd 18:00:00")) const [end, setEnd] = useState<string>(formatDate(new Date(), "YY-MM-dd 18:00:00"))
@ -17,23 +17,20 @@ const Offline: FC = () => {
const [depid, setDepid] = useState<number | null>(null) const [depid, setDepid] = useState<number | null>(null)
const [isDownloading, setDownloading] = useState(false) const [isDownloading, setDownloading] = useState(false)
Taro.useLoad(() => {
useEffect(() => {
curriculum.department().then(res => { curriculum.department().then(res => {
setManages(res.data) setManages(res.data)
}) })
}) }, [])
useEffect(() => { useEffect(() => {
if (!depid) { if (!depid || isDownloading) {
return return
} }
if (isDownloading) { Taro.showLoading()
return;
}
setDownloading(true) setDownloading(true)
const startTime = new Date(start).getTime() const startTime = new Date(start).getTime()
const endTime = new Date(end).getTime() const endTime = new Date(end).getTime()
const path = encodeURIComponent("/pages/meeting/meeting") const path = encodeURIComponent("/pages/meeting/meeting")
@ -42,6 +39,7 @@ const Offline: FC = () => {
if (process.env.TARO_ENV === 'h5') { if (process.env.TARO_ENV === 'h5') {
setTempFilePath(qrcodeUrl) setTempFilePath(qrcodeUrl)
setDownloading(false)
} else { } else {
Taro.downloadFile({ Taro.downloadFile({
url: qrcodeUrl, url: qrcodeUrl,
@ -56,6 +54,7 @@ const Offline: FC = () => {
} }
}) })
} }
Taro.hideLoading()
}, [depid]) }, [depid])
function change(e) { function change(e) {
@ -65,7 +64,8 @@ const Offline: FC = () => {
const handleWriteFile = useCallback(() => { const handleWriteFile = useCallback(() => {
if (tempFilePath == null) { if (tempFilePath == null) {
Taro.showToast({title: '下载失败', icon: 'error'}) Taro.showToast({title: '下载失败', icon: 'error'})
} else if (process.env.TARO_ENV !== 'h5') { return
}
Taro.saveImageToPhotosAlbum({ Taro.saveImageToPhotosAlbum({
filePath: tempFilePath, filePath: tempFilePath,
success() { success() {
@ -75,12 +75,13 @@ const Offline: FC = () => {
Taro.showToast({title: '下载失败', icon: 'error'}) Taro.showToast({title: '下载失败', icon: 'error'})
} }
}) })
} else {
Taro.showToast({title: '请截屏', icon: 'error'})
}
}, [tempFilePath]) }, [tempFilePath])
const handleSaveCode = useCallback(() => { const handleSaveCode = useCallback(() => {
if (process.env.TARO_ENV === 'h5') {
Taro.showToast({title: '请截屏', icon: 'error'})
} else {
getSetting({ getSetting({
success: function ({authSetting}) { success: function ({authSetting}) {
//没有权限则申请 //没有权限则申请
@ -97,6 +98,7 @@ const Offline: FC = () => {
} }
}, },
}); });
}
}, [tempFilePath]); }, [tempFilePath]);
@ -126,11 +128,14 @@ const Offline: FC = () => {
onError={(e) => setError(e.detail.errMsg)} onError={(e) => setError(e.detail.errMsg)}
style={{width: '80%'}} style={{width: '80%'}}
/> />
{error && <View>{error}</View>}` {error && <View>{error}</View>}
<MyButton onClick={handleSaveCode}></MyButton>
{process.env.TARO_ENV !== 'h5' && <MyButton onClick={handleSaveCode}></MyButton>}
{process.env.TARO_ENV === 'h5' && <View></View>}
</View>} </View>}
</View> </View>
) )
} }
export default Offline export default SpotMeeting

@ -2,10 +2,10 @@ import {getCurrentInstance} from "@tarojs/runtime";
import {curriculum, RecordData} from "@/api"; import {curriculum, RecordData} from "@/api";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import {View, Progress, CustomWrapper} from "@tarojs/components"; import {View, Progress, CustomWrapper} from "@tarojs/components";
import './college.scss' import './student.scss'
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
const College = () => { const Student = () => {
const {id, name} = getCurrentInstance()?.router?.params as any const {id, name} = getCurrentInstance()?.router?.params as any
const [data, setData] = useState<RecordData[]>([]) const [data, setData] = useState<RecordData[]>([])
@ -36,4 +36,4 @@ const College = () => {
</CustomWrapper> </CustomWrapper>
) )
} }
export default College export default Student

@ -6,6 +6,7 @@ import styles from '../../my.module.scss'
import dep from '@/static/img/dep.png' import dep from '@/static/img/dep.png'
import buy from '@/static/img/buy.png' import buy from '@/static/img/buy.png'
import cur from '@/static/img/cur.png' import cur from '@/static/img/cur.png'
import userInfo from '@/static/img/userInfo.png'
interface List { interface List {
title: string; title: string;
@ -15,8 +16,8 @@ interface List {
const Service = () => { const Service = () => {
const [list, setList] = useState<List[]>([ const [list, setList] = useState<List[]>([
{title: '学习记录', src: cur, router: '/pages/business/history/history'}, {title: '历史记录', src: cur, router: '/pages/business/history/history'},
{title: '设置', src: dep, router: '/pages/business/userInfo/userInfo'}, {title: '个人中心', src: userInfo, router: '/pages/business/userInfo/userInfo'},
]) ])
const {user} = Profile.useContainer() const {user} = Profile.useContainer()
@ -26,8 +27,8 @@ const Service = () => {
if ([1, 2].includes(user?.role_type || 0)) { if ([1, 2].includes(user?.role_type || 0)) {
oldList.unshift(...[ oldList.unshift(...[
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'}, {title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'},
{title: '课程购买', src: buy, router: '/pages/manage/curriculum/curriculum'}, {title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
{title: '现场会', src: buy, router: '/pages/manage/offline/offline'}, {title: '现场会', src: buy, router: '/pages/manage/spotMeeting/spotMeeting'},
]) ])
setList(oldList) setList(oldList)
} }

@ -1,7 +1,6 @@
import {CustomWrapper, View} from "@tarojs/components"; import {View} from "@tarojs/components";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import styles from './my.module.scss' import styles from './my.module.scss'
import {Profile} from '@/store'
import Header from "./components/header/header"; import Header from "./components/header/header";
import {FC} from "react"; import {FC} from "react";
import Time from "@/pages/my/components/header/time"; import Time from "@/pages/my/components/header/time";
@ -11,8 +10,6 @@ const My: FC = () => {
const globalData = Taro.getApp().globalData const globalData = Taro.getApp().globalData
return ( return (
<CustomWrapper>
<Profile.Provider>
<View className={styles.content} style={`paddingTop:${globalData.statusBarHeight}px`}> <View className={styles.content} style={`paddingTop:${globalData.statusBarHeight}px`}>
<Header/> <Header/>
<View className={styles.ribbon}> <View className={styles.ribbon}>
@ -20,8 +17,6 @@ const My: FC = () => {
<Service/> <Service/>
</View> </View>
</View> </View>
</Profile.Provider>
</CustomWrapper>
) )
} }

Loading…
Cancel
Save