Browse Source

修改头部问题

lex 1 year ago
parent
commit
4122fe8c91

+ 9 - 2
src/student/main.ts

@@ -4,7 +4,11 @@ import dayjs from 'dayjs'
 import 'dayjs/locale/zh-cn'
 import router from '../router/index-student'
 import vueFilter from '@/helpers/vueFilter'
-import { listenerMessage, postMessage, promisefiyPostMessage } from '@/helpers/native-message'
+import {
+  listenerMessage,
+  postMessage,
+  promisefiyPostMessage
+} from '@/helpers/native-message'
 
 import 'normalize.css'
 
@@ -46,7 +50,10 @@ if (browser().isOrchestraStudent) {
   })
 
   // 从缓存里面获取token
-  promisefiyPostMessage({ api: 'getCache', content: { key: 'h5-colexiu-token' } }).then((res: any) => {
+  promisefiyPostMessage({
+    api: 'getCache',
+    content: { key: 'h5-colexiu-token' }
+  }).then((res: any) => {
     const content = res.content
     if (content.value) {
       setAuth(content.value)

+ 2 - 2
src/student/member-center/member-active.tsx

@@ -22,7 +22,7 @@ export default defineComponent({
         const { content } = res as any
         const dpi = content.dpi || 2
         if (content.navHeight) {
-          const navHeight = content.navHeight / dpi``
+          const navHeight = content.navHeight / dpi
           navBarHeight.value = navHeight
         }
       })
@@ -33,7 +33,7 @@ export default defineComponent({
           name="arrow-left"
           class={styles.backIcon}
           style={{
-            top: `calc(${navBarHeight.value}px + 16px)`
+            top: `calc(${navBarHeight.value}px + 12px)`
           }}
         />
 

+ 2 - 0
src/student/share-active/track-review-activity/index.tsx

@@ -23,6 +23,7 @@ import { orderStatus } from '@/views/order-detail/orderStatus'
 import { difficulty } from '@/constant'
 import { state } from '@/state'
 import iconTeacher from '@/common/images/icon_teacher.png'
+import ColHeader from '@/components/col-header'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -361,6 +362,7 @@ export default defineComponent({
           backgroundSize: 'contain'
         }}
       >
+        <ColHeader />
         <img class={styles.bannerImg} src={this.activeInfo.subjectUrl} />
         <div class={styles.reviewContainer}>
           <div class={[styles.section, styles.activeTime]}>

+ 328 - 326
src/student/teacher-dependent/teacher-follow.tsx

@@ -1,326 +1,328 @@
-import { Cell, Dialog, Icon, Image, List, Rate, Sticky, Toast } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './model/teacher-header.module.less'
-import iconTeacher from '@common/images/icon_teacher.png'
-import musicCert from '@common/images/music_cert.png'
-import teacherCert from '@common/images/teacher_cert.png'
-import request from '@/helpers/request'
-import ColResult from '@/components/col-result'
-import { postMessage } from '@/helpers/native-message'
-import ColSearch from '@/components/col-search'
-import IconXueli from '@common/images/icon-xueli.png'
-import IconJiaozi from '@common/images/icon-jiaozi.png'
-import dayjs from 'dayjs'
-export const getAssetsHomeFile = (fileName: string) => {
-  const path = `./images/${fileName}`
-  const modules = import.meta.globEager('./images/*')
-  return modules[path].default
-}
-
-export default defineComponent({
-  name: 'teacher-follow',
-  data() {
-    return {
-      userInfo: {} as any,
-      starGrade: 0,
-      subjectNameList: [],
-      list: [],
-      dataShow: true, // 判断是否有数据
-      loading: false,
-      finished: false,
-      params: {
-        username: '',
-        page: 1,
-        rows: 20
-      }
-    }
-  },
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    getSubjectNameList(subject: string) {
-      const subjectList = subject.split(',')
-      return subjectList || []
-    },
-    onSearch(val: string) {
-      this.params.username = val
-      this.onSort()
-    },
-    onSort() {
-      this.params.page = 1
-      this.list = []
-      this.dataShow = true // 判断是否有数据
-      this.loading = false
-      this.finished = false
-      this.getList()
-    },
-    async getList() {
-      try {
-        const params = this.params
-        const res = await request.post('/api-student/student/queryMyFollow', {
-          data: {
-            ...params
-          }
-        })
-        this.loading = false
-        const result = res.data || {}
-        // 处理重复请求数据
-        if (this.list.length > 0 && result.pageNo === 1) {
-          return
-        }
-        this.list = this.list.concat(result.rows || [])
-        this.finished = result.pageNo >= result.totalPage
-        this.params.page = result.pageNo + 1
-        this.dataShow = this.list.length > 0
-      } catch {
-        this.dataShow = false
-        this.finished = true
-      }
-    },
-    async onUnLike(item: any) {
-      Dialog.confirm({
-        message: '确定取消关注吗?',
-        confirmButtonColor: 'var(--van-primary)'
-      }).then(async () => {
-        try {
-          await request.get('/api-student/teacher/starOrUnStar', {
-            params: {
-              userId: item.userId,
-              starStatus: 0
-            }
-          })
-          Toast('取消关注成功')
-          setTimeout(() => {
-            this.onSort()
-          }, 1000)
-        } catch {}
-      })
-    },
-    // 检验是否有对应徽章
-    checkBadge(type: string, item: any) {
-      // tag : 老师点亮图标
-      // STYLE:个人风采
-      // VIDEO:视频课
-      // LIVE:直播课,
-      // MUSIC:曲目 逗号隔开
-      let status = false
-      switch (type) {
-        case 'STYLE':
-        case 'VIDEO':
-        case 'LIVE':
-        case 'MUSIC':
-          if (item.tag) {
-            status = item.tag.indexOf(type) > -1
-          }
-          break
-        case 'VIP':
-          if (item.membershipStartTime && item.membershipEndTime) {
-            const startTime = dayjs(item.membershipStartTime).valueOf()
-            const endTime = dayjs(item.membershipEndTime).valueOf()
-            const nowTime = dayjs().valueOf()
-            status = nowTime >= startTime && nowTime <= endTime
-          } else {
-            status = false
-          }
-          break
-        case 'DEGREE':
-          status = item.degreeFlag ? true : false
-          break
-        case 'TEACHER':
-          status = item.teacherFlag ? true : false
-          break
-        default:
-          status = false
-          break
-      }
-      return status
-    }
-  },
-  render() {
-    return (
-      <div class={styles.teacherFollow}>
-        <Sticky position="top" offsetTop={0}>
-          <ColSearch onSearch={this.onSearch} />
-        </Sticky>
-        {this.dataShow ? (
-          <List
-            class={styles.liveList}
-            v-model:loading={this.loading}
-            immediateCheck={false}
-            finished={this.finished}
-            finishedText="没有更多了"
-          >
-            {this.list.map((item: any) => (
-              <div
-                class={[styles.headerCount, styles.headerFollow]}
-                onClick={(e: MouseEvent) => {
-                  e.stopPropagation()
-                  sessionStorage.removeItem('teacherHomeTabs')
-                  this.$router.push({
-                    path: '/teacherHome',
-                    query: {
-                      teacherId: item.userId,
-                      tabs: 'single'
-                    }
-                  })
-                }}
-              >
-                <div class={styles.followContainer}>
-                  <div class={styles.teacherContent}>
-                    <div
-                      class={styles.teacherIcon}
-                      onClick={e => {
-                        // 判断是否在直播中
-                        if (item.liveFlag === 1) {
-                          e.stopPropagation()
-                          postMessage({
-                            api: 'joinLiveRoom',
-                            content: {
-                              roomId: item.roomUid,
-                              teacherId: item.userId
-                            }
-                          })
-                        }
-                      }}
-                    >
-                      <Image
-                        class={[
-                          styles.avatar,
-                          this.checkBadge('VIP', item.teacher) &&
-                            styles.avatarActive
-                        ]}
-                        round
-                        src={item.avatar || iconTeacher}
-                        fit="cover"
-                      />
-
-                      {item.liveFlag === 1 ? (
-                        <p class={[styles.liveTag, styles.liveTagFollow]}>
-                          直播中
-                        </p>
-                      ) : (
-                        <Image
-                          class={styles.teacherIconVip}
-                          src={
-                            this.checkBadge('VIP', item.teacher)
-                              ? getAssetsHomeFile('vip_active.png')
-                              : getAssetsHomeFile('vip_default.png')
-                          }
-                        />
-                      )}
-                    </div>
-                  </div>
-
-                  <div>
-                    <div class={styles.teacherInfo}>
-                      <div class={styles.teacherInfoName}>
-                        {item.userName || `游客${item.userId || ''}`}
-                      </div>
-                      {this.checkBadge('DEGREE', item.teacher) && (
-                        <img src={IconXueli} />
-                      )}
-                      {this.checkBadge('TEACHER', item.teacher) && (
-                        <img src={IconJiaozi} />
-                      )}
-                    </div>
-                    <div class={styles.piNameSubject}>
-                      {/* <Image
-                        class={styles.subjectSection}
-                        src={getAssetsHomeFile('icon_subject.png')}
-                        fit="contain"
-                      /> */}
-                      <div class={styles.subjectList}>
-                        {this.getSubjectNameList(item.subjectName).map(
-                          (item: any) => (
-                            <span class={styles.subject}>{item}</span>
-                          )
-                        )}
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <div class={styles.teacherHonor}>
-                  <div>勋章:</div>
-                  <div class={styles.teacherIcons}>
-                    <Image
-                      class={styles.iconOther}
-                      src={
-                        this.checkBadge('STYLE', item.teacher)
-                          ? getAssetsHomeFile('cert_active.png')
-                          : getAssetsHomeFile('cert_default.png')
-                      }
-                    />
-                    <Image
-                      class={styles.iconOther}
-                      src={
-                        this.checkBadge('VIDEO', item.teacher)
-                          ? getAssetsHomeFile('video_active.png')
-                          : getAssetsHomeFile('video_default.png')
-                      }
-                    />
-                    <Image
-                      class={styles.iconOther}
-                      src={
-                        this.checkBadge('LIVE', item.teacher)
-                          ? getAssetsHomeFile('live_active.png')
-                          : getAssetsHomeFile('live_default.png')
-                      }
-                    />
-                    <Image
-                      class={styles.iconOther}
-                      src={
-                        this.checkBadge('MUSIC', item.teacher)
-                          ? getAssetsHomeFile('music_active.png')
-                          : getAssetsHomeFile('music_default.png')
-                      }
-                    />
-                  </div>
-                  <div class={styles.score}>评分: </div>
-                  <div class={styles.level}>
-                    {item.starGrade ? (
-                      <Rate
-                        readonly
-                        modelValue={item.starGrade}
-                        iconPrefix="iconfont"
-                        color="#FFC459"
-                        void-icon="star_default"
-                        icon="star_active"
-                        size={15}
-                      />
-                    ) : (
-                      <span style={{ fontSize: '12px', color: '#999999' }}>
-                        暂无评分
-                      </span>
-                    )}
-                  </div>
-                </div>
-                <div class={[styles['teacher-bottom'], styles.followFans]}>
-                  <div class={styles['teacher-data']}>
-                    <div class={styles['teacher-data_item']}>
-                      粉丝 <span>{item.fansNum || 0}</span>
-                    </div>
-                    <div class={styles['teacher-data_item']}>
-                      已上课时 <span>{item.expTime || 0}</span>
-                    </div>
-                  </div>
-                  <div
-                    class={styles.unlinkeBtn}
-                    onClick={(e: MouseEvent) => {
-                      e.stopPropagation()
-                      this.onUnLike(item)
-                    }}
-                  >
-                    取消关注
-                  </div>
-                </div>
-              </div>
-            ))}
-          </List>
-        ) : (
-          <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无关注" />
-        )}
-      </div>
-    )
-  }
-})
+import { Cell, Dialog, Icon, Image, List, Rate, Sticky, Toast } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './model/teacher-header.module.less'
+import iconTeacher from '@common/images/icon_teacher.png'
+import musicCert from '@common/images/music_cert.png'
+import teacherCert from '@common/images/teacher_cert.png'
+import request from '@/helpers/request'
+import ColResult from '@/components/col-result'
+import { postMessage } from '@/helpers/native-message'
+import ColSearch from '@/components/col-search'
+import IconXueli from '@common/images/icon-xueli.png'
+import IconJiaozi from '@common/images/icon-jiaozi.png'
+import dayjs from 'dayjs'
+import ColHeader from '@/components/col-header'
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `./images/${fileName}`
+  const modules = import.meta.globEager('./images/*')
+  return modules[path].default
+}
+
+export default defineComponent({
+  name: 'teacher-follow',
+  data() {
+    return {
+      userInfo: {} as any,
+      starGrade: 0,
+      subjectNameList: [],
+      list: [],
+      dataShow: true, // 判断是否有数据
+      loading: false,
+      finished: false,
+      params: {
+        username: '',
+        page: 1,
+        rows: 20
+      }
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    getSubjectNameList(subject: string) {
+      const subjectList = subject.split(',')
+      return subjectList || []
+    },
+    onSearch(val: string) {
+      this.params.username = val
+      this.onSort()
+    },
+    onSort() {
+      this.params.page = 1
+      this.list = []
+      this.dataShow = true // 判断是否有数据
+      this.loading = false
+      this.finished = false
+      this.getList()
+    },
+    async getList() {
+      try {
+        const params = this.params
+        const res = await request.post('/api-student/student/queryMyFollow', {
+          data: {
+            ...params
+          }
+        })
+        this.loading = false
+        const result = res.data || {}
+        // 处理重复请求数据
+        if (this.list.length > 0 && result.pageNo === 1) {
+          return
+        }
+        this.list = this.list.concat(result.rows || [])
+        this.finished = result.pageNo >= result.totalPage
+        this.params.page = result.pageNo + 1
+        this.dataShow = this.list.length > 0
+      } catch {
+        this.dataShow = false
+        this.finished = true
+      }
+    },
+    async onUnLike(item: any) {
+      Dialog.confirm({
+        message: '确定取消关注吗?',
+        confirmButtonColor: 'var(--van-primary)'
+      }).then(async () => {
+        try {
+          await request.get('/api-student/teacher/starOrUnStar', {
+            params: {
+              userId: item.userId,
+              starStatus: 0
+            }
+          })
+          Toast('取消关注成功')
+          setTimeout(() => {
+            this.onSort()
+          }, 1000)
+        } catch {}
+      })
+    },
+    // 检验是否有对应徽章
+    checkBadge(type: string, item: any) {
+      // tag : 老师点亮图标
+      // STYLE:个人风采
+      // VIDEO:视频课
+      // LIVE:直播课,
+      // MUSIC:曲目 逗号隔开
+      let status = false
+      switch (type) {
+        case 'STYLE':
+        case 'VIDEO':
+        case 'LIVE':
+        case 'MUSIC':
+          if (item.tag) {
+            status = item.tag.indexOf(type) > -1
+          }
+          break
+        case 'VIP':
+          if (item.membershipStartTime && item.membershipEndTime) {
+            const startTime = dayjs(item.membershipStartTime).valueOf()
+            const endTime = dayjs(item.membershipEndTime).valueOf()
+            const nowTime = dayjs().valueOf()
+            status = nowTime >= startTime && nowTime <= endTime
+          } else {
+            status = false
+          }
+          break
+        case 'DEGREE':
+          status = item.degreeFlag ? true : false
+          break
+        case 'TEACHER':
+          status = item.teacherFlag ? true : false
+          break
+        default:
+          status = false
+          break
+      }
+      return status
+    }
+  },
+  render() {
+    return (
+      <div class={styles.teacherFollow}>
+        <Sticky position="top" offsetTop={0}>
+          <ColHeader border={false} />
+          <ColSearch onSearch={this.onSearch} />
+        </Sticky>
+        {this.dataShow ? (
+          <List
+            class={styles.liveList}
+            v-model:loading={this.loading}
+            immediateCheck={false}
+            finished={this.finished}
+            finishedText="没有更多了"
+          >
+            {this.list.map((item: any) => (
+              <div
+                class={[styles.headerCount, styles.headerFollow]}
+                onClick={(e: MouseEvent) => {
+                  e.stopPropagation()
+                  sessionStorage.removeItem('teacherHomeTabs')
+                  this.$router.push({
+                    path: '/teacherHome',
+                    query: {
+                      teacherId: item.userId,
+                      tabs: 'single'
+                    }
+                  })
+                }}
+              >
+                <div class={styles.followContainer}>
+                  <div class={styles.teacherContent}>
+                    <div
+                      class={styles.teacherIcon}
+                      onClick={e => {
+                        // 判断是否在直播中
+                        if (item.liveFlag === 1) {
+                          e.stopPropagation()
+                          postMessage({
+                            api: 'joinLiveRoom',
+                            content: {
+                              roomId: item.roomUid,
+                              teacherId: item.userId
+                            }
+                          })
+                        }
+                      }}
+                    >
+                      <Image
+                        class={[
+                          styles.avatar,
+                          this.checkBadge('VIP', item.teacher) &&
+                            styles.avatarActive
+                        ]}
+                        round
+                        src={item.avatar || iconTeacher}
+                        fit="cover"
+                      />
+
+                      {item.liveFlag === 1 ? (
+                        <p class={[styles.liveTag, styles.liveTagFollow]}>
+                          直播中
+                        </p>
+                      ) : (
+                        <Image
+                          class={styles.teacherIconVip}
+                          src={
+                            this.checkBadge('VIP', item.teacher)
+                              ? getAssetsHomeFile('vip_active.png')
+                              : getAssetsHomeFile('vip_default.png')
+                          }
+                        />
+                      )}
+                    </div>
+                  </div>
+
+                  <div>
+                    <div class={styles.teacherInfo}>
+                      <div class={styles.teacherInfoName}>
+                        {item.userName || `游客${item.userId || ''}`}
+                      </div>
+                      {this.checkBadge('DEGREE', item.teacher) && (
+                        <img src={IconXueli} />
+                      )}
+                      {this.checkBadge('TEACHER', item.teacher) && (
+                        <img src={IconJiaozi} />
+                      )}
+                    </div>
+                    <div class={styles.piNameSubject}>
+                      {/* <Image
+                        class={styles.subjectSection}
+                        src={getAssetsHomeFile('icon_subject.png')}
+                        fit="contain"
+                      /> */}
+                      <div class={styles.subjectList}>
+                        {this.getSubjectNameList(item.subjectName).map(
+                          (item: any) => (
+                            <span class={styles.subject}>{item}</span>
+                          )
+                        )}
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <div class={styles.teacherHonor}>
+                  <div>勋章:</div>
+                  <div class={styles.teacherIcons}>
+                    <Image
+                      class={styles.iconOther}
+                      src={
+                        this.checkBadge('STYLE', item.teacher)
+                          ? getAssetsHomeFile('cert_active.png')
+                          : getAssetsHomeFile('cert_default.png')
+                      }
+                    />
+                    <Image
+                      class={styles.iconOther}
+                      src={
+                        this.checkBadge('VIDEO', item.teacher)
+                          ? getAssetsHomeFile('video_active.png')
+                          : getAssetsHomeFile('video_default.png')
+                      }
+                    />
+                    <Image
+                      class={styles.iconOther}
+                      src={
+                        this.checkBadge('LIVE', item.teacher)
+                          ? getAssetsHomeFile('live_active.png')
+                          : getAssetsHomeFile('live_default.png')
+                      }
+                    />
+                    <Image
+                      class={styles.iconOther}
+                      src={
+                        this.checkBadge('MUSIC', item.teacher)
+                          ? getAssetsHomeFile('music_active.png')
+                          : getAssetsHomeFile('music_default.png')
+                      }
+                    />
+                  </div>
+                  <div class={styles.score}>评分: </div>
+                  <div class={styles.level}>
+                    {item.starGrade ? (
+                      <Rate
+                        readonly
+                        modelValue={item.starGrade}
+                        iconPrefix="iconfont"
+                        color="#FFC459"
+                        void-icon="star_default"
+                        icon="star_active"
+                        size={15}
+                      />
+                    ) : (
+                      <span style={{ fontSize: '12px', color: '#999999' }}>
+                        暂无评分
+                      </span>
+                    )}
+                  </div>
+                </div>
+                <div class={[styles['teacher-bottom'], styles.followFans]}>
+                  <div class={styles['teacher-data']}>
+                    <div class={styles['teacher-data_item']}>
+                      粉丝 <span>{item.fansNum || 0}</span>
+                    </div>
+                    <div class={styles['teacher-data_item']}>
+                      已上课时 <span>{item.expTime || 0}</span>
+                    </div>
+                  </div>
+                  <div
+                    class={styles.unlinkeBtn}
+                    onClick={(e: MouseEvent) => {
+                      e.stopPropagation()
+                      this.onUnLike(item)
+                    }}
+                  >
+                    取消关注
+                  </div>
+                </div>
+              </div>
+            ))}
+          </List>
+        ) : (
+          <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无关注" />
+        )}
+      </div>
+    )
+  }
+})

+ 2 - 0
src/teacher/leaderboard/index.tsx

@@ -17,6 +17,7 @@ import IconAvator from '@/common/images/icon_teacher.png'
 import request from '@/helpers/request'
 import { useRoute, useRouter } from 'vue-router'
 import { state as userInfo } from '@/state'
+import ColHeader from '@/components/col-header'
 
 interface IMusicItem {
   loaded: boolean
@@ -104,6 +105,7 @@ export default defineComponent({
     const imgRef = ref()
     return () => (
       <div class={styles.leaderboard}>
+        <ColHeader />
         <div class={styles.container}>
           <div class={styles.headImg} ref={imgRef}>
             <Image

+ 2 - 0
src/teacher/share-page/track-review-activity/index.tsx

@@ -7,6 +7,7 @@ import dayjs from 'dayjs'
 import ShareModel from './share-model'
 import { postMessage } from '@/helpers/native-message'
 import { state } from '@/state'
+import ColHeader from '@/components/col-header'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -144,6 +145,7 @@ export default defineComponent({
           backgroundSize: 'contain'
         }}
       >
+        <ColHeader />
         <img class={styles.bannerImg} src={this.activeInfo.subjectUrl} />
         <div class={styles.reviewContainer}>
           <div class={[styles.section, styles.activeTime]}>

+ 31 - 24
src/teacher/teacher-cert/teacher-cert-update/index.tsx

@@ -7,6 +7,7 @@ import { defineComponent } from 'vue'
 import teacherCert from '..'
 import CertThree from '../cert-three'
 import { teacherState } from '../teacherState'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'teacher-cert-update',
@@ -78,31 +79,37 @@ export default defineComponent({
     return (
       <>
         {this.authStatus ? (
-          <ColResult
-            type="teacherCert"
-            style={{ paddingTop: '60px' }}
-            classImgSize="CERT"
-            tips="感谢您的申请,小酷将在24小时内完成审核,请留意APP消息及短信获取审核结果。"
-          />
+          <>
+            <ColHeader />
+            <ColResult
+              type="teacherCert"
+              style={{ paddingTop: '60px' }}
+              classImgSize="CERT"
+              tips="感谢您的申请,小酷将在24小时内完成审核,请留意APP消息及短信获取审核结果。"
+            />
+          </>
         ) : (
-          <div
-            style={{
-              paddingTop: '12px'
-            }}
-          >
-            <CertThree />
-            <ColSticky position="bottom">
-              <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
-                <Button
-                  block
-                  round
-                  onClick={this.onSubmit}
-                  type="primary"
-                  text="提交审核"
-                />
-              </div>
-            </ColSticky>
-          </div>
+          <>
+            <ColHeader />
+            <div
+              style={{
+                paddingTop: '12px'
+              }}
+            >
+              <CertThree />
+              <ColSticky position="bottom">
+                <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
+                  <Button
+                    block
+                    round
+                    onClick={this.onSubmit}
+                    type="primary"
+                    text="提交审核"
+                  />
+                </div>
+              </ColSticky>
+            </div>
+          </>
         )}
       </>
     )

+ 201 - 199
src/teacher/video-class/create.tsx

@@ -1,199 +1,201 @@
-import { Grid, GridItem, Icon, Sticky } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './create.module.less'
-import ClassInfo from './class-info'
-import ClassContent from './class-content'
-import { createState } from './createState'
-import request from '@/helpers/request'
-
-import nameActive from './images/icon_name_active.png'
-import education from './images/icon_education.png'
-import educationActive from './images/icon_education_active.png'
-import CreateSubmit from './create-submit'
-
-export default defineComponent({
-  name: 'Create',
-  async created() {
-    const query = this.$route.query
-    createState.groupId = Number(query.groupId) || 0
-    // 判断是否是编辑
-    if (!createState.groupId) {
-      return false
-    }
-    try {
-      document.title = '修改视频课'
-      createState.loadingStatus = true
-      const res = await request.get(
-        '/api-teacher/videoLessonGroup/selectVideoLesson',
-        {
-          params: {
-            groupId: createState.groupId
-          }
-        }
-      )
-      const result = res.data
-      const {
-        auditStatus,
-        lessonCoverUrl,
-        lessonPrice,
-        lessonDesc,
-        lessonSubject,
-        lessonName,
-        relationType,
-        id,
-        ...group
-      } = result.lessonGroup
-      // 判断模板图片是否在模板列表中,如果不在则是用户自己上传的图片
-      const statusUrl = createState.templateList.includes(lessonCoverUrl)
-        ? true
-        : false
-      createState.lessonGroup = {
-        id: id,
-        lessonName: lessonName,
-        lessonSubject: lessonSubject,
-        lessonDesc: lessonDesc,
-        lessonPrice: lessonPrice,
-        relationType: 'RECOMMEND',
-        lessonCoverTemplateUrl: statusUrl ? lessonCoverUrl : '',
-        lessonCoverUrl: statusUrl ? '' : lessonCoverUrl
-      }
-      createState.lessonList = []
-      result.detailList &&
-        result.detailList.forEach((item: any) => {
-          const tempInfo = item.musicAlbumInfos || []
-          const relationList = tempInfo.map((info: any) => {
-            return {
-              relationMusicAlbum: info.relationType,
-              musicAlbumName: info.name,
-              musicAlbumId: info.musicAlbumId,
-              relationId: info.id,
-              useRelationType: 'RECOMMEND'
-            }
-          })
-          createState.lessonList.push({
-            videoTitle: item.videoTitle,
-            videoContent: item.videoContent,
-            videoUrl: item.videoUrl,
-            coverUrl: item.coverUrl,
-            relationList,
-            posterUrl: item.posterUrl // 视频封面图
-          })
-        })
-      createState.loadingStatus = false
-    } catch {
-      //
-    }
-    if (
-      createState.lessonGroup.lessonCoverUrl &&
-      !createState.templateList.includes(createState.lessonGroup.lessonCoverUrl)
-    ) {
-      createState.tabIndex = 2
-    } else {
-      createState.tabIndex = 1
-    }
-  },
-  async mounted() {
-    try {
-      // const sysConfig = await request.get(
-      //   '/api-teacher/sysConfig/queryByParamName',
-      //   {
-      //     params: {
-      //       paramName: 'video_lesson_service_fee'
-      //     }
-      //   }
-      // )
-      request
-        .get('/api-teacher/sysConfig/queryByParamNameList', {
-          params: {
-            paramNames: 'video_lesson_service_fee,video_account_period'
-          }
-        })
-        .then((res: any) => {
-          console.log(res, 'res')
-          const data = res.data || []
-          data.forEach((item: any) => {
-            if (item.paramName === 'video_lesson_service_fee') {
-              createState.rate = item.paramValue
-            } else if (item.paramName === 'video_account_period') {
-              createState.video_account_period = item.paramValue
-            }
-          })
-        })
-    } catch {}
-  },
-  render() {
-    return (
-      <div class={styles['video-create']}>
-        {createState.active <= 2 ? (
-          <Sticky position="top" offsetTop={0} zIndex={999999}>
-            <Grid
-              border={false}
-              style={{ paddingTop: '15px' }}
-              direction="horizontal"
-              columnNum="2"
-              class={styles.gridColumn}
-            >
-              <GridItem
-                v-slots={{
-                  default: () => (
-                    <>
-                      <Icon name={nameActive} size={38} />
-                      <span
-                        class={[
-                          styles.gridName,
-                          createState.active >= 1 ? styles.active : null
-                        ]}
-                      >
-                        课程信息
-                      </span>
-                    </>
-                  )
-                }}
-              />
-              <GridItem
-                v-slots={{
-                  default: () => (
-                    <>
-                      <Icon
-                        name={
-                          createState.active === 2 ? educationActive : education
-                        }
-                        size={38}
-                      />
-                      <span
-                        class={[
-                          styles.gridName,
-                          createState.active === 2 ? styles.active : null
-                        ]}
-                      >
-                        课程内容
-                      </span>
-                    </>
-                  )
-                }}
-              />
-            </Grid>
-          </Sticky>
-        ) : null}
-        {/* 课程信息 */}
-        {createState.active === 1 ? (
-          <>
-            <ClassInfo />
-          </>
-        ) : null}
-        {/* 课程内容 */}
-        {createState.active === 2 ? (
-          <>
-            <ClassContent />
-          </>
-        ) : null}
-        {/* 预览 */}
-        {createState.active === 3 ? (
-          <>
-            <CreateSubmit />
-          </>
-        ) : null}
-      </div>
-    )
-  }
-})
+import { Grid, GridItem, Icon, Sticky } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './create.module.less'
+import ClassInfo from './class-info'
+import ClassContent from './class-content'
+import { createState } from './createState'
+import request from '@/helpers/request'
+
+import nameActive from './images/icon_name_active.png'
+import education from './images/icon_education.png'
+import educationActive from './images/icon_education_active.png'
+import CreateSubmit from './create-submit'
+import ColHeader from '@/components/col-header'
+
+export default defineComponent({
+  name: 'Create',
+  async created() {
+    const query = this.$route.query
+    createState.groupId = Number(query.groupId) || 0
+    // 判断是否是编辑
+    if (!createState.groupId) {
+      return false
+    }
+    try {
+      document.title = '修改视频课'
+      createState.loadingStatus = true
+      const res = await request.get(
+        '/api-teacher/videoLessonGroup/selectVideoLesson',
+        {
+          params: {
+            groupId: createState.groupId
+          }
+        }
+      )
+      const result = res.data
+      const {
+        auditStatus,
+        lessonCoverUrl,
+        lessonPrice,
+        lessonDesc,
+        lessonSubject,
+        lessonName,
+        relationType,
+        id,
+        ...group
+      } = result.lessonGroup
+      // 判断模板图片是否在模板列表中,如果不在则是用户自己上传的图片
+      const statusUrl = createState.templateList.includes(lessonCoverUrl)
+        ? true
+        : false
+      createState.lessonGroup = {
+        id: id,
+        lessonName: lessonName,
+        lessonSubject: lessonSubject,
+        lessonDesc: lessonDesc,
+        lessonPrice: lessonPrice,
+        relationType: 'RECOMMEND',
+        lessonCoverTemplateUrl: statusUrl ? lessonCoverUrl : '',
+        lessonCoverUrl: statusUrl ? '' : lessonCoverUrl
+      }
+      createState.lessonList = []
+      result.detailList &&
+        result.detailList.forEach((item: any) => {
+          const tempInfo = item.musicAlbumInfos || []
+          const relationList = tempInfo.map((info: any) => {
+            return {
+              relationMusicAlbum: info.relationType,
+              musicAlbumName: info.name,
+              musicAlbumId: info.musicAlbumId,
+              relationId: info.id,
+              useRelationType: 'RECOMMEND'
+            }
+          })
+          createState.lessonList.push({
+            videoTitle: item.videoTitle,
+            videoContent: item.videoContent,
+            videoUrl: item.videoUrl,
+            coverUrl: item.coverUrl,
+            relationList,
+            posterUrl: item.posterUrl // 视频封面图
+          })
+        })
+      createState.loadingStatus = false
+    } catch {
+      //
+    }
+    if (
+      createState.lessonGroup.lessonCoverUrl &&
+      !createState.templateList.includes(createState.lessonGroup.lessonCoverUrl)
+    ) {
+      createState.tabIndex = 2
+    } else {
+      createState.tabIndex = 1
+    }
+  },
+  async mounted() {
+    try {
+      // const sysConfig = await request.get(
+      //   '/api-teacher/sysConfig/queryByParamName',
+      //   {
+      //     params: {
+      //       paramName: 'video_lesson_service_fee'
+      //     }
+      //   }
+      // )
+      request
+        .get('/api-teacher/sysConfig/queryByParamNameList', {
+          params: {
+            paramNames: 'video_lesson_service_fee,video_account_period'
+          }
+        })
+        .then((res: any) => {
+          console.log(res, 'res')
+          const data = res.data || []
+          data.forEach((item: any) => {
+            if (item.paramName === 'video_lesson_service_fee') {
+              createState.rate = item.paramValue
+            } else if (item.paramName === 'video_account_period') {
+              createState.video_account_period = item.paramValue
+            }
+          })
+        })
+    } catch {}
+  },
+  render() {
+    return (
+      <div class={styles['video-create']}>
+        {createState.active <= 2 ? (
+          <Sticky position="top" offsetTop={0} zIndex={999999}>
+            <ColHeader border={false} />
+            <Grid
+              border={false}
+              style={{ paddingTop: '15px' }}
+              direction="horizontal"
+              columnNum="2"
+              class={styles.gridColumn}
+            >
+              <GridItem
+                v-slots={{
+                  default: () => (
+                    <>
+                      <Icon name={nameActive} size={38} />
+                      <span
+                        class={[
+                          styles.gridName,
+                          createState.active >= 1 ? styles.active : null
+                        ]}
+                      >
+                        课程信息
+                      </span>
+                    </>
+                  )
+                }}
+              />
+              <GridItem
+                v-slots={{
+                  default: () => (
+                    <>
+                      <Icon
+                        name={
+                          createState.active === 2 ? educationActive : education
+                        }
+                        size={38}
+                      />
+                      <span
+                        class={[
+                          styles.gridName,
+                          createState.active === 2 ? styles.active : null
+                        ]}
+                      >
+                        课程内容
+                      </span>
+                    </>
+                  )
+                }}
+              />
+            </Grid>
+          </Sticky>
+        ) : null}
+        {/* 课程信息 */}
+        {createState.active === 1 ? (
+          <>
+            <ClassInfo />
+          </>
+        ) : null}
+        {/* 课程内容 */}
+        {createState.active === 2 ? (
+          <>
+            <ClassContent />
+          </>
+        ) : null}
+        {/* 预览 */}
+        {createState.active === 3 ? (
+          <>
+            <CreateSubmit />
+          </>
+        ) : null}
+      </div>
+    )
+  }
+})

+ 2 - 0
src/views/shop-mall/shop-order-detail/index.tsx

@@ -16,6 +16,7 @@ import styles from './index.module.less'
 import { orderState } from '@/views/shop-mall/shop-mall'
 import { dateFormat, moneyFormat } from '@/helpers/utils'
 import ColSticky from '@/components/col-sticky'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'shop-order-detail',
@@ -139,6 +140,7 @@ export default defineComponent({
 
     return () => (
       <>
+        <ColHeader />
         {items.value.length ? (
           <>
             <div class={styles.shopOrderDetail}>