123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <div class="case-library-container">
- <!-- 中间内容区 -->
- <div class="content-wrapper">
- <!-- 欢迎区域 -->
- <section class="welcome-section">
- <h2>案例库</h2>
- <p>今天是 {{ currentDate.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' }) }},为客户提供最佳的设计参考</p>
- </section>
- <!-- 筛选区域 -->
- <section class="filter-section">
- <div class="filter-header">
- <button class="filter-toggle-btn" (click)="toggleFilterPanel()">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <line x1="4" y1="10" x2="20" y2="10"></line>
- <line x1="4" y1="14" x2="20" y2="14"></line>
- <line x1="4" y1="18" x2="13" y2="18"></line>
- </svg>
- <span>高级筛选</span>
- </button>
- <button class="reset-filter-btn" (click)="resetFilters()">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <polyline points="23 4 23 10 17 10"></polyline>
- <polyline points="1 20 1 14 7 14"></polyline>
- <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>
- </svg>
- <span>重置筛选</span>
- </button>
- </div>
- <!-- 高级筛选面板 -->
- <div class="filter-panel" [class.show]="showFilterPanel()">
- <form [formGroup]="filterForm" class="filter-form">
- <div class="filter-row">
- <div class="filter-group">
- <label>装修风格</label>
- <div class="checkbox-group">
- <label *ngFor="let style of styleOptions" class="checkbox-item">
- <input
- type="checkbox"
- [value]="style"
- [checked]="filterForm.get('style')?.value?.includes(style) || false"
- (change)="onStyleChange(style, $event.target.checked)"
- />
- <span>{{ style }}</span>
- </label>
- </div>
- </div>
-
- <div class="filter-group">
- <label>户型</label>
- <select formControlName="houseType">
- <option value="">全部户型</option>
- <option *ngFor="let type of houseTypeOptions" [value]="type">{{ type }}</option>
- </select>
- </div>
-
- <div class="filter-group">
- <label>楼盘</label>
- <select formControlName="property">
- <option value="">全部楼盘</option>
- <option *ngFor="let property of propertyOptions" [value]="property">{{ property }}</option>
- </select>
- </div>
- </div>
-
- <div class="filter-row">
- <div class="filter-group">
- <label>房屋面积</label>
- <div class="range-inputs">
- <input
- type="number"
- formControlName="minArea"
- placeholder="最小面积"
- min="0"
- />
- <span>-</span>
- <input
- type="number"
- formControlName="maxArea"
- placeholder="最大面积"
- min="0"
- />
- <span>㎡</span>
- </div>
- </div>
-
- <div class="filter-group">
- <label>收藏案例</label>
- <label class="checkbox-item full-width">
- <input type="checkbox" formControlName="favorite" />
- <span>仅显示我收藏的案例</span>
- </label>
- </div>
- </div>
- </form>
- </div>
- </section>
- <!-- 案例展示区域 -->
- <section class="cases-section">
- <div class="section-header">
- <h3>精选案例 <span class="cases-count">({{ filteredCases().length }})</span></h3>
- </div>
-
- <!-- 案例网格 -->
- <div class="cases-grid">
- <div *ngIf="filteredCases().length === 0" class="empty-state">
- <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
- <circle cx="8.5" cy="8.5" r="1.5"></circle>
- <polyline points="21 15 16 10 5 21"></polyline>
- </svg>
- <p>未找到符合条件的案例</p>
- <button class="btn-reset" (click)="resetFilters()">重置筛选条件</button>
- </div>
-
- <div *ngFor="let caseItem of paginatedCases()" class="case-card" (click)="viewCaseDetails(caseItem)">
- <div class="case-image-container">
- <img [src]="caseItem.coverImage" [alt]="caseItem.name" class="case-image">
- <div class="case-overlay">
- <button class="favorite-btn" (click)="$event.stopPropagation(); toggleFavorite(caseItem.id)">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
- </svg>
- <span *ngIf="caseItem.isFavorite">已收藏</span>
- <span *ngIf="!caseItem.isFavorite">收藏</span>
- </button>
- <button class="share-btn" (click)="$event.stopPropagation(); shareCase(caseItem.id)">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
- <polyline points="16 6 12 2 8 6"></polyline>
- <line x1="12" y1="2" x2="12" y2="15"></line>
- </svg>
- <span>分享</span>
- </button>
- </div>
- </div>
-
- <div class="case-info">
- <h4 class="case-name">{{ caseItem.name }}</h4>
-
- <div class="case-meta">
- <div class="meta-item">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
- <circle cx="12" cy="7" r="4"></circle>
- </svg>
- <span>{{ caseItem.designer }}</span>
- </div>
- <div class="meta-item">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
- </svg>
- <span>{{ caseItem.area }}㎡</span>
- </div>
- <div class="meta-item">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M14 10h4.764a2 2 0 0 1 1.789 2.894l-3.5 7A2 2 0 0 1 15.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 0 0-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h2.5"></path>
- </svg>
- <span>{{ caseItem.views }}浏览</span>
- </div>
- </div>
-
- <div class="case-tags">
- <span *ngFor="let tag of caseItem.tags" class="tag">{{ tag }}</span>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 分页控件 -->
- <div class="pagination" *ngIf="totalPages() > 1">
- <button class="page-btn" (click)="prevPage()" [disabled]="currentPage() === 1">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <polyline points="15 18 9 12 15 6"></polyline>
- </svg>
- </button>
-
- <button
- *ngFor="let page of pageNumbers()"
- class="page-btn"
- [class.active]="page === currentPage()"
- (click)="goToPage(page)"
- [disabled]="page === -1"
- >
- {{ page === -1 ? '...' : page }}
- </button>
-
- <button class="page-btn" (click)="nextPage()" [disabled]="currentPage() === totalPages()">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <polyline points="9 18 15 12 9 6"></polyline>
- </svg>
- </button>
- </div>
- </section>
- </div>
- <!-- 案例详情模态框 -->
- <div class="case-modal" *ngIf="selectedCase()" (click)="closeCaseDetails()">
- <div class="modal-content" (click)="$event.stopPropagation()">
- <button class="close-btn" (click)="closeCaseDetails()">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <line x1="18" y1="6" x2="6" y2="18"></line>
- <line x1="6" y1="6" x2="18" y2="18"></line>
- </svg>
- </button>
-
- <div class="case-detail-header">
- <h2>{{ selectedCase()?.name }}</h2>
- <div class="case-detail-meta">
- <span>{{ selectedCase()?.designer }}</span>
- <span>{{ selectedCase()?.area }}㎡</span>
- <span>{{ formatDate(selectedCase()?.createdAt!) }}</span>
- </div>
- </div>
-
- <!-- 案例图片轮播 -->
- <div class="case-image-gallery">
- <div class="main-image">
- <img [src]="selectedCase()?.coverImage" [alt]="selectedCase()?.name">
- </div>
- <div class="thumbnails">
- <img
- *ngFor="let image of selectedCase()?.detailImages"
- [src]="image"
- [alt]="selectedCase()?.name"
- class="thumbnail"
- >
- </div>
- </div>
-
- <!-- 案例详情信息 -->
- <div class="case-detail-info">
- <div class="info-section">
- <h3>案例详情</h3>
- <p>{{ selectedCase()?.description }}</p>
- <p>本案例采用了{{ selectedCase()?.style }}风格设计,为{{ selectedCase()?.houseType }}户型,面积{{ selectedCase()?.area }}平方米。设计师{{ selectedCase()?.designer }}根据客户需求,融合了现代美学与实用功能,打造了舒适且富有个性的居住空间。</p>
- </div>
-
- <div class="info-section">
- <h3>基本信息</h3>
- <div class="info-grid">
- <div class="info-item">
- <label>风格</label>
- <span>{{ getSelectedCaseStyle() }}</span>
- </div>
- <div class="info-item">
- <label>户型</label>
- <span>{{ selectedCase()?.houseType }}</span>
- </div>
- <div class="info-item">
- <label>楼盘</label>
- <span>{{ selectedCase()?.property }}</span>
- </div>
- <div class="info-item">
- <label>面积</label>
- <span>{{ selectedCase()?.area }}㎡</span>
- </div>
- <div class="info-item">
- <label>分类</label>
- <span>{{ selectedCase()?.category }}</span>
- </div>
- <div class="info-item">
- <label>浏览量</label>
- <span>{{ selectedCase()?.views }}</span>
- </div>
- </div>
- </div>
-
- <div class="info-section">
- <h3>标签</h3>
- <div class="tags-container">
- <span *ngFor="let tag of selectedCase()?.tags" class="tag">{{ tag }}</span>
- </div>
- </div>
- </div>
-
- <!-- 操作按钮 -->
- <div class="case-actions">
- <button
- class="primary-btn"
- (click)="toggleFavorite(selectedCase()?.id!)"
- >
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
- </svg>
- <span *ngIf="selectedCase()?.isFavorite">已收藏</span>
- <span *ngIf="!selectedCase()?.isFavorite">收藏案例</span>
- </button>
- <button class="secondary-btn" (click)="shareCase(selectedCase()?.id!)">
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
- <polyline points="16 6 12 2 8 6"></polyline>
- <line x1="12" y1="2" x2="12" y2="15"></line>
- </svg>
- <span>分享案例</span>
- </button>
- <button class="secondary-btn">
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>
- </svg>
- <span>查看原图</span>
- </button>
- </div>
- </div>
- </div>
- </div>
|