|  | @@ -3,7 +3,7 @@ import SectionDetail from '@/business-components/section-detail'
 | 
											
												
													
														|  |  import UserDetail from '@/business-components/user-detail'
 |  |  import UserDetail from '@/business-components/user-detail'
 | 
											
												
													
														|  |  import request from '@/helpers/request'
 |  |  import request from '@/helpers/request'
 | 
											
												
													
														|  |  import dayjs from 'dayjs'
 |  |  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 { defineComponent } from 'vue'
 | 
											
												
													
														|  |  import styles from './live-detail.module.less'
 |  |  import styles from './live-detail.module.less'
 | 
											
												
													
														|  |  import iconTips from '@common/images/icon_tips.png'
 |  |  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 ColHeader from '@/components/col-header'
 | 
											
												
													
														|  |  import { postMessage } from '@/helpers/native-message'
 |  |  import { postMessage } from '@/helpers/native-message'
 | 
											
												
													
														|  |  import ColSticky from '@/components/col-sticky'
 |  |  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 {
 |  |  interface IProps {
 | 
											
												
													
														|  |    courseTime: string
 |  |    courseTime: string
 | 
											
												
													
														|  |    coursePlan: string
 |  |    coursePlan: string
 | 
											
										
											
												
													
														|  | @@ -28,28 +32,36 @@ export default defineComponent({
 | 
											
												
													
														|  |        recomUserId: query.recomUserId, // 推荐人id
 |  |        recomUserId: query.recomUserId, // 推荐人id
 | 
											
												
													
														|  |        groupId: query.groupId,
 |  |        groupId: query.groupId,
 | 
											
												
													
														|  |        courseId: query.classId,
 |  |        courseId: query.classId,
 | 
											
												
													
														|  | -      live: {} as any
 |  | 
 | 
											
												
													
														|  | 
 |  | +      live: {} as any,
 | 
											
												
													
														|  | 
 |  | +      shareStatus: false,
 | 
											
												
													
														|  | 
 |  | +      shareUrl: '',
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    computed: {
 |  |    computed: {
 | 
											
												
													
														|  |      userInfo() {
 |  |      userInfo() {
 | 
											
												
													
														|  |        const live = this.live as any
 |  |        const live = this.live as any
 | 
											
												
													
														|  | 
 |  | +      console.log('live', live)
 | 
											
												
													
														|  |        const planList = live.planList || []
 |  |        const planList = live.planList || []
 | 
											
												
													
														|  |        const startTime = planList[0]?.startTime || new Date()
 |  |        const startTime = planList[0]?.startTime || new Date()
 | 
											
												
													
														|  |        const endTime = planList[0]?.endTime || new Date()
 |  |        const endTime = planList[0]?.endTime || new Date()
 | 
											
												
													
														|  |        return {
 |  |        return {
 | 
											
												
													
														|  | 
 |  | +        avatar: live.avatar,
 | 
											
												
													
														|  |          headUrl: live.avatar,
 |  |          headUrl: live.avatar,
 | 
											
												
													
														|  |          username: live.userName || `游客${live.teacherId || ''}`,
 |  |          username: live.userName || `游客${live.teacherId || ''}`,
 | 
											
												
													
														|  | 
 |  | +        id: live.teacherId,
 | 
											
												
													
														|  |          startTime:
 |  |          startTime:
 | 
											
												
													
														|  |            `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
 |  |            `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
 | 
											
												
													
														|  |              'HH:mm'
 |  |              'HH:mm'
 | 
											
												
													
														|  |            )}~${dayjs(endTime).format('HH:mm')}` || '',
 |  |            )}~${dayjs(endTime).format('HH:mm')}` || '',
 | 
											
												
													
														|  |          buyNum: live.studentCount,
 |  |          buyNum: live.studentCount,
 | 
											
												
													
														|  | 
 |  | +        lessonId: live.courseGroupId,
 | 
											
												
													
														|  |          lessonPrice: live.coursePrice,
 |  |          lessonPrice: live.coursePrice,
 | 
											
												
													
														|  |          lessonNum: live.courseNum,
 |  |          lessonNum: live.courseNum,
 | 
											
												
													
														|  |          lessonDesc: live.courseIntroduce,
 |  |          lessonDesc: live.courseIntroduce,
 | 
											
												
													
														|  |          lessonCoverUrl: live.backgroundPic || live.backgroundPicTemplate,
 |  |          lessonCoverUrl: live.backgroundPic || live.backgroundPicTemplate,
 | 
											
												
													
														|  |          lessonName: live.courseGroupName,
 |  |          lessonName: live.courseGroupName,
 | 
											
												
													
														|  | 
 |  | +        subjectName: live.subjectName,
 | 
											
												
													
														|  | 
 |  | +        courseStartTime: live.courseStartTime,
 | 
											
												
													
														|  |          auditVersion: live.auditVersion || 0,
 |  |          auditVersion: live.auditVersion || 0,
 | 
											
												
													
														|  |          isDegree: live.degreeFlag ? true : false,
 |  |          isDegree: live.degreeFlag ? true : false,
 | 
											
												
													
														|  |          isTeacher: live.teacherFlag ? true : false
 |  |          isTeacher: live.teacherFlag ? true : false
 | 
											
										
											
												
													
														|  | @@ -96,6 +108,11 @@ export default defineComponent({
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    async mounted() {
 |  |    async mounted() {
 | 
											
												
													
														|  |      await this._init()
 |  |      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: {
 |  |    methods: {
 | 
											
												
													
														|  |      async _init() {
 |  |      async _init() {
 | 
											
										
											
												
													
														|  | @@ -246,7 +263,11 @@ export default defineComponent({
 | 
											
												
													
														|  |    render() {
 |  |    render() {
 | 
											
												
													
														|  |      return (
 |  |      return (
 | 
											
												
													
														|  |        <div class={[styles['live-detail'], 'mb12']}>
 |  |        <div class={[styles['live-detail'], 'mb12']}>
 | 
											
												
													
														|  | -        <ColHeader />
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <ColHeader v-slots={{
 | 
											
												
													
														|  | 
 |  | +          right: () => (
 | 
											
												
													
														|  | 
 |  | +            <img src={iconShare} onClick={() => this.shareStatus = true} />
 | 
											
												
													
														|  | 
 |  | +          )
 | 
											
												
													
														|  | 
 |  | +        }} />
 | 
											
												
													
														|  |          <UserDetail userInfo={this.userInfo} showBuy={false} />
 |  |          <UserDetail userInfo={this.userInfo} showBuy={false} />
 | 
											
												
													
														|  |          <SectionDetail border>
 |  |          <SectionDetail border>
 | 
											
												
													
														|  |            <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
 |  |            <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
 | 
											
										
											
												
													
														|  | @@ -314,6 +335,35 @@ export default defineComponent({
 | 
											
												
													
														|  |              </div>
 |  |              </div>
 | 
											
												
													
														|  |            </ColSticky>
 |  |            </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>
 |  |        </div>
 | 
											
												
													
														|  |      )
 |  |      )
 | 
											
												
													
														|  |    }
 |  |    }
 |