zkxw-mobile-oa-manage-capsule-safe-demo.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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, maximum-scale=1" />
  6. <title>OA 列表 ·「管理」避开微信胶囊 Demo</title>
  7. <style>
  8. :root {
  9. --brand: #0a9f6d;
  10. --brand-dark: #087f57;
  11. --brand-soft: #e9f9f2;
  12. --warn: #d97706;
  13. --warn-soft: #fff7e8;
  14. --danger: #ef4444;
  15. --nav-bg: #ecfdf5;
  16. --page-bg: #f5f8f7;
  17. --text: #1f2a26;
  18. --text-muted: #6b7b74;
  19. --border: #e8eaed;
  20. --capsule-w: 87px;
  21. --capsule-h: 32px;
  22. --capsule-right: 7px;
  23. --capsule-gap: 8px;
  24. }
  25. * { box-sizing: border-box; }
  26. body {
  27. margin: 0;
  28. font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, system-ui, sans-serif;
  29. color: var(--text);
  30. background:
  31. radial-gradient(900px 420px at 8% -8%, rgba(10, 159, 109, 0.12), transparent 55%),
  32. linear-gradient(180deg, #f8fffc 0%, #f4f7fb 50%, #f7f8fa 100%);
  33. line-height: 1.45;
  34. }
  35. .stage { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
  36. .hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 720; }
  37. .hero p { margin: 0; color: #64748b; font-size: 14px; max-width: 880px; }
  38. .rec {
  39. margin: 16px 0 0;
  40. padding: 14px 16px;
  41. border-radius: 14px;
  42. background: var(--brand-soft);
  43. border: 1px solid #b7ebd4;
  44. font-size: 13px;
  45. color: #166534;
  46. line-height: 1.55;
  47. }
  48. .rec b { color: var(--brand-dark); }
  49. .tabs {
  50. display: flex; flex-wrap: wrap; gap: 10px;
  51. margin: 20px 0 18px;
  52. }
  53. .tab {
  54. appearance: none; border: 1px solid #e2e8f0; background: #fff;
  55. border-radius: 999px; padding: 10px 16px; font-size: 13px;
  56. font-weight: 600; color: #475569; cursor: pointer;
  57. }
  58. .tab.is-active {
  59. color: var(--brand-dark); border-color: var(--brand);
  60. background: var(--brand-soft);
  61. box-shadow: 0 0 0 3px rgba(10, 159, 109, 0.16);
  62. }
  63. .tab .badge {
  64. margin-left: 6px; font-size: 11px; font-weight: 700;
  65. color: var(--brand-dark); background: #d1fae5;
  66. border-radius: 999px; padding: 2px 7px;
  67. }
  68. .tab .badge.warn {
  69. color: #92400e; background: #fef3c7;
  70. }
  71. .layout {
  72. display: grid;
  73. grid-template-columns: minmax(240px, 320px) 1fr;
  74. gap: 20px; align-items: start;
  75. }
  76. @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
  77. .panel {
  78. background: rgba(255,255,255,.94);
  79. border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px;
  80. box-shadow: 0 10px 28px rgba(15,23,42,.05);
  81. }
  82. .panel h2 { margin: 0 0 4px; font-size: 15px; }
  83. .panel .sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
  84. .panel ul { margin: 0; padding-left: 18px; font-size: 13px; color: #475569; }
  85. .panel li { margin: 6px 0; }
  86. .panel .pick {
  87. margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  88. background: #fff7e8; border: 1px solid #fde68a;
  89. font-size: 12px; color: #92400e;
  90. }
  91. .panel .ok {
  92. margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  93. background: #ecfdf5; border: 1px solid #a7f3d0;
  94. font-size: 12px; color: #047857;
  95. }
  96. .panel .bad {
  97. margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  98. background: #fef2f2; border: 1px solid #fecaca;
  99. font-size: 12px; color: #b91c1c;
  100. }
  101. .phones { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
  102. .phone {
  103. width: 375px; background: #fff; border-radius: 28px; overflow: hidden;
  104. box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 18px 40px rgb(15 23 42 / 12%);
  105. position: relative;
  106. }
  107. .cap {
  108. text-align: center; font-size: 11px; font-weight: 650; color: #64748b;
  109. padding: 8px; background: #f8fafc; border-bottom: 1px solid #eef2f0;
  110. }
  111. /* 模拟系统状态栏 + 自定义导航 */
  112. .sys-bar {
  113. height: 44px;
  114. background: var(--nav-bg);
  115. display: flex;
  116. align-items: flex-end;
  117. justify-content: space-between;
  118. padding: 0 16px 6px;
  119. font-size: 12px;
  120. font-weight: 650;
  121. color: #0f291e;
  122. position: relative;
  123. }
  124. .sys-bar__time { font-variant-numeric: tabular-nums; }
  125. .sys-bar__icons { opacity: 0.75; letter-spacing: 2px; font-size: 11px; }
  126. .nav-wrap {
  127. background: var(--nav-bg);
  128. border-bottom: 1px solid #d8f3e5;
  129. position: relative;
  130. }
  131. .nav {
  132. height: 44px;
  133. display: flex;
  134. align-items: center;
  135. padding: 0 8px 0 4px;
  136. position: relative;
  137. }
  138. .nav.is-capsule-safe {
  139. padding-right: calc(var(--capsule-w) + var(--capsule-right) + var(--capsule-gap));
  140. }
  141. .nav-back {
  142. width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  143. color: #0f291e; flex-shrink: 0;
  144. }
  145. .nav-back::before {
  146. content: ""; width: 10px; height: 10px;
  147. border-left: 2px solid #0f291e; border-bottom: 2px solid #0f291e;
  148. transform: rotate(45deg); margin-left: 4px;
  149. }
  150. .nav-title {
  151. position: absolute; left: 50%; transform: translateX(-50%);
  152. font-size: 16px; font-weight: 650; color: #0f291e;
  153. white-space: nowrap;
  154. }
  155. .nav-action {
  156. margin-left: auto;
  157. min-width: 48px;
  158. height: 36px;
  159. display: flex; align-items: center; justify-content: center;
  160. padding: 0 8px;
  161. font-size: 14px; font-weight: 650; color: #166534;
  162. cursor: pointer; user-select: none;
  163. position: relative; z-index: 2;
  164. }
  165. .nav-action.is-done { color: #64748b; }
  166. .nav-action.is-hit {
  167. outline: 2px solid var(--danger);
  168. outline-offset: 1px;
  169. border-radius: 6px;
  170. background: rgba(239, 68, 68, 0.08);
  171. }
  172. .nav-action.is-safe {
  173. outline: 2px solid var(--brand);
  174. outline-offset: 1px;
  175. border-radius: 6px;
  176. background: rgba(10, 159, 109, 0.08);
  177. }
  178. /* 微信右上角胶囊(模拟) */
  179. .wx-capsule {
  180. position: absolute;
  181. top: 6px;
  182. right: var(--capsule-right);
  183. width: var(--capsule-w);
  184. height: var(--capsule-h);
  185. border-radius: 16px;
  186. background: rgba(255, 255, 255, 0.92);
  187. border: 1px solid rgba(0, 0, 0, 0.12);
  188. box-shadow: 0 1px 2px rgba(0,0,0,.04);
  189. display: flex;
  190. align-items: center;
  191. z-index: 50;
  192. pointer-events: none;
  193. overflow: hidden;
  194. }
  195. .wx-capsule__dots,
  196. .wx-capsule__close {
  197. flex: 1;
  198. height: 100%;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. color: #111;
  203. font-size: 13px;
  204. font-weight: 700;
  205. }
  206. .wx-capsule__dots { gap: 3px; }
  207. .wx-capsule__dots span {
  208. width: 4px; height: 4px; border-radius: 50%; background: #111;
  209. }
  210. .wx-capsule__divider {
  211. width: 1px; height: 18px; background: rgba(0,0,0,.12);
  212. }
  213. .wx-capsule__close { font-size: 15px; line-height: 1; }
  214. .wx-capsule.is-warn {
  215. box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
  216. }
  217. .wx-capsule.is-ok {
  218. box-shadow: 0 0 0 2px rgba(10, 159, 109, 0.35);
  219. }
  220. .hit-label {
  221. position: absolute;
  222. top: 46px;
  223. right: 10px;
  224. z-index: 40;
  225. font-size: 10px;
  226. font-weight: 700;
  227. padding: 3px 8px;
  228. border-radius: 999px;
  229. background: #fee2e2;
  230. color: #b91c1c;
  231. border: 1px solid #fecaca;
  232. }
  233. .safe-label {
  234. position: absolute;
  235. top: 46px;
  236. right: 10px;
  237. z-index: 40;
  238. font-size: 10px;
  239. font-weight: 700;
  240. padding: 3px 8px;
  241. border-radius: 999px;
  242. background: #d1fae5;
  243. color: #047857;
  244. border: 1px solid #a7f3d0;
  245. }
  246. .toolbar {
  247. background: #fff;
  248. padding: 8px 12px;
  249. border-bottom: 1px solid var(--border);
  250. }
  251. .search {
  252. height: 36px;
  253. border-radius: 10px;
  254. border: 1px solid #e8eaed;
  255. background: #fafafa;
  256. display: flex;
  257. align-items: center;
  258. padding: 0 12px;
  259. gap: 8px;
  260. color: #94a3b8;
  261. font-size: 13px;
  262. }
  263. .search::before {
  264. content: "";
  265. width: 14px; height: 14px;
  266. border: 2px solid #94a3b8;
  267. border-radius: 50%;
  268. box-sizing: border-box;
  269. position: relative;
  270. }
  271. .toolbar-row {
  272. display: flex;
  273. align-items: center;
  274. gap: 8px;
  275. }
  276. .toolbar-row .search { flex: 1; }
  277. .manage-chip {
  278. flex-shrink: 0;
  279. height: 36px;
  280. padding: 0 12px;
  281. border-radius: 10px;
  282. border: 1px solid #a7f3d0;
  283. background: #ecfdf5;
  284. color: #166534;
  285. font-size: 13px;
  286. font-weight: 650;
  287. display: flex;
  288. align-items: center;
  289. cursor: pointer;
  290. }
  291. .manage-chip.is-done {
  292. border-color: #e2e8f0;
  293. background: #f8fafc;
  294. color: #64748b;
  295. }
  296. .list-head {
  297. display: flex;
  298. align-items: center;
  299. justify-content: space-between;
  300. padding: 10px 14px 6px;
  301. background: var(--page-bg);
  302. }
  303. .list-head__count {
  304. font-size: 12px;
  305. color: var(--text-muted);
  306. }
  307. .list-head__count strong { color: var(--text); font-weight: 700; }
  308. .list-head__link {
  309. font-size: 13px;
  310. font-weight: 650;
  311. color: #166534;
  312. cursor: pointer;
  313. padding: 4px 2px;
  314. }
  315. .list-head__link.is-done { color: #64748b; }
  316. .list-head__link.is-safe {
  317. outline: 2px solid var(--brand);
  318. outline-offset: 2px;
  319. border-radius: 6px;
  320. background: rgba(10, 159, 109, 0.08);
  321. }
  322. .list {
  323. background: var(--page-bg);
  324. padding: 8px 12px 20px;
  325. min-height: 320px;
  326. }
  327. .card {
  328. background: #fff;
  329. border-radius: 14px;
  330. border: 1px solid #eef2f0;
  331. padding: 12px 14px;
  332. margin-bottom: 10px;
  333. box-shadow: 0 4px 12px rgba(15,23,42,.04);
  334. }
  335. .card__title {
  336. font-size: 14px; font-weight: 650; color: #0f291e;
  337. margin-bottom: 6px;
  338. }
  339. .card__meta { font-size: 12px; color: var(--text-muted); }
  340. .card.is-manage {
  341. display: flex; align-items: center; gap: 10px;
  342. }
  343. .check {
  344. width: 20px; height: 20px; border-radius: 50%;
  345. border: 2px solid #cbd5e1; flex-shrink: 0;
  346. }
  347. .check.on {
  348. border-color: var(--brand);
  349. background: var(--brand);
  350. box-shadow: inset 0 0 0 3px #fff;
  351. }
  352. .card__body { flex: 1; min-width: 0; }
  353. .legend {
  354. margin-top: 16px;
  355. display: flex; flex-wrap: wrap; gap: 10px;
  356. font-size: 12px; color: #64748b;
  357. }
  358. .legend span {
  359. display: inline-flex; align-items: center; gap: 6px;
  360. padding: 6px 10px; border-radius: 8px; background: #fff;
  361. border: 1px solid #e2e8f0;
  362. }
  363. .dot {
  364. width: 10px; height: 10px; border-radius: 50%;
  365. }
  366. .dot.hit { background: #ef4444; }
  367. .dot.ok { background: #0a9f6d; }
  368. .dot.cap { background: #94a3b8; border: 1px solid #64748b; }
  369. .note {
  370. margin-top: 18px;
  371. font-size: 12px;
  372. color: #64748b;
  373. max-width: 880px;
  374. }
  375. code {
  376. font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  377. font-size: 11px;
  378. background: #f1f5f9;
  379. padding: 1px 5px;
  380. border-radius: 4px;
  381. }
  382. </style>
  383. </head>
  384. <body>
  385. <div class="stage">
  386. <div class="hero">
  387. <h1>OA 列表 ·「管理」避开微信小程序胶囊</h1>
  388. <p>
  389. 影响页面:自定义导航的 <b>草稿箱 / 待办中心 / 抄送我的</b>
  390. (已办中心、我发起的目前用系统导航且无「管理」)。
  391. 右上角模拟微信「··· / 关闭」胶囊;红框=被遮挡,绿框=可点区域安全。
  392. </p>
  393. <div class="rec">
  394. <b>建议:</b>优先选 <b>A · 顶栏保留「管理」+ 按胶囊宽度留白</b>
  395. (改动最小,交互习惯不变)。若希望管理与列表语义更近,可选
  396. <b>B · 列表头「共 N 条 | 管理」</b>。
  397. </div>
  398. </div>
  399. <div class="tabs" id="tabs">
  400. <button type="button" class="tab is-active" data-k="now">① 现状·被遮挡<span class="badge warn">问题</span></button>
  401. <button type="button" class="tab" data-k="a">② A · 顶栏留白<span class="badge">推荐</span></button>
  402. <button type="button" class="tab" data-k="b">③ B · 列表头管理</button>
  403. <button type="button" class="tab" data-k="c">④ C · 搜索旁胶囊</button>
  404. </div>
  405. <div class="layout">
  406. <aside class="panel" id="info">
  407. <h2>—</h2>
  408. <p class="sub">—</p>
  409. <ul></ul>
  410. <div class="pick" hidden></div>
  411. <div class="ok" hidden></div>
  412. <div class="bad" hidden></div>
  413. </aside>
  414. <div>
  415. <div class="phones" id="phones"></div>
  416. <div class="legend">
  417. <span><i class="dot cap"></i>微信胶囊(不可覆盖)</span>
  418. <span><i class="dot hit"></i>「管理」与胶囊冲突</span>
  419. <span><i class="dot ok"></i>「管理」可安全点击</span>
  420. </div>
  421. </div>
  422. </div>
  423. <p class="note">
  424. 实现提示:方案 A 用 <code>uni.getMenuButtonBoundingClientRect()</code>
  425. (或微信 <code>wx.getMenuButtonBoundingClientRect</code>)取胶囊
  426. <code>width / left / right</code>,给 <code>.nav__inner</code> 增加
  427. <code>padding-right</code>,把「管理」推到胶囊左侧并留约 8px 间隙。
  428. 非微信环境可回退为固定约 96px 右内边距。
  429. </p>
  430. </div>
  431. <script>
  432. var SCENES = {
  433. now: {
  434. title: "① 现状 · 顶栏右侧「管理」被胶囊遮住",
  435. sub: "自定义 navigationStyle,仅处理了 statusBar,未避开胶囊。",
  436. items: [
  437. "「管理」贴在导航栏最右侧(margin-left: auto)",
  438. "微信胶囊叠在同一垂直带上,文字被挡住、难以点击",
  439. "草稿箱 / 待办 / 抄送三页结构相同"
  440. ],
  441. bad: "不要继续这样落地:真机上关闭区会盖住「管理」。",
  442. phoneCap: "现状 · 冲突",
  443. mode: "now"
  444. },
  445. a: {
  446. title: "② A · 顶栏保留「管理」+ 胶囊安全留白(推荐)",
  447. sub: "仍在标题栏右侧,但右侧 padding 避开胶囊宽度。",
  448. items: [
  449. "交互位置不变:用户仍在顶栏找「管理 / 完成」",
  450. "用 menuButtonBoundingClientRect 动态算右侧安全区",
  451. "改动集中在公共顶栏样式 / 工具函数,三页可复用",
  452. "标题仍居中,不会挤到胶囊上"
  453. ],
  454. ok: "推荐:最小改动、符合现有 Demo 约定(顶栏管理)。",
  455. phoneCap: "方案 A · 顶栏留白",
  456. mode: "a"
  457. },
  458. b: {
  459. title: "③ B · 列表头「共 N 条 | 管理」",
  460. sub: "顶栏只留返回+标题;管理下移到搜索下方次级行。",
  461. items: [
  462. "彻底避开胶囊,无需计算胶囊宽度",
  463. "管理与列表批量操作语义更近(对齐早期美化 Demo S1)",
  464. "顶栏更干净,但入口位置相对现状下移",
  465. "三页需改模板结构(多一行 list-head)"
  466. ],
  467. pick: "想弱化顶栏操作、强调列表批量时选 B。",
  468. phoneCap: "方案 B · 列表头",
  469. mode: "b"
  470. },
  471. c: {
  472. title: "④ C · 搜索框右侧胶囊按钮",
  473. sub: "顶栏无「管理」;与搜索同排的描边小按钮。",
  474. items: [
  475. "同样避开胶囊,实现简单",
  476. "搜索区会变窄,长 placeholder 更易截断",
  477. "早期 Demo 曾认为「挤在搜索旁偏突兀」"
  478. ],
  479. pick: "仅作备选;一般不如 A / B。",
  480. phoneCap: "方案 C · 搜索旁",
  481. mode: "c"
  482. }
  483. }
  484. var cards = [
  485. { title: "差旅报销申请", meta: "张三 · 技术中心 · 2 小时前" },
  486. { title: "采购合同审批", meta: "李四 · 采购部 · 昨天" },
  487. { title: "请假申请", meta: "王五 · 行政 · 周一" }
  488. ]
  489. function wxCapsule(extraClass) {
  490. return (
  491. '<div class="wx-capsule ' + (extraClass || "") + '" aria-hidden="true">' +
  492. '<div class="wx-capsule__dots"><span></span><span></span><span></span></div>' +
  493. '<div class="wx-capsule__divider"></div>' +
  494. '<div class="wx-capsule__close">✕</div>' +
  495. '</div>'
  496. )
  497. }
  498. function cardHtml(manage) {
  499. return cards.map(function (c, i) {
  500. if (!manage) {
  501. return (
  502. '<div class="card">' +
  503. '<div class="card__title">' + c.title + '</div>' +
  504. '<div class="card__meta">' + c.meta + '</div>' +
  505. '</div>'
  506. )
  507. }
  508. return (
  509. '<div class="card is-manage">' +
  510. '<div class="check' + (i === 0 ? ' on' : '') + '"></div>' +
  511. '<div class="card__body">' +
  512. '<div class="card__title">' + c.title + '</div>' +
  513. '<div class="card__meta">' + c.meta + '</div>' +
  514. '</div>' +
  515. '</div>'
  516. )
  517. }).join("")
  518. }
  519. function phoneShell(label, bodyInner, flag) {
  520. var labelHtml = ""
  521. if (flag === "hit") labelHtml = '<div class="hit-label">被胶囊遮挡</div>'
  522. if (flag === "safe") labelHtml = '<div class="safe-label">可安全点击</div>'
  523. return (
  524. '<div class="phone">' +
  525. '<div class="cap">' + label + '</div>' +
  526. '<div class="sys-bar">' +
  527. '<span class="sys-bar__time">9:41</span>' +
  528. '<span class="sys-bar__icons">▮▮▮ ░</span>' +
  529. '</div>' +
  530. '<div class="nav-wrap">' +
  531. bodyInner +
  532. (flag === "hit" ? wxCapsule("is-warn") : wxCapsule("is-ok")) +
  533. labelHtml +
  534. '</div>' +
  535. '</div>'
  536. )
  537. }
  538. function setInfo(key) {
  539. var s = SCENES[key]
  540. var info = document.getElementById("info")
  541. info.querySelector("h2").textContent = s.title
  542. info.querySelector(".sub").textContent = s.sub
  543. info.querySelector("ul").innerHTML = s.items
  544. .map(function (t) { return "<li>" + t + "</li>" })
  545. .join("")
  546. ;["pick", "ok", "bad"].forEach(function (cls) {
  547. var el = info.querySelector("." + cls)
  548. if (s[cls]) {
  549. el.hidden = false
  550. el.textContent = s[cls]
  551. } else {
  552. el.hidden = true
  553. el.textContent = ""
  554. }
  555. })
  556. }
  557. function buildPhone(mode, manage) {
  558. var actionText = manage ? "完成" : "管理"
  559. var actionCls = manage ? "nav-action is-done" : "nav-action"
  560. var list = '<div class="list">' + cardHtml(manage) + "</div>"
  561. var inner = ""
  562. var flag = "safe"
  563. var label = ""
  564. if (mode === "now") {
  565. flag = "hit"
  566. label = manage ? "现状 · 管理态(冲突)" : "现状 · 普通态(冲突)"
  567. inner =
  568. '<div class="nav">' +
  569. '<div class="nav-back"></div>' +
  570. '<div class="nav-title">待办中心</div>' +
  571. '<div class="' + actionCls + ' is-hit">' + actionText + "</div>" +
  572. "</div>" +
  573. '<div class="toolbar"><div class="search">搜索流程名称、申请人</div></div>' +
  574. list
  575. } else if (mode === "a") {
  576. label = manage ? "A · 管理态" : "A · 普通态"
  577. inner =
  578. '<div class="nav is-capsule-safe">' +
  579. '<div class="nav-back"></div>' +
  580. '<div class="nav-title">待办中心</div>' +
  581. '<div class="' + actionCls + ' is-safe">' + actionText + "</div>" +
  582. "</div>" +
  583. '<div class="toolbar"><div class="search">搜索流程名称、申请人</div></div>' +
  584. list
  585. } else if (mode === "b") {
  586. label = manage ? "B · 管理态" : "B · 普通态"
  587. var linkCls = manage
  588. ? "list-head__link is-done is-safe"
  589. : "list-head__link is-safe"
  590. inner =
  591. '<div class="nav">' +
  592. '<div class="nav-back"></div>' +
  593. '<div class="nav-title">待办中心</div>' +
  594. "</div>" +
  595. '<div class="toolbar"><div class="search">搜索流程名称、申请人</div></div>' +
  596. '<div class="list-head">' +
  597. '<div class="list-head__count">共 <strong>3</strong> 条</div>' +
  598. '<div class="' + linkCls + '">' + actionText + "</div>" +
  599. "</div>" +
  600. list
  601. } else {
  602. label = manage ? "C · 管理态" : "C · 普通态"
  603. var chipCls = manage ? "manage-chip is-done" : "manage-chip"
  604. inner =
  605. '<div class="nav">' +
  606. '<div class="nav-back"></div>' +
  607. '<div class="nav-title">待办中心</div>' +
  608. "</div>" +
  609. '<div class="toolbar">' +
  610. '<div class="toolbar-row">' +
  611. '<div class="search">搜索流程名称、申请人</div>' +
  612. '<div class="' + chipCls + '">' + actionText + "</div>" +
  613. "</div>" +
  614. "</div>" +
  615. list
  616. }
  617. return phoneShell(label, inner, flag)
  618. }
  619. function render(key) {
  620. var s = SCENES[key]
  621. document.getElementById("phones").innerHTML =
  622. buildPhone(s.mode, false) + buildPhone(s.mode, true)
  623. setInfo(key)
  624. }
  625. document.getElementById("tabs").addEventListener("click", function (e) {
  626. var btn = e.target.closest(".tab")
  627. if (!btn) return
  628. document.querySelectorAll(".tab").forEach(function (t) {
  629. t.classList.toggle("is-active", t === btn)
  630. })
  631. render(btn.getAttribute("data-k"))
  632. })
  633. render("now")
  634. </script>
  635. </body>
  636. </html>