From a9349517d50b22207dd871599cdb446ff602687f Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 3 Dec 2020 15:55:57 +0800 Subject: [PATCH 1/2] fix tax price display --- lib/models/price_model.dart | 33 ++++++++++++++----------- lib/models/price_model.g.dart | 8 +++--- lib/pages/home/classify/goods_page.dart | 2 +- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lib/models/price_model.dart b/lib/models/price_model.dart index aea6231..38523c7 100644 --- a/lib/models/price_model.dart +++ b/lib/models/price_model.dart @@ -12,53 +12,58 @@ part 'price_model.g.dart'; @JsonSerializable() class Price extends Object { - Min min; Max max; - Price(this.min,this.max,); + Price( + this.min, + this.max, + ); - factory Price.fromJson(Map srcJson) => _$PriceFromJson(srcJson); + factory Price.fromJson(Map srcJson) => + _$PriceFromJson(srcJson); Map toJson() => _$PriceToJson(this); - } - @JsonSerializable() class Min extends Object { - double originalPrice; double discountPrice; double commission; - Min(this.originalPrice,this.discountPrice,this.commission,); + double ferme; + + Min( + this.originalPrice, + this.discountPrice, + this.commission, + this.ferme, + ); factory Min.fromJson(Map srcJson) => _$MinFromJson(srcJson); Map toJson() => _$MinToJson(this); - } - @JsonSerializable() class Max extends Object { - double originalPrice; double discountPrice; double commission; - Max(this.originalPrice,this.discountPrice,this.commission,); + Max( + this.originalPrice, + this.discountPrice, + this.commission, + ); factory Max.fromJson(Map srcJson) => _$MaxFromJson(srcJson); Map toJson() => _$MaxToJson(this); - } - - diff --git a/lib/models/price_model.g.dart b/lib/models/price_model.g.dart index 66dab1b..82b4ab6 100644 --- a/lib/models/price_model.g.dart +++ b/lib/models/price_model.g.dart @@ -21,9 +21,11 @@ Map _$PriceToJson(Price instance) => Min _$MinFromJson(Map json) { return Min( - (json['originalPrice'] as num)?.toDouble(), - (json['discountPrice'] as num)?.toDouble(), - (json['commission'] as num)?.toDouble()); + (json['originalPrice'] as num)?.toDouble(), + (json['discountPrice'] as num)?.toDouble(), + (json['commission'] as num)?.toDouble(), + (json['ferme'] as num)?.toDouble(), + ); } Map _$MinToJson(Min instance) => { diff --git a/lib/pages/home/classify/goods_page.dart b/lib/pages/home/classify/goods_page.dart index 2a327c3..4a1db90 100644 --- a/lib/pages/home/classify/goods_page.dart +++ b/lib/pages/home/classify/goods_page.dart @@ -663,7 +663,7 @@ class _GoodsPageState extends BaseStoreState { widget.goodsDetail.data.isFerme == 1 ? rWBox(10) : SizedBox(), widget.goodsDetail.data.isFerme == 1 ? Text( - '预计¥${(widget.goodsDetail.data.price.min.originalPrice * 1.2 * 0.091).toStringAsFixed(2)}由瑞库客承担', + '预计¥${widget.goodsDetail.data.price.min.ferme.toStringAsFixed(2)}由瑞库客承担', style: TextStyle( fontSize: rSP(13), color: Color(0xFF535353), From f15165d6de393834996245244c6ea4354c26cd35 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 3 Dec 2020 16:27:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BF=9B=E5=8F=A3=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E9=A1=B5=E9=9D=A2=E9=9C=80=E8=A6=81=E5=90=8C?= =?UTF-8?q?=E6=84=8F=E6=89=8D=E8=83=BD=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/classify/goods_page.dart | 4 ++-- lib/pages/home/classify/order_preview_page.dart | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/pages/home/classify/goods_page.dart b/lib/pages/home/classify/goods_page.dart index 4a1db90..3868bbb 100644 --- a/lib/pages/home/classify/goods_page.dart +++ b/lib/pages/home/classify/goods_page.dart @@ -839,7 +839,7 @@ class _GoodsPageState extends BaseStoreState { break; } return Image.asset( - _address?.city == null ? text : text2, + _address?.city == '' ? text : text2, height: rSize(26), width: rSize(26), ); @@ -891,7 +891,7 @@ class _GoodsPageState extends BaseStoreState { Column( children: [ Image.asset( - _address?.city == null + _address?.city == '' ? R.ASSETS_STATIC_OVERSEA_LOCATION_PNG : R.ASSETS_STATIC_OVERSEA_LOCATION_ON_PNG, height: rSize(26), diff --git a/lib/pages/home/classify/order_preview_page.dart b/lib/pages/home/classify/order_preview_page.dart index 12110ad..c739dbc 100644 --- a/lib/pages/home/classify/order_preview_page.dart +++ b/lib/pages/home/classify/order_preview_page.dart @@ -778,10 +778,19 @@ class _GoodsOrderPageState extends BaseStoreState { } Container _bottomBar(BuildContext context, int totalNum) { + bool isOversea = false; + for (var item in _orderModel.data.brands) { + for (var childItem in item.goods) { + if (childItem.isImport == 1) isOversea = true; + } + } // bool canDeliver = _orderModel.data.addr?.isDeliveryArea == 1 || // (_orderModel.data.addr?.isDeliveryArea == 0 && _orderModel.data.shippingMethod == 1); bool canDeliver = _orderModel.data.addr?.isDeliveryArea == 1 || (_orderModel.data.shippingMethod == 1); + if (isOversea) { + if (!_accept) canDeliver = false; + } double ruiCoin = 0; _orderModel.data.brands.forEach((brand) { brand.goods.forEach((good) {