|  | @@ -19,11 +19,16 @@ import SettingModal from './setting-modal';
 | 
	
		
			
				|  |  |  import { randomScoreElement, renderScore, setting } from './setting';
 | 
	
		
			
				|  |  |  import { handleStartTick, hendleEndTick } from './tick';
 | 
	
		
			
				|  |  |  import { handleStartBeat, hendleEndBeat } from './beat-tick';
 | 
	
		
			
				|  |  | +import { browser } from '@/helpers/utils';
 | 
	
		
			
				|  |  | +import { useRoute } from 'vue-router';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'tempo-practice',
 | 
	
		
			
				|  |  |    setup() {
 | 
	
		
			
				|  |  | +    const route = useRoute();
 | 
	
		
			
				|  |  |      const state = reactive({
 | 
	
		
			
				|  |  | +      platform: route.query.platform, // microapp 老师端应用里面打开单独处理返回逻辑
 | 
	
		
			
				|  |  | +      win: route.query.win,
 | 
	
		
			
				|  |  |        settingStatus: false,
 | 
	
		
			
				|  |  |        speedList: [
 | 
	
		
			
				|  |  |          { text: '40', value: 40, color: '#060606' },
 | 
	
	
		
			
				|  | @@ -47,6 +52,20 @@ export default defineComponent({
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      // 返回
 | 
	
		
			
				|  |  |      const goback = () => {
 | 
	
		
			
				|  |  | +      if (state.platform === 'microapp') {
 | 
	
		
			
				|  |  | +        window.parent.postMessage(
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            api: 'iframe_exit'
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          '*'
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if (!browser().isApp) {
 | 
	
		
			
				|  |  | +        window.close();
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        postMessage({ api: 'goBack' });
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -89,7 +108,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        renderScore();
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      return () => (
 | 
	
		
			
				|  |  | -      <div class={styles.tempoPractice}>
 | 
	
		
			
				|  |  | +      <div class={[styles.tempoPractice, state.win === 'pc' ? styles.pc : '']}>
 | 
	
		
			
				|  |  |          <div class={styles.head}>
 | 
	
		
			
				|  |  |            <div class={styles.back} onClick={goback}>
 | 
	
		
			
				|  |  |              <img src={icon_back} />
 | 
	
	
		
			
				|  | @@ -102,36 +121,39 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        <div class={styles.container}>
 | 
	
		
			
				|  |  | -          {setting.scorePart.map((item: any, i: number) => (
 | 
	
		
			
				|  |  | -            <div
 | 
	
		
			
				|  |  | -              class={[
 | 
	
		
			
				|  |  | -                styles.beatSection,
 | 
	
		
			
				|  |  | -                // item.length !== 1 &&
 | 
	
		
			
				|  |  | -                setting.scorePart.length >= 2 &&
 | 
	
		
			
				|  |  | -                  item.length !== 1 &&
 | 
	
		
			
				|  |  | -                  styles.small
 | 
	
		
			
				|  |  | -              ]}>
 | 
	
		
			
				|  |  | -              {item.map((child: any, j: number) => (
 | 
	
		
			
				|  |  | -                <div
 | 
	
		
			
				|  |  | -                  class={[styles.beat, child.selected ? styles.active : '']}
 | 
	
		
			
				|  |  | -                  onClick={() => {
 | 
	
		
			
				|  |  | -                    if (setting.tempo.length <= 1) {
 | 
	
		
			
				|  |  | -                      showToast('无法切换,请选择至少2种节奏型');
 | 
	
		
			
				|  |  | -                      return;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    const obj = randomScoreElement(child.index);
 | 
	
		
			
				|  |  | -                    child.index = obj.index;
 | 
	
		
			
				|  |  | -                    child.url = obj.url;
 | 
	
		
			
				|  |  | -                  }}>
 | 
	
		
			
				|  |  | -                  <div class={styles.imgSection}>
 | 
	
		
			
				|  |  | -                    <img src={getImage(child.url)} />
 | 
	
		
			
				|  |  | +        <div class={styles.conCon}>
 | 
	
		
			
				|  |  | +          <div class={styles.container}>
 | 
	
		
			
				|  |  | +            {setting.scorePart.map((item: any, i: number) => (
 | 
	
		
			
				|  |  | +              <div
 | 
	
		
			
				|  |  | +                class={[
 | 
	
		
			
				|  |  | +                  styles.beatSection,
 | 
	
		
			
				|  |  | +                  setting.scorePart.length >= 2 &&
 | 
	
		
			
				|  |  | +                    item.length !== 1 &&
 | 
	
		
			
				|  |  | +                    styles.small
 | 
	
		
			
				|  |  | +                ]}>
 | 
	
		
			
				|  |  | +                {item.map((child: any, j: number) => (
 | 
	
		
			
				|  |  | +                  <div
 | 
	
		
			
				|  |  | +                    class={[styles.beat, child.selected ? styles.active : '']}
 | 
	
		
			
				|  |  | +                    onClick={() => {
 | 
	
		
			
				|  |  | +                      if (setting.playState === 'play') return;
 | 
	
		
			
				|  |  | +                      if (setting.tempo.length <= 1) {
 | 
	
		
			
				|  |  | +                        showToast('无法切换,请选择至少2种节奏型');
 | 
	
		
			
				|  |  | +                        return;
 | 
	
		
			
				|  |  | +                      }
 | 
	
		
			
				|  |  | +                      const obj = randomScoreElement(child.index);
 | 
	
		
			
				|  |  | +                      child.index = obj.index;
 | 
	
		
			
				|  |  | +                      child.url = obj.url;
 | 
	
		
			
				|  |  | +                    }}>
 | 
	
		
			
				|  |  | +                    <div class={styles.imgSection}>
 | 
	
		
			
				|  |  | +                      <img src={getImage(child.url)} />
 | 
	
		
			
				|  |  | +                    </div>
 | 
	
		
			
				|  |  |                    </div>
 | 
	
		
			
				|  |  | -                </div>
 | 
	
		
			
				|  |  | -              ))}
 | 
	
		
			
				|  |  | -            </div>
 | 
	
		
			
				|  |  | -          ))}
 | 
	
		
			
				|  |  | +                ))}
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            ))}
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          <div class={styles.footer}>
 | 
	
		
			
				|  |  |            {/* 播放 */}
 | 
	
		
			
				|  |  |            <div class={styles.play} onClick={handlePlay}>
 |