From 13f61ef139e8955c7affe2374e91d2d2d1cac080 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 24 Jan 2022 10:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E9=80=89=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=94=B9;=20?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=88=B7=E6=96=B0=E6=9B=B4=E6=94=B9;=20?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E4=BC=98=E6=83=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9B=B4=E6=94=B9;=20=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=9B=B4=E6=94=B9;=20=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=A6=8F=E6=A0=BC=E6=98=BE=E7=A4=BA=E6=9B=B4?= =?UTF-8?q?=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_child_page.dart | 11 ++++++++--- .../community_view/community_dynamic.dart | 3 +-- lib/home/home_view/coupon.dart | 6 +++--- lib/home/home_view/featured_acticvity.dart | 6 +++--- lib/integral/integral_detailed_page.dart | 1 + lib/settlement/settlement.dart | 8 ++++++-- lib/settlement/settlement_view/coupon.dart | 4 ++-- .../settlement_view/settlement_coupon.dart | 2 +- .../settlement_order_commodity.dart | 17 ++++++++++++----- lib/store/store_view/product_sku.dart | 16 ++++++++-------- lib/store/store_view/shop_goods.dart | 2 +- lib/store/store_view/store_order_list.dart | 7 +------ lib/view_widget/custom_image.dart | 4 ++-- lib/view_widget/text_image_dialog.dart | 2 +- 14 files changed, 50 insertions(+), 39 deletions(-) diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 0295df8b..051bf228 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -27,8 +27,9 @@ class CommunityChildPage extends StatefulWidget { class _CommunityChildPage extends State { RefreshController refreshController = RefreshController(); ApiService apiService; - int pageNum = 0; + int pageNum = 1; String userId; + bool isLoadMore = false; List
articles = []; @@ -39,7 +40,6 @@ class _CommunityChildPage extends State { } _onRefresh() async { - pageNum = 0; setState(() {}); } @@ -54,7 +54,11 @@ class _CommunityChildPage extends State { token: value.getString("token"), ); } - pageNum += 1; + if(isLoadMore){ + pageNum += 1; + isLoadMore = false; + } + else pageNum = 1; BaseData> baseData = await apiService.trendList({ "onlyFollow": widget.typeStr == "关注" ? true : false, "onlyMe": false, @@ -113,6 +117,7 @@ class _CommunityChildPage extends State { ), onRefresh: _onRefresh, onLoading: () { + isLoadMore = true; setState(() {}); }, child: ListView.builder( diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 01ee9c1e..c87e5207 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -368,10 +368,9 @@ class _CommunityDynamic extends State { ); }, child: MImage( - cnt["images"][0].replaceAll(".jpg", ".jpg?imageView2/0/q/75"), + cnt["images"][0], fit: BoxFit.contain, radius: BorderRadius.circular(2), - width: MediaQuery.of(context).size.width/1.5, height:MediaQuery.of(context).size.width/1.5, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", diff --git a/lib/home/home_view/coupon.dart b/lib/home/home_view/coupon.dart index 0f1f42b8..7114a1d7 100644 --- a/lib/home/home_view/coupon.dart +++ b/lib/home/home_view/coupon.dart @@ -87,12 +87,12 @@ class _CouponView extends State { Widget couponItem(Coupon coupon) { return Container( - width: 0.9.sw, + width: 0.9, height: 122.h, child: Stack( children: [ Container( - width: 0.9.sw, + width: 0.9, height: 122.h, child: SvgPicture.asset( "assets/svg/youhuiquan_bg.svg", @@ -102,7 +102,7 @@ class _CouponView extends State { ), ), Container( - width: 0.9.sw, + width: 0.9, height: 122.h, child: Row( children: [ diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart index bab089a3..12324473 100644 --- a/lib/home/home_view/featured_acticvity.dart +++ b/lib/home/home_view/featured_acticvity.dart @@ -119,9 +119,9 @@ class _FeaturedActivity extends State { ), ), ), - SizedBox( - height: 5, - ), + // SizedBox( + // height: 5, + // ), // GestureDetector( // onTap: () { // Navigator.of(context).pushNamed('/router/web_page', diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index c943880c..390dcd7c 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index eb7905b2..3d120e31 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -307,7 +307,9 @@ class _Settlement extends State { } BaseData baseData = await minService .settlementWx(placeOrderFirst.toJson()) - .catchError((error) {}); + .catchError((error) { + print(error); + }); if (baseData != null && baseData.isSuccess) { WxPay wxPay = baseData.data; await registerWxApi( @@ -332,7 +334,9 @@ class _Settlement extends State { } else { BaseData baseData = await minService .settlementApi(placeOrderFirst.toJson()) - .catchError((error) {}); + .catchError((error) { + print(error); + }); if (baseData != null && baseData.isSuccess) { toOrderDetails(placeOrderFirst.id); } else { diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index bae2b62b..2eb17ba3 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -171,8 +171,8 @@ class _CouponWidget extends State { }, child: Image.asset( widget.selected - ? "assets/image/icon_radio_unselected.png" - : "assets/image/icon_radio_selected.png", + ? "assets/image/icon_radio_selected.png" + : "assets/image/icon_radio_unselected.png", width: 24, height: 24, ), diff --git a/lib/settlement/settlement_view/settlement_coupon.dart b/lib/settlement/settlement_view/settlement_coupon.dart index d9bf735f..a8469317 100644 --- a/lib/settlement/settlement_view/settlement_coupon.dart +++ b/lib/settlement/settlement_view/settlement_coupon.dart @@ -115,7 +115,7 @@ class _SettlementCoupon extends State { return CouponWidget( couponCan[position], widget.storeInfo, - selected: widget.couponBean == couponCan[position], + selected: widget?.couponBean?.id == couponCan[position]?.id, ); }, ), diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 67529d5b..ea89f6ab 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -122,7 +122,7 @@ class _SettlementOrderCommodity extends State { children: [ MImage( productList.skuImg, - width: 44.w, + width: 44, height: 44, fit: BoxFit.cover, errorSrc: "assets/image/default_1.png", @@ -342,10 +342,7 @@ class _SettlementOrderCommodity extends State { ), Container( child: Text( - "已优惠:¥${(widget.minOrderInfo != null) ? (double.parse(widget.minOrderInfo.discountAmount ?? "0") + double.parse(widget.settleOrderInfo.benefitDiscountAmount ?? "0")) : - (double.parse(widget.tableId <= 0 ? "0" : (widget.settleOrderInfo.discountAmount ?? "0")) - + double.parse(widget?.settleOrderInfo?.benefitDiscountAmount ?? "0")) - }", + "已优惠:¥${discountPrice()}", style: TextStyle( fontSize: 12.sp, color: Color(0xFF7B7B7B), @@ -384,6 +381,16 @@ class _SettlementOrderCommodity extends State { ); } + String discountPrice(){ + if(widget.minOrderInfo != null){ + return (widget.minOrderInfo.discountAmount ?? "0") + double.parse(widget.settleOrderInfo.benefitDiscountAmount ?? "0"); + }else if(widget.tableId < 0){ + return "0"; + }else { + return widget?.settleOrderInfo?.discountAmount ?? "0"; + } + } + String totalPrice() { if (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) { diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 8e7f6e0a..eb6b34b2 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -34,8 +34,8 @@ class ProductSku extends StatefulWidget { class _ProductSku extends State { List selectSkus = []; - int count = 1; + String selectedPrice = ""; @override void initState() { @@ -59,6 +59,7 @@ class _ProductSku extends State { return; } if (productSku == null) return; + selectedPrice = productSku.skuPrice; String skuId = productSku.id; if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return; int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id); @@ -98,6 +99,7 @@ class _ProductSku extends State { height: MediaQuery.of(context).size.height / 3 * 2, width: double.infinity, decoration: BoxDecoration( + // color: Color(0xFFFAFAFA), color: Color(0xFFFAFAFA), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), @@ -123,7 +125,7 @@ class _ProductSku extends State { SizedBox( width: 10, ), - Expanded(child: Column( + Expanded(child:Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -159,7 +161,7 @@ class _ProductSku extends State { ), ), Text( - widget.miNiDetail.price, + selectedPrice, style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 14.sp, @@ -169,9 +171,7 @@ class _ProductSku extends State { ], ), ], - )) - , - Spacer(), + )), InkWell( onTap: () { // Navigator.of(context).pop(); @@ -352,12 +352,12 @@ class _ProductSku extends State { Widget sweetnessItem(String name, bool isCheck) { return Container( child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: 70.w, - height: 29.h, + height:30.h, alignment: Alignment.center, decoration: BoxDecoration( color: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060), diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 56fd25d3..d8051136 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -198,7 +198,7 @@ class _ShopGoods extends State { ), ), if (widget.isShopCart || (widget.productListBean?.attrStyle??0) == 0) - InkWell( + GestureDetector( onTap: () { widget.add(widget.shoppingCartSkuItemListBean); }, diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index ae7cf7e8..0f4e50f4 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -230,11 +230,7 @@ class _StoreOrderListPage extends State { } }); } - return InkWell( - onTap: () { - widget.queryMiNiDetail(productListBeans[position].id,1); - }, - child: ShopGoods( + return ShopGoods( (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { widget.queryMiNiDetail(productListBeans[position].id,1); }, @@ -247,7 +243,6 @@ class _StoreOrderListPage extends State { isShopCart: false, queryMiNiDetail: widget.queryMiNiDetail, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, - ), ); } } diff --git a/lib/view_widget/custom_image.dart b/lib/view_widget/custom_image.dart index 8c9f81f6..e03f81d5 100644 --- a/lib/view_widget/custom_image.dart +++ b/lib/view_widget/custom_image.dart @@ -43,8 +43,8 @@ class MImage extends StatelessWidget { // } ///压缩图片 - if (src != "" && src.startsWith("http")) { - imageUrl = "$src?imageView2/1/w/${(constraints.constrainWidth() * scaleIndex).toInt()}/h/${(constraints.constrainHeight() * scaleIndex).toInt()}/format/jpg/q/75"; + if ((src??"").startsWith("http")) { + imageUrl = "$src?imageView2/1/format/jpg/q/50"; } // print("imageUrl:$imageUrl"); diff --git a/lib/view_widget/text_image_dialog.dart b/lib/view_widget/text_image_dialog.dart index 119fbddf..074f64ce 100644 --- a/lib/view_widget/text_image_dialog.dart +++ b/lib/view_widget/text_image_dialog.dart @@ -38,7 +38,7 @@ class _TextImageWidget extends State { child: Center( child: Container( width: double.infinity, - margin: EdgeInsets.symmetric(horizontal:16.w), + margin: EdgeInsets.symmetric(horizontal:26.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), decoration: BoxDecoration( color: Colors.white,