Browse Source

feat: 评测支持选段

TIANYONG 9 months ago
parent
commit
2fb81db556

+ 2 - 2
src/subpages/colexiu/buttons/evaluating.tsx

@@ -25,6 +25,7 @@ import startData from './data/start_new.json'
 import startingData from './data/starting_new.json'
 import { unitTestData } from '../unitTest'
 import iconEvaluatingStart from './icons/icon-evaluatingStart.png'
+import iconEvaluatingBegin from './icons/icon-evaluatingBegin.png'
 import qs from 'query-string'
 import CheckDelayPopup from "/src/pages/detail/CheckDelayPopup";
 import Headphone, { HeadphoneData } from "/src/pages/detail/Headphone";
@@ -985,8 +986,7 @@ export default defineComponent({
             {startButtonShow.value && !delayData.open && modelType.value !== 'init' && (
               <div
                 style={{
-                  backgroundImage: `url(${iconEvaluatingStart})`,
-                  'transform': detailState.isSpecialShapedScreen ? `translateX(${detailState.notchHeight / 4}px)`  : '',
+                  backgroundImage: `url(${iconEvaluatingBegin})`
                 }}
                 class={[styles.evaluatStartBtn]}
                 onClick={async () => {

BIN
src/subpages/colexiu/buttons/icons/icon-evaluatingBegin.png


+ 5 - 4
src/subpages/colexiu/buttons/index.module.less

@@ -150,10 +150,11 @@
 }
 .evaluatStartBtn {
   position: fixed;
-  top: calc(50% - 37.5px);
-  left: calc(50% - 37.5px);
-  width: 75px;
-  height: 75px;
+  bottom: 17px;
+  left: calc(50% - 32px);
+  width: 64px;
+  height: 20px;
+  border-radius: 12px;
   background-size: 100%;
   background-position: center;
   z-index: 10;

+ 55 - 47
src/subpages/colexiu/buttons/index.tsx

@@ -315,6 +315,59 @@ export default defineComponent({
                 <span>声轨</span>
               </Button>
             )}
+
+            {['practice', 'evaluation'].includes(modelType.value) && (
+              <>
+                {
+                  modelType.value === 'practice' ? 
+                  <Button
+                    data-step="m1"
+                    class={[styles.button, styles.hasText]}
+                    onClick={() => RuntimeUtils.changeMode(runtime.mode === 'background' ? 'music' : 'background')}
+                    disabled={changeModeIsDisabled}
+                  >
+                    <ButtonIcon key="music" name={runtime.mode === 'music' ? 'music' : 'accompaniment'} />
+                    <span>{runtime.mode === 'background' ? '伴奏' : '原声'}</span>
+                  </Button> : null
+                }
+                {/* 如果为单元测试和课后训练 */}
+                {unitTestData.isSelectMeasureMode ? null : (
+                  <Button
+                    data-step="m2"
+                    class={[styles.button, styles.hasText]}
+                    onClick={RuntimeUtils.sectionChange}
+                    disabled={runtime.playState === 'play'}
+                  >
+                    <ButtonIcon
+                      key="section"
+                      name={
+                        'section' +
+                        (detailState.section.length && detailState.section.length <= 2
+                          ? detailState.section.length
+                          : '')
+                      }
+                    />
+                    <span>选段</span>
+                  </Button>
+                )}
+                {
+                  modelType.value === 'practice' ? 
+                  <Button
+                    data-step="m3"
+                    class={[styles.button, styles.hasText]}
+                    disabled={runtime.playState === 'play'}
+                    onClick={() => {
+                      SettingState.sett.fingering = !SettingState.sett.fingering
+                      RuntimeUtils.event.emit('settingFingeringChange')
+                    }}
+                  >
+                    <ButtonIcon key="music" name={SettingState.sett.fingering ? 'fingeringOn' : 'fingeringOff'} />
+                    <span>指法</span>
+                  </Button> : null               
+                }
+              </>
+            )}
+
             {modelType.value === 'evaluation' && (
               <>
                 <Popover
@@ -366,53 +419,8 @@ export default defineComponent({
 
                 <Evaluating ref={evaluatingRef} />
               </>
-            )}
-
-            {modelType.value === 'practice' && (
-              <>
-                <Button
-                  data-step="m1"
-                  class={[styles.button, styles.hasText]}
-                  onClick={() => RuntimeUtils.changeMode(runtime.mode === 'background' ? 'music' : 'background')}
-                  disabled={changeModeIsDisabled}
-                >
-                  <ButtonIcon key="music" name={runtime.mode === 'music' ? 'music' : 'accompaniment'} />
-                  <span>{runtime.mode === 'background' ? '伴奏' : '原声'}</span>
-                </Button>
-                {/* 如果为单元测试和课后训练 */}
-                {unitTestData.isSelectMeasureMode ? null : (
-                  <Button
-                    data-step="m2"
-                    class={[styles.button, styles.hasText]}
-                    onClick={RuntimeUtils.sectionChange}
-                    disabled={runtime.evaluatingStatus || runtime.playState === 'play'}
-                  >
-                    <ButtonIcon
-                      key="section"
-                      name={
-                        'section' +
-                        (detailState.section.length && detailState.section.length <= 2
-                          ? detailState.section.length
-                          : '')
-                      }
-                    />
-                    <span>选段</span>
-                  </Button>
-                )}
-                <Button
-                  data-step="m3"
-                  class={[styles.button, styles.hasText]}
-                  disabled={runtime.playState === 'play'}
-                  onClick={() => {
-                    SettingState.sett.fingering = !SettingState.sett.fingering
-                    RuntimeUtils.event.emit('settingFingeringChange')
-                  }}
-                >
-                  <ButtonIcon key="music" name={SettingState.sett.fingering ? 'fingeringOn' : 'fingeringOff'} />
-                  <span>指法</span>
-                </Button>
-              </>
-            )}
+            )}    
+                    
             {['practice', 'evaluation'].includes(modelType.value) && !search.lessonTrainingId && (
               <Popover
                 trigger="manual"