zkxw-mobile-empty-state-demo.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
  6. <title>中科兴皖 · 空态 Empty State UI Demo</title>
  7. <style>
  8. :root {
  9. --brand-green: #0a9f6d;
  10. --brand-green-dark: #087f57;
  11. --brand-green-soft: #e9f9f2;
  12. --barley-yellow: #d6a343;
  13. --barley-yellow-soft: #fff7e8;
  14. --bg-page: #f5f8f7;
  15. --surface: #ffffff;
  16. --text-primary: #1f2a26;
  17. --text-muted: #6b7b74;
  18. --border: #dcebe4;
  19. --shadow-soft: 0 4px 16px rgba(8, 127, 87, 0.08);
  20. }
  21. * { box-sizing: border-box; }
  22. html, body {
  23. margin: 0;
  24. padding: 0;
  25. min-height: 100%;
  26. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  27. color: var(--text-primary);
  28. background:
  29. radial-gradient(900px 420px at 10% -10%, rgba(10, 159, 109, 0.14), transparent 55%),
  30. radial-gradient(700px 380px at 90% 0%, rgba(214, 163, 67, 0.12), transparent 50%),
  31. linear-gradient(180deg, #eef6f2 0%, #f7faf9 40%, #f3f6f5 100%);
  32. }
  33. body { padding: 24px 16px 48px; }
  34. .page { max-width: 1180px; margin: 0 auto; }
  35. .hero {
  36. background: rgba(255, 255, 255, 0.92);
  37. border: 1px solid var(--border);
  38. border-radius: 18px;
  39. padding: 22px 22px 18px;
  40. box-shadow: var(--shadow-soft);
  41. margin-bottom: 20px;
  42. }
  43. .hero h1 {
  44. margin: 0 0 6px;
  45. font-size: 22px;
  46. color: var(--brand-green-dark);
  47. }
  48. .hero .sub {
  49. margin: 0;
  50. font-size: 13px;
  51. color: var(--text-muted);
  52. line-height: 1.55;
  53. max-width: 720px;
  54. }
  55. .grid {
  56. display: grid;
  57. grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  58. gap: 16px;
  59. }
  60. .card {
  61. background: #fff;
  62. border: 1px solid var(--border);
  63. border-radius: 18px;
  64. overflow: hidden;
  65. box-shadow: var(--shadow-soft);
  66. }
  67. .card-label {
  68. display: flex;
  69. align-items: center;
  70. gap: 8px;
  71. padding: 12px 14px;
  72. border-bottom: 1px solid #eef3f1;
  73. background: #fafcfb;
  74. }
  75. .badge {
  76. width: 24px; height: 24px; border-radius: 7px;
  77. background: var(--brand-green-soft);
  78. color: var(--brand-green-dark);
  79. font-size: 12px; font-weight: 700;
  80. display: inline-flex; align-items: center; justify-content: center;
  81. }
  82. .card-label h3 { margin: 0; font-size: 14px; }
  83. .card-label p { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
  84. .phone {
  85. background: var(--bg-page);
  86. padding: 14px;
  87. min-height: 260px;
  88. }
  89. .phone-header {
  90. background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
  91. color: #fff;
  92. border-radius: 14px 14px 18px 18px;
  93. padding: 12px 14px 16px;
  94. margin: -14px -14px 12px;
  95. }
  96. .phone-header .brand { font-size: 11px; opacity: .9; }
  97. .phone-header .hello { font-size: 15px; font-weight: 600; margin-top: 4px; }
  98. .panel {
  99. background: #fff;
  100. border-radius: 14px;
  101. border: 1px solid var(--border);
  102. padding: 12px;
  103. }
  104. .panel-hd {
  105. display: flex; justify-content: space-between; align-items: center;
  106. margin-bottom: 6px;
  107. }
  108. .panel-hd .t { font-size: 13px; font-weight: 600; }
  109. .panel-hd .h { font-size: 11px; color: var(--text-muted); }
  110. .card-foot {
  111. padding: 12px 14px 14px;
  112. font-size: 12px;
  113. color: var(--text-muted);
  114. line-height: 1.5;
  115. border-top: 1px solid #eef3f1;
  116. }
  117. /* A */
  118. .empty-a {
  119. display: flex; flex-direction: column; align-items: center; justify-content: center;
  120. padding: 36px 12px; gap: 8px;
  121. }
  122. .empty-a .ico { font-size: 36px; color: #b7c7bf; line-height: 1; }
  123. .empty-a .txt { font-size: 13px; color: var(--text-muted); }
  124. /* B */
  125. .empty-b {
  126. border-radius: 14px;
  127. background: linear-gradient(165deg, #eef9f3 0%, #ffffff 55%);
  128. border: 1.5px dashed #b7e5d0;
  129. padding: 28px 14px 22px;
  130. display: flex; flex-direction: column; align-items: center; justify-content: center;
  131. gap: 8px;
  132. box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  133. }
  134. .empty-b .blob {
  135. width: 72px; height: 72px; border-radius: 50%;
  136. background: radial-gradient(circle at 35% 30%, #fff, #d8f3e7 70%);
  137. display: flex; align-items: center; justify-content: center;
  138. }
  139. .empty-b .blob svg { width: 30px; height: 30px; }
  140. .empty-b .txt { font-size: 13px; color: #5d746a; }
  141. .empty-b .tip { font-size: 11px; color: #8aa198; text-align: center; line-height: 1.4; }
  142. /* C */
  143. .empty-c {
  144. display: flex; flex-direction: column; align-items: center; justify-content: center;
  145. padding: 40px 12px; gap: 12px;
  146. }
  147. .empty-c .ico-wrap {
  148. width: 56px; height: 56px; border-radius: 16px;
  149. background: var(--brand-green-soft);
  150. display: flex; align-items: center; justify-content: center;
  151. }
  152. .empty-c .ico-wrap svg { width: 26px; height: 26px; }
  153. .empty-c .txt { font-size: 13px; color: var(--text-muted); font-weight: 500; }
  154. /* D */
  155. .empty-d {
  156. display: flex; flex-direction: column; align-items: center; justify-content: center;
  157. padding: 32px 12px; gap: 10px;
  158. }
  159. .empty-d .ring {
  160. width: 72px; height: 72px; border-radius: 50%;
  161. background: var(--barley-yellow-soft);
  162. border: 2px solid #f0d9a8;
  163. display: flex; align-items: center; justify-content: center;
  164. }
  165. .empty-d .ring svg { width: 30px; height: 30px; }
  166. .empty-d .txt { font-size: 13px; color: var(--text-primary); font-weight: 500; }
  167. .empty-d .tip { font-size: 11px; color: var(--text-muted); }
  168. /* E */
  169. .empty-e {
  170. display: flex; align-items: center; justify-content: center; gap: 12px;
  171. padding: 40px 12px;
  172. }
  173. .empty-e .dot {
  174. width: 40px; height: 40px; border-radius: 12px;
  175. background: var(--brand-green-soft);
  176. display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  177. }
  178. .empty-e .dot svg { width: 20px; height: 20px; }
  179. .empty-e .col { display: flex; flex-direction: column; gap: 2px; }
  180. .empty-e .txt { font-size: 13px; color: var(--text-primary); font-weight: 500; }
  181. .empty-e .tip { font-size: 11px; color: var(--text-muted); }
  182. .note {
  183. margin-top: 20px;
  184. padding: 14px 16px;
  185. background: rgba(255,255,255,.9);
  186. border: 1px solid var(--border);
  187. border-radius: 14px;
  188. font-size: 13px;
  189. color: var(--text-muted);
  190. line-height: 1.55;
  191. }
  192. .note strong { color: var(--brand-green-dark); }
  193. </style>
  194. </head>
  195. <body>
  196. <div class="page">
  197. <div class="hero">
  198. <h1>空态 Empty State · 方案对比</h1>
  199. <p class="sub">对齐三墙 Token(品牌绿 #0a9f6d)。选定后将统一到 <code>mobile-h5/components/van-empty</code>,主页 / 列表 / 组件演示页共用。</p>
  200. </div>
  201. <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
  202. <symbol id="i-inbox" viewBox="0 0 24 24" fill="none" stroke="#0a9f6d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  203. <polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/>
  204. <path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>
  205. </symbol>
  206. <symbol id="i-folder" viewBox="0 0 24 24" fill="none" stroke="#0a9f6d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  207. <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
  208. </symbol>
  209. <symbol id="i-box" viewBox="0 0 24 24" fill="none" stroke="#d6a343" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  210. <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>
  211. <polyline points="3.27 6.96 12 12.01 20.73 6.96"/>
  212. <line x1="12" y1="22.08" x2="12" y2="12"/>
  213. </symbol>
  214. <symbol id="i-search" viewBox="0 0 24 24" fill="none" stroke="#0a9f6d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  215. <circle cx="11" cy="11" r="7"/>
  216. <line x1="21" y1="21" x2="16.65" y2="16.65"/>
  217. </symbol>
  218. </svg>
  219. <div class="grid">
  220. <!-- A -->
  221. <article class="card">
  222. <div class="card-label">
  223. <span class="badge">A</span>
  224. <div>
  225. <h3>现状 · 符号空态</h3>
  226. <p>当前 ∅ 实现</p>
  227. </div>
  228. </div>
  229. <div class="phone">
  230. <div class="phone-header">
  231. <div class="brand">中科兴皖 · 移动工作台</div>
  232. <div class="hello">功能菜单</div>
  233. </div>
  234. <div class="panel">
  235. <div class="panel-hd"><span class="t">功能菜单</span><span class="h">共 0 项</span></div>
  236. <div class="empty-a">
  237. <div class="ico">∅</div>
  238. <div class="txt">暂无可用菜单权限</div>
  239. </div>
  240. </div>
  241. </div>
  242. <div class="card-foot">简洁但偏弱,辨识度一般,不建议作为全局定稿。</div>
  243. </article>
  244. <!-- B -->
  245. <article class="card">
  246. <div class="card-label">
  247. <span class="badge">B</span>
  248. <div>
  249. <h3>虚线软卡 · 推荐</h3>
  250. <p>对齐 vant Demo 组件区</p>
  251. </div>
  252. </div>
  253. <div class="phone">
  254. <div class="phone-header">
  255. <div class="brand">中科兴皖 · 移动工作台</div>
  256. <div class="hello">功能菜单</div>
  257. </div>
  258. <div class="panel">
  259. <div class="panel-hd"><span class="t">功能菜单</span><span class="h">共 0 项</span></div>
  260. <div class="empty-b">
  261. <div class="blob"><svg><use href="#i-inbox"/></svg></div>
  262. <div class="txt">暂无可用菜单权限</div>
  263. <div class="tip">请联系管理员开通功能入口</div>
  264. </div>
  265. </div>
  266. </div>
  267. <div class="card-foot">薄荷绿渐变虚线框 + 圆形插画 + 主副文案,适合作为全局默认空态。</div>
  268. </article>
  269. <!-- C -->
  270. <article class="card">
  271. <div class="card-label">
  272. <span class="badge">C</span>
  273. <div>
  274. <h3>极简徽章</h3>
  275. <p>圆角图标底板</p>
  276. </div>
  277. </div>
  278. <div class="phone">
  279. <div class="phone-header">
  280. <div class="brand">中科兴皖 · 移动工作台</div>
  281. <div class="hello">功能菜单</div>
  282. </div>
  283. <div class="panel">
  284. <div class="panel-hd"><span class="t">功能菜单</span><span class="h">共 0 项</span></div>
  285. <div class="empty-c">
  286. <div class="ico-wrap"><svg><use href="#i-folder"/></svg></div>
  287. <div class="txt">暂无可用菜单权限</div>
  288. </div>
  289. </div>
  290. </div>
  291. <div class="card-foot">留白多、视觉轻;适合卡片内嵌,副文案可选。</div>
  292. </article>
  293. <!-- D -->
  294. <article class="card">
  295. <div class="card-label">
  296. <span class="badge">D</span>
  297. <div>
  298. <h3>大麦黄点缀</h3>
  299. <p>辅助色圆环</p>
  300. </div>
  301. </div>
  302. <div class="phone">
  303. <div class="phone-header">
  304. <div class="brand">中科兴皖 · 移动工作台</div>
  305. <div class="hello">功能菜单</div>
  306. </div>
  307. <div class="panel">
  308. <div class="panel-hd"><span class="t">功能菜单</span><span class="h">共 0 项</span></div>
  309. <div class="empty-d">
  310. <div class="ring"><svg><use href="#i-box"/></svg></div>
  311. <div class="txt">暂无可用菜单权限</div>
  312. <div class="tip">当前角色暂无功能入口</div>
  313. </div>
  314. </div>
  315. </div>
  316. <div class="card-foot">更醒目,适合「权限不足 / 需关注」类提示;日常空列表可能略抢眼。</div>
  317. </article>
  318. <!-- E -->
  319. <article class="card">
  320. <div class="card-label">
  321. <span class="badge">E</span>
  322. <div>
  323. <h3>横向紧凑</h3>
  324. <p>列表矮空态变体</p>
  325. </div>
  326. </div>
  327. <div class="phone">
  328. <div class="phone-header">
  329. <div class="brand">中科兴皖 · 移动工作台</div>
  330. <div class="hello">待办列表</div>
  331. </div>
  332. <div class="panel">
  333. <div class="panel-hd"><span class="t">待办列表</span><span class="h">0 条</span></div>
  334. <div class="empty-e">
  335. <div class="dot"><svg><use href="#i-search"/></svg></div>
  336. <div class="col">
  337. <div class="txt">暂无数据</div>
  338. <div class="tip">可下拉刷新或调整筛选条件</div>
  339. </div>
  340. </div>
  341. </div>
  342. </div>
  343. <div class="card-foot">图标与文案横排,适合列表矮区域;可与 B/C 主样式通过 layout 属性切换。</div>
  344. </article>
  345. </div>
  346. <div class="note">
  347. <strong>建议:</strong>全局默认选 <strong>B</strong> 或 <strong>C</strong>;列表矮场景可加 <strong>E</strong> 作为变体。
  348. 选定后改 <code>van-empty</code> 一处,主页 / demo 列表 / 组件页自动一致。
  349. </div>
  350. </div>
  351. </body>
  352. </html>