|
@@ -28,6 +28,7 @@ import dayjs from 'dayjs'
|
|
|
import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import { browser } from '@/helpers/utils'
|
|
|
import { usePageVisibility } from '@vant/use'
|
|
|
+import ColSticky from '@/components/col-sticky'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'VideoClassDetail',
|
|
@@ -62,18 +63,19 @@ export default defineComponent({
|
|
|
},
|
|
|
freeRate: 0, // 试看百分比
|
|
|
trySee: false, // 是否试看
|
|
|
- videoHeight: '212px'
|
|
|
+ videoHeight: '212px',
|
|
|
+ offsetTop: 'auto'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
users() {
|
|
|
return state.user.data
|
|
|
- },
|
|
|
- offsetTop() {
|
|
|
- const navHeight: number = this.navHeight
|
|
|
- const top = Number(navHeight) + 44
|
|
|
- return top + 'px'
|
|
|
}
|
|
|
+ // offsetTop() {
|
|
|
+ // const navHeight: number = this.navHeight
|
|
|
+ // const top = Number(navHeight) + 44
|
|
|
+ // return top + 'px'
|
|
|
+ // }
|
|
|
},
|
|
|
async mounted() {
|
|
|
this.pageVisibility = usePageVisibility()
|
|
@@ -227,109 +229,119 @@ export default defineComponent({
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={styles['video-class-detail']}>
|
|
|
- {/* <Sticky offsetTop={0} position="top"> */}
|
|
|
- <ColHeader
|
|
|
- v-slots={{
|
|
|
- default: () =>
|
|
|
- !this.reload && (
|
|
|
- <ColVideo
|
|
|
- freeRate={Number(this.freeRate)}
|
|
|
- freeTitleStatus={this.lessonPrice > 0 ? true : false}
|
|
|
- trySee={this.trySee}
|
|
|
- src={this.srcUrl}
|
|
|
- payType={this.payType}
|
|
|
- poster={this.posterUrl}
|
|
|
- height={this.videoHeight}
|
|
|
- isBuy
|
|
|
- onBuyEmit={async () => {
|
|
|
- if (this.payType === 'VIP') {
|
|
|
- if (browser().isApp) {
|
|
|
- postMessage({
|
|
|
- api: 'openWebView',
|
|
|
- content: {
|
|
|
- url: `${location.origin}${location.pathname}#/memberCenter`,
|
|
|
- orientation: 1,
|
|
|
- isHideTitle: false
|
|
|
+ <ColSticky
|
|
|
+ position="top"
|
|
|
+ onGetHeight={(val: any) => {
|
|
|
+ this.offsetTop = val + 'px'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <ColHeader
|
|
|
+ v-slots={{
|
|
|
+ default: () =>
|
|
|
+ !this.reload && (
|
|
|
+ <ColVideo
|
|
|
+ freeRate={Number(this.freeRate)}
|
|
|
+ freeTitleStatus={this.lessonPrice > 0 ? true : false}
|
|
|
+ trySee={this.trySee}
|
|
|
+ src={this.srcUrl}
|
|
|
+ payType={this.payType}
|
|
|
+ poster={this.posterUrl}
|
|
|
+ height={this.videoHeight}
|
|
|
+ isBuy
|
|
|
+ onBuyEmit={async () => {
|
|
|
+ if (this.payType === 'VIP') {
|
|
|
+ if (browser().isApp) {
|
|
|
+ postMessage({
|
|
|
+ api: 'openWebView',
|
|
|
+ content: {
|
|
|
+ url: `${location.origin}${location.pathname}#/memberCenter`,
|
|
|
+ orientation: 1,
|
|
|
+ isHideTitle: false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/memberCenter'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.lessonPrice > 0) {
|
|
|
+ this.$router.back()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ const userInfo = this.videoDetail
|
|
|
+ orderStatus.orderObject.orderType = 'VIDEO'
|
|
|
+ orderStatus.orderObject.orderName = '视频课购买'
|
|
|
+ orderStatus.orderObject.orderDesc = '视频课购买'
|
|
|
+ orderStatus.orderObject.actualPrice =
|
|
|
+ userInfo.lessonPrice
|
|
|
+ orderStatus.orderObject.recomUserId = ''
|
|
|
+ orderStatus.orderObject.orderNo = ''
|
|
|
+ orderStatus.orderObject.orderList = [
|
|
|
+ {
|
|
|
+ orderType: 'VIDEO',
|
|
|
+ goodsName: '视频课购买',
|
|
|
+ courseGroupId: userInfo.id,
|
|
|
+ courseGroupName: userInfo.lessonName,
|
|
|
+ coursePrice: userInfo.lessonPrice,
|
|
|
+ teacherName:
|
|
|
+ userInfo.username ||
|
|
|
+ `游客${userInfo.teacherId || ''}`,
|
|
|
+ teacherId: userInfo.teacherId,
|
|
|
+ avatar: userInfo.headUrl,
|
|
|
+ relationType: userInfo.relationType,
|
|
|
+ courseInfo: this.detailList,
|
|
|
+ recomUserId: ''
|
|
|
}
|
|
|
+ ]
|
|
|
+ await onSubmitZero(() => {
|
|
|
+ Dialog.alert({
|
|
|
+ message: '领取成功',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonColor: '#2dc7aa'
|
|
|
+ }).then(() => {
|
|
|
+ this.__init()
|
|
|
+ })
|
|
|
})
|
|
|
- } else {
|
|
|
- this.$router.push({
|
|
|
- path: '/memberCenter'
|
|
|
- })
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
}
|
|
|
- return
|
|
|
- }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ />
|
|
|
|
|
|
- if (this.lessonPrice > 0) {
|
|
|
- this.$router.back()
|
|
|
- return
|
|
|
- }
|
|
|
- try {
|
|
|
- const userInfo = this.videoDetail
|
|
|
- orderStatus.orderObject.orderType = 'VIDEO'
|
|
|
- orderStatus.orderObject.orderName = '视频课购买'
|
|
|
- orderStatus.orderObject.orderDesc = '视频课购买'
|
|
|
- orderStatus.orderObject.actualPrice = userInfo.lessonPrice
|
|
|
- orderStatus.orderObject.recomUserId = ''
|
|
|
- orderStatus.orderObject.orderNo = ''
|
|
|
- orderStatus.orderObject.orderList = [
|
|
|
- {
|
|
|
- orderType: 'VIDEO',
|
|
|
- goodsName: '视频课购买',
|
|
|
- courseGroupId: userInfo.id,
|
|
|
- courseGroupName: userInfo.lessonName,
|
|
|
- coursePrice: userInfo.lessonPrice,
|
|
|
- teacherName:
|
|
|
- userInfo.username ||
|
|
|
- `游客${userInfo.teacherId || ''}`,
|
|
|
- teacherId: userInfo.teacherId,
|
|
|
- avatar: userInfo.headUrl,
|
|
|
- relationType: userInfo.relationType,
|
|
|
- courseInfo: this.detailList,
|
|
|
- recomUserId: ''
|
|
|
- }
|
|
|
- ]
|
|
|
- await onSubmitZero(() => {
|
|
|
- Dialog.alert({
|
|
|
- message: '领取成功',
|
|
|
- confirmButtonText: '确定',
|
|
|
- confirmButtonColor: '#2dc7aa'
|
|
|
- }).then(() => {
|
|
|
- this.__init()
|
|
|
- })
|
|
|
- })
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- )
|
|
|
- }}
|
|
|
- />
|
|
|
- {/* </Sticky> */}
|
|
|
- <Cell
|
|
|
- border={false}
|
|
|
- class={styles.cell}
|
|
|
- title={this.title}
|
|
|
- titleClass={[styles.titleInfo, 'van-ellipsis']}
|
|
|
- v-slots={{
|
|
|
- icon: () => (
|
|
|
- <Icon
|
|
|
- name="video"
|
|
|
- size={18}
|
|
|
- color="var(--van-primary)"
|
|
|
- style={{ display: 'flex', alignItems: 'center' }}
|
|
|
- />
|
|
|
- ),
|
|
|
- value: () => (
|
|
|
- <div class={styles.label}>
|
|
|
- <span>{this.currentClassIndex}</span>/{this.detailList.length}
|
|
|
- 课时
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- ></Cell>
|
|
|
- <div class={styles.videoDesc}>{this.videoContent}</div>
|
|
|
+ <div style="overflow: hidden">
|
|
|
+ <Cell
|
|
|
+ border={false}
|
|
|
+ class={styles.cell}
|
|
|
+ title={this.title}
|
|
|
+ titleClass={[styles.titleInfo, 'van-ellipsis']}
|
|
|
+ v-slots={{
|
|
|
+ icon: () => (
|
|
|
+ <Icon
|
|
|
+ name="video"
|
|
|
+ size={18}
|
|
|
+ color="var(--van-primary)"
|
|
|
+ style={{ display: 'flex', alignItems: 'center' }}
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ value: () => (
|
|
|
+ <div class={styles.label}>
|
|
|
+ <span>{this.currentClassIndex}</span>/
|
|
|
+ {this.detailList.length}
|
|
|
+ 课时
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ ></Cell>
|
|
|
+ <div class={styles.videoDesc}>{this.videoContent}</div>
|
|
|
+ </div>
|
|
|
+ </ColSticky>
|
|
|
|
|
|
<Tabs
|
|
|
v-model:active={this.tabIndex}
|
|
@@ -343,10 +355,16 @@ export default defineComponent({
|
|
|
<div
|
|
|
style={{
|
|
|
// height: `calc(100vh - 320px - ${this.navHeight}px)`,
|
|
|
+ height:
|
|
|
+ 'calc(100vh - var(--van-tabs-line-height) - var(--header-height))',
|
|
|
overflowY: 'auto'
|
|
|
}}
|
|
|
>
|
|
|
- <SectionDetail title="课程列表" icon="courseList" border>
|
|
|
+ <SectionDetail
|
|
|
+ title="课程列表"
|
|
|
+ icon="courseList"
|
|
|
+ style={{ marginBottom: '12px' }}
|
|
|
+ >
|
|
|
{this.detailList.map((item: any, index: number) => {
|
|
|
const musicAlbumInfos = item.musicAlbumInfos || []
|
|
|
const temp = musicAlbumInfos.map((info: any) => {
|
|
@@ -400,6 +418,7 @@ export default defineComponent({
|
|
|
style={{
|
|
|
// height: `calc(100vh - 380px - ${this.navHeight}px)`,
|
|
|
overflowY: 'auto',
|
|
|
+ height: `calc(100vh - var(--van-tabs-line-height) - var(--header-height) - (var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height)))`,
|
|
|
marginBottom:
|
|
|
'calc(var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height))'
|
|
|
}}
|