|
@@ -8,17 +8,57 @@ import { NavController } from '@ionic/angular';
|
|
|
})
|
|
|
export class Tab4Page implements OnInit {
|
|
|
|
|
|
- constructor(private navCtrl: NavController) {this.selectedContent = '发布';}
|
|
|
- selectedContent: string = '';
|
|
|
+ constructor(private navCtrl: NavController) {}//this.selectedContent = '发布';
|
|
|
+ selectedContent: string = '发布';
|
|
|
+
|
|
|
+ publishedWorks: any[] = [
|
|
|
+ {description: '这是发布作品1的描述' },
|
|
|
+ {description: '这是发布作品2的描述' },
|
|
|
+ // 其他发布作品信息
|
|
|
+ ];
|
|
|
+
|
|
|
+ collectedWorks: any[] = [
|
|
|
+ {description: '这是收藏作品1的描述' },
|
|
|
+ {description: '这是收藏作品2的描述' },
|
|
|
+ // 其他收藏作品信息
|
|
|
+ ];
|
|
|
+
|
|
|
+ likedWorks: any[] = [
|
|
|
+ {description: '这是点赞作品1的描述' },
|
|
|
+ {description: '这是点赞作品2的描述' },
|
|
|
+ // 其他点赞作品信息
|
|
|
+ ];
|
|
|
+
|
|
|
+ viewedWorks: any[] = [
|
|
|
+ {description: '这是浏览作品1的描述' },
|
|
|
+ {description: '这是浏览作品2的描述' },
|
|
|
+ // 其他浏览作品信息
|
|
|
+ ];
|
|
|
+
|
|
|
+ selectedWorks: any[] = [];
|
|
|
|
|
|
showContent(content: string) {
|
|
|
- if (content === '收藏') {
|
|
|
- this.selectedContent = '一个作品都没有';
|
|
|
- } else {
|
|
|
- this.selectedContent = content;
|
|
|
+ this.selectedContent = content;
|
|
|
+ switch(content) {
|
|
|
+ case '发布':
|
|
|
+ this.selectedWorks = this.publishedWorks;
|
|
|
+ break;
|
|
|
+ case '收藏':
|
|
|
+ this.selectedWorks = this.collectedWorks;
|
|
|
+ break;
|
|
|
+ case '点赞':
|
|
|
+ this.selectedWorks = this.likedWorks;
|
|
|
+ break;
|
|
|
+ case '浏览':
|
|
|
+ this.selectedWorks = this.viewedWorks;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.selectedWorks = [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
openFeedbackPage() {
|
|
|
// 打开反馈页面
|
|
|
}
|
|
@@ -28,7 +68,12 @@ export class Tab4Page implements OnInit {
|
|
|
// 打开设置页面
|
|
|
}
|
|
|
|
|
|
+ openLoginPage() {
|
|
|
+ this.navCtrl.navigateForward('/login');
|
|
|
+ }
|
|
|
+
|
|
|
ngOnInit() {
|
|
|
+ this.showContent(this.selectedContent);
|
|
|
}
|
|
|
|
|
|
}
|