|
@@ -250,11 +250,8 @@ class _IntellectSearchGoodsDialogState |
|
|
), |
|
|
), |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: Text( |
|
|
child: Text( |
|
|
(num.tryParse(widget?.model?.price ?? "0") - |
|
|
|
|
|
num.tryParse( |
|
|
|
|
|
widget?.model?.couponPrice ?? "0")) |
|
|
|
|
|
.toStringAsFixed(2) ?? |
|
|
|
|
|
"", |
|
|
|
|
|
|
|
|
formatNum((num.tryParse(widget?.model?.price ?? "0") - num.tryParse(widget?.model?.couponPrice ?? "0")), 2), |
|
|
|
|
|
// ().toStringAsFixed(2) ?? "", |
|
|
maxLines: 1, |
|
|
maxLines: 1, |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 16, |
|
|
fontSize: 16, |
|
@@ -272,6 +269,18 @@ class _IntellectSearchGoodsDialogState |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 取两位小数,不进行四舍五入 |
|
|
|
|
|
String formatNum(var num, int position) { |
|
|
|
|
|
String rlt = '0'; |
|
|
|
|
|
if ((num.toString().length - num.toString().lastIndexOf(".") - 1) < position) { |
|
|
|
|
|
//小数点后有几位小数 |
|
|
|
|
|
rlt = num.toStringAsFixed(position).substring(0, num.toString().lastIndexOf(".") + position + 1).toString(); |
|
|
|
|
|
} else { |
|
|
|
|
|
rlt = num.toString().substring(0, num.toString().lastIndexOf(".") + position + 1).toString(); |
|
|
|
|
|
} |
|
|
|
|
|
return rlt; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
_buildBottomItem() { |
|
|
_buildBottomItem() { |
|
|
return Column( |
|
|
return Column( |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
@@ -294,10 +303,7 @@ class _IntellectSearchGoodsDialogState |
|
|
child: Text( |
|
|
child: Text( |
|
|
(_styleModel?.moduleList?.saveBtn?.content ?? "") + |
|
|
(_styleModel?.moduleList?.saveBtn?.content ?? "") + |
|
|
" ¥" + |
|
|
" ¥" + |
|
|
((num.tryParse(widget?.model?.couponPrice ?? "0") ?? |
|
|
|
|
|
0) + |
|
|
|
|
|
num.tryParse(widget?.model?.commission ?? '0')) |
|
|
|
|
|
.toString(), |
|
|
|
|
|
|
|
|
formatNum((num.tryParse(widget?.model?.couponPrice ?? "0") ?? 0) + num.tryParse(widget?.model?.commission ?? '0'), 2), |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
color: HexColor.fromHex( |
|
|
color: HexColor.fromHex( |
|
|
_styleModel?.moduleList?.saveBtn?.fontColor), |
|
|
_styleModel?.moduleList?.saveBtn?.fontColor), |
|
|