IndividualCustomer.razor 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. @page "/memberManagement/individualCustomer"
  2. @attribute [ReuseTabsPage(Title = "个人用户")]
  3. <PageHeader Title="个人用户" SubTitle=""></PageHeader>
  4. <div class="customer-management-container">
  5. <!-- 查询区域 -->
  6. <div class="search-section">
  7. <div class="ant-row ant-row-start" style="margin-bottom: 20px;">
  8. <div class="ant-col ant-col-3" style="padding-right: 8px;">
  9. <input type="text"
  10. class="ant-input"
  11. placeholder="客户名称"
  12. @bind="SearchCustomerName"
  13. @bind:event="oninput" />
  14. </div>
  15. <div class="ant-col ant-col-3" style="padding-right: 8px;">
  16. <input type="text"
  17. class="ant-input"
  18. placeholder="客户编号"
  19. @bind="SearchCustomerCode"
  20. @bind:event="oninput" />
  21. </div>
  22. <div class="ant-col ant-col-3" style="padding-right: 8px;">
  23. <input type="text"
  24. class="ant-input"
  25. placeholder="客户手机号"
  26. @bind="SearchCustomerMobile"
  27. @bind:event="oninput" />
  28. </div>
  29. <!-- 操作按钮 -->
  30. <div class="ant-col ant-col-12" style="text-align: right;">
  31. <Button Type="@ButtonType.Primary" Icon="search" OnClick="HandleSearch">
  32. 查询
  33. </Button>
  34. </div>
  35. </div>
  36. </div>
  37. <!-- 客户列表表格 -->
  38. <div class="table-section">
  39. @if (Loading)
  40. {
  41. <div class="loading-container">
  42. <div class="ant-spin ant-spin-lg" style="margin: 20px auto;">
  43. <span class="ant-spin-dot ant-spin-dot-spin">
  44. <i class="ant-spin-dot-item"></i>
  45. <i class="ant-spin-dot-item"></i>
  46. <i class="ant-spin-dot-item"></i>
  47. <i class="ant-spin-dot-item"></i>
  48. </span>
  49. <div class="ant-spin-text">加载中...</div>
  50. </div>
  51. </div>
  52. }
  53. else
  54. {
  55. <div class="ant-table-wrapper">
  56. <div class="ant-table">
  57. <div class="ant-table-container">
  58. <!-- 使用单个表格,确保表头和内容列对齐 -->
  59. <div class="ant-table-content">
  60. <table style="width: 100%; table-layout: fixed;">
  61. <colgroup>
  62. <col style="width: 15%;" />
  63. <col style="width: 10%;" />
  64. <col style="width: 10%;" />
  65. <col style="width: 15%;" />
  66. <col style="width: 10%;" />
  67. <col style="width: 10%;" />
  68. <col style="width: 15%;" />
  69. <col style="width: 10%;" />
  70. <col style="width: 10%;" />
  71. <col style="width: 10%;" />
  72. </colgroup>
  73. <thead class="ant-table-thead">
  74. <tr>
  75. <th class="ant-table-cell">客户名称</th>
  76. <th class="ant-table-cell">客户编号</th>
  77. <th class="ant-table-cell">站点</th>
  78. <th class="ant-table-cell">手机号</th>
  79. <th class="ant-table-cell">注册时间</th>
  80. <th class="ant-table-cell">账户余额</th>
  81. <th class="ant-table-cell">微信头像</th>
  82. <th class="ant-table-cell">最近行为</th>
  83. <th class="ant-table-cell">最后活跃时间</th>
  84. <th class="ant-table-cell">操作</th>
  85. </tr>
  86. </thead>
  87. <tbody class="ant-table-tbody">
  88. @foreach (var customer in FilteredCustomers)
  89. {
  90. <tr class="ant-table-row">
  91. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  92. @customer.Name
  93. </td>
  94. <td class="ant-table-cell">@customer.AccountNo</td>
  95. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  96. @customer.StationName
  97. </td>
  98. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  99. @customer.Mobile
  100. </td>
  101. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  102. @customer.RegisterTime
  103. </td>
  104. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  105. @customer.Balance
  106. </td>
  107. <td class="ant-table-cell">@customer.AvatarUrl</td>
  108. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  109. @customer.RecentBehavior
  110. </td>
  111. <td class="ant-table-cell" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
  112. @customer.LastActiveTime
  113. </td>
  114. <td class="ant-table-cell">
  115. <div style="display: flex; gap: 4px; flex-wrap: nowrap;">
  116. <button type="button" class="ant-btn ant-btn-link ant-btn-sm"
  117. @onclick="() => ShowCardManagement(customer)"
  118. title="卡管理">
  119. 卡管理
  120. </button>
  121. <button type="button" class="ant-btn ant-btn-link ant-btn-sm"
  122. @onclick="() => ShowEditModal(customer)"
  123. title="编辑">
  124. 编辑
  125. </button>
  126. </div>
  127. </td>
  128. </tr>
  129. }
  130. </tbody>
  131. </table>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- 分页 -->
  136. @if (TotalCount > 0)
  137. {
  138. <div style="margin-top: 16px; text-align: right;">
  139. <Pagination Total="@TotalCount"
  140. PageSize="@PageSize"
  141. Current="@CurrentPage"
  142. OnChange="@HandlePageChange"
  143. OnShowSizeChange="@HandlePageSizeChange"
  144. ShowSizeChanger
  145. ShowQuickJumper />
  146. </div>
  147. }
  148. </div>
  149. }
  150. </div>
  151. </div>
  152. }
  153. <style>
  154. /* 页面基础样式 */
  155. .customer-management-container {
  156. padding: 24px;
  157. background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  158. min-height: calc(100vh - 100px);
  159. }
  160. .search-section {
  161. margin-bottom: 30px;
  162. background: white;
  163. padding: 20px;
  164. border-radius: 12px;
  165. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  166. }
  167. /* 表格样式 */
  168. .table-section {
  169. background: white;
  170. padding: 20px;
  171. border-radius: 12px;
  172. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  173. }
  174. /* 模态框基础样式 */
  175. .modal-overlay {
  176. position: fixed;
  177. top: 0;
  178. left: 0;
  179. right: 0;
  180. bottom: 0;
  181. background-color: rgba(0, 0, 0, 0.5);
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. z-index: 1000;
  186. backdrop-filter: blur(5px);
  187. animation: fadeIn 0.3s ease;
  188. }
  189. /* 优雅的模态框样式 */
  190. .elegant-modal {
  191. background: white;
  192. border-radius: 16px;
  193. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  194. overflow: hidden;
  195. animation: slideUp 0.4s ease;
  196. max-height: 85vh;
  197. display: flex;
  198. flex-direction: column;
  199. border: 1px solid rgba(255, 255, 255, 0.2);
  200. }
  201. .modal-header {
  202. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  203. color: white;
  204. padding: 24px 30px;
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. position: relative;
  209. }
  210. .modal-header::after {
  211. content: '';
  212. position: absolute;
  213. bottom: 0;
  214. left: 5%;
  215. right: 5%;
  216. height: 1px;
  217. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  218. }
  219. .modal-title {
  220. font-size: 20px;
  221. font-weight: 600;
  222. display: flex;
  223. align-items: center;
  224. gap: 10px;
  225. }
  226. .modal-icon {
  227. font-size: 24px;
  228. }
  229. .modal-close-btn {
  230. background: rgba(255, 255, 255, 0.2);
  231. border: none;
  232. width: 36px;
  233. height: 36px;
  234. border-radius: 50%;
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. color: white;
  239. font-size: 20px;
  240. cursor: pointer;
  241. transition: all 0.3s ease;
  242. }
  243. .modal-close-btn:hover {
  244. background: rgba(255, 255, 255, 0.3);
  245. transform: rotate(90deg);
  246. }
  247. .modal-body {
  248. padding: 30px;
  249. flex: 1;
  250. overflow-y: auto;
  251. max-height: calc(85vh - 150px);
  252. }
  253. /* 移除滚动条样式 */
  254. .modal-body::-webkit-scrollbar {
  255. display: none;
  256. }
  257. .modal-body {
  258. -ms-overflow-style: none;
  259. scrollbar-width: none;
  260. }
  261. /* 表单卡片样式 */
  262. .form-card {
  263. background: white;
  264. border-radius: 12px;
  265. box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  266. margin-bottom: 24px;
  267. border: 1px solid #f0f0f0;
  268. transition: all 0.3s ease;
  269. }
  270. .form-card:hover {
  271. box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  272. transform: translateY(-2px);
  273. }
  274. .card-header {
  275. padding: 20px 24px;
  276. border-bottom: 1px solid #f0f0f0;
  277. background: linear-gradient(to right, #f8f9ff, #ffffff);
  278. }
  279. .card-title {
  280. font-size: 16px;
  281. font-weight: 600;
  282. color: #2d3748;
  283. display: flex;
  284. align-items: center;
  285. gap: 10px;
  286. }
  287. .card-icon {
  288. font-size: 18px;
  289. }
  290. .card-body {
  291. padding: 24px;
  292. }
  293. /* 表单布局 */
  294. .form-grid {
  295. display: grid;
  296. grid-template-columns: repeat(2, 1fr);
  297. gap: 24px;
  298. }
  299. .form-row {
  300. margin-bottom: 24px;
  301. }
  302. .form-row:last-child {
  303. margin-bottom: 0;
  304. }
  305. .form-group {
  306. margin-bottom: 0;
  307. }
  308. .form-group.full-width {
  309. grid-column: 1 / -1;
  310. }
  311. .form-label {
  312. display: block;
  313. margin-bottom: 8px;
  314. font-weight: 500;
  315. color: #4a5568;
  316. font-size: 14px;
  317. }
  318. .form-label.required::after {
  319. content: '*';
  320. color: #ff4d4f;
  321. margin-left: 4px;
  322. }
  323. /* 表单控件样式 */
  324. .form-input, .form-select, .form-textarea {
  325. width: 100%;
  326. padding: 12px 16px;
  327. border: 2px solid #e2e8f0;
  328. border-radius: 8px;
  329. font-size: 14px;
  330. color: #2d3748;
  331. background: white;
  332. transition: all 0.3s ease;
  333. box-sizing: border-box;
  334. }
  335. .form-input:focus, .form-select:focus, .form-textarea:focus {
  336. outline: none;
  337. border-color: #4299e1;
  338. box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
  339. }
  340. .form-input:hover, .form-select:hover, .form-textarea:hover {
  341. border-color: #cbd5e0;
  342. }
  343. .form-textarea {
  344. resize: vertical;
  345. min-height: 80px;
  346. }
  347. .form-select {
  348. appearance: none;
  349. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  350. background-repeat: no-repeat;
  351. background-position: right 16px center;
  352. background-size: 12px;
  353. padding-right: 40px;
  354. }
  355. /* 按钮样式 */
  356. .modal-footer {
  357. padding: 24px 30px;
  358. background: #f8fafc;
  359. border-top: 1px solid #e2e8f0;
  360. display: flex;
  361. justify-content: flex-end;
  362. gap: 12px;
  363. }
  364. .btn {
  365. padding: 12px 28px;
  366. border-radius: 8px;
  367. font-size: 14px;
  368. font-weight: 500;
  369. border: none;
  370. cursor: pointer;
  371. transition: all 0.3s ease;
  372. display: inline-flex;
  373. align-items: center;
  374. justify-content: center;
  375. gap: 8px;
  376. min-width: 100px;
  377. }
  378. .btn:hover {
  379. transform: translateY(-1px);
  380. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  381. }
  382. .btn:active {
  383. transform: translateY(0);
  384. }
  385. .btn-secondary {
  386. background: white;
  387. color: #4a5568;
  388. border: 2px solid #e2e8f0;
  389. }
  390. .btn-secondary:hover {
  391. background: #f7fafc;
  392. border-color: #cbd5e0;
  393. }
  394. .btn-primary {
  395. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  396. color: white;
  397. }
  398. .btn-primary:hover {
  399. background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  400. box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  401. }
  402. .btn-icon {
  403. font-size: 16px;
  404. }
  405. /* 删除确认对话框样式 */
  406. .delete-confirm-modal {
  407. background: white;
  408. border-radius: 16px;
  409. padding: 40px;
  410. text-align: center;
  411. max-width: 400px;
  412. width: 90%;
  413. animation: slideUp 0.4s ease;
  414. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  415. }
  416. .delete-modal-content {
  417. display: flex;
  418. flex-direction: column;
  419. align-items: center;
  420. }
  421. .delete-icon {
  422. font-size: 48px;
  423. margin-bottom: 20px;
  424. color: #fc8181;
  425. }
  426. .delete-title {
  427. font-size: 24px;
  428. font-weight: 600;
  429. color: #2d3748;
  430. margin-bottom: 16px;
  431. }
  432. .delete-message {
  433. font-size: 16px;
  434. color: #4a5568;
  435. margin-bottom: 12px;
  436. line-height: 1.5;
  437. }
  438. .delete-customer-name {
  439. color: #667eea;
  440. font-weight: 600;
  441. }
  442. .delete-warning {
  443. font-size: 14px;
  444. color: #718096;
  445. margin-bottom: 24px;
  446. }
  447. .delete-actions {
  448. display: flex;
  449. gap: 12px;
  450. width: 100%;
  451. justify-content: center;
  452. }
  453. .btn-cancel {
  454. background: white;
  455. color: #4a5568;
  456. border: 2px solid #e2e8f0;
  457. padding: 12px 28px;
  458. border-radius: 8px;
  459. font-size: 14px;
  460. font-weight: 500;
  461. cursor: pointer;
  462. transition: all 0.3s ease;
  463. min-width: 100px;
  464. }
  465. .btn-cancel:hover {
  466. background: #f7fafc;
  467. border-color: #cbd5e0;
  468. }
  469. .btn-delete {
  470. background: linear-gradient(135deg, #f56565 0%, #ed64a6 100%);
  471. color: white;
  472. border: none;
  473. padding: 12px 28px;
  474. border-radius: 8px;
  475. font-size: 14px;
  476. font-weight: 500;
  477. cursor: pointer;
  478. transition: all 0.3s ease;
  479. min-width: 100px;
  480. }
  481. .btn-delete:hover {
  482. background: linear-gradient(135deg, #e53e3e 0%, #d53f8c 100%);
  483. box-shadow: 0 4px 20px rgba(245, 101, 101, 0.3);
  484. }
  485. /* 动画效果 */
  486. @@keyframes fadeIn {
  487. from {
  488. opacity: 0;
  489. }
  490. to {
  491. opacity: 1;
  492. }
  493. }
  494. @@keyframes slideUp {
  495. from {
  496. opacity: 0;
  497. transform: translateY(20px);
  498. }
  499. to {
  500. opacity: 1;
  501. transform: translateY(0);
  502. }
  503. }
  504. /* 响应式设计 */
  505. @@media (max-width: 850px) {
  506. .elegant-modal {
  507. width: 95% !important;
  508. margin: 20px;
  509. }
  510. .form-grid {
  511. grid-template-columns: 1fr;
  512. }
  513. }
  514. @@media (max-width: 600px) {
  515. .customer-management-container {
  516. padding: 12px;
  517. }
  518. .search-section,
  519. .table-section {
  520. padding: 16px;
  521. }
  522. .modal-header,
  523. .modal-body,
  524. .modal-footer {
  525. padding: 20px;
  526. }
  527. .form-grid {
  528. gap: 16px;
  529. }
  530. .card-body {
  531. padding: 16px;
  532. }
  533. .btn {
  534. padding: 10px 20px;
  535. min-width: 80px;
  536. }
  537. }
  538. /* 输入验证状态 */
  539. .form-input:invalid:not(:placeholder-shown),
  540. .form-select:invalid {
  541. border-color: #fc8181;
  542. }
  543. .form-input:valid:not(:placeholder-shown),
  544. .form-select:valid {
  545. border-color: #48bb78;
  546. }
  547. /* 表单分组间距优化 */
  548. .form-group + .form-group {
  549. margin-top: 0;
  550. }
  551. /* 添加一些细节装饰 */
  552. .form-card::before {
  553. content: '';
  554. position: absolute;
  555. top: 0;
  556. left: 0;
  557. right: 0;
  558. height: 3px;
  559. background: linear-gradient(90deg, #667eea, #764ba2);
  560. border-radius: 12px 12px 0 0;
  561. opacity: 0;
  562. transition: opacity 0.3s ease;
  563. }
  564. .form-card:hover::before {
  565. opacity: 1;
  566. }
  567. </style>