Kaynağa Gözat

feat: 保存作品提示逻辑

TIANYONG 8 ay önce
ebeveyn
işleme
815fff89d7

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

@@ -1030,7 +1030,7 @@ export default defineComponent({
                 }}
                 class={[styles.evaluatStartBtn]}
                 onClick={async () => {
-                  runtime.initShow = false
+                  runtime.initShow = true
                   // 评测模式,如果有系统节拍器,需要先播放系统节拍器
                   if (detailState.needTick) {
                     await RuntimeUtils.setEvaluatTick()

+ 5 - 6
src/subpages/colexiu/popups/evaluating/content.tsx

@@ -70,7 +70,6 @@ export default defineComponent({
     /** 是否是单元测试 */
     const isUnitTest = search.unitId ? true : false
     const shareShow = ref(false)
-    const noSaveTipShow = ref(true)
     const shareLoadedPngData = ref('')
     const { data } = toRefs(props)
     const pathname = location.pathname
@@ -144,10 +143,9 @@ export default defineComponent({
 
     // 播放倍率不等于1,或者是选段评测,APP暂时不支持保存演奏,需要给出提示
     const noSaveTips = computed(() => {
-      console.log('提示123',noSaveTipShow.value)
       let tipContent = '';
-      if (isUnitTest || detailState.section.length === 2 || runtime.basePlayRate != 1 || !runtime.songs.background) {
-        tipContent = isUnitTest ? '单元测验暂不支持保存作品噢~' : !runtime.songs.background ? '该曲目暂不支持保存作品噢~' : detailState.section.length === 2 ? '选段后暂不支持保存作品噢~' : runtime.basePlayRate != 1 ? '调速后暂不支持保存作品噢~' : '';
+      if (isUnitTest || detailState.section.length === 2 || detailState.activeDetail.isAppPlay || runtime.basePlayRate != 1 || !runtime.songs.background) {
+        tipContent = isUnitTest ? '单元测验暂不支持保存作品噢~' : (!runtime.songs.background || detailState.activeDetail.isAppPlay) ? '该曲目暂不支持保存作品噢~' : detailState.section.length === 2 ? '选段后暂不支持保存作品噢~' : runtime.basePlayRate != 1 ? '调速后暂不支持保存作品噢~' : '';
       }
       return tipContent
     })
@@ -247,6 +245,7 @@ export default defineComponent({
                     <Button
                       style={{ margin: '0 4px' }}
                       onClick={() => {
+                        runtime.initShow = true;
                         detailState.evaluatings = {}
                         emit('restart')
                       }}
@@ -282,11 +281,11 @@ export default defineComponent({
                     保存作品
                   </div>
                   {
-                    noSaveTips.value && noSaveTipShow.value ? 
+                    noSaveTips.value && runtime.initShow ? 
                     <div class={[styles.noSaveTip]}>
                       <span class={styles.arrowIcon}></span>
                       {noSaveTips.value}
-                      <i onClick={() => noSaveTipShow.value = false}></i>
+                      <i onClick={() => runtime.initShow = false}></i>
                     </div> : null                   
                   }
                 </div>