浏览代码

Merge branch 'ui-revision-9' into online

lex 2 年之前
父节点
当前提交
62c7612624
共有 35 个文件被更改,包括 439 次插入378 次删除
  1. 1 1
      src/business-components/course-video-item/index.tsx
  2. 7 0
      src/components/col-sticky/index.module.less
  3. 6 1
      src/components/col-sticky/index.tsx
  4. 2 1
      src/student/live-class/live-detail.module.less
  5. 21 5
      src/student/live-class/live-detail.tsx
  6. 65 39
      src/student/teacher-dependent/components/live.module.less
  7. 29 35
      src/student/teacher-dependent/components/live.tsx
  8. 1 0
      src/student/teacher-dependent/components/music.tsx
  9. 二进制
      src/student/teacher-dependent/images/icon_subject.png
  10. 20 18
      src/student/teacher-dependent/model/teacher-header.module.less
  11. 4 1
      src/student/teacher-dependent/model/teacher-header.tsx
  12. 8 8
      src/student/teacher-dependent/teacher-home.tsx
  13. 1 1
      src/student/video-class/video-class-detail.tsx
  14. 9 0
      src/student/video-class/video-detail.module.less
  15. 13 5
      src/student/video-class/video-detail.tsx
  16. 47 31
      src/student/video-class/video-item.module.less
  17. 27 10
      src/student/video-class/video-item.tsx
  18. 6 0
      src/styles/index.less
  19. 3 3
      src/teacher/live-class/live-detail.tsx
  20. 2 2
      src/teacher/video-class/video-detail.tsx
  21. 5 0
      src/views/live-class/index.tsx
  22. 1 0
      src/views/music/album/index.tsx
  23. 5 2
      src/views/music/component/song/index.tsx
  24. 8 1
      src/views/music/list/index.module.less
  25. 58 22
      src/views/music/list/index.tsx
  26. 20 18
      src/views/music/personal/collection.tsx
  27. 11 0
      src/views/music/personal/index.module.less
  28. 16 15
      src/views/music/personal/personal.tsx
  29. 13 3
      src/views/music/personal/practice.tsx
  30. 5 1
      src/views/music/search/select-subject.tsx
  31. 7 0
      src/views/music/songbook/index.module.less
  32. 16 2
      src/views/music/songbook/list.tsx
  33. 2 1
      src/views/video-class/index.tsx
  34. 0 75
      src/views/video-class/video-item.module.less
  35. 0 77
      src/views/video-class/video-item.tsx

+ 1 - 1
src/business-components/course-video-item/index.tsx

@@ -61,7 +61,7 @@ export default defineComponent({
             </div>
             </div>
           ),
           ),
           title: () => (
           title: () => (
-            <div class={styles.videoTitle}>
+            <div class={[styles.videoTitle, 'videoSmall']}>
               <p
               <p
                 class={[
                 class={[
                   styles.videoTitleText,
                   styles.videoTitleText,

+ 7 - 0
src/components/col-sticky/index.module.less

@@ -0,0 +1,7 @@
+.white {
+  background-color: #fff;
+  > div {
+    padding: 15px;
+    box-shadow: 0px 0px 10px 0px rgba(216, 216, 216, 0.5);
+  }
+}

+ 6 - 1
src/components/col-sticky/index.tsx

@@ -1,5 +1,6 @@
 import { useRect } from '@vant/use'
 import { useRect } from '@vant/use'
 import { defineComponent } from 'vue'
 import { defineComponent } from 'vue'
+import styles from './index.module.less'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'col-sticky',
   name: 'col-sticky',
@@ -7,6 +8,10 @@ export default defineComponent({
     position: {
     position: {
       type: String,
       type: String,
       default: 'top' as 'top' | 'bottom'
       default: 'top' as 'top' | 'bottom'
+    },
+    background: {
+      type: String,
+      default: ''
     }
     }
   },
   },
   data() {
   data() {
@@ -32,7 +37,7 @@ export default defineComponent({
       <div style={this.sectionStyle}>
       <div style={this.sectionStyle}>
         <div
         <div
           ref="div"
           ref="div"
-          class="van-sticky van-sticky--fixed"
+          class={['van-sticky van-sticky--fixed', styles[this.background]]}
           style={[this.divStyle, this.sectionStyle]}
           style={[this.divStyle, this.sectionStyle]}
         >
         >
           {this.$slots.default && this.$slots.default()}
           {this.$slots.default && this.$slots.default()}

+ 2 - 1
src/student/live-class/live-detail.module.less

@@ -17,7 +17,7 @@
   .tips {
   .tips {
     background-color: white;
     background-color: white;
     border-radius: 10px;
     border-radius: 10px;
-    margin: 14px;
+    margin: 14px 12px;
     padding: var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding);
     padding: var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding);
     h3 {
     h3 {
       display: flex;
       display: flex;
@@ -27,6 +27,7 @@
       line-height: 1;
       line-height: 1;
     }
     }
     p {
     p {
+      text-align: justify;
       padding-top: 9px;
       padding-top: 9px;
       font-size: 12px;
       font-size: 12px;
       color: #7a7a7a;
       color: #7a7a7a;

+ 21 - 5
src/student/live-class/live-detail.tsx

@@ -10,6 +10,7 @@ import iconTips from '@common/images/icon_tips.png'
 import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
 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'
 interface IProps {
 interface IProps {
   courseTime: string
   courseTime: string
   coursePlan: string
   coursePlan: string
@@ -247,13 +248,14 @@ export default defineComponent({
       <div class={[styles['live-detail'], 'mb12']}>
       <div class={[styles['live-detail'], 'mb12']}>
         <ColHeader />
         <ColHeader />
         <UserDetail userInfo={this.userInfo} showBuy={false} />
         <UserDetail userInfo={this.userInfo} showBuy={false} />
-        <SectionDetail>
+        <SectionDetail border>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
         </SectionDetail>
         </SectionDetail>
 
 
         <SectionDetail
         <SectionDetail
           title="课程列表"
           title="课程列表"
           icon="courseList"
           icon="courseList"
+          border
           contentStyle={{ paddingTop: '0' }}
           contentStyle={{ paddingTop: '0' }}
         >
         >
           {this.courseInfo.length > 0 && (
           {this.courseInfo.length > 0 && (
@@ -280,23 +282,37 @@ export default defineComponent({
           </p>
           </p>
         </div>
         </div>
         {this.courseInfo.length > 0 && this.live.existBuy !== 1 && (
         {this.courseInfo.length > 0 && this.live.existBuy !== 1 && (
-          <Sticky offsetBottom={0} position="bottom">
+          // <Sticky offsetBottom={0} position="bottom">
+          //   <div class={['btnGroup', styles.btnMore]}>
+          //     <Button block round type="primary" onClick={this.onBuy}>
+          //       {this.live.coursePrice <= 0 ? '免费领取' : `立即购买`}
+          //     </Button>
+          //   </div>
+          // </Sticky>
+          <ColSticky position="bottom" background="white">
             <div class={['btnGroup', styles.btnMore]}>
             <div class={['btnGroup', styles.btnMore]}>
               <Button block round type="primary" onClick={this.onBuy}>
               <Button block round type="primary" onClick={this.onBuy}>
                 {this.live.coursePrice <= 0 ? '免费领取' : `立即购买`}
                 {this.live.coursePrice <= 0 ? '免费领取' : `立即购买`}
               </Button>
               </Button>
             </div>
             </div>
-          </Sticky>
+          </ColSticky>
         )}
         )}
 
 
         {this.joinRoom == '1' && this.liveStatus.liveStatus !== 2 && (
         {this.joinRoom == '1' && this.liveStatus.liveStatus !== 2 && (
-          <Sticky offsetBottom={0} position="bottom">
+          // <Sticky offsetBottom={0} position="bottom">
+          //   <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
+          //     <Button block round type="primary" onClick={this.onJoinRoom}>
+          //       进入直播间
+          //     </Button>
+          //   </div>
+          // </Sticky>
+          <ColSticky position="bottom" background="white">
             <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
             <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
               <Button block round type="primary" onClick={this.onJoinRoom}>
               <Button block round type="primary" onClick={this.onJoinRoom}>
                 进入直播间
                 进入直播间
               </Button>
               </Button>
             </div>
             </div>
-          </Sticky>
+          </ColSticky>
         )}
         )}
       </div>
       </div>
     )
     )

+ 65 - 39
src/student/teacher-dependent/components/live.module.less

@@ -10,57 +10,76 @@
 }
 }
 
 
 .liContent {
 .liContent {
-  padding-left: 10px;
+  padding-left: 14px;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
   .liTitle {
   .liTitle {
     font-size: 15px;
     font-size: 15px;
     font-weight: 500;
     font-weight: 500;
     color: #1a1a1a;
     color: #1a1a1a;
     line-height: 20px;
     line-height: 20px;
-    padding-bottom: 8px;
-    padding-top: 8px;
+    padding-top: 4px;
     max-width: 180px;
     max-width: 180px;
   }
   }
-  .avatar {
-    width: 18px;
-    height: 18px;
-    overflow: hidden;
-    border-radius: 50%;
-    margin-right: 6px;
-  }
-
-  .liUserInfo,
-  .userInfo {
-    display: flex;
-    align-items: center;
-    font-size: 13px;
-    color: #999999;
-    line-height: 18px;
-    flex-wrap: wrap;
-  }
+  // .avatar {
+  //   width: 18px;
+  //   height: 18px;
+  //   overflow: hidden;
+  //   border-radius: 50%;
+  //   margin-right: 6px;
+  // }
 
 
-  .userInfo {
-    padding-right: 10px;
-    margin-right: 10px;
-  }
+  // .liUserInfo,
+  // .userInfo {
+  //   display: flex;
+  //   align-items: center;
+  //   font-size: 13px;
+  //   color: #999999;
+  //   line-height: 18px;
+  //   flex-wrap: wrap;
+  // }
 
 
-  .num {
-    color: #ff802c;
-  }
+  // .userInfo {
+  //   padding-right: 10px;
+  //   margin-right: 10px;
+  // }
+}
+.num {
+  color: #ff802c;
+  font-size: 13px;
+}
 
 
-  .buyNum {
-    color: #999999;
-    display: flex;
-    align-items: center;
-    line-height: 1;
-  }
+.buyNum {
+  color: #ff802c;
+  display: flex;
+  align-items: center;
+  line-height: 1;
+  font-size: 13px;
 }
 }
 
 
 .price {
 .price {
+  // font-size: 14px;
+  // color: var(--van-primary);
+  // span {
+  //   font-weight: 600;
+  //   font-size: 16px;
+  // }
   font-size: 14px;
   font-size: 14px;
-  color: var(--van-primary);
-  span {
-    font-weight: 600;
-    font-size: 16px;
+  color: #999;
+
+  .priceNum {
+    color: #ff0000;
+    font-size: 18px;
+    font-weight: bold;
+    i {
+      font-size: 15px;
+      font-style: normal;
+    }
+  }
+  .label {
+    padding-left: 8px;
   }
   }
 }
 }
 
 
@@ -72,8 +91,8 @@
 
 
 .subjectName {
 .subjectName {
   position: absolute;
   position: absolute;
-  top: 8px;
-  left: 8px;
+  bottom: 4px;
+  left: 0px;
   font-size: 12px;
   font-size: 12px;
   padding: 3px 5px;
   padding: 3px 5px;
   color: #ffffff;
   color: #ffffff;
@@ -81,3 +100,10 @@
   border-radius: 1px;
   border-radius: 1px;
   background: rgba(0, 0, 0, 0.29);
   background: rgba(0, 0, 0, 0.29);
 }
 }
+
+.timerString {
+  font-size: 13px;
+  display: flex;
+  align-items: center;
+  color: #666;
+}

+ 29 - 35
src/student/teacher-dependent/components/live.tsx

@@ -97,9 +97,10 @@ export default defineComponent({
                 onClick={() => this.onDetail(item)}
                 onClick={() => this.onDetail(item)}
               >
               >
                 <Cell
                 <Cell
+                  style={{ paddingTop: '19px', paddingBottom: '19px' }}
                   v-slots={{
                   v-slots={{
                     icon: () => (
                     icon: () => (
-                      <div style={{ position: 'relative' }}>
+                      <div style={{ position: 'relative', lineHeight: '0' }}>
                         <Image
                         <Image
                           class={styles.liCover}
                           class={styles.liCover}
                           src={item.backgroundPic}
                           src={item.backgroundPic}
@@ -115,7 +116,7 @@ export default defineComponent({
                         <div class={[styles.liTitle, 'van-ellipsis']}>
                         <div class={[styles.liTitle, 'van-ellipsis']}>
                           {item.courseGroupName}
                           {item.courseGroupName}
                         </div>
                         </div>
-                        <div class={styles.liUserInfo}>
+                        {/* <div class={styles.liUserInfo}>
                           <div class={[styles.userInfo, 'van-hairline--right']}>
                           <div class={[styles.userInfo, 'van-hairline--right']}>
                             <Image
                             <Image
                               class={styles.avatar}
                               class={styles.avatar}
@@ -127,16 +128,22 @@ export default defineComponent({
                               {item.teacherName || `游客${item.teacherId}`}
                               {item.teacherName || `游客${item.teacherId}`}
                             </p>
                             </p>
                           </div>
                           </div>
-                          {item.existBuy === 1 ? (
-                            <span class={styles.buyNum}>
-                              {/* <Icon name={iconSuccess} size="15" /> */}
-                              已购买
-                            </span>
-                          ) : (
-                            <span class={styles.num}>
-                              {item.studentCount}人已购买
-                            </span>
+                        </div> */}
+                        <div class={styles.price}>
+                          {item.coursePrice > 0 && (
+                            <>
+                              <span class={styles.priceNum}>
+                                <i>¥</i>
+                                {(this as any).$filters.moneyFormat(
+                                  item.coursePrice
+                                )}
+                              </span>
+                            </>
                           )}
                           )}
+                          <span class={styles.label}>
+                            {item.coursePrice > 0 && '/'}
+                            {item.courseNum}课时
+                          </span>
                         </div>
                         </div>
                       </div>
                       </div>
                     )
                     )
@@ -146,35 +153,22 @@ export default defineComponent({
                   titleStyle={{ color: '#666666', fontSize: '13px' }}
                   titleStyle={{ color: '#666666', fontSize: '13px' }}
                   v-slots={{
                   v-slots={{
                     title: () => (
                     title: () => (
-                      <span
-                        style={{
-                          display: 'flex',
-                          alignItems: 'center',
-                          fontSize: '13px'
-                        }}
-                      >
-                        <Icon
-                          name={iconTimer}
-                          size="16"
-                          style={{ marginRight: '5px' }}
-                        />
+                      <span class={styles.timerString}>
                         {this.formatTime(item.salesStartDate)}
                         {this.formatTime(item.salesStartDate)}
                       </span>
                       </span>
                     ),
                     ),
                     default: () => (
                     default: () => (
-                      <div class={styles.price}>
-                        {item.coursePrice > 0 && (
-                          <>
-                            <span>
-                              ¥
-                              {(this as any).$filters.moneyFormat(
-                                item.coursePrice
-                              )}
-                            </span>
-                            /
-                          </>
+                      <div>
+                        {item.existBuy === 1 ? (
+                          <span class={styles.buyNum}>
+                            {/* <Icon name={iconSuccess} size="15" /> */}
+                            已购买
+                          </span>
+                        ) : (
+                          <span class={styles.num}>
+                            {item.studentCount}人已购买
+                          </span>
                         )}
                         )}
-                        {item.courseNum}课时
                       </div>
                       </div>
                     )
                     )
                   }}
                   }}

+ 1 - 0
src/student/teacher-dependent/components/music.tsx

@@ -40,6 +40,7 @@ export default defineComponent({
       <>
       <>
         <MusicList
         <MusicList
           hideSearch
           hideSearch
+          myself
           onItemClick={this.onItemClick}
           onItemClick={this.onItemClick}
           teacherId={this.teacherId}
           teacherId={this.teacherId}
         />
         />

二进制
src/student/teacher-dependent/images/icon_subject.png


+ 20 - 18
src/student/teacher-dependent/model/teacher-header.module.less

@@ -21,9 +21,9 @@
     border: 2px solid #fff;
     border: 2px solid #fff;
     background-color: #fff;
     background-color: #fff;
   }
   }
-  .avatarActive{
-    border-color: #FFE0B9;
-    background-color: #FFE0B9;
+  .avatarActive {
+    border-color: #ffe0b9;
+    background-color: #ffe0b9;
   }
   }
   .teacherIconVip {
   .teacherIconVip {
     position: absolute;
     position: absolute;
@@ -83,16 +83,17 @@
     padding: 3px 12px 1px;
     padding: 3px 12px 1px;
     min-width: 62px;
     min-width: 62px;
   }
   }
-  .btnStar{
-    color: #F18400;
-    border-color: #F18400;
+  .btnStar {
+    color: #f18400;
+    border-color: #f18400;
   }
   }
 }
 }
 
 
 .subjectSection {
 .subjectSection {
-  padding-right: 10px;
-  height: 18px;
-  max-width: 70px;
+  margin-right: 10px;
+  // height: 18px;
+  max-width: 68px;
+  box-sizing: content-box;
 }
 }
 
 
 .teacher-bottom {
 .teacher-bottom {
@@ -180,6 +181,7 @@
 .subjectList {
 .subjectList {
   overflow: auto;
   overflow: auto;
   width: 255px;
   width: 255px;
+  // height: 18px;
   display: flex;
   display: flex;
   flex-wrap: nowrap;
   flex-wrap: nowrap;
 }
 }
@@ -191,13 +193,13 @@
   .subject {
   .subject {
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
-    margin-left: 5px;
-    background: #fff1de;
-    border-radius: 4px;
+    margin-left: 4px;
+    background: #effbf9;
+    border-radius: 8px;
     font-size: 12px;
     font-size: 12px;
-    line-height: 12px;
-    color: #ff8c00;
-    padding: 3px;
+    line-height: 16px;
+    color: #2dc7aa;
+    padding: 0 5px;
     white-space: nowrap;
     white-space: nowrap;
     &:first-child {
     &:first-child {
       margin-left: 0;
       margin-left: 0;
@@ -326,15 +328,15 @@
       flex-wrap: wrap;
       flex-wrap: wrap;
     }
     }
     .subject {
     .subject {
-      margin: 0 5px 5px 0;
+      margin: 2px 5px 3px 0;
     }
     }
     .teacher-bottom {
     .teacher-bottom {
       padding-top: 24px;
       padding-top: 24px;
     }
     }
     .unlinkeBtn {
     .unlinkeBtn {
       font-size: 12px;
       font-size: 12px;
-      color: #FF6363;
-      border: 1px solid #FF6363;
+      color: #ff6363;
+      border: 1px solid #ff6363;
       padding: 5px 10px;
       padding: 5px 10px;
       border-radius: 20px;
       border-radius: 20px;
     }
     }

+ 4 - 1
src/student/teacher-dependent/model/teacher-header.tsx

@@ -166,7 +166,10 @@ export default defineComponent({
                   size="small"
                   size="small"
                   plain
                   plain
                   round
                   round
-                  class={[styles.btn, this.userInfo.isStar ? styles.btnStar : '']}
+                  class={[
+                    styles.btn,
+                    this.userInfo.isStar ? styles.btnStar : ''
+                  ]}
                   onClick={this.onStart}
                   onClick={this.onStart}
                 >
                 >
                   {/* {!this.userInfo.isStar && <Icon name="plus" />} */}
                   {/* {!this.userInfo.isStar && <Icon name="plus" />} */}

+ 8 - 8
src/student/teacher-dependent/teacher-home.tsx

@@ -46,8 +46,8 @@ export default defineComponent({
     useEventListener(document, 'scroll', evt => {
     useEventListener(document, 'scroll', evt => {
       const { y } = useWindowScroll()
       const { y } = useWindowScroll()
       // this.background = `rgba(255, 255, 255, ${y.value / 100})`
       // this.background = `rgba(255, 255, 255, ${y.value / 100})`
-      // console.log(y.value)
-      if (y.value > 142) {
+      // console.log(y.value) 142
+      if (y.value > 52) {
         this.headColor = '#000'
         this.headColor = '#000'
         this.background = '#fff'
         this.background = '#fff'
         this.backIconColor = 'black'
         this.backIconColor = 'black'
@@ -83,7 +83,7 @@ export default defineComponent({
               this.$nextTick(() => {
               this.$nextTick(() => {
                 const { height } = useRect((this as any).$refs.headers)
                 const { height } = useRect((this as any).$refs.headers)
                 this.height = height
                 this.height = height
-                this.homeContaiterHeight = `calc(100vh - var(--van-tabs-line-height) - ${height}px - 15px)`
+                // this.homeContaiterHeight = `calc(100vh - var(--van-tabs-line-height) - ${height}px - 15px)`
               })
               })
             }}
             }}
           />
           />
@@ -106,29 +106,29 @@ export default defineComponent({
           }}
           }}
         >
         >
           <Tab title="个人风采" name="single">
           <Tab title="个人风采" name="single">
-            <div style={{minHeight: this.homeContaiterHeight}}>
+            <div style={{ minHeight: this.homeContaiterHeight }}>
               {this.tabs === 'single' && <Single userInfo={this.userInfo} />}
               {this.tabs === 'single' && <Single userInfo={this.userInfo} />}
             </div>
             </div>
           </Tab>
           </Tab>
           <Tab title="陪练课" name="practice">
           <Tab title="陪练课" name="practice">
-            <div style={{minHeight: this.homeContaiterHeight}}>
+            <div style={{ minHeight: this.homeContaiterHeight }}>
               {this.tabs === 'practice' && (
               {this.tabs === 'practice' && (
                 <Practice userInfo={this.userInfo} />
                 <Practice userInfo={this.userInfo} />
               )}
               )}
             </div>
             </div>
           </Tab>
           </Tab>
           <Tab title="直播课" name="live">
           <Tab title="直播课" name="live">
-            <div style={{minHeight: this.homeContaiterHeight}}>
+            <div style={{ minHeight: this.homeContaiterHeight }}>
               {this.tabs === 'live' && <Live />}
               {this.tabs === 'live' && <Live />}
             </div>
             </div>
           </Tab>
           </Tab>
           <Tab title="视频课" name="video">
           <Tab title="视频课" name="video">
-            <div style={{minHeight: this.homeContaiterHeight}}>
+            <div style={{ minHeight: this.homeContaiterHeight }}>
               {this.tabs === 'video' && <VideoList />}
               {this.tabs === 'video' && <VideoList />}
             </div>
             </div>
           </Tab>
           </Tab>
           <Tab title="乐谱" name="music">
           <Tab title="乐谱" name="music">
-            <div style={{minHeight: this.homeContaiterHeight}}>
+            <div style={{ minHeight: this.homeContaiterHeight }}>
               {this.tabs === 'music' && <Music />}
               {this.tabs === 'music' && <Music />}
             </div>
             </div>
           </Tab>
           </Tab>

+ 1 - 1
src/student/video-class/video-class-detail.tsx

@@ -237,7 +237,7 @@ export default defineComponent({
                 overflowY: 'auto'
                 overflowY: 'auto'
               }}
               }}
             >
             >
-              <SectionDetail title="课程列表" icon="courseList">
+              <SectionDetail title="课程列表" icon="courseList" border>
                 {this.detailList.map((item: any, index: number) => (
                 {this.detailList.map((item: any, index: number) => (
                   <CourseVideoItem
                   <CourseVideoItem
                     class={'mb12'}
                     class={'mb12'}

+ 9 - 0
src/student/video-class/video-detail.module.less

@@ -18,4 +18,13 @@
       }
       }
     }
     }
   }
   }
+
+  .videoItem {
+    .van-cell__title {
+      font-size: 22px;
+      p {
+        max-width: 100px;
+      }
+    }
+  }
 }
 }

+ 13 - 5
src/student/video-class/video-detail.tsx

@@ -8,6 +8,7 @@ import request from '@/helpers/request'
 import ColHeader from '@/components/col-header'
 import ColHeader from '@/components/col-header'
 import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
 import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
 import { tradeOrder } from '../trade/tradeOrder'
 import { tradeOrder } from '../trade/tradeOrder'
+import ColSticky from '@/components/col-sticky'
 export default defineComponent({
 export default defineComponent({
   name: 'VideoDetail',
   name: 'VideoDetail',
   data() {
   data() {
@@ -162,14 +163,14 @@ export default defineComponent({
       <div class={[styles['video-detail']]}>
       <div class={[styles['video-detail']]}>
         <ColHeader />
         <ColHeader />
         <UserDetail userInfo={this.userInfo} />
         <UserDetail userInfo={this.userInfo} />
-        <SectionDetail>
+        <SectionDetail border>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
         </SectionDetail>
         </SectionDetail>
 
 
-        <SectionDetail title="课程列表" icon="courseList" class="mb12">
+        <SectionDetail title="课程列表" icon="courseList" class="mb12" border>
           {this.detailList.map((item: any) => (
           {this.detailList.map((item: any) => (
             <CourseVideoItem
             <CourseVideoItem
-              class={'mb12'}
+              class={['mb12', styles.videoItem]}
               detail={{
               detail={{
                 id: item.id,
                 id: item.id,
                 title: item.videoTitle,
                 title: item.videoTitle,
@@ -182,13 +183,20 @@ export default defineComponent({
         </SectionDetail>
         </SectionDetail>
 
 
         {this.userInfo.id && !this.userInfo.alreadyBuy && (
         {this.userInfo.id && !this.userInfo.alreadyBuy && (
-          <Sticky offsetBottom={0} position="bottom">
+          // <Sticky offsetBottom={0} position="bottom">
+          //   <div class={['btnGroup', styles.btnMore]}>
+          //     <Button block round type="primary" onClick={this.onBuy}>
+          //       {this.userInfo.lessonPrice <= 0 ? '免费领取' : `立即购买`}
+          //     </Button>
+          //   </div>
+          // </Sticky>
+          <ColSticky position="bottom" background="white">
             <div class={['btnGroup', styles.btnMore]}>
             <div class={['btnGroup', styles.btnMore]}>
               <Button block round type="primary" onClick={this.onBuy}>
               <Button block round type="primary" onClick={this.onBuy}>
                 {this.userInfo.lessonPrice <= 0 ? '免费领取' : `立即购买`}
                 {this.userInfo.lessonPrice <= 0 ? '免费领取' : `立即购买`}
               </Button>
               </Button>
             </div>
             </div>
-          </Sticky>
+          </ColSticky>
         )}
         )}
       </div>
       </div>
     )
     )

+ 47 - 31
src/student/video-class/video-item.module.less

@@ -12,7 +12,7 @@
   }
   }
 
 
   .viSection {
   .viSection {
-    padding: 8px;
+    padding: 8px 12px 13px;
   }
   }
 
 
   .viTitle {
   .viTitle {
@@ -21,50 +21,66 @@
     line-height: 20px;
     line-height: 20px;
   }
   }
 
 
-  .viUserInfo {
-    display: flex;
-    align-items: center;
-    font-size: 12px;
-    color: #999;
-    padding: 8px 0;
+  // .viUserInfo {
+  //   display: flex;
+  //   align-items: center;
+  //   font-size: 12px;
+  //   color: #999;
+  //   padding: 8px 0;
 
 
-    .viUserLogo {
-      width: 18px;
-      height: 18px;
-      border-radius: 50%;
-      margin-right: 5px;
-      overflow: hidden;
-    }
+  //   .viUserLogo {
+  //     width: 18px;
+  //     height: 18px;
+  //     border-radius: 50%;
+  //     margin-right: 5px;
+  //     overflow: hidden;
+  //   }
 
 
-    .viUserName {
-      padding-right: 6px;
-      margin-right: 6px;
-      // &::after {
-      //   content: '|';
-      //   display: inline-block;
-      // }
-    }
+  //   .viUserName {
+  //     padding-right: 6px;
+  //     margin-right: 6px;
+  //     max-width: 60px;
+  //     white-space: nowrap;
+  //     overflow: hidden;
+  //     text-overflow: ellipsis;
+  //     flex: 1 auto;
+  //   }
+  // }
 
 
-    .viUserNum {
-      color: #ff802c;
-    }
+  .viUserNum {
+    padding-top: 4px;
+    color: #ff802c;
+    font-size: 12px;
   }
   }
 
 
   .viPrice {
   .viPrice {
+    padding-top: 10px;
     font-size: 14px;
     font-size: 14px;
-    font-weight: 500;
-    color: #2dc7aa;
+    color: #999;
+
+    .priceNum {
+      color: #ff0000;
+      font-size: 18px;
+      font-weight: bold;
+      i {
+        font-size: 15px;
+        font-style: normal;
+      }
+    }
+    .label {
+      padding-left: 8px;
+    }
   }
   }
 
 
   .subjectName {
   .subjectName {
     position: absolute;
     position: absolute;
-    top: 8px;
-    left: 8px;
-    font-size: 12px;
+    bottom: 6px;
+    right: 6px;
+    font-size: 10px;
     padding: 3px 5px;
     padding: 3px 5px;
     color: #ffffff;
     color: #ffffff;
     line-height: 1;
     line-height: 1;
-    border-radius: 1px;
+    border-radius: 2px;
     background: rgba(0, 0, 0, 0.29);
     background: rgba(0, 0, 0, 0.29);
   }
   }
 }
 }

+ 27 - 10
src/student/video-class/video-item.tsx

@@ -15,6 +15,7 @@ interface VideoItemProps {
   lessonPrice: number
   lessonPrice: number
   countStudent: number
   countStudent: number
   lessonSubjectName: string
   lessonSubjectName: string
+  auditVersion: number
 }
 }
 
 
 export default defineComponent({
 export default defineComponent({
@@ -46,24 +47,40 @@ export default defineComponent({
 
 
         <div class={styles.viSection}>
         <div class={styles.viSection}>
           <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
           <div class={[styles.viTitle, 'van-ellipsis']}>{item?.lessonName}</div>
-          <div class={styles.viUserInfo}>
+          {/* <div class={styles.viUserInfo}>
             <Image
             <Image
               src={item?.avatar || iconTeacher}
               src={item?.avatar || iconTeacher}
               class={styles.viUserLogo}
               class={styles.viUserLogo}
             />
             />
             <span class={[styles.viUserName, 'van-hairline--right']}>
             <span class={[styles.viUserName, 'van-hairline--right']}>
-              {item?.userName || `游客${item?.teacherId || ''}`}
+              {item?.userName ||
+                item?.username ||
+                `游客${item?.teacherId || ''}`}
             </span>
             </span>
-            <span class={styles.viUserNum}>
-              {item?.countStudent}人已
-              {item?.lessonPrice > 0 ? '购买' : '领取'}
+          </div> */}
+          <div class={styles.viPrice}>
+            <span class={styles.priceNum}>
+              {item?.lessonPrice > 0 && (
+                <>
+                  <i>¥</i>
+                  {item?.lessonPrice}
+                </>
+              )}
+              {item?.lessonPrice <= 0 && item.auditVersion !== 0 && (
+                <>
+                  <i>¥</i>0
+                </>
+              )}
+              {item?.lessonPrice <= 0 && item.auditVersion === 0 && <>免费</>}
             </span>
             </span>
+            <span class={styles.label}>/{item?.lessonCount}课时</span>
           </div>
           </div>
-          <div class={styles.viPrice}>
-            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
-            {item?.lessonPrice <= 0 && item.auditVersion !== 0 && <>¥{0}/</>}
-            {item?.lessonPrice <= 0 && item.auditVersion === 0 && <>免费/</>}
-            {item?.lessonCount}课时
+
+          <div class={styles.viUserNum}>
+            {item?.countStudent}人已
+            {item?.lessonPrice <= 0 && item.auditVersion === 0
+              ? '领取'
+              : '购买'}
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>

+ 6 - 0
src/styles/index.less

@@ -139,6 +139,12 @@ body {
 //   transform: translateZ(0);
 //   transform: translateZ(0);
 //   -webkit-transform: translateZ(0);
 //   -webkit-transform: translateZ(0);
 // }
 // }
+// .van-sticky--fixed {
+//   .btnGroup {
+//     background-color: #fff;
+//     padding-top: 15px;
+//   }
+// }
 
 
 .sticky {
 .sticky {
   position: relative;
   position: relative;

+ 3 - 3
src/teacher/live-class/live-detail.tsx

@@ -249,7 +249,7 @@ export default defineComponent({
         {this.live.status !== 'OUT_SALE' && (
         {this.live.status !== 'OUT_SALE' && (
           <>
           <>
             {this.courseOffStatus && (
             {this.courseOffStatus && (
-              <ColSticky position="bottom">
+              <ColSticky position="bottom" background="white">
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                   <Button
                   <Button
                     block
                     block
@@ -264,7 +264,7 @@ export default defineComponent({
             )}
             )}
 
 
             {this.joinRoom == '1' && this.liveStatus.liveStatus !== 2 && (
             {this.joinRoom == '1' && this.liveStatus.liveStatus !== 2 && (
-              <ColSticky position="bottom">
+              <ColSticky position="bottom" background="white">
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                   <Button block round type="primary" onClick={this.onJoinRoom}>
                   <Button block round type="primary" onClick={this.onJoinRoom}>
                     进入直播间
                     进入直播间
@@ -274,7 +274,7 @@ export default defineComponent({
             )}
             )}
 
 
             {this.share == '1' && this.courseInfo.length > 0 && (
             {this.share == '1' && this.courseInfo.length > 0 && (
-              <ColSticky position="bottom">
+              <ColSticky position="bottom" background="white">
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                   <Button
                   <Button
                     block
                     block

+ 2 - 2
src/teacher/video-class/video-detail.tsx

@@ -215,7 +215,7 @@ export default defineComponent({
         {this.shelvesFlag === 1 && (
         {this.shelvesFlag === 1 && (
           <>
           <>
             {this.share == '1' && this.detailList.length > 0 && (
             {this.share == '1' && this.detailList.length > 0 && (
-              <ColSticky position="bottom">
+              <ColSticky position="bottom" background="white">
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                   <Button
                   <Button
                     block
                     block
@@ -231,7 +231,7 @@ export default defineComponent({
               </ColSticky>
               </ColSticky>
             )}
             )}
             {this.share != '1' && this.detailList.length > 0 && (
             {this.share != '1' && this.detailList.length > 0 && (
-              <ColSticky position="bottom">
+              <ColSticky position="bottom" background="white">
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                 <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
                   <Button
                   <Button
                     block
                     block

+ 5 - 0
src/views/live-class/index.tsx

@@ -25,6 +25,7 @@ export default defineComponent({
       searchStatus: false,
       searchStatus: false,
       openStatus: false,
       openStatus: false,
       subjectList: [],
       subjectList: [],
+      lockLoading: false,
       params: {
       params: {
         search: '',
         search: '',
         subjectId: null as any,
         subjectId: null as any,
@@ -91,6 +92,8 @@ export default defineComponent({
     },
     },
     async getList() {
     async getList() {
       try {
       try {
+        if (this.lockLoading) return
+        this.lockLoading = true
         const params: any = {
         const params: any = {
           ...this.params
           ...this.params
         }
         }
@@ -114,6 +117,7 @@ export default defineComponent({
             ...params
             ...params
           }
           }
         })
         })
+        this.lockLoading = false
         this.loading = false
         this.loading = false
         const result = res.data || {}
         const result = res.data || {}
         // 处理重复请求数据
         // 处理重复请求数据
@@ -127,6 +131,7 @@ export default defineComponent({
       } catch {
       } catch {
         this.dataShow = false
         this.dataShow = false
         this.finished = true
         this.finished = true
+        this.lockLoading = false
       }
       }
     },
     },
     onDetail(item: any) {
     onDetail(item: any) {

+ 1 - 0
src/views/music/album/index.tsx

@@ -225,6 +225,7 @@ export default defineComponent({
           >
           >
             <SelectSubject
             <SelectSubject
               isReset
               isReset
+              type="ALBUM"
               searchParams={subject}
               searchParams={subject}
               onComfirm={onComfirmSubject}
               onComfirm={onComfirmSubject}
             />
             />

+ 5 - 2
src/views/music/component/song/index.tsx

@@ -8,6 +8,8 @@ import { state } from '@/state'
 import request from '@/helpers/request'
 import request from '@/helpers/request'
 import ColShare from '@/components/col-share'
 import ColShare from '@/components/col-share'
 import MusicIcon from '../../list/icons/music-icon.png'
 import MusicIcon from '../../list/icons/music-icon.png'
+import collection_active from '../images/collection_active.png'
+import collection from '../images/collection.png'
 export const getAssetsHomeFile = (fileName: string) => {
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `../images/${fileName}`
   const path = `../images/${fileName}`
   const modules = import.meta.globEager('../images/*')
   const modules = import.meta.globEager('../images/*')
@@ -178,6 +180,7 @@ export default defineComponent({
                 )
                 )
               }}
               }}
             />
             />
+
             {state.platformType === 'STUDENT' && (
             {state.platformType === 'STUDENT' && (
               <Cell
               <Cell
                 border={false}
                 border={false}
@@ -191,8 +194,8 @@ export default defineComponent({
                       <Image
                       <Image
                         src={
                         src={
                           moreData.value.favorite
                           moreData.value.favorite
-                            ? getAssetsHomeFile('collection_active.png')
-                            : getAssetsHomeFile('collection.png')
+                            ? collection_active
+                            : collection
                         }
                         }
                       />
                       />
                     </div>
                     </div>

+ 8 - 1
src/views/music/list/index.module.less

@@ -16,4 +16,11 @@
       margin-left: 4px;
       margin-left: 4px;
     }
     }
   }
   }
-}
+}
+
+.alumnList {
+  padding: 0 12px;
+  border-radius: 18px;
+  background-color: #fff;
+  margin: 14px;
+}

+ 58 - 22
src/views/music/list/index.tsx

@@ -11,6 +11,7 @@ import { getRandomKey, musicBuy } from '../music'
 import { state } from '@/state'
 import { state } from '@/state'
 import SelectSubject from '../search/select-subject'
 import SelectSubject from '../search/select-subject'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
+import Song from '../component/song'
 
 
 const noop = () => {}
 const noop = () => {}
 
 
@@ -32,9 +33,16 @@ export default defineComponent({
     teacherId: {
     teacherId: {
       type: String || Number,
       type: String || Number,
       default: ''
       default: ''
+    },
+    myself: {
+      type: Boolean,
+      default: false
     }
     }
   },
   },
-  setup({ hideSearch, defauleParams, onItemClick, teacherId }, { expose }) {
+  setup(
+    { hideSearch, defauleParams, onItemClick, teacherId, myself },
+    { expose }
+  ) {
     const subjects: any = useSubjectId(SubjectEnum.SEARCH)
     const subjects: any = useSubjectId(SubjectEnum.SEARCH)
     // 判断是否已有数据
     // 判断是否已有数据
     if (!subjects.id) {
     if (!subjects.id) {
@@ -107,8 +115,13 @@ export default defineComponent({
         createBy: teacherId
         createBy: teacherId
       }
       }
       // if (state.platformType === 'TEACHER') {
       // if (state.platformType === 'TEACHER') {
-      tempParams.myself = false
+
       // }
       // }
+      if (myself) {
+        tempParams.myself = true
+      } else {
+        tempParams.myself = false
+      }
 
 
       try {
       try {
         const res = await request.post(`${apiSuffix.value}/music/sheet/list`, {
         const res = await request.post(`${apiSuffix.value}/music/sheet/list`, {
@@ -204,26 +217,48 @@ export default defineComponent({
             </Sticky>
             </Sticky>
           )}
           )}
 
 
-          {data.value && data.value.rows.length
-            ? data.value.rows.map(item => (
-                <Item
-                  data={item}
-                  onClick={() => {
-                    if (onItemClick === noop) {
-                      musicBuy(item)
-                    } else {
-                      onItemClick?.(item)
-                    }
-                  }}
-                />
-              ))
-            : !loading.value && (
-                <ColResult
-                  tips="暂无曲目"
-                  classImgSize="SMALL"
-                  btnStatus={false}
-                />
-              )}
+          {data.value && data.value.rows.length ? (
+            <div class={styles.alumnList}>
+              <Song
+                list={data.value.rows}
+                onDetail={(item: any) => {
+                  if (onItemClick === noop) {
+                    musicBuy(item)
+                  } else {
+                    onItemClick?.(item)
+                  }
+                  // if (onItemClick === noop || !onItemClick) {
+                  //   musicBuy(item, () => {}, {
+                  //     albumId: route.params.id,
+                  //     albumName: albumDetail.value?.albumName
+                  //   })
+                  // } else {
+                  //   onItemClick(item)
+                  // }
+                }}
+              />
+            </div>
+          ) : (
+            // data.value.rows.map(item => (
+            //     <Item
+            //       data={item}
+            //       onClick={() => {
+            //         if (onItemClick === noop) {
+            //           musicBuy(item)
+            //         } else {
+            //           onItemClick?.(item)
+            //         }
+            //       }}
+            //     />
+            //   ))
+            !loading.value && (
+              <ColResult
+                tips="暂无曲目"
+                classImgSize="SMALL"
+                btnStatus={false}
+              />
+            )
+          )}
         </List>
         </List>
         <Popup
         <Popup
           show={tagVisibility.value}
           show={tagVisibility.value}
@@ -253,6 +288,7 @@ export default defineComponent({
         >
         >
           <SelectSubject
           <SelectSubject
             isReset
             isReset
+            type="MUSIC"
             searchParams={subject}
             searchParams={subject}
             onComfirm={onComfirmSubject}
             onComfirm={onComfirmSubject}
           />
           />

+ 20 - 18
src/views/music/personal/collection.tsx

@@ -6,6 +6,8 @@ import { useRoute } from 'vue-router'
 import ColResult from '@/components/col-result'
 import ColResult from '@/components/col-result'
 import { musicBuy } from '../music'
 import { musicBuy } from '../music'
 import { state } from '@/state'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'MusicList',
   name: 'MusicList',
@@ -66,24 +68,24 @@ export default defineComponent({
         onLoad={FetchList}
         onLoad={FetchList}
         error={isError.value}
         error={isError.value}
       >
       >
-        {rows.value.length
-          ? rows.value.map(item => (
-              <Item
-                data={item}
-                onClick={() => musicBuy(item)}
-                onFavorite={() => {
-                  reset()
-                  emit('favorite')
-                }}
-              />
-            ))
-          : !loading.value && (
-              <ColResult
-                tips="暂无收藏单曲"
-                classImgSize="SMALL"
-                btnStatus={false}
-              />
-            )}
+        {rows.value.length ? (
+          <div class={styles.personalSong}>
+            <Song
+              list={rows.value}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+        ) : (
+          !loading.value && (
+            <ColResult
+              tips="暂无收藏单曲"
+              classImgSize="SMALL"
+              btnStatus={false}
+            />
+          )
+        )}
       </List>
       </List>
     )
     )
   }
   }

+ 11 - 0
src/views/music/personal/index.module.less

@@ -20,3 +20,14 @@
     }
     }
   }
   }
 }
 }
+
+.practice,
+.personalSong {
+  padding: 0 12px;
+  border-radius: 18px;
+  background-color: #fff;
+  margin: 0 14px 14px;
+}
+.personalSong {
+  margin: 14px;
+}

+ 16 - 15
src/views/music/personal/personal.tsx

@@ -6,6 +6,8 @@ import { musicBuy } from '../music'
 import { useRoute } from 'vue-router'
 import { useRoute } from 'vue-router'
 import ColResult from '@/components/col-result'
 import ColResult from '@/components/col-result'
 import { state } from '@/state'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'MusicList',
   name: 'MusicList',
@@ -64,21 +66,20 @@ export default defineComponent({
         onLoad={FetchList}
         onLoad={FetchList}
         error={isError.value}
         error={isError.value}
       >
       >
-        {rows.value.length
-          ? rows.value.map(item => (
-              <Item
-                data={item}
-                onClick={() => musicBuy(item)}
-                onFavorite={() => emit('favorite')}
-              />
-            ))
-          : !loading.value && (
-              <ColResult
-                tips="暂无单曲"
-                classImgSize="SMALL"
-                btnStatus={false}
-              />
-            )}
+        {rows.value.length ? (
+          <div class={styles.personalSong}>
+            <Song
+              list={rows.value}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+        ) : (
+          !loading.value && (
+            <ColResult tips="暂无单曲" classImgSize="SMALL" btnStatus={false} />
+          )
+        )}
       </List>
       </List>
     )
     )
   }
   }

+ 13 - 3
src/views/music/personal/practice.tsx

@@ -5,6 +5,8 @@ import { Cell, Skeleton } from 'vant'
 import Item from '../list/item'
 import Item from '../list/item'
 import { musicBuy } from '../music'
 import { musicBuy } from '../music'
 import { state } from '@/state'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'Practice',
   name: 'Practice',
@@ -39,8 +41,16 @@ export default defineComponent({
       }
       }
       return (
       return (
         <>
         <>
-          {prevNum.value > 0 && <Cell title="最近练习" />}
-          {Array.from(Array(prevNum.value)).map((_, index) => {
+          {prevNum.value > 0 && <Cell title="最近练习" border={false} />}
+          <div class={styles.practice}>
+            <Song
+              list={list}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+          {/* {Array.from(Array(prevNum.value)).map((_, index) => {
             const item = list[index]
             const item = list[index]
             console.log(list, item)
             console.log(list, item)
             if (!item) {
             if (!item) {
@@ -56,7 +66,7 @@ export default defineComponent({
                 }}
                 }}
               />
               />
             )
             )
-          })}
+          })} */}
         </>
         </>
       )
       )
     }
     }

+ 5 - 1
src/views/music/search/select-subject.tsx

@@ -20,6 +20,10 @@ export default defineComponent({
         id: ''
         id: ''
       }
       }
     },
     },
+    type: {
+      type: String,
+      default: 'MUSIC'
+    },
     onComfirm: {
     onComfirm: {
       type: Function,
       type: Function,
       default: (item: any) => {}
       default: (item: any) => {}
@@ -46,7 +50,7 @@ export default defineComponent({
   methods: {
   methods: {
     async getList() {
     async getList() {
       const { data } = await request.get(
       const { data } = await request.get(
-        `${this.apiSuffix}/subject/subjectSelect?type=MUSIC`
+        `${this.apiSuffix}/subject/subjectSelect?type=${this.type}`
       )
       )
       if (Array.isArray(data)) {
       if (Array.isArray(data)) {
         this.subjectList = data
         this.subjectList = data

+ 7 - 0
src/views/music/songbook/index.module.less

@@ -82,3 +82,10 @@
     }
     }
   }
   }
 }
 }
+
+.listContainer {
+  padding: 0 12px;
+  border-radius: 18px;
+  background-color: #fff;
+  margin: 0 14px 14px;
+}

+ 16 - 2
src/views/music/songbook/list.tsx

@@ -9,6 +9,7 @@ import { useRoute, useRouter } from 'vue-router'
 import ColResult from '@/components/col-result'
 import ColResult from '@/components/col-result'
 import { state as tempState } from '@/state'
 import { state as tempState } from '@/state'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
+import Song from '../component/song'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'Songbook',
   name: 'Songbook',
@@ -52,7 +53,20 @@ export default defineComponent({
             border={false}
             border={false}
           />
           />
           <div class={styles.listContainer}>
           <div class={styles.listContainer}>
-            {state.value.data.rows.map(item => (
+            <Song
+              list={state.value.data.rows}
+              onDetail={(item: any) => {
+                musicBuy(item, (path: any) => {
+                  router.push({
+                    path,
+                    query: {
+                      orderType: 'MUSIC'
+                    }
+                  })
+                })
+              }}
+            />
+            {/* {state.value.data.rows.map(item => (
               <Item
               <Item
                 data={item}
                 data={item}
                 onClick={(item: any) => {
                 onClick={(item: any) => {
@@ -66,7 +80,7 @@ export default defineComponent({
                   })
                   })
                 }}
                 }}
               />
               />
-            ))}
+            ))} */}
           </div>
           </div>
         </>
         </>
       ) : (
       ) : (

+ 2 - 1
src/views/video-class/index.tsx

@@ -3,7 +3,8 @@ import ColSearch from '@/components/col-search'
 import { Sticky, Image, List, Popup, Icon } from 'vant'
 import { Sticky, Image, List, Popup, Icon } from 'vant'
 import { defineComponent } from 'vue'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
 import styles from './index.module.less'
-import VideoItem from './video-item'
+import VideoItem from '@/student/video-class/video-item'
+// import VideoItem from './video-item'
 
 
 import banner from './images/banner.png'
 import banner from './images/banner.png'
 import request from '@/helpers/request'
 import request from '@/helpers/request'

+ 0 - 75
src/views/video-class/video-item.module.less

@@ -1,75 +0,0 @@
-.videoItem {
-  border-radius: 8px;
-  background-color: #fff;
-  overflow: hidden;
-  width: 168px;
-  margin-bottom: 12px;
-
-  .viCover {
-    height: 94px;
-    width: 100%;
-    vertical-align: middle;
-  }
-
-  .viSection {
-    padding: 8px;
-  }
-
-  .viTitle {
-    font-size: 14px;
-    color: #1a1a1a;
-    line-height: 20px;
-  }
-
-  .viUserInfo {
-    display: flex;
-    align-items: center;
-    font-size: 12px;
-    color: #999;
-    padding: 8px 0;
-
-    .viUserLogo {
-      width: 18px;
-      height: 18px;
-      border-radius: 50%;
-      margin-right: 5px;
-      overflow: hidden;
-    }
-
-    .viUserName {
-      padding-right: 6px;
-      margin-right: 6px;
-      max-width: 60px;
-      white-space: nowrap;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      flex: 1 auto;
-      // &::after {
-      //   content: '|';
-      //   display: inline-block;
-      // }
-    }
-
-    .viUserNum {
-      color: #ff802c;
-    }
-  }
-
-  .viPrice {
-    font-size: 14px;
-    font-weight: 500;
-    color: #2dc7aa;
-  }
-
-  .subjectName {
-    position: absolute;
-    top: 8px;
-    left: 8px;
-    font-size: 12px;
-    padding: 3px 5px;
-    color: #ffffff;
-    line-height: 1;
-    border-radius: 1px;
-    background: rgba(0, 0, 0, 0.29);
-  }
-}

+ 0 - 77
src/views/video-class/video-item.tsx

@@ -1,77 +0,0 @@
-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
-  auditVersion: number
-}
-
-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}人已
-              {item?.lessonPrice <= 0 && item.auditVersion === 0
-                ? '领取'
-                : '购买'}
-            </span>
-          </div>
-          <div class={styles.viPrice}>
-            {item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/</>}
-            {item?.lessonPrice <= 0 && item.auditVersion !== 0 && <>¥{0}/</>}
-            {item?.lessonPrice <= 0 && item.auditVersion === 0 && <>免费/</>}
-            {item?.lessonCount}课时
-          </div>
-        </div>
-      </div>
-    )
-  }
-})