flowaaa 1 năm trước cách đây
mục cha
commit
d11e1b6f8a

+ 2 - 2
app-angular/src/modules/lesson/lesson-routing.module.ts

@@ -19,13 +19,13 @@ import { PageLessonDetailComponent } from './page-lesson-detail/page-lesson-deta
 
 
 const routes: Routes = [
-  { path: 'me', component: MeComponent , canActivate: [authGuard]},
+  { path: 'me', component: MeComponent },
   { path: 'they', component: TheyComponent },
   { path: 'community', component: CommunityComponent },
   { path: 'near', component: NearComponent },
   { path: 'lesson', component: PageLessonComponent },
   { path: 'lesson/detail', component: PageLessonDetailComponent },
-  { path: 'page-chat', component: PageChatComponent, canActivate: [authGuard] },
+  { path: 'page-chat', component: PageChatComponent },
   { path: 'they/detail', component: TheyDetailComponent },
   { path: 'community/scienceDetail', component: ScienceDetailComponent },
   { path: 'community/share', component: ShareComponent },

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

@@ -63,10 +63,7 @@
             </ion-item>
         </ion-list>
     </ion-card>
-    <ion-list [inset]="true">
-        <ion-button *ngIf="!currentUser?.id" expand="block" routerLink="/user/login">登录</ion-button>
-        <ion-button *ngIf="currentUser?.id" fill="clear" expand="block" (click)="logout()">登出</ion-button>
-    </ion-list>
+
     <!-- 列表 -->
     <ion-card class="myList">
         <ion-list [inset]="true">
@@ -115,7 +112,7 @@
 
     <ng-container *ngIf="cate=='推荐'">
         <ion-list [inset]="true" lines="inset">
-            <ng-container *ngFor="let recommend of myViewList">
+            <ng-container *ngFor="let recommend of myRecommendList">
                 <ion-item>
                     <ion-thumbnail slot="end">
                         <img alt="推荐图" [src]="recommend?.get('img')" />
@@ -134,7 +131,7 @@
     <ng-container *ngIf="cate=='关注'">
         <ion-grid>
             <ion-row>
-                <ng-container *ngFor="let attention of myRoleList">
+                <ng-container *ngFor="let attention of myAttentionList">
                     <ion-col size="6">
                         <ion-card class="roleCard">
                             <img alt="关注图" [src]="attention?.get('img')" />
@@ -155,7 +152,7 @@
 
     <!-- 科普笔记 -->
     <ng-container *ngIf="cate=='科普'">
-        <ng-container *ngFor="let science of myFoodList">
+        <ng-container *ngFor="let science of myScienceList">
             <ion-card>
                 <img alt="科普图" [src]="science?.get('img')" />
                 <ion-card-header>
@@ -182,6 +179,9 @@
         </ng-container>
     </ng-container>
 
-
+    <ion-list [inset]="true">
+        <ion-button *ngIf="!currentUser?.id" expand="block" routerLink="/user/login">登录</ion-button>
+        <ion-button *ngIf="currentUser?.id" fill="clear" expand="block" (click)="logout()">登出</ion-button>
+    </ion-list>
 
 </ion-content>

+ 7 - 10
app-angular/src/modules/lesson/me/me.component.ts

@@ -22,14 +22,14 @@ export class MeComponent {
   }
 
   async ngOnInit() {
-    this.myRoleList = await this.gteAttentionData()
-    this.myFoodList = await this.getScienceData()
-    this.myViewList = await this.getViewDate()
+    this.myAttentionList = await this.gteAttentionData()
+    this.myScienceList = await this.getScienceData()
+    this.myRecommendList = await this.getRecommendDate()
   }
 
   cate: string = "关注"
-  myViewList: Array<Parse.Object> = []
-  async getViewDate() {
+  myRecommendList: Array<Parse.Object> = []
+  async getRecommendDate() {
     let query = new Parse.Query("PetRecommend");
     query.equalTo("user", Parse.User.current()?.toPointer())
     query.include("user")
@@ -37,7 +37,7 @@ export class MeComponent {
     return list
   }
   
-  myRoleList: Array<Parse.Object> = []
+  myAttentionList: Array<Parse.Object> = []
   async gteAttentionData() {
     let query = new Parse.Query("PetAttention");
     query.equalTo("user", Parse.User.current()?.toPointer())
@@ -45,7 +45,7 @@ export class MeComponent {
     let list = await query.find();
     return list
   }
-  myFoodList: Array<Parse.Object> = []
+  myScienceList: Array<Parse.Object> = []
   async getScienceData() {
     let query = new Parse.Query("PetScience");
     query.equalTo("user", Parse.User.current()?.toPointer())
@@ -53,9 +53,6 @@ export class MeComponent {
     let list = await query.find();
     return list
   }
-
-
-
   async logout() {
     await Parse.User.logOut()
     this.currentUser = undefined

+ 1 - 1
app-angular/src/modules/lesson/page-lesson-detail/page-lesson-detail.component.html

@@ -2,7 +2,7 @@
     <ion-header>
         <ion-toolbar>
             <ion-buttons slot="start">
-                <ion-button routerLink="/cook/lesson">&lt;返回</ion-button>
+                <ion-button routerLink="/lesson/lesson">&lt;返回</ion-button>
             </ion-buttons>
             <ion-title>课程</ion-title>
         </ion-toolbar>

+ 0 - 5
app-angular/src/modules/lesson/page-lesson/page-lesson.component.ts

@@ -1,10 +1,5 @@
 import { Component } from '@angular/core';
 import { Router } from '@angular/router';
-// import { DetailComponent } from '../detail/detail.component';
-import { MenuController } from '@ionic/angular';
-
-// 引入服务
-import { ActivatedRoute } from '@angular/router';
 
 // 引入Parse第三方库
 import * as Parse from "parse"