case-library.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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. <!-- 第一行:主要筛选项 -->
  33. <div class="filter-row primary-filters">
  34. <div class="filter-group">
  35. <label>项目类型</label>
  36. <select formControlName="projectType">
  37. <option value="">全部类型</option>
  38. @for (type of projectTypeOptions; track type) {
  39. <option [value]="type">{{ type }}</option>
  40. }
  41. </select>
  42. </div>
  43. <div class="filter-group">
  44. <label>户型</label>
  45. <select formControlName="houseType">
  46. <option value="">全部户型</option>
  47. @for (type of houseTypeOptions; track type) {
  48. <option [value]="type">{{ type }}</option>
  49. }
  50. </select>
  51. </div>
  52. <div class="filter-group">
  53. <label>价格范围</label>
  54. <select formControlName="price">
  55. <option value="">全部价格</option>
  56. @for (price of priceOptions; track price) {
  57. <option [value]="price">{{ price }}</option>
  58. }
  59. </select>
  60. </div>
  61. <div class="filter-group">
  62. <label>排序方式</label>
  63. <select formControlName="sortBy">
  64. @for (option of sortOptions; track option.value) {
  65. <option [value]="option.value">{{ option.label }}</option>
  66. }
  67. </select>
  68. </div>
  69. </div>
  70. <!-- 第二行:风格选择 -->
  71. <div class="filter-row style-filters">
  72. <div class="filter-group style-group">
  73. <label>设计风格</label>
  74. <div class="style-checkboxes">
  75. @for (style of styleOptions; track style) {
  76. <label class="style-checkbox">
  77. <input
  78. type="checkbox"
  79. [value]="style"
  80. (change)="onStyleChange(style, $event.target.checked)"
  81. />
  82. <span class="style-tag">{{ style }}</span>
  83. </label>
  84. }
  85. </div>
  86. </div>
  87. </div>
  88. <!-- 第三行:高级筛选 -->
  89. <div class="filter-row advanced-filters">
  90. <div class="filter-group">
  91. <label>子类型</label>
  92. <select formControlName="subType">
  93. <option value="">全部子类型</option>
  94. @for (subType of subTypeOptions; track subType) {
  95. <option [value]="subType">{{ subType }}</option>
  96. }
  97. </select>
  98. </div>
  99. <div class="filter-group">
  100. <label>渲染级别</label>
  101. <select formControlName="renderingLevel">
  102. <option value="">全部级别</option>
  103. @for (level of renderingLevelOptions; track level) {
  104. <option [value]="level">{{ level }}</option>
  105. }
  106. </select>
  107. </div>
  108. <div class="filter-group checkbox-group">
  109. <label class="favorite-checkbox">
  110. <input type="checkbox" formControlName="favorite" />
  111. <span class="checkbox-text">只看收藏</span>
  112. </label>
  113. </div>
  114. </div>
  115. </form>
  116. </div>
  117. </section>
  118. <!-- 案例展示区域 -->
  119. <section class="cases-section">
  120. <div class="section-header">
  121. <h3>精选案例 <span class="cases-count">({{ filteredCases().length }})</span></h3>
  122. </div>
  123. <!-- 案例网格(瀑布流布局) -->
  124. <div class="cases-grid">
  125. <div *ngIf="filteredCases().length === 0" class="empty-state">
  126. <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  127. <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
  128. <circle cx="8.5" cy="8.5" r="1.5"></circle>
  129. <polyline points="21 15 16 10 5 21"></polyline>
  130. </svg>
  131. <p>未找到符合条件的案例</p>
  132. <button class="btn-reset" (click)="resetFilters()">重置筛选条件</button>
  133. </div>
  134. <div *ngFor="let caseItem of paginatedCases()" class="case-card" (click)="viewCaseDetails(caseItem)">
  135. <div class="case-image-container">
  136. <img [src]="caseItem.coverImage" [alt]="caseItem.name" class="case-image">
  137. <div class="case-overlay">
  138. <button class="favorite-btn" (click)="$event.stopPropagation(); toggleFavorite(caseItem.id)">
  139. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  140. <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>
  141. </svg>
  142. <span *ngIf="caseItem.isFavorite">已收藏</span>
  143. <span *ngIf="!caseItem.isFavorite">收藏</span>
  144. </button>
  145. <button class="share-btn" (click)="$event.stopPropagation(); shareCase(caseItem.id)">
  146. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  147. <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
  148. <polyline points="16 6 12 2 8 6"></polyline>
  149. <line x1="12" y1="2" x2="12" y2="15"></line>
  150. </svg>
  151. <span>分享</span>
  152. </button>
  153. </div>
  154. </div>
  155. <div class="case-info">
  156. <h4 class="case-name">{{ caseItem.name }}</h4>
  157. <div class="case-meta">
  158. <div class="meta-item">
  159. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  160. <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
  161. <circle cx="12" cy="7" r="4"></circle>
  162. </svg>
  163. <span>{{ caseItem.designer }}</span>
  164. </div>
  165. <div class="meta-item">
  166. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  167. <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
  168. </svg>
  169. <span>{{ caseItem.area }}㎡</span>
  170. </div>
  171. <div class="meta-item">
  172. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  173. <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>
  174. </svg>
  175. <span>{{ caseItem.views }}浏览</span>
  176. </div>
  177. </div>
  178. <div class="case-tags">
  179. <span *ngFor="let tag of caseItem.tags" class="tag">{{ tag }}</span>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 分页控件 -->
  185. <div class="pagination" *ngIf="totalPages() > 1">
  186. <button class="page-btn" (click)="prevPage()" [disabled]="currentPage() === 1">
  187. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  188. <polyline points="15 18 9 12 15 6"></polyline>
  189. </svg>
  190. </button>
  191. <ng-container *ngFor="let page of pageNumbers()">
  192. <button
  193. *ngIf="page !== -1; else ellipsis"
  194. class="page-btn"
  195. [class.active]="page === currentPage()"
  196. (click)="goToPage(page)"
  197. >
  198. {{ page }}
  199. </button>
  200. <ng-template #ellipsis>
  201. <div class="pagination-ellipsis">...</div>
  202. </ng-template>
  203. </ng-container>
  204. <button class="page-btn" (click)="nextPage()" [disabled]="currentPage() === totalPages()">
  205. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  206. <polyline points="9 18 15 12 9 6"></polyline>
  207. </svg>
  208. </button>
  209. </div>
  210. </section>
  211. </div>
  212. <!-- 案例详情模态框 -->
  213. <div class="case-modal" *ngIf="selectedCase()" (click)="closeCaseDetails()">
  214. <div class="modal-content" (click)="$event.stopPropagation()">
  215. <button class="close-btn" (click)="closeCaseDetails()">
  216. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  217. <line x1="18" y1="6" x2="6" y2="18"></line>
  218. <line x1="6" y1="6" x2="18" y2="18"></line>
  219. </svg>
  220. </button>
  221. <div class="case-detail-header">
  222. <h2>{{ selectedCase()?.name }}</h2>
  223. <div class="case-detail-meta">
  224. <span>{{ selectedCase()?.designer }}</span>
  225. <span>{{ selectedCase()?.area }}㎡</span>
  226. <span>{{ formatDate(selectedCase()?.createdAt!) }}</span>
  227. </div>
  228. </div>
  229. <!-- 案例图片轮播 -->
  230. <div class="case-image-gallery">
  231. <div class="main-image">
  232. <img [src]="selectedCase()?.coverImage" [alt]="selectedCase()?.name">
  233. </div>
  234. <div class="thumbnails">
  235. <img
  236. *ngFor="let image of selectedCase()?.detailImages"
  237. [src]="image"
  238. [alt]="selectedCase()?.name"
  239. class="thumbnail"
  240. >
  241. </div>
  242. </div>
  243. <!-- 案例详情信息 -->
  244. <div class="case-detail-info">
  245. <div class="info-section">
  246. <h3>案例详情</h3>
  247. <p>{{ selectedCase()?.description }}</p>
  248. <p>本案例采用了{{ selectedCase()?.style }}风格设计,为{{ selectedCase()?.houseType }}户型,面积{{ selectedCase()?.area }}平方米。设计师{{ selectedCase()?.designer }}根据客户需求,融合了现代美学与实用功能,打造了舒适且富有个性的居住空间。</p>
  249. </div>
  250. <div class="info-section">
  251. <h3>基本信息</h3>
  252. <div class="info-grid">
  253. <div class="info-item">
  254. <label>风格</label>
  255. <span>{{ getSelectedCaseStyle() }}</span>
  256. </div>
  257. <div class="info-item">
  258. <label>户型</label>
  259. <span>{{ selectedCase()?.houseType }}</span>
  260. </div>
  261. <div class="info-item">
  262. <label>楼盘</label>
  263. <span>{{ selectedCase()?.property }}</span>
  264. </div>
  265. <div class="info-item">
  266. <label>面积</label>
  267. <span>{{ selectedCase()?.area }}㎡</span>
  268. </div>
  269. <div class="info-item">
  270. <label>分类</label>
  271. <span>{{ selectedCase()?.category }}</span>
  272. </div>
  273. <div class="info-item">
  274. <label>项目类型</label>
  275. <span>{{ selectedCase()?.projectType }}</span>
  276. </div>
  277. <div class="info-item">
  278. <label>细分类型</label>
  279. <span>{{ selectedCase()?.subType }}</span>
  280. </div>
  281. <div class="info-item">
  282. <label>渲染水平</label>
  283. <span>{{ selectedCase()?.renderingLevel }}</span>
  284. </div>
  285. <div class="info-item">
  286. <label>浏览次数</label>
  287. <span>{{ selectedCase()?.views }}</span>
  288. </div>
  289. <div class="info-item">
  290. <label>收藏次数</label>
  291. <span>{{ selectedCase()?.favoriteCount }}</span>
  292. </div>
  293. <div class="info-item">
  294. <label>喜欢次数</label>
  295. <span>{{ selectedCase()?.likeCount }}</span>
  296. </div>
  297. <div class="info-item">
  298. <label>分享次数</label>
  299. <span>{{ selectedCase()?.shareCount }}</span>
  300. </div>
  301. <div class="info-item">
  302. <label>转化率</label>
  303. <span>{{ selectedCase()?.conversionRate }}%</span>
  304. </div>
  305. </div>
  306. </div>
  307. <div class="info-section">
  308. <h3>标签</h3>
  309. <div class="tags-container">
  310. <span *ngFor="let tag of selectedCase()?.tags" class="tag">{{ tag }}</span>
  311. </div>
  312. </div>
  313. </div>
  314. <!-- 操作按钮 -->
  315. <div class="case-actions">
  316. <button
  317. class="primary-btn"
  318. (click)="toggleFavorite(selectedCase()?.id!)"
  319. >
  320. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  321. <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>
  322. </svg>
  323. <span *ngIf="selectedCase()?.isFavorite">已收藏</span>
  324. <span *ngIf="!selectedCase()?.isFavorite">收藏案例</span>
  325. </button>
  326. <button class="secondary-btn" (click)="shareCase(selectedCase()?.id!)">
  327. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  328. <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
  329. <polyline points="16 6 12 2 8 6"></polyline>
  330. <line x1="12" y1="2" x2="12" y2="15"></line>
  331. </svg>
  332. <span>分享案例</span>
  333. </button>
  334. <button class="secondary-btn">
  335. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  336. <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>
  337. </svg>
  338. <span>查看原图</span>
  339. </button>
  340. </div>
  341. </div>
  342. </div>
  343. <!-- 分享弹窗 -->
  344. <div class="share-modal" *ngIf="showShareModal()" (click)="closeShareModal()">
  345. <div class="share-modal-content" (click)="$event.stopPropagation()">
  346. <button class="close-btn" (click)="closeShareModal()">
  347. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  348. <path d="M6 6L18 18M18 6L6 18" stroke="#666" stroke-width="2" stroke-linecap="round"/>
  349. </svg>
  350. </button>
  351. <h3>分享案例</h3>
  352. <p class="share-tip">复制链接发送给客户,或扫码打开案例页</p>
  353. <div class="share-body">
  354. <div class="share-link-box">
  355. <input class="share-link-input" [value]="shareLink()" readonly />
  356. <button class="btn-primary" (click)="copyShareLink()">复制链接</button>
  357. <button class="btn-secondary" (click)="openShareLink()">打开</button>
  358. </div>
  359. <div class="qr-box">
  360. <img *ngIf="qrDataUrl(); else qrPlaceholder" [src]="qrDataUrl()" alt="分享二维码" width="160" height="160" />
  361. <ng-template #qrPlaceholder>
  362. <div class="qr-placeholder">二维码生成中或不可用</div>
  363. </ng-template>
  364. <div class="qr-actions" *ngIf="qrDataUrl()">
  365. <button class="btn-secondary" (click)="downloadQrCode()">下载二维码</button>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. </div>
  371. </div>