chore: release v1.0.3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ class PageResult<T> {
|
||||
T Function(Map<String, dynamic>) fromJson,
|
||||
) {
|
||||
return PageResult(
|
||||
data: (json['data'] as List)
|
||||
data: ((json['data'] as List?) ?? [])
|
||||
.map((e) => fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
total: json['total'] as int,
|
||||
|
||||
@@ -46,72 +46,76 @@ Future<void> printProductLabelImpl({
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&family=Noto+Serif+SC:wght@700&family=IBM+Plex+Mono:wght@400&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&family=IBM+Plex+Mono:wght@400&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
/* 标签尺寸:20mm × 38mm,竖向 */
|
||||
@page { size: 20mm 38mm; margin: 0; }
|
||||
/* 标签尺寸:38mm × 20mm,横向 */
|
||||
@page { size: 38mm 20mm; margin: 0; }
|
||||
* { box-sizing: border-box; margin: 0; padding: 0;
|
||||
-webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
||||
body { width: 20mm; height: 38mm; overflow: hidden; background: #fff; }
|
||||
body { width: 38mm; height: 20mm; overflow: hidden; background: #fff; }
|
||||
|
||||
.label {
|
||||
width: 20mm; height: 38mm;
|
||||
width: 38mm; height: 20mm;
|
||||
display: flex; flex-direction: column;
|
||||
font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
/* ── Header:酒行名称 5.5mm ── */
|
||||
/* ── Header:酒行名称 3.5mm ── */
|
||||
.hdr {
|
||||
background: #1f2a3a; color: #f4ecd8;
|
||||
height: 5.5mm; flex-shrink: 0;
|
||||
height: 3.5mm; flex-shrink: 0;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
padding: 0 1mm; overflow: hidden;
|
||||
padding: 0 1.5mm; overflow: hidden;
|
||||
}
|
||||
.hdr-name {
|
||||
font-size: 6pt; font-weight: 700; letter-spacing: 0.06em;
|
||||
font-size: 5.5pt; font-weight: 700; letter-spacing: 0.08em;
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ── 商品名 7mm ── */
|
||||
.product-name {
|
||||
height: 7mm; flex-shrink: 0;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
padding: 0 1mm;
|
||||
font-size: 7pt; font-weight: 700; letter-spacing: 0.03em;
|
||||
text-align: center; line-height: 1.2;
|
||||
/* ── 中部:左侧商品信息 + 右侧二维码 ── */
|
||||
.middle {
|
||||
flex: 1; display: flex; flex-direction: row; overflow: hidden;
|
||||
}
|
||||
|
||||
/* 左:商品名 + 规格批次 */
|
||||
.info {
|
||||
flex: 1; display: flex; flex-direction: column;
|
||||
justify-content: center; padding: 0.8mm 1mm 0.5mm 1.5mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── QR 码区 15mm ── */
|
||||
.qr-wrap {
|
||||
height: 15mm; flex-shrink: 0;
|
||||
display: flex; flex-direction: column;
|
||||
align-items: center; justify-content: center; gap: 0.5mm;
|
||||
.product-name {
|
||||
font-size: 6.5pt; font-weight: 700; line-height: 1.2;
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
margin-bottom: 0.8mm;
|
||||
}
|
||||
.qr-wrap img { width: 13.5mm; height: 13.5mm; object-fit: contain; }
|
||||
.qr-cap { font-size: 4pt; color: #888; letter-spacing: 0.12em; }
|
||||
|
||||
/* ── 规格/批次 7.5mm ── */
|
||||
.specs {
|
||||
flex: 1; padding: 0.5mm 1.5mm;
|
||||
display: flex; flex-direction: column; justify-content: center; gap: 0.8mm;
|
||||
display: flex; flex-direction: column; gap: 0.5mm;
|
||||
}
|
||||
.spec-row {
|
||||
display: flex; gap: 1mm; align-items: baseline;
|
||||
font-size: 5pt; white-space: nowrap; overflow: hidden;
|
||||
display: flex; gap: 0.8mm; align-items: baseline;
|
||||
font-size: 4pt; white-space: nowrap; overflow: hidden;
|
||||
}
|
||||
.lbl { color: #888; flex-shrink: 0; }
|
||||
.lbl { color: #999; flex-shrink: 0; }
|
||||
.val { font-family: "IBM Plex Mono", monospace;
|
||||
overflow: hidden; text-overflow: ellipsis; }
|
||||
|
||||
/* 右:二维码 */
|
||||
.qr-wrap {
|
||||
width: 14mm; flex-shrink: 0;
|
||||
display: flex; flex-direction: column;
|
||||
align-items: center; justify-content: center; gap: 0.3mm;
|
||||
padding: 0.5mm 0.5mm 0.5mm 0;
|
||||
}
|
||||
.qr-wrap img { width: 12mm; height: 12mm; object-fit: contain; }
|
||||
.qr-cap { font-size: 3pt; color: #aaa; letter-spacing: 0.1em; }
|
||||
|
||||
/* ── Footer:联系方式 3mm ── */
|
||||
.ftr {
|
||||
background: #f4ecd8; height: 3mm; flex-shrink: 0;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
padding: 0 1mm;
|
||||
font-size: 4pt; color: #5a4e35; overflow: hidden; white-space: nowrap;
|
||||
padding: 0 1.5mm;
|
||||
font-size: 3.5pt; color: #5a4e35; overflow: hidden; white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
@@ -123,17 +127,19 @@ body { width: 20mm; height: 38mm; overflow: hidden; background: #fff; }
|
||||
<span class="hdr-name">$shopName</span>
|
||||
</div>
|
||||
|
||||
<div class="product-name">$name</div>
|
||||
|
||||
<div class="qr-wrap">
|
||||
<img src="data:image/png;base64,$base64Img" />
|
||||
<div class="qr-cap">扫码溯源</div>
|
||||
</div>
|
||||
|
||||
<div class="specs">
|
||||
<div class="spec-row"><span class="lbl">规</span><span class="val">$specVal</span></div>
|
||||
<div class="spec-row"><span class="lbl">批</span><span class="val">$batchVal</span></div>
|
||||
<div class="spec-row"><span class="lbl">产</span><span class="val">$dateVal</span></div>
|
||||
<div class="middle">
|
||||
<div class="info">
|
||||
<div class="product-name">$name</div>
|
||||
<div class="specs">
|
||||
<div class="spec-row"><span class="lbl">规</span><span class="val">$specVal</span></div>
|
||||
<div class="spec-row"><span class="lbl">批</span><span class="val">$batchVal</span></div>
|
||||
<div class="spec-row"><span class="lbl">产</span><span class="val">$dateVal</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-wrap">
|
||||
<img src="data:image/png;base64,$base64Img" />
|
||||
<div class="qr-cap">扫码溯源</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ftr">${contactLine.isNotEmpty ? contactLine : shopName}</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ class NumberRuleRepository {
|
||||
Future<List<NumberRule>> list() async {
|
||||
try {
|
||||
final resp = await _client.get('/number-rules');
|
||||
final data = resp.data['data'] as List;
|
||||
final data = (resp.data['data'] as List?) ?? [];
|
||||
return data
|
||||
.map((e) => NumberRule.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
@@ -7,7 +7,7 @@ class UserRepository {
|
||||
|
||||
Future<List<AppUser>> list() async {
|
||||
final resp = await _client.get('/users');
|
||||
final data = resp.data['data'] as List;
|
||||
final data = (resp.data['data'] as List?) ?? [];
|
||||
return data.map((e) => AppUser.fromJson(e as Map<String, dynamic>)).toList();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class WarehouseRepository {
|
||||
try {
|
||||
final resp = await _client.get('/warehouses');
|
||||
final body = resp.data as Map<String, dynamic>;
|
||||
final raw = body['data'] as List;
|
||||
final raw = (body['data'] as List?) ?? [];
|
||||
return raw
|
||||
.map((e) => Warehouse.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../core/auth/auth_state.dart';
|
||||
import '../../core/config/app_config.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/storage/login_history.dart';
|
||||
import '../../providers/connectivity_provider.dart';
|
||||
@@ -488,13 +489,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
const SizedBox(height: 12),
|
||||
TextButton(
|
||||
onPressed: () => launchUrl(
|
||||
Uri.parse('https://jiu.51yanmei.com/register/'),
|
||||
Uri.parse('${AppConfig.publicBaseUrl}/register/'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
child: const Text(
|
||||
'还没有门店账号?前往官网注册',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontSize: 15,
|
||||
color: AppTheme.textSecondary,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -386,7 +386,6 @@ class _InventoryListScreenState extends ConsumerState<InventoryListScreen> {
|
||||
DataCell(SizedBox()),
|
||||
DataCell(SizedBox()),
|
||||
DataCell(SizedBox()),
|
||||
DataCell(SizedBox()),
|
||||
])
|
||||
]
|
||||
: filteredItems
|
||||
|
||||
@@ -1578,8 +1578,6 @@ class _BatchImportWidgetState extends ConsumerState<_BatchImportWidget> {
|
||||
'格式:选项编号 | 选项名称 | 备注'),
|
||||
_ImportSlot('商品规格', '/import/product-specs',
|
||||
'格式:选项编号 | 选项名称 | 单品数量 | 备注'),
|
||||
_ImportSlot('商品编码', '/import/product-codes',
|
||||
'格式:商品编码:xxxx'),
|
||||
_ImportSlot('库存', '/import/inventory',
|
||||
'格式:商品编号|商品名称|系列|规格|单位|库存数量|单价|金额|生产日期|批次|分类|所在仓库|入库日期|供应商|上次盘点|备注'),
|
||||
];
|
||||
|
||||
+12
-28
@@ -69,10 +69,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_assets
|
||||
sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687"
|
||||
sha256: "67cf6d84013f9c601e42a6f8a6b74c4c0d9dc1a1619d775f2b28b732d3551b85"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.2.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -205,14 +205,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
go_router:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -225,10 +217,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: hooks
|
||||
sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e"
|
||||
sha256: a41af4e8fc687cd6d33de9751eb936c8c0204ebe2bcb6c15ecf707504bf47f31
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "2.0.0"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -373,22 +365,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
native_toolchain_c:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: native_toolchain_c
|
||||
sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.17.6"
|
||||
objective_c:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: objective_c
|
||||
sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52"
|
||||
sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.3.0"
|
||||
version: "9.4.1"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -694,10 +678,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_android
|
||||
sha256: "3bb000251e55d4a209aa0e2e563309dc9bb2befea2295fd0cec1f51760aac572"
|
||||
sha256: "17bc677f0b301615530dd1d67e0a9828cafa2d0b6b6eae4cd3679b7eac4a273c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.3.29"
|
||||
version: "6.3.30"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -734,10 +718,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_web
|
||||
sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f
|
||||
sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.2"
|
||||
version: "2.4.3"
|
||||
url_launcher_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -758,10 +742,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
||||
sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "15.0.2"
|
||||
version: "15.2.0"
|
||||
web:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user