浏览代码

Merge branch 'newVersion' into dev

mo 2 年之前
父节点
当前提交
0fbe9f38cb

+ 6 - 7
src/components/banner/index.module.less

@@ -1,23 +1,22 @@
 .mySwiper {
-  min-height: 400px;
-  /deep/.swiper-slide {
-    min-height: 400px;
-  }
   cursor: pointer;
 }
+
 :global {
   .bannerSwiper {
+
     .mySwiper {
+      overflow: hidden;
+      min-height: 400px;
       &:hover {
         .myprev,
         .mynext {
           visibility: visible !important;
           &:active {
             opacity: 0.9;
-           }
+          }
         }
       }
-
     }
     .myprev,
     .mynext {
@@ -58,7 +57,7 @@
     .swiper-pagination-bullet-active {
       width: 50px;
       height: 6px;
-      background: #2dc7aa!important;
+      background: #2dc7aa !important;
       border-radius: 3px;
     }
     .swiper-pagination-bullet {

+ 1 - 2
src/components/hotSearch/index.module.less

@@ -170,7 +170,7 @@
       // border-bottom: 1px solid #ededed;
       display: flex;
       flex-direction: row;
-
+      flex-wrap: wrap;
       .chioseRow {
         width: 50%;
         // display: flex;
@@ -202,7 +202,6 @@
         p {
           font-size: 18px;
           line-height: 48px;
-          width: 112px;
           // text-align: center;
           font-weight: 600;
           color: #000000;

+ 35 - 5
src/components/hotSearch/index.tsx

@@ -1,4 +1,11 @@
-import { defineComponent, toRefs, reactive, onMounted, ref } from 'vue'
+import {
+  defineComponent,
+  toRefs,
+  reactive,
+  onMounted,
+  ref,
+  nextTick
+} from 'vue'
 import { ElButton, ElTag } from 'element-plus'
 import classes from './index.module.less'
 import tagItem from '@/components/tagItem'
@@ -11,8 +18,9 @@ import request from '@/helpers/request'
 import arrows from './images/selectArrow.png'
 import clearIcon from './images/clearIcon.png'
 import item from '@/views/user-info/components/item'
-import { useRouter } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import { spawn } from 'child_process'
+
 export default defineComponent({
   name: 'hotSearch',
   components: { tagItem },
@@ -48,6 +56,7 @@ export default defineComponent({
       searchHover: false
     })
     const router = useRouter()
+    const route = useRoute()
     const getHotList = async () => {
       try {
         const res = await request.get(
@@ -64,7 +73,13 @@ export default defineComponent({
       try {
         const res = await request.get('/api-website/open/MusicTag/tree', {})
         state.tagTree = res.data
-
+        if (route.params.tag && route.params.parentTagId) {
+          let tag = findTag(route.params.tag)
+          if (tag) {
+            state.showDetail= false;
+            chioseTag(tag)
+          }
+        }
         // state.hotList = res.data
       } catch (e) {
         console.log(e)
@@ -171,9 +186,21 @@ export default defineComponent({
     const gotoSearch = () => {
       router.push({ path: props.gotoPath })
     }
+    const findTag = (id: any) => {
+      let tag = null as any
+      state.tagTree.forEach((tree: any) => {
+        tree.children.forEach((item: any) => {
+          if (id == item.id) {
+            tag = item
+          }
+        })
+      })
+      return tag
+    }
     onMounted(() => {
       getHotList()
       getTagTree()
+      // 判断有没有parment
     })
     return () => (
       <>
@@ -236,7 +263,7 @@ export default defineComponent({
                 {state.searchTagList.map((item: any) => {
                   return (
                     <ElTag
-                    size="large"
+                      size="large"
                       closable
                       onClose={() => closeChioseTag(item)}
                       class="chioseTag"
@@ -274,7 +301,10 @@ export default defineComponent({
                             //  effect={isChiose(tag)}
 
                             <div
-                              class={[classes.tags,tag.isCheck?classes.check:'']}
+                              class={[
+                                classes.tags,
+                                tag.isCheck ? classes.check : ''
+                              ]}
                               onClick={() => {
                                 chioseTag(tag)
                               }}

+ 1 - 1
src/components/searchInput/index.tsx

@@ -61,7 +61,7 @@ export default defineComponent({
       try {
         const res = await request.get(
           '/api-website/open/subject/queryPage',
-          {data:{rows:9999,page:1}}
+          {params:{rows:9999,page:1}}
         )
 
         state.subjectList = res.data.rows

+ 3 - 4
src/helpers/imageFunction.ts

@@ -54,11 +54,10 @@ export const addWatermark = (canvas, text) => {
   return canvas
 }
 
+
+
 export const convasToImg = canvas => {
-  // var image = new Image()
-  // canvas.toDataURL 返回的是一串Base64编码的URL
-  // 指定格式 PNG
-  // image.src = canvas.toDataURL('image/png')
+
 
   return canvas.toDataURL('image/png')
 }

+ 1 - 1
src/views/albumDetail/index.tsx

@@ -146,7 +146,7 @@ export default defineComponent({
                         </div>
                         <div class={classes.itemBottomR}>
                           <img src={state.details.favorite ?oLineStart:oStart} alt=""     onClick={() => favoriteAlbum()}/>
-                          <span>共{state.details.favorite}人收藏</span>
+                          <span>共{state.details.albumFavoriteCount}人收藏</span>
                         </div>
                       </div>
                       {/* {state.userType == 'STUDENT' ? (

+ 5 - 1
src/views/home/index.tsx

@@ -85,6 +85,10 @@ export default defineComponent({
     const gotoVideoList = () => {
       router.push({ path: '/videoDetailList',  })
     }
+
+    const gotoSearchTag = (tag:any) =>{
+      router.push({ name: 'searchdetail', params: { search: state.search,tag:tag.id,parentTagId:tag.parentTagId } })
+    }
     //
     onMounted(() => {
       getAlbumList()
@@ -155,7 +159,7 @@ export default defineComponent({
                                   class={styles.tags}
                                   title={tag.name}
                                   onSearchTag={() => {
-                                    gotoSearch(tag.name,'')
+                                    gotoSearchTag(tag)
                                   }}
                                 >
                                   {/* {} */}

+ 2 - 2
src/views/muiscDetial/index.tsx

@@ -402,8 +402,8 @@ export default defineComponent({
                         <div class={classes.teacherHeadLeft}>
                           <img
                             src={
-                              state.teacherDetail.avatar
-                                ? state.teacherDetail.avatar
+                              state.teacherDetail.userAvatar
+                                ? state.teacherDetail.userAvatar
                                 : teacherHeader
                             }
                             alt=""

+ 1 - 1
src/views/musicLibrary/index.module.less

@@ -96,7 +96,7 @@
     align-items: center;
     flex-wrap: wrap;
     margin-bottom: 25px;
-    justify-content: space-around;
+    justify-content: flex-start;
     margin-top: 20px;
   }
   .videoList {

+ 8 - 5
src/views/videoDetailList/index.tsx

@@ -1,5 +1,4 @@
 import { defineComponent, toRefs, reactive, onMounted, ref } from 'vue'
-
 // import classes from './index.module.less'
 import styles from './index.module.less'
 import hotSearch from '@/components/hotSearch'
@@ -10,6 +9,10 @@ import pagination from '@/components/pagination'
 import { useRoute } from 'vue-router'
 import ColEmpty from '@/components/col-empty'
 import banner from '@/components/banner'
+import 'swiper/css'
+import 'swiper/css/navigation'
+import 'swiper/css/pagination'
+import 'swiper/css/scrollbar'
 export default defineComponent({
   name: 'videoDetailList',
   props: {
@@ -19,12 +22,13 @@ export default defineComponent({
     }
   },
   components: {
+    banner,
     hotSearch,
     searchInput,
     videoDetailItem,
     pagination,
-    ColEmpty,
-    banner
+
+    ColEmpty
   },
   setup(props, conent) {
     const state = reactive({
@@ -91,9 +95,8 @@ export default defineComponent({
     })
     return () => (
       <>
+        <banner />
         <div>
-          {/* <div class="wall" style={{ height: '60px' }}></div> */}
-          <banner></banner>
           <div class={styles.w1200}>
             <div class={styles.section}>
               <searchInput

+ 4 - 4
src/views/videoDetailList/videoDetail.tsx

@@ -126,7 +126,7 @@ export default defineComponent({
           `/api-website/open/teacher/detail/${res.data.lessonGroup.teacherId}`
         )
         state.teacherDetail = { ...teacherRes.data }
-        state.teacherDetail.styleList = [...res.data.detailList]
+
       } catch (e) {}
     }
 
@@ -296,8 +296,8 @@ export default defineComponent({
                   <span>老师风采</span>
                 </div>
                 <div class={styles.teacherVideoList}>
-                  {state.teacherDetail.styleList &&
-                    state.teacherDetail.styleList.map((item: any) => {
+                  {state.teacherDetail.styleVideo &&
+                    state.teacherDetail.styleVideo.map((item: any) => {
                       return (
                         <div
                           class={styles.videoItem}
@@ -314,7 +314,7 @@ export default defineComponent({
                             src={item.videoUrl}
                             controls={false}
                           ></video> */}
-                          <img  class={styles.videoItemVideo} src={item.coverUrl} alt="" />
+                          <img  class={styles.videoItemVideo} src={item.cover} alt="" />
                           <img src={player} alt="" class={styles.player} />
                         </div>
                       )