case-library.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <div class="case-library-container">
  2. <!-- 中间内容区 -->
  3. <div class="content-wrapper">
  4. <!-- 欢迎区域 -->
  5. <section class="welcome-section">
  6. <h2>案例库</h2>
  7. <p>今天是 {{ currentDate.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' }) }},为客户提供最佳的设计参考</p>
  8. </section>
  9. <!-- 筛选区域 -->
  10. <section class="filter-section">
  11. <div class="filter-header">
  12. <button class="filter-toggle-btn" (click)="toggleFilterPanel()">
  13. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  14. <line x1="4" y1="10" x2="20" y2="10"></line>
  15. <line x1="4" y1="14" x2="20" y2="14"></line>
  16. <line x1="4" y1="18" x2="13" y2="18"></line>
  17. </svg>
  18. <span>高级筛选</span>
  19. </button>
  20. <button class="reset-filter-btn" (click)="resetFilters()">
  21. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  22. <polyline points="23 4 23 10 17 10"></polyline>
  23. <polyline points="1 20 1 14 7 14"></polyline>
  24. <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>
  25. </svg>
  26. <span>重置筛选</span>
  27. </button>
  28. </div>
  29. <!-- 高级筛选面板 -->
  30. <div class="filter-panel" [class.show]="showFilterPanel()">
  31. <form [formGroup]="filterForm" class="filter-form">
  32. <div class="filter-row">
  33. <div class="filter-group">
  34. <label>装修风格</label>
  35. <div class="checkbox-group">
  36. <label *ngFor="let style of styleOptions" class="checkbox-item">
  37. <input
  38. type="checkbox"
  39. [value]="style"
  40. [checked]="filterForm.get('style')?.value?.includes(style) || false"
  41. (change)="onStyleChange(style, $event.target.checked)"
  42. />
  43. <span>{{ style }}</span>
  44. </label>
  45. </div>
  46. </div>
  47. <div class="filter-group">
  48. <label>户型</label>
  49. <select formControlName="houseType">
  50. <option value="">全部户型</option>
  51. <option *ngFor="let type of houseTypeOptions" [value]="type">{{ type }}</option>
  52. </select>
  53. </div>
  54. <div class="filter-group">
  55. <label>楼盘</label>
  56. <select formControlName="property">
  57. <option value="">全部楼盘</option>
  58. <option *ngFor="let property of propertyOptions" [value]="property">{{ property }}</option>
  59. </select>
  60. </div>
  61. </div>
  62. <div class="filter-row">
  63. <div class="filter-group">
  64. <label>房屋面积</label>
  65. <div class="range-inputs">
  66. <input
  67. type="number"
  68. formControlName="minArea"
  69. placeholder="最小面积"
  70. min="0"
  71. />
  72. <span>-</span>
  73. <input
  74. type="number"
  75. formControlName="maxArea"
  76. placeholder="最大面积"
  77. min="0"
  78. />
  79. <span>㎡</span>
  80. </div>
  81. </div>
  82. <div class="filter-group">
  83. <label>收藏案例</label>
  84. <label class="checkbox-item full-width">
  85. <input type="checkbox" formControlName="favorite" />
  86. <span>仅显示我收藏的案例</span>
  87. </label>
  88. </div>
  89. </div>
  90. </form>
  91. </div>
  92. </section>
  93. <!-- 案例展示区域 -->
  94. <section class="cases-section">
  95. <div class="section-header">
  96. <h3>精选案例 <span class="cases-count">({{ filteredCases().length }})</span></h3>
  97. </div>
  98. <!-- 案例网格 -->
  99. <div class="cases-grid">
  100. <div *ngIf="filteredCases().length === 0" class="empty-state">
  101. <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  102. <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
  103. <circle cx="8.5" cy="8.5" r="1.5"></circle>
  104. <polyline points="21 15 16 10 5 21"></polyline>
  105. </svg>
  106. <p>未找到符合条件的案例</p>
  107. <button class="btn-reset" (click)="resetFilters()">重置筛选条件</button>
  108. </div>
  109. <div *ngFor="let caseItem of paginatedCases()" class="case-card" (click)="viewCaseDetails(caseItem)">
  110. <div class="case-image-container">
  111. <img [src]="caseItem.coverImage" [alt]="caseItem.name" class="case-image">
  112. <div class="case-overlay">
  113. <button class="favorite-btn" (click)="$event.stopPropagation(); toggleFavorite(caseItem.id)">
  114. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  115. <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>
  116. </svg>
  117. <span *ngIf="caseItem.isFavorite">已收藏</span>
  118. <span *ngIf="!caseItem.isFavorite">收藏</span>
  119. </button>
  120. <button class="share-btn" (click)="$event.stopPropagation(); shareCase(caseItem.id)">
  121. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  122. <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
  123. <polyline points="16 6 12 2 8 6"></polyline>
  124. <line x1="12" y1="2" x2="12" y2="15"></line>
  125. </svg>
  126. <span>分享</span>
  127. </button>
  128. </div>
  129. </div>
  130. <div class="case-info">
  131. <h4 class="case-name">{{ caseItem.name }}</h4>
  132. <div class="case-meta">
  133. <div class="meta-item">
  134. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  135. <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
  136. <circle cx="12" cy="7" r="4"></circle>
  137. </svg>
  138. <span>{{ caseItem.designer }}</span>
  139. </div>
  140. <div class="meta-item">
  141. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  142. <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
  143. </svg>
  144. <span>{{ caseItem.area }}㎡</span>
  145. </div>
  146. <div class="meta-item">
  147. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  148. <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>
  149. </svg>
  150. <span>{{ caseItem.views }}浏览</span>
  151. </div>
  152. </div>
  153. <div class="case-tags">
  154. <span *ngFor="let tag of caseItem.tags" class="tag">{{ tag }}</span>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <!-- 分页控件 -->
  160. <div class="pagination" *ngIf="totalPages() > 1">
  161. <button class="page-btn" (click)="prevPage()" [disabled]="currentPage() === 1">
  162. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  163. <polyline points="15 18 9 12 15 6"></polyline>
  164. </svg>
  165. </button>
  166. <button
  167. *ngFor="let page of pageNumbers()"
  168. class="page-btn"
  169. [class.active]="page === currentPage()"
  170. (click)="goToPage(page)"
  171. [disabled]="page === -1"
  172. >
  173. {{ page === -1 ? '...' : page }}
  174. </button>
  175. <button class="page-btn" (click)="nextPage()" [disabled]="currentPage() === totalPages()">
  176. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  177. <polyline points="9 18 15 12 9 6"></polyline>
  178. </svg>
  179. </button>
  180. </div>
  181. </section>
  182. </div>
  183. <!-- 案例详情模态框 -->
  184. <div class="case-modal" *ngIf="selectedCase()" (click)="closeCaseDetails()">
  185. <div class="modal-content" (click)="$event.stopPropagation()">
  186. <button class="close-btn" (click)="closeCaseDetails()">
  187. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  188. <line x1="18" y1="6" x2="6" y2="18"></line>
  189. <line x1="6" y1="6" x2="18" y2="18"></line>
  190. </svg>
  191. </button>
  192. <div class="case-detail-header">
  193. <h2>{{ selectedCase()?.name }}</h2>
  194. <div class="case-detail-meta">
  195. <span>{{ selectedCase()?.designer }}</span>
  196. <span>{{ selectedCase()?.area }}㎡</span>
  197. <span>{{ formatDate(selectedCase()?.createdAt!) }}</span>
  198. </div>
  199. </div>
  200. <!-- 案例图片轮播 -->
  201. <div class="case-image-gallery">
  202. <div class="main-image">
  203. <img [src]="selectedCase()?.coverImage" [alt]="selectedCase()?.name">
  204. </div>
  205. <div class="thumbnails">
  206. <img
  207. *ngFor="let image of selectedCase()?.detailImages"
  208. [src]="image"
  209. [alt]="selectedCase()?.name"
  210. class="thumbnail"
  211. >
  212. </div>
  213. </div>
  214. <!-- 案例详情信息 -->
  215. <div class="case-detail-info">
  216. <div class="info-section">
  217. <h3>案例详情</h3>
  218. <p>{{ selectedCase()?.description }}</p>
  219. <p>本案例采用了{{ selectedCase()?.style }}风格设计,为{{ selectedCase()?.houseType }}户型,面积{{ selectedCase()?.area }}平方米。设计师{{ selectedCase()?.designer }}根据客户需求,融合了现代美学与实用功能,打造了舒适且富有个性的居住空间。</p>
  220. </div>
  221. <div class="info-section">
  222. <h3>基本信息</h3>
  223. <div class="info-grid">
  224. <div class="info-item">
  225. <label>风格</label>
  226. <span>{{ getSelectedCaseStyle() }}</span>
  227. </div>
  228. <div class="info-item">
  229. <label>户型</label>
  230. <span>{{ selectedCase()?.houseType }}</span>
  231. </div>
  232. <div class="info-item">
  233. <label>楼盘</label>
  234. <span>{{ selectedCase()?.property }}</span>
  235. </div>
  236. <div class="info-item">
  237. <label>面积</label>
  238. <span>{{ selectedCase()?.area }}㎡</span>
  239. </div>
  240. <div class="info-item">
  241. <label>分类</label>
  242. <span>{{ selectedCase()?.category }}</span>
  243. </div>
  244. <div class="info-item">
  245. <label>浏览量</label>
  246. <span>{{ selectedCase()?.views }}</span>
  247. </div>
  248. </div>
  249. </div>
  250. <div class="info-section">
  251. <h3>标签</h3>
  252. <div class="tags-container">
  253. <span *ngFor="let tag of selectedCase()?.tags" class="tag">{{ tag }}</span>
  254. </div>
  255. </div>
  256. </div>
  257. <!-- 操作按钮 -->
  258. <div class="case-actions">
  259. <button
  260. class="primary-btn"
  261. (click)="toggleFavorite(selectedCase()?.id!)"
  262. >
  263. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  264. <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>
  265. </svg>
  266. <span *ngIf="selectedCase()?.isFavorite">已收藏</span>
  267. <span *ngIf="!selectedCase()?.isFavorite">收藏案例</span>
  268. </button>
  269. <button class="secondary-btn" (click)="shareCase(selectedCase()?.id!)">
  270. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  271. <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
  272. <polyline points="16 6 12 2 8 6"></polyline>
  273. <line x1="12" y1="2" x2="12" y2="15"></line>
  274. </svg>
  275. <span>分享案例</span>
  276. </button>
  277. <button class="secondary-btn">
  278. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  279. <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>
  280. </svg>
  281. <span>查看原图</span>
  282. </button>
  283. </div>
  284. </div>
  285. </div>
  286. </div>