### File

`src/app/services/services.page.ts`

### Metadata

selector | `app-services`
styleUrls | `./services.page.scss`
templateUrl | `./services.page.html`

### Index

###### Properties

- hasSelfDisciplineScore
- hasTimeOptimizationSuggestion
- selfDisciplineEvaluation
- selfDisciplineScore
- timeOptimizationSuggestion

###### Methods

- generateAISchedule
- generateSelfDisciplineScore
- generateTimeOptimizationSuggestion

### Constructor

`constructor()`
Defined in src/app/services/services.page.ts:14

### Methods

generateAISchedule
`generateAISchedule()`
Defined in src/app/services/services.page.ts:18
Returns : `void`

generateSelfDisciplineScore
`generateSelfDisciplineScore()`
Defined in src/app/services/services.page.ts:23
Returns : `void`

generateTimeOptimizationSuggestion
`generateTimeOptimizationSuggestion()`
Defined in src/app/services/services.page.ts:30
Returns : `void`

### Properties

hasSelfDisciplineScore
Default value : `false`
Defined in src/app/services/services.page.ts:9

hasTimeOptimizationSuggestion
Default value : `false`
Defined in src/app/services/services.page.ts:13

selfDisciplineEvaluation
Type : `string`
Default value : `''`
Defined in src/app/services/services.page.ts:11

selfDisciplineScore
Type : `string`
Default value : `''`
Defined in src/app/services/services.page.ts:10

timeOptimizationSuggestion
Type : `string`
Default value : `''`
Defined in src/app/services/services.page.ts:14

    import { Component } from '@angular/core';

    @Component({
      selector: 'app-services',
      templateUrl: './services.page.html',
      styleUrls: ['./services.page.scss'],
    })
    export class ServicesPage {
      hasSelfDisciplineScore = false;
      selfDisciplineScore: string = '';
      selfDisciplineEvaluation: string = '';

      hasTimeOptimizationSuggestion = false;
      timeOptimizationSuggestion: string = '';

      constructor() { }

      generateAISchedule() {
        // 进入子页面生成AI时间表的逻辑
        console.log('AI时间表生成按钮点击');
      }

      generateSelfDisciplineScore() {
        this.hasSelfDisciplineScore = true;
        this.selfDisciplineScore = '自律评分：85';
        this.selfDisciplineEvaluation = '昨天的表现很好，继续保持！';
        console.log('自律评分生成');
      }

      generateTimeOptimizationSuggestion() {
        this.hasTimeOptimizationSuggestion = true;
        this.timeOptimizationSuggestion = '建议每天早起一小时，提高效率。';
        console.log('时间优化建议生成');
      }
    }

    <ion-header>
      <ion-toolbar>
        <ion-title>服务页面</ion-title>
      </ion-toolbar>
    </ion-header>

    <ion-content>
      <ion-button expand="block" color="primary" (click)="generateAISchedule()" class="ai-schedule-button">
        <ion-icon slot="start" name="calendar"></ion-icon>
        AI时间表生成
      </ion-button>

      <h2 class="center-title">自律评分</h2>
      <ion-card class="custom-card">
        <ion-card-content>
          <div *ngIf="!hasSelfDisciplineScore">
            <ion-button expand="block" color="secondary" (click)="generateSelfDisciplineScore()">
              生成
            </ion-button>
          </div>
          <div *ngIf="hasSelfDisciplineScore">
            <p>{{ selfDisciplineScore }}</p>
            <p>{{ selfDisciplineEvaluation }}</p>
          </div>
        </ion-card-content>
      </ion-card>

      <h2 class="center-title">时间优化建议</h2>
      <ion-card class="custom-card">
        <ion-card-content>
          <div *ngIf="!hasTimeOptimizationSuggestion">
            <ion-button expand="block" color="tertiary" (click)="generateTimeOptimizationSuggestion()">
              生成
            </ion-button>
          </div>
          <div *ngIf="hasTimeOptimizationSuggestion">
            <p>{{ timeOptimizationSuggestion }}</p>
          </div>
        </ion-card-content>
      </ion-card>
    </ion-content>

`./services.page.scss`

    ion-header {
        --background: #f8f9fa;
        --color: #000;
      }

      ion-content {
        --padding-start: 16px;
        --padding-end: 16px;
      }

      .ai-schedule-button {
        margin-top: 20px;
        height: 50px;
      }

      .center-title {
        text-align: center;
        font-size: 1.2em;
        font-weight: bold;
        margin-top: 20px;
        margin-bottom: 10px;
      }

      .custom-card {
        margin: 20px 0;
        padding: 20px;
      }

Legend
Html element
Component
Html element with directive

# results matching ""

# No results matching ""