|
@@ -1,5 +1,6 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
import { Router } from '@angular/router'; // 导入 Router 服务
|
|
|
+import { ModalController } from '@ionic/angular/standalone';
|
|
|
import { CloudFPlan } from 'src/lib/cloudspplan'; // 引入 CloudFPlan 类
|
|
|
|
|
|
@Component({
|
|
@@ -13,7 +14,7 @@ export class PagePlanComponent implements OnInit {
|
|
|
plan: string = ''; // 用于存储 Plan 字段的内容
|
|
|
cloudFPlan: any;
|
|
|
|
|
|
- constructor(private router: Router) { } // 注入 Router
|
|
|
+ constructor(private router: Router ,private modalCtrl: ModalController) { } // 注入 Router
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.loadPlanData(); // 页面初始化时加载计划数据
|
|
@@ -43,6 +44,7 @@ export class PagePlanComponent implements OnInit {
|
|
|
exitPlan() {
|
|
|
console.log('退出运动计划');
|
|
|
// 执行退出逻辑,例如跳转到首页
|
|
|
- this.router.navigate(['/home']); // 假设跳转到首页路径为 /home
|
|
|
- }
|
|
|
+ this.modalCtrl.dismiss(); // 假设跳转到首页路径为 /home
|
|
|
+ }
|
|
|
+
|
|
|
}
|