You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { NavController } from '@ionic/angular';
|
|
|
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
|
|
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
|
|
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-survey',
|
|
|
|
|
templateUrl: './survey.component.html',
|
|
|
|
|
styleUrls: ['./survey.component.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class SurveyComponent implements OnInit {
|
|
|
|
|
rate: any;
|
|
|
|
|
isSkip: boolean = false;
|
|
|
|
|
setTime: number = 5;
|
|
|
|
|
satisfied: any = '5';
|
|
|
|
|
|
|
|
|
|
constructor(public ts: TranslatorService, public cs: CommonService, public nav: NavController, public authService: AuthenticationService) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.setTimer();
|
|
|
|
|
}
|
|
|
|
|
skip() {
|
|
|
|
|
this.nav.pop();
|
|
|
|
|
CommonService.SKIP = true;
|
|
|
|
|
}
|
|
|
|
|
setTimer() {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.setTime--;
|
|
|
|
|
if (this.setTime == 0) {
|
|
|
|
|
this.isSkip = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.setTimer();
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
saveSruvey() {
|
|
|
|
|
|
|
|
|
|
var request = {}
|
|
|
|
|
this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
select(rating) {
|
|
|
|
|
this.satisfied = rating;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|