Bladeren bron

Your commit message

AAA123 3 maanden geleden
bovenliggende
commit
84f599a546
54 gewijzigde bestanden met toevoegingen van 473 en 258 verwijderingen
  1. 2 2
      angular.json
  2. 2 14
      package-lock.json
  3. 2 5
      package.json
  4. 29 29
      src/app/annual-checkup/annual-checkup.page.ts
  5. 39 29
      src/app/app-routing.module.ts
  6. 5 5
      src/app/consultation/consultation.page.ts
  7. 3 3
      src/app/edit-profile/edit-profile.page.ts
  8. 5 5
      src/app/expert-lectures/expert-lectures.page.ts
  9. 2 2
      src/app/eye-exam/eye-exam.page.ts
  10. 4 4
      src/app/health-community/health-community.page.ts
  11. 1 1
      src/app/manage-family/manage-family.page.html
  12. 2 2
      src/app/medicine-purchase/medicine-purchase.page.ts
  13. 2 2
      src/app/services/medicine.service.ts
  14. 15 0
      src/app/services/splash.service.ts
  15. 2 2
      src/app/services/user.service.ts
  16. 17 0
      src/app/splash/splash-routing.module.ts
  17. 20 0
      src/app/splash/splash.module.ts
  18. 10 0
      src/app/splash/splash.page.html
  19. 68 0
      src/app/splash/splash.page.scss
  20. 17 0
      src/app/splash/splash.page.spec.ts
  21. 43 0
      src/app/splash/splash.page.ts
  22. 9 7
      src/app/tab1/tab1.page.html
  23. 3 2
      src/app/tab1/tab1.page.scss
  24. 27 17
      src/app/tab1/tab1.page.ts
  25. 4 4
      src/app/tab2/tab2.page.html
  26. 114 112
      src/app/tab2/tab2.page.scss
  27. 1 1
      src/app/tab3/tab3.page.scss
  28. 2 2
      src/app/tab3/tab3.page.ts
  29. 4 8
      src/app/tabs/tabs-routing.module.ts
  30. 0 0
      src/assets/images/AIdoctor.png
  31. 0 0
      src/assets/images/action.jpg
  32. 0 0
      src/assets/images/brackground1.jpg
  33. 0 0
      src/assets/images/brackground2.jpg
  34. 0 0
      src/assets/images/brackground3.jpeg
  35. 0 0
      src/assets/images/doctor1.jpg
  36. 0 0
      src/assets/images/doctor2.jpg
  37. 0 0
      src/assets/images/doctor3.jpg
  38. 0 0
      src/assets/images/doctor4.jpg
  39. 0 0
      src/assets/images/doctor5.jpg
  40. 0 0
      src/assets/images/eye1.jpg
  41. 0 0
      src/assets/images/eye2.jpg
  42. 0 0
      src/assets/images/ill1.jpg
  43. 0 0
      src/assets/images/ill2.jpg
  44. 0 0
      src/assets/images/ill3.jpg
  45. 0 0
      src/assets/images/ill4.jpg
  46. 0 0
      src/assets/images/ill5.jpg
  47. 0 0
      src/assets/images/medicine1.png
  48. 0 0
      src/assets/images/medicine2.png
  49. 0 0
      src/assets/images/user.png
  50. 0 0
      src/assets/images/user1.jpg
  51. 0 0
      src/assets/images/user2.jpg
  52. 0 0
      src/assets/images/user3.jpg
  53. 0 0
      src/assets/images/user4.jpg
  54. 19 0
      src/dev/jxnu/202226701052

+ 2 - 2
angular.json

@@ -44,8 +44,8 @@
                 },
                 {
                   "type": "anyComponentStyle",
-                  "maximumWarning": "6kb",
-                  "maximumError": "8kb"
+                  "maximumWarning": "8kb",
+                  "maximumError": "10kb"
                 }
               ],
               "fileReplacements": [

+ 2 - 14
package-lock.json

@@ -16,14 +16,11 @@
         "@angular/platform-browser": "^18.0.0",
         "@angular/platform-browser-dynamic": "^18.0.0",
         "@angular/router": "^18.0.0",
-        "@capacitor/android": "6.2.0",
+        "@capacitor/android": "^6.2.0",
         "@capacitor/app": "6.0.2",
-        "@capacitor/clipboard": "^6.0.2",
         "@capacitor/core": "^6.2.0",
-        "@capacitor/filesystem": "^6.0.2",
         "@capacitor/haptics": "6.0.2",
         "@capacitor/keyboard": "6.0.3",
-        "@capacitor/share": "^6.0.3",
         "@capacitor/splash-screen": "^6.0.3",
         "@capacitor/status-bar": "6.0.2",
         "@ionic/angular": "^8.4.1",
@@ -43,7 +40,7 @@
         "@angular/cli": "18.2.12",
         "@angular/compiler-cli": "^18.0.0",
         "@angular/language-service": "^18.0.0",
-        "@capacitor/cli": "6.2.0",
+        "@capacitor/cli": "^6.2.0",
         "@ionic/angular-toolkit": "^11.0.1",
         "@types/jasmine": "~5.1.0",
         "@types/uuid": "^10.0.0",
@@ -2761,15 +2758,6 @@
         "@capacitor/core": "^6.0.0"
       }
     },
-    "node_modules/@capacitor/share": {
-      "version": "6.0.3",
-      "resolved": "https://registry.npmmirror.com/@capacitor/share/-/share-6.0.3.tgz",
-      "integrity": "sha512-BkNM73Ix+yxQ7fkni8CrrGcp1kSl7u+YNoPLwWKQ1MuQ5Uav0d+CT8M67ie+3dc4jASmegnzlC6tkTmFcPTLeA==",
-      "license": "MIT",
-      "peerDependencies": {
-        "@capacitor/core": "^6.0.0"
-      }
-    },
     "node_modules/@capacitor/splash-screen": {
       "version": "6.0.3",
       "resolved": "https://registry.npmmirror.com/@capacitor/splash-screen/-/splash-screen-6.0.3.tgz",

+ 2 - 5
package.json

@@ -21,14 +21,11 @@
     "@angular/platform-browser": "^18.0.0",
     "@angular/platform-browser-dynamic": "^18.0.0",
     "@angular/router": "^18.0.0",
-    "@capacitor/android": "6.2.0",
+    "@capacitor/android": "^6.2.0",
     "@capacitor/app": "6.0.2",
-    "@capacitor/clipboard": "^6.0.2",
     "@capacitor/core": "^6.2.0",
-    "@capacitor/filesystem": "^6.0.2",
     "@capacitor/haptics": "6.0.2",
     "@capacitor/keyboard": "6.0.3",
-    "@capacitor/share": "^6.0.3",
     "@capacitor/splash-screen": "^6.0.3",
     "@capacitor/status-bar": "6.0.2",
     "@ionic/angular": "^8.4.1",
@@ -48,7 +45,7 @@
     "@angular/cli": "18.2.12",
     "@angular/compiler-cli": "^18.0.0",
     "@angular/language-service": "^18.0.0",
-    "@capacitor/cli": "6.2.0",
+    "@capacitor/cli": "^6.2.0",
     "@ionic/angular-toolkit": "^11.0.1",
     "@types/jasmine": "~5.1.0",
     "@types/uuid": "^10.0.0",

+ 29 - 29
src/app/annual-checkup/annual-checkup.page.ts

@@ -1,29 +1,29 @@
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
-
-@Component({
-  selector: 'app-annual-checkup',
-  templateUrl: './annual-checkup.page.html',
-  styleUrls: ['./annual-checkup.page.scss'],
-})
-export class AnnualCheckupPage implements OnInit {
-  checkupData: any;
-
-  constructor(private route: ActivatedRoute) {}
-
-  ngOnInit() {
-    // 假设从服务中获取数据
-    this.checkupData = {
-      title: '年度体检',
-      date: new Date(),
-      results: [
-        { name: '血压', value: '120/80 mmHg', status: '正常' },
-        { name: '血糖', value: '5.6 mmol/L', status: '正常' },
-        { name: '胆固醇', value: '4.5 mmol/L', status: '正常' },
-        { name: '体重', value: '70 kg', status: '正常' },
-        { name: '身高', value: '175 cm', status: '正常' }
-      ],
-      notes: '总体健康状况良好,建议继续保持良好的生活习惯。'
-    };
-  }
-}
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+
+@Component({
+  selector: 'app-annual-checkup',
+  templateUrl: './annual-checkup.page.html',
+  styleUrls: ['./annual-checkup.page.scss'],
+})
+export class AnnualCheckupPage implements OnInit {
+  checkupData: any;
+
+  constructor(private route: ActivatedRoute) {}
+
+  ngOnInit() {
+    // 假设从服务中获取数据
+    this.checkupData = {
+      title: '年度体检',
+      date: new Date(),
+      results: [
+        { name: '血压', value: '120/80 mmHg', status: '正常' },
+        { name: '血糖', value: '5.6 mmol/L', status: '正常' },
+        { name: '胆固醇', value: '4.5 mmol/L', status: '正常' },
+        { name: '体重', value: '70 kg', status: '正常' },
+        { name: '身高', value: '175 cm', status: '正常' }
+      ],
+      notes: '总体健康状况良好,建议继续保持良好的生活习惯。'
+    };
+  }
+}

+ 39 - 29
src/app/app-routing.module.ts

@@ -4,6 +4,15 @@ import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
 const routes: Routes = [
   {
     path: '',
+    redirectTo: 'splash',
+    pathMatch: 'full'
+  },
+  {
+    path: 'splash',
+    loadChildren: () => import('./splash/splash.module').then(m => m.SplashPageModule)
+  },
+  {
+    path: 'tabs',
     loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
   },
   {
@@ -73,35 +82,36 @@ const routes: Routes = [
   {
     path: 'medicine-detail/:id', // 添加 :id 参数以匹配具体药品ID
     loadChildren: () => import('./medicine-detail/medicine-detail.module').then( m => m.MedicineDetailPageModule)
-  },
  {
-    path: 'expert-lectures',
-    loadChildren: () => import('./expert-lectures/expert-lectures.module').then( m => m.ExpertLecturesPageModule)
-  },
-  {
-    path: 'health-community',
-    loadChildren: () => import('./health-community/health-community.module').then( m => m.HealthCommunityPageModule)
-  },
-  {
-    path: 'new-post',
-    loadChildren: () => import('./new-post/new-post.module').then( m => m.NewPostPageModule)
-  },
-  {
-    path: 'orders',
-    loadChildren: () => import('./orders/orders.module').then( m => m.OrdersPageModule)
-  },
-  {
-    path: 'promotions',
-    loadChildren: () => import('./promotions/promotions.module').then( m => m.PromotionsPageModule)
-  },
-  {
-    path: 'medical-services',
-    loadChildren: () => import('./medical-services/medical-services.module').then( m => m.MedicalServicesPageModule)
-  },
-  {
-    path: 'points-and-coupons',
-    loadChildren: () => import('./points-and-coupons/points-and-coupons.module').then( m => m.PointsAndCouponsPageModule)
-  }
-
+  },
+  {
+    path: 'expert-lectures',
+    loadChildren: () => import('./expert-lectures/expert-lectures.module').then( m => m.ExpertLecturesPageModule)
+  },
+  {
+    path: 'health-community',
+    loadChildren: () => import('./health-community/health-community.module').then( m => m.HealthCommunityPageModule)
+  },
+  {
+    path: 'new-post',
+    loadChildren: () => import('./new-post/new-post.module').then( m => m.NewPostPageModule)
+  },
+  {
+    path: 'orders',
+    loadChildren: () => import('./orders/orders.module').then( m => m.OrdersPageModule)
+  },
+  {
+    path: 'promotions',
+    loadChildren: () => import('./promotions/promotions.module').then( m => m.PromotionsPageModule)
+  },
+  {
+    path: 'medical-services',
+    loadChildren: () => import('./medical-services/medical-services.module').then( m => m.MedicalServicesPageModule)
+  },
+  {
+    path: 'points-and-coupons',
+    loadChildren: () => import('./points-and-coupons/points-and-coupons.module').then( m => m.PointsAndCouponsPageModule)
+  },
+ 
 
 
 ];

+ 5 - 5
src/app/consultation/consultation.page.ts

@@ -14,27 +14,27 @@ export class ConsultationPage {
   // 示例专家列表
   experts = [
     {
-      avatar: '../../assets/images/医生1.jpg',
+      avatar: '../../assets/images/doctor1.jpg',
       name: '张医生',
       specialty: '心血管科'
     },
     {
-      avatar: '../../assets/images/医生2.jpg',
+      avatar: '../../assets/images/doctor2.jpg',
       name: '李医生',
       specialty: '神经科'
     },
     {
-      avatar: '../../assets/images/医生3.jpg',
+      avatar: '../../assets/images/doctor3.jpg',
       name: '王医生',
       specialty: '儿科'
     },
     {
-      avatar: '../../assets/images/医生4.jpg',
+      avatar: '../../assets/images/doctor4.jpg',
       name: '赵医生',
       specialty: '外科'
     },
     {
-      avatar: '../../assets/images/医生5.jpg',
+      avatar: '../../assets/images/doctor5.jpg',
       name: '陈医生',
       specialty: '内科'
     }

+ 3 - 3
src/app/edit-profile/edit-profile.page.ts

@@ -12,7 +12,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 })
 export class EditProfilePage implements OnInit {
   profileForm: FormGroup;
-  previewImage: string | null = '../../assets/images/user-avatar.png'; // 默认头像路径
+  previewImage: string | null = '../../assets/images/user.png'; // 默认头像路径
   selectedFile: File | null = null;
 
   constructor(
@@ -36,7 +36,7 @@ export class EditProfilePage implements OnInit {
     this.userService.getUserInfo().subscribe(userInfo => {
       if (userInfo) {
         this.profileForm.patchValue(userInfo);
-        this.previewImage = userInfo.userAvatar ?? '../../assets/images/user-avatar.png'; // 确保预览图像是最新的头像或默认值
+        this.previewImage = userInfo.userAvatar ?? '../../assets/images/user.png'; // 确保预览图像是最新的头像或默认值
       }
     });
   }
@@ -63,7 +63,7 @@ export class EditProfilePage implements OnInit {
         alert('请选择有效的图片文件(支持的格式:JPEG, PNG, GIF)。');
         input.value = '';
         this.selectedFile = null;
-        this.previewImage = '../../assets/images/user-avatar.png'; // 清除预览图并恢复默认值
+        this.previewImage = '../../assets/images/user.png'; // 清除预览图并恢复默认值
       }
     }
   }

+ 5 - 5
src/app/expert-lectures/expert-lectures.page.ts

@@ -14,35 +14,35 @@ export class ExpertLecturesPage implements OnInit {
       speaker: '李教授',
       date: '2024-12-25',
       description: '了解如何通过生活方式改变和医学干预来预防心血管疾病...',
-      imageUrl: '../assets/images/1.jpg' // 确保图片路径正确
+      imageUrl: '../assets/images/ill1.jpg' // 确保图片路径正确
     },
     {
       title: '糖尿病管理的新进展',
       speaker: '王博士',
       date: '2024-12-30',
       description: '探讨最新的糖尿病管理技术和方法,帮助患者更好地控制病情...',
-      imageUrl: '../assets/images/2.jpg' // 确保图片路径正确
+      imageUrl: '../assets/images/ill2.jpg' // 确保图片路径正确
     },
     {
       title: '心理健康的重要性',
       speaker: '张心理学家',
       date: '2024-12-27',
       description: '心理健康对整体健康的影响及日常维护的方法...',
-      imageUrl: '../assets/images/3.jpg' // 确保图片路径正确
+      imageUrl: '../assets/images/ill3.jpg' // 确保图片路径正确
     },
     {
       title: '癌症早期筛查的意义',
       speaker: '赵医生',
       date: '2024-12-28',
       description: '介绍癌症早期筛查的重要性和常用方法...',
-      imageUrl: '../assets/images/4.jpg' // 确保图片路径正确
+      imageUrl: '../assets/images/ill4.jpg' // 确保图片路径正确
     },
     {
       title: '营养与免疫系统的关系',
       speaker: '孙营养师',
       date: '2024-12-29',
       description: '探讨营养在增强免疫系统中的作用及合理膳食建议...',
-      imageUrl: '../assets/images/5.jpg' // 确保图片路径正确
+      imageUrl: '../assets/images/ill5.jpg' // 确保图片路径正确
     },
     // 添加更多讲座...
   ];

+ 2 - 2
src/app/eye-exam/eye-exam.page.ts

@@ -36,8 +36,8 @@ export class EyeExamPage implements OnInit {
       date: new Date(),
       details: '视力良好,无异常。建议定期复查。',
       attachments: [
-        { url: '../../assets/images/眼科图.jpg', name: '附件1' },
-        { url: '../../assets/images/眼科图2.jpg', name: '附件2' }
+        { url: '../../assets/images/eye1.jpg', name: '附件1' },
+        { url: '../../assets/images/eye2.jpg', name: '附件2' }
       ]
     };
   }

+ 4 - 4
src/app/health-community/health-community.page.ts

@@ -17,7 +17,7 @@ export class HealthCommunityPage implements OnInit {
       author: '张三',
       date: new Date('2024-12-18'),
       content: '保持健康的饮食习惯对于维持良好的身体状态非常重要...',
-      imageUrl: '../../assets/images/用户1.jpg', // 确保图片路径正确
+      imageUrl: '../../assets/images/user1.jpg', // 确保图片路径正确
       authorAvatar: '' // 添加作者头像属性,默认为空字符串
     },
     {
@@ -26,7 +26,7 @@ export class HealthCommunityPage implements OnInit {
       author: '李四',
       date: new Date('2024-12-17'),
       content: '适量的运动不仅有助于增强体质,还能改善心情...',
-      imageUrl: '../../assets/images/用户2.jpg', // 确保图片路径正确
+      imageUrl: '../../assets/images/user2.jpg', // 确保图片路径正确
       authorAvatar: '' // 添加作者头像属性,默认为空字符串
     },
     // 添加更多帖子...
@@ -116,7 +116,7 @@ export class HealthCommunityPage implements OnInit {
       if (data && data.data) {
         // 在创建新帖子之前获取当前用户的头像
         const currentUserInfo = await firstValueFrom(this.userService.getUserInfo());
-        const authorAvatar = currentUserInfo?.userAvatar || '../../assets/images/user-avatar.png';
+        const authorAvatar = currentUserInfo?.userAvatar || '../../assets/images/user.png';
 
         const newPost = {
           id: this.posts.length + 1,
@@ -124,7 +124,7 @@ export class HealthCommunityPage implements OnInit {
           author: this.currentUser || '当前用户', // 使用当前用户名
           date: new Date(),
           content: data.data.content,
-          imageUrl: data.data.imageUrl || '../assets/images/用户4.jpg', // 根据实际需求设置默认图片或允许上传图片
+          imageUrl: data.data.imageUrl || '../assets/images/user3.jpg', // 根据实际需求设置默认图片或允许上传图片
           authorAvatar: authorAvatar // 添加作者头像
         };
         this.posts.unshift(newPost); // 将新帖子添加到最前面

+ 1 - 1
src/app/manage-family/manage-family.page.html

@@ -20,7 +20,7 @@
   <ion-list *ngIf="!isLoading && familyMembers.length > 0">
     <ion-item *ngFor="let member of familyMembers" button (click)="editMember(member)">
       <ion-avatar slot="start">
-        <img [src]="member.avatar || '../assets/images/用户4.jpg'" alt="Avatar" />
+        <img [src]="member.avatar || '../assets/images/user4.jpg'" alt="Avatar" />
       </ion-avatar>
       <ion-label>
         <h2>{{ member.name }}</h2>

+ 2 - 2
src/app/medicine-purchase/medicine-purchase.page.ts

@@ -22,8 +22,8 @@ import { trigger, state, style, transition, animate } from '@angular/animations'
 })
 export class MedicinePurchasePage implements OnInit {
   medicines = [
-    { id: 1, name: '阿司匹林', price: 15.99, description: '用于缓解轻度至中度疼痛...', imageUrl: '../assets/images/1.png' },
-    { id: 2, name: '布洛芬', price: 12.99, description: '非甾体抗炎药...', imageUrl: '../assets/images/2.png' },
+    { id: 1, name: '阿司匹林', price: 15.99, description: '用于缓解轻度至中度疼痛...', imageUrl: '../assets/images/medicine1.png' },
+    { id: 2, name: '布洛芬', price: 12.99, description: '非甾体抗炎药...', imageUrl: '../assets/images/medicine2.png' },
     // 添加更多药品...
   ];
 

+ 2 - 2
src/app/services/medicine.service.ts

@@ -25,7 +25,7 @@ export class MedicineService {
       name: '阿司匹林',
       price: 15.99,
       description: '用于缓解轻度至中度疼痛...',
-      imageUrl: '../assets/images/1.png',
+      imageUrl: '../assets/images/medicine1.png',
       usage: '成人常用量:口服,一次0.3-0.6g,每日3次...',
       precautions: '不宜长期大量服用...',
       sideEffects: '可能出现恶心、呕吐、上腹部不适或疼痛...'
@@ -35,7 +35,7 @@ export class MedicineService {
       name: '布洛芬',
       price: 12.99,
       description: '非甾体抗炎药...',
-      imageUrl: '../assets/images/2.png',
+      imageUrl: '../assets/images/medicine2.png',
       usage: '成人及12岁以上儿童,一次1片,若持续疼痛或发热,可间隔4~6小时重复用药一次...',
       precautions: '本品最好在饭后服用...',
       sideEffects: '少数患者可能会出现消化不良、胃痛、头痛等症状...'

+ 15 - 0
src/app/services/splash.service.ts

@@ -0,0 +1,15 @@
+// splash.service.ts
+import { Injectable } from '@angular/core';
+import { BehaviorSubject } from 'rxjs';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class SplashService {
+  private openLoginModalSource = new BehaviorSubject<boolean>(false);
+  openLoginModal$ = this.openLoginModalSource.asObservable();
+
+  setOpenLoginModal(value: boolean) {
+    this.openLoginModalSource.next(value);
+  }
+}

+ 2 - 2
src/app/services/user.service.ts

@@ -46,7 +46,7 @@ export class UserService {
         phone: userInfo.phone ?? (currentUserInfo as UserInfo).phone,
         gender: userInfo.gender ?? (currentUserInfo as UserInfo).gender,
         birthday: userInfo.birthday ?? (currentUserInfo as UserInfo).birthday,
-        userAvatar: userInfo.userAvatar ?? (currentUserInfo as UserInfo).userAvatar ?? '../../assets/images/user-avatar.png',
+        userAvatar: userInfo.userAvatar ?? (currentUserInfo as UserInfo).userAvatar ?? '../../assets/images/user.png',
         userType: userInfo.userType ?? (currentUserInfo as UserInfo).userType ?? '普通用户'
       };
 
@@ -95,7 +95,7 @@ export class UserService {
           ...parsedUserInfo,
           id: parsedUserInfo.id, // 确保 id 被正确传递
           username: parsedUserInfo.username || '',
-          userAvatar: parsedUserInfo.userAvatar || '../../assets/images/user-avatar.png',
+          userAvatar: parsedUserInfo.userAvatar || '../../assets/images/user.png',
           userType: parsedUserInfo.userType || '普通用户',
           gender: parsedUserInfo.gender || '',
           phone: parsedUserInfo.phone || '',

+ 17 - 0
src/app/splash/splash-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { SplashPage } from './splash.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: SplashPage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class SplashPageRoutingModule {}

+ 20 - 0
src/app/splash/splash.module.ts

@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { SplashPageRoutingModule } from './splash-routing.module';
+
+import { SplashPage } from './splash.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    SplashPageRoutingModule
+  ],
+  declarations: [SplashPage]
+})
+export class SplashPageModule {}

+ 10 - 0
src/app/splash/splash.page.html

@@ -0,0 +1,10 @@
+<ion-content>
+  <div class="splash-screen" [@splashAnimation]="animationState">
+    <img src="https://www.logosc.cn/uploads/icon/2020/11/12/b667ed4d-b167-4041-8555-39379da8b5c7.png" alt="App Logo" class="logo"/>
+    <!-- 动态文本 -->
+    <p class="welcome-message">{{ animationState ? 'Welcome AI 医疗' : '' }}</p>
+    <!-- 背景装饰图形 -->
+    <div class="decorative-shape top-left"></div>
+    <div class="decorative-shape bottom-right"></div>
+  </div>
+</ion-content>

+ 68 - 0
src/app/splash/splash.page.scss

@@ -0,0 +1,68 @@
+.splash-screen {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: linear-gradient(135deg, #76b852, #8DC26F); /* 使用渐变背景 */
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    z-index: 9999;
+    overflow: hidden; /* 确保超出部分被隐藏 */
+}
+
+.logo {
+    max-width: 150px;
+    max-height: 150px;
+    animation: fadeIn 1s ease-in-out forwards;
+}
+
+.welcome-message {
+    font-size: 24px;
+    color: white;
+    opacity: 0;
+    animation: fadeInText 1s 2s forwards;
+}
+
+.decorative-shape {
+    position: absolute;
+    width: 50px;
+    height: 50px;
+    background: rgba(255, 255, 255, 0.2);
+    border-radius: 50%;
+    animation: pulse 2s infinite ease-in-out;
+}
+
+.top-left {
+    top: 20px;
+    left: 20px;
+    animation-delay: 0s;
+}
+
+.bottom-right {
+    bottom: 20px;
+    right: 20px;
+    animation-delay: 1s;
+}
+
+@keyframes fadeIn {
+    from { opacity: 0; transform: scale(0.8); }
+    to { opacity: 1; transform: scale(1); }
+}
+
+@keyframes fadeInText {
+    from { opacity: 0; transform: translateY(-20px); }
+    to { opacity: 1; transform: translateY(0); }
+}
+
+@keyframes pulse {
+    0%, 100% {
+        transform: scale(1);
+        opacity: 1;
+    }
+    50% {
+        transform: scale(1.2);
+        opacity: 0.5;
+    }
+}

+ 17 - 0
src/app/splash/splash.page.spec.ts

@@ -0,0 +1,17 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { SplashPage } from './splash.page';
+
+describe('SplashPage', () => {
+  let component: SplashPage;
+  let fixture: ComponentFixture<SplashPage>;
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(SplashPage);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 43 - 0
src/app/splash/splash.page.ts

@@ -0,0 +1,43 @@
+// splash.page.ts
+import { Component, AfterViewInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { SplashService } from '../services/splash.service'; // 确保路径正确
+import { trigger, state, style, animate, transition } from '@angular/animations';
+
+@Component({
+  selector: 'app-splash',
+  templateUrl: './splash.page.html',
+  styleUrls: ['./splash.page.scss'],
+  animations: [
+    trigger('splashAnimation', [
+      state('true', style({ opacity: 1 })),
+      state('false', style({ opacity: 0 })),
+      transition('true => false', [
+        animate('500ms ease-out')
+      ]),
+      transition('false => true', [
+        animate('500ms ease-in')
+      ])
+    ])
+  ]
+})
+export class SplashPage implements AfterViewInit {
+  animationState = true;
+
+  constructor(private router: Router, private splashService: SplashService) {}
+
+  ngAfterViewInit() {
+    this.startAnimation();
+  }
+
+  private startAnimation() {
+    setTimeout(() => {
+      this.animationState = false;
+      // 在动画结束之后通知 Tab1 打开模态框并导航到 tab1
+      setTimeout(() => {
+        this.splashService.setOpenLoginModal(true);
+        this.router.navigate(['/tabs/tab1']);
+      }, 500);
+    }, 5000); // 3秒后开始淡出
+  }
+}

+ 9 - 7
src/app/tab1/tab1.page.html

@@ -27,23 +27,23 @@
 <ion-modal [isOpen]="isLoginModalOpen" (ionDidDismiss)="onLoginModalDismissed($event)">
   <ng-template>
     <ion-header>
-      <ion-toolbar>
+      <ion-toolbar color="primary">
         <ion-title>登录/注册</ion-title>
         <ion-buttons slot="end">
           <ion-button (click)="closeLoginModal()" fill="clear">关闭</ion-button>
         </ion-buttons>
       </ion-toolbar>
     </ion-header>
-    <ion-content class="ion-padding">
+    <ion-content class="ion-padding modal-content">
       <form #loginForm="ngForm" (ngSubmit)="onLoginFormSubmit(loginForm.value)" novalidate>
-        <ion-item>
+        <ion-item lines="none" style="--background: rgba(255, 255, 255, 0.9);">
           <ion-label position="floating">用户名</ion-label>
           <ion-input type="text" [(ngModel)]="user.username" name="username" required></ion-input>
           <ion-text *ngIf="user.username.length > 0 && user.username.length < 3" color="danger" style="position: absolute; top: 50%; right: 16px; transform: translateY(-50%); opacity: 0.7;">
             还差 {{ 3 - user.username.length }} 位
           </ion-text>
         </ion-item>
-        <ion-item>
+        <ion-item lines="none" style="--background: rgba(255, 255, 255, 0.9);">
           <ion-label position="floating">密码</ion-label>
           <ion-input type="password" [(ngModel)]="user.password" name="password" required></ion-input>
           <ion-text *ngIf="user.password.length > 0 && user.password.length < 6" color="danger" style="position: absolute; top: 50%; right: 16px; transform: translateY(-50%); opacity: 0.7;">
@@ -52,14 +52,16 @@
         </ion-item>
         <ion-row>
           <ion-col>
-            <ion-button expand="block" type="submit" [disabled]="!loginForm.form.valid">登录</ion-button>
+            <ion-button expand="block" type="submit" [disabled]="!loginForm.form.valid" style="--background: #6a9e4c; --color: white;">登录</ion-button>
           </ion-col>
           <ion-col>
-            <ion-button expand="block" (click)="registerUser()">注册</ion-button>
+            <ion-button expand="block" (click)="registerUser()" style="--background: #6a9e4c; --color: white;">注册</ion-button>
           </ion-col>
         </ion-row>
       </form>
-      <div *ngIf="errorMessage" class="error-message">{{ errorMessage }}</div>
+      <div *ngIf="errorMessage" class="error-message" style="color: #ff4d4d; text-align: center; margin-top: 16px;">
+        {{ errorMessage }}
+      </div>
     </ion-content>
   </ng-template>
 </ion-modal>

+ 3 - 2
src/app/tab1/tab1.page.scss

@@ -48,7 +48,7 @@ ion-toolbar {
     width: 100%; /* 占满整个宽度 */
      /* 使用min-height代替padding-top */
      min-height: 300px; /* 根据需要调整 */
-    background: url('../../assets/images/user-avatar.png') no-repeat center center / cover;
+    background: url('../../assets/images/user.png') no-repeat center center / cover;
     overflow: hidden;
     margin: 0 0; /* 只保留上下外边距 */
     border-radius: 0; /* 移除圆角 */
@@ -362,4 +362,5 @@ ion-toolbar {
       font-size: 10px; // 减小标签文字大小
     }
   }
-}
+}
+

+ 27 - 17
src/app/tab1/tab1.page.ts

@@ -1,14 +1,12 @@
 import { Component, AfterViewInit } from '@angular/core';
 import { Router } from '@angular/router';
 import { ModalController, NavController, ToastController } from '@ionic/angular';
-import { Observable } from 'rxjs';
-import { map, catchError,tap } from 'rxjs/operators';
-import { HttpClient, HttpHeaders } from '@angular/common/http';
-import { throwError } from 'rxjs';
+import { SplashService } from '../services/splash.service';
+import { HttpClient,} from '@angular/common/http';
 import { Subscription } from 'rxjs';
 import { UserService } from '../services/user.service';
-import {ElementRef, OnInit, Renderer2 } from '@angular/core';
-import { environment } from 'src/environments/environment';
+import {ElementRef, Renderer2 } from '@angular/core';
+
 
 interface User {
   username: string;
@@ -24,36 +22,36 @@ export class Tab1Page implements AfterViewInit {
 
   doctors = [
     {
-      avatar: '../../assets/images/医生1.jpg',
+      avatar: '../../assets/images/doctor1.jpg',
       name: '张医生',
       specialty: '心血管科'
     },
     {
-      avatar: '../../assets/images/医生2.jpg',
+      avatar: '../../assets/images/doctor2.jpg',
       name: '李医生',
       specialty: '神经科'
     },
     {
-      avatar: '../../assets/images/医生3.jpg',
+      avatar: '../../assets/images/doctor3.jpg',
       name: '王医生',
       specialty: '儿科'
     },
     {
-      avatar: '../../assets/images/医生4.jpg',
+      avatar: '../../assets/images/doctor4.jpg',
       name: '赵医生',
       specialty: '外科'
     },
     {
-      avatar: '../../assets/images/医生5.jpg',
+      avatar: '../../assets/images/doctor5.jpg',
       name: '陈医生',
       specialty: '内科'
     }
   ];
 
   images = [
-    '../../assets/images/背景图1.jpg',
-    '../../assets/images/背景图2.jpg',
-    '../../assets/images/背景图3.jpeg'
+    '../../assets/images/brackground1.jpg',
+    '../../assets/images/brackground2.jpg',
+    '../../assets/images/brackground3.jpeg'
   ];
 
   // 功能按钮数据
@@ -72,7 +70,7 @@ export class Tab1Page implements AfterViewInit {
     { label: '健康社区', icon: 'people', route: '/health-community' }
   ];
 
-  userAvatar: string = '../../assets/images/user-avatar.png'; // 默认头像
+  userAvatar: string = '../../assets/images/user.png'; // 默认头像
   private userInfoSubscription!: Subscription;
 
   currentIndex = 0;
@@ -86,6 +84,8 @@ export class Tab1Page implements AfterViewInit {
   isLoginModalOpen = false;
   user: User = { username: '', password: '' };
   fileToUpload: File | null = null;
+  private splashSubscription!: Subscription;
+  isLoggedIn: boolean = false;
  
 
   constructor(
@@ -96,7 +96,8 @@ export class Tab1Page implements AfterViewInit {
     private toastController: ToastController,// 添加 ToastController 注入
     private userService: UserService ,
     private el: ElementRef, 
-    private renderer: Renderer2
+    private renderer: Renderer2,
+    private splashService: SplashService
   ) {}
 
   ngOnInit() {
@@ -104,6 +105,11 @@ export class Tab1Page implements AfterViewInit {
     this.startImageRotation();
     // 初始化时设置第一张图片
     this.updateBackgroundImage();
+    this.splashSubscription = this.splashService.openLoginModal$.subscribe(async (shouldOpen) => {
+      if (shouldOpen) {
+        await this.openLoginModal();
+      }
+    });
   }
 
   ionViewWillEnter() {
@@ -114,6 +120,9 @@ export class Tab1Page implements AfterViewInit {
     if (this.userInfoSubscription) {
       this.userInfoSubscription.unsubscribe();
     }
+    if (this.splashSubscription) {
+      this.splashSubscription.unsubscribe();
+    }
   }
   
   // 实现 AfterViewInit 接口的 ngAfterViewInit 方法
@@ -245,7 +254,6 @@ export class Tab1Page implements AfterViewInit {
     this.router.navigate([route]);
   }
 
-
   openLoginModal() {
     this.isLoginModalOpen = true;
     console.log('打开登录/注册模态框');
@@ -280,6 +288,7 @@ export class Tab1Page implements AfterViewInit {
         async (response) => {
           console.log('登录成功:', response);
           await this.presentToast('登录成功', 'success');
+          this.isLoggedIn = true;
           this.closeLoginModal();
         },
         async (error) => {
@@ -312,6 +321,7 @@ export class Tab1Page implements AfterViewInit {
         async (response) => {
           console.log('注册成功:', response);
           await this.presentToast('注册成功', 'success');
+          this.isLoggedIn = true;
           this.closeLoginModal();
         },
         async (error) => {

+ 4 - 4
src/app/tab2/tab2.page.html

@@ -10,7 +10,7 @@
       <div class="message-container" [class.user-message]="message.sender === 'user'" [class.ai-message]="message.sender === 'ai'">
         <div class="avatar-container" *ngIf="message.sender === 'user'">
           <ion-avatar class="user-avatar">
-            <img [src]="'../../assets/images/user-avatar.png'" />
+            <img [src]="'../../assets/images/user.png'" />
           </ion-avatar>
         </div>
         <div class="message-text">
@@ -19,7 +19,7 @@
         </div>
         <div class="avatar-container" *ngIf="message.sender === 'ai'">
           <ion-avatar class="ai-avatar">
-            <img [src]="'../../assets/images/AI医生.png'" />
+            <img [src]="'../../assets/images/AIdoctor.png'" />
           </ion-avatar>
         </div>
       </div>
@@ -31,10 +31,10 @@
   <ion-toolbar>
     <ion-grid>
       <ion-row>
-        <ion-col size="10">
+        <ion-col size="9">
           <ion-input [(ngModel)]="userInput" placeholder="请输入您的问题..." (keyup.enter)="sendMessage()"></ion-input>
         </ion-col>
-        <ion-col size="2" class="send-button-container">
+        <ion-col size="3" class="send-button-container">
           <ion-button (click)="sendMessage()" expand="block" [disabled]="isLoading || !userInput.trim()">
             发送
           </ion-button>

+ 114 - 112
src/app/tab2/tab2.page.scss

@@ -1,113 +1,115 @@
-/* src/app/tab2/tab2.page.scss */
-.message-container {
-    display: flex;
-    align-items: center; /* 垂直居中 */
-    margin-bottom: 10px;
-  }
-  
-  .user-message,
-  .ai-message {
-    width: 100%;
-  }
-  
-  .user-message .message-text,
-  .ai-message .message-text {
-    max-width: 75%; /* 消息内容的最大宽度 */
-    word-wrap: break-word; /* 防止文字溢出 */
-  }
-  
-  .avatar-container {
-    display: flex;
-    align-items: center; /* 垂直居中 */
-  }
-  
-  .full-avatar {
-    width: 36px;
-    height: 36px;
-    border-radius: 50%;
-    overflow: hidden; /* 确保图片超出部分被隐藏 */
-  }
-  
-  .full-avatar img {
-    width: 100%;
-    height: 100%;
-    object-fit: cover; /* 保持图片比例并填充容器 */
-    border-radius: 50%; /* 保持圆形 */
-  }
-  
-  .user-message .avatar-container {
-    margin-right: 10px; /* 头像和文本之间的间距 */
-  }
-  
-  .ai-message .avatar-container {
-    margin-left: 10px; /* 头像和文本之间的间距 */
-  }
-  
-  .user-message .message-text {
-    text-align: left; /* 用户消息左对齐 */
-    margin-left: 10px; /* 文本和头像之间的间距 */
-    color:rgb(7, 7, 15); /* 用户消息的文字颜色 */
-    
-  }
-  
-  .ai-message .message-text {
-    tetext-align: left; /* AI 消息左对齐 */
-    margin-right: 10px; /* 文本和头像之间的间距 */
-    color: #333; /* AI 医生消息的文字颜色 */
-  }
-  
-  .user-message {
-    justify-content: flex-start; /* 用户消息固定在左边 */
-    background-color:#f1f1f1; /* 用户消息的背景色 */
-    
-  }
-  
-  .ai-message {
-    justify-content: flex-end; /* AI 消息固定在右边 */
-    background-color: #f1f1f1; /* AI 医生消息的背景色 */
-  }
-  
-  /* 确保头像和消息在同一行内 */
-  .user-message .message-container,
-  .ai-message .message-container {
-    display: flex;
-    align-items: center; /* 垂直居中 */
-  }
-  
-  /* 确保消息容器占据整个宽度 */
-  .user-message .message-container,
-  .ai-message .message-container {
-    width: 100%;
-  }
-  
-  ion-footer ion-toolbar {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 10px;
-  }
-  
-  ion-footer .send-button-container {
-    display: flex;
-    justify-content: flex-end;
-    align-items: center;
-  }
-  
-  ion-footer ion-input {
-    flex: 1;
-    margin-right: 10px;
-  }
-  
-  ion-footer ion-button {
-    width: 80px;
-  }
-  
-  ion-spinner {
-    margin-left: 10px;
-  }
-  
-  /* 居中显示标题 */
-  .center-title {
-    text-align: center;
-    width: 100%; /* 确保标题占据整个工具栏的宽度 */
+/* src/app/tab2/tab2.page.scss */
+.message-container {
+    display: flex;
+    align-items: center; /* 垂直居中 */
+    margin-bottom: 10px;
+  }
+  
+  .user-message,
+  .ai-message {
+    width: 100%;
+  }
+  
+  .user-message .message-text,
+  .ai-message .message-text {
+    max-width: 75%; /* 消息内容的最大宽度 */
+    word-wrap: break-word; /* 防止文字溢出 */
+  }
+  
+  .avatar-container {
+    display: flex;
+    align-items: center; /* 垂直居中 */
+  }
+  
+  .full-avatar {
+    width: 36px;
+    height: 36px;
+    border-radius: 50%;
+    overflow: hidden; /* 确保图片超出部分被隐藏 */
+  }
+  
+  .full-avatar img {
+    width: 100%;
+    height: 100%;
+    object-fit: cover; /* 保持图片比例并填充容器 */
+    border-radius: 50%; /* 保持圆形 */
+  }
+  
+  .user-message .avatar-container {
+    margin-right: 10px; /* 头像和文本之间的间距 */
+  }
+  
+  .ai-message .avatar-container {
+    margin-left: 10px; /* 头像和文本之间的间距 */
+  }
+  
+  .user-message .message-text {
+    text-align: left; /* 用户消息左对齐 */
+    margin-left: 10px; /* 文本和头像之间的间距 */
+    color:rgb(7, 7, 15); /* 用户消息的文字颜色 */
+    
+  }
+  
+  .ai-message .message-text {
+    tetext-align: left; /* AI 消息左对齐 */
+    margin-right: 10px; /* 文本和头像之间的间距 */
+    color: #333; /* AI 医生消息的文字颜色 */
+  }
+  
+  .user-message {
+    justify-content: flex-start; /* 用户消息固定在左边 */
+    background-color:#f1f1f1; /* 用户消息的背景色 */
+    
+  }
+  
+  .ai-message {
+    justify-content: flex-end; /* AI 消息固定在右边 */
+    background-color: #f1f1f1; /* AI 医生消息的背景色 */
+  }
+  
+  /* 确保头像和消息在同一行内 */
+  .user-message .message-container,
+  .ai-message .message-container {
+    display: flex;
+    align-items: center; /* 垂直居中 */
+  }
+  
+  /* 确保消息容器占据整个宽度 */
+  .user-message .message-container,
+  .ai-message .message-container {
+    width: 100%;
+  }
+  
+  ion-footer ion-toolbar {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 10px;
+  }
+  
+  ion-footer .send-button-container {
+    display: flex;
+    justify-content: center; /* 居中对齐按钮 */
+    align-items: center;
+    min-width: 80px; /* 设置最小宽度 */
+  }
+  
+  ion-footer ion-input {
+    flex: 1;
+    margin-right: 10px;
+  }
+  
+  ion-footer ion-button {
+    width: 100%; /* 让按钮占据整个列宽 */
+    min-width: 80px; /* 设置最小宽度 */
+    white-space: nowrap; /* 防止文本换行 */
+  }
+  
+  ion-spinner {
+    margin-left: 10px;
+  }
+  /* 居中显示标题 */
+  .center-title {
+    text-align: center;
+    width: 100%; /* 确保标题占据整个工具栏的宽度 */
   }

+ 1 - 1
src/app/tab3/tab3.page.scss

@@ -167,7 +167,7 @@ ion-button {
   }
 
   .promotion-image {
-    background: url('../../assets/images/活动.jpg') no-repeat center center / cover;
+    background: url('../../assets/images/action.jpg') no-repeat center center / cover;
     width: 100%;
     transition: opacity 0.3s ease;
     &:hover {

+ 2 - 2
src/app/tab3/tab3.page.ts

@@ -11,7 +11,7 @@ import { Subscription } from 'rxjs';
 export class Tab3Page implements OnInit {
 
   username: string = '';
-  userAvatar: string | null = '../../assets/images/user-avatar.png'; // 允许 null
+  userAvatar: string | null = '../../assets/images/user.png'; // 允许 null
   userType: string = '普通用户';
   previewImage: string | null = null;
   private userInfoSubscription?: Subscription;
@@ -53,7 +53,7 @@ export class Tab3Page implements OnInit {
         this.userType = userInfo.userType ?? '普通用户';
         this.previewImage = userInfo.userAvatar ?? null; // 设置预览图像
       } else {
-        this.userAvatar = '../../assets/images/user-avatar.png'; // 如果没有用户信息,使用默认头像
+        this.userAvatar = '../../assets/images/user.png'; // 如果没有用户信息,使用默认头像
         this.previewImage = null;
       }
     });

+ 4 - 8
src/app/tabs/tabs-routing.module.ts

@@ -4,7 +4,7 @@ import { TabsPage } from './tabs.page';
 
 const routes: Routes = [
   {
-    path: 'tabs',
+    path: '',
     component: TabsPage,
     children: [
       {
@@ -21,19 +21,15 @@ const routes: Routes = [
       },
       {
         path: '',
-        redirectTo: '/tabs/tab1',
+        redirectTo: 'tab1',
         pathMatch: 'full'
       }
     ]
-  },
-  {
-    path: '',
-    redirectTo: '/tabs/tab1',
-    pathMatch: 'full'
   }
 ];
 
 @NgModule({
   imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
 })
-export class TabsPageRoutingModule {}
+export class TabsPageRoutingModule {}

+ 0 - 0
src/assets/images/AI医生.png → src/assets/images/AIdoctor.png


+ 0 - 0
src/assets/images/活动.jpg → src/assets/images/action.jpg


+ 0 - 0
src/assets/images/背景图1.jpg → src/assets/images/brackground1.jpg


+ 0 - 0
src/assets/images/背景图2.jpg → src/assets/images/brackground2.jpg


+ 0 - 0
src/assets/images/背景图3.jpeg → src/assets/images/brackground3.jpeg


+ 0 - 0
src/assets/images/医生1.jpg → src/assets/images/doctor1.jpg


+ 0 - 0
src/assets/images/医生2.jpg → src/assets/images/doctor2.jpg


+ 0 - 0
src/assets/images/医生3.jpg → src/assets/images/doctor3.jpg


+ 0 - 0
src/assets/images/医生4.jpg → src/assets/images/doctor4.jpg


+ 0 - 0
src/assets/images/医生5.jpg → src/assets/images/doctor5.jpg


+ 0 - 0
src/assets/images/眼科图.jpg → src/assets/images/eye1.jpg


+ 0 - 0
src/assets/images/眼科图2.jpg → src/assets/images/eye2.jpg


+ 0 - 0
src/assets/images/病1.jpg → src/assets/images/ill1.jpg


+ 0 - 0
src/assets/images/病2.jpg → src/assets/images/ill2.jpg


+ 0 - 0
src/assets/images/病3.jpg → src/assets/images/ill3.jpg


+ 0 - 0
src/assets/images/病4.jpg → src/assets/images/ill4.jpg


+ 0 - 0
src/assets/images/病5.jpg → src/assets/images/ill5.jpg


+ 0 - 0
src/assets/images/药1.png → src/assets/images/medicine1.png


+ 0 - 0
src/assets/images/药2.png → src/assets/images/medicine2.png


+ 0 - 0
src/assets/images/user-avatar.png → src/assets/images/user.png


+ 0 - 0
src/assets/images/用户1.jpg → src/assets/images/user1.jpg


+ 0 - 0
src/assets/images/用户2.jpg → src/assets/images/user2.jpg


+ 0 - 0
src/assets/images/用户3.jpg → src/assets/images/user3.jpg


+ 0 - 0
src/assets/images/用户4.jpg → src/assets/images/user4.jpg


+ 19 - 0
src/dev/jxnu/202226701052

@@ -0,0 +1,19 @@
+# 打包项目,携带应用前缀(index.html中相对路径将自动修复为/dev/jxnu/<学号>前缀)
+# /dev/ 项目测试版上传路径
+# /dev/jxnu/<学号> nova-crm项目预留路径
+set NODE_OPTIONS=–max_old_space_size=16000
+node ./node_modules/@angular/cli/bin/ng build --base-href="/dev/jxnu/20226701052/"
+
+# 清空旧文件目录
+obsutil rm obs://nova-cloud/dev/jxnu/20226701052 -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com"
+
+# 同步文件目录
+obsutil sync ./www obs://nova-cloud/dev/jxnu/20226701052  -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read
+
+
+# 授权公开可读
+obsutil chattri obs://nova-cloud/dev/jxnu/20226701052 -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read
+
+# 列举对象
+obsutil ls obs://nova-cloud/dev/jxnu/20226701052  -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com"
+