Commit 26753b31 authored by liujiangnan's avatar liujiangnan

fix: 显示问题

parent 1a414e7e
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core'; import { Component, ApplicationRef,ChangeDetectorRef,ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core';
import * as _ from 'lodash'; import * as _ from 'lodash';
import {trigger, state, transition, style, animate, keyframes} from '@angular/animations'; import {trigger, state, transition, style, animate, keyframes} from '@angular/animations';
...@@ -41,7 +41,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges { ...@@ -41,7 +41,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges {
_lc_text = ''; _lc_text = '';
_data = []; _data = [];
constructor() { constructor(private appRef: ApplicationRef,
public changeDetectorRef: ChangeDetectorRef) {
this.rightAudio.src = 'assets/right.mp3'; this.rightAudio.src = 'assets/right.mp3';
this.rightAudio.load(); this.rightAudio.load();
this.wrongAudio.src = 'assets/wrong.mp3'; this.wrongAudio.src = 'assets/wrong.mp3';
...@@ -78,7 +79,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges { ...@@ -78,7 +79,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges {
this.audio.currentTime = 0; this.audio.currentTime = 0;
this.isPlaying = false; this.isPlaying = false;
window["air"].hideAirClassLoading(this.saveKey, this.data) window["air"].hideAirClassLoading(this.saveKey, this.data);
this.refresh();
}, this.saveKey); }, this.saveKey);
} }
...@@ -120,5 +124,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges { ...@@ -120,5 +124,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges {
} }
} }
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment