mo 2 years ago
parent
commit
7daa94cabf

+ 145 - 140
src/business-components/user-detail/index.tsx

@@ -1,140 +1,145 @@
-import { Cell, CellGroup, Icon, Image, Tag } from 'vant'
-import { defineComponent, PropType } from 'vue'
-import styles from './index.module.less'
-
-import iconUserNum from '@common/images/icon_user_num.png'
-import defaultIcon from '@common/images/icon_teacher.png'
-import iconTimer from '@common/images/icon_timer2.png'
-
-/**
- * @description: 视频详情
- * @param {type} headUrl 头像
- * @param {type} username 姓名
- * @param {type} startTime 开始时间
- * @param {type} buyNum 购买用户数
- * @param {type} lessonPrice 价格
- * @param {type} lessonCoverUrl 视频封面
- * @param {type} lessonDesc 课程描述
- * @param {type} lessonNum 课程数
- * @param {type} lessonName 课程名称
- */
-interface UserType {
-  headUrl: string
-  username: string
-  startTime?: string
-  id?: number
-  buyNum?: number
-  lessonPrice: number
-  lessonNum?: number
-  lessonDesc?: string
-  lessonCoverUrl: string
-  lessonName: string
-}
-
-export default defineComponent({
-  name: 'user-detail',
-  props: {
-    userInfo: {
-      type: Object as PropType<UserType>,
-      required: true
-    },
-    showType: {
-      type: String as PropType<'BUY' | 'TIME'>,
-      default: 'BUY'
-    },
-    showBuy: {
-      type: Boolean,
-      default: true
-    },
-    border: {
-      type: Boolean,
-      default: false
-    }
-  },
-  render() {
-    return (
-      <div class={styles.userDetail}>
-        <Image
-          class={[styles.banner]}
-          src={this.userInfo.lessonCoverUrl}
-          fit="cover"
-        />
-        <CellGroup class={styles.userInfo} border={this.border}>
-          <Cell
-            title={this.userInfo.lessonName}
-            titleClass={styles.userTitle}
-            v-slots={{
-              label: () =>
-                this.userInfo.startTime && (
-                  <span
-                    style={{
-                      display: 'flex',
-                      alignItems: 'center',
-                      fontSize: '13px',
-                      paddingTop: 'var(--van-cell-label-margin-top)'
-                    }}
-                  >
-                    <Icon
-                      name={iconTimer}
-                      size="16"
-                      style={{ marginRight: '5px' }}
-                    />
-                    开课时间:
-                    {this.userInfo.startTime}
-                  </span>
-                )
-            }}
-          />
-          <Cell
-            v-slots={{
-              icon: () => (
-                <Image
-                  class={styles.avatar}
-                  src={this.userInfo.headUrl || defaultIcon}
-                  fit="cover"
-                />
-              ),
-              title: () => (
-                <div class={styles.name}>
-                  <div class={styles.username}>
-                    {this.userInfo.username || `游客${this.userInfo.id || ''}`}
-                  </div>
-                  {this.showType === 'TIME' ? (
-                    <Tag
-                      style={{ marginLeft: '8px' }}
-                      color="#FFF1DE"
-                      textColor="#FF9300"
-                    >
-                      {this.userInfo.lessonNum}课时
-                    </Tag>
-                  ) : (
-                    this.showBuy && (
-                      <div class={styles.buyNum}>
-                        {this.userInfo.buyNum}人已购买
-                      </div>
-                    )
-                  )}
-                </div>
-              ),
-              value: () =>
-                this.showType === 'TIME' ? (
-                  <div class={styles.buyNumInfo}>
-                    <Icon name={iconUserNum} size={14} class={styles.iconBuy} />{' '}
-                    已购 {this.userInfo.buyNum} 人
-                  </div>
-                ) : (
-                  <div class={styles.info}>
-                    {/* 0元不显示,为了处理ios审核问题 */}
-                    {this.userInfo.lessonPrice > 0 && (
-                      <>¥{this.userInfo.lessonPrice}/</>
-                    )}
-                    {this.userInfo.lessonNum}课时
-                  </div>
-                )
-            }}
-          ></Cell>
-        </CellGroup>
-      </div>
-    )
-  }
-})
+import { Cell, CellGroup, Icon, Image, Tag } from 'vant'
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+
+import iconUserNum from '@common/images/icon_user_num.png'
+import defaultIcon from '@common/images/icon_teacher.png'
+import iconTimer from '@common/images/icon_timer2.png'
+
+/**
+ * @description: 视频详情
+ * @param {type} headUrl 头像
+ * @param {type} username 姓名
+ * @param {type} startTime 开始时间
+ * @param {type} buyNum 购买用户数
+ * @param {type} lessonPrice 价格
+ * @param {type} lessonCoverUrl 视频封面
+ * @param {type} lessonDesc 课程描述
+ * @param {type} lessonNum 课程数
+ * @param {type} lessonName 课程名称
+ */
+interface UserType {
+  headUrl: string
+  username: string
+  startTime?: string
+  id?: number
+  buyNum?: number
+  lessonPrice: number
+  lessonNum?: number
+  lessonDesc?: string
+  lessonCoverUrl: string
+  lessonName: string
+  auditVersion: number
+}
+
+export default defineComponent({
+  name: 'user-detail',
+  props: {
+    userInfo: {
+      type: Object as PropType<UserType>,
+      required: true
+    },
+    showType: {
+      type: String as PropType<'BUY' | 'TIME'>,
+      default: 'BUY'
+    },
+    showBuy: {
+      type: Boolean,
+      default: true
+    },
+    border: {
+      type: Boolean,
+      default: false
+    }
+  },
+  render() {
+    return (
+      <div class={styles.userDetail}>
+        <Image
+          class={[styles.banner]}
+          src={this.userInfo.lessonCoverUrl}
+          fit="cover"
+        />
+        <CellGroup class={styles.userInfo} border={this.border}>
+          <Cell
+            title={this.userInfo.lessonName}
+            titleClass={styles.userTitle}
+            v-slots={{
+              label: () =>
+                this.userInfo.startTime && (
+                  <span
+                    style={{
+                      display: 'flex',
+                      alignItems: 'center',
+                      fontSize: '13px',
+                      paddingTop: 'var(--van-cell-label-margin-top)'
+                    }}
+                  >
+                    <Icon
+                      name={iconTimer}
+                      size="16"
+                      style={{ marginRight: '5px' }}
+                    />
+                    开课时间:
+                    {this.userInfo.startTime}
+                  </span>
+                )
+            }}
+          />
+          <Cell
+            v-slots={{
+              icon: () => (
+                <Image
+                  class={styles.avatar}
+                  src={this.userInfo.headUrl || defaultIcon}
+                  fit="cover"
+                />
+              ),
+              title: () => (
+                <div class={styles.name}>
+                  <div class={styles.username}>
+                    {this.userInfo.username || `游客${this.userInfo.id || ''}`}
+                  </div>
+                  {this.showType === 'TIME' ? (
+                    <Tag
+                      style={{ marginLeft: '8px' }}
+                      color="#FFF1DE"
+                      textColor="#FF9300"
+                    >
+                      {this.userInfo.lessonNum}课时
+                    </Tag>
+                  ) : (
+                    this.showBuy && (
+                      <div class={styles.buyNum}>
+                        {this.userInfo.buyNum}人已购买
+                      </div>
+                    )
+                  )}
+                </div>
+              ),
+              value: () =>
+                this.showType === 'TIME' ? (
+                  <div class={styles.buyNumInfo}>
+                    <Icon name={iconUserNum} size={14} class={styles.iconBuy} />{' '}
+                    已购 {this.userInfo.buyNum} 人
+                  </div>
+                ) : (
+                  <div class={styles.info}>
+                    {/* 0元不显示,为了处理ios审核问题 */}
+                    {this.userInfo.lessonPrice > 0 && (
+                      <>¥{this.userInfo.lessonPrice}/</>
+                    )}
+                    {this.userInfo.lessonPrice <= 0 &&
+                      this.userInfo.auditVersion && <>¥{0}/</>}
+                    {this.userInfo.lessonPrice <= 0 &&
+                      !this.userInfo.auditVersion && <>免费/</>}
+                    {this.userInfo.lessonNum}课时
+                  </div>
+                )
+            }}
+          ></Cell>
+        </CellGroup>
+      </div>
+    )
+  }
+})

+ 69 - 67
src/student/video-class/video-item.tsx

@@ -1,67 +1,69 @@
-import { defineComponent, PropType } from 'vue'
-import { Image } from 'vant'
-import styles from './video-item.module.less'
-
-import iconTeacher from '@common/images/icon_teacher.png'
-
-interface VideoItemProps {
-  id?: number
-  teacherId?: number
-  lessonName: string
-  userName: string
-  avatar: string
-  lessonCoverUrl: string
-  lessonCount: number
-  lessonPrice: number
-  countStudent: number
-  lessonSubjectName: string
-}
-
-export default defineComponent({
-  name: 'VideoItem',
-  props: {
-    item: Object as PropType<VideoItemProps>,
-    onClick: {
-      type: Function as PropType<(item: any) => void>,
-      default: (item: any) => {}
-    }
-  },
-  render() {
-    const item: any = this.item
-    return (
-      <div
-        class={styles.videoItem}
-        onClick={() => {
-          this.onClick(item)
-        }}
-      >
-        <div style={{ position: 'relative' }}>
-          <Image
-            class={styles.viCover}
-            fit="cover"
-            src={item?.lessonCoverUrl}
-          />
-          <span class={styles.subjectName}>{item?.lessonSubjectName}</span>
-        </div>
-
-        <div class={styles.viSection}>
-          <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
-          <div class={styles.viUserInfo}>
-            <Image
-              src={item?.avatar || iconTeacher}
-              class={styles.viUserLogo}
-            />
-            <span class={[styles.viUserName, 'van-hairline--right']}>
-              {item?.userName || `游客${item?.teacherId || ''}`}
-            </span>
-            <span class={styles.viUserNum}>{item?.countStudent}人已购买</span>
-          </div>
-          <div class={styles.viPrice}>
-            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
-            {item?.lessonCount}课时
-          </div>
-        </div>
-      </div>
-    )
-  }
-})
+import { defineComponent, PropType } from 'vue'
+import { Image } from 'vant'
+import styles from './video-item.module.less'
+
+import iconTeacher from '@common/images/icon_teacher.png'
+
+interface VideoItemProps {
+  id?: number
+  teacherId?: number
+  lessonName: string
+  userName: string
+  avatar: string
+  lessonCoverUrl: string
+  lessonCount: number
+  lessonPrice: number
+  countStudent: number
+  lessonSubjectName: string
+}
+
+export default defineComponent({
+  name: 'VideoItem',
+  props: {
+    item: Object as PropType<VideoItemProps>,
+    onClick: {
+      type: Function as PropType<(item: any) => void>,
+      default: (item: any) => {}
+    }
+  },
+  render() {
+    const item: any = this.item
+    return (
+      <div
+        class={styles.videoItem}
+        onClick={() => {
+          this.onClick(item)
+        }}
+      >
+        <div style={{ position: 'relative' }}>
+          <Image
+            class={styles.viCover}
+            fit="cover"
+            src={item?.lessonCoverUrl}
+          />
+          <span class={styles.subjectName}>{item?.lessonSubjectName}</span>
+        </div>
+
+        <div class={styles.viSection}>
+          <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
+          <div class={styles.viUserInfo}>
+            <Image
+              src={item?.avatar || iconTeacher}
+              class={styles.viUserLogo}
+            />
+            <span class={[styles.viUserName, 'van-hairline--right']}>
+              {item?.userName || `游客${item?.teacherId || ''}`}
+            </span>
+            <span class={styles.viUserNum}>{item?.countStudent}人已购买</span>
+          </div>
+          <div class={styles.viPrice}>
+            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
+            {item?.lessonPrice <= 0 &&item?.auditVersion &&<>¥{0}/</>}
+            {item?.lessonPrice <= 0 &&!item?.auditVersion &&<>免费/</>}
+            {item?.lessonCount}课时
+          </div>
+        </div>
+      </div>
+    )
+  }
+})

+ 240 - 239
src/teacher/video-class/video-detail.tsx

@@ -1,239 +1,240 @@
-import CourseVideoItem from '@/business-components/course-video-item'
-import SectionDetail from '@/business-components/section-detail'
-import UserDetail from '@/business-components/user-detail'
-import UserList from '@/business-components/user-list'
-import { Button, List, Popup, Sticky, Tab, Tabs, Toast } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './video-detail.module.less'
-import request from '@/helpers/request'
-import ColResult from '@/components/col-result'
-import ColShare from '@/components/col-share'
-import ColSticky from '@/components/col-sticky'
-import LiveItem from '@/views/live-class/live-item'
-import { state } from '@/state'
-export default defineComponent({
-  name: 'VideoDetail',
-  data() {
-    const query = this.$route.query
-    return {
-      userInfo: {} as any,
-      detailList: [],
-      buyUserList: [], // 购买学生数
-      dataShow: true, // 判断是否有数据
-      loading: false,
-      finished: false,
-      share: query.share,
-      params: {
-        videoLessonGroupId: query.groupId,
-        page: 1,
-        rows: 20
-      },
-      shareStatus: false,
-      shareUrl: '',
-      shelvesFlag: 0,
-      myself: false
-    }
-  },
-  async mounted() {
-    try {
-      const res = await request.get(
-        '/api-teacher/videoLessonGroup/selectVideoLesson',
-        {
-          params: {
-            groupId: this.params.videoLessonGroupId
-          }
-        }
-      )
-      const result = res.data || {}
-      if (state.platformType === 'TEACHER') {
-        this.myself = !result.myself
-      }
-      this.userInfo = {
-        id: result.lessonGroup.teacherId,
-        username: result.lessonGroup.username,
-        headUrl: result.lessonGroup.avatar,
-        buyNum: result.lessonGroup.countStudent,
-        lessonId: result.lessonGroup.id,
-        lessonNum: result.lessonGroup.lessonCount,
-        lessonName: result.lessonGroup.lessonName,
-        lessonDesc: result.lessonGroup.lessonDesc,
-        lessonPrice: result.lessonGroup.lessonPrice,
-        lessonCoverUrl: result.lessonGroup.lessonCoverUrl,
-        lessonSubjectName: result.lessonGroup.lessonSubjectName
-      }
-
-      this.shelvesFlag = result.lessonGroup.shelvesFlag
-      this.detailList = result.detailList || []
-
-      // shareVideo?recomUserId=56&groupId=124
-      this.shareUrl = `${location.origin}/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.videoLessonGroupId}`
-
-      this.getList()
-    } catch (e) {
-      console.log(e)
-    }
-  },
-  methods: {
-    async getList() {
-      try {
-        const params = this.params
-        const res = await request.post('/api-teacher/videoLesson/pageStudent', {
-          data: {
-            ...params
-          }
-        })
-        this.loading = false
-        const result = res.data || {}
-        // 处理重复请求数据
-        if (this.buyUserList.length > 0 && result.pageNo === 1) {
-          return
-        }
-        this.buyUserList = this.buyUserList.concat(result.rows || [])
-        this.finished = result.pageNo >= result.totalPage
-        this.params.page = result.pageNo + 1
-        this.dataShow = this.buyUserList.length > 0
-      } catch {
-        this.dataShow = false
-        this.finished = true
-      }
-    },
-    onPlay(detail: any) {
-      this.$router.push({
-        path: '/videoClassDetail',
-        query: {
-          groupId: this.params.videoLessonGroupId,
-          classId: detail.id
-        }
-      })
-    }
-  },
-  render() {
-    return (
-      <div class={[styles['video-detail'], 'mb12']}>
-        {this.userInfo.id && <UserDetail userInfo={this.userInfo} />}
-        <SectionDetail border>
-          <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
-        </SectionDetail>
-
-        {this.myself ? (
-          <SectionDetail title="课程列表" icon="courseList" border={true}>
-            {this.detailList.map((item: any) => (
-              <CourseVideoItem
-                class={'mb12'}
-                detail={{
-                  id: item.id,
-                  title: item.videoTitle,
-                  content: item.videoContent,
-                  imgUrl: item.coverUrl
-                }}
-                onPlay={this.onPlay}
-              />
-            ))}
-          </SectionDetail>
-        ) : (
-          <SectionDetail
-            title="课程列表"
-            icon="courseList"
-            titleShow={false}
-            contentStyle={{ paddingTop: '0' }}
-          >
-            <Tabs color="var(--van-primary)" lineWidth={20} sticky>
-              <Tab title="课程" titleClass="van-hairline--bottom">
-                {this.detailList.map((item: any) => (
-                  <CourseVideoItem
-                    class={'mb12'}
-                    detail={{
-                      id: item.id,
-                      title: item.videoTitle,
-                      content: item.videoContent,
-                      imgUrl: item.coverUrl
-                    }}
-                    onPlay={this.onPlay}
-                  />
-                ))}
-              </Tab>
-              <Tab title="学员列表" titleClass="van-hairline--bottom">
-                {this.dataShow ? (
-                  <List
-                    v-model:loading={this.loading}
-                    finished={this.finished}
-                    finishedText="没有更多了"
-                    onLoad={this.getList}
-                  >
-                    {this.buyUserList.map((item: any) => (
-                      <UserList
-                        class="mb12"
-                        users={{
-                          avatar: item.avatar,
-                          studentId: item.userId,
-                          studentName: item.username,
-                          createTime: item.createTime
-                        }}
-                      />
-                    ))}
-                  </List>
-                ) : (
-                  <ColResult
-                    btnStatus={false}
-                    classImgSize="SMALL"
-                    tips="暂无学生购买"
-                  />
-                )}
-              </Tab>
-            </Tabs>
-          </SectionDetail>
-        )}
-
-        {this.shelvesFlag !== 1 && (
-          <>
-            {this.share == '1' && this.detailList.length > 0 && (
-              <ColSticky position="bottom">
-                <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
-                  <Button
-                    block
-                    round
-                    type="primary"
-                    onClick={() => {
-                      this.shareStatus = true
-                    }}
-                  >
-                    分享课程
-                  </Button>
-                </div>
-              </ColSticky>
-            )}
-          </>
-        )}
-
-        <Popup
-          v-model:show={this.shareStatus}
-          style={{ background: 'transparent' }}
-        >
-          <ColShare
-            teacherId={this.userInfo.id}
-            shareUrl={this.shareUrl}
-            shareType="video"
-          >
-            <LiveItem
-              class={styles.shareCourse}
-              coverClass={styles.coverClass}
-              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.headUrl,
-                studentCount: this.userInfo.buyNum,
-                existBuy: 0,
-                subjectName: this.userInfo.lessonSubjectName
-              }}
-            />
-          </ColShare>
-        </Popup>
-      </div>
-    )
-  }
-})
+import CourseVideoItem from '@/business-components/course-video-item'
+import SectionDetail from '@/business-components/section-detail'
+import UserDetail from '@/business-components/user-detail'
+import UserList from '@/business-components/user-list'
+import { Button, List, Popup, Sticky, Tab, Tabs, Toast } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './video-detail.module.less'
+import request from '@/helpers/request'
+import ColResult from '@/components/col-result'
+import ColShare from '@/components/col-share'
+import ColSticky from '@/components/col-sticky'
+import LiveItem from '@/views/live-class/live-item'
+import { state } from '@/state'
+export default defineComponent({
+  name: 'VideoDetail',
+  data() {
+    const query = this.$route.query
+    return {
+      userInfo: {} as any,
+      detailList: [],
+      buyUserList: [], // 购买学生数
+      dataShow: true, // 判断是否有数据
+      loading: false,
+      finished: false,
+      share: query.share,
+      params: {
+        videoLessonGroupId: query.groupId,
+        page: 1,
+        rows: 20
+      },
+      shareStatus: false,
+      shareUrl: '',
+      shelvesFlag: 0,
+      myself: false
+    }
+  },
+  async mounted() {
+    try {
+      const res = await request.get(
+        '/api-teacher/videoLessonGroup/selectVideoLesson',
+        {
+          params: {
+            groupId: this.params.videoLessonGroupId
+          }
+        }
+      )
+      const result = res.data || {}
+      if (state.platformType === 'TEACHER') {
+        this.myself = !result.myself
+      }
+      this.userInfo = {
+        id: result.lessonGroup.teacherId,
+        username: result.lessonGroup.username,
+        headUrl: result.lessonGroup.avatar,
+        buyNum: result.lessonGroup.countStudent,
+        lessonId: result.lessonGroup.id,
+        lessonNum: result.lessonGroup.lessonCount,
+        lessonName: result.lessonGroup.lessonName,
+        lessonDesc: result.lessonGroup.lessonDesc,
+        lessonPrice: result.lessonGroup.lessonPrice,
+        lessonCoverUrl: result.lessonGroup.lessonCoverUrl,
+        lessonSubjectName: result.lessonGroup.lessonSubjectName,
+        auditVersion:result.lessonGroup.auditVersion
+      }
+
+      this.shelvesFlag = result.lessonGroup.shelvesFlag
+      this.detailList = result.detailList || []
+
+      // shareVideo?recomUserId=56&groupId=124
+      this.shareUrl = `${location.origin}/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.videoLessonGroupId}`
+
+      this.getList()
+    } catch (e) {
+      console.log(e)
+    }
+  },
+  methods: {
+    async getList() {
+      try {
+        const params = this.params
+        const res = await request.post('/api-teacher/videoLesson/pageStudent', {
+          data: {
+            ...params
+          }
+        })
+        this.loading = false
+        const result = res.data || {}
+        // 处理重复请求数据
+        if (this.buyUserList.length > 0 && result.pageNo === 1) {
+          return
+        }
+        this.buyUserList = this.buyUserList.concat(result.rows || [])
+        this.finished = result.pageNo >= result.totalPage
+        this.params.page = result.pageNo + 1
+        this.dataShow = this.buyUserList.length > 0
+      } catch {
+        this.dataShow = false
+        this.finished = true
+      }
+    },
+    onPlay(detail: any) {
+      this.$router.push({
+        path: '/videoClassDetail',
+        query: {
+          groupId: this.params.videoLessonGroupId,
+          classId: detail.id
+        }
+      })
+    }
+  },
+  render() {
+    return (
+      <div class={[styles['video-detail'], 'mb12']}>
+        {this.userInfo.id && <UserDetail userInfo={this.userInfo} />}
+        <SectionDetail border>
+          <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
+        </SectionDetail>
+
+        {this.myself ? (
+          <SectionDetail title="课程列表" icon="courseList" border={true}>
+            {this.detailList.map((item: any) => (
+              <CourseVideoItem
+                class={'mb12'}
+                detail={{
+                  id: item.id,
+                  title: item.videoTitle,
+                  content: item.videoContent,
+                  imgUrl: item.coverUrl
+                }}
+                onPlay={this.onPlay}
+              />
+            ))}
+          </SectionDetail>
+        ) : (
+          <SectionDetail
+            title="课程列表"
+            icon="courseList"
+            titleShow={false}
+            contentStyle={{ paddingTop: '0' }}
+          >
+            <Tabs color="var(--van-primary)" lineWidth={20} sticky>
+              <Tab title="课程" titleClass="van-hairline--bottom">
+                {this.detailList.map((item: any) => (
+                  <CourseVideoItem
+                    class={'mb12'}
+                    detail={{
+                      id: item.id,
+                      title: item.videoTitle,
+                      content: item.videoContent,
+                      imgUrl: item.coverUrl
+                    }}
+                    onPlay={this.onPlay}
+                  />
+                ))}
+              </Tab>
+              <Tab title="学员列表" titleClass="van-hairline--bottom">
+                {this.dataShow ? (
+                  <List
+                    v-model:loading={this.loading}
+                    finished={this.finished}
+                    finishedText="没有更多了"
+                    onLoad={this.getList}
+                  >
+                    {this.buyUserList.map((item: any) => (
+                      <UserList
+                        class="mb12"
+                        users={{
+                          avatar: item.avatar,
+                          studentId: item.userId,
+                          studentName: item.username,
+                          createTime: item.createTime
+                        }}
+                      />
+                    ))}
+                  </List>
+                ) : (
+                  <ColResult
+                    btnStatus={false}
+                    classImgSize="SMALL"
+                    tips="暂无学生购买"
+                  />
+                )}
+              </Tab>
+            </Tabs>
+          </SectionDetail>
+        )}
+
+        {this.shelvesFlag !== 1 && (
+          <>
+            {this.share == '1' && this.detailList.length > 0 && (
+              <ColSticky position="bottom">
+                <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
+                  <Button
+                    block
+                    round
+                    type="primary"
+                    onClick={() => {
+                      this.shareStatus = true
+                    }}
+                  >
+                    分享课程
+                  </Button>
+                </div>
+              </ColSticky>
+            )}
+          </>
+        )}
+
+        <Popup
+          v-model:show={this.shareStatus}
+          style={{ background: 'transparent' }}
+        >
+          <ColShare
+            teacherId={this.userInfo.id}
+            shareUrl={this.shareUrl}
+            shareType="video"
+          >
+            <LiveItem
+              class={styles.shareCourse}
+              coverClass={styles.coverClass}
+              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.headUrl,
+                studentCount: this.userInfo.buyNum,
+                existBuy: 0,
+                subjectName: this.userInfo.lessonSubjectName
+              }}
+            />
+          </ColShare>
+        </Popup>
+      </div>
+    )
+  }
+})

+ 71 - 69
src/views/video-class/video-item.tsx

@@ -1,69 +1,71 @@
-import { defineComponent, PropType } from 'vue'
-import { Image } from 'vant'
-import styles from './video-item.module.less'
-
-import iconTeacher from '@common/images/icon_teacher.png'
-
-interface VideoItemProps {
-  id?: number
-  teacherId?: number
-  lessonName: string
-  userName: string
-  avatar: string
-  lessonCoverUrl: string
-  lessonCount: number
-  lessonPrice: number
-  countStudent: number
-  lessonSubjectName: string
-}
-
-export default defineComponent({
-  name: 'VideoItem',
-  props: {
-    item: Object as PropType<VideoItemProps>,
-    onClick: {
-      type: Function as PropType<(item: any) => void>,
-      default: (item: any) => {}
-    }
-  },
-  render() {
-    const item: any = this.item
-    return (
-      <div
-        class={styles.videoItem}
-        onClick={() => {
-          this.onClick(item)
-        }}
-      >
-        <div style={{ position: 'relative' }}>
-          <Image
-            class={styles.viCover}
-            fit="cover"
-            src={item?.lessonCoverUrl}
-          />
-          <span class={styles.subjectName}>{item?.lessonSubjectName}</span>
-        </div>
-
-        <div class={styles.viSection}>
-          <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
-          <div class={styles.viUserInfo}>
-            <Image
-              src={item?.avatar || iconTeacher}
-              class={styles.viUserLogo}
-            />
-            <span class={[styles.viUserName, 'van-hairline--right']}>
-              {item?.userName ||
-                item?.username ||
-                `游客${item?.teacherId || ''}`}
-            </span>
-            <span class={styles.viUserNum}>{item?.countStudent}人已购买</span>
-          </div>
-          <div class={styles.viPrice}>
-            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
-            {item?.lessonCount}课时
-          </div>
-        </div>
-      </div>
-    )
-  }
-})
+import { defineComponent, PropType } from 'vue'
+import { Image } from 'vant'
+import styles from './video-item.module.less'
+
+import iconTeacher from '@common/images/icon_teacher.png'
+
+interface VideoItemProps {
+  id?: number
+  teacherId?: number
+  lessonName: string
+  userName: string
+  avatar: string
+  lessonCoverUrl: string
+  lessonCount: number
+  lessonPrice: number
+  countStudent: number
+  lessonSubjectName: string
+}
+
+export default defineComponent({
+  name: 'VideoItem',
+  props: {
+    item: Object as PropType<VideoItemProps>,
+    onClick: {
+      type: Function as PropType<(item: any) => void>,
+      default: (item: any) => {}
+    }
+  },
+  render() {
+    const item: any = this.item
+    return (
+      <div
+        class={styles.videoItem}
+        onClick={() => {
+          this.onClick(item)
+        }}
+      >
+        <div style={{ position: 'relative' }}>
+          <Image
+            class={styles.viCover}
+            fit="cover"
+            src={item?.lessonCoverUrl}
+          />
+          <span class={styles.subjectName}>{item?.lessonSubjectName}</span>
+        </div>
+
+        <div class={styles.viSection}>
+          <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
+          <div class={styles.viUserInfo}>
+            <Image
+              src={item?.avatar || iconTeacher}
+              class={styles.viUserLogo}
+            />
+            <span class={[styles.viUserName, 'van-hairline--right']}>
+              {item?.userName ||
+                item?.username ||
+                `游客${item?.teacherId || ''}`}
+            </span>
+            <span class={styles.viUserNum}>{item?.countStudent}人已购买</span>
+          </div>
+          <div class={styles.viPrice}>
+            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
+            {item?.lessonPrice <= 0 &&item?.auditVersion &&<>¥{0}/</>}
+            {item?.lessonPrice <= 0 &&!item?.auditVersion &&<>免费/</>}
+            {item?.lessonCount}课时
+          </div>
+        </div>
+      </div>
+    )
+  }
+})