diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 16b1dda1..d2473e87 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -466,10 +466,10 @@ class _StoreOrderPage extends State return ShopCar( productLists, _queryMiNiDetail, - (allCount, allPrice) { + (ProductListBean productListBeans) { setState(() { - this.allCount = allCount; - this.allPrice = allPrice; + // this.allCount = allCount; + // this.allPrice = allPrice; }); }, ); diff --git a/lib/store/store_view/shop_car.dart b/lib/store/store_view/shop_car.dart index 25e4ec33..8ed3e9bd 100644 --- a/lib/store/store_view/shop_car.dart +++ b/lib/store/store_view/shop_car.dart @@ -11,7 +11,7 @@ class ShopCar extends StatefulWidget { final List productLists; final Function(String id) queryMiNiDetail; - final Function(int allCount, double allPrice) fc; + final Function(ProductListBean productListBeans) fc; ShopCar( this.productLists, @@ -27,12 +27,11 @@ class ShopCar extends StatefulWidget { class _ShopCar extends State { - int allCount; - double allPrice; - int allCount = 0; double allPrice = 0; + ProductListBean productListBeans; + @override void initState() { super.initState(); @@ -59,8 +58,7 @@ class _ShopCar extends State { } widget.productLists.forEach((element) { allCount += element.buyNum; - allPrice += double.parse(element.price) * - element.buyNum; + allPrice += double.parse(element.price) * element.buyNum; }); }); } @@ -125,8 +123,7 @@ class _ShopCar extends State { ), child: ListView.builder( itemCount: widget.productLists == null - ? 0 - : widget.productLists.length, + ? 0 : widget.productLists.length, physics: BouncingScrollPhysics(), itemBuilder: (context, position) { return GestureDetector( @@ -135,11 +132,10 @@ class _ShopCar extends State { widget.productLists, position, widget.queryMiNiDetail, - (int allCount, double allPrice){ - widget.fc(allCount, allPrice); + (ProductListBean productListBeans){ + widget.fc(productListBeans); setState(() { - this.allCount = allCount; - this.allPrice = allPrice; + this.productListBeans = productListBeans; }); }, ), diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index c8c81c01..a6944721 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -10,7 +10,7 @@ class ShopGoods extends StatefulWidget { final List productListBeans; final int position; final Function(String id) queryMiNiDetail; - final Function(int allCount, double allPrice) fc; + final Function(ProductListBean productListBeans) fc; ShopGoods( this.productListBeans, @@ -205,7 +205,7 @@ class _ShopGoods extends State { ), ], ), - ) + ), ], ), ); diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index d40b197c..7fdc9a23 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -67,7 +67,6 @@ class _StoreOrderListPage extends State { appletGoods(); - widget.controller.addListener(() {}); } ///小程序查询分组及商品列表