Browse Source

更新修改数据

lex 1 year ago
parent
commit
8317ae0221

+ 4 - 15
src/components/card-type/index.module.less

@@ -15,7 +15,7 @@
   height: 220px;
   border-radius: 14px;
   overflow: hidden;
-  background: linear-gradient(270deg, #DBF1FF 0%, #E7F9FF 100%);
+  background: linear-gradient(270deg, #DBF1FF 0%, #E7F9FF 100%) !important;
   display: inline-flex;
 
   // 鼠标经过时样式
@@ -40,9 +40,11 @@
   .cover {
     width: 100%;
     height: 170px;
+    background-color: #fff;
 
     img {
-      height: inherit;
+      height: fit-content;
+      min-height: 100%;
     }
   }
 
@@ -50,19 +52,6 @@
     transition: all .3s ease-in-out;
   }
 
-  // 封面样式
-  .cover {
-    width: 100%;
-    height: 170px;
-
-    img {
-      height: inherit;
-    }
-  }
-
-  .image {
-    transition: all .3s ease-in-out;
-  }
 
   :global {
     .n-card__footer {

+ 2 - 2
src/router/router-guards.ts

@@ -11,7 +11,7 @@ const whitePathList = [LOGIN_PATH]; // no redirect whitelist
 export function createRouterGuards(router: Router) {
   const userStore = useUserStore();
   router.beforeEach(async (to, from, next) => {
-    console.log('access token');
+    // console.log('access token');
     window.$loadingBar && window.$loadingBar.start();
 
     // console.log(window.$loadingBar, '232332');
@@ -27,7 +27,7 @@ export function createRouterGuards(router: Router) {
     }
 
     const token = storage.get(ACCESS_TOKEN);
-    console.log(token, 'access token');
+    // console.log(token, 'access token');
     if (!token) {
       // You can access without permissions. You need to set the routing meta.ignoreAuth to true
       if (to.meta.ignoreAuth) {

+ 30 - 15
src/views/attend-class/index.tsx

@@ -140,38 +140,45 @@ export default defineComponent({
         // },
         {
           id: '1',
-          name: '歌曲表演 大鹿',
-          title: '歌曲表演 大鹿',
+          name: '其多列',
+          title: '其多列',
           type: 'VIDEO',
           content:
-            'https://courseware.lexiaoya.cn/%E5%BF%85%E5%AD%A6%E5%BF%85%E7%9C%8B-%E8%90%A8%E5%85%8B%E6%96%AF-1-C4-4.mp4',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/23cc71b5d7874dcf8752cd257483e687_mergeImage.png'
+            'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844560120.mp4',
+          url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844640957.png'
         },
+        // {
+        //   id: '1',
+        //   name: '歌曲表演 大鹿',
+        //   title: '歌曲表演 大鹿',
+        //   type: 'VIDEO',
+        //   content:
+        //     'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687838624636.mp4',
+        //   url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLloDA.jpg'
+        // },
         {
           id: '2',
           name: '知识 音的高低',
           title: '知识 音的高低',
           type: 'IMG',
-          content:
-            'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1686815979899.png',
-          url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1686815979899.png'
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png'
         },
         {
           id: '3',
           name: '欣赏 永远在童话里',
           title: '欣赏 永远在童话里',
           type: 'IMG',
-          content:
-            'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1686815979899.png',
-          url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1686815979899.png'
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png'
         },
         {
           id: '4',
-          name: '唱歌 小红帽',
-          title: '唱歌 小红帽',
+          name: '彩虹岛',
+          title: '彩虹岛',
           type: 'SONG',
-          content: '11707',
-          url: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngd1f4e00a00bc8134db4ec43e51a66442f778756e2caf01d10a1ffdd51fc7c6cb'
+          content: '22078',
+          url: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png'
         }
       ];
       data.itemList = data.knowledgePointList.map((m: any) => {
@@ -487,6 +494,14 @@ export default defineComponent({
 
     onMounted(() => {
       window.addEventListener('message', iframeHandle);
+
+      // window.onbeforeunload = e => {
+      //   console.log(e, 'e');
+      //   if (e) {
+      //     e.returnValue = '关闭提示';
+      //   }
+      //   return false;
+      // };
     });
 
     return () => (
@@ -736,8 +751,8 @@ export default defineComponent({
               type="default"
               round
               onClick={() => {
-                // window.close();
                 data.modelAttendStatus = false;
+                window.close();
               }}>
               暂不布置
             </NButton>

+ 2 - 1
src/views/attend-class/model/train-settings/index.module.less

@@ -1,11 +1,12 @@
 .trainSettings {
   .trainBtnGroup {
-    padding: 40px 0;
+    padding: 32px 0 40px;
     justify-content: center !important;
 
     :global {
       .n-button {
         height: 48px !important;
+        padding: 0 42px;
       }
     }
   }

+ 6 - 6
src/views/attend-class/model/train-settings/index.tsx

@@ -22,17 +22,17 @@ export default defineComponent({
     });
     const list = [
       {
-        id: 1,
-        src: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/4eb9b81ad9ff4b8c9f026e22d37d7c14_mergeImage.png',
+        id: 22078,
+        src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png',
         type: 'practice',
-        name: '小星星',
+        name: '彩虹岛',
         typeList: ['1-12小节', '速度90', '20分钟']
       },
       {
-        id: 2,
-        src: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/4eb9b81ad9ff4b8c9f026e22d37d7c14_mergeImage.png',
+        id: 22048,
+        src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675839970286-1.png',
         type: 'evaluation',
-        name: '夏日狂欢曲',
+        name: '彩云追月',
         typeList: ['入门级', '全部小节', '速度90', '20分钟']
       }
     ];

+ 6 - 1
src/views/attend-class/model/train-type/index.module.less

@@ -69,11 +69,12 @@
 
   :global {
     .n-image {
-      width: inherit;
+      width: 100%;
       height: inherit;
 
       img {
         width: 100%;
+        height: fit-content;
       }
     }
   }
@@ -114,6 +115,10 @@
   align-items: center;
   justify-content: space-between;
 
+  .type {
+    gap: 8px 10px !important;
+  }
+
   :global {
     .n-tag {
       font-size: 14px;

+ 1 - 1
src/views/attend-class/model/train-type/index.tsx

@@ -66,7 +66,7 @@ export default defineComponent({
           </NButton>
         </div>
         <div class={styles['train-content']}>
-          <NImage src={props.item.src} previewDisabled />
+          <NImage src={props.item.src} previewDisabled objectFit="cover" />
           <div class={styles.preview}>
             <NButton strong secondary class={styles.previewBtn}>
               预览

+ 25 - 35
src/views/natural-resources/index.tsx

@@ -4,6 +4,7 @@ import Pagination from '@/components/pagination';
 import { NTabPane, NTabs } from 'naive-ui';
 import CardType from '/src/components/card-type';
 import SearchGroupResources from './search-group-resources';
+import listData from '../xiaoku-music/data.json';
 export default defineComponent({
   name: 'student-studentList',
   setup() {
@@ -13,50 +14,39 @@ export default defineComponent({
       pagination: {
         page: 1,
         rows: 10,
-        pageTotal: 4
+        pageTotal: 0
       },
       tableList: [] as any
     });
     const forms = reactive({
-      list: [
-        {
-          id: 1,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: false // 是否精选
-        },
-        {
-          id: 2,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: true // 是否精选
-        },
-        {
-          id: 3,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: true // 是否精选
-        },
-        {
-          id: 4,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: false // 是否精选
-        }
-      ],
+      list: [],
       height: '100%' as any
     });
+
+    const formatData = () => {
+      const rows = listData.rows || [];
+      console.log(rows);
+      const tempList: any = [];
+      rows.forEach((row: any, i: number) => {
+        tempList.push({
+          id: row.id,
+          type: 'SONG',
+          title: row.musicSheetName,
+          url: row.fixedTone ? row.fixedTone.split(',')[0] : '',
+          isCollect: i % 3 ? false : true,
+          isSelected: i % 4 ? false : true
+        });
+      });
+
+      forms.list = tempList || [];
+      state.pagination.pageTotal = tempList.length;
+      state.pagination.rows = tempList.length;
+    };
     const getList = () => {
       console.log('getList');
     };
+
+    formatData();
     return () => (
       <div class={styles.listWrap}>
         <NTabs

+ 23 - 22
src/views/prepare-lessons/components/lesson-main/index.tsx

@@ -10,36 +10,37 @@ export default defineComponent({
     const forms = reactive({
       list: [
         {
-          id: 1,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: false // 是否精选
+          id: '5',
+          name: '多其列',
+          title: '多其列',
+          type: 'VIDEO',
+          content:
+            'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844560120.mp4',
+          url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844640957.png'
         },
         {
-          id: 2,
+          id: '2',
+          name: '知识 音的高低',
+          title: '知识 音的高低',
           type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: true // 是否精选
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png'
         },
         {
-          id: 3,
+          id: '3',
+          name: '欣赏 永远在童话里',
+          title: '欣赏 永远在童话里',
           type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: true // 是否精选
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png'
         },
         {
-          id: 4,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: false // 是否精选
+          id: '4',
+          name: '彩虹岛',
+          title: '彩虹岛',
+          type: 'SONG',
+          content: '22078',
+          url: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png'
         }
       ],
       showAttendClass: false // 开始上课

+ 23 - 22
src/views/prepare-lessons/components/resource-main/index.tsx

@@ -18,36 +18,37 @@ export default defineComponent({
     const forms = reactive({
       list: [
         {
-          id: 1,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: false // 是否精选
+          id: '5',
+          name: '多其列',
+          title: '多其列',
+          type: 'VIDEO',
+          content:
+            'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844560120.mp4',
+          url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844640957.png'
         },
         {
-          id: 2,
+          id: '2',
+          name: '知识 音的高低',
+          title: '知识 音的高低',
           type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: true // 是否精选
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlteU.png'
         },
         {
-          id: 3,
+          id: '3',
+          name: '欣赏 永远在童话里',
+          title: '欣赏 永远在童话里',
           type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: true // 是否精选
+          content: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png',
+          url: 'https://daya.ks3-cn-beijing.ksyun.com/202306/TiLlxJ0.png'
         },
         {
-          id: 4,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: false // 是否精选
+          id: '4',
+          name: '彩虹岛',
+          title: '彩虹岛',
+          type: 'SONG',
+          content: '22078',
+          url: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png'
         }
       ],
       height: '100%' as any

+ 7 - 1
src/views/prepare-lessons/model/attend-class/index.module.less

@@ -1,6 +1,5 @@
 .attendClass {
   margin: 32px 0;
-  padding: 0 40px;
 }
 
 .attendClassSearch {
@@ -9,6 +8,7 @@
   align-items: center;
   gap: 0 24px;
   margin-bottom: 28px;
+  padding: 0 40px;
 
   :global {
 
@@ -18,6 +18,7 @@
       min-height: 52px;
       --n-height: 52px !important;
       font-size: 18px;
+      border-radius: 8px !important;
     }
   }
 
@@ -27,6 +28,11 @@
   }
 }
 
+.classList {
+  max-height: 60vh;
+  padding: 0 40px;
+}
+
 .thingItem {
   background: #F5F6FA;
   border-radius: 12px;

+ 1 - 1
src/views/prepare-lessons/model/attend-class/index.tsx

@@ -82,7 +82,7 @@ export default defineComponent({
             ]}
           />
         </div>
-        <NScrollbar style={{ 'max-height': '65vh' }}>
+        <NScrollbar class={styles.classList}>
           {[1, 2, 3, 4, 5, 6, 7].map(i => (
             <div onClick={() => onAttendClass(i)}>
               <NThing class={styles.thingItem}>

+ 24 - 34
src/views/prepare-lessons/model/select-music/index.tsx

@@ -4,48 +4,38 @@ import styles from './index.module.less';
 import CardType from '@/components/card-type';
 import { NBaseIcon } from 'naive-ui/es/_internal';
 import SearchGroup from './search-group';
+import listData from '@views/xiaoku-music/data.json';
 
 export default defineComponent({
   name: 'select-music',
   emits: ['select'],
   setup(props, { emit }) {
     const forms = reactive({
-      list: [
-        {
-          id: 1,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: false // 是否精选
-        },
-        {
-          id: 2,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: true // 是否精选
-        },
-        {
-          id: 3,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '夏日曲演奏',
-          isCollect: false, // 是否收藏
-          isSelected: true // 是否精选
-        },
-        {
-          id: 4,
-          type: 'IMG',
-          url: 'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/24a8551d69b245e0aec1c8613bf50d46_mergeImage.png',
-          title: '欢乐颂',
-          isCollect: true, // 是否收藏
-          isSelected: false // 是否精选
-        }
-      ],
+      list: [],
       height: '100%' as any
     });
+
+    const formatData = () => {
+      const rows = listData.rows || [];
+      console.log(rows);
+      const tempList: any = [];
+      rows.forEach((row: any, i: number) => {
+        if (i <= 10) {
+          tempList.push({
+            id: row.id,
+            type: 'SONG',
+            title: row.musicSheetName,
+            url: row.fixedTone ? row.fixedTone.split(',')[0] : '',
+            isCollect: i % 3 ? false : true,
+            isSelected: i % 4 ? false : true
+          });
+        }
+      });
+
+      forms.list = tempList || [];
+    };
+
+    formatData();
     return () => (
       <div class={styles.selectMusic}>
         <NTabs