sqj 2 kuukautta sitten
vanhempi
commit
cbbcad66c7

+ 4 - 1
FitMind-app/angular.json

@@ -126,7 +126,10 @@
     }
   },
   "cli": {
-    "schematicCollections": ["@ionic/angular-toolkit"]
+    "schematicCollections": [
+      "@ionic/angular-toolkit"
+    ],
+    "analytics": "6b290171-7721-4516-8735-cb19df21f329"
   },
   "schematics": {
     "@ionic/angular-toolkit:component": {

+ 27 - 86
FitMind-app/src/app/ai-chat-component/ai-chat-component.component.html

@@ -1,25 +1,24 @@
-<!--头部内容-->
 <ion-header>
-  <ion-toolbar class="custom-toolbar" >
+  <ion-toolbar class="custom-toolbar">
     <ion-buttons slot="start">
-      <ion-button (click)="goBack()">  <!--返回按钮-->
+      <ion-button (click)="goBack()">  <!-- 返回按钮 -->
         <ion-icon name="chevron-back-sharp" style="color: black; font-size:27px"></ion-icon>
       </ion-button>
     </ion-buttons>
-    <ion-title>hcx</ion-title>  <!--AI名称-->
+    <ion-title>Neon</ion-title>  <!-- AI名称 -->
     <ion-buttons slot="end">
-      <ion-button (click)="openOptions()">   <!--更多按钮-->
+      <ion-button (click)="openOptions()">   <!-- 更多按钮 -->
         <ion-icon name="ellipsis-horizontal" style="color: black; font-size:27px"></ion-icon>
       </ion-button>
     </ion-buttons>
   </ion-toolbar>
 </ion-header>
 
-<!--聊天区域:聊天内容保存在messages-->
 <ion-content>
   <div class="chat-container">
+    <!-- 显示消息 -->
     <div *ngFor="let message of messages" class="message-container">
-      <!-- 如果是用户消息,头像和消息都在右边 -->
+      <!-- 用户消息 -->
       <div *ngIf="message.sender === 'user'" class="message-content user-message-content">
         <div class="message-bubble user-message">
           {{ message.text }}
@@ -29,7 +28,7 @@
         </div>
       </div>
       
-      <!-- 如果是 AI 消息,头像和消息都在左边 -->
+      <!-- AI 消息 -->
       <div *ngIf="message.sender === 'ai'" class="message-content ai-message-content">
         <div class="ai-avatar">
           <img src="../../assets/images/cxtouxiang.jpg" alt="AI头像" />
@@ -38,96 +37,38 @@
           {{ message.text }}
         </div>
       </div>
-
     </div>
 
-<!--当AI正在生成内容时显示加载动画-->
+    <!-- 显示加载动画 -->
     <div *ngIf="isLoading" class="message-content ai-message-content">
       <div class="ai-avatar">
         <img src="../../assets/images/cxtouxiang.jpg" alt="AI头像" />
       </div>
       <div class="message-bubble ai-message">
-      <div class="loading-dots">
-        <div class="loading-dot"></div>
-        <div class="loading-dot"></div>
-        <div class="loading-dot"></div>
+        <div class="loading-dots">
+          <div class="loading-dot"></div>
+          <div class="loading-dot"></div>
+          <div class="loading-dot"></div>
+        </div>
       </div>
     </div>
-  </div>
 
   </div>
 </ion-content>
 
-<!--表情模拟框-->
-<ion-modal [isOpen]="isEmojiPickerOpen" (didDismiss)="closeEmojiPicker()"  [initialBreakpoint]="0.25" [breakpoints]="[0, 0.25, 0.5, 0.75]"
- handleBehavior="cycle" >
-  <ng-template>
-    <ion-content class="emoji-picker" >
-        <div *ngFor="let emoji of emojis" (click)="addEmoji(emoji)" fill="clean" class="emoji-button"> <!--表情按钮-->
-          {{ emoji }}
-        </div>
-    </ion-content>
-  </ng-template>
-</ion-modal>
-
-<!--底部内容-->
-<ion-footer style="background-color: #99d75c;">
-  <ion-toolbar>
-    <div class="footer-content">
+<!-- 文本输入框 -->
+<ion-footer>
+  <ion-input placeholder="输入消息..." class="input-box" [(ngModel)]="userMessage">
+    <ion-button (click)="openEmojiPicker()" fill="clear" slot="end">
+      <ion-icon name="happy-outline" style="color:#99d75c; font-size: 30px;"></ion-icon> <!-- 表情符号 -->
+    </ion-button>
+  </ion-input>
 
-      <ion-buttons>  <!--语音输入-->
-        <ion-button (click)="startVoice()" fill="clear" id="open-modal">
-          <ion-icon name="mic-circle-outline" style="color: white; font-size: 40px;"></ion-icon>
-        </ion-button>
-        
-     <!--语音输入模态框 -->
-<ion-modal [isOpen]="isVoiceModalOpen" (didDismiss)="cancleVoice()" [initialBreakpoint]="0.25" [breakpoints]="[0, 0.25, 0.5, 0.75]" handleBehavior="cycle"
-[backdropDismiss]="false">
-  <ng-template>
-    <ion-content class="yuyinframe">
-      <div class="modal-content">
-        <!--取消按钮-->
-        <ion-icon name="close-circle-outline" (click)="cancelVoiceInput()" class="cancle-button"></ion-icon>
-        
-        <div class="timer-container">
-          <!--计时器-->
-          <div style="color: black; font-size: 24px;" id="timer">{{ timer }}</div>
-         
-          <!--音律跳动-->
-              <div class="light">
-                  <span></span>
-                  <span></span>
-                  <span></span>
-                  <span></span>
-                  <span></span>
-              </div>
-          
-        </div>
-        <!--提交语音内容按钮-->
-        <div class="send-button">
-          <ion-icon name="send-outline" style="font-size: 40px;" (click)="sendVoiceInput()"> </ion-icon>
-        </div>
+  <ion-buttons>
+    <ion-button (click)="sendMessage()" fill="clear">  <!-- 发送按钮 -->
+      <div class="circle">
+        <ion-icon name="paper-plane" style="color: white; font-size: 27px;"></ion-icon>
       </div>
-    </ion-content>
-  </ng-template>
-</ion-modal>
-        
-      </ion-buttons>
-<!--文本输入框-->
-      <ion-input placeholder="输入消息..." class="input-box" [(ngModel)]="userMessage">
-        <ion-button (click)="openEmojiPicker()" fill="clear" slot="end">
-          <ion-icon name="happy-outline" style="color:#99d75c; font-size: 30px;" ></ion-icon> <!--表情符号-->
-
-        </ion-button>
-      </ion-input>
-
-      <ion-buttons>
-        <ion-button (click)="sendMessage()" fill="clear">  <!--发送按钮-->
-          <div class="circle">
-          <ion-icon name="paper-plane" style="color: white; font-size: 27px;"></ion-icon>
-        </div>
-        </ion-button>
-      </ion-buttons>
-    </div>
-  </ion-toolbar>
-</ion-footer>
+    </ion-button>
+  </ion-buttons>
+</ion-footer>

+ 81 - 342
FitMind-app/src/app/ai-chat-component/ai-chat-component.component.scss

@@ -1,43 +1,43 @@
 ion-toolbar {
-    height: 70px; /* 设置你想要的高度 */
-    --min-height: 60px; /* 设置最小高度 */
-    padding: 0; /* 去掉内边距 */
-    display: flex; /* 使用Flexbox布局 */
-    align-items: center; /* 垂直居中对齐 */
-    --background: transparent; /* 去除背景色 */
-  }
-  //头部样式
-  ion-header{
-    background-color: #99d75c ;
-    --background: transparent; /* 去除背景色 */
-  }
-  //头部标题
-  ion-title {
-    margin: 0; /* 去掉默认的外边距 */
-    flex: 1; /* 让标题占据剩余空间 */
-    text-align: center; /* 让标题文本居中 */
-    font-size: 24px;
-  }
+  height: 70px; /* 设置你想要的高度 */
+  --min-height: 60px; /* 设置最小高度 */
+  padding: 0; /* 去掉内边距 */
+  display: flex; /* 使用Flexbox布局 */
+  align-items: center; /* 垂直居中对齐 */
+  --background: transparent; /* 去除背景色 */
+}
+//头部样式
+ion-header{
+  background-color: #99d75c ;
+  --background: transparent; /* 去除背景色 */
+}
+//头部标题
+ion-title {
+  margin: 0; /* 去掉默认的外边距 */
+  flex: 1; /* 让标题占据剩余空间 */
+  text-align: center; /* 让标题文本居中 */
+  font-size: 24px;
+}
 
 /* 文本输入框样式 */
 .input-box {
-  background-color: white; /* 设置输入框背景为白色 */
-  border-radius: 8px; /* 圆角 */
- 
-  height: 40px; /* 高度 */
-  flex: 1; /* 让输入框占据剩余空间 */
+background-color: white; /* 设置输入框背景为白色 */
+border-radius: 8px; /* 圆角 */
+
+height: 40px; /* 高度 */
+flex: 1; /* 让输入框占据剩余空间 */
 }
 
 /* 底部内容容器 */
 .footer-content {
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  width: 100%; /* 宽度100% */
+display: flex; /* 使用Flexbox布局 */
+align-items: center; /* 垂直居中对齐 */
+justify-content: center; /* 水平居中对齐 */
+width: 100%; /* 宽度100% */
 }
 //底部按钮样式
 ion-buttons {
-  margin: 0 5px; /* 按钮之间的间距 */
+margin: 0 5px; /* 按钮之间的间距 */
 }
 //底部发送按钮圆圈样式
 .circle{
@@ -52,358 +52,97 @@ justify-content: center; /* 水平居中对齐 */
 
 //聊天内容容器样式
 .chat-container {
-  display: flex;
-  flex-direction: column;
-  padding-top: 10px;
+display: flex;
+flex-direction: column;
+padding-top: 10px;
 }
 //聊天内容样式
 .message-container {
-  display: flex; /* 使用Flexbox布局 */
-  justify-content: flex-end; /* 用户消息在右边,AI消息在左边 */
-  margin: 10px 0; /* 消息之间的间距 */
+display: flex; /* 使用Flexbox布局 */
+justify-content: flex-end; /* 用户消息在右边,AI消息在左边 */
+margin: 10px 0; /* 消息之间的间距 */
 }
 //消息内容样式
 .message-content {
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
+display: flex; /* 使用Flexbox布局 */
+align-items: center; /* 垂直居中对齐 */
 }
 //用户消息和头像样式
 .user-message-content {
-  justify-content: flex-end; /* 用户消息和头像在右边 */
+justify-content: flex-end; /* 用户消息和头像在右边 */
 }
 //AI消息和头像样式
 .ai-message-content {
-  justify-content: flex-start; /* AI消息和头像在左边 */
+justify-content: flex-start; /* AI消息和头像在左边 */
 }
 //气泡样式
 .message-bubble {
-  background-color: #99d75c; /* 绿色气泡的背景色 */
-  color: white; /* 字体颜色 */
-  border-radius: 15px; /* 圆角 */
-  padding: 10px 15px; /* 内边距 */
-  max-width: 60%; /* 最大宽度 */
+background-color: #99d75c; /* 绿色气泡的背景色 */
+color: white; /* 字体颜色 */
+border-radius: 15px; /* 圆角 */
+padding: 10px 15px; /* 内边距 */
+max-width: 60%; /* 最大宽度 */
 }
 //用户消息样式
 .user-message {
-  background-color: #99d75c; /* 用户消息的颜色 */
-  margin-left: 10px; /* 与头像之间的间距 */
+background-color: #99d75c; /* 用户消息的颜色 */
+margin-left: 10px; /* 与头像之间的间距 */
 }
 //AI消息样式
 .ai-message {
-  background-color: white; /* AI消息的气泡颜色 */
-  color: black; /* 字体颜色 */
-  border: 1px solid black; /* 添加黑色边框 */
-  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
-  margin-right: 10px; /* 与头像之间的间距 */
+background-color: white; /* AI消息的气泡颜色 */
+color: black; /* 字体颜色 */
+border: 1px solid black; /* 添加黑色边框 */
+box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
+margin-right: 10px; /* 与头像之间的间距 */
 }
 //用户头像样式
 .user-avatar {
-  width: 40px; /* 头像宽度 */
-  height: 40px; /* 头像高度 */
-  border-radius: 50%; /* 圆形 */
-  overflow: hidden; /* 超出部分隐藏 */
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  background-color: #f0f0f0; /* 背景色 */
-  border: 2px solid #99d75c; /* 边框颜色 */
-  margin-left: 5px; /* 与消息之间的间距 */
+width: 40px; /* 头像宽度 */
+height: 40px; /* 头像高度 */
+border-radius: 50%; /* 圆形 */
+overflow: hidden; /* 超出部分隐藏 */
+display: flex; /* 使用Flexbox布局 */
+align-items: center; /* 垂直居中对齐 */
+justify-content: center; /* 水平居中对齐 */
+background-color: #f0f0f0; /* 背景色 */
+border: 2px solid #99d75c; /* 边框颜色 */
+margin-left: 5px; /* 与消息之间的间距 */
 }
 //AI头像样式
 .ai-avatar {
-  width: 40px; /* 头像宽度 */
-  height: 40px; /* 头像高度 */
-  border-radius: 50%; /* 圆形 */
-  overflow: hidden; /* 超出部分隐藏 */
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  background-color: #f0f0f0; /* 背景色 */
-  border: 2px solid #99d75c; /* 边框颜色 */
-  margin-right: 5px; /* 与消息之间的间距 */
+width: 40px; /* 头像宽度 */
+height: 40px; /* 头像高度 */
+border-radius: 50%; /* 圆形 */
+overflow: hidden; /* 超出部分隐藏 */
+display: flex; /* 使用Flexbox布局 */
+align-items: center; /* 垂直居中对齐 */
+justify-content: center; /* 水平居中对齐 */
+background-color: #f0f0f0; /* 背景色 */
+border: 2px solid #99d75c; /* 边框颜色 */
+margin-right: 5px; /* 与消息之间的间距 */
 }
 //用户头像图片样式
 .user-avatar img {
-  width: 100%; /* 使图片适应头像框 */
-  height: 100%; /* 使图片适应头像框 */
-  object-fit: cover; /* 保持图片比例,裁剪多余部分 */
+width: 100%; /* 使图片适应头像框 */
+height: 100%; /* 使图片适应头像框 */
+object-fit: cover; /* 保持图片比例,裁剪多余部分 */
 }
 //AI头像图片样式
 .ai-avatar img {
-  width: 100%; /* 使图片适应头像框 */
-  height: 100%; /* 使图片适应头像框 */
-  object-fit: cover; /* 保持图片比例,裁剪多余部分 */
-}
-//语音框
-.yuyinframe{
-  --background: transparent; 
-  background-color: #99d75c; 
-  display: flex; 
-  flex-direction: column; 
-  justify-content: center; 
-  align-items: center;
+width: 100%; /* 使图片适应头像框 */
+height: 100%; /* 使图片适应头像框 */
+object-fit: cover; /* 保持图片比例,裁剪多余部分 */
 }
-.modal-content {
-  display: flex;
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  width: 100%; /* 宽度100% */
-  height: 25%;
-}
-//语音框中间内容框
-.timer-container {
-  height: 100%;
-  flex-direction: column; /* 垂直排列 */
-  
-  justify-content: center; /* 水平居中对齐 */
 
-}
 //计时器样式
 #timer{
-  width: 100%;
-  margin-top: 30px; /* 可根据需要调整这个值 */
-  text-align: center; /* 确保文本居中 */
-  margin-bottom: 10px;
+width: 100%;
+margin-top: 30px; /* 可根据需要调整这个值 */
+text-align: center; /* 确保文本居中 */
+margin-bottom: 10px;
 }
 
-/*语音取消按钮的样式 */
-.cancle-button {
-  font-size: 75px;
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  color: white;
-  background-color: #99d75c; 
-  margin-right: 20px;
-}
-
-/*语音发送按钮的样式 */
-.send-button {
-  height:60px ;
-  width: 60px;
-  border-radius: 50%;//圆
-  display: flex; /* 使用Flexbox布局 */
-  align-items: center; /* 垂直居中对齐 */
-  justify-content: center; /* 水平居中对齐 */
-  color: white;
-  background-color: #99d75c; 
-  border: 5px solid white;
-  margin-left: 20px;
-}
 
 
-//音律跳动
-.light {
-  width: 100%;
-  height: 90px;
-  display: flex;
-}
-
-.light span {
-  width: 10px;
-  border-radius: 18px;
-  margin-right: 20px;
-}
-
-.light span:nth-child(1) {
-  animation: bar1 2s 0.2s infinite linear;
-}
 
-.light span:nth-child(2) {
-  animation: bar2 2s 0.4s infinite linear;
-}
-
-.light span:nth-child(3) {
-  animation: bar3 2s 0.6s infinite linear;
-}
-
-.light span:nth-child(4) {
-  animation: bar4 2s 0.8s infinite linear;
-}
-
-.light span:nth-child(5) {
-  animation: bar5 2s 1.0s infinite linear;
-}
-
-.light span:nth-child(6) {
-  animation: bar6 2s 1.2s infinite linear;
-}
-
-.light span:nth-child(7) {
-  animation: bar7 2s 1.4s infinite linear;
-}
-
-.light span:nth-child(8) {
-  animation: bar8 2s 1.6s infinite linear;
-}
-
-.light span:nth-child(9) {
-  animation: bar9 2s 1.8s infinite linear;
-}
-//第一条音律加载动画
-@keyframes bar1 {
-  0% {
-      background: #f677b0;
-      margin-top: 25%;
-      height: 10%;
-  }
-
-  50% {
-      background: #f677b0;
-      height: 100%;
-      margin-top: 0%;
-  }
-
-  100% {
-      background: #f677b0;
-      height: 10%;
-      margin-top: 25%;
-  }
-}
-//第二条音律加载动画
-@keyframes bar2 {
-  0% {
-      background: #df7ff2;
-      margin-top: 25%;
-      height: 10%;
-  }
-
-  50% {
-      background: #df7ff2;
-      height: 100%;
-      margin-top: 0%;
-  }
-
-  100% {
-      background: #df7ff2;
-      height: 10%;
-      margin-top: 25%;
-  }
-}
-//第三条音律加载动画
-@keyframes bar3 {
-  0% {
-      background: #8c7ff2;
-      margin-top: 25%;
-      height: 10%;
-  }
-
-  50% {
-      background: #8c7ff2;
-      height: 100%;
-      margin-top: 0%;
-  }
-
-  100% {
-      background: #8c7ff2;
-      height: 10%;
-      margin-top: 25%;
-  }
-}
-//第四条音律加载动画
-@keyframes bar4 {
-  0% {
-      background: #024b6a;
-      margin-top: 25%;
-      height: 10%;
-  }
-
-  50% {
-      background: #024b6a;
-      height: 100%;
-      margin-top: 0%;
-  }
-
-  100% {
-      background: #024b6a;
-      height: 10%;
-      margin-top: 25%;
-  }
-}
-//第五条音律加载动画
-@keyframes bar5 {
-  0% {
-      background: #7ff2d3;
-      margin-top: 25%;
-      height: 10%;
-  }
-
-  50% {
-      background: #7ff2d3;
-      height: 100%;
-      margin-top: 0%;
-  }
-
-  100% {
-      background: #7ff2d3;
-      height: 10%;
-      margin-top: 25%;
-  }
-}
-//三个点的加载动画
-.loading-dots {
-  display: flex;
-  align-items: center;
-  margin-left: 10px; /* 气泡与点之间的间距 */
-}
-
-.loading-dot {
-  width: 8px;
-  height: 8px;
-  border-radius: 50%;
-  background-color: #99d75c; /* 点的颜色 */
-  margin: 0 2px; /* 点之间的间距 */
-  animation: loading 1s infinite; /* 加载动画 */
-}
-//第一个点
-.loading-dot:nth-child(1) {
-  animation-delay: 0s;
-}
-//第二个点
-.loading-dot:nth-child(2) {
-  animation-delay: 0.2s;
-}
-//第三个点
-.loading-dot:nth-child(3) {
-  animation-delay: 0.4s;
-}
-//加载动画
-@keyframes loading {
-  0%, 100% {
-    opacity: 0.5;
-  }
-  50% {
-    opacity: 1;
-  }
-}
-
-
-
-
-/* 表情选择器样式 */
-.emoji-picker {
-  --background: transparent; //去除默认样式
-  background-color: #99d75c; /* 背景颜色 */
-  display: flex;
-  flex-wrap: wrap; /* 允许换行 */
-  padding: 10px;
-  justify-content: flex-start; /* 左对齐 */
-  overflow-y: scroll; /* 允许纵向滚动 */
-  height: 200px;
-}
-//表情按钮
-.emoji-button {
-  margin: 9px; /* 每个表情与顶部的间距 */
-  cursor: pointer; /* 鼠标悬停时显示为指针 */
-  font-size: 28px; /* 字体大小 */
-  height: 40px; /* 按钮高度 */
-  width: 40px; /* 按钮宽度 */
-  display: flex; /* 使用 flexbox 对齐 */
-  align-items: center; /* 垂直居中 */
-  justify-content: center; /* 水平居中 */
-  --background: transparent; /* 背景透明 */
-  --box-shadow: none; /* 去掉阴影 */
-  --outline: none; /* 去掉轮廓 */
-  border: none; /* 去掉边框 */
-  float: left;
-}

+ 0 - 8
FitMind-app/src/app/edit-rating-star/edit-rating-star.component.html

@@ -1,8 +0,0 @@
-<div class="star-rating">
-  <ng-container *ngFor="let star of starList; let i = index">
-    <ion-icon 
-      [name]="star ? 'star' : 'star-outline'" 
-      (click)="rate(i)">
-    </ion-icon>
-  </ng-container>
-</div>

+ 0 - 10
FitMind-app/src/app/edit-rating-star/edit-rating-star.component.scss

@@ -1,10 +0,0 @@
-.star-rating {
-    display: flex;
-    cursor: pointer;
-  
-    ion-icon {
-      font-size: 40px; // 调整星星大小
-      color: gold; // 星星颜色
-      margin-right: 5px; // 星星间距
-    }
-  }

+ 0 - 22
FitMind-app/src/app/edit-rating-star/edit-rating-star.component.spec.ts

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

+ 0 - 54
FitMind-app/src/app/edit-rating-star/edit-rating-star.component.ts

@@ -1,54 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { Component, OnInit } from '@angular/core';
-import { Input, Output, EventEmitter } from '@angular/core';
-import { IonIcon } from '@ionic/angular/standalone';
-import { addIcons } from 'ionicons';
-import { star,starOutline } from 'ionicons/icons';
-addIcons({star,starOutline})
-@Component({
-  selector: 'edit-rating-star',
-  templateUrl: './edit-rating-star.component.html',
-  styleUrls: ['./edit-rating-star.component.scss'],
-  standalone: true,
-  imports:[IonIcon,CommonModule]
-})
-export class EditRatingStarComponent  implements OnInit {
-  @Input() score: number = 0; // 默认分值为0
-  @Input() scoreMax: number = 5; // 最大分值
-  starList: boolean[] = []; // 星星状态数组
-
-  @Output() onScoreChange: EventEmitter<number> = new EventEmitter<number>();
-
-  constructor() {
-    this.updateStarList();
-  }
-  ngOnInit(): void {
-    this.updateStarList();
-  }
-
-  ngOnChanges() {
-    this.updateStarList();
-  }
-
-  // 更新星星数组
-  private updateStarList() {
-    this.starList = Array(this.scoreMax).fill(false);
-    for (let i = 0; i < this.score; i++) {
-      this.starList[i] = true;
-    }
-  }
-
-  // 打分方法
-  rate(index: number) {
-    if (this.score === index + 1) {
-      // 如果点击的是当前分值,清零
-      this.score = 0;
-    } else {
-      // 否则更新分值
-      this.score = index + 1;
-    }
-    this.updateStarList();
-    this.onScoreChange.emit(this.score); // 触发分值变化事件
-  }
-
-}

BIN
FitMind-app/src/app/images/1..jpg


BIN
FitMind-app/src/app/images/2.jpg


BIN
FitMind-app/src/app/images/touxiang.jpg


+ 0 - 39
FitMind-app/src/app/page-evaluate/page-evaluate.component.html

@@ -1,39 +0,0 @@
-<ion-header>
-  <ion-toolbar>
-    <ion-buttons slot="start">
-      <ion-button (click)="goBack()" fill="clear">
-        <ion-icon aria-hidden="true" name="chevron-back" style="color: black; font-size: 24px; argin:left"></ion-icon>
-      </ion-button>
-    </ion-buttons>
-    <ion-title>评价</ion-title>
-    <ion-buttons slot="end">
-      <ion-button (click)="submitEvaluation()" class="submit-button" color="light" id="present-alert">发表</ion-button>
-      <ion-alert
-  trigger="present-alert"
-  header="发表状态"
-  message="发表成功"
-  [buttons]="alertButtons"
-></ion-alert>
-    </ion-buttons>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content>
-  <div class="rating-container">
-    <span class="rating-label">评分:</span>
-    <edit-rating-star 
-      [score]="currentScore" 
-      [scoreMax]="5" 
-      (onScoreChange)="handleScoreChange($event)">
-    </edit-rating-star>
-    <span class="actual-score">{{ getScoreDescription(currentScore) }}</span>
-  </div>
-  <div class="textbox">
-  <ion-textarea  placeholder="你可以从AI的使用体验、速度、准确性、实用性、创新性以及全面性等方面进行评价,晒图分享你的使用体验~"[autoGrow]="true"></ion-textarea>
-</div>
-
-<div class="imgbox">
-</div>
-
-
-</ion-content>

+ 0 - 64
FitMind-app/src/app/page-evaluate/page-evaluate.component.scss

@@ -1,64 +0,0 @@
-.evaluation-content {
-    display: flex; /* 使用 flexbox 布局 */
-    flex-direction: column; /* 垂直方向排列 */
-    align-items: center; /* 水平方向居中 */
-    justify-content: center; /* 垂直方向居中 */
-    padding: 16px;
-    height: 100%; /* 填充整个内容区域 */
-  }
-  
-  ion-textarea {
-    width: 100%; /* 使文本区域宽度适应父容器 */
-    max-width: 500px; /* 设置最大宽度 */
-    min-height: 150px; /* 设置最小高度 */
-    margin-bottom: 16px; /* 文本区域和按钮之间的间距 */
-  }
-  
-  .submit-button {
-    background-color: orange; /* 橙色背景 */
-    color: white !important; /* 强制设置文字颜色为白色 */
-    border-radius: 20px; /* 椭圆形 */
-    padding: 6px 12px; /* 调整内边距以缩小按钮 */
-    font-size: 16px; /* 调整字体大小 */
-    height: auto; /* 自适应高度 */
-    min-width: 80px; /* 最小宽度 */
-  }
-  .rating-container {
-    display: flex; /* 使用 flexbox 布局 */
-    align-items: center; /* 垂直居中对齐 */
-   height:120px;
-    padding: 16px; /* 添加内边距 */
-    border-bottom: 1px solid grey; /* 只显示底部边框,设置为黑色 */
-    margin-bottom: 10px; /* 评分容器与文本之间的间距 */
-  }
-  
-  .rating-label {
-    display: flex; /* 使用 flexbox 布局 */
-    align-items: center; /* 垂直居中对齐 */
-    font-weight: bold; /* 加粗评分文本 */
-    font-size: 22px; /* 调整字体大小 */
-    margin-right: 5px; /* 评分文本与星星之间的间距 */
-  }
-  
-  .actual-score {
-    display: flex; /* 使用 flexbox 布局 */
-    align-items: center; /* 垂直居中对齐 */
-    margin-left: 50px; /* 分数与星星之间的间距 */
-    font-size: 15px; /* 调整字体大小 */
-    color: grey;
-  }
-
-  .textbox{
-    width: 100%; /* 使文本区域宽度适应父容器 */
-    height: 400px; /* 设置最大宽度 */
-    border-bottom: 1px solid grey; /* 只显示底部边框,设置为黑色 */
-  }
-
-  .imgbox{
-    width: 100%; /* 使文本区域宽度适应父容器 */
-    height: 200px; /* 设置最大宽度 */
-    background-image: url("../images/1..jpg");
-    background-size: contain; /* 图像填充方式 */
-  background-position: center; /* 图像居中 */
-  background-repeat: no-repeat; /* 不重复图像 */
-  }

+ 0 - 22
FitMind-app/src/app/page-evaluate/page-evaluate.component.spec.ts

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

+ 0 - 60
FitMind-app/src/app/page-evaluate/page-evaluate.component.ts

@@ -1,60 +0,0 @@
-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 = ['退出'];
-
-
-}

+ 0 - 30
FitMind-app/src/app/page-test/page-test.component.html

@@ -1,30 +0,0 @@
-<ion-content >
-<h1 align="center">这是测试页</h1>
-  <ion-button (click)="goToDetail()">点击按钮</ion-button>
-  <ion-button (mouseup)="goToDetail()">抬起按钮</ion-button>
-  <app-edit-tag  (onTagChange)="setTagsValue($event)"></app-edit-tag>
-
-  <h1>父级页面</h1>
-  <ul>
-   @for(tag of editTags;track tag){
-     <li>{{tag}}</li>
-   }
-  </ul>
-
-  <ion-button (click)="goTestPage()">进入测试页</ion-button>
-
-  <h1>星星打分组件演示,分值:{{currentScore}}</h1>
-  <edit-rating-star 
- [score]="currentScore" 
- [scoreMax]="5" 
- (onScoreChange)="handleScoreChange($event)">
-</edit-rating-star>
-
-<ion-list>
-  <ion-item>
-    <ion-textarea label="请输入:" placeholder="具体描述你的感受" [autoGrow]="true"></ion-textarea>
-  </ion-item>
-
-</ion-list>
-</ion-content>
-

+ 0 - 5
FitMind-app/src/app/page-test/page-test.component.scss

@@ -1,5 +0,0 @@
-button{
-    background-color: #007bff;
-    width: 50px;
-    height: 50px;
-}

+ 0 - 22
FitMind-app/src/app/page-test/page-test.component.spec.ts

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

+ 0 - 42
FitMind-app/src/app/page-test/page-test.component.ts

@@ -1,42 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { IonicModule } from '@ionic/angular'; // 导入 IonicModule
-import {aperture,glasses,person, logoOctocat } from 'ionicons/icons';
-import { EditTagComponent } from '../edit-tag/edit-tag.component';
-import { Router } from '@angular/router';
-import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
-
-@Component({
-  selector: 'app-page-test',
-  templateUrl: './page-test.component.html',
-  styleUrls: ['./page-test.component.scss'],
-  standalone: true,
-  imports: [IonicModule,EditTagComponent,EditRatingStarComponent]
-})
-export class PageTestComponent  implements OnInit {
-
-  goToDetail(){
-    alert('hello ionic')
-  }
-  editTags:Array<string> = [];
-  setTagsValue(ev:any){
-    console.log("setTagsValue",ev)
-    this.editTags = ev;
-  }
-
-  constructor(private router: Router){}
-  ngOnInit(): void {
-    console.log('PageTestComponent ngOnInit');
-  }
-  // 跳转到测试页面
-goTestPage(){
-  this.router.navigate(['/tabs/test']);}
-  
-//星星打分
-  currentScore: number = 0; // 初始分值
-
-  handleScoreChange(newScore: number) {
-    this.currentScore = newScore;
-    console.log('新分值:', newScore); // 处理分值变化
-  }
-
-}

+ 2 - 32
FitMind-app/src/app/tab2/tab2.page.html

@@ -27,13 +27,7 @@
       (click)="selectSegment('test')">
       测试
     </ion-button>
-    <ion-button 
-      fill="clear" 
-      class="nav-button" 
-      [ngClass]="{'activated': isActivated('evaluate')}" 
-      (click)="selectSegment('evaluate')">
-      评价AI
-    </ion-button>
+   
   </div>
 
   <div *ngIf="selectedSegment === 'ai-outfit'">
@@ -135,33 +129,9 @@
 
   </div>
 
-  <div *ngIf="selectedSegment === 'evaluate'">
-    <div class="rating-container">
-      <span class="rating-label">评分:</span>
-      <edit-rating-star 
-        [score]="currentScore" 
-        [scoreMax]="5" 
-        (onScoreChange)="handleScoreChange($event)">
-      </edit-rating-star>
-      <span class="actual-score">{{ getScoreDescription(currentScore) }}</span>
-    </div>
-    <div class="textbox">
-    <ion-textarea  placeholder="你可以从AI的使用体验、速度、准确性、实用性、创新性以及全面性等方面进行评价,晒图分享你的使用体验~"[autoGrow]="true"></ion-textarea>
-  </div>
 
- 
-  <div class="imgbox">
-    <img src="../../assets/images/1..jpg" alt="" srcset="">
-  </div>
-
-    <!-- 提交评价按钮 -->
-<ion-button fill="clear"
-class="analysis-button" 
-(click)="submitEvaluation()">
-  提交评价
-</ion-button>
 
 
 
-  </div>
+  
 </ion-content>

+ 3 - 38
FitMind-app/src/app/tab2/tab2.page.ts

@@ -8,8 +8,8 @@ import { ChatPanelOptions, FmChatModalInput, FmodeChat, FmodeChatCompletion, Fmo
 import { Router } from '@angular/router'; // 导入 Router
 import { DalleOptions, ImagineWork } from 'fmode-ng';
 import { PageAiChatComponent } from '../page-ai-chat/page-ai-chat.component';
-import { PageEvaluateComponent } from '../page-evaluate/page-evaluate.component';
-import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
+//import { PageEvaluateComponent } from '../page-evaluate/page-evaluate.component';
+
 import { CloudUser } from 'src/lib/ncloud';
 import { openUserLoginModal } from 'src/lib/user/modal-user-login/modal-user-login.component';
 
@@ -22,7 +22,7 @@ import { openUserLoginModal } from 'src/lib/user/modal-user-login/modal-user-log
   standalone: true,
   imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,IonItem,IonList,IonSelect,IonSelectOption,IonButton,CommonModule,IonTextarea,FormsModule,
     MarkdownPreviewModule,IonSegment,IonSegmentButton,IonLabel,// ASR语音输入模块
-    FmChatModalInput,PageAiChatComponent,PageEvaluateComponent,EditRatingStarComponent,IonAlert,IonButtons],
+    FmChatModalInput,PageAiChatComponent,IonAlert,IonButtons],
 })
 export class Tab2Page {
   placeholderText: string = "职业:非必填\n喜好:非必填\n运动目标:非必填\n运动类型:非必填\n其他需求:";
@@ -220,44 +220,9 @@ goBmipage() {
 }
 
 
-//AI评价
-async submitEvaluation() {
-  // 处理评价提交逻辑
-  console.log('发表评价');
-  // 这里可以添加您希望执行的代码,例如将评价发送到服务器
-  // 弹出提示框
-  const alert = await this.alertController.create({
-    header: '提交成功,感谢你的评价!',
-    buttons: ['确定'] // 按钮
-  });
 
-  await alert.present(); // 显示弹出框
-}
 
-//星星打分
-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 = ['退出'];
 
 

+ 3 - 10
FitMind-app/src/app/tabs/tabs.routes.ts

@@ -26,16 +26,9 @@ export const routes: Routes = [
         redirectTo: '/tabs/tab1',
         pathMatch: 'full',
       },
-      {
-        path: 'test',
-        loadComponent: () =>
-          import('../page-test/page-test.component').then((m) => m.PageTestComponent),
-      },
-      {
-        path: 'evaluate',
-        loadComponent: () =>
-          import('../page-evaluate/page-evaluate.component').then((m) => m.PageEvaluateComponent),
-      },
+     
+    
+     
       {
         path: 'AIChat',
         loadComponent: () =>

+ 20 - 0
FitMind-app/src/deploy.ps1

@@ -0,0 +1,20 @@
+# 打包项目,携带应用前缀(index.html中相对路径将自动修复为/dev/jxnu/<学号>前缀)
+# /dev/ 项目测试版上传路径
+# /dev/jxnu/<学号> nova-crm项目预留路径
+set NODE_OPTIONS=-max_old_space_size=16000
+node ./node_modules/@angular/cli/bin/ng build --base-href="/dev/jxnu/202226701011/"
+
+# 清空旧文件目录
+obsutil rm obs://nova-cloud/dev/jxnu/202226701011 -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com"
+
+# 同步文件目录
+obsutil sync ./www obs://nova-cloud/dev/jxnu/202226701011  -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read
+
+
+# 授权公开可读
+obsutil chattri obs://nova-cloud/dev/jxnu/202226701011 -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read
+
+# 列举对象
+obsutil ls obs://nova-cloud/dev/jxnu/202226701011  -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com"
+
+