我正在使用 ionicv2 和 Adobe Creative SDK 构建照片编辑应用程序。我已经成功实现了创意SDK。
C SDK 成功返回编辑文件的 url 后,我会推送包含段的页面以及文件 URL。
问题出在第二页上,当我单击该段时,它不会切换。仅当我单击页面内的输入时它才会切换。
我尝试在没有 CSDK 的情况下执行此操作,并且运行没有任何问题。
My Code:
loadCamera(sourceType){
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: sourceType
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64:
let base64Image = 'data:image/jpeg;base64,' + imageData;
var thisModule = this;
function success(newUrl) {
console.log("Success Editing!", newUrl);
thisModule.goToCreate(newUrl);
}
function error(error) {
console.log("Error!", error);
}
/* Optional `options` object. See API guide for usage. */
var options = {
outputType: CSDKImageEditor.OutputType.JPEG,
quality: 70
};
/* Launch the Image Editor */
CSDKImageEditor.edit(success, error, base64Image, options);
}, (err) => {
// Handle error
});
}
/* Push a new page along with url */
goToCreate(url){
this.nav.push(SecondPage, {url: url});
}
}
第二页(包含段组件)
section: string;
url: string;
constructor(...) {
this.url = navParams.get('url');
console.log(this.url); //Working Perfectly
this.section = "segment1";
}
onSegmentChanged(segmentButton: SegmentButton) {
// console.log('Segment changed to', segmentButton.value);
}
onSegmentSelected(segmentButton: SegmentButton) {
// console.log('Segment selected', segmentButton.value);
}
第二页 HTML (当我点击段 2 时,它不会去那里,除非我点击段 1 内的输入)
<ion-content class="secondpage-content">
<ion-segment class="secondpage-segment" [(ngModel)]="section" (ionChange)="onSegmentChanged($event)">
<ion-segment-button value="segment1" (ionSelect)="onSegmentSelected($event)">
Segment 1
</ion-segment-button>
<ion-segment-button value="segment2" (ionSelect)="onSegmentSelected($event)">
Segment 2
</ion-segment-button>
<ion-segment-button value="segment3" (ionSelect)="onSegmentSelected($event)">
Segment 3
</ion-segment-button>
</ion-segment>
<div [ngSwitch]="section">
<div *ngSwitchCase="'segment1'" >
<ion-item>
<ion-label floating>Input</ion-label>
<ion-input type="text" formControlName="input_example"></ion-input>
</ion-item>
</div>
<div *ngSwitchCase="'segment2'" >
</div>
<div *ngSwitchCase="'segment3'" >
</div>
</div>
</ion-content>
另外,控制台日志不会返回任何错误。你知道发生了什么事吗?我真的认为它与CSDK有关。谢谢