Browse Source

Merge branch 'master' of codehub-cn-south-1.devcloud.huaweicloud.com:web3000003/web-0210402

flowaaa 1 year ago
parent
commit
9760ab457d

+ 2 - 2
app-angular/src/modules/lesson/attention-detail/rattention-detail.component.ts

@@ -35,8 +35,8 @@ export class AttentionDetailComponent {
     })
   }
   async getRoleInfoById(id: string) {
-    let query = new Parse.Query("SqzRoleInfo")
-    this.attention = await query.get(id)
+    let query = new Parse.Query("PetAttention")
+    this.role = await query.get(id)
   }
 
 }

+ 23 - 2
app-angular/src/modules/lesson/community/community.component.html

@@ -34,8 +34,8 @@
             <ion-row>
                 <ng-container *ngFor="let attention of recommendList">
                     <ion-col size="6">
-                        <ion-card class="roleCard" (click)="goAttentionDetail(attention)">
-                            <img alt="推荐图" [src]="attention?.get('img')" />
+                        <ion-card class="roleCard" (click)="goRecommendDetail(role)">
+                            <img alt="推荐图" [src]="role?.get('img')" />
                             <ion-card-header>
                                 <ion-card-title>
                                     {{attention?.get('name')}}
@@ -89,6 +89,7 @@
 
     <!-- 科普 -->
     <ng-container *ngIf="cate=='科普'">
+<<<<<<< HEAD
         <ng-container *ngFor="let sciene of scienceList">
             <ion-card (click)="goScienceDetail(sciene)">
                 <img alt="科普图" [src]="sciene?.get('img')" />
@@ -103,11 +104,31 @@
                         <ion-button fill="clear" color="dark" size="small" class="like">
                             <ion-icon name="heart-outline" size="small"></ion-icon>
                             <ion-note>{{sciene?.get('like')}}</ion-note>
+=======
+        <ng-container *ngFor="let science of scienceList">
+            <ion-card (click)="goScienceDetail(science)">
+                <img alt="科普图" [src]="science?.get('img')" />
+                <ion-card-header>
+                    <ion-card-title>{{science?.get('name')}}</ion-card-title>
+                    <ion-card-subtitle>{{science?.get('createdAt')| date: 'YYYY/MM/dd'||"发布时间"}}</ion-card-subtitle>
+                    <div class="metadata-end-wrapper">
+                        <ion-button fill="clear" color="dark" size="small" class="see">
+                            <ion-icon name="eye-outline" size="small"></ion-icon>
+                            <ion-note>{{science?.get('see')}}</ion-note>
+                        </ion-button>
+                        <ion-button fill="clear" color="dark" size="small" class="like">
+                            <ion-icon name="heart-outline" size="small"></ion-icon>
+                            <ion-note>{{science?.get('like')}}</ion-note>
+>>>>>>> 8055be6d18ac165452aa094fb923b58460946ed3
                         </ion-button>
                     </div>
                 </ion-card-header>
                 <ion-card-content>
+<<<<<<< HEAD
                     <p class="foodContent">{{sciene?.get('content')}}</p>
+=======
+                    <p class="foodContent">{{science?.get('content')}}</p>
+>>>>>>> 8055be6d18ac165452aa094fb923b58460946ed3
                 </ion-card-content>
             </ion-card>
         </ng-container>

+ 2 - 2
app-angular/src/modules/lesson/community/community.component.ts

@@ -52,9 +52,9 @@ export class CommunityComponent {
 
 
   // 跳转函数
-  goScienceDetail(sciene: Parse.Object) {
+  goScienceDetail(science: Parse.Object) {
     this.router.navigate(["/lesson/community/scienceDetail"], {
-      queryParams: sciene
+      queryParams: science
     })
   }
 

+ 24 - 1
app-angular/src/modules/lesson/me/me.component.html

@@ -100,7 +100,7 @@
                     <ion-label>关注</ion-label>
                 </ion-segment-button>
                 <ion-segment-button value="科普" (click)="cate='科普'">
-                    <ion-icon name="fast-sciene-outline"></ion-icon>
+                    <ion-icon name="fast-science-outline"></ion-icon>
                     <ion-label>笔记</ion-label>
                 </ion-segment-button>
             </ion-segment>
@@ -152,6 +152,7 @@
 
     <!-- 科普笔记 -->
     <ng-container *ngIf="cate=='科普'">
+<<<<<<< HEAD
         <ng-container *ngFor="let sciene of myFoodList">
             <ion-card>
                 <img alt="科普图" [src]="sciene?.get('img')" />
@@ -168,12 +169,34 @@
                             <ion-button>
                                 <ion-icon name="heart-outline" size="small"></ion-icon>
                                 <ion-note>{{sciene?.get('like')}}</ion-note>
+=======
+        <ng-container *ngFor="let science of myFoodList">
+            <ion-card>
+                <img alt="科普图" [src]="science?.get('img')" />
+                <ion-card-header>
+                    <ion-card-title>{{science?.get('name')}}</ion-card-title>
+                    <ion-card-subtitle>{{science?.get('createdAt')| date:
+                        'YYYY/MM/dd/HH:mm'||"发布时间"}}</ion-card-subtitle>
+                    <div class="metadata-end-wrapper-science">
+                        <ion-buttons slot="end">
+                            <ion-button>
+                                <ion-icon name="eye-outline" size="small"></ion-icon>
+                                <ion-note>{{science?.get('see')}}</ion-note>
+                            </ion-button>
+                            <ion-button>
+                                <ion-icon name="heart-outline" size="small"></ion-icon>
+                                <ion-note>{{science?.get('like')}}</ion-note>
+>>>>>>> 8055be6d18ac165452aa094fb923b58460946ed3
                             </ion-button>
                         </ion-buttons>
                     </div>
                 </ion-card-header>
                 <ion-card-content>
+<<<<<<< HEAD
                     <p class="foodContent">{{sciene?.get('content')}}</p>
+=======
+                    <p class="foodContent">{{science?.get('content')}}</p>
+>>>>>>> 8055be6d18ac165452aa094fb923b58460946ed3
                 </ion-card-content>
             </ion-card>
         </ng-container>

+ 1 - 1
app-angular/src/modules/lesson/me/me.component.scss

@@ -43,7 +43,7 @@ ion-item {
     align-items: center;
 }
 
-.metadata-end-wrapper-sciene {
+.metadata-end-wrapper-science {
     position: absolute;
 
     top: 0px;

+ 6 - 6
app-angular/src/modules/lesson/science-detail/science-detail.component.html

@@ -13,15 +13,15 @@
 </ion-header>
 <ion-content color="light">
     <ion-card>
-        <img alt="科普图" [src]="sciene?.get('img')" />
+        <img alt="科普图" [src]="science?.get('img')" />
         <ion-card-header>
-            <ion-card-title>{{sciene?.get('name')}}</ion-card-title>
-            <ion-card-subtitle>作者:{{sciene?.get('user')?.get('name')||"无名"}}</ion-card-subtitle>
-            <ion-card-subtitle>{{sciene?.get('type')||"科普类别"}}</ion-card-subtitle>
-            <ion-card-subtitle>{{sciene?.get('createdAt')| date: 'YYYY/MM/dd/HH:mm'||"发布时间"}}</ion-card-subtitle>
+            <ion-card-title>{{science?.get('name')}}</ion-card-title>
+            <ion-card-subtitle>作者:{{science?.get('user')?.get('name')||"无名"}}</ion-card-subtitle>
+            <ion-card-subtitle>{{science?.get('type')||"科普类别"}}</ion-card-subtitle>
+            <ion-card-subtitle>{{science?.get('createdAt')| date: 'YYYY/MM/dd/HH:mm'||"发布时间"}}</ion-card-subtitle>
         </ion-card-header>
         <ion-card-content>
-            {{sciene?.get('content')}}
+            {{science?.get('content')}}
         </ion-card-content>
     </ion-card>
     <!-- 评论区 -->

+ 3 - 3
app-angular/src/modules/lesson/science-detail/science-detail.component.ts

@@ -29,17 +29,17 @@ export class ScienceDetailComponent {
   }
 
   //预设值变量
-  sciene: Parse.Object | undefined;
+  science: Parse.Object | undefined;
   // 依赖注入
   constructor(private route: ActivatedRoute) {
-    // 查询参数获取并赋值给this.sciene
+    // 查询参数获取并赋值给this.science
     this.route.queryParams.subscribe(params => {
       this.getFoodInfoById(params["id"])
     })
   }
   async getFoodInfoById(id: string) {
     let query = new Parse.Query("PetScience")
-    this.sciene = await query.get(id)
+    this.science = await query.get(id)
   }