Files
platforms/scripts/compare-user-app-a1.ps1
czl231 3ef33b531d 已完成用户APP首期功能开发
交付用户端首期页面、配套接口、后台资源及测试文档。用户APP构建、静态分析和三个管理后台构建通过;完整测试仍有2项失败,后端模型注释检查未通过,详见交付记录。
2026-09-13 00:57:32 +08:00

34 lines
3.0 KiB
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 功能描述:将最新设计与 A1 Flutter 截图并排保存,源图保持比例,不作为像素一致性断言。
# 版本1.1.0。参数无;从脚本位置解析仓库路径,输出 docs/视觉验收/A1。
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.Drawing
$a1Repo = Split-Path -Parent $PSScriptRoot
$a1Names = @{'01'='登录页';'03'='首页';'05'='一键报修';'11'='燃气商城';'12'='商品详情';'13'='购物车';'14'='提交订单';'15'='我的收藏';'16'='押金管理';'17'='退瓶退押金';'18'='气瓶下单';'19'='支付确认';'20'='订单中心';'21'='订单详情';'22'='配送详情';'23'='配送轨迹';'24'='电子发票';'25'='个人中心';'26'='我的记录';'27'='用气统计';'29'='地址管理';'30'='消息中心';'33'='家庭成员与设备共享';'39'='余额提现';'40'='银行卡管理';'41'='个人资料';'42'='报修工单详情'}
foreach ($a1Number in @('01','03','05','11','12','13','14','15','16','17','18','19','20','20-shop','21','21-gas','22','23','24','25','26','27','28','29','30','31','32','33','39','40','41','42')) {
$a1SourceNumber = $a1Number -replace '-(gas|shop)$', ''
$a1Name = if ($a1SourceNumber -eq '28') { '我的钱包' } elseif ($a1SourceNumber -eq '32') { '供气合同' } elseif ($a1SourceNumber -eq '31') { '设置' } else { $a1Names[$a1SourceNumber] }
$a1Reference = [System.Drawing.Image]::FromFile((Join-Path $a1Repo "doc/用户端APP-最新参考产品设计/$a1SourceNumber-$a1Name.png"))
$a1Actual = [System.Drawing.Image]::FromFile((Join-Path $a1Repo "docs/视觉验收/A1/${a1Number}_390_1.0.png"))
$a1TargetHeight = if ($a1SourceNumber -eq '30') { 856 } else { 844 }
$a1Canvas = [System.Drawing.Bitmap]::new(800, ($a1TargetHeight + 36))
$a1Graphics = [System.Drawing.Graphics]::FromImage($a1Canvas)
$a1Font = [System.Drawing.Font]::new('Microsoft YaHei', 10)
try {
$a1Graphics.Clear([System.Drawing.Color]::White)
$a1Graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$a1Graphics.DrawString('最新设计(等比缩放)', $a1Font, [System.Drawing.Brushes]::Black, 0, 5)
$a1Graphics.DrawString("实现 Fixture390 × $a1TargetHeight", $a1Font, [System.Drawing.Brushes]::Black, 410, 5)
$a1Scale = [math]::Min(390.0/$a1Reference.Width, $a1TargetHeight/$a1Reference.Height)
$a1Graphics.DrawImage($a1Reference, 0, 30, [int]($a1Reference.Width*$a1Scale), [int]($a1Reference.Height*$a1Scale))
$a1Graphics.DrawImage($a1Actual, 410, 30, 390, $a1TargetHeight)
$a1Canvas.Save((Join-Path $a1Repo "docs/视觉验收/A1/${a1Number}_并排对照.png"), [System.Drawing.Imaging.ImageFormat]::Png)
} finally {
$a1Font.Dispose()
$a1Graphics.Dispose()
$a1Canvas.Dispose()
$a1Reference.Dispose()
$a1Actual.Dispose()
}
}
Write-Output '已生成三十二组并排对照图(三十张设计,含订单列表与详情双分支);仅为差异检查,不代表视觉验收通过。'