mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix go back
This commit is contained in:
+38
-24
@@ -1,4 +1,4 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, OnInit, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
@@ -13,6 +13,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { StopvideoService } from "src/app/services/stopvideo.service"
|
||||
import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service'
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -34,6 +35,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
dynamicBullets: true
|
||||
}
|
||||
|
||||
isComponentIsAlive = true
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications:PublicationsService,
|
||||
@@ -45,7 +48,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService,
|
||||
public StopvideoService: StopvideoService
|
||||
public StopvideoService: StopvideoService,
|
||||
public PublicationHolderService: PublicationHolderService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -77,6 +81,19 @@ export class PublicationDetailPage implements OnInit {
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
|
||||
|
||||
|
||||
window['publicationEdit'] = () => {
|
||||
if(this.isComponentIsAlive == true) {
|
||||
this.getPublicationDetail()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
OnDestroy() {
|
||||
this.isComponentIsAlive = false
|
||||
}
|
||||
doRefresh(event) {
|
||||
this.getPublicationDetail();
|
||||
@@ -131,9 +148,6 @@ export class PublicationDetailPage implements OnInit {
|
||||
if(this.isModal) {
|
||||
this.close()
|
||||
} else {
|
||||
if(window['app-view-publications-page-doRefresh']) {
|
||||
window['app-view-publications-page-doRefresh']()
|
||||
}
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
@@ -167,28 +181,28 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
async editPost(publicationType:any) {
|
||||
if(this.PublicationHolderService.PublicationFormMV.length == 0) {
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
publicationType: publicationType,
|
||||
publication: this.publication,
|
||||
folderId: this.folderId
|
||||
},
|
||||
cssClass: 'new-publication modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
publicationType: publicationType,
|
||||
publication: this.publication,
|
||||
folderId: this.folderId
|
||||
},
|
||||
cssClass: 'new-publication modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
} else {
|
||||
this.toastService._successMessage('já existe uma publicação a ser processado');
|
||||
}
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if(data.data) {
|
||||
this.publication = data.data
|
||||
if(window['app-view-publications-page-doRefresh']) {
|
||||
window['app-view-publications-page-doRefresh']()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
async openPreview(item) {
|
||||
|
||||
@@ -126,6 +126,10 @@ export class PublicationFromMvService {
|
||||
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
|
||||
}
|
||||
|
||||
if(window['publicationEdit']) {
|
||||
window['publicationEdit']()
|
||||
}
|
||||
|
||||
this.publicationFolderService.getPublicationsIds(this.folderId)
|
||||
window['upload-header-set-remove'](this.id);
|
||||
|
||||
|
||||
@@ -10,28 +10,28 @@
|
||||
<div >
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
||||
[src]="'data:image/jpg;base64,' + files.FileBase64" loading="lazy">
|
||||
|
||||
|
||||
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="none"
|
||||
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)" (click)="playVideo()">
|
||||
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)"q>
|
||||
<source [src]="files.FileBase64" type="video/mp4">
|
||||
</video>
|
||||
|
||||
<!-- <button class="play-button" *ngIf="!videoPlaying && checkFileType.checkFileType(files.FileExtension ) == 'video'">
|
||||
▶
|
||||
</button> -->
|
||||
|
||||
|
||||
</div>
|
||||
</swiper-slide>
|
||||
|
||||
|
||||
</swiper-container>
|
||||
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div *ngIf="publicationList.Files.length > 1" class="dots-container">
|
||||
<span *ngFor="let files of publicationList.Files; let k = index"
|
||||
[class.dotsSwiper]="true"
|
||||
<span *ngFor="let files of publicationList.Files; let k = index"
|
||||
[class.dotsSwiper]="true"
|
||||
[class.active-dot]="swiperIndex === k"
|
||||
(click)="goToSlide(k)"
|
||||
>
|
||||
|
||||
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
export const environment: Environment = oaprProd;
|
||||
export const environment: Environment = DevDev;
|
||||
|
||||
Reference in New Issue
Block a user