问题描述
我正在尝试解决一个错误,但我不明白。我在Ios应用程序上工作,该应用程序在调试版本中可以正常工作,但是无法在发行版中打开组件。按照我来自不同组件的代码进行导航。
裁剪部分的代码:
go() {
if (this.photoService.cropping === true) {
console.log("Je suis passé par là: go en mode multiple");
this.toPreview();
}
else {
setTimeout(() => {
if (this.comeBackRoute == "chat") {
console.log("Je suis passé par là: go on revient au chat");
this.router.back();
} else {
console.log("Je suis passé par là: go to Validation");
this.router.navigate([this.comeBackRoute]);
}
},10);
}
}
预览组件的代码:
sendPhotos() {
console.log("Je suis passé par là: sendPhotos");
this.photoService.pathes = this.pathes;
this.photoService.finished = true;
setTimeout(() => {
if (this.comeBackRoute == "chat") {
console.log("Je suis passé par là: sendPhotosChat");
this.router.back();
} else {
console.log("Je suis passé par là: sendPhotos autre chemin");
this.router.navigate([this.comeBackRoute]);
}
},10);
}
仪表板组件中的代码:
onChooseDocument() {
this.showSubFab = false;
// topmost().transition = { name: "slidetop",duration: 380 };
this.router.navigate([
"sendInvoice",{ type: "external",clearHistory: false }
]);
}
这是来自验证组件的ngOnInit,它是目的地:
async ngOnInit() {
var compteur = 0;
this.possibleError = false;
this.launch = true;
this.ScrollViewHeight = "0";
this.path = "";
this.pictureName = "";
this.pdfPreview = false;
setBoolean("newMessage",false);
setBoolean("validation",true);
console.log("before page route activated route")
// used to get the params back from the "url" routing
this.pageRoute.activatedRoute
.switchMap(activatedRoute => activatedRoute.params)
.forEach(params => {
this.params = params["type"];
});
this.pathPhoto = this.photoService.pathes[0];
if (this.pathPhoto && this.pathPhoto !== "//PhotoCancelled//") {
this.busy = false;
this.ScrollViewHeight = "100%";
this.processFileBeforeUpload([this.pathPhoto,this.pathPhoto]);
} else if (this.params === "external") {
this.pickAlreadyExistingDocument();
} else {
this.moveBackToDashboard();
}
if (isIOS && this.params === "external") {
//
this.fileSubs = this.documentPicker.pickedFile2.subscribe(url => {
//url du fichier capté
if (
(url && url !== getString("path")) ||
(url && getString("path") == undefined)
) {
compteur = 0;
//url différent du précédent
this.processFileBeforeUpload([url,url]);
this.ngzone.run(() => {
//refresh component
});
} else {
}
});
}
this.cancelledSub = this.documentPicker.cancelledPicking.subscribe(
cancelled => {
if (cancelled === true) {
this.routerExtensions.back()
}
}
);
// else get the argument and up
connectivity.startMonitoring(connectionType => {
this.ngzone.run(() => {
this.isConnectionEnabled = connectivity.getConnectionType() != 0;
});
});
// managing the case of companies with no upload folder capabilities
if (this.companyService.currentCompany.multiFolderEnable) {
this.isMultiFolderUnable = true;
this.selectedUploadFolder = null;
this.companyService.getUploadFolders().subscribe(
(data: UploadFolder[]) => {
this.uploadFolderList = [];
data.forEach((uploadFolder: UploadFolder) => {
uploadFolder.isSelected = false;
this.uploadFolderList.push(uploadFolder);
});
},error => {
let e = new TimestampConsoleWriter();
this.errorReportingService.PostError(
e.write(error,"error get upload folder",messageType.error),this.companyService.getCurrentCompany().key
);
this.routerExtensions.navigate(["/login"],{ clearHistory: true });
}
);
}
this.launch = false;
}
更清楚地说,如果先前的组件是chat(在这种情况下我们不传递给验证的组件),comeBackRoute接受参数聊天;在其他情况下,sendInvoice则是验证的组件的路由名称。问题是我无法在发行版中打开最后一个组件,就像这个问题特定于该组件一样,我认为错误的根源在于它。
提前向大家致意。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)