From e74e8bc03ddf6f9213afa264896606734f35b552 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 13 Jan 2022 10:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=B4=AD=E4=B9=B0,=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=9C=89=E9=97=AE=E9=A2=98;=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E6=89=80=E6=9C=89=E5=95=86=E5=93=81=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E8=B4=AD=E4=B9=B0;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopping/shopping_goods_details.dart | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index b73418c6..70c9bd93 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -141,7 +141,6 @@ class _ShoppingGoodsDetails extends State { queryMiNiDetail(id); } else { queryMiNiDetail(productId); - queryViewProduct(actProductId, pageType); } EasyLoading.dismiss(); } @@ -184,6 +183,8 @@ class _ShoppingGoodsDetails extends State { if (baseData != null && baseData.isSuccess) { setState(() { miNiDetail = baseData.data; + if(pageType != null) + queryViewProduct(actProductId, pageType); }); refreshController.refreshCompleted(); } else { @@ -210,6 +211,15 @@ class _ShoppingGoodsDetails extends State { if (baseData != null && baseData.isSuccess) { setState(() { activityDetails = baseData.data; + miNiDetail.productSkuVOList.forEach((element) { + var sku = activityDetails.actProduct.skuJson.firstWhere((ele) => ele.skuId == element.id); + if(sku == null ){ + miNiDetail.productSkuVOList.remove(sku); + }else{ + element.skuPrice = sku.skuPrice.toString(); + element.skuStock = sku.skuStock.toInt(); + } + }); }); refreshController.refreshCompleted(); } else { @@ -279,7 +289,7 @@ class _ShoppingGoodsDetails extends State { } ///选规格添加购物车 - Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count) async { + Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count,) async { if (selectSkus != null && selectSkus.length == 0) { productSku = miNiDetail.productSkuVOList.first; } else { @@ -300,12 +310,14 @@ class _ShoppingGoodsDetails extends State { .toString() .replaceAll("[", "") .replaceAll("]", "") - .replaceAll(",", ""); + .replaceAll(",", "") + ; setState(() { skuId1 = skuId; skuValue1 = skuValue; count1 = count; }); + } ///商品➕1 @@ -673,7 +685,7 @@ class _ShoppingGoodsDetails extends State { children: [ GestureDetector( onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details'); + toDownOrder(); }, child: Container( alignment: Alignment.center, @@ -727,7 +739,7 @@ class _ShoppingGoodsDetails extends State { ), GestureDetector( onTap: (){ - Navigator.of(context).popAndPushNamed('/router/bargain_details'); + toDownOrder(); }, child: Container( alignment: Alignment.center, @@ -791,7 +803,7 @@ class _ShoppingGoodsDetails extends State { children: [ GestureDetector( onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details'); + toDownOrder(); }, child: Container( alignment: Alignment.center, @@ -910,7 +922,7 @@ class _ShoppingGoodsDetails extends State { children: [ GestureDetector( onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details'); + toDownOrder(); }, child: Container( alignment: Alignment.center, @@ -964,6 +976,7 @@ class _ShoppingGoodsDetails extends State { ), GestureDetector( onTap: (){ + toDownOrder(); }, child: Container( alignment: Alignment.center,