|
@@ -21,6 +21,7 @@ import iconLoop from '../coursewarePlay/image/icon-loop.svg'
|
|
|
import iconLoopActive from '../coursewarePlay/image/icon-loop-active.svg'
|
|
|
import iconplay from '../coursewarePlay/image/icon-play.svg'
|
|
|
import iconpause from '../coursewarePlay/image/icon-pause.svg'
|
|
|
+import iconGoPractice from '../coursewarePlay/image/icon-go-practice.svg'
|
|
|
import iconVideobg from '../coursewarePlay/image/icon-videobg.png'
|
|
|
import { browser, getSecondRPM } from '@/helpers/utils'
|
|
|
import qs from 'query-string'
|
|
@@ -28,6 +29,7 @@ import { Vue3Lottie } from 'vue3-lottie'
|
|
|
import playLoadData from '../coursewarePlay/datas/data.json'
|
|
|
import { handleCheckVip } from '../hook/useFee'
|
|
|
import item from '@/student/coupons/item'
|
|
|
+import { usePageVisibility } from '@vant/use'
|
|
|
|
|
|
const materialType = {
|
|
|
视频: 'VIDEO',
|
|
@@ -38,14 +40,15 @@ const materialType = {
|
|
|
export default defineComponent({
|
|
|
name: 'exercise-after-class',
|
|
|
setup() {
|
|
|
+ const pageVisibility = usePageVisibility()
|
|
|
/** 设置播放容器 16:9 */
|
|
|
const parentContainer = reactive({
|
|
|
width: '100vw'
|
|
|
})
|
|
|
const setContainer = () => {
|
|
|
- let min = Math.min(screen.width, screen.height)
|
|
|
- let max = Math.max(screen.width, screen.height)
|
|
|
- let width = min * (16 / 9)
|
|
|
+ const min = Math.min(screen.width, screen.height)
|
|
|
+ const max = Math.max(screen.width, screen.height)
|
|
|
+ const width = min * (16 / 9)
|
|
|
if (width > max) {
|
|
|
parentContainer.width = '100vw'
|
|
|
return
|
|
@@ -306,7 +309,7 @@ export default defineComponent({
|
|
|
lessonTrainingId: query.lessonTrainingId,
|
|
|
materialId: nextItem.materialId
|
|
|
})
|
|
|
- let src = `${location.origin}/orchestra-music-score/?` + parmas
|
|
|
+ const src = `${location.origin}/orchestra-music-score/?` + parmas
|
|
|
postMessage({
|
|
|
api: 'openAccompanyWebView',
|
|
|
content: {
|
|
@@ -328,6 +331,36 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ watch(pageVisibility, (value: any) => {
|
|
|
+ console.log('watch', value)
|
|
|
+ if (value == 'visible') {
|
|
|
+ // 横屏
|
|
|
+ postMessage(
|
|
|
+ {
|
|
|
+ api: 'setRequestedOrientation',
|
|
|
+ content: {
|
|
|
+ orientation: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ () => {
|
|
|
+ console.log(234)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 去练习
|
|
|
+ const gotoPractice = () => {
|
|
|
+ const url = window.location.origin + location.pathname + `#/accompany`
|
|
|
+ postMessage({
|
|
|
+ api: 'openWebView',
|
|
|
+ content: {
|
|
|
+ url: url,
|
|
|
+ orientation: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={styles.playContent}>
|
|
|
<div class={styles.coursewarePlay} style={{ width: parentContainer.width }}>
|
|
@@ -459,12 +492,22 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.menu}>{popupData.tabName}</div>
|
|
|
<div class={styles.nums}>
|
|
|
- 练习次数:{data.videoData?.trainingTimes || 0}/
|
|
|
+ 观看视频模仿并练习:{data.videoData?.trainingTimes || 0}/
|
|
|
{data.videoData?.trainingContent?.practiceTimes || 0}
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
</Transition>
|
|
|
+ <Transition name="right">
|
|
|
+ {activeData.model && (
|
|
|
+ <div class={styles.btnGroup}>
|
|
|
+ <div class={styles.btnItem} onClick={gotoPractice}>
|
|
|
+ <img src={iconGoPractice} class={styles.btnImg} />
|
|
|
+ <span>去练习</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </Transition>
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|