Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcc0fd988b |
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.68] - 2026-06-21
|
||||||
|
|
||||||
|
### 改进
|
||||||
|
- 店铺公开商品页:每个商品卡片显示「在库 N」数量,且只展示有货商品
|
||||||
|
|
||||||
## [1.0.67] - 2026-06-21
|
## [1.0.67] - 2026-06-21
|
||||||
|
|
||||||
### 改进
|
### 改进
|
||||||
|
|||||||
@@ -269,6 +269,12 @@ class _ProductCard extends StatelessWidget {
|
|||||||
final name = item['name'] as String? ?? '';
|
final name = item['name'] as String? ?? '';
|
||||||
final series = item['series'] as String? ?? '';
|
final series = item['series'] as String? ?? '';
|
||||||
final spec = item['spec'] as String? ?? '';
|
final spec = item['spec'] as String? ?? '';
|
||||||
|
final unit = item['unit'] as String? ?? '';
|
||||||
|
final qtyNum = (item['quantity'] as num?)?.toDouble() ?? 0;
|
||||||
|
// 去掉整数的 .0 尾巴:5.0 → 5,1.5 → 1.5
|
||||||
|
final qtyStr = qtyNum == qtyNum.roundToDouble()
|
||||||
|
? qtyNum.toInt().toString()
|
||||||
|
: qtyNum.toString();
|
||||||
final images = (item['images'] as List<dynamic>? ?? [])
|
final images = (item['images'] as List<dynamic>? ?? [])
|
||||||
.cast<Map<String, dynamic>>();
|
.cast<Map<String, dynamic>>();
|
||||||
final imageUrl = images.isNotEmpty
|
final imageUrl = images.isNotEmpty
|
||||||
@@ -339,7 +345,18 @@ class _ProductCard extends StatelessWidget {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Spacer(),
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
'在库 $qtyStr$unit',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
color: _kBurgundy,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8, vertical: 3),
|
horizontal: 8, vertical: 3),
|
||||||
|
|||||||
Reference in New Issue
Block a user