liushengqiang пре 2 година
родитељ
комит
7bfe61dc80

BIN
src/common/images/icon_bg.png


Разлика између датотеке није приказан због своје велике величине
+ 10 - 0
src/common/images/icon_jianpuActive.svg


BIN
src/views/co-ai/image/1.png


Разлика између датотеке није приказан због своје велике величине
+ 20 - 0
src/views/co-ai/image/1.svg


BIN
src/views/co-ai/image/2.png


Разлика између датотеке није приказан због своје велике величине
+ 19 - 0
src/views/co-ai/image/2.svg


BIN
src/views/co-ai/image/3.png


Разлика између датотеке није приказан због своје велике величине
+ 20 - 0
src/views/co-ai/image/3.svg


BIN
src/views/co-ai/image/4.png


+ 11 - 0
src/views/co-ai/image/icon_arrow.svg

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="8px" height="16px" viewBox="0 0 8 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>路径 4</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.802384876">
+        <g id="小酷Ai-备份" transform="translate(-157.000000, -137.000000)" fill="#FFFFFF">
+            <g id="教材" transform="translate(50.000000, 51.000000)">
+                <path d="M115,86.8530466 L107.361648,93.5605603 C106.946657,93.9249789 106.90566,94.5568153 107.270078,94.9718063 C107.297261,95.0027617 107.326331,95.0320078 107.357122,95.0593773 L115,101.853047 L115,101.853047 L115,86.8530466 Z" id="路径-4"></path>
+            </g>
+        </g>
+    </g>
+</svg>

+ 27 - 0
src/views/co-ai/image/icon_back.svg

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="38px" height="38px" viewBox="0 0 38 38" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>返回</title>
+    <defs>
+        <linearGradient x1="-67.2865798%" y1="100%" x2="100%" y2="50%" id="linearGradient-1">
+            <stop stop-color="#5BECFF" offset="0%"></stop>
+            <stop stop-color="#259CFE" offset="100%"></stop>
+        </linearGradient>
+        <linearGradient x1="-1.46584134e-14%" y1="2.42861287e-14%" x2="100%" y2="100%" id="linearGradient-2">
+            <stop stop-color="#19F1E1" offset="0%"></stop>
+            <stop stop-color="#0094FF" offset="100%"></stop>
+        </linearGradient>
+        <path d="M9.14012318,15.1713216 L15.0855207,8.77987308 C15.8974668,8.13316936 17.1353518,8.67908809 17.1353518,9.68273868 L17.1353518,13.2186123 L24.82,13.2186123 L24.82,20.1013877 L17.1397887,20.1013877 L17.1397887,23.6372613 C17.1397887,24.6409119 15.8974668,25.1868306 15.0899576,24.5401269 L9.17118123,18.4090396 C8.28824532,17.4935759 8.27493473,16.0993835 9.14012318,15.1713216 Z" id="path-3"></path>
+    </defs>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="小酷Ai-" transform="translate(-14.000000, -16.000000)">
+            <g id="编组-7" transform="translate(16.000000, 18.000000)">
+                <path d="M17,0 C26.3736175,0 34,7.62638252 34,17 C34,26.3736175 26.3736175,34 17,34 C7.62638252,34 0,26.3736175 0,17 C0,7.62638252 7.62638252,0 17,0" id="路径" stroke-opacity="0.363481855" stroke="#7BCBF8" stroke-width="3" fill="#FFFFFF" fill-rule="nonzero"></path>
+                <g id="路径">
+                    <use fill="#EFEFEF" xlink:href="#path-3"></use>
+                    <use fill="url(#linearGradient-1)" xlink:href="#path-3"></use>
+                    <use fill="url(#linearGradient-2)" xlink:href="#path-3"></use>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 15 - 0
src/views/co-ai/image/icon_hot.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="10px" height="11px" viewBox="0 0 10 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>路径</title>
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#FF9556" offset="0%"></stop>
+            <stop stop-color="#FF6A6A" offset="100%"></stop>
+        </linearGradient>
+    </defs>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组-28备份-5" transform="translate(-4.328904, -2.911412)" fill="url(#linearGradient-1)" fill-rule="nonzero">
+            <path d="M8.28009876,13.7532294 C8.28009876,13.7532294 3.66856815,12.7196546 5.72964728,7.58962324 C5.72964728,7.58962324 6.19758726,8.15962672 6.13329016,8.43398524 C6.13329016,8.43398524 6.50002175,7.13906032 7.29182858,6.3656531 C7.97171084,5.70104323 8.66230927,3.83256709 8.02529175,3.157314 C8.02529175,3.157314 11.1806122,3.83256709 11.5318649,7.21001511 C11.5318649,7.21001511 11.9355077,6.13386745 12.7642259,6.02743527 C12.7642259,6.02743527 12.5094189,6.61872519 12.7642259,7.50566007 C12.7642259,7.50566007 15.3777837,12.0645053 10.873415,13.6054069 C10.873415,13.6054069 12.223654,12.0432189 9.36005183,9.36231042 C9.36005183,9.36231042 8.68493233,10.7979623 8.28128945,11.3041065 C8.28009876,11.3052891 7.15370889,12.591936 8.28009876,13.7532294 Z" id="路径"></path>
+        </g>
+    </g>
+</svg>

+ 21 - 0
src/views/co-ai/image/icon_leftBg.svg

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="117px" height="297px" viewBox="0 0 117 297" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
+    <title>蒙版备份</title>
+    <defs>
+        <linearGradient x1="43.5893735%" y1="100%" x2="57.5983913%" y2="18.0655582%" id="linearGradient-1">
+            <stop stop-color="#43B2FF" offset="0%"></stop>
+            <stop stop-color="#159AF7" offset="100%"></stop>
+        </linearGradient>
+        <linearGradient x1="42.9740198%" y1="3.0851473%" x2="56.7925564%" y2="89.619475%" id="linearGradient-2">
+            <stop stop-color="#FFFFFF" offset="0%"></stop>
+            <stop stop-color="#FFFFFF" stop-opacity="0.333539629" offset="100%"></stop>
+        </linearGradient>
+        <path d="M21,1 L95,1 C106.59798,1 116,10.4020203 116,22 L116,275 C116,286.59798 106.59798,296 95,296 L21,296 C9.954305,296 1,287.045695 1,276 L1,21 C1,9.954305 9.954305,1 21,1 Z" id="path-3"></path>
+    </defs>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <mask id="mask-4" fill="white">
+            <use xlink:href="#path-3"></use>
+        </mask>
+        <use id="蒙版备份" stroke="url(#linearGradient-2)" stroke-width="2" fill="url(#linearGradient-1)" xlink:href="#path-3"></use>
+    </g>
+</svg>

+ 155 - 26
src/views/co-ai/index.module.less

@@ -4,12 +4,20 @@
     top: 17px;
     width: 31px;
     height: 31px;
-    background-color: red;
-    border-radius: 50%;
+
+    &>img {
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
+    }
+
+    &:active {
+        opacity: .8;
+    }
 }
 
 .container {
-    background: rgba(59, 130, 243, 1);
+    background: url('../../common/images/icon_bg.png') no-repeat center center / cover;
     padding: 47px 12px 20px 54px;
     height: 100vh;
     overflow: hidden;
@@ -18,11 +26,7 @@
 .content {
     display: flex;
     height: calc(100vh - 67px);
-
-    .center,
-    .right {
-        flex: 1;
-    }
+    overflow: hidden;
 }
 
 .opacityBg {
@@ -31,11 +35,32 @@
     border: 2px solid #fff;
 }
 
+.leftContent {
+    position: relative;
+    width: 55%;
+    padding-left: 100px;
+}
+
+.leftBg {
+    position: absolute;
+    left: -2px;
+    top: -2px;
+    width: 104px;
+    height: calc(100% + 4px);
+    background: linear-gradient(48deg, #43B2FF 0%, #159AF7 100%);
+    border: 2px solid #fff;
+    border-radius: 18px;
+}
+
 .types {
-    width: 100px;
-    padding: 0 10px;
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 102px;
     height: 100%;
+    padding: 4px 0;
     overflow-y: auto;
+    border-radius: 18px;
 
     &::-webkit-scrollbar {
         width: 0;
@@ -43,37 +68,77 @@
     }
 
     .type {
+        position: relative;
+        padding: 4px 14px;
+
+        &.typeActive {
+            .typeImg {
+                border-color: #f4b482;
+                border-width: 3px;
+                box-shadow: 0px 0 4px 2px #fff;
+            }
+
+            .typeIndex {
+                display: block;
+            }
+        }
+    }
+
+    .typeIndex {
+        position: absolute;
+        top: 45%;
+        right: -6px;
+        width: 12px;
+        height: 12px;
+        background: rgba(184, 219, 251, 1);
+        border: 2px solid #fff;
+        border-radius: 2px;
+        transform: rotate(45deg);
+        z-index: 2;
+        display: none;
+    }
+
+    .typeImg {
         background-color: #000;
         border: 2px solid #fff;
         border-radius: 18px;
         height: 75px;
-        margin: 7px 0;
         transition: .3s;
+        overflow: hidden;
+
         &:active {
             transform: scale(0.8);
         }
-        &.typeActive {
-            border-color: rgba(244, 180, 130, 1);
-        }
+    }
+
+    .typeIcon {
+        display: block;
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
     }
 }
 
 .center {
     position: relative;
-    margin: 0 8px;
     padding-top: calc(var(--van-search-input-height) + 12px);
-    overflow: hidden;
+    height: 100%;
+
     :global {
         .van-search {
             position: absolute;
             top: 0;
+            left: 0;
+            right: 0;
             padding: 6px 9px;
         }
     }
 }
 
 .musicContent {
-    padding: 0 6px;
+    width: calc(100% + 14px);
+    padding: 12px;
+    padding-right: 28px;
     height: 100%;
     overflow-y: auto;
 
@@ -84,16 +149,44 @@
 }
 
 .musicItem {
+    position: relative;
     display: flex;
     align-items: center;
-    border: 2px solid #fff;
+    border: 3px solid #fff;
     border-radius: 9px;
     margin-bottom: 6px;
     background-color: #fff;
     padding: 5px;
+    transition: all .3s;
+
+    &::after {
+        content: '';
+        position: absolute;
+        right: -26px;
+        border: 10px solid transparent;
+        border-right-color: #fff;
+        opacity: 0;
+    }
+
+    &.disableNotic {
+        :global {
+            .van-notice-bar__content {
+                transition-duration: 0s !important;
+                transform: none !important;
+            }
+        }
+    }
 
     &.musicActive {
-        border-color: rgba(244, 180, 130, 1);
+        border-width: 3px;
+        background: linear-gradient(180deg, #FFFFFF 0%, #BFE1FF 100%);
+        transform: scale(1.05);
+        box-shadow: 0px 2px 4px 0px rgba(73, 159, 228, 1);
+
+        &::after {
+            animation: displayIcon 0.1s forwards;
+            animation-delay: .2s;
+        }
     }
 
     .musicAvtor {
@@ -129,13 +222,14 @@
         }
 
         .musicFavitor {
-            border: 1px solid #FF3B3B;
-            color: #FF3B3B;
-            padding: 1px 2px 1px 18px;
+            border: 1px solid #FFC5C5;
+            color: #FF6A6A;
+            padding: 1px 3px 1px 14px;
             border-radius: 4px;
-            background-image: url('@/common/images/icon_play.svg');
+            background-color: #FFF8F7;
+            background-image: url('./image/icon_hot.svg');
             background-repeat: no-repeat;
-            background-size: 14px;
+            background-size: auto 70%;
             background-position: 2px center;
             margin-right: 4px;
         }
@@ -146,7 +240,7 @@
             font-weight: 400;
             color: #777;
             line-height: 12px;
-            max-width: 15vw;
+            max-width: 9vw;
         }
     }
 
@@ -161,6 +255,17 @@
     background: #fff;
     overflow: hidden;
     border: none;
+    width: 45%;
+    margin-left: 12px;
+}
+
+.right-musicName {
+    font-size: 15px;
+    font-weight: 500;
+    color: #131415;
+    line-height: 20px;
+    text-align: center;
+    padding: 12px 0;
 }
 
 .staff {
@@ -178,15 +283,39 @@
     height: 78px;
     background: #fff;
     background-image: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #C1EEFF 100%);
-    & > img {
+
+    &>img {
         margin: 0 4px;
         height: 30px;
         transition: .3s;
+
         &:active {
             transform: scale(0.8);
         }
     }
+
     &>img:last-child {
         margin-left: auto;
+        animation: scaleBtn 1s ease-in-out infinite;
+    }
+}
+
+@keyframes scaleBtn {
+    0% {
+        transform: scale(1);
+    }
+
+    50% {
+        transform: scale(1.1);
+    }
+
+    100% {
+        transform: scale(1);
+    }
+}
+
+@keyframes displayIcon {
+    to {
+        opacity: 1;
     }
 }

+ 155 - 48
src/views/co-ai/index.tsx

@@ -3,81 +3,188 @@ import styles from './index.module.less';
 import MSearch from '@/components/m-search';
 import icon_play from '@/common/images/icon_play.svg';
 import { NoticeBar } from 'vant';
+import icon_back from './image/icon_back.svg';
 import icon_down from '@/common/images/icon_down.svg';
 import icon_jianpu from '@/common/images/icon_jianpu.svg';
+import icon_jianpuActive from '@/common/images/icon_jianpuActive.svg';
 import icon_start from '@/common/images/icon_start.svg';
-
+import icon_1 from './image/1.svg';
+import icon_2 from './image/2.svg';
+import icon_3 from './image/3.svg';
+import png_1 from './image/1.png';
+import png_2 from './image/2.png';
+import png_3 from './image/3.png';
+import png_4 from './image/4.png';
 export default defineComponent({
   name: 'co-ai',
   setup() {
+    const icons = [icon_1, icon_2, icon_3];
+    const titles = [
+      {
+        name: '竖笛-上学歌',
+        auther: '人教版',
+        hot: 232,
+        img: png_1
+      },
+      {
+        name: '最伟大的作品',
+        auther: '周杰伦',
+        hot: 132,
+        img: png_2
+      },
+      {
+        name: '夏天的风',
+        auther: '温岚',
+        hot: 112,
+        img: png_3
+      },
+      {
+        name: '慢生活',
+        auther: '李萌',
+        hot: 112,
+        img: png_4
+      },
+      {
+        name: '竖笛-上学歌',
+        auther: '人教版',
+        hot: 232,
+        img: png_1
+      },
+      {
+        name: '最伟大的作品',
+        auther: '周杰伦',
+        hot: 132,
+        img: png_2
+      },
+      {
+        name: '夏天的风',
+        auther: '温岚',
+        hot: 112,
+        img: png_3
+      },
+      {
+        name: '慢生活',
+        auther: '李萌',
+        hot: 112,
+        img: png_4
+      }
+    ];
     const data = reactive({
       /** 教材Index */
       typeIndex: 0,
       /** 音乐Index */
-      musicIndex: 0
+      musicIndex: 0,
+      /** 显示简谱 */
+      isShowJianpu: false
     });
     return () => (
       <div class={styles.container}>
-        <div class={styles.back}></div>
+        <div class={styles.back}>
+          <img src={icon_back} />
+        </div>
         <div class={styles.content}>
-          <div class={[styles.opacityBg, styles.types]}>
-            {new Array(10).fill(1).map((item, index) => {
-              return (
-                <div
-                  class={[
-                    styles.type,
-                    data.typeIndex === index && styles.typeActive
-                  ]}
-                  onClick={() => (data.typeIndex = index)}></div>
-              );
-            })}
-          </div>
-          <div class={[styles.opacityBg, styles.center]}>
-            <MSearch
-              shape="round"
-              background="transparent"
-              placeholder="请输入曲目名称"
-            />
-            <div class={styles.musicContent}>
+          <div class={[styles.opacityBg, styles.leftContent]}>
+            <div class={styles.leftBg}></div>
+            <div class={styles.types}>
               {new Array(10).fill(1).map((item, index) => {
+                const icon = icons[index] ? icons[index] : icons[index % 3];
                 return (
                   <div
                     class={[
-                      styles.musicItem,
-                      data.musicIndex === index && styles.musicActive
+                      styles.type,
+                      data.typeIndex === index && styles.typeActive
                     ]}
-                    onClick={() => (data.musicIndex = index)}>
-                    <img class={styles.musicAvtor} />
-                    <div class={styles.musicInfo}>
-                      <div class={styles.musicName}>
-                        <NoticeBar
-                          scrollable={data.musicIndex === index}
-                          text={'最伟大的作品-周杰伦'}
-                          color="#333"
-                          class={styles.noticeBar}
-                          background="none"
-                        />
-                      </div>
-                      <div class={styles.musicDes}>
-                        <div class={styles.musicFavitor}>132收藏</div>
-                        <div class={[styles.musicAuthor, 'van-ellipsis']}>
-                          周杰伦
-                        </div>
-                      </div>
+                    onClick={() => (data.typeIndex = index)}>
+                    <div class={styles.typeIndex}></div>
+                    <div class={styles.typeImg}>
+                      <img class={styles.typeIcon} src={icon} />
                     </div>
-                    <img class={[styles.musicIcon]} src={icon_play} />
                   </div>
                 );
               })}
             </div>
+            <div class={styles.center}>
+              <MSearch
+                shape="round"
+                background="transparent"
+                placeholder="请输入曲目名称"
+              />
+              <div class={styles.musicContent}>
+                {titles.map((item, index) => {
+                  return (
+                    <div
+                      class={[
+                        styles.musicItem,
+                        data.musicIndex === index
+                          ? styles.musicActive
+                          : styles.disableNotic
+                      ]}
+                      onClick={() => (data.musicIndex = index)}>
+                      <img class={styles.musicAvtor} src={item.img} />
+                      <div class={styles.musicInfo}>
+                        <div class={styles.musicName}>
+                          <NoticeBar
+                            text={item.name}
+                            color="#333"
+                            class={styles.noticeBar}
+                            background="none"
+                          />
+                        </div>
+                        <div class={styles.musicDes}>
+                          <div class={styles.musicFavitor}>{item.hot}</div>
+                          <div class={[styles.musicAuthor, 'van-ellipsis']}>
+                            {item.auther}
+                          </div>
+                        </div>
+                      </div>
+                      <img class={[styles.musicIcon]} src={icon_play} />
+                    </div>
+                  );
+                })}
+              </div>
+            </div>
           </div>
           <div class={[styles.opacityBg, styles.right]}>
-            <img class={styles.staff} src='https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet/1675232853576-1.png' />
+            <div class={styles['right-musicName']}>{titles[data.musicIndex].name}</div>
+            {data.isShowJianpu ? (
+              <>
+                <img
+                  style={{ display: data.musicIndex % 2 === 0 ? '' : 'none' }}
+                  class={styles.staff}
+                  src="https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-first/1687673062603-1.png"
+                />
+                <img
+                  style={{ display: data.musicIndex % 2 !== 0 ? '' : 'none' }}
+                  class={styles.staff}
+                  src="https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-first/1675232855321-1.png"
+                />
+              </>
+            ) : (
+              <>
+                <img
+                  style={{
+                    display: data.musicIndex % 2 === 0 ? '' : 'none'
+                  }}
+                  class={styles.staff}
+                  src="https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet/1687673062488-1.png"
+                />
+                <img
+                  style={{
+                    display: data.musicIndex % 2 !== 0 ? '' : 'none'
+                  }}
+                  class={styles.staff}
+                  src="https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet/1675232854483-2.png"
+                />
+              </>
+            )}
+
             <div class={styles.rightBtns}>
-                <img src='' />
-                <img src={icon_jianpu} />
-                <img src={icon_down} />
-                <img src={icon_start} />
+              <img
+                src={data.isShowJianpu ? icon_jianpuActive : icon_jianpu}
+                onClick={() => (data.isShowJianpu = !data.isShowJianpu)}
+              />
+              <img src={icon_down} />
+              <img src={icon_start} />
             </div>
           </div>
         </div>

Неке датотеке нису приказане због велике количине промена