Browse Source

feat:complete

5230292 4 months ago
parent
commit
fed07166ef

+ 1 - 1
src/app/app.module.ts

@@ -9,7 +9,7 @@ import { AppComponent } from './app.component';
 
 @NgModule({
   declarations: [AppComponent],
-  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
+  imports: [BrowserModule, IonicModule.forRoot({mode:"md"}), AppRoutingModule],
   providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
   bootstrap: [AppComponent],
 })

+ 23 - 14
src/app/tab1/tab1.page.html

@@ -129,6 +129,10 @@
   </ion-card-content>
 </ion-card>
 <!-- 个人表单填写 -->
+
+
+
+
 <!-- 个人推荐 -->
 <ion-grid>
   <ion-row>
@@ -141,25 +145,30 @@
           <!-- 弹性布局的六行一列金刚区按钮 -->
           <ion-row>
             <ion-col size="6" *ngFor="let item of customItems">
-              <ion-button expand="block">{{ item.title }}</ion-button>
+              <ion-button expand="block" (click)="currentType=item?.title">{{ item.title }}</ion-button>
             </ion-col>
           </ion-row>
           <!-- 图文及评分标准、浏览量 -->
           <ion-row>
-            <ion-col size="6">
+            <!-- <ion-col size="6">
               <ion-img src="assets/img/人间烟火.jpg" style="width: 100%; height: 100%;" ></ion-img>
-            </ion-col>
-            <ion-col size="6">
-              <ion-card>
-                <ion-card-header>
-                  图书名称:人间烟火
-                </ion-card-header>
-                <ion-card-content>
-                  <ion-label>评分:5.0</ion-label><br>
-                  <ion-label>浏览量:1000</ion-label>
-                </ion-card-content>
-              </ion-card>
-            </ion-col>
+            </ion-col> -->
+
+            <ng-container *ngFor="let novel of novelList">
+              <ion-col size="6" *ngIf="currentType=='全部'||novel.get('booktype')==currentType">
+                <ion-card>
+                  <ion-card-header>
+                    图书名称:{{novel?.get("bookname")}}
+                  </ion-card-header>
+                  <ion-card-content>
+                    图书编号:{{novel?.get("bookid")}}<br>
+                    图书金额:{{novel?.get("bookwage")}}¥
+                    <!-- <ion-label>评分:5.0</ion-label><br>
+                    <ion-label>浏览量:1000</ion-label> -->
+                  </ion-card-content>
+                </ion-card>
+              </ion-col>
+            </ng-container>
           </ion-row>
         </ion-card-content>
       </ion-card>

+ 1 - 1
src/app/tab1/tab1.page.spec.ts

@@ -1,6 +1,5 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { IonicModule } from '@ionic/angular';
-
 import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
 
 import { Tab1Page } from './tab1.page';
@@ -23,4 +22,5 @@ describe('Tab1Page', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
 });

+ 14 - 7
src/app/tab1/tab1.page.ts

@@ -1,5 +1,5 @@
 import { Component } from '@angular/core';
-
+import Parse from "parse";
 
 @Component({
   selector: 'app-tab1',
@@ -28,16 +28,23 @@ export class Tab1Page {
     setInterval(() => {
       this.currentTime = new Date();
     }, 1000);
+    this.loadNovels()
   }
-
+  currentType:string = "全部"
+    novelList:Array<Parse.Object> = []
+    async loadNovels(){
+    let query = new Parse.Query("NovelInformation");
+    let list = await query.find();
+    this.novelList = list
+    }
 
   customItems:Array<any> = [
-    {title:"游戏"},
-    {title:"历史"},
+    {title:"生活"},
+    {title:"言情"},
     {title:"仙侠"},
-    {title:"武侠"},
-    {title:"科幻"},
-    {title:"悬疑"},
+    {title:"修炼"},
+    {title:"校园"},
+    {title:"恐怖"},
   ]
 
 

+ 1 - 5
src/app/tab2/tab2.page.html

@@ -60,7 +60,7 @@
         <ion-searchbar placeholder="搜索"></ion-searchbar>
       </ion-col>
     </ion-row>
-<!-- 数组的使用 -->
+<!-- 数组的使用 进行分类-->
     <ion-list>
       <ion-list-header class="malefavorbooks"  *ngIf="currentTab=='male' || currentTab=='recommend'">男生喜欢的图书
         <ion-item-group *ngFor="let book of maleBooks">
@@ -78,10 +78,6 @@
     </ion-list-header>
     </ion-list>
 
-
-
-
-
   </ion-grid>
 
   <!-- 书籍名称 -->

+ 2 - 1
src/app/tab2/tab2.page.ts

@@ -10,7 +10,7 @@ export class Tab2Page implements OnInit{
   currentTab:string = "recommend"
   constructor() {}
   onClick(){
-    alert("666")
+    // alert("666")
   }
   ngOnInit() {
     this.loadNovels()
@@ -31,6 +31,7 @@ export class Tab2Page implements OnInit{
 
 
 
+
   maleBooks = [
     {
       title: '《盗墓笔记》',

+ 3 - 3
src/app/tab3/tab3.page.html

@@ -25,17 +25,17 @@
 
 
   <ion-card class="bianju">
-    <img alt="" src="https://gd-hbimg.huaban.com/db3495ffea73e3551181abbfd45adbeee8b532369f3b3-N2AKKf_fw1200webp" />
+    <img alt="" src="https://gd-hbimg.huaban.com/ccb1af849966407d71080fdfafca5eda7fc29e261cb81-iWjkms_fw1200webp" height="100%" width="100%" />
     <ion-card-header>
       <ion-card-title>{{user?.get("username") || '未登录'}}</ion-card-title>
       <ion-card-subtitle *ngIf="!user?.id">请您登陆后继续使用</ion-card-subtitle>
-      <ion-card-subtitle *ngIf="user?.id">{{user?.get("name")}}-{{user?.get("gender")}}</ion-card-subtitle>
+      <ion-card-subtitle *ngIf="user?.id">{{user?.get("name")}}-{{user?.get("gender")}}-{{user?.get("birthday")}}</ion-card-subtitle>
     </ion-card-header>
  
     <!-- 新增:根据用户状态,显示登录/登出按钮,执行跳转或登出函数 -->
     <ion-button *ngIf="!user?.id" fill="clear" routerLink="/user/login">登录</ion-button>
     <ion-button *ngIf="user?.id" fill="clear" routerLink="/user/edit/info">编辑资料</ion-button>
-    <ion-button *ngIf="user?.id" fill="clear" (click)="logout()">登出</ion-button>
+    <ion-button *ngIf="user?.id" fill="clear" (click)="logout()" style="right: auto;">退出</ion-button>
   </ion-card>
 
 

BIN
src/assets/img/123.jpg


BIN
src/assets/img/风景背景.jpg


BIN
src/assets/img/鬼吹灯.jpg


+ 1 - 1
src/index.html

@@ -12,7 +12,7 @@
   <meta name="format-detection" content="telephone=no" />
   <meta name="msapplication-tap-highlight" content="no" />
 
-  <link rel="icon" type="/src/assets/img/背景.jpg" href="assets/icon/favicon.png" />
+  <link rel="icon" type="/src/assets/img/风景背景.jpg" href="assets/icon/favicon.png" />
 
   <!-- add to homescreen for ios -->
   <meta name="apple-mobile-web-app-capable" content="yes" />

+ 8 - 0
src/user/edit-info/edit-info.page.html

@@ -38,6 +38,14 @@
             </ng-template>
           </ion-modal>
         </ion-item>
+        <!-- <ion-item>
+          <ion-label position="stacked">选择生日日期</ion-label>
+          <ion-datetime displayFormat="DD/MM/YYYY" [(ngModel)]="birthday"></ion-datetime>
+        </ion-item> -->
+
+
+
+
       </ion-list>
     </ion-card-content>
   </ion-card>

+ 4 - 2
src/user/edit-info/edit-info.page.ts

@@ -9,6 +9,8 @@ import * as Parse from 'parse';
 })
 export class EditInfoPage implements OnInit {
 
+
+
   userInfo: any = {
     name: '',
     mobile: '',
@@ -36,8 +38,8 @@ export class EditInfoPage implements OnInit {
     this.currentUser = Parse.User.current();
     if (this.currentUser) {
       console.log(this.userInfo)
-      this.userInfo.birthday = this.userInfo.birthday || new Date()
-      this.userInfo.birthday = new Date(this.userInfo.birthday);
+       this.userInfo.birthday = this.userInfo.birthday || new Date()
+       this.userInfo.birthday = new Date(this.userInfo.birthday);
       for (const key in this.userInfo) {
         if (this.userInfo.hasOwnProperty(key)) {
           this.currentUser.set(key, this.userInfo[key]);

+ 1 - 1
src/user/mine/mine.page.html

@@ -7,7 +7,7 @@
 <ion-content [fullscreen]="true">
 
   <ion-card>
-    <img alt="" src="/src/assets/img/背景.jpg" />
+    <img alt="" src="/src/assets/img/风景背景.jpg" />
     <ion-card-header>
       <ion-card-title>{{user?.get("username") || '未登录'}}</ion-card-title>
       <ion-card-subtitle *ngIf="!user?.id">请您登陆后继续使用</ion-card-subtitle>