Ver Fonte

fix:修复页面定长

xukang há 4 meses atrás
pai
commit
104224fd4b

+ 29 - 3
TFPower-app/src/app/tab2/tab2.page.html

@@ -94,7 +94,33 @@
     </ng-template>
 
 
-
+    <ion-card>
+      <!-- 未登录 -->
+      @if(!currentUser?.id){
+      <ion-card-header>
+        <ion-card-title>请登录</ion-card-title>
+        <ion-card-subtitle>暂无信息</ion-card-subtitle>
+      </ion-card-header>
+      }
+      <!-- 未登录 -->
+      @if(currentUser?.id){
+      <ion-card-header>
+        <ion-card-title>{{currentUser?.get("username")}} {{currentUser?.get("realname")}}</ion-card-title>
+        <ion-card-subtitle>性别:{{currentUser?.get("gender")||"-"}} 年龄:{{currentUser?.get("age")||"-"}}
+        </ion-card-subtitle>
+      </ion-card-header>
+      }
+      <ion-card-content>
+        @if(!currentUser?.id){
+        <ion-button expand="block" (click)="signup()">注册</ion-button>
+        <ion-button expand="block" (click)="login()">登录</ion-button>
+        }
+        @if(currentUser?.id){
+        <ion-button expand="block" (click)="editUser()">编辑资料</ion-button>
+        <ion-button expand="block" (click)="logout()" color="light">登出</ion-button>
+        }
+      </ion-card-content>
+    </ion-card>
 
   </div>
 
@@ -160,7 +186,7 @@
   <div *ngIf="selectedTab === 'consultation'" class="consult">
     <ion-card-content>
       <div
-        style="width: 95%; margin: auto; height: 110px; display: flex; justify-content: space-between; background-color: #ffffff; border: 1px solid #e7e7db; border-radius: 20px; overflow: hidden;"
+        style="width: 95%; margin: auto; height: 100px; display: flex; justify-content: space-between; background-color: #ffffff; border: 1px solid #e7e7db; border-radius: 20px; overflow: hidden;"
         (click)="doPoemTask()">
         <!-- 左侧内容部分 -->
         <div
@@ -248,7 +274,7 @@
         </ion-card-content>
       </ion-card>
       <div
-        style="width: 95%; margin: auto; height: 110px; display: flex; justify-content: space-between; background-color: #ffffff; border: 1px solid #e7e7db; border-radius: 20px; overflow: hidden;"
+        style="width: 95%; margin: auto; height: 100px; display: flex; justify-content: space-between; background-color: #ffffff; border: 1px solid #e7e7db; border-radius: 20px; overflow: hidden;"
         (click)="doInqueryTask()">
 
         <!-- 左侧内容部分 -->

+ 20 - 35
TFPower-app/src/app/tab2/tab2.page.scss

@@ -78,11 +78,9 @@ ion-content {
 /* 表格行的底部间距 */
 .plan-table ion-col {
   margin-bottom: 1px;
- 
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
 /* 表格的列 */
@@ -90,9 +88,9 @@ ion-content {
   background-color: #ffffff;
   padding: 12px;
   text-align: center;
-   display: flex;
-    justify-content: center;
-    align-items: center;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
 /* 表格的标题 */
@@ -146,44 +144,17 @@ ion-content {
   }
 }
 /* 问诊部分的设计 */
-/* 确保图片等大 */
-.consult .ion-text-center ion-img {
-  width: 100%; 
-  height: 200px; 
-  object-fit: cover; 
-}
-.consult ion-item {
-  margin-bottom: 12px; 
-  padding: 12px; 
-  padding-right: 4px;
-  border-radius: 8px; 
-  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
-  background-color: #ffffff; 
-}
-.consult .thumbnail {
-  width: 160px; 
-  height: 160px; 
-  margin-bottom: 10px;  
-}
-.consult ion-thumbnail {
-  width: 60px;
-  height: 60px; 
-}
 .consult .lan {
   --background: #009b7d;
   --background-hover: #9ce0be;
   --background-activated: #88f4be;
   --background-focused: #88f4be;
-
   --color: #ffffff;
-
   --border-radius: 10px;
   --border-color: #28a169;
   --border-style: solid;
   --border-width: 1px;
-
   --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);
-
   --ripple-color: deeppink;
   --padding-left: 10px;
   --padding-right: 10px;
@@ -191,6 +162,20 @@ ion-content {
   --padding-bottom: 3px;
 }
 
+.consult ion-item {
+  margin-bottom: 12px; 
+  padding: 12px; 
+  padding-right: 4px;
+  border-radius: 8px; 
+  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
+  background-color: #ffffff; 
+}
+
+.consult ion-thumbnail {
+  width: 17%;
+  height:  17%; 
+}
+
 .consult .coach-info {
   margin-left: 12px;
   display: flex;

+ 8 - 6
TFPower-app/src/app/tab2/tab2.page.ts

@@ -356,9 +356,10 @@ export class Tab2Page implements OnInit {
     if (user?.id) {
       this.currentUser = user
     }
-    this.loadPlanList()
-    this.loadCoachList()
-    this.loadPlanUser()
+    window.location.reload();  // 登录后刷新页面
+    // this.loadPlanList()
+    // this.loadCoachList()
+    // this.loadPlanUser()
   }
   async signup() {
     // 弹出注册窗口
@@ -370,9 +371,10 @@ export class Tab2Page implements OnInit {
   }
   async logout() {
     await this.currentUser?.logout();
-    this.loadPlanList()
-    this.loadCoachList()
-    this.loadPlanUser()
+    window.location.reload();  // 登录后刷新页面
+    // this.loadPlanList()
+    // this.loadCoachList()
+    // this.loadPlanUser()
   }
 
   editUser() {

+ 1 - 1
TFPower-app/src/app/tianqi/tianqi.component.html

@@ -1,4 +1,4 @@
-<div class="box1" style="position: relative;width: 90%;margin: auto;">
+<div class="box1" style="position: relative;width: 95%;margin: auto;">
   <div class="box2">
     <div>
       <span id="crtp" class="span1" style="display: block;">{{weather?.data?.forecast[0].type}}</span>

+ 1 - 1
TFPower-app/src/app/tianqi/tianqi.component.scss

@@ -20,7 +20,7 @@ img {
     box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
     display: flex;
     position: relative;
-    width: 90%;
+    width: 95%;
     margin-right: 1.5rem;
     background-color: white;
     border-radius: 15px;