组装页.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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">
  6. <title>组装页</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <style>
  9. /* 隐藏滚动条但保留滚动功能 */
  10. .no-scrollbar::-webkit-scrollbar {
  11. display: none;
  12. }
  13. .no-scrollbar {
  14. -ms-overflow-style: none;
  15. scrollbar-width: none;
  16. }
  17. /* iOS 弹窗缩放动画 */
  18. @keyframes zoomIn {
  19. from { transform: scale(1.1); opacity: 0; }
  20. to { transform: scale(1); opacity: 1; }
  21. }
  22. .animate-zoom-in {
  23. animation: zoomIn 0.2s ease-out forwards;
  24. }
  25. </style>
  26. </head>
  27. <body class="bg-gray-100 flex justify-center h-screen overflow-hidden font-sans">
  28. <!-- 移动端模拟容器 -->
  29. <div class="w-full max-w-[400px] h-full bg-white flex flex-col relative shadow-2xl overflow-hidden">
  30. <!-- 顶部状态栏 (全局共享) -->
  31. <div class="h-11 w-full flex justify-between items-center px-5 text-black bg-white z-30 relative shrink-0">
  32. <span class="text-[15px] font-medium">9:41</span>
  33. <div class="flex gap-1.5 items-center">
  34. <svg width="18" height="12" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 12V9H3.5V12H1.5ZM6 12V6.5H8V12H6ZM10.5 12V3.5H12.5V12H10.5ZM15 12V0H17V12H15Z" fill="black"/></svg>
  35. <svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 12C9.10457 12 10 11.1046 10 10C10 8.89543 9.10457 8 8 8C6.89543 8 6 8.89543 6 10C6 11.1046 6.89543 12 8 12Z" fill="black"/><path d="M2.34315 5.65685C5.46734 2.53266 10.5327 2.53266 13.6569 5.65685" stroke="black" stroke-width="1.5" stroke-linecap="round"/><path d="M5.17157 8.48528C6.73367 6.92318 9.26633 6.92318 10.8284 8.48528" stroke="black" stroke-width="1.5" stroke-linecap="round"/></svg>
  36. <svg width="25" height="12" viewBox="0 0 25 12" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke="black"/><rect x="2" y="2" width="18" height="8" rx="1" fill="black"/><path d="M23 4V8" stroke="black" stroke-width="1.5" stroke-linecap="round"/></svg>
  37. </div>
  38. </div>
  39. <!-- 导航栏 -->
  40. <header class="h-11 flex items-center justify-between px-4 bg-white z-20 shrink-0 border-b border-gray-100">
  41. <button class="text-gray-800 p-1">
  42. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
  43. </button>
  44. <h1 class="text-[17px] font-medium text-gray-900 absolute left-1/2 -translate-x-1/2">标题名称</h1>
  45. <div class="w-8"></div>
  46. </header>
  47. <!-- 内容滚动区 -->
  48. <div class="flex-1 overflow-y-auto no-scrollbar pb-8 bg-white relative">
  49. <!-- 1. 顶部占位大图 -->
  50. <div class="w-full h-[220px] bg-[#eef6fc] flex items-center justify-center relative">
  51. <!-- 内部占位 Logo 模拟 -->
  52. <div class="w-32 h-32 rounded-full bg-[#d5e8f4] flex items-center justify-center relative overflow-hidden">
  53. <svg viewBox="0 0 100 100" class="w-full h-full text-white" fill="currentColor">
  54. <path d="M10,90 L90,90 L50,10 Z" opacity="0.8"/>
  55. <circle cx="50" cy="50" r="40" opacity="0.6"/>
  56. </svg>
  57. </div>
  58. </div>
  59. <div class="px-5 pt-6 pb-2 space-y-8">
  60. <!-- 2. 主标题模块 -->
  61. <section>
  62. <h2 class="text-[20px] font-bold text-gray-900 mb-3 tracking-wide">主标题文案一行字</h2>
  63. <p class="text-[14px] text-gray-600 leading-[1.6] text-justify tracking-wide">
  64. 详情文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案
  65. </p>
  66. </section>
  67. <!-- 3. 权益标题模块 -->
  68. <section>
  69. <h3 class="text-[18px] font-bold text-gray-900 mb-2">权益标题</h3>
  70. <div class="flex flex-col">
  71. <!-- 权益项 1 -->
  72. <div class="flex items-center gap-4 py-4 border-b border-gray-100 active:bg-gray-50 transition cursor-pointer">
  73. <div class="w-12 h-12 rounded-full border border-gray-200 bg-[#fbfcfc] flex items-center justify-center text-gray-500 shrink-0">
  74. <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
  75. </div>
  76. <div class="flex-1">
  77. <div class="text-[15px] font-medium text-gray-900">权益名称一行字</div>
  78. <div class="text-[13px] text-gray-500 mt-1">权益简介文案权益简介文案</div>
  79. </div>
  80. <svg class="w-5 h-5 text-gray-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg>
  81. </div>
  82. <!-- 权益项 2 -->
  83. <div class="flex items-center gap-4 py-4 border-b border-gray-100 active:bg-gray-50 transition cursor-pointer">
  84. <div class="w-12 h-12 rounded-full border border-gray-200 bg-[#fbfcfc] flex items-center justify-center text-gray-500 shrink-0">
  85. <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
  86. </div>
  87. <div class="flex-1">
  88. <div class="text-[15px] font-medium text-gray-900">权益名称一行字</div>
  89. <div class="text-[13px] text-gray-500 mt-1">权益简介文案权益简介文案</div>
  90. </div>
  91. <svg class="w-5 h-5 text-gray-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg>
  92. </div>
  93. <!-- 权益项 3 -->
  94. <div class="flex items-center gap-4 py-4 border-b border-gray-100 active:bg-gray-50 transition cursor-pointer">
  95. <div class="w-12 h-12 rounded-full border border-gray-200 bg-[#fbfcfc] flex items-center justify-center text-gray-500 shrink-0">
  96. <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
  97. </div>
  98. <div class="flex-1">
  99. <div class="text-[15px] font-medium text-gray-900">权益名称一行字</div>
  100. <div class="text-[13px] text-gray-500 mt-1">权益简介文案权益简介文案</div>
  101. </div>
  102. <svg class="w-5 h-5 text-gray-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg>
  103. </div>
  104. <!-- 权益项 4 -->
  105. <div class="flex items-center gap-4 py-4 border-b border-gray-100 active:bg-gray-50 transition cursor-pointer">
  106. <div class="w-12 h-12 rounded-full border border-gray-200 bg-[#fbfcfc] flex items-center justify-center text-gray-500 shrink-0">
  107. <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
  108. </div>
  109. <div class="flex-1">
  110. <div class="text-[15px] font-medium text-gray-900">权益名称一行字</div>
  111. <div class="text-[13px] text-gray-500 mt-1">权益简介文案权益简介文案</div>
  112. </div>
  113. <svg class="w-5 h-5 text-gray-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg>
  114. </div>
  115. </div>
  116. </section>
  117. <!-- 活动标题模块已按照要求跳过不写 -->
  118. <!-- 4. 副标题模块 1 -->
  119. <section>
  120. <h3 class="text-[18px] font-bold text-gray-900 mb-3 tracking-wide">副标题名称一行字</h3>
  121. <p class="text-[14px] text-gray-600 leading-[1.6] text-justify tracking-wide">
  122. 详情文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案文案
  123. </p>
  124. </section>
  125. <!-- 5. 副标题模块 2 (带外链图标排版) -->
  126. <section>
  127. <h3 class="text-[18px] font-bold text-gray-900 mb-3 tracking-wide">副标题名称一行字</h3>
  128. <div class="text-[14px] text-gray-600 leading-[1.8] text-justify tracking-wide">
  129. 说明文字说明 <span class="text-gray-900 font-medium cursor-pointer hover:underline">文字链接名字</span>
  130. <svg class="inline-block w-3.5 h-3.5 ml-0.5 text-gray-500 mb-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"/></svg>
  131. 明文文字链接名字 文字说明
  132. <svg class="inline-block w-3.5 h-3.5 mx-0.5 text-gray-500 mb-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"/></svg>
  133. 字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明
  134. <span class="text-gray-900 font-medium ml-1 cursor-pointer hover:underline">文字链接名字</span>
  135. <svg class="inline-block w-3.5 h-3.5 ml-0.5 text-gray-500 mb-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"/></svg>
  136. 字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明
  137. </div>
  138. </section>
  139. <!-- 6. 底部操作按钮 -->
  140. <section class="pt-4 space-y-3 pb-6">
  141. <button class="w-full bg-[#d70014] text-white text-[16px] font-medium py-3.5 rounded active:bg-red-800 transition">
  142. 可配置字段
  143. </button>
  144. <button onclick="openBottomHint()" class="w-full bg-white border border-gray-300 text-gray-900 text-[16px] font-medium py-3.5 rounded active:bg-gray-50 transition">
  145. 弹窗按钮
  146. </button>
  147. </section>
  148. </div>
  149. </div>
  150. <!-- 底部 Home Indicator (iOS风格) - 固定在最上层 -->
  151. <div class="h-8 w-full flex justify-center items-center z-50 absolute bottom-0 pointer-events-none bg-gradient-to-t from-white via-white to-transparent">
  152. <div class="w-32 h-1 bg-gray-900 rounded-full mt-2"></div>
  153. </div>
  154. <!-- 自定义 Toast 提示框 -->
  155. <div id="customToast" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-gray-800 text-white text-sm px-6 py-3 rounded-lg z-[200] hidden opacity-0 transition-opacity duration-300 shadow-lg whitespace-nowrap pointer-events-none">
  156. 提示内容
  157. </div>
  158. <!-- 底部提示弹窗 (Bottom Hint Modal) -->
  159. <div id="bottomHintDialog" class="absolute inset-0 z-[100] hidden">
  160. <div class="absolute inset-0 bg-black/40 transition-opacity" onclick="closeBottomHint()"></div>
  161. <div id="bottomHintContent" class="absolute bottom-0 left-0 w-full bg-white rounded-t-xl transform translate-y-full transition-transform duration-300 ease-out flex flex-col shadow-[0_-10px_40px_rgba(0,0,0,0.1)]">
  162. <div class="px-5 py-4 flex justify-between items-center border-b border-gray-100 shrink-0">
  163. <h2 class="text-[18px] font-medium text-gray-900">提示</h2>
  164. <button onclick="closeBottomHint()" class="text-gray-400 p-1 hover:bg-gray-100 rounded-full transition">
  165. <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
  166. </button>
  167. </div>
  168. <div class="px-5 pt-6 pb-8">
  169. <p class="text-[15px] text-gray-700 leading-[1.6] mb-8">
  170. 详情文案文案文案文案文案文案文案文案文案文案文案文
  171. </p>
  172. <div class="flex gap-3">
  173. <button onclick="closeBottomHint()" class="flex-1 py-3 text-[16px] font-medium text-gray-800 bg-white border border-gray-300 rounded active:bg-gray-50 transition">取消</button>
  174. <button onclick="confirmBottomHint()" class="flex-1 py-3 text-[16px] font-medium text-white bg-[#d70014] rounded active:bg-red-800 transition">确认</button>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- 外部跳转拦截弹窗 (优化后 UI) -->
  180. <div id="externalLinkDialog" class="absolute inset-0 z-[110] flex items-center justify-center hidden">
  181. <!-- 遮罩层 -->
  182. <div class="absolute inset-0 bg-black/50 transition-opacity" onclick="closeExternalDialog()"></div>
  183. <!-- 弹窗本体 -->
  184. <div class="relative bg-white w-[300px] rounded-xl flex flex-col p-6 animate-zoom-in shadow-2xl">
  185. <div class="flex items-center gap-3 mb-3">
  186. <div class="w-8 h-8 rounded-full bg-red-50 flex items-center justify-center shrink-0">
  187. <svg class="w-4 h-4 text-[#d70014]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg>
  188. </div>
  189. <h3 class="text-[17px] font-bold text-gray-900">您正在离开汇丰中国</h3>
  190. </div>
  191. <p class="text-[13px] text-gray-500 leading-relaxed mb-6">请注意,外部网站的政策与我们网站的条款和条件以及隐私政策不同。将在新浏览器窗口或选项卡中打开下一个网站。</p>
  192. <div class="flex gap-3">
  193. <button onclick="closeExternalDialog()" class="flex-1 py-2.5 text-[15px] font-medium text-gray-700 bg-gray-100 rounded hover:bg-gray-200 active:bg-gray-200 transition">取消</button>
  194. <button onclick="confirmExternalDialog()" class="flex-1 py-2.5 text-[15px] font-medium text-white bg-[#d70014] rounded hover:bg-red-700 active:bg-red-800 transition">继续前往</button>
  195. </div>
  196. </div>
  197. </div>
  198. <script>
  199. // 自定义 Toast 显示函数,替代 alert
  200. function showToast(message) {
  201. const toast = document.getElementById('customToast');
  202. toast.innerText = message;
  203. toast.classList.remove('hidden');
  204. // 触发重绘以应用动画
  205. void toast.offsetWidth;
  206. toast.classList.add('opacity-100');
  207. setTimeout(() => {
  208. toast.classList.remove('opacity-100');
  209. setTimeout(() => {
  210. toast.classList.add('hidden');
  211. }, 300); // 等待淡出动画结束
  212. }, 2000); // 显示 2 秒
  213. }
  214. // --- 底部提示弹窗 ---
  215. function openBottomHint() {
  216. const modal = document.getElementById('bottomHintDialog');
  217. const content = document.getElementById('bottomHintContent');
  218. modal.classList.remove('hidden');
  219. setTimeout(() => {
  220. content.classList.remove('translate-y-full');
  221. }, 10);
  222. }
  223. function closeBottomHint() {
  224. const content = document.getElementById('bottomHintContent');
  225. content.classList.add('translate-y-full');
  226. setTimeout(() => {
  227. document.getElementById('bottomHintDialog').classList.add('hidden');
  228. }, 300);
  229. }
  230. function confirmBottomHint() {
  231. closeBottomHint();
  232. setTimeout(() => {
  233. openExternalDialog();
  234. }, 300);
  235. }
  236. // --- 外部跳转弹窗 ---
  237. function openExternalDialog() {
  238. document.getElementById('externalLinkDialog').classList.remove('hidden');
  239. }
  240. function closeExternalDialog() {
  241. document.getElementById('externalLinkDialog').classList.add('hidden');
  242. }
  243. function confirmExternalDialog() {
  244. closeExternalDialog();
  245. // 模拟跳转后的提示操作
  246. setTimeout(() => {
  247. showToast('已确认,将模拟跳转至外部链接!');
  248. }, 200); // 稍微延迟等待弹窗消失动画
  249. }
  250. </script>
  251. </div>
  252. </body>
  253. </html>