Browse Source

乐谱查询功能

黄琪勇 2 weeks ago
parent
commit
37d1e9b484

+ 29 - 0
src/api/pptOperate.ts

@@ -30,3 +30,32 @@ export const getMaterialQueryPage = (data: Record<string, any>) => {
     data
   })
 }
+
+// 获取乐器信息
+export const getSubjectListApi = () => {
+  return httpAxios.axioseRquest({
+    method: "post",
+    url: "/edu-app/subject/list",
+    data: {
+      delFlag: 0,
+      page: 1,
+      rows: 999
+    }
+  })
+}
+// 获取课件教材
+export const getMusicTagTreeApi = () => {
+  return httpAxios.axioseRquest({
+    method: "get",
+    url: "/edu-app/musicTag/tree"
+  })
+}
+
+// 收藏课件 取消收藏
+export const favoriteApi = (data: { favoriteFlag: 0 | 1; materialId: string; type: string }) => {
+  return httpAxios.axioseRquest({
+    method: "post",
+    url: "/edu-app/material/favorite",
+    data
+  })
+}

+ 1 - 1
src/components/Empty/Empty.vue

@@ -8,7 +8,7 @@
 <script setup lang="ts">
 const props = withDefaults(
   defineProps<{
-    text: string
+    text?: string
   }>(),
   {
     text: "暂无内容"

+ 4 - 2
src/components/PopoverMenuItem.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="popover-menu-item" :class="{ center: center }" @click="emit('click')">
+  <div class="popover-menu-item" :class="[center && 'center', active && 'active']" @click="emit('click')">
     <slot></slot>
   </div>
 </template>
@@ -8,6 +8,7 @@
 withDefaults(
   defineProps<{
     center?: boolean
+    active?: boolean
   }>(),
   {
     center: false
@@ -29,7 +30,8 @@ const emit = defineEmits<{
   &.center {
     text-align: center;
   }
-  &:hover {
+  &:hover,
+  &.active {
     background: #f5f6fa;
   }
   & + .popover-menu-item {

+ 8 - 1
src/queryParams/index.ts

@@ -5,16 +5,23 @@ import router from "@/router"
 export type queryParamsType = {
   hideFullScreen: boolean
   fromType: "PLATFORM" | "TEACHER" | "CLASS"
+  instrumentId: string
+  lessonCoursewareKnowledgeId: string
 }
 const queryParams = reactive<queryParamsType>({
   hideFullScreen: false, // 隐藏预览时候的全屏按钮
-  fromType: "TEACHER"
+  fromType: "TEACHER", // 用于区分老师端 平台,或者学生端
+  lessonCoursewareKnowledgeId: "", // 课件id 老师端带过来查相关课件
+  instrumentId: "" // 传过来的乐器值,用于ppt里面云教练带什么乐器
 })
 
 export function initQueryParams() {
   const query = router.currentRoute.value.query
   queryParams.hideFullScreen = !!query.hideFullScreen
   query.fromType && (queryParams.fromType = query.fromType as any)
+  query.lessonCoursewareKnowledgeId && (queryParams.lessonCoursewareKnowledgeId = query.lessonCoursewareKnowledgeId as any)
+  query.instrumentId && (queryParams.instrumentId = query.instrumentId as any)
+  console.log(queryParams, "携带参数")
 }
 
 export default queryParams

+ 1 - 21
src/views/Editor/CanvasTool/index.vue

@@ -225,7 +225,7 @@
         "
       />
     </Modal>
-    <!--<Modal
+    <Modal
       :contentStyle="{
         width: '70%',
         minWidth: '1200px',
@@ -245,26 +245,6 @@
           }
         "
       />
-    </Modal> -->
-    <Modal
-      :contentStyle="{
-        width: '800px',
-        height: '600px',
-        boxShadow: '0px 2px 10px 0px rgba(0,0,0,0.08)',
-        borderRadius: '16px',
-        border: '1px solid #DEDEDE',
-        padding: '0'
-      }"
-      v-model:visible="cloudCoachVisible"
-    >
-      <cloudCoachList
-        @update="handleCloudCoach"
-        @close="
-          () => {
-            cloudCoachVisible = false
-          }
-        "
-      />
     </Modal>
   </div>
 </template>

+ 703 - 50
src/views/components/element/cloudCoachElement/cloudCoachList/cloudCoachList.vue

@@ -1,90 +1,743 @@
 <template>
-  <div class="cloudCoachList" v-loading="loading">
-    <div class="name">乐谱</div>
-    <div class="listCon">
-      <div class="list" v-for="item in listData" :key="item.id">
-        <div>曲目名称:{{ item.name }}</div>
-        <ElButton @click="handleUpdate(item.id)">添加</ElButton>
+  <div class="cloudCoachList">
+    <div class="headCon">
+      <div class="headLeft">
+        <img class="tipImg" src="@/views/Editor/CanvasTool/imgs/yp.png" alt="" />
+        <div class="title">乐谱</div>
+      </div>
+      <div class="headright">
+        <img @click="emits('close')" class="closeBtn" src="./imgs/close.png" alt="" />
       </div>
     </div>
-    <div class="pagination">
-      <el-pagination layout="prev, pager, next" :default-page-size="20" @current-change="handleCurrentChange" :total="paginationData.total" />
+    <div class="content">
+      <div class="tabTools">
+        <div class="tabCon">
+          <div
+            class="tab"
+            @click="handleTabChange(item.value)"
+            :class="{ active: item.value === queryData.sourceType }"
+            v-for="item in tabData"
+            :key="item.value"
+          >
+            {{ item.label }}
+          </div>
+        </div>
+        <div class="query">
+          <Input :placeholder="'请输入搜索关键词'" v-model:value="queryData.name">
+            <template #prefix>
+              <img class="img" src="./imgs/query.png" alt="" />
+            </template>
+            <template #suffix>
+              <div class="queryBtn" @click="handleQuery">搜索</div>
+            </template>
+          </Input>
+        </div>
+      </div>
+      <div class="musicListCon">
+        <div class="queryFrom">
+          <div v-show="queryData.sourceType === 2" class="queryFromList">
+            <div class="tit">教程:</div>
+            <div class="queryFromCon">
+              <div
+                v-for="item in musicTagList"
+                :key="item.id"
+                @click="handleMusicTagChange(item.id)"
+                :class="['queryTip', queryData.bookVersionId === item.id && 'active']"
+              >
+                {{ item.name }}
+              </div>
+            </div>
+          </div>
+          <div v-show="queryData.sourceType !== 3" class="queryFromList">
+            <div class="tit">场景:</div>
+            <div class="queryFromCon">
+              <div
+                v-for="item in audioPlayTypesOption"
+                :key="item.value"
+                @click="handleAudioPlayTypesChange(item.value)"
+                :class="['queryTip', queryData.audioPlayTypes === item.value && 'active']"
+              >
+                {{ item.text }}
+              </div>
+            </div>
+          </div>
+          <div v-show="queryData.audioPlayTypes !== 'SING'" class="queryFromList">
+            <div class="tit">乐器:</div>
+            <div class="queryFromCon">
+              <template v-for="item in subjectList">
+                <div
+                  :class="['queryTip', queryData.subject.id === item.instruments[0].id && 'active']"
+                  @click="handleSubjectChange(item.instruments[0])"
+                  v-if="item.instruments.length === 1"
+                  :key="item.id"
+                >
+                  {{ item.instruments[0].name }}
+                </div>
+                <Popover v-model:value="item.isExpand" trigger="mouseenter" v-else :offset="-4" :key="item.id + '_'">
+                  <template #content>
+                    <PopoverMenuItem
+                      @click="
+                        () => {
+                          item.isExpand = false
+                          handleSubjectChange(row)
+                        }
+                      "
+                      v-for="row in item.instruments"
+                      :key="row.id"
+                      :active="row.id === queryData.subject.id"
+                      >{{ row.name }}</PopoverMenuItem
+                    >
+                  </template>
+                  <div class="queryTip" :class="{ hoverActive: isActiveSubjectPop(item) }">
+                    <div>{{ isActiveSubjectPop(item) ? queryData.subject.name : item.name }}</div>
+                    <img src="./imgs/jt.png" alt="" />
+                  </div>
+                </Popover>
+              </template>
+            </div>
+          </div>
+        </div>
+        <div class="musicListConBox" v-loading="loading">
+          <div class="musicList" :class="{ empty: !musicList.length && !loading }">
+            <div class="musicListBox" v-if="musicList.length && !loading">
+              <div class="musicCon" v-for="item in musicList" :key="item.id">
+                <div class="musicLeft">
+                  <div class="iconCon">
+                    <img class="icon" :src="item.titleImg" alt="" />
+                    <img v-if="item.sourceFrom === 'PLATFORM'" class="jxImg" src="./imgs/jx.png" alt="" />
+                  </div>
+                  <div class="musicInfo">
+                    <EllipsisScroll class="musicTit" :title="item.name || ''" />
+                    <div class="info">
+                      <div class="hotInfo" v-if="item.usedNum">
+                        <img src="./imgs/hot.png" alt="" />
+                        <div>{{ formatNumber(item.usedNum) }}</div>
+                      </div>
+                      <div class="play" v-if="item.audioPlayTypes?.includes('SING')">演唱</div>
+                      <div class="sing" v-if="item.audioPlayTypes?.includes('PLAY')">演奏</div>
+                      <div class="musicUserName">
+                        <EllipsisScroll :title="item.composer || ''" />
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <div class="musicRight">
+                  <img class="sc" @click="handleFavorite(item)" :src="item.favoriteFlag ? scActImg : scImg" alt="" />
+                  <div class="addBtn" @click="handleAddMusic(item.id)">添加</div>
+                </div>
+              </div>
+            </div>
+            <Empty v-if="!musicList.length && !loading" />
+          </div>
+          <div class="pagination" v-show="musicList.length">
+            <el-pagination layout="prev, pager, next" :default-page-size="21" @current-change="handleCurrentChange" :total="queryData.total" />
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ElButton, ElLoading, ElPagination } from "element-plus"
-import { getMaterialQueryPage } from "@/api/pptOperate"
+import { ElLoading, ElPagination } from "element-plus"
+import Input from "@/components/Input.vue"
+import Popover from "@/components/Popover.vue"
+import PopoverMenuItem from "@/components/PopoverMenuItem.vue"
+import Empty from "@/components/Empty"
+import EllipsisScroll from "@/components/ellipsisScroll"
+import { reactive, ref } from "vue"
+import { getMaterialQueryPage, getSubjectListApi, getMusicTagTreeApi, favoriteApi } from "@/api/pptOperate"
 import { httpAjax } from "@/plugins/httpAjax"
-import { ref, reactive } from "vue"
+import queryParams from "@/queryParams"
+import scActImg from "./imgs/scAct.png"
+import scImg from "./imgs/sc.png"
 
-const emit = defineEmits<{
+const emits = defineEmits<{
   (event: "update", id: string): void
+  (event: "close"): void
 }>()
-function handleUpdate(id: string) {
-  emit("update", id)
-}
 
-const vLoading = ElLoading.directive
-const loading = ref(false)
+function handleAddMusic(id: string) {
+  emits("update", id)
+  emits("close")
+}
 
-const listData = ref<any[]>([])
+const tabData = [
+  {
+    label: "相关资源",
+    value: 5
+  },
+  {
+    label: "共享资源",
+    value: 2
+  },
+  {
+    label: "我的资源",
+    value: 3
+  },
+  {
+    label: "我的收藏",
+    value: 4
+  }
+]
+// 场景
+const audioPlayTypesOption = [
+  { text: "全部", value: "" },
+  { text: "演唱", value: "SING" },
+  { text: "演奏", value: "PLAY" },
+  { text: "演唱+演奏", value: "PLAY,SING" }
+]
+// 教程
+const musicTagList = ref<any[]>([])
+// 乐器
+const subjectList = ref<any[]>([])
 
-const paginationData = reactive({
+const queryData = reactive({
   page: 1,
-  total: 0
+  rows: 21,
+  total: 0,
+  sourceType: 5,
+  name: "",
+  bookVersionId: "",
+  audioPlayTypes: "",
+  subject: {
+    id: "",
+    name: ""
+  }
 })
 
-function handleCurrentChange(e: number) {
-  paginationData.page = e
-  queryFun()
+const musicList = ref<any[]>([])
+const loading = ref(true)
+const vLoading = ElLoading.directive
+
+getQueryList()
+function getQueryList() {
+  Promise.all([httpAjax(getSubjectListApi), httpAjax(getMusicTagTreeApi)]).then(res => {
+    const [subjectListRes, musicTagTreeRes] = res
+    if (subjectListRes.code === 200) {
+      subjectList.value = subjectListRes.data.map((item: any) => {
+        return item.instruments.length > 1 ? Object.assign(item, { isExpand: ref(false) }) : item
+      })
+      // 赋默认值
+      handleSubjectDefault()
+    }
+    if (musicTagTreeRes.code === 200) {
+      musicTagList.value = [
+        { id: "", name: "全部" },
+        ...musicTagTreeRes.data.map((item: any) => {
+          return {
+            id: item.id,
+            name: item.name
+          }
+        })
+      ]
+    }
+    handleQuery()
+  })
+}
+function handleSubjectDefault() {
+  if (subjectList.value.length > 0) {
+    const instruments = subjectList.value.reduce((arr, item) => {
+      arr.push(...item.instruments)
+      return arr
+    }, [])
+    const instrumentId = queryParams.instrumentId
+    // 有id 就用id,没有就默认第一个
+    const instrumentObj = instrumentId
+      ? instruments.find((i: any) => {
+          return i.id === instrumentId
+        })
+      : instruments[0]
+    if (instrumentObj) {
+      queryData.subject.id = instrumentObj.id
+      queryData.subject.name = instrumentObj.name
+    }
+  }
+}
+function clearQueryData() {
+  queryData.page = 1
+  queryData.rows = 21
+  queryData.total = 0
+  queryData.sourceType = 5
+  queryData.name = ""
+  queryData.bookVersionId = ""
+  queryData.audioPlayTypes = ""
+  queryData.subject = {
+    id: "",
+    name: ""
+  }
+  handleSubjectDefault()
+}
+function handleTabChange(sourceType: number) {
+  clearQueryData()
+  queryData.sourceType = sourceType
+  handleQuery()
+}
+function handleMusicTagChange(id: string) {
+  queryData.bookVersionId = id
+  handleQuery()
+}
+function handleAudioPlayTypesChange(value: string) {
+  queryData.audioPlayTypes = value
+  handleQuery()
+}
+function handleSubjectChange(item: any) {
+  queryData.subject.id = item.id
+  queryData.subject.name = item.name
+  handleQuery()
+}
+function isActiveSubjectPop(item: any) {
+  return item.instruments.some((i: any) => {
+    return i.id === queryData.subject.id
+  })
 }
 
-queryFun()
-function queryFun() {
+function handleCurrentChange(e: number) {
+  queryData.page = e
+  handleGetQuery()
+}
+function handleQuery() {
+  queryData.page = 1
+  queryData.rows = 21
+  handleGetQuery()
+}
+function handleGetQuery() {
   loading.value = true
-  httpAjax(getMaterialQueryPage, {
-    type: "MUSIC",
-    sourceType: 2,
-    enableFlag: true,
-    page: paginationData.page,
-    rows: 20
-  }).then(res => {
+  let { sourceType, subject, audioPlayTypes, name, page, rows, bookVersionId } = queryData
+  let musicalInstrumentId = subject.id
+  const audioPlayTypesParams = audioPlayTypes ? audioPlayTypes.split(",") : []
+  let params: any
+  // 相关资源
+  if (sourceType === 5) {
+    if (audioPlayTypesParams[0] === "SING") {
+      musicalInstrumentId = ""
+    }
+    params = {
+      name,
+      type: "MUSIC",
+      sourceType,
+      musicalInstrumentId,
+      enableFlag: true,
+      page,
+      rows,
+      audioPlayTypes: audioPlayTypesParams,
+      lessonCoursewareKnowledgeId: queryParams.lessonCoursewareKnowledgeId
+    }
+  }
+  if (sourceType === 2) {
+    if (audioPlayTypesParams[0] === "SING") {
+      musicalInstrumentId = ""
+    }
+    params = {
+      name,
+      type: "MUSIC",
+      sourceType,
+      musicalInstrumentId,
+      enableFlag: true,
+      page,
+      rows,
+      audioPlayTypes: audioPlayTypesParams,
+      lessonCoursewareKnowledgeId: queryParams.lessonCoursewareKnowledgeId,
+      bookVersionId
+    }
+  }
+  if (sourceType === 3) {
+    params = {
+      name,
+      type: "MUSIC",
+      sourceType,
+      musicalInstrumentId,
+      enableFlag: true,
+      page,
+      rows
+    }
+  }
+  if (sourceType === 4) {
+    if (audioPlayTypesParams[0] === "SING") {
+      musicalInstrumentId = ""
+    }
+    params = {
+      name,
+      type: "MUSIC",
+      sourceType,
+      musicalInstrumentId,
+      enableFlag: true,
+      page,
+      rows,
+      audioPlayTypes: audioPlayTypesParams
+    }
+  }
+  httpAjax(getMaterialQueryPage, params).then(res => {
+    if (res.code === 200) {
+      musicList.value = res.data.rows
+      queryData.total = res.data.total
+    }
     loading.value = false
+  })
+}
+
+function handleFavorite(item: any) {
+  httpAjax(favoriteApi, {
+    favoriteFlag: item.favoriteFlag ? 0 : 1,
+    materialId: item.id,
+    type: "MUSIC"
+  }).then(res => {
     if (res.code === 200) {
-      listData.value = res.data.rows
-      paginationData.total = res.data.total
+      item.favoriteFlag = !item.favoriteFlag
     }
   })
 }
+function formatNumber(num: number) {
+  return num >= 10000 ? (num / 10000).toFixed(1).replace(/\.0$/, "") + "万" : num.toString()
+}
 </script>
 
 <style lang="scss" scoped>
 .cloudCoachList {
-  padding: 40px 40px 20px 40px;
   width: 100%;
   height: 100%;
-  .name {
-    height: 40px;
-    font-size: 20px;
+  .headCon {
+    width: 100%;
+    height: 64px;
+    border-bottom: 1px solid #eaeaea;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .headLeft {
+      margin-left: 30px;
+      display: flex;
+      align-items: center;
+      .tipImg {
+        width: 24px;
+        height: 24px;
+      }
+      .title {
+        font-weight: 600;
+        font-size: 18px;
+        color: #131415;
+        margin-left: 8px;
+      }
+    }
+    .headright {
+      margin-right: 30px;
+      display: flex;
+      align-items: center;
+      .closeBtn {
+        width: 24px;
+        height: 24px;
+        cursor: pointer;
+        &:hover {
+          opacity: 0.8;
+        }
+      }
+    }
   }
-  .listCon {
-    height: calc(100% - 100px);
-    overflow: auto;
-    .list {
+  .content {
+    width: 100%;
+    height: calc(100% - 64px);
+    .tabTools {
+      height: 72px;
+      width: 100%;
+      padding: 18px 30px;
       display: flex;
       justify-content: space-between;
       align-items: center;
-      height: 40px;
+      .tabCon {
+        display: flex;
+        .tab {
+          margin-right: 32px;
+          font-weight: 400;
+          font-size: 16px;
+          color: #8b8d98;
+          line-height: 22px;
+          cursor: pointer;
+          &:hover {
+            opacity: 0.8;
+          }
+          &:last-child {
+            margin-right: 0;
+          }
+          &.active {
+            font-weight: 600;
+            color: #131415;
+            position: relative;
+            &::after {
+              content: "";
+              position: absolute;
+              width: 100%;
+              height: 10px;
+              background: linear-gradient(90deg, #77bbff 0%, rgba(163, 231, 255, 0.22) 100%);
+              bottom: 0;
+              left: 0;
+              z-index: -1;
+            }
+          }
+        }
+      }
+      .query {
+        width: 400px;
+        height: 36px;
+        &::v-deep(.input) {
+          align-items: center;
+          padding: 0 3px 0 12px;
+          border-radius: 18px;
+          height: 100%;
+          &:not(.disabled):hover,
+          &.focused {
+            .img {
+              opacity: 1;
+            }
+            .queryBtn {
+              opacity: 1;
+            }
+          }
+          input {
+            font-size: 14px;
+          }
+          .img {
+            width: 16px;
+            height: 16px;
+            opacity: 0.4;
+          }
+          .queryBtn {
+            width: 60px;
+            height: 30px;
+            background: #198cfe;
+            border-radius: 16px;
+            font-weight: 500;
+            font-size: 14px;
+            color: #ffffff;
+            line-height: 30px;
+            text-align: center;
+            opacity: 0.4;
+            cursor: pointer;
+            &:hover {
+              opacity: 0.8 !important;
+            }
+          }
+        }
+      }
+    }
+    .musicListCon {
+      width: 100%;
+      height: calc(100% - 72px);
+      display: flex;
+      flex-direction: column;
+      .queryFrom {
+        padding: 0 30px;
+        .queryFromList {
+          display: flex;
+          margin-bottom: 4px;
+          .tit {
+            flex-shrink: 0;
+            font-weight: 500;
+            font-size: 14px;
+            color: #131415;
+            line-height: 32px;
+            margin-right: 16px;
+          }
+          .queryFromCon {
+            display: flex;
+            flex-wrap: wrap;
+            .queryTip {
+              margin: 0 16px 12px 0;
+              font-weight: 400;
+              font-size: 14px;
+              color: rgba(0, 0, 0, 0.6);
+              line-height: 20px;
+              padding: 6px 16px;
+              background: #f5f6fa;
+              border-radius: 6px;
+              cursor: pointer;
+              display: flex;
+              align-items: center;
+              & > img {
+                width: 7px;
+                height: 4px;
+                margin-left: 6px;
+              }
+              &.active,
+              &:hover {
+                background: #d2ecff;
+                color: rgba(0, 0, 0, 1);
+                > img {
+                  transform: rotate(180deg);
+                }
+              }
+              &.hoverActive {
+                background: #d2ecff;
+                color: rgba(0, 0, 0, 1);
+              }
+            }
+          }
+        }
+      }
+      .musicListConBox {
+        flex-grow: 1;
+        overflow: hidden;
+        .musicList {
+          padding: 4px 0;
+          height: calc(100% - 60px);
+          overflow: auto;
+          &.empty {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+          }
+          .musicListBox {
+            width: calc(100% + 24px);
+            margin-left: -24px;
+            display: flex;
+            flex-wrap: wrap;
+            padding: 0 30px;
+            .musicCon {
+              margin-bottom: 24px;
+              width: calc(33.3333% - 24px);
+              margin-left: 24px;
+              padding: 16px;
+              background: #f5f6fa;
+              border-radius: 12px;
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              &:nth-last-child(-n + 3) {
+                margin-bottom: 0;
+              }
+              &:hover {
+                outline: 2px solid #198cfe;
+              }
+              .musicLeft {
+                display: flex;
+                align-items: center;
+                margin-right: 14px;
+                overflow: hidden;
+                .iconCon {
+                  position: relative;
+                  .icon {
+                    width: 70px;
+                    height: 70px;
+                    border-radius: 8px;
+                  }
+                  .jxImg {
+                    position: absolute;
+                    left: 0;
+                    top: 0;
+                    width: 34px;
+                    height: 16px;
+                  }
+                }
+                .musicInfo {
+                  margin-left: 12px;
+                  overflow: hidden;
+                  .musicTit {
+                    font-weight: 600;
+                    font-size: 15px;
+                    color: #131415;
+                    line-height: 21px;
+                  }
+                  .info {
+                    margin-top: 13px;
+                    display: flex;
+                    align-items: center;
+                    .hotInfo {
+                      margin-right: 4px;
+                      padding: 0 4px;
+                      background: #fff3f3;
+                      border-radius: 3px;
+                      border: 1px solid rgba(254, 67, 67, 0.5);
+                      display: flex;
+                      align-items: center;
+                      justify-content: center;
+                      flex-shrink: 0;
+                      line-height: 16px;
+                      & > img {
+                        width: 10px;
+                        height: 12px;
+                      }
+                      & > div {
+                        margin-left: 2px;
+                        font-weight: 400;
+                        font-size: 12px;
+                        color: #fe4343;
+                      }
+                    }
+                    .play {
+                      margin-right: 4px;
+                      flex-shrink: 0;
+                      padding: 0 4px;
+                      background: #ffffff;
+                      border-radius: 3px;
+                      border: 1px solid rgba(243, 130, 26, 0.5);
+                      font-weight: 400;
+                      font-size: 12px;
+                      color: #f3821a;
+                      line-height: 16px;
+                      text-align: center;
+                    }
+                    .sing {
+                      margin-right: 4px;
+                      flex-shrink: 0;
+                      padding: 0 4px;
+                      background: #ffffff;
+                      border-radius: 3px;
+                      border: 1px solid rgba(21, 178, 253, 0.5);
+                      font-weight: 400;
+                      font-size: 12px;
+                      color: #00adff;
+                      line-height: 16px;
+                      text-align: center;
+                    }
+                    .musicUserName {
+                      overflow: hidden;
+                      font-weight: 400;
+                      font-size: 13px;
+                      color: #777777;
+                      line-height: 16px;
+                    }
+                  }
+                }
+              }
+              .musicRight {
+                flex-shrink: 0;
+                display: flex;
+                align-items: center;
+                .sc {
+                  width: 26px;
+                  height: 26px;
+                  cursor: pointer;
+                  &:hover {
+                    opacity: 0.8;
+                  }
+                }
+                .addBtn {
+                  margin-left: 12px;
+                  width: 58px;
+                  height: 26px;
+                  background: #198cfe;
+                  border-radius: 4px;
+                  font-weight: 600;
+                  font-size: 13px;
+                  color: #ffffff;
+                  line-height: 26px;
+                  text-align: center;
+                  cursor: pointer;
+                  &:hover {
+                    opacity: 0.8;
+                  }
+                }
+              }
+            }
+          }
+        }
+        .pagination {
+          padding: 0 30px;
+          display: flex;
+          justify-content: flex-end;
+          align-items: center;
+          height: 60px;
+        }
+      }
     }
-  }
-  .pagination {
-    margin-top: 20px;
-    display: flex;
-    justify-content: flex-end;
-    align-items: center;
-    height: 40px;
   }
 }
 </style>

+ 0 - 606
src/views/components/element/cloudCoachElement/cloudCoachList/cloudCoachList123.vue

@@ -1,606 +0,0 @@
-<template>
-  <div class="cloudCoachList">
-    <div class="headCon">
-      <div class="headLeft">
-        <img class="tipImg" src="@/views/Editor/CanvasTool/imgs/yp.png" alt="" />
-        <div class="title">乐谱</div>
-      </div>
-      <div class="headright">
-        <img @click="emits('close')" class="closeBtn" src="./imgs/close.png" alt="" />
-      </div>
-    </div>
-    <div class="content">
-      <div class="tabTools">
-        <div class="tabCon">
-          <div class="tab" :class="{ active: item.value === querData.tab }" v-for="item in tabData" :key="item.value">{{ item.label }}</div>
-        </div>
-        <div class="query">
-          <Input :placeholder="'请输入搜索关键词'" v-model:value="querData.value">
-            <template #prefix>
-              <img class="img" src="./imgs/query.png" alt="" />
-            </template>
-            <template #suffix>
-              <div class="queryBtn">搜索</div>
-            </template>
-          </Input>
-        </div>
-      </div>
-      <div class="musicListCon">
-        <div class="queryFrom">
-          <div class="queryFromList">
-            <div class="tit">标签:</div>
-            <div class="queryFromCon">
-              <div class="queryTip active">全部</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-            </div>
-          </div>
-          <div class="queryFromList">
-            <div class="tit">标签:</div>
-            <div class="queryFromCon">
-              <div class="queryTip">全部</div>
-              <div class="queryTip active">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <div class="queryTip">最新</div>
-              <Popover trigger="mouseenter" :offset="-4">
-                <template #content>
-                  <PopoverMenuItem>英式竖笛</PopoverMenuItem>
-                  <PopoverMenuItem>德式竖笛</PopoverMenuItem>
-                </template>
-                <div class="queryTip" :class="{ hoverActive: true }">
-                  <div>我是</div>
-                  <img src="./imgs/jt.png" alt="" />
-                </div>
-              </Popover>
-            </div>
-          </div>
-          <div class="isExpand" :class="{ active: isExpand }">
-            <div>{{ isExpand ? "收起" : "展开" }}</div>
-            <img src="./imgs/jiao.png" alt="" />
-          </div>
-        </div>
-        <!-- <div class="musicList empty"> -->
-        <div class="musicList">
-          <div class="musicListBox">
-            <div class="musicCon">
-              <div class="musicLeft">
-                <div class="iconCon">
-                  <img class="icon" src="" alt="" />
-                  <img class="jxImg" src="./imgs/jx.png" alt="" />
-                </div>
-                <div class="musicInfo">
-                  <EllipsisScroll class="musicTit" :title="'流浪地球流浪地球流浪地球流浪地球'" />
-                  <div class="info">
-                    <div class="hotInfo">
-                      <img src="./imgs/hot.png" alt="" />
-                      <div>1.8万</div>
-                    </div>
-                    <div class="play">演唱</div>
-                    <div class="sing">演奏</div>
-                    <div class="musicUserName">
-                      <EllipsisScroll :title="'耶寒尔'" />
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="musicRight">
-                <img class="sc" src="./imgs/sc.png" alt="" />
-                <div class="addBtn">添加</div>
-              </div>
-            </div>
-            <div class="musicCon">
-              <div class="musicLeft">
-                <div class="iconCon">
-                  <img class="icon" src="" alt="" />
-                  <img class="jxImg" src="./imgs/jx.png" alt="" />
-                </div>
-                <div class="musicInfo">
-                  <EllipsisScroll class="musicTit" :title="'流浪地球流浪地球流浪地球流浪地球'" />
-                  <div class="info">
-                    <div class="hotInfo">
-                      <img src="./imgs/hot.png" alt="" />
-                      <div>1.8万</div>
-                    </div>
-                    <div class="play">演唱</div>
-                    <div class="sing">演奏</div>
-                    <div class="musicUserName">
-                      <EllipsisScroll :title="'耶寒尔'" />
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="musicRight">
-                <img class="sc" src="./imgs/sc.png" alt="" />
-                <div class="addBtn">添加</div>
-              </div>
-            </div>
-            <div class="musicCon">
-              <div class="musicLeft">
-                <div class="iconCon">
-                  <img class="icon" src="" alt="" />
-                  <img class="jxImg" src="./imgs/jx.png" alt="" />
-                </div>
-                <div class="musicInfo">
-                  <EllipsisScroll class="musicTit" :title="'流浪地球流浪地球流浪地球流浪地球'" />
-                  <div class="info">
-                    <div class="hotInfo">
-                      <img src="./imgs/hot.png" alt="" />
-                      <div>1.8万</div>
-                    </div>
-                    <div class="play">演唱</div>
-                    <div class="sing">演奏</div>
-                    <div class="musicUserName">
-                      <EllipsisScroll :title="'耶寒尔'" />
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="musicRight">
-                <img class="sc" src="./imgs/sc.png" alt="" />
-                <div class="addBtn">添加</div>
-              </div>
-            </div>
-            <div class="musicCon">
-              <div class="musicLeft">
-                <div class="iconCon">
-                  <img class="icon" src="" alt="" />
-                  <img class="jxImg" src="./imgs/jx.png" alt="" />
-                </div>
-                <div class="musicInfo">
-                  <EllipsisScroll class="musicTit" :title="'流浪地球流浪地球流浪地球流浪地球'" />
-                  <div class="info">
-                    <div class="hotInfo">
-                      <img src="./imgs/hot.png" alt="" />
-                      <div>1.8万</div>
-                    </div>
-                    <div class="play">演唱</div>
-                    <div class="sing">演奏</div>
-                    <div class="musicUserName">
-                      <EllipsisScroll :title="'耶寒尔'" />
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="musicRight">
-                <img class="sc" src="./imgs/sc.png" alt="" />
-                <div class="addBtn">添加</div>
-              </div>
-            </div>
-          </div>
-          <!-- <Empty /> -->
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { ElButton } from "element-plus"
-import Input from "@/components/Input.vue"
-import Popover from "@/components/Popover.vue"
-import PopoverMenuItem from "@/components/PopoverMenuItem.vue"
-import Empty from "@/components/Empty"
-import EllipsisScroll from "@/components/ellipsisScroll"
-import { reactive, ref } from "vue"
-
-const emits = defineEmits<{
-  (event: "update", id: string): void
-  (event: "close"): void
-}>()
-function handleUpdate() {
-  emits("update", "1760123974848413697")
-}
-
-const tabData = [
-  {
-    label: "相关资源",
-    value: "1"
-  },
-  {
-    label: "共享资源",
-    value: "2"
-  },
-  {
-    label: "我的资源",
-    value: "3"
-  },
-  {
-    label: "我的收藏",
-    value: "4"
-  }
-]
-
-const isExpand = ref(true)
-
-const querData = reactive({
-  tab: "1",
-  value: ""
-})
-</script>
-
-<style lang="scss" scoped>
-.cloudCoachList {
-  width: 100%;
-  height: 100%;
-  position: relative;
-  &::after {
-    width: 100%;
-    content: "";
-    position: absolute;
-    width: 100%;
-    height: 100px;
-    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
-    bottom: 0;
-    left: 0;
-  }
-  .headCon {
-    width: 100%;
-    height: 64px;
-    border-bottom: 1px solid #eaeaea;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .headLeft {
-      margin-left: 30px;
-      display: flex;
-      align-items: center;
-      .tipImg {
-        width: 24px;
-        height: 24px;
-      }
-      .title {
-        font-weight: 600;
-        font-size: 18px;
-        color: #131415;
-        margin-left: 8px;
-      }
-    }
-    .headright {
-      margin-right: 30px;
-      display: flex;
-      align-items: center;
-      .closeBtn {
-        width: 24px;
-        height: 24px;
-        cursor: pointer;
-        &:hover {
-          opacity: 0.8;
-        }
-      }
-    }
-  }
-  .content {
-    width: 100%;
-    height: calc(100% - 64px);
-    .tabTools {
-      height: 72px;
-      width: 100%;
-      padding: 18px 30px;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      .tabCon {
-        display: flex;
-        .tab {
-          margin-right: 32px;
-          font-weight: 400;
-          font-size: 16px;
-          color: #8b8d98;
-          line-height: 22px;
-          cursor: pointer;
-          &:hover {
-            opacity: 0.8;
-          }
-          &:last-child {
-            margin-right: 0;
-          }
-          &.active {
-            font-weight: 600;
-            color: #131415;
-            position: relative;
-            &::after {
-              content: "";
-              position: absolute;
-              width: 100%;
-              height: 10px;
-              background: linear-gradient(90deg, #77bbff 0%, rgba(163, 231, 255, 0.22) 100%);
-              bottom: 0;
-              left: 0;
-              z-index: -1;
-            }
-          }
-        }
-      }
-      .query {
-        width: 400px;
-        height: 36px;
-        &::v-deep(.input) {
-          align-items: center;
-          padding: 0 3px 0 12px;
-          border-radius: 18px;
-          height: 100%;
-          &:not(.disabled):hover,
-          &.focused {
-            .img {
-              opacity: 1;
-            }
-            .queryBtn {
-              opacity: 1;
-            }
-          }
-          input {
-            font-size: 14px;
-          }
-          .img {
-            width: 16px;
-            height: 16px;
-            opacity: 0.4;
-          }
-          .queryBtn {
-            width: 60px;
-            height: 30px;
-            background: #198cfe;
-            border-radius: 16px;
-            font-weight: 500;
-            font-size: 14px;
-            color: #ffffff;
-            line-height: 30px;
-            text-align: center;
-            opacity: 0.4;
-            cursor: pointer;
-            &:hover {
-              opacity: 0.8 !important;
-            }
-          }
-        }
-      }
-    }
-    .musicListCon {
-      width: 100%;
-      height: calc(100% - 72px);
-      overflow: auto;
-      overflow: overlay;
-      display: flex;
-      flex-direction: column;
-      .queryFrom {
-        padding: 0 30px;
-        .queryFromList {
-          display: flex;
-          margin-bottom: 4px;
-          .tit {
-            flex-shrink: 0;
-            font-weight: 500;
-            font-size: 14px;
-            color: #131415;
-            line-height: 32px;
-            margin-right: 16px;
-          }
-          .queryFromCon {
-            display: flex;
-            flex-wrap: wrap;
-            .queryTip {
-              margin: 0 16px 12px 0;
-              font-weight: 400;
-              font-size: 14px;
-              color: rgba(0, 0, 0, 0.6);
-              line-height: 20px;
-              padding: 6px 16px;
-              background: #f5f6fa;
-              border-radius: 6px;
-              cursor: pointer;
-              display: flex;
-              align-items: center;
-              & > img {
-                width: 7px;
-                height: 4px;
-                margin-left: 6px;
-              }
-              &.active,
-              &:hover {
-                background: #d2ecff;
-                color: rgba(0, 0, 0, 1);
-              }
-              &.hoverActive {
-                > img {
-                  transform: rotate(180deg);
-                }
-              }
-            }
-          }
-        }
-        .isExpand {
-          margin-bottom: 16px;
-          cursor: pointer;
-          display: flex;
-          justify-content: center;
-          font-weight: 400;
-          font-size: 14px;
-          color: #198cfe;
-          line-height: 20px;
-          align-items: center;
-          &:hover {
-            opacity: 0.8;
-          }
-          &.active > img {
-            transform: rotate(180deg);
-          }
-          & > img {
-            margin-left: 4px;
-            width: 10px;
-            height: 10px;
-          }
-        }
-      }
-      .musicList {
-        display: flex;
-        padding: 0 30px;
-        &.empty {
-          flex-grow: 1;
-          justify-content: center;
-          align-items: center;
-        }
-        .musicListBox {
-          width: calc(100% + 24px);
-          margin-left: -24px;
-          display: flex;
-          flex-wrap: wrap;
-          .musicCon {
-            margin-bottom: 24px;
-            width: calc(33.3333% - 24px);
-            margin-left: 24px;
-            padding: 16px;
-            background: #f5f6fa;
-            border-radius: 12px;
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            &:hover {
-              outline: 2px solid #198cfe;
-            }
-            .musicLeft {
-              display: flex;
-              align-items: center;
-              margin-right: 14px;
-              overflow: hidden;
-              .iconCon {
-                position: relative;
-                .icon {
-                  width: 70px;
-                  height: 70px;
-                  border-radius: 8px;
-                }
-                .jxImg {
-                  position: absolute;
-                  left: 0;
-                  top: 0;
-                  width: 34px;
-                  height: 16px;
-                }
-              }
-              .musicInfo {
-                margin-left: 12px;
-                overflow: hidden;
-                .musicTit {
-                  font-weight: 600;
-                  font-size: 15px;
-                  color: #131415;
-                  line-height: 21px;
-                }
-                .info {
-                  margin-top: 13px;
-                  display: flex;
-                  align-items: center;
-                  .hotInfo {
-                    margin-right: 4px;
-                    padding: 0 4px;
-                    background: #fff3f3;
-                    border-radius: 3px;
-                    border: 1px solid rgba(254, 67, 67, 0.5);
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                    flex-shrink: 0;
-                    line-height: 16px;
-                    & > img {
-                      width: 10px;
-                      height: 12px;
-                    }
-                    & > div {
-                      font-weight: 400;
-                      font-size: 12px;
-                      color: #fe4343;
-                    }
-                  }
-                  .play {
-                    margin-right: 4px;
-                    flex-shrink: 0;
-                    padding: 0 4px;
-                    background: #ffffff;
-                    border-radius: 3px;
-                    border: 1px solid rgba(243, 130, 26, 0.5);
-                    font-weight: 400;
-                    font-size: 12px;
-                    color: #f3821a;
-                    line-height: 16px;
-                    text-align: center;
-                  }
-                  .sing {
-                    margin-right: 4px;
-                    flex-shrink: 0;
-                    padding: 0 4px;
-                    background: #ffffff;
-                    border-radius: 3px;
-                    border: 1px solid rgba(21, 178, 253, 0.5);
-                    font-weight: 400;
-                    font-size: 12px;
-                    color: #00adff;
-                    line-height: 16px;
-                    text-align: center;
-                  }
-                  .musicUserName {
-                    overflow: hidden;
-                    font-weight: 400;
-                    font-size: 13px;
-                    color: #777777;
-                    line-height: 16px;
-                  }
-                }
-              }
-            }
-            .musicRight {
-              flex-shrink: 0;
-              display: flex;
-              align-items: center;
-              .sc {
-                width: 26px;
-                height: 26px;
-                cursor: pointer;
-                &:hover {
-                  opacity: 0.8;
-                }
-              }
-              .addBtn {
-                margin-left: 12px;
-                width: 58px;
-                height: 26px;
-                background: #198cfe;
-                border-radius: 4px;
-                font-weight: 600;
-                font-size: 13px;
-                color: #ffffff;
-                line-height: 26px;
-                text-align: center;
-                cursor: pointer;
-                &:hover {
-                  opacity: 0.8;
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
-</style>

BIN
src/views/components/element/cloudCoachElement/cloudCoachList/imgs/jiao.png


+ 2 - 1
src/views/components/element/cloudCoachElement/cloudCoachPlayer/cloudCoachPlayer.vue

@@ -19,6 +19,7 @@
 import { ref, computed } from "vue"
 import { getToken } from "@/libs/auth"
 import { YJL_URL_API } from "@/config/index"
+import queryParams from "@/queryParams"
 
 const props = withDefaults(
   defineProps<{
@@ -32,7 +33,7 @@ const props = withDefaults(
   }
 )
 const url = computed(() => {
-  return `${YJL_URL_API}?v=${Date.now()}&showGuide=true&showWebGuide=false&platform=pc&imagePos=right&zoom=0.8&modelType=practise&instrumentId=&iscurseplay=play&id=${props.id}&Authorization=${getToken()}`
+  return `${YJL_URL_API}?v=${Date.now()}&showGuide=true&showWebGuide=false&platform=pc&imagePos=right&zoom=0.8&modelType=practise&instrumentId=${queryParams.instrumentId}&iscurseplay=play&id=${props.id}&Authorization=${getToken()}`
 })
 
 // 先关闭这个功能