|
@@ -1,12 +1,15 @@
|
|
|
import CourseVideoItem from '@/business-components/course-video-item'
|
|
|
import SectionDetail from '@/business-components/section-detail'
|
|
|
import UserDetail from '@/business-components/user-detail'
|
|
|
-import { Button, Toast } from 'vant'
|
|
|
+import { Button, Dialog, Toast } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import request from '@/helpers/request'
|
|
|
import ColSticky from '@/components/col-sticky'
|
|
|
import { shareCall } from '../share'
|
|
|
+import { browser } from '@/helpers/utils'
|
|
|
+import { postMessage } from '@/helpers/native-message'
|
|
|
+import { state } from '@/state'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `../images/${fileName}`
|
|
@@ -36,6 +39,25 @@ export default defineComponent({
|
|
|
},
|
|
|
async mounted() {
|
|
|
try {
|
|
|
+ if (browser().isApp) {
|
|
|
+ if (state.platformType === 'STUDENT') {
|
|
|
+ // 自动跳转到学生端视频课详情购买页
|
|
|
+ window.location.replace(
|
|
|
+ `${location.origin}/student/#/videoDetail?recomUserId=${this.recomUserId}&groupId=${this.params.videoLessonGroupId}`
|
|
|
+ )
|
|
|
+ } else if (state.platformType === 'TEACHER') {
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '请使用酷乐秀学生端扫码打开'
|
|
|
+ }).then(() => {
|
|
|
+ postMessage({ api: 'back' })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果不在app里面则不需要唤起操作
|
|
|
+ this.reCall()
|
|
|
+ }
|
|
|
+
|
|
|
const res = await request.post(`/api-teacher/open/videoShareProfit`, {
|
|
|
data: {
|
|
|
bizId: this.params.videoLessonGroupId,
|
|
@@ -43,7 +65,6 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
const result = res.data || {}
|
|
|
- console.log(result)
|
|
|
const { lessonGroup, detailList } = result.videoGroup
|
|
|
this.userInfo = {
|
|
|
username: result.name,
|
|
@@ -57,22 +78,11 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
this.detailList = detailList || []
|
|
|
-
|
|
|
- this.reCall()
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onPlay(detail: any) {
|
|
|
- this.$router.push({
|
|
|
- path: '/videoClassDetail',
|
|
|
- query: {
|
|
|
- groupId: this.params.videoLessonGroupId,
|
|
|
- classId: detail.id
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
reCall() {
|
|
|
const { origin } = location
|
|
|
let str = origin + '/student/#/videoDetail'
|
|
@@ -82,6 +92,10 @@ export default defineComponent({
|
|
|
shareCall(str, {})
|
|
|
},
|
|
|
onShare() {
|
|
|
+ if (browser().weixin) {
|
|
|
+ this.wxStatus = true
|
|
|
+ return
|
|
|
+ }
|
|
|
this.reCall()
|
|
|
setTimeout(() => {
|
|
|
this.$router.push('/download')
|
|
@@ -110,7 +124,6 @@ export default defineComponent({
|
|
|
content: item.videoContent,
|
|
|
imgUrl: item.coverUrl
|
|
|
}}
|
|
|
- onPlay={this.onPlay}
|
|
|
/>
|
|
|
))}
|
|
|
</SectionDetail>
|