page-publishsurvey.component.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { Component, OnInit,NgModule } from '@angular/core';
  2. import { Router } from '@angular/router';
  3. import { IonHeader,IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList,
  4. IonListHeader,IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar,IonInput,IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption } from '@ionic/angular/standalone';
  5. import { CommonModule } from '@angular/common';
  6. import { FormsModule } from '@angular/forms';
  7. @Component({
  8. selector: 'app-page-publishsurvey',
  9. templateUrl: './page-publishsurvey.component.html',
  10. styleUrls: ['./page-publishsurvey.component.scss'],
  11. standalone: true,
  12. imports: [
  13. IonHeader,IonToolbar,IonTitle,IonContent,IonSegment,IonSegmentButton,IonSelect,IonSelectOption,
  14. IonList,IonListHeader,IonItem,IonCardTitle,
  15. IonLabel,IonIcon,IonButton,IonCardContent,
  16. IonInput,IonSearchbar,IonCard,IonCardHeader,
  17. CommonModule,FormsModule
  18. ]
  19. })
  20. export class PagePublishsurveyComponent implements OnInit {
  21. category: string = 'school'; // 默认类别
  22. surveyTitle: string = '';
  23. surveyLink: string = '';
  24. targetAudience: string = 'all'; // 默认面向对象
  25. societySurveyTitle: string = '';
  26. societySurveyLink: string = '';
  27. onCategoryChange() {
  28. console.log(`当前选择的类别: ${this.category}`);
  29. }
  30. publishSurvey() {
  31. console.log('发布学校问卷:');
  32. console.log(`标题: ${this.surveyTitle}`);
  33. console.log(`链接: ${this.surveyLink}`);
  34. console.log(`面向对象: ${this.targetAudience}`);
  35. // 这里可以添加逻辑将问卷发布到后端或其他处理
  36. }
  37. publishSocietySurvey() {
  38. console.log('发布社会问卷:');
  39. console.log(`标题: ${this.societySurveyTitle}`);
  40. console.log(`链接: ${this.societySurveyLink}`);
  41. // 这里可以添加逻辑将问卷发布到后端或其他处理
  42. }
  43. constructor(private router: Router) { }
  44. goTab1(){
  45. this.router.navigate(['tabs/tab1']);
  46. }
  47. ngOnInit() {}
  48. }