|
@@ -38,31 +38,36 @@ export default defineComponent({
|
|
|
wxStatus: false
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- if (browser().isApp) {
|
|
|
- if (state.platformType === 'STUDENT') {
|
|
|
- // 自动跳转到学生端视频课详情购买页
|
|
|
- window.location.replace(
|
|
|
- `${location.origin}/student/#/videoDetail?${qs.stringify(
|
|
|
- this.$route.query
|
|
|
- )}`
|
|
|
- )
|
|
|
- } else if (state.platformType === 'TEACHER') {
|
|
|
- Dialog.alert({
|
|
|
- title: '提示',
|
|
|
- message: '请使用酷乐秀学生端扫码打开',
|
|
|
- confirmButtonColor: '#2dc7aa'
|
|
|
- }).then(() => {
|
|
|
- postMessage({ api: 'back' })
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 如果不在app里面则不需要唤起操作
|
|
|
- this.reCall()
|
|
|
- }
|
|
|
- },
|
|
|
async mounted() {
|
|
|
try {
|
|
|
+ if (browser().isApp) {
|
|
|
+ if (state.platformType === 'STUDENT') {
|
|
|
+ // 自动跳转到学生端视频课详情购买页
|
|
|
+ // window.location.replace(
|
|
|
+ // `${location.origin}/student/#/videoDetail?${qs.stringify(
|
|
|
+ // this.$route.query
|
|
|
+ // )}`
|
|
|
+ // )
|
|
|
+
|
|
|
+ this.locationReplace(
|
|
|
+ `${location.origin}/student/#/videoDetail?${qs.stringify(
|
|
|
+ this.$route.query
|
|
|
+ )}`
|
|
|
+ )
|
|
|
+ } else if (state.platformType === 'TEACHER') {
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '请使用酷乐秀学生端扫码打开',
|
|
|
+ confirmButtonColor: '#2dc7aa'
|
|
|
+ }).then(() => {
|
|
|
+ postMessage({ api: 'back' })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果不在app里面则不需要唤起操作
|
|
|
+ this.reCall()
|
|
|
+ }
|
|
|
+
|
|
|
const res = await request.post(`/api-teacher/open/videoShareProfit`, {
|
|
|
data: {
|
|
|
bizId: this.params.videoLessonGroupId,
|
|
@@ -86,10 +91,16 @@ export default defineComponent({
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
|
-
|
|
|
- console.log()
|
|
|
},
|
|
|
methods: {
|
|
|
+ locationReplace(url: string) {
|
|
|
+ if (history.replaceState) {
|
|
|
+ history.replaceState(null, document.title, url)
|
|
|
+ history.go(0)
|
|
|
+ } else {
|
|
|
+ location.replace(url)
|
|
|
+ }
|
|
|
+ },
|
|
|
reCall() {
|
|
|
const { origin } = location
|
|
|
let str = origin + '/student/#/videoDetail'
|