学习记录

main
king 1 year ago
parent ae6fd4f3ff
commit f10af4f1cc
  1. 1
      src/app.config.ts
  2. 7
      src/components/video/video.tsx
  3. 3
      src/config.ts
  4. 4
      src/hooks/unique_ident.ts
  5. 2
      src/pages/business/test/test.tsx
  6. 2
      src/pages/business/videoInfo/videoInfo.tsx
  7. 4
      src/pages/preview/preview.config.ts
  8. 14
      src/pages/preview/preview.tsx
  9. 2
      src/store/profile.ts

@ -5,6 +5,7 @@ export default defineAppConfig({
'pages/login/login',
'pages/check/check',
'pages/my/my',
'pages/preview/preview',
],
window: {
backgroundTextStyle: 'light',

@ -47,7 +47,8 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
if (process.env.TARO_ENV === 'h5') {
try {
document?.exitFullscreen().then()
} catch (e) {}
} catch (e) {
}
}
video?.exitFullScreen()
@ -106,6 +107,10 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
}
})
Taro.useUnload(() => {
unique_ident.del(currentTime, Date.now())
})
return (
<>

@ -2,5 +2,6 @@
export const whiteList: string[] = [
'/pages/check/check',
'/pages/login/login',
'/pages/meeting/meeting'
'/pages/meeting/meeting',
'/pages/preview/preview',
]

@ -31,8 +31,8 @@ function put(duration?: number, start_date?: number, upload = true) {
}
}
function del() {
put()
function del(duration?: number, start_date?: number, upload = true) {
put(duration, start_date, upload)
const data: HourCacheParam | undefined = Taro.getStorageSync(KEY)
if (data) {
curriculum.delCache(data.courseId)

@ -40,7 +40,7 @@ const Test = () => {
useEffect(() => {
if (answers.length) {
unique_ident.put(0, Date.now())
unique_ident.put(undefined, Date.now())
const isPass = answers.every(d => d)
curriculum.recordText(hourId, {

@ -7,7 +7,6 @@ import Course from "./components/course";
import Taro from "@tarojs/taro";
import eventsIndex from "@/hooks/eventsIndex";
import {formatMinute} from "@/utils/time";
import unique_ident from "@/hooks/unique_ident";
import videoEvents from "@/hooks/videoEvents";
@ -102,7 +101,6 @@ const VideoInfo: FC = () => {
Taro.useUnload(() => {
unique_ident.del()
videoEvents.videoOff()
})
return (

@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText:'医学道',
onReachBottomDistance: 30
})

@ -0,0 +1,14 @@
import {FC} from "react";
import {View, Navigator} from "@tarojs/components";
const Preview: FC = () => {
return (
<View>
.....
<Navigator url='/pages/login/login'></Navigator>
</View>
)
}
export default Preview

@ -42,7 +42,7 @@ function useProfile() {
if (data?.token == null) {
if (!whiteList.includes(Taro.getCurrentInstance().router?.path?.split('?')?.[0] || '')) {
Taro.reLaunch({url: '/pages/login/login'})
Taro.reLaunch({url: '/pages/preview/preview'})
}
}

Loading…
Cancel
Save