cainiao-hue há 4 meses atrás
pai
commit
fa52bd30d1

+ 51 - 0
soul-app/src/app/edit-detail/README.md

@@ -0,0 +1,51 @@
+查看详情组件:
+页面结构
+1. 页面标题区
+组件: 页面标题
+元素:
+标题文本(H1)
+示例内容: “有效管理焦虑情绪的指南”
+2. 管理焦虑的技巧区
+组件: 技巧列表
+元素:
+列表项(每个技巧可以展开)
+示例内容:
+技巧一: 深呼吸
+描述: “通过深呼吸来放松身心,缓解焦虑。”
+技巧二: 运动
+描述: “规律的运动有助于释放压力和焦虑。”
+技巧三: 正念冥想
+描述: “通过正念练习来关注当下,减少焦虑。”
+3. 实用工具区
+组件: 工具推荐
+元素:
+工具名称
+工具描述
+使用链接或下载按钮
+示例内容:
+工具一: 焦虑管理APP
+描述: “帮助你记录情绪,提供放松练习。”
+按钮: “下载APP”
+工具二: 在线冥想课程
+描述: “提供多种冥想练习,帮助你减轻焦虑。”
+按钮: “查看课程”
+4. 资源区
+组件: 文章和视频推荐
+元素:
+文章标题
+视频缩略图
+资源链接
+示例内容:
+文章: “如何应对焦虑的五个方法”
+链接: “阅读更多”
+视频: “焦虑管理技巧”
+链接: “观看视频”
+5. 社区支持区
+组件: 社区讨论
+元素:
+讨论主题
+参与链接
+示例内容:
+主题: “分享你的焦虑管理经验”
+链接: “参与讨论”
+请您作为一名专业的Ionic前端工程师,帮我运用ionic v7 或v8及以上的angular版本standalone模式编写,选择合适的ionic组件来重构以上产品页面的各个区域和内容,如果涉及到图形效果请用ion-icon。并给出整个页面的edit-detail.component.html代码还有edit-detail.component.ts代码

+ 72 - 0
soul-app/src/app/edit-detail/edit-detail.component.html

@@ -0,0 +1,72 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-title>有效管理焦虑情绪的指南</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <!-- 管理焦虑的技巧区 -->
+  <section>
+    <ion-list>
+      <ion-list-header>
+        <ion-label>管理焦虑的技巧</ion-label>
+      </ion-list-header>
+      <ion-item *ngFor="let tip of tips">
+        <ion-label>
+          <h2>{{ tip.title }}</h2>
+          <p>{{ tip.description }}</p>
+        </ion-label>
+        <ion-icon name="chevron-down" slot="end" (click)="tip.expanded = !tip.expanded"></ion-icon>
+        <ion-item *ngIf="tip.expanded">
+          <ion-label>{{ tip.details }}</ion-label>
+        </ion-item>
+      </ion-item>
+    </ion-list>
+  </section>
+
+  <!-- 实用工具区 -->
+  <section>
+    <ion-list>
+      <ion-list-header>
+        <ion-label>实用工具</ion-label>
+      </ion-list-header>
+      <ion-item *ngFor="let tool of tools">
+        <ion-label>
+          <h2>{{ tool.name }}</h2>
+          <p>{{ tool.description }}</p>
+        </ion-label>
+        <ion-button slot="end" [href]="tool.link">{{ tool.buttonText }}</ion-button>
+      </ion-item>
+    </ion-list>
+  </section>
+
+  <!-- 资源区 -->
+  <section>
+    <ion-list>
+      <ion-list-header>
+        <ion-label>相关文章和视频</ion-label>
+      </ion-list-header>
+      <ion-item *ngFor="let resource of resources">
+        <ion-label>
+          <h2>{{ resource.title }}</h2>
+        </ion-label>
+        <ion-button slot="end" [href]="resource.link">{{ resource.buttonText }}</ion-button>
+      </ion-item>
+    </ion-list>
+  </section>
+
+  <!-- 社区支持区 -->
+  <section>
+    <ion-list>
+      <ion-list-header>
+        <ion-label>社区讨论</ion-label>
+      </ion-list-header>
+      <ion-item *ngFor="let discussion of discussions">
+        <ion-label>
+          <h2>{{ discussion.title }}</h2>
+        </ion-label>
+        <ion-button slot="end" [href]="discussion.link">参与讨论</ion-button>
+      </ion-item>
+    </ion-list>
+  </section>
+</ion-content>

+ 0 - 0
soul-app/src/app/settings/settings.page.scss → soul-app/src/app/edit-detail/edit-detail.component.scss


+ 22 - 0
soul-app/src/app/edit-detail/edit-detail.component.spec.ts

@@ -0,0 +1,22 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+
+import { EditDetailComponent } from './edit-detail.component';
+
+describe('EditDetailComponent', () => {
+  let component: EditDetailComponent;
+  let fixture: ComponentFixture<EditDetailComponent>;
+
+  beforeEach(waitForAsync(() => {
+    TestBed.configureTestingModule({
+      imports: [EditDetailComponent],
+    }).compileComponents();
+
+    fixture = TestBed.createComponent(EditDetailComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  }));
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 82 - 0
soul-app/src/app/edit-detail/edit-detail.component.ts

@@ -0,0 +1,82 @@
+import { CommonModule } from '@angular/common';
+import { Component, OnInit } from '@angular/core';
+import { IonHeader,IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonTitle, IonToolbar,IonInput,IonSearchbar } from '@ionic/angular/standalone';
+import { ExploreContainerComponent } from '../explore-container/explore-container.component';
+
+@Component({
+  selector: 'app-edit-detail',
+  templateUrl: './edit-detail.component.html',
+  styleUrls: ['./edit-detail.component.scss'],
+  standalone: true,
+  imports: [IonHeader,IonToolbar,IonTitle,IonContent,ExploreContainerComponent,
+    IonList,IonListHeader,IonItem,IonInput,IonSearchbar,
+    IonLabel,IonIcon,IonButton,CommonModule
+  ]
+})
+export class EditDetailComponent  implements OnInit {
+  tips = [
+    {
+      title: '深呼吸',
+      description: '通过深呼吸来放松身心,缓解焦虑。',
+      details: '深呼吸可以帮助你放慢心率,增加氧气摄入,改善心理状态。',
+      expanded: false,
+    },
+    {
+      title: '运动',
+      description: '规律的运动有助于释放压力和焦虑。',
+      details: '运动可以释放内啡肽,提升你的情绪。',
+      expanded: false,
+    },
+    {
+      title: '正念冥想',
+      description: '通过正念练习来关注当下,减少焦虑。',
+      details: '正念冥想可以帮助你更好地管理情绪,提升专注力。',
+      expanded: false,
+    },
+  ];
+
+  tools = [
+    {
+      name: '焦虑管理APP',
+      description: '帮助你记录情绪,提供放松练习。',
+      link: 'https://www.18183.com/down/2968763.html',
+      buttonText: '下载APP',
+    },
+    {
+      name: '在线冥想课程',
+      description: '提供多种冥想练习,帮助你减轻焦虑。',
+      link: 'https://www.bilibili.com/video/BV1gdUpYyEiw/',
+      buttonText: '查看视频',
+    },
+  ];
+
+  resources = [
+    {
+      title: '控制焦虑的方法',
+      link: 'https://m.baidu.com/bh/m/detail/ar_13481633186713755563',
+      buttonText: '查看更多',
+    },
+    {
+      title: '克服焦虑的方法',
+      link: 'https://m.baidu.com/bh/m/detail/ar_4824212419687234431',
+      buttonText: '阅读更多',
+    },
+    {
+      title: '焦虑管理技巧',
+      link: 'https://www.bilibili.com/video/BV1Kj2KYJEYU/',
+      buttonText: '观看视频',
+    },
+  ];
+
+  discussions = [
+    {
+      title: '分享你的焦虑管理经验',
+      link: 'https://example.com/community',
+    },
+  ];
+  constructor() { }
+
+  ngOnInit() {}
+
+}

+ 0 - 13
soul-app/src/app/settings/settings.page.html

@@ -1,13 +0,0 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>settings</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">settings</ion-title>
-    </ion-toolbar>
-  </ion-header>
-</ion-content>

+ 0 - 17
soul-app/src/app/settings/settings.page.spec.ts

@@ -1,17 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { SettingsPage } from './settings.page';
-
-describe('SettingsPage', () => {
-  let component: SettingsPage;
-  let fixture: ComponentFixture<SettingsPage>;
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(SettingsPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 20
soul-app/src/app/settings/settings.page.ts

@@ -1,20 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';
-
-@Component({
-  selector: 'app-settings',
-  templateUrl: './settings.page.html',
-  styleUrls: ['./settings.page.scss'],
-  standalone: true,
-  imports: [IonContent, IonHeader, IonTitle, IonToolbar, CommonModule, FormsModule]
-})
-export class SettingsPage implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {
-  }
-
-}

+ 4 - 14
soul-app/src/app/tab1/tab1.page.html

@@ -1,10 +1,5 @@
 <ion-header [translucent]="true">
   <ion-toolbar>
-    <!--
-    <ion-title>
-      首页
-    </ion-title>
-    -->
     <ion-buttons slot="end">
         <ion-searchbar>
         </ion-searchbar>
@@ -12,17 +7,10 @@
   </ion-toolbar>
 </ion-header>
 <ion-content [fullscreen]="true">
-<!--
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">首页</ion-title>
-    </ion-toolbar>
-  </ion-header>
-<app-explore-container name="Tab 1 page"></app-explore-container>-->
   <section>
   <ion-card>
     <ion-card-header>
-      <ion-card-title>专业心理咨询</ion-card-title>
+      <ion-card-title>心理咨询</ion-card-title>
     </ion-card-header>
     <ion-card-content>
       <ion-list>
@@ -52,7 +40,8 @@
             <h2>{{ topic.title }}</h2>
             <p>{{ topic.description }}</p>
           </ion-label>
-          <ion-button slot="end" [routerLink]="['/topic', topic.id]">查看详情</ion-button>
+          <ion-button (click)="viewDetails()">查看详情</ion-button>
+          <!--<ion-button slot="end" [routerLink]="['/topic', topic.id]" (click)="viewDetails()">查看详情</ion-button>-->
         </ion-item>
       </ion-list>
     </ion-card-content>
@@ -78,4 +67,5 @@
     </ion-card-content>
   </ion-card>
 </section>
+
 </ion-content>

+ 16 - 11
soul-app/src/app/tab1/tab1.page.ts

@@ -1,8 +1,10 @@
 import { Component,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 import { IonHeader, IonToolbar, IonTitle, IonContent, IonAvatar, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonLabel, IonList,
-   IonItem,IonIcon,IonCardTitle,IonInput,IonSearchbar } from '@ionic/angular/standalone';
+   IonItem,IonIcon,IonCardTitle,IonInput,IonSearchbar} from '@ionic/angular/standalone';
 import { ExploreContainerComponent } from '../explore-container/explore-container.component';
 import { CommonModule } from '@angular/common';
+import { EditDetailComponent } from '../edit-detail/edit-detail.component';
+import { Router } from '@angular/router';
 @Component({
   selector: 'app-tab1',
   templateUrl: 'tab1.page.html',
@@ -12,7 +14,7 @@ import { CommonModule } from '@angular/common';
     IonButtons,IonButton,IonIcon,
     IonCard,IonCardContent,IonCardHeader,IonCardTitle,
     IonLabel,IonList,IonItem,IonAvatar,IonInput,IonSearchbar,
-    CommonModule,
+    CommonModule,EditDetailComponent
   ],
   schemas: [CUSTOM_ELEMENTS_SCHEMA],
 })
@@ -25,21 +27,20 @@ export class Tab1Page {
   consultants = [
     {
       name: '李医生',
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       fields: ['焦虑', '抑郁']
     },
     {
       name: '张医生',
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       fields: ['人际关系', '情绪管理']
     },
     {
       name: '王医生',
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       fields: ['压力管理', '心理咨询']
     }
   ];
-
   topics = [
     {
       id: 1,
@@ -57,25 +58,29 @@ export class Tab1Page {
       description: '学习如何建立自信。'
     }
   ];
-
   reviews = [
     {
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       content: '这款APP真的帮助了我,感谢陪聊师!',
       rating: 4
     },
     {
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       content: '非常实用的心理咨询平台!',
       rating: 5
     },
     {
-      avatar: 'img/1.png',
+      avatar: '/assets/img/1.png',
       content: '我喜欢这里的热门话题!',
       rating: 4
     }
   ];
-
+  constructor(private router: Router) {
+    // 其他构造函数代码
+  }
+  viewDetails(){//查看详情
+    this.router.navigate(['/tabs/detail'])
+  }
   bookConsultation(consultant: any) {
     // 预约咨询逻辑
     console.log(`预约咨询: ${consultant.name}`);

+ 5 - 0
soul-app/src/app/tabs/tabs.routes.ts

@@ -21,6 +21,11 @@ export const routes: Routes = [
         loadComponent: () =>
           import('../tab3/tab3.page').then((m) => m.Tab3Page),
       },
+      {
+        path: 'detail',
+        loadComponent: () =>
+          import('../edit-detail/edit-detail.component').then((m) => m.EditDetailComponent),
+      },
       {
         path: '',
         redirectTo: '/tabs/tab1',

+ 2 - 2
soul-prod/README.md

@@ -78,7 +78,7 @@
 > 我最近学习压力好大啊,学也学不明白,真不知道怎么办了
 ## 专业建议
 - 专业性的情绪管理技巧与方法
-```python
+```js
 1. 情绪识别与表达
     - 情绪日记:记录每天的情绪变化及其触发因素,帮助识别情绪模式。
     - 情绪词汇:学习并使用丰富的情绪词汇,准确表达自己的感受。
@@ -113,7 +113,7 @@
     - 自我肯定:通过积极的自我对话增强自信和自尊。
 ```
 - 专业性的压力管理技巧与方法
-```python
+```js
 1. 认知行为疗法(CBT)
     - 识别负面思维:记录并识别引发压力的负面思维。
     - 挑战不合理信念:通过逻辑分析和证据挑战这些思维,寻找更合理的替代想法。