flowaaa 1 yıl önce
ebeveyn
işleme
8bba03f3ab

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

@@ -69,7 +69,11 @@ export class CommunityComponent {
       queryParams: attention
     })
   }
-
-
+  goHateDetail(attention: Parse.Object) {
+    this.router.navigate(["/lesson/community/hateDetail"], {
+      queryParams: attention
+    })
+  }
+// 888
 
 }

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

@@ -84,7 +84,10 @@
             </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>
 
     <!-- 详细内容 -->
     <!-- 导航 -->
@@ -179,9 +182,4 @@
         </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>

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

@@ -10,7 +10,8 @@
     <ion-content>
 
 
-        <ion-img [src]="course?.get('courseImg')" alt="图片加载不出来"></ion-img>
+        <ion-img [src]="course?.get('foodImg')" alt="图片加载不出来"></ion-img>
+        <ion-title >课程</ion-title>
 
         <ion-item>
             <ion-avatar slot="start">
@@ -19,26 +20,12 @@
             </ion-avatar>
             <ion-label>{{course?.get('courseAuthor')?.get('name')}}</ion-label>
             <ion-button fill="outline" color="danger">关注</ion-button>
-            <!-- <div>{{course?.get('courseStore') | tok}}人收藏</div> -->
         </ion-item>
 
         <ion-card>
-            <ion-card-header>
-                <ion-card-title>{{course?.get('courseName')}}</ion-card-title>
-                <ion-card-subtitle class="custom-subtitle">{{course?.get('courseScore')}}<span
-                        style="color: rgb(196, 194, 194); font-size: 10px;">
-                        评分</span></ion-card-subtitle>
-            </ion-card-header>
-
-            <ion-card-content>
-                {{course?.get('courseDescript')}}
-            </ion-card-content>
-
             <ion-button fill="clear">收藏</ion-button>
-            <ion-button fill="clear">购买</ion-button>
         </ion-card>
 
-        <!-- <ion-list *ngIf="lesson.videocourse?.length"> -->
         <ion-list>
             <ion-list-header>
                 <ion-label>视频</ion-label>
@@ -55,7 +42,6 @@
                         d="M529.0752 534.1184l-128.2816 74.624a25.6 25.6 0 0 1-38.4768-22.1184v-149.248a25.6 25.6 0 0 1 38.4768-22.1184l128.256 74.624a25.6 25.6 0 0 1 0 44.2368z"
                         fill="#FB553C" p-id="3936"></path>
                 </svg>
-                <!-- <ion-label>{{video}}</ion-label> -->
             </ion-item>
         </ion-list>
 

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

@@ -18,13 +18,12 @@ export class PageLessonDetailComponent {
   }
   lessonPointer: any;//获取当前指针
   async getCourseById(id: string) {
-    let query = new Parse.Query("PetCourse")
+    let query = new Parse.Query("PetFood")
     query.include('courseAuthor')//查询指针
     this.course = await query.get(id);
-    // this.name = this.course?.get('courseAuthor')?.get('name')
     this.lessonPointer = {
       __type: 'Pointer',
-      className: 'PetCourse',
+      className: 'PetFood',
       objectId: this.course.id
     };
   }

+ 6 - 16
app-angular/src/modules/lesson/page-lesson/page-lesson.component.html

@@ -16,7 +16,7 @@
                 <ion-menu-button></ion-menu-button>
             </ion-buttons>
             <ion-searchbar [(ngModel)]="searchInput" (ionChange)="search()" (ionClear)="search()"
-                placeholder="今天想学什么呢?"></ion-searchbar>
+                placeholder="小猫咪不能吃胡萝卜?"></ion-searchbar>
         </ion-toolbar>
     </ion-header>
     <!--课程卡片区-->
@@ -27,35 +27,25 @@
                     <ng-container *ngIf="i % 2 === 0">
                         <ion-col size="5.5">
                             <ion-card (click)="goLessonDetail(course)">
-                                <img alt="Silhouette of mountains" [src]="course?.get('courseImg')" />
+                                <img alt="Silhouette of mountains" [src]="course?.get('foodImg')" />
                                 <ion-card-header>
-                                    <ion-card-title>{{course?.get("courseName")}}</ion-card-title>
-                                    <ion-card-subtitle>评分:{{course?.get("courseScore")}}</ion-card-subtitle>
+                                    <ion-card-title>{{course?.get("foodName")}}</ion-card-title>
                                 </ion-card-header>
 
                             </ion-card>
                         </ion-col>
                         <ion-col size="5.5" *ngIf="i + 1 < courseList.length">
                             <ion-card (click)="goLessonDetail(courseList[i+1])">
-                                <img alt="Silhouette of mountains" [src]="courseList[i + 1].get('courseImg')" />
+                                <img alt="Silhouette of mountains" [src]="courseList[i + 1].get('foodImg')" />
                                 <ion-card-header>
-                                    <ion-card-title>{{courseList[i +
-                                        1].get("courseName")}}</ion-card-title>
-                                    <ion-card-subtitle>评分:{{courseList[i+1].get("courseScore")}}</ion-card-subtitle>
+                                    <ion-card-title>{{courseList[i +1].get("foodName")}}</ion-card-title>
                                 </ion-card-header>
-
                             </ion-card>
-
                         </ion-col>
                     </ng-container>
                 </ng-container>
             </ion-row>
         </ion-grid>
     </ion-content>
-    <!-- 触底控制区域 -->
-    <ion-infinite-scroll #infiScroll (ionInfinite)="onBottomLoad($event,infiScroll)">
-        <ion-infinite-scroll-content loadingText="Please wait..."
-            loadingSpinner="bubbles"></ion-infinite-scroll-content>
-    </ion-infinite-scroll>
-    <!-- <div class="navfooter"> </div> -->
+
 </div>

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

@@ -21,7 +21,7 @@ export class PageLessonComponent {
   }
   // 数据加载相关函数
   async getMenuData() {
-    let query = new Parse.Query("PetCourse");
+    let query = new Parse.Query("PetFood");
     query.limit(this.pageSize);
     query.include('courseAuthor')
     if (this.searchInput) {
@@ -37,7 +37,7 @@ export class PageLessonComponent {
   }
   // 搜索功能相关函数与属性
   searchInput: string = ``
-  searchType: string = `courseName`
+  searchType: string = `foodName`
   async search() {
     this.skip = 0; // 每次搜索条件变化,从第一条重新加载
     this.courseList = await this.getMenuData();

+ 0 - 9
app-angular/src/modules/lesson/they-detail/they-detail.component.ts

@@ -26,13 +26,4 @@ export class TheyDetailComponent {
     let query = new Parse.Query("SqzPerson")
     this.they = await query.get(id)
   }
-
-
-  // getDateString(datestr: string) {
-  //   if (datestr) {
-  //     let now = new Date(datestr)
-  //     return `${now.getFullYear()}年${now.getMonth() + 1}月${now.getDate()}日`
-  //   }
-  //   return ""
-  // }
 }

+ 0 - 7
app-angular/src/modules/lesson/they/they.component.html

@@ -54,11 +54,4 @@
             </ion-item-sliding>
         </ng-container>
     </ion-list>
-
-
-    <!-- 触底控制区域
-    <ion-infinite-scroll #infiScroll (ionInfinite)="onBottomLoad($event,infiScroll)">
-        <ion-infinite-scroll-content loadingText="Please wait..."
-            loadingSpinner="bubbles"></ion-infinite-scroll-content>
-    </ion-infinite-scroll> -->
 </ion-content>

+ 0 - 12
app-angular/src/modules/lesson/they/they.component.ts

@@ -26,17 +26,6 @@ export class TheyComponent {
     this.theyList = await this.getTheyData()
   }
 
-  // // 触底加载函数逻辑
-  // pageSize = 20
-  // skip: number = 0 // 跳过多少条进行加载
-  // async onBottomLoad(event: any, infiScroll: any) {
-  //   console.log("onBottomLoad", this.theyList.length)
-  //   this.skip = this.theyList.length;
-  //   let list = await this.getTheyData();
-  //   this.theyList = this.theyList.concat(list)
-  //   infiScroll?.complete();
-  // }
-
   // 数据加载相关函数
   async getTheyData() {
     let query = new Parse.Query("SqzPerson");
@@ -44,7 +33,6 @@ export class TheyComponent {
     let list = await query.find();
     return list
   }
-
   // 跳转函数
   goTheyDetail(they: Parse.Object) {
     this.router.navigate(["/lesson/they/detail"], {

+ 2 - 2
app-angular/src/modules/user/guard-auth/auth.guard.ts

@@ -10,8 +10,8 @@ export const authGuard: CanActivateFn = (route, state) => {
     // 暂时存储登陆前用户所在页面
     let REDIRECT_URL = location.pathname;
     localStorage.setItem("REDIRECT_URL", REDIRECT_URL);
-    if (location.pathname?.startsWith("/s0210463")) {
-      location.href = "/s0210463/user/login"
+    if (location.pathname?.startsWith("/s0210402")) {
+      location.href = "/s0210402/user/login"
     } else {
       location.href = "/user/login"
     }

+ 0 - 2
app-angular/src/modules/user/page-login/page-login.component.html

@@ -1,4 +1,3 @@
-<!-- IonicModule + FormsModule实现,默认好看 -->
 <ion-header>
     <ion-toolbar>
         <ion-buttons slot="start">
@@ -40,7 +39,6 @@
 </ion-content>
 
 
-<!-- 纯HTML + FormsModule实现,可任意定制样式 -->
 <ng-container *ngIf="false">
 
     请输入用户名:{{userData.username}} <br />

+ 3 - 1
app-angular/src/modules/user/page-login/page-login.component.ts

@@ -22,13 +22,14 @@ export class PageLoginComponent {
 
   goBack() {
     let path = localStorage.getItem("REDIRECT_URL") || "/lesson/me"
+    if (path=="/cook/mine") path ="/lesson/me"
     this.router.navigate([path])
   }
 
   goRegister() {
     let path = "/user/register"
     this.router.navigate([path])
-
+    console.log('账户已保存,去登录吧')
   }
 
   async login() {
@@ -41,6 +42,7 @@ export class PageLoginComponent {
     } catch (err) {
       let msg: any = err
       this.alertError(msg)
+      console.log('账户已保存')
     }
   }
   async alertError(err: string | undefined) {

+ 1 - 1
app-angular/src/modules/user/page-register/page-register.component.html

@@ -29,7 +29,7 @@
                 <ion-input placeholder="密码" [clearInput]="true" [counter]="true" maxlength="20" type="password">
                 </ion-input>
             </ion-item>
-            <ion-button expand="block">确定</ion-button>
+            <ion-button expand="block" (click)="register()">确定</ion-button>
         </ion-list>
     </div>
 </ion-content>

+ 17 - 2
app-angular/src/modules/user/page-register/page-register.component.ts

@@ -1,5 +1,6 @@
 import { Component } from '@angular/core';
 import { Router } from '@angular/router';
+import { AlertController } from '@ionic/angular';
 
 @Component({
   selector: 'app-page-register',
@@ -9,12 +10,26 @@ import { Router } from '@angular/router';
 export class PageRegisterComponent {
   constructor(
     private router: Router,
+    private alertController: AlertController
   ) { }
 
+  async register() {
+    // 处理注册逻辑,例如发送注册请求到后端
+
+    // 显示注册成功的提示框
+    const alert = await this.alertController.create({
+      header: '提示',
+      message: '注册成功',
+      buttons: ['确定']
+    });
+    await alert.present();
+
+    // 导航到登录页面
+    this.router.navigate(['/user/login']);
+  }
 
   goBack() {
-    let path = "/user/login"
-    this.router.navigate([path])
+    this.router.navigate(['/user/login']);
   }
 
 }