123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import { Component, OnInit } from '@angular/core';
- import { Router } from '@angular/router';
- import { IonicModule } from '@ionic/angular'; // 导入 IonicModule
- import { addIcons } from 'ionicons';
- import { chevronBack } from 'ionicons/icons';
- import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
- addIcons({chevronBack});
- @Component({
- selector: 'app-page-evaluate',
- templateUrl: './page-evaluate.component.html',
- styleUrls: ['./page-evaluate.component.scss'],
- standalone: true,
- imports: [IonicModule,EditRatingStarComponent],
-
- })
- export class PageEvaluateComponent implements OnInit {
- ngOnInit() {}
- constructor(private router: Router) {}
-
- // 返回按钮点击事件
- goBack() {
- this.router.navigate(['tabs/tab3']);
- }
- submitEvaluation() {
- // 处理评价提交逻辑
- console.log('发表评价');
- // 这里可以添加您希望执行的代码,例如将评价发送到服务器
- }
- //星星打分
- currentScore: number = 0; // 初始分值
- handleScoreChange(newScore: number) {
- this.currentScore = newScore;
- console.log('新分值:', newScore); // 处理分值变化
- }
- getScoreDescription(score: number): string {
- switch (score) {
- case 1:
- return '很差';
- case 2:
- return '差';
- case 3:
- return '一般';
- case 4:
- return '还不错';
- case 5:
- return '很满意';
- default:
- return ''; // 默认返回空字符串
- }
- }
- alertButtons = ['退出'];
- }
|