|
|
@@ -193,8 +193,8 @@ class _IntellectSearchGoodsDialogState extends State<IntellectSearchGoodsDialog> |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
formatNum((num.tryParse(widget?.model?.price ?? "0") - num.tryParse(widget?.model?.couponPrice ?? "0")), 2), |
|
|
|
// ().toStringAsFixed(2) ?? "", |
|
|
|
// formatNum((num.tryParse(widget?.model?.price ?? "0") - num.tryParse(widget?.model?.couponPrice ?? "0")), 2), |
|
|
|
widget?.model?.finalPrice ?? '0', |
|
|
|
maxLines: 1, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16, |
|
|
@@ -213,7 +213,8 @@ class _IntellectSearchGoodsDialogState extends State<IntellectSearchGoodsDialog> |
|
|
|
|
|
|
|
// 取两位小数,不进行四舍五入 |
|
|
|
String formatNum(var num, int position) { |
|
|
|
String rlt = '0'; |
|
|
|
String rlt = num?.toString() ?? '0'; |
|
|
|
if (rlt.indexOf('.') == -1) return rlt; |
|
|
|
if ((num.toString().length - num.toString().lastIndexOf(".") - 1) < position) { |
|
|
|
//小数点后有几位小数 |
|
|
|
rlt = num.toStringAsFixed(position).substring(0, num.toString().lastIndexOf(".") + position + 1).toString(); |
|
|
@@ -239,10 +240,10 @@ class _IntellectSearchGoodsDialogState extends State<IntellectSearchGoodsDialog> |
|
|
|
child: Center( |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.all(12.0), |
|
|
|
child: Text( |
|
|
|
child: Text( // 立省按钮文字 |
|
|
|
(_styleModel?.moduleList?.saveBtn?.content ?? "") + |
|
|
|
" ¥" + |
|
|
|
formatNum((num.tryParse(widget?.model?.couponPrice ?? "0") ?? 0) + num.tryParse(widget?.model?.commission ?? '0'), 2), |
|
|
|
" ¥" + widget?.model?.earnPrice ?? '0' , |
|
|
|
// formatNum((num.tryParse(widget?.model?.couponPrice ?? "0") ?? 0) + num.tryParse(widget?.model?.commission ?? '0'), 2), |
|
|
|
style: TextStyle(color: HexColor.fromHex(_styleModel?.moduleList?.saveBtn?.fontColor), fontSize: 12), |
|
|
|
), |
|
|
|
)), |
|
|
|