|
@@ -3,7 +3,7 @@ import SectionDetail from '@/business-components/section-detail'
|
|
|
import UserDetail from '@/business-components/user-detail'
|
|
|
import request from '@/helpers/request'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { Icon, Sticky, Button, Dialog, Toast } from 'vant'
|
|
|
+import { Icon, Sticky, Button, Dialog, Toast, Popup } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './live-detail.module.less'
|
|
|
import iconTips from '@common/images/icon_tips.png'
|
|
@@ -11,6 +11,10 @@ import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import ColHeader from '@/components/col-header'
|
|
|
import { postMessage } from '@/helpers/native-message'
|
|
|
import ColSticky from '@/components/col-sticky'
|
|
|
+import ColShare from '@/components/col-share'
|
|
|
+import LiveItem from '@/views/live-class/live-item'
|
|
|
+import iconShare from '@/views/shop-mall/images/icon-share.svg'
|
|
|
+import { state } from '@/state'
|
|
|
interface IProps {
|
|
|
courseTime: string
|
|
|
coursePlan: string
|
|
@@ -28,28 +32,36 @@ export default defineComponent({
|
|
|
recomUserId: query.recomUserId, // 推荐人id
|
|
|
groupId: query.groupId,
|
|
|
courseId: query.classId,
|
|
|
- live: {} as any
|
|
|
+ live: {} as any,
|
|
|
+ shareStatus: false,
|
|
|
+ shareUrl: '',
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
userInfo() {
|
|
|
const live = this.live as any
|
|
|
+ console.log('live', live)
|
|
|
const planList = live.planList || []
|
|
|
const startTime = planList[0]?.startTime || new Date()
|
|
|
const endTime = planList[0]?.endTime || new Date()
|
|
|
return {
|
|
|
+ avatar: live.avatar,
|
|
|
headUrl: live.avatar,
|
|
|
username: live.userName || `游客${live.teacherId || ''}`,
|
|
|
+ id: live.teacherId,
|
|
|
startTime:
|
|
|
`${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
|
|
|
'HH:mm'
|
|
|
)}~${dayjs(endTime).format('HH:mm')}` || '',
|
|
|
buyNum: live.studentCount,
|
|
|
+ lessonId: live.courseGroupId,
|
|
|
lessonPrice: live.coursePrice,
|
|
|
lessonNum: live.courseNum,
|
|
|
lessonDesc: live.courseIntroduce,
|
|
|
lessonCoverUrl: live.backgroundPic || live.backgroundPicTemplate,
|
|
|
lessonName: live.courseGroupName,
|
|
|
+ subjectName: live.subjectName,
|
|
|
+ courseStartTime: live.courseStartTime,
|
|
|
auditVersion: live.auditVersion || 0,
|
|
|
isDegree: live.degreeFlag ? true : false,
|
|
|
isTeacher: live.teacherFlag ? true : false
|
|
@@ -96,6 +108,11 @@ export default defineComponent({
|
|
|
},
|
|
|
async mounted() {
|
|
|
await this._init()
|
|
|
+ if (/(localhost|192)/g.test(location.origin)) {
|
|
|
+ this.shareUrl = `https://dev.colexiu.com/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}`
|
|
|
+ } else {
|
|
|
+ this.shareUrl = `${location.origin}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}`
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
async _init() {
|
|
@@ -246,7 +263,11 @@ export default defineComponent({
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={[styles['live-detail'], 'mb12']}>
|
|
|
- <ColHeader />
|
|
|
+ <ColHeader v-slots={{
|
|
|
+ right: () => (
|
|
|
+ <img src={iconShare} onClick={() => this.shareStatus = true} />
|
|
|
+ )
|
|
|
+ }} />
|
|
|
<UserDetail userInfo={this.userInfo} showBuy={false} />
|
|
|
<SectionDetail border>
|
|
|
<p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
|
|
@@ -314,6 +335,35 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</ColSticky>
|
|
|
)}
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ v-model:show={this.shareStatus}
|
|
|
+ style={{ background: 'transparent' }}
|
|
|
+ >
|
|
|
+ <ColShare
|
|
|
+ teacherId={this.userInfo.id}
|
|
|
+ shareUrl={this.shareUrl}
|
|
|
+ shareType="live"
|
|
|
+ >
|
|
|
+ <LiveItem
|
|
|
+ class={styles.shareCourse}
|
|
|
+ liveInfo={{
|
|
|
+ backgroundPic: this.userInfo.lessonCoverUrl,
|
|
|
+ courseGroupId: this.userInfo.lessonId,
|
|
|
+ courseGroupName: this.userInfo.lessonName,
|
|
|
+ courseNum: this.userInfo.lessonNum,
|
|
|
+ coursePrice: this.userInfo.lessonPrice,
|
|
|
+ teacherName: this.userInfo.username,
|
|
|
+ teacherId: this.userInfo.id,
|
|
|
+ avatar: this.userInfo.avatar,
|
|
|
+ studentCount: this.userInfo.buyNum,
|
|
|
+ courseStartTime: this.userInfo.courseStartTime,
|
|
|
+ existBuy: 0,
|
|
|
+ subjectName: this.userInfo.subjectName
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </ColShare>
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
)
|
|
|
}
|