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. 87
      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. 21
      src/pages/my/my.tsx

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

@ -1,11 +1,19 @@
.operation {
display: flex;
justify-content: space-around;
padding: 20px 0;
justify-content: space-between;
width: 100%;
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) => {
return (
<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}
<View className={styles.operation}>
<View className={styles.cancel} onClick={pros.onClickOverlay}></View>

@ -1,7 +1,7 @@
import {Button, View} from "@tarojs/components";
import {getCurrentInstance} from "@tarojs/runtime";
import {curriculum} from "@/api";
import {FC, useEffect, useState} from "react";
import {useEffect, useState} from "react";
import ShortAnswer from "@/components/topic/shortAnswer";
import Judge from "@/components/topic/judge";
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 avatar from "@/static/img/avatar.png"
import PopPut from "@/components/popPut/popPut";
@ -68,12 +68,4 @@ const List = () => {
}
const userInfo: FC = () => {
return (
<Profile.Provider>
<List/>
</Profile.Provider>
)
}
export default userInfo
export default List

@ -2,7 +2,6 @@ import {Image, Text, View} from "@tarojs/components";
import {FC, useCallback, useEffect, useState} from "react";
import {CourseDepData, curriculum} from "@/api";
import './videoInfo.scss'
import {Profile} from '@/store'
import Catalogue from "./components/catalogue";
import Course from "./components/course";
import Taro from "@tarojs/taro";
@ -91,7 +90,7 @@ const VideoInfo: FC = () => {
return (
<Profile.Provider>
<>
<View className='content'>
<View className='content-video'>
{playId ?
@ -112,7 +111,7 @@ const VideoInfo: FC = () => {
<Catalogue data={data} setHors={setHors} id={id}/>
</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 {FC, useEffect, useState} from "react";
import {useEffect, useState} from "react";
import {ManageApi, Student} from "@/api/manage";
import Icon from "@/components/icon";
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 router = useRouter()
useLoad(() => {
if (!router.params.ticket) {
Taro.reLaunch({
url: "/pages/index/index"
})
}
})
// Taro.useLoad(() => {
// 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 {Image, Picker, View} from "@tarojs/components";
import styles from './offline.module.scss'
import styles from './spotMeeting.module.scss'
import Taro from "@tarojs/taro";
import {curriculum} from "@/api";
import {formatDate} from "@/utils/time";
@ -8,7 +8,7 @@ import {getSetting, authorize} from "@tarojs/taro";
import PopPut from "@/components/popPut/popPut";
import MyButton from "@/components/button/MyButton";
const Offline: FC = () => {
const SpotMeeting: FC = () => {
const [manages, setManages] = useState<Manage[]>([])
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"))
@ -17,23 +17,20 @@ const Offline: FC = () => {
const [depid, setDepid] = useState<number | null>(null)
const [isDownloading, setDownloading] = useState(false)
Taro.useLoad(() => {
useEffect(() => {
curriculum.department().then(res => {
setManages(res.data)
})
})
}, [])
useEffect(() => {
if (!depid) {
if (!depid || isDownloading) {
return
}
if (isDownloading) {
return;
}
Taro.showLoading()
setDownloading(true)
const startTime = new Date(start).getTime()
const endTime = new Date(end).getTime()
const path = encodeURIComponent("/pages/meeting/meeting")
@ -42,6 +39,7 @@ const Offline: FC = () => {
if (process.env.TARO_ENV === 'h5') {
setTempFilePath(qrcodeUrl)
setDownloading(false)
} else {
Taro.downloadFile({
url: qrcodeUrl,
@ -56,6 +54,7 @@ const Offline: FC = () => {
}
})
}
Taro.hideLoading()
}, [depid])
function change(e) {
@ -65,38 +64,41 @@ const Offline: FC = () => {
const handleWriteFile = useCallback(() => {
if (tempFilePath == null) {
Taro.showToast({title: '下载失败', icon: 'error'})
} else if (process.env.TARO_ENV !== 'h5') {
Taro.saveImageToPhotosAlbum({
filePath: tempFilePath,
success() {
Taro.showModal({title: '下载成功'})
},
fail() {
Taro.showToast({title: '下载失败', icon: 'error'})
}
})
} else {
Taro.showToast({title: '请截屏', icon: 'error'})
return
}
Taro.saveImageToPhotosAlbum({
filePath: tempFilePath,
success() {
Taro.showModal({title: '下载成功'})
},
fail() {
Taro.showToast({title: '下载失败', icon: 'error'})
}
})
}, [tempFilePath])
const handleSaveCode = useCallback(() => {
getSetting({
success: function ({authSetting}) {
//没有权限则申请
if (!authSetting["scope.writePhotosAlbum"]) {
authorize({
scope: "scope.writePhotosAlbum",
success: () => {
//存储二维码
handleWriteFile()
},
});
} else {
handleWriteFile()
}
},
});
if (process.env.TARO_ENV === 'h5') {
Taro.showToast({title: '请截屏', icon: 'error'})
} else {
getSetting({
success: function ({authSetting}) {
//没有权限则申请
if (!authSetting["scope.writePhotosAlbum"]) {
authorize({
scope: "scope.writePhotosAlbum",
success: () => {
//存储二维码
handleWriteFile()
},
});
} else {
handleWriteFile()
}
},
});
}
}, [tempFilePath]);
@ -126,11 +128,14 @@ const Offline: FC = () => {
onError={(e) => setError(e.detail.errMsg)}
style={{width: '80%'}}
/>
{error && <View>{error}</View>}`
<MyButton onClick={handleSaveCode}></MyButton>
{error && <View>{error}</View>}
{process.env.TARO_ENV !== 'h5' && <MyButton onClick={handleSaveCode}></MyButton>}
{process.env.TARO_ENV === 'h5' && <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 {useEffect, useState} from "react";
import {View, Progress, CustomWrapper} from "@tarojs/components";
import './college.scss'
import './student.scss'
import Taro from "@tarojs/taro";
const College = () => {
const Student = () => {
const {id, name} = getCurrentInstance()?.router?.params as any
const [data, setData] = useState<RecordData[]>([])
@ -36,4 +36,4 @@ const College = () => {
</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 buy from '@/static/img/buy.png'
import cur from '@/static/img/cur.png'
import userInfo from '@/static/img/userInfo.png'
interface List {
title: string;
@ -15,8 +16,8 @@ interface List {
const Service = () => {
const [list, setList] = useState<List[]>([
{title: '学习记录', src: cur, router: '/pages/business/history/history'},
{title: '设置', src: dep, router: '/pages/business/userInfo/userInfo'},
{title: '历史记录', src: cur, router: '/pages/business/history/history'},
{title: '个人中心', src: userInfo, router: '/pages/business/userInfo/userInfo'},
])
const {user} = Profile.useContainer()
@ -26,8 +27,8 @@ const Service = () => {
if ([1, 2].includes(user?.role_type || 0)) {
oldList.unshift(...[
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'},
{title: '课程购买', src: buy, router: '/pages/manage/curriculum/curriculum'},
{title: '现场会', src: buy, router: '/pages/manage/offline/offline'},
{title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
{title: '现场会', src: buy, router: '/pages/manage/spotMeeting/spotMeeting'},
])
setList(oldList)
}

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

Loading…
Cancel
Save