diff --git a/h5/home/assets/home/index/banner-top-cropped.png b/h5/home/assets/home/index/banner-top-cropped.png new file mode 100644 index 0000000..930b1c6 Binary files /dev/null and b/h5/home/assets/home/index/banner-top-cropped.png differ diff --git a/h5/home/assets/home/index/banner-top.png b/h5/home/assets/home/index/banner-top.png new file mode 100644 index 0000000..46a3d6e Binary files /dev/null and b/h5/home/assets/home/index/banner-top.png differ diff --git a/h5/home/assets/home/index/card-stats-bg.png b/h5/home/assets/home/index/card-stats-bg.png new file mode 100644 index 0000000..54d9994 Binary files /dev/null and b/h5/home/assets/home/index/card-stats-bg.png differ diff --git a/h5/home/assets/home/index/card-waimai-bg.png b/h5/home/assets/home/index/card-waimai-bg.png new file mode 100644 index 0000000..63dd02e Binary files /dev/null and b/h5/home/assets/home/index/card-waimai-bg.png differ diff --git a/h5/home/assets/home/index/categories/express.png b/h5/home/assets/home/index/categories/express.png new file mode 100644 index 0000000..5c4038e Binary files /dev/null and b/h5/home/assets/home/index/categories/express.png differ diff --git a/h5/home/assets/home/index/categories/hotel.png b/h5/home/assets/home/index/categories/hotel.png new file mode 100644 index 0000000..478665e Binary files /dev/null and b/h5/home/assets/home/index/categories/hotel.png differ diff --git a/h5/home/assets/home/index/categories/invite-earn.png b/h5/home/assets/home/index/categories/invite-earn.png new file mode 100644 index 0000000..621b9c7 Binary files /dev/null and b/h5/home/assets/home/index/categories/invite-earn.png differ diff --git a/h5/home/assets/home/index/categories/movie.png b/h5/home/assets/home/index/categories/movie.png new file mode 100644 index 0000000..1fe6802 Binary files /dev/null and b/h5/home/assets/home/index/categories/movie.png differ diff --git a/h5/home/assets/home/index/categories/taxi.png b/h5/home/assets/home/index/categories/taxi.png new file mode 100644 index 0000000..9ff52f4 Binary files /dev/null and b/h5/home/assets/home/index/categories/taxi.png differ diff --git a/h5/home/assets/home/index/chevron-double-fade.png b/h5/home/assets/home/index/chevron-double-fade.png new file mode 100644 index 0000000..3e71d69 Binary files /dev/null and b/h5/home/assets/home/index/chevron-double-fade.png differ diff --git a/h5/home/assets/home/index/chevron-double.png b/h5/home/assets/home/index/chevron-double.png new file mode 100644 index 0000000..4731397 Binary files /dev/null and b/h5/home/assets/home/index/chevron-double.png differ diff --git a/h5/home/assets/home/index/coupon-claim-bg.png b/h5/home/assets/home/index/coupon-claim-bg.png new file mode 100644 index 0000000..f6349c0 Binary files /dev/null and b/h5/home/assets/home/index/coupon-claim-bg.png differ diff --git a/h5/home/assets/home/index/coupon-ticket-cluster.png b/h5/home/assets/home/index/coupon-ticket-cluster.png new file mode 100644 index 0000000..342ea3b Binary files /dev/null and b/h5/home/assets/home/index/coupon-ticket-cluster.png differ diff --git a/h5/home/assets/home/index/feed/chabaidao.png b/h5/home/assets/home/index/feed/chabaidao.png new file mode 100644 index 0000000..839cb64 Binary files /dev/null and b/h5/home/assets/home/index/feed/chabaidao.png differ diff --git a/h5/home/assets/home/index/feed/jubaoyuan.png b/h5/home/assets/home/index/feed/jubaoyuan.png new file mode 100644 index 0000000..d00185f Binary files /dev/null and b/h5/home/assets/home/index/feed/jubaoyuan.png differ diff --git a/h5/home/assets/home/index/feed/luckin.png b/h5/home/assets/home/index/feed/luckin.png new file mode 100644 index 0000000..577e0e9 Binary files /dev/null and b/h5/home/assets/home/index/feed/luckin.png differ diff --git a/h5/home/assets/home/index/feed/mcdonalds.png b/h5/home/assets/home/index/feed/mcdonalds.png new file mode 100644 index 0000000..c7ecfac Binary files /dev/null and b/h5/home/assets/home/index/feed/mcdonalds.png differ diff --git a/h5/home/assets/home/index/feed/pizzahut.png b/h5/home/assets/home/index/feed/pizzahut.png new file mode 100644 index 0000000..c98d5a9 Binary files /dev/null and b/h5/home/assets/home/index/feed/pizzahut.png differ diff --git a/h5/home/assets/home/index/feed/subway.png b/h5/home/assets/home/index/feed/subway.png new file mode 100644 index 0000000..7dce2cc Binary files /dev/null and b/h5/home/assets/home/index/feed/subway.png differ diff --git a/h5/home/assets/home/index/feed/yoshinoya.png b/h5/home/assets/home/index/feed/yoshinoya.png new file mode 100644 index 0000000..0255fcd Binary files /dev/null and b/h5/home/assets/home/index/feed/yoshinoya.png differ diff --git a/h5/home/assets/home/index/home-tri-arrow-button.svg b/h5/home/assets/home/index/home-tri-arrow-button.svg new file mode 100644 index 0000000..159b613 --- /dev/null +++ b/h5/home/assets/home/index/home-tri-arrow-button.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/h5/home/assets/home/index/money-bag.png b/h5/home/assets/home/index/money-bag.png new file mode 100644 index 0000000..a5ad643 Binary files /dev/null and b/h5/home/assets/home/index/money-bag.png differ diff --git a/h5/home/assets/home/index/no-deal-search.png b/h5/home/assets/home/index/no-deal-search.png new file mode 100644 index 0000000..de623d9 Binary files /dev/null and b/h5/home/assets/home/index/no-deal-search.png differ diff --git a/h5/home/assets/home/index/oneclick-claim.png b/h5/home/assets/home/index/oneclick-claim.png new file mode 100644 index 0000000..3710296 Binary files /dev/null and b/h5/home/assets/home/index/oneclick-claim.png differ diff --git a/h5/home/assets/home/index/piggy-bank.png b/h5/home/assets/home/index/piggy-bank.png new file mode 100644 index 0000000..73be580 Binary files /dev/null and b/h5/home/assets/home/index/piggy-bank.png differ diff --git a/h5/home/assets/home/index/tap-hand-generated.png b/h5/home/assets/home/index/tap-hand-generated.png new file mode 100644 index 0000000..9a59318 Binary files /dev/null and b/h5/home/assets/home/index/tap-hand-generated.png differ diff --git a/h5/home/assets/shared/badges/lowest-price.png b/h5/home/assets/shared/badges/lowest-price.png new file mode 100644 index 0000000..d39ea1e Binary files /dev/null and b/h5/home/assets/shared/badges/lowest-price.png differ diff --git a/h5/home/assets/shared/cta/compare-result.png b/h5/home/assets/shared/cta/compare-result.png new file mode 100644 index 0000000..4af3995 Binary files /dev/null and b/h5/home/assets/shared/cta/compare-result.png differ diff --git a/h5/home/assets/shared/cta/one-click-compare-gray.png b/h5/home/assets/shared/cta/one-click-compare-gray.png new file mode 100644 index 0000000..380a34d Binary files /dev/null and b/h5/home/assets/shared/cta/one-click-compare-gray.png differ diff --git a/h5/home/assets/shared/cta/one-click-compare-square.png b/h5/home/assets/shared/cta/one-click-compare-square.png new file mode 100644 index 0000000..10ca133 Binary files /dev/null and b/h5/home/assets/shared/cta/one-click-compare-square.png differ diff --git a/h5/home/assets/shared/cta/one-click-compare.png b/h5/home/assets/shared/cta/one-click-compare.png new file mode 100644 index 0000000..4af3995 Binary files /dev/null and b/h5/home/assets/shared/cta/one-click-compare.png differ diff --git a/h5/home/assets/shared/cta/tap-hint.svg b/h5/home/assets/shared/cta/tap-hint.svg new file mode 100644 index 0000000..daeda05 --- /dev/null +++ b/h5/home/assets/shared/cta/tap-hint.svg @@ -0,0 +1,3 @@ + + + diff --git a/h5/home/assets/shared/cta/today-coupon-orange.png b/h5/home/assets/shared/cta/today-coupon-orange.png new file mode 100644 index 0000000..f886244 Binary files /dev/null and b/h5/home/assets/shared/cta/today-coupon-orange.png differ diff --git a/h5/home/assets/shared/gestures/tap-hint.svg b/h5/home/assets/shared/gestures/tap-hint.svg new file mode 100644 index 0000000..daeda05 --- /dev/null +++ b/h5/home/assets/shared/gestures/tap-hint.svg @@ -0,0 +1,3 @@ + + + diff --git a/h5/home/assets/shared/home-snapshots/sb-home.png b/h5/home/assets/shared/home-snapshots/sb-home.png new file mode 100644 index 0000000..873147f Binary files /dev/null and b/h5/home/assets/shared/home-snapshots/sb-home.png differ diff --git a/h5/home/assets/shared/icons/README.md b/h5/home/assets/shared/icons/README.md new file mode 100644 index 0000000..5555930 --- /dev/null +++ b/h5/home/assets/shared/icons/README.md @@ -0,0 +1,43 @@ +# Shared Icons + +通用图标的单一事实源(canonical source)。每个图标都是独立 SVG 文件,但**实际页面里必须内联 SVG markup**(不用 `` 或 `` 引用),符合 prototypes 仓库"每个 HTML 自包含"原则。 + +## 工作流 + +1. 改图标 → 改这里的 SVG 文件 +2. 在所有用到的 HTML 里同步替换内联 SVG markup +3. DESIGN.md 引用本目录路径作为基准 + +## 现有图标 + +| 文件 | 用途 | 推荐内联尺寸 | +|---|---|---| +| `back-chevron.svg` | 顶部导航返回按钮 | 24×24 | +| `tab-home-outline.svg` | 底 tab "首页" 未选中态 | 24×24 | +| `tab-home-filled.svg` | 底 tab "首页" 选中态(黄填充)| 24×24 | +| `tab-welfare-outline.svg` | 底 tab "福利" 未选中态 | 24×24 | +| `tab-welfare-filled.svg` | 底 tab "福利" 选中态(黄填充)| 24×24 | +| `tab-profile-outline.svg` | 底 tab "我的" 未选中态 | 24×24 | +| `tab-profile-filled.svg` | 底 tab "我的" 选中态(黄填充)| 24×24 | + +## 标准 button 包装 + +```html + + + + + +``` + +```css +.btn-back { + width: 44px; height: 44px; + display: flex; align-items: center; justify-content: center; + background: transparent; border: none; padding: 0; + cursor: pointer; -webkit-tap-highlight-color: transparent; + flex-shrink: 0; +} +.btn-back:active { opacity: 0.5; } +.btn-back svg { width: 24px; height: 24px; display: block; } +``` diff --git a/h5/home/assets/shared/icons/back-chevron.svg b/h5/home/assets/shared/icons/back-chevron.svg new file mode 100644 index 0000000..5eeb353 --- /dev/null +++ b/h5/home/assets/shared/icons/back-chevron.svg @@ -0,0 +1,3 @@ + + + diff --git a/h5/home/assets/shared/icons/tab-home-filled.svg b/h5/home/assets/shared/icons/tab-home-filled.svg new file mode 100644 index 0000000..2e6fe3d --- /dev/null +++ b/h5/home/assets/shared/icons/tab-home-filled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/h5/home/assets/shared/icons/tab-home-outline.svg b/h5/home/assets/shared/icons/tab-home-outline.svg new file mode 100644 index 0000000..f453eca --- /dev/null +++ b/h5/home/assets/shared/icons/tab-home-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/h5/home/assets/shared/icons/tab-profile-filled.svg b/h5/home/assets/shared/icons/tab-profile-filled.svg new file mode 100644 index 0000000..defee4c --- /dev/null +++ b/h5/home/assets/shared/icons/tab-profile-filled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/h5/home/assets/shared/icons/tab-profile-outline.svg b/h5/home/assets/shared/icons/tab-profile-outline.svg new file mode 100644 index 0000000..57c4dab --- /dev/null +++ b/h5/home/assets/shared/icons/tab-profile-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/h5/home/assets/shared/icons/tab-welfare-filled.svg b/h5/home/assets/shared/icons/tab-welfare-filled.svg new file mode 100644 index 0000000..6cb269c --- /dev/null +++ b/h5/home/assets/shared/icons/tab-welfare-filled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/h5/home/assets/shared/icons/tab-welfare-outline.svg b/h5/home/assets/shared/icons/tab-welfare-outline.svg new file mode 100644 index 0000000..b597121 --- /dev/null +++ b/h5/home/assets/shared/icons/tab-welfare-outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/h5/home/assets/shared/logos/jd-waimai.png b/h5/home/assets/shared/logos/jd-waimai.png new file mode 100644 index 0000000..6de9605 Binary files /dev/null and b/h5/home/assets/shared/logos/jd-waimai.png differ diff --git a/h5/home/assets/shared/logos/jd.png b/h5/home/assets/shared/logos/jd.png new file mode 100644 index 0000000..ed939da Binary files /dev/null and b/h5/home/assets/shared/logos/jd.png differ diff --git a/h5/home/assets/shared/logos/meituan-waimai.png b/h5/home/assets/shared/logos/meituan-waimai.png new file mode 100644 index 0000000..9ef0783 Binary files /dev/null and b/h5/home/assets/shared/logos/meituan-waimai.png differ diff --git a/h5/home/assets/shared/logos/meituan.png b/h5/home/assets/shared/logos/meituan.png new file mode 100644 index 0000000..71cede9 Binary files /dev/null and b/h5/home/assets/shared/logos/meituan.png differ diff --git a/h5/home/assets/shared/logos/sb-brand-vector.svg b/h5/home/assets/shared/logos/sb-brand-vector.svg new file mode 100644 index 0000000..1451bff --- /dev/null +++ b/h5/home/assets/shared/logos/sb-brand-vector.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/h5/home/assets/shared/logos/sb-brand.old.png b/h5/home/assets/shared/logos/sb-brand.old.png new file mode 100644 index 0000000..106b7c5 Binary files /dev/null and b/h5/home/assets/shared/logos/sb-brand.old.png differ diff --git a/h5/home/assets/shared/logos/sb-brand.png b/h5/home/assets/shared/logos/sb-brand.png new file mode 100644 index 0000000..c8f1c13 Binary files /dev/null and b/h5/home/assets/shared/logos/sb-brand.png differ diff --git a/h5/home/assets/shared/logos/taobao-shanguang.png b/h5/home/assets/shared/logos/taobao-shanguang.png new file mode 100644 index 0000000..3091d33 Binary files /dev/null and b/h5/home/assets/shared/logos/taobao-shanguang.png differ diff --git a/h5/home/assets/shared/logos/taobao.png b/h5/home/assets/shared/logos/taobao.png new file mode 100644 index 0000000..7e0f742 Binary files /dev/null and b/h5/home/assets/shared/logos/taobao.png differ diff --git a/h5/home/assets/shared/overlays/aurora-decoration.png b/h5/home/assets/shared/overlays/aurora-decoration.png new file mode 100644 index 0000000..6f0a98f Binary files /dev/null and b/h5/home/assets/shared/overlays/aurora-decoration.png differ diff --git a/h5/home/assets/shared/overlays/floating-window.jpg b/h5/home/assets/shared/overlays/floating-window.jpg new file mode 100644 index 0000000..6d3f2c2 Binary files /dev/null and b/h5/home/assets/shared/overlays/floating-window.jpg differ diff --git a/h5/home/assets/shared/products/aomiao-detergent.jpg b/h5/home/assets/shared/products/aomiao-detergent.jpg new file mode 100644 index 0000000..20595ec Binary files /dev/null and b/h5/home/assets/shared/products/aomiao-detergent.jpg differ diff --git a/h5/home/assets/shared/products/coca-cola.jpg b/h5/home/assets/shared/products/coca-cola.jpg new file mode 100644 index 0000000..3eb4a36 Binary files /dev/null and b/h5/home/assets/shared/products/coca-cola.jpg differ diff --git a/h5/home/assets/shared/products/hfs-shampoo.jpg b/h5/home/assets/shared/products/hfs-shampoo.jpg new file mode 100644 index 0000000..d9086c8 Binary files /dev/null and b/h5/home/assets/shared/products/hfs-shampoo.jpg differ diff --git a/h5/home/assets/shared/products/jly-rice.jpg b/h5/home/assets/shared/products/jly-rice.jpg new file mode 100644 index 0000000..f304d5f Binary files /dev/null and b/h5/home/assets/shared/products/jly-rice.jpg differ diff --git a/h5/home/assets/shared/products/vinda-tissue.jpg b/h5/home/assets/shared/products/vinda-tissue.jpg new file mode 100644 index 0000000..ed70010 Binary files /dev/null and b/h5/home/assets/shared/products/vinda-tissue.jpg differ diff --git a/h5/home/assets/shared/products/yili-milk.jpg b/h5/home/assets/shared/products/yili-milk.jpg new file mode 100644 index 0000000..da6d3c5 Binary files /dev/null and b/h5/home/assets/shared/products/yili-milk.jpg differ diff --git a/h5/home/assets/welfare/index/checkin-coins-600.png b/h5/home/assets/welfare/index/checkin-coins-600.png new file mode 100644 index 0000000..3fb3bf4 Binary files /dev/null and b/h5/home/assets/welfare/index/checkin-coins-600.png differ diff --git a/h5/home/assets/welfare/index/coin-icon.png b/h5/home/assets/welfare/index/coin-icon.png new file mode 100644 index 0000000..02861d3 Binary files /dev/null and b/h5/home/assets/welfare/index/coin-icon.png differ diff --git a/h5/home/index.html b/h5/home/index.html new file mode 100644 index 0000000..941ff5e --- /dev/null +++ b/h5/home/index.html @@ -0,0 +1,10397 @@ + + + + + + + + +比价APP 高保真原型 (外卖版) + + + + + + + + + + + ⚙ + + 方案切换 + 暂无多方案模块在 variants 配置中添加模块即可 + + + + + + 返回 + + + + + + + 用户协议及隐私保护 + 我已阅读并同意用户协议、基本功能隐私政策 + 同意并登录 + 不同意 + + + + + + + + + + + + + + + 傻瓜比价 + + 跨平台比价,用傻瓜 + + + + + + + + + + + 邀好友 赚金币 + 立即邀请 › + 🎁 + + + + + + + + + + + + + + + + 14:23:18省***手比价后节省88888.88元 + + + + 14:22:451***2比价后节省42.40元 + + + + 14:20:31小**比价后节省7.90元 + + + + 14:18:077***0比价后节省156.30元 + + + + 14:15:42团**比价后节省23.50元 + + + + 14:11:296***0比价后节省89.40元 + + + + + 14:23:18省***手比价后节省88888.88元 + + + + + + + + + 帮助用户 + 12847人 + + + 完成比价 + 86532次 + + + 累计节省 + 37621.4元 + + + + + + 上次比价 + + + + + + + + + + + + + 最低价 + + + + + + + + + 去查看 + + + + + + + + + + + + + 今日大额优惠券 + AI 一键自动领 + + 去领取 + + + + + + + + + + 点外卖,赚金币 + 快去解锁全网底价 + + 去点餐 + + + + + + + + + + + + + + + 特惠酒店 + + + + 折扣电影票 + + + + 打车券 + + + + 寄快递 + + + + 分享赚钱 + + + + + + + 智能推荐 + 距离最近 + 销量最高 + + + + + + + + + + 授权地理位置,附近美食优惠马上看~ + 去授权 + + + + + 附近暂无优惠商品~去外卖平台解锁底价 + 去比价 + + + + 加载中… + + + + 服务繁忙,下拉重试~ + 重试 + + + + 已经到底了 + + + + 首页 + 赚钱 + 记录 + 我的 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + × + 提现金额 + 0.3元 + + + + + + + + + + + 暂未绑定微信账户 + 绑定后才可提现,可以更换和解绑 + + + 去微信绑定并提现 + + + + + + + + + + × + 金币兑换现金 + 金币余额:28,967 + + + ¥ + 28,967 + + = 2.89元 + + + 1000 + 2000 + 3000 + 全部兑换 + + + 最低 100 金币,不足 100 的金币将原路返回 + 立即兑换 + + + + + + + + + + + + + 退出登录 + 退出后将无法继续累积金币收益 + + 取消 + 确认退出 + + + + + + + + ⚠️ + 确认注销账号? + 注销后以下数据将永久删除且无法恢复: + + · 全部金币余额和现金收益 + · 比价记录和购买战绩 + · 邀请好友关系和返佣收益 + + + 我再想想 + 确认注销 + + + + + + + + + + + + + + + + + + + + 傻瓜比价 + + + + + + + + 今日已从帮您领取 + 共0张优惠券 + + + + + 23:58:27 后失效 + + 开心收下,立即使用 + + + + + + + + + + + + ✕ + + + + + + + + 您仍未领取今日大额优惠券 + + + 先领券,再比价 + + + + + 将在以上平台领取 + + 一键自动领取 + + + + + + + + + ✕ + 🍱 + 请选择您常用的平台 + 进入平台选好商品后,AI 一键替你比多家 + + + + + + + + + × + 连续签到14天 最高可领2888金币 + 签到领取今日金币 + 已连续签到 2 天,今天可领 220 金币 + + + + 已领取 + 180 + + + 已领取 + 380 + + + + 220 + + + + 260 + + + + 888 + + + + + + 第1天 + 第2天 + 今天 + 明天 + 第7天 + + + 签到领 220 + 打开签到提醒 + + + + + + + ✕ + + 日历权限未开启 + 开启提醒失败,请前往设置-傻瓜比价打开日历权限后重试 + + 去开启 + + + + + + + + + + + + + + + × + + ⚠️ + + 比价功能未开启 + + 在「已安装的应用」中找到「傻瓜比价」并开启无障碍 + + + + 我们的安全承诺 + + 仅在您开启比价时启用,用完即停 + 全程端侧加密,全方位守护您的隐私 + 您随时可在设置中关闭 + + + + 去开启 + + + + + + + 允许"傻瓜比价"获取此设备的位置信息? + 用于获取附近美食优惠和配送范围,为你推荐更精准的比价结果。 + + 仅使用期间允许 + 允许本次使用 + 禁止 + + + + + + + + + + + + + + + + + 比价结果反馈 + 审核通过可获得 2,000 金币 奖励 + + + + 选择反馈类型 + + 💰 + 我发现了更低价格在其他平台找到了同款更便宜的 + › + + + ❌ + 外卖不是同一家比价结果中有外卖匹配错误 + › + + + + + + + 我发现了更低价格 + + 粘贴外卖链接 + + 上传截图 (含价格信息) + + + + + + + 提交反馈 + + + + + + 外卖不是同一家 + + 哪个平台的结果有误? + + 上传截图或描述问题 + + + + + + 提交反馈 + + + + ✅ + 反馈已提交 + 系统正在验证,审核通过后2,000 金币 将自动到账 + 审核结果将通过推送通知告知您 + 知道了 + + + + + + + + + + + + + + + ✕ + + 🎉🎊✨🎊🎉 + 新手大礼包 + 专享新客福利,开启领取 + + + + + + + + + + + + 🎁 + + +5,000金币 + 已存入「福利」,随时可提现 + ✨ 开启礼包 + + + + + +5,000 金币 + + + + + + + + + + × + 「开启省钱之旅」按钮样式 + 点击切换,预览不同方案 + + 红橙渐变当前 + 黄底黑字品牌主色 + 黑底黄字高对比 + 金色光泽动态扫光 + 玻璃质感立体黄 + 描边偏移克制款 + 红包喜庆红+金 + 呼吸跳动动效款 + 蜜糖渐变黄→琥珀 + 金币描边深金细边 + + + + 领券弹窗副标题样式 + 主标题下那行小字,强化"收益"信号 + + 基线灰当前最弱 + 金币胶囊品牌黄徽章 + 关键词高亮黄色荧光笔 + 优惠券小票齿边+朱红 + 数字徽章预计立省¥ + 双行节奏预告+承诺 + V2b 金币翻转动效活力 + V2c 双色分段黑黄拼接 + V2d 闪光描边轻盈款 + V2e 数字嵌入¥18+ 内嵌 + V2f 双图标金币+闪电 + V2g 立体浮起金属高光 + 流程植入领券→比价→底价 + + + + 「完成设置」弹窗版式 + 点击切换,下次进入弹窗即生效 + + 轻收尾·重期待承上小,起下大 + 分割式三段节奏 + 叙事流递进式 + 行为优先主舞台让给行为 + 徽章+行动卡chip 强调最后一步 + 进度条推进脉动黄推进感 + 数字步骤① ✓ → ② 当前 + 极简专注大字承担引导 + + ▶ 预览当前版式 + + + + + + + + + + + + + + + + + + + diff --git a/h5/shared/bridge.js b/h5/shared/bridge.js index a61f187..cbacdf7 100644 --- a/h5/shared/bridge.js +++ b/h5/shared/bridge.js @@ -124,6 +124,29 @@ else console.log('[SGBridge mock] closePage'); } + /** H5「去授权」→ 触发系统定位权限窗(原生侧永久拒绝跳设置)。结果异步,H5 回前台 visibilitychange 自行重查。 */ + function requestLocationPermission() { + if (hasNative && native.requestLocationPermission) native.requestLocationPermission(); + else console.log('[SGBridge mock] requestLocationPermission'); + } + + /** 定位权限是否已授予(FINE/COARSE)。H5 据此切「未授权空态 / feed」。浏览器无原生 → mock 返 true(便于预览 feed)。 */ + function isLocationGranted() { + if (hasNative && native.isLocationGranted) return !!native.isLocationGranted(); + return true; + } + + /** 取设备当前经纬度 → {longitude, latitude};原生拿不到(未授权/无缓存)返 null,浏览器无原生 mock 北京。 + * 原生侧同步返宿主缓存的 lastLocation(见 SGBridge.kt getLocation);H5 拿到 null 自行落默认坐标。 */ + function getLocation() { + if (hasNative && native.getLocation) { + var o = safeParse(native.getLocation(), null); + if (o && typeof o.longitude === 'number' && typeof o.latitude === 'number') return o; + return null; + } + return { longitude: 116.404, latitude: 39.928 }; + } + // ====== 原生 → H5 事件总线 ====== var listeners = {}; // event → [fn] @@ -153,6 +176,8 @@ getAppVersion: getAppVersion, getInstalledApps: getInstalledApps, getCouponClaimedToday: getCouponClaimedToday, + isLocationGranted: isLocationGranted, + getLocation: getLocation, // 动作 navigate: navigate, requestLogin: requestLogin, @@ -162,6 +187,7 @@ startCouponClaim: startCouponClaim, launchApp: launchApp, closePage: closePage, + requestLocationPermission: requestLocationPermission, // 事件 on: on, _emit: _emit, diff --git a/tests/test_h5_hosting.py b/tests/test_h5_hosting.py index 1acd149..9f1d4b0 100644 --- a/tests/test_h5_hosting.py +++ b/tests/test_h5_hosting.py @@ -30,3 +30,72 @@ def test_h5_records_served_and_migrated(client) -> None: assert "NativeBridge" not in body # 旧桥名清零 assert "getApiBase" not in body # 同源:绝对地址拼接已移除 assert "../shared/bridge.js" in body + + +def test_h5_home_served(client) -> None: + resp = client.get("/h5/home/index.html") + assert resp.status_code == 200 + assert resp.headers.get("cache-control") == "no-cache" + body = resp.text + assert 'id="home"' in body + assert "data-cc-id" not in body # 原型编辑器留痕已剥 + assert "../../assets/" not in body # 素材路径已本地化 + assert "/api/v1/platform/stats" in body # 已接同源数据 + assert body.count('class="screen') == 1 # 只剩首页一屏 + + +def test_h5_home_asset_served(client) -> None: + resp = client.get("/h5/home/assets/shared/logos/sb-brand.png") + assert resp.status_code == 200 + + +def test_h5_bridge_has_get_location(client) -> None: + # H2b: 首页 feed 需经纬度, bridge 暴露同步 getLocation()(无桥 mock 北京) + resp = client.get("/h5/shared/bridge.js") + assert resp.status_code == 200 + body = resp.text + assert "getLocation" in body + assert "116.404" in body and "39.928" in body # 浏览器 mock 北京兜底 + + +def test_h5_home_feed_wired(client) -> None: + # H2b: 首页 feed 接真实美团端点 + 抢换链;mock 静态卡已移除 + resp = client.get("/h5/home/index.html") + assert resp.status_code == 200 + body = resp.text + assert "/api/v1/meituan/feed" in body # rec/distance + assert "/api/v1/meituan/top-sales" in body # 销量最高 + assert "/api/v1/meituan/referral-link" in body # 抢 + assert "HomeFeed" in body # feed 模块已挂 + assert "茶百道" not in body # 写死的 mock 卡(店名)已移除 + assert "chabaidao.png" not in body # 写死的 mock 头图已移除 + assert "比团购省 5.5 元" not in body # 随原生:mock 卡的「比团购省」标签已删(渲染只用 price_label/rank_label) + + +def test_h5_home_last_compare_wired(client) -> None: + # 「上次比价」横幅改接真实 /api/v1/compare/records + 4 分钟新鲜窗口;原写死 mock 默认值已移除 + resp = client.get("/h5/home/index.html") + assert resp.status_code == 200 + body = resp.text + assert "/api/v1/compare/records" in body # 接真实比价记录端点 + assert "pickFreshLastCompare" in body # 4 分钟新鲜窗口逻辑 + assert "DEFAULT_LAST_COMPARE_RECORD" not in body # 写死 mock 默认已移除 + assert 'id="lastCompareShop">窑鸡王' not in body # 横幅店名静态 mock 占位已清空 + + +def test_compare_records_requires_auth(client) -> None: + # 横幅靠 Bearer token 才拿得到数据;无鉴权必须 401(无桥/未登录时横幅隐藏) + resp = client.get("/api/v1/compare/records?limit=5") + assert resp.status_code == 401 + + +def test_h5_home_coupon_popup_coin_icon_served(client) -> None: + # 「去领取」弹窗右上角金币图标:welfare 资源子树曾漏本地化 → 404 不显示;补齐后须 200 + resp = client.get("/h5/home/assets/welfare/index/coin-icon.png") + assert resp.status_code == 200 + + +def test_h5_home_coupon_ad_reward_coins_served(client) -> None: + # 领券「看广告赚金币」到账 toast(showCouponAdRewardToast)的金币堆图标:同属漏拷的 welfare 子树,补齐后须 200 + resp = client.get("/h5/home/assets/welfare/index/checkin-coins-600.png") + assert resp.status_code == 200