Browse Source

修改样式

lex-xin 1 month ago
parent
commit
05dc068e9d

+ 16 - 14
src/tenant/music/music-detail/new-index.tsx

@@ -64,6 +64,7 @@ import { svgtopng } from './formatSvgToImg'
 // import { shareCall } from '@/teacher/share-page/share'
 import deepClone from '@/helpers/deep-clone'
 import { formatXML, getCustomInfo, onlyVisible } from './instrument'
+import { data } from 'browserslist'
 
 export default defineComponent({
   name: 'new-index',
@@ -520,17 +521,17 @@ export default defineComponent({
       try {
         nextTick(() => {
           if (musicPdfUrl.value) {
-            const url = `${location.origin}${
-                location.pathname
-              }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
-                musicPdfUrl.value
-              )}&t=${Date.now()}`
+            // const url = `${location.origin}${
+            //     location.pathname
+            //   }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
+            //     musicPdfUrl.value
+            //   )}&t=${Date.now()}`
 
 
-              // const url = '/pdf/web/viewer-pdf.html?file=' +
-              //   encodeURIComponent(musicPdfUrl.value) +
-              //   '&t=' +
-              //   Date.now()
+              const url = '/pdf/web/viewer-pdf.html?file=' +
+                encodeURIComponent(musicPdfUrl.value) +
+                '&t=' +
+                Date.now()
             
             const iframeRef = document.querySelector('#staffIframeRef') as any
             iframeRef.contentWindow.location.replace(
@@ -538,8 +539,8 @@ export default defineComponent({
             )
             staffData.iframeSrc = url
           } else {
-            const url = `${location.origin}${location.pathname}osmd/index.html`
-            // const url = `${location.origin}/osmd/index.html`
+            // const url = `${location.origin}${location.pathname}osmd/index.html`
+            const url = `${location.origin}/osmd/index.html`
 
             const iframeRef = document.querySelector('#staffIframeRef') as any
             iframeRef.contentWindow.location.replace(url)
@@ -611,10 +612,10 @@ export default defineComponent({
           musicDetail.value?.musicSheetType === 'CONCERT'
             ? getInstrumentName(item.track)
             : ''
-        console.log(item, 'item')
         return {
           text: item.track + (instrumentName ? `(${instrumentName})` : ''),
           value: index,
+          instrumentName,
           musicPdfUrl: item.musicPdfUrl,
           firstPdfUrl: item.firstPdfUrl,
           jianPdfUrl: item.jianPdfUrl,
@@ -857,10 +858,10 @@ export default defineComponent({
               style={{
                 display:
                   musicDetail.value?.musicSheetType === 'SINGLE' ? '' : 'none',
-                opacity: showImg.value.length <= 0 ? 0.6 : 1
+                // opacity: showImg.value.length <= 0 || data.musicPdfUrl ? 0.6 : 1
               }}
               onClick={() => {
-                if (showImg.value.length <= 0) return
+                // if (showImg.value.length <= 0 || data.musicPdfUrl) return
 
                 staff.status = true
               }}
@@ -1229,6 +1230,7 @@ export default defineComponent({
               staffData.open = false
               staffData.partIndex = value.value
               staffData.partXmlIndex = value.xmlValue
+              staffData.instrumentName = value.instrumentName
               showImg.value = []
               nextTick(() => {
                 // const item = getInstrumentItem(musicDetail.value?.background || [], value.selectedOptions[0].track);

BIN
src/views/music/music-detail/images/icon-change.png


BIN
src/views/music/music-detail/images/icon_album.png


BIN
src/views/music/music-detail/images/icon_download.png


+ 14 - 5
src/views/music/music-detail/index.module.less

@@ -91,6 +91,9 @@
   .musicTitle {
     text-align: center;
     font-size: 16px;
+    padding-top: 10px;
+    font-weight: bold;
+    color: #131415;
   }
 
   .musicImg {
@@ -153,11 +156,16 @@
     }
 
     /* 修改滑块的样式 */
-    input[type="range"]::-webkit-slider-thumb {
-      background-color: #2DC7AA !important;
-      border: none;
-      box-shadow: none;
-    }
+    // input[type="range"]::-webkit-slider-thumb {
+    //   background-color: #2DC7AA !important;
+    //   border: none;
+    //   box-shadow: none;
+    //   text-shadow: none;
+    //   outline: none;
+    //   -webkit-appearance: none; /* 针对 WebKit 浏览器 */
+    //   background: transparent; /* 去掉背景 */
+    //   margin: 0; /* 去掉边距 */
+    // }
   }
 }
 
@@ -443,6 +451,7 @@
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
+    color: var(--van-primary);
   }
 
   .tag {

+ 37 - 21
src/views/music/music-detail/index.tsx

@@ -304,6 +304,10 @@ export default defineComponent({
       }
     }
     onMounted(async () => {
+      postMessage({
+        api: 'setStatusBarTextColor',
+        content: { statusBarTextColor: true }
+      })
       await FetchList()
       const { height } = useRect(headers as any)
       const footer = useRect(footers as any)
@@ -317,6 +321,10 @@ export default defineComponent({
       window.addEventListener('message', showLoading)
     })
     onUnmounted(() => {
+      postMessage({
+        api: 'setStatusBarTextColor',
+        content: { statusBarTextColor: false }
+      })
       window.removeEventListener('message', showLoading)
     })
 
@@ -362,7 +370,7 @@ export default defineComponent({
     const removeCourse = async () => {
       Dialog.confirm({
         title: '提示',
-        message: '您是否确定移课件',
+        message: '您是否确定移课件',
         confirmButtonColor: '#269a93',
         cancelButtonText: '取消',
         confirmButtonText: '确定'
@@ -376,7 +384,7 @@ export default defineComponent({
             }
           )
           setTimeout(() => {
-            Toast('移成功')
+            Toast('移成功')
             musicDetail.value.coursewareStatus = 0
           }, 100)
         } catch {
@@ -612,23 +620,23 @@ export default defineComponent({
       try {
         nextTick(() => {
           if (musicPdfUrl.value) {
-            // const url = `${location.origin}/pdf/web/viewer-pdf.html?file=${encodeURIComponent(
-            //   musicPdfUrl.value
-            // )}&t=${Date.now()}`
-            const url = `${location.origin}${
-              location.pathname
-            }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
+            const url = `${location.origin}/pdf/web/viewer-pdf.html?file=${encodeURIComponent(
               musicPdfUrl.value
             )}&t=${Date.now()}`
+            // const url = `${location.origin}${
+            //   location.pathname
+            // }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
+            //   musicPdfUrl.value
+            // )}&t=${Date.now()}`
 
             const iframeRef = document.querySelector('#staffIframeRef') as any
             iframeRef.contentWindow.location.replace(url)
             staffData.iframeSrc = url
           } else {
-            const url = `${location.origin}${
-              location.pathname
-            }osmd/index.html?t=${new Date().getTime()}`
-            // const url = `${location.origin}/osmd/index.html`
+            // const url = `${location.origin}${
+            //   location.pathname
+            // }osmd/index.html?t=${new Date().getTime()}`
+            const url = `${location.origin}/osmd/index.html`
 
             const iframeRef = document.querySelector('#staffIframeRef') as any
             iframeRef.contentWindow.location.replace(
@@ -802,8 +810,22 @@ export default defineComponent({
                             src={getAssetsHomeFile('icon_album_active.png')}
                           />
                         )}
-                        <span class={styles.coomposer}>
-                          {musicDetail.value?.composer}
+                        <span class={styles.coomposer} onClick={() => {
+                          if (
+                            browser().isApp &&
+                            musicDetail.value?.sourceType === 'TEACHER' &&
+                            state.platformType === 'STUDENT'
+                          ) {
+                            router.push({
+                              path: '/teacherHome',
+                              query: {
+                                teacherId: musicDetail.value?.userId,
+                                tabs: 'music'
+                              }
+                            })
+                          }
+                        }}>
+                          {musicDetail.value?.userName}
                         </span>
                       </p>
                     </div>
@@ -823,16 +845,10 @@ export default defineComponent({
                           }
                         }}
                       >
-                        <img src={iconAddCourse} />
+                        <img src={musicDetail.value?.coursewareStatus?iconRemoveCourse: iconAddCourse} />
                         <span>添加课件</span>
                       </span>
                       <span
-                        style={{
-                          display:
-                            musicDetail.value?.musicSheetType === 'CONCERT'
-                              ? ''
-                              : 'none'
-                        }}
                         class={styles.download}
                         onClick={() => toggleFavorite()}
                       >