case-library.html 17 KB

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