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',
|
||||
'格式:商品编号|商品名称|系列|规格|单位|库存数量|单价|金额|生产日期|批次|分类|所在仓库|入库日期|供应商|上次盘点|备注'),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user