From b91af0947d18dd9d0476d38319c8b9f482289afd Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 19 Jun 2023 16:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E7=AE=80=E4=BB=8B=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=BF=AE=E6=94=B9=EF=BC=9B=20=E6=88=91?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8D=B0=E7=AB=A0=E5=8D=A1?= =?UTF-8?q?=E6=94=B9=E9=9B=86=E6=8D=A2=E5=8D=A1=EF=BC=9B=20=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E4=B8=AD=E5=BF=83=E6=96=B0=E5=A2=9E=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0=EF=BC=9B=20=E6=96=B0=E5=A2=9E=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=BA=A2=E5=87=BA=E5=A4=84=E7=90=86=EF=BC=9B=20?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B0=E5=A2=9E=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E6=98=8E=E7=BB=86=E6=98=BE=E7=A4=BA=EF=BC=9B=20?= =?UTF-8?q?=E5=85=B3=E4=BA=8E=E5=9B=9E=E4=B9=A1=EF=BC=8C=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=EF=BC=9B=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=BB=93=E7=AE=97=E9=A1=B5=E6=94=AF=E4=BB=98=E6=96=B9?= =?UTF-8?q?=E5=BC=8FgetOrderIfo=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E6=89=93?= =?UTF-8?q?=E5=8C=85=E8=B4=B9=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=20=E9=A6=96=E9=A1=B5=E7=A6=8F=E5=88=A9=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC=E6=9B=B4=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=20=E5=85=91=E6=8D=A2=E7=A6=8F=E5=88=A9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=AD=A3=E5=9C=A8=E5=8A=A0=E8=BD=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/class_details.dart | 3 +- lib/home/home_view/welfare_core.dart | 4 +- lib/home/huixiang_view/origin_info.dart | 1 + lib/home/welfare_exchange.dart | 2 + lib/mine/mine_view/mine_navbar.dart | 2 +- lib/mine/mine_vip/mine_vip_core.dart | 3 +- lib/order/order_detail_page.dart | 4 +- lib/order/order_view/order_commodity.dart | 210 ++++++++++++------ lib/settlement/settlement.dart | 46 ++-- .../settlement_order_commodity.dart | 2 +- lib/view_widget/no_data_view.dart | 66 +++--- 11 files changed, 205 insertions(+), 138 deletions(-) diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index f1f5e2f9..6087a3f9 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -412,7 +412,8 @@ class _ClassDetails extends State with WidgetsBindingObserver { color: Colors.black, ), ), - SizedBox(height: 3.h), + SizedBox(height: 5.h), + if((course?.introduce ?? "").length > 50) GestureDetector( onTap: () { setState(() { diff --git a/lib/home/home_view/welfare_core.dart b/lib/home/home_view/welfare_core.dart index b4d2077d..f19f97f5 100644 --- a/lib/home/home_view/welfare_core.dart +++ b/lib/home/home_view/welfare_core.dart @@ -105,7 +105,7 @@ class _WelfareCore extends State { SizedBox(width: 10.w,), Expanded(child: GestureDetector( onTap: (){ - Navigator.of(context).pushNamed('/router/welfare_page'); + Navigator.of(context).pushNamed('/router/invite_friends'); }, child:Container( width: double.infinity, @@ -144,7 +144,7 @@ class _WelfareCore extends State { SizedBox(width: 10.w,), Expanded(child: GestureDetector( onTap: (){ - Navigator.of(context).pushNamed('/router/welfare_page'); + Navigator.of(context).pushNamed('/router/welfare_exchange'); }, child:Container( width: double.infinity, diff --git a/lib/home/huixiang_view/origin_info.dart b/lib/home/huixiang_view/origin_info.dart index a825efa6..a28e1893 100644 --- a/lib/home/huixiang_view/origin_info.dart +++ b/lib/home/huixiang_view/origin_info.dart @@ -108,6 +108,7 @@ class _OriginInfo extends State { ), ), SizedBox(height: 3.h), + if((widget?.founder?.description ?? "").length > 35) GestureDetector( onTap: () { setState(() { diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 003d1f26..90b43d9f 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -62,10 +62,12 @@ class _WelfareExchange extends State } queryUser() async { + EasyLoading.show(status: S.current.zhengzaijiazai); BaseData baseData = await apiService.queryInfo().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; + EasyLoading.dismiss(); setState(() {}); SharedPreferences.getInstance().then((value) => { value.setString('user', jsonEncode(baseData.data)), diff --git a/lib/mine/mine_view/mine_navbar.dart b/lib/mine/mine_view/mine_navbar.dart index 49063640..03e6cf03 100644 --- a/lib/mine/mine_view/mine_navbar.dart +++ b/lib/mine/mine_view/mine_navbar.dart @@ -246,7 +246,7 @@ class _MineNavbar extends State { }, child: mineBottomItem( widget?.userInfo?.happyBean?? "0", - "印章卡", + S.of(context).jihuanka, ), ), ), diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 25989262..f9447fd1 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -72,7 +72,7 @@ class _MineVipCore extends State { // value.setBool("FirstGongC", true); // } apiService = - ApiService(Dio(), context: context, token: value.getString("token")); + ApiService(Dio(), context: context, showLoading: false,token: value.getString("token")); queryVipLevel(); queryBenefitList(); queryRuleDetails(); @@ -204,7 +204,6 @@ class _MineVipCore extends State { await queryRuleDetails(); } - @override Widget build(BuildContext context) { return Container( diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 4c658729..e7837eeb 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -44,12 +44,12 @@ class _OrderDetailPage extends State { @override void initState() { super.initState(); + jumpState = widget.arguments["jumpState"]; SharedPreferences.getInstance().then((value) { apiService = ApiService(Dio(), - context: context, token: value.getString("token"), showLoading: true); + context: context, token: value.getString("token"), showLoading: jumpState == 2? true:false); queryDetails(); }); - jumpState = widget.arguments["jumpState"]; } /// 小程序登录 diff --git a/lib/order/order_view/order_commodity.dart b/lib/order/order_view/order_commodity.dart index f251faa5..beae0d51 100644 --- a/lib/order/order_view/order_commodity.dart +++ b/lib/order/order_view/order_commodity.dart @@ -9,6 +9,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/separator.dart'; +import '../../retrofit/data/shoppingCart.dart'; import '../../utils/flutter_utils.dart'; class OrderCommodity extends StatefulWidget { @@ -182,95 +183,160 @@ class _OrderCommodity extends State { Widget commodityItem(OrderProductVOList productList) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( children: [ - MImage( - productList.skuImg, - width: 49, - height: 49, - fit: BoxFit.cover, - radius: BorderRadius.circular(2), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.only( - left: 8.w, + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MImage( + productList.skuImg, + width: 49, + height: 49, + fit: BoxFit.cover, + radius: BorderRadius.circular(2), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), - // height: 44.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - productList.productName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 4.h, + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only( + left: 8.w, ), - Text( - productList.skuNameStr != null - ? "${productList.skuNameStr ?? ""}" - : "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFFA29E9E), - ), + // height: 44.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + productList.productName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + productList.skuNameStr != null + ? "${productList.skuNameStr ?? ""}" + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + Text( + "x${productList.buyNum}", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF727272), + ), + ), + ], ), + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ Text( - "x${productList.buyNum}", + productList.buyNum > 1 + ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) + : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF727272), + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF4C4C4C), ), ), + if (productList.discountAmount != null && productList.discountAmount != "0") + Text( + S.of(context).yuan_(productList.sellPrice), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + decoration: TextDecoration.lineThrough, + color: Color(0xFFA29E9E), + ), + ) ], ), - ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - productList.buyNum > 1 - ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) - : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFF4C4C4C), - ), - ), - if (productList.discountAmount != null && productList.discountAmount != "0") - Text( - S.of(context).yuan_(productList.sellPrice), - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - decoration: TextDecoration.lineThrough, - color: Color(0xFFA29E9E), - ), - ) ], ), + if (productList.setMealDataList.length != 0) + ListView.builder( + itemCount: productList.setMealDataList.length, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.zero, + itemBuilder: (context, index) { + return orderMealsItem(productList.setMealDataList[index]); + }, + ), ], ), ); } + Widget orderMealsItem(SetMealDataList setMealDataList) { + return Column(children: setMealDataList.productInfoList.map((e) { + return Container( + margin: EdgeInsets.symmetric( + vertical: 10.h, + ), + child: Row( + children: [ + Expanded( + flex: 2, + child: Text( + e.productName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffA29E9E), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Expanded( + flex: 3, + child: Text( + "${(e.skuName == "") ? "" : e.skuName}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffA29E9E), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Text( + "x${e.buyNumber.toString()}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffFF7A1A), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ); + }).toList(),); + } + Widget discountItem(Color color, textName, condition, amount) { return Container( margin: EdgeInsets.only(top: 9.h, bottom: 9.h), diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 9c63c033..59e87869 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -1284,16 +1284,16 @@ class _Settlement extends State { productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - (settleOrderInfo.isRaise || payChannel == 5) - ? "NONE" - : ((useVipPriceSelect == false && - couponListBean?.id != "" && - ((promotion?.id ?? productId) != "")) - ? "MEMBER_RANK" - : (isVips == false) - ? "MEMBER_RANK" - : "AUTO"), - // preferentialType(), + // (settleOrderInfo.isRaise || payChannel == 5) + // ? "NONE" + // : ((useVipPriceSelect == false && + // couponListBean?.id != "" && + // ((promotion?.id ?? productId) != "")) + // ? "MEMBER_RANK" + // : (isVips == false) + // ? "MEMBER_RANK" + // : "AUTO"), + preferentialType(), // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect, // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect, count1, @@ -1305,17 +1305,17 @@ class _Settlement extends State { String preferentialType(){ if(settleOrderInfo.isRaise || payChannel == 5) return "NONE"; - if((((promotion?.id ?? productId) ?? "") != "") && (couponListBean?.id ?? "") == ""){ - return "ACTIVITY"; - }else if((couponListBean?.id ?? "") != "" && (((promotion?.id ?? productId) ?? "") == "")){ - return "COUPON"; - }else if(useVipPriceSelect == false && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ?? "") == "")){ - return "MEMBER_RANK"; - }else if(useVipPriceSelect == true && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ??"") == "")){ + if(settleOrderInfo.discountType == "ACTIVITY"){ + return "ACTIVITY"; + }else if(settleOrderInfo.discountType == "COUPON"){ + return "COUPON"; + }else if(settleOrderInfo.discountType == "MEMBER_RANK" || settleOrderInfo.discountType == "SURPRISE"){ + return "MEMBER_RANK"; + }else if(settleOrderInfo.discountType == "VIP"){ return "VIP"; }else { - return "AUTO"; - } + return "AUTO"; + } } vipPriceSelect(bool useVipPriceSelect) { @@ -1421,9 +1421,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", (couponBean?.id ?? 0) == 0 - ? ((isVips == false) - ? "MEMBER_RANK" - : "AUTO") + ? "AUTO" : "COUPON", // useVipPriceSelect, // useBenefitSelect, @@ -1462,9 +1460,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", ((pro?.id ?? 0) ?? productId) == 0 - ? ((isVips == false) - ? "MEMBER_RANK" - : "AUTO") + ?"AUTO" : "ACTIVITY", // useVipPriceSelect, // useBenefitSelect, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 8aeab279..e4fab047 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -118,7 +118,7 @@ class _SettlementOrderCommodity extends State { ); } - if (widget.diningStatus == 3) { + if (widget.diningStatus == 3 && widget.isTakeOut != 2) { //打包费 widgets.add( discountItem( diff --git a/lib/view_widget/no_data_view.dart b/lib/view_widget/no_data_view.dart index 7f74d674..22fb9ac2 100644 --- a/lib/view_widget/no_data_view.dart +++ b/lib/view_widget/no_data_view.dart @@ -27,41 +27,43 @@ class NoDataView extends StatelessWidget { return Container( margin: margin, alignment: Alignment.center, - child: Column( - children: [ - Image( - image: AssetImage(src), - width: iconWidth, - height: iconHeight, - ), - SizedBox( - height: 35.h, - ), - Text( - text, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: fontSize, - height: 1.5, - color: Color(0xFF353535), + child: Expanded( + child: Column( + children: [ + Image( + image: AssetImage(src), + width: iconWidth, + height: iconHeight, ), - ), - SizedBox( - height: 10.h, - ), - if (isShowBtn) - Container( - margin: EdgeInsets.symmetric(horizontal: 16.w), - child: RoundButton( - text: S.of(context).fanhuishouye, - textColor: Colors.white, - fontSize: 14.sp, - padding: EdgeInsets.all(12.w), - backgroup: Color(0xFF32A060), - radius: 4, + SizedBox( + height: 35.h, + ), + Text( + text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: fontSize, + height: 1.5, + color: Color(0xFF353535), ), ), - ], + SizedBox( + height: 10.h, + ), + if (isShowBtn) + Container( + margin: EdgeInsets.symmetric(horizontal: 16.w), + child: RoundButton( + text: S.of(context).fanhuishouye, + textColor: Colors.white, + fontSize: 14.sp, + padding: EdgeInsets.all(12.w), + backgroup: Color(0xFF32A060), + radius: 4, + ), + ), + ], + ), ), ); }