|
@@ -2,10 +2,56 @@ import { Component } from '@angular/core';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-pages-fitting-room',
|
|
selector: 'app-pages-fitting-room',
|
|
- imports: [],
|
|
|
|
|
|
+ imports:[],
|
|
templateUrl: './pages-fitting-room.html',
|
|
templateUrl: './pages-fitting-room.html',
|
|
- styleUrl: './pages-fitting-room.scss'
|
|
|
|
|
|
+ styleUrls: ['./pages-fitting-room.scss']
|
|
})
|
|
})
|
|
export class PagesFittingRoom {
|
|
export class PagesFittingRoom {
|
|
|
|
+ // 身材参数
|
|
|
|
+ height = 170;
|
|
|
|
+ weight = 60;
|
|
|
|
+
|
|
|
|
+ // 场景映射
|
|
|
|
+ sceneNames = {
|
|
|
|
+ 'office': '办公场景',
|
|
|
|
+ 'date': '约会场景',
|
|
|
|
+ 'party': '派对场景',
|
|
|
|
+ 'casual': '休闲场景'
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 场景背景色
|
|
|
|
+ sceneBackgrounds = {
|
|
|
|
+ 'office': { '--scene-bg-start': '#ff9a9e', '--scene-bg-end': '#fecfef' },
|
|
|
|
+ 'date': { '--scene-bg-start': '#a8edea', '--scene-bg-end': '#fed6e3' },
|
|
|
|
+ 'party': { '--scene-bg-start': '#667eea', '--scene-bg-end': '#764ba2' },
|
|
|
|
+ 'casual': { '--scene-bg-start': '#ffeaa7', '--scene-bg-end': '#fab1a0' }
|
|
|
|
+ };
|
|
|
|
|
|
-}
|
|
|
|
|
|
+ // 更新身高
|
|
|
|
+ updateHeight(event: Event) {
|
|
|
|
+ this.height = parseInt((event.target as HTMLInputElement).value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 更新体重
|
|
|
|
+ updateWeight(event: Event) {
|
|
|
|
+ this.weight = parseInt((event.target as HTMLInputElement).value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 选择场景
|
|
|
|
+ selectScene(scene: keyof typeof this.sceneNames) {
|
|
|
|
+ console.log(`已切换到${this.sceneNames[scene]}`);
|
|
|
|
+ this.showNotification('场景切换', `已切换到${this.sceneNames[scene]}`);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 启动AR试衣
|
|
|
|
+ startAR() {
|
|
|
|
+ console.log('开启AR试穿');
|
|
|
|
+ this.showNotification('AR试穿', '正在启动相机...');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 显示通知
|
|
|
|
+ showNotification(title: string, message: string) {
|
|
|
|
+ // 在实际项目中,这里可以使用Angular Material的Snackbar或Toast服务
|
|
|
|
+ console.log(`[${title}] ${message}`);
|
|
|
|
+ }
|
|
|
|
+}
|