From f2e58e3e82d99e62f228ecc799b4c30d33ea4ed1 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 17 Jan 2024 14:28:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=89=B9=E9=87=8F=E4=B8=8B?= =?UTF-8?q?=E6=9E=B6=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=95=86=E5=93=81=E5=8A=9F=E8=83=BD=EF=BC=9B=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E:=E5=8A=A0=E8=BD=BD=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81,=E6=A0=A1=E9=AA=8C=E9=AA=8C=E8=AF=81=E7=A0=81,?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81,=E6=B3=A8?= =?UTF-8?q?=E5=86=8C,=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81,=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B4=AD=E4=B9=B0=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=9B=20=E5=95=86=E5=93=81=E5=AE=9E=E4=BD=93=E7=B1=BB?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5=EF=BC=9B?= =?UTF-8?q?=20=E6=89=80=E6=9C=89=E5=95=86=E5=AE=B6=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A4=84=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=9C=8D=E5=8A=A1=E5=A5=97=E9=A4=90=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E7=8A=B6=E6=80=81=E4=B8=A4=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=9B=20=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=95=86=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=B9=B6=E5=86=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E8=AF=A5=E9=A1=B5=E9=9D=A2=E6=97=B6=E8=B0=83=E7=94=A8?= =?UTF-8?q?=EF=BC=9B=EF=BC=88=E8=AF=A5=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E6=9C=8D=E5=8A=A1=E5=A5=97=E9=A4=90=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=E6=9F=A5=E8=AF=A2=E5=95=86=E6=88=B7=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E4=B8=BB=E8=A6=81=E7=94=A8=E4=BA=8E=E5=95=86?= =?UTF-8?q?=E6=88=B7=E8=B4=AD=E4=B9=B0=E5=A5=97=E9=A4=90=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=A5=97=E9=A4=90=E6=97=B6=E9=97=B4=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84=E5=88=B7=E6=96=B0=E6=9F=A5=E8=AF=A2=EF=BC=89?= =?UTF-8?q?=20MyAppBar=E6=8E=A7=E4=BB=B6=E4=B8=ADactions=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9B=20=E5=95=86=E5=93=81=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E4=B8=8B=E6=9E=B6=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=96=B0=E5=A2=9EtitleName=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=8C=BA=E5=88=86=E8=AF=A5=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=A4=84=E7=90=86=E5=95=86=E5=93=81=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E8=B7=9F=E8=AE=BE=E7=BD=AE=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E6=97=B6=E9=80=89=E6=8B=A9=E5=A5=97=E9=A4=90=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=9B=20=E5=B0=8F=E7=BE=8E?= =?UTF-8?q?=EF=BC=9Aip2024.1.9=E8=B5=B7=E6=9B=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=EF=BC=9A=20admin-api.test.yixinhuixiang.com=20:=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20192.168.10.54:8764=20app-api.test.yixinhuixiang.com?= =?UTF-8?q?=20:=20=20=20=20=20=20=20=20192.168.10.54:8765=20platform-api.t?= =?UTF-8?q?est.yixinhuixiang.com=20=20=20=20=20=20=20=20=20192.168.10.54:8?= =?UTF-8?q?766=20=E6=94=B6=E9=93=B6=E5=8F=B0=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=BF=A1=E6=81=AF=E6=9D=BF=E5=9D=97=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=EF=BC=9B=20=E6=9C=8D=E5=8A=A1=E5=A5=97=E9=A4=90=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E9=A1=B5=E9=9D=A2ui:=E6=96=B0=E5=A2=9E=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E4=BD=BF=E7=94=A8=E7=9A=84=E5=A5=97=E9=A4=90=EF=BC=8C?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E8=AE=B0=E5=BD=95=EF=BC=9B=20=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=A5=97=E9=A4=90=E8=B4=AD=E4=B9=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3:=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E6=96=B0=E5=A2=9Edispose?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E5=A5=97=E9=A4=90=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=9B=B4=E6=94=B9=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=BC=A0=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=A5=97=E9=A4=90=E6=94=AF=E4=BB=98=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BC=A0=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=9B=20=E5=A5=97=E9=A4=90=E6=8A=98=E6=89=A3?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E5=88=97=E8=A1=A8=E5=AE=9E=E4=BD=93=E7=B1=BB=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=EF=BC=9B=20app?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86=EF=BC=9B=20?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=85=85=E5=80=BC=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=85=85=E5=80=BC=E6=8C=89=E9=92=AEui?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=EF=BC=9B=20app=E5=9B=9E=E4=B9=A1vip=E5=8D=A1?= =?UTF-8?q?=E9=83=A8=E5=88=86=EF=BC=8C=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/on_sale/batch_shelf.dart | 129 ++++++++++---- .../goods/on_sale/on_sale_page.dart | 2 +- .../home/cashier/cashier_page.dart | 12 +- .../home/vip/vip_recharge_page.dart | 1 + .../login/business_login_page.dart | 67 ++++++- .../mine/business_mine_page.dart | 96 +++++++--- .../service_subscription_page.dart | 167 ++++++++++++++---- lib/login/new_login_page.dart | 4 +- lib/mine/mine_page.dart | 1 - lib/mine/mine_view/mine_item.dart | 4 +- lib/retrofit/business_api.dart | 34 +++- lib/retrofit/business_api.g.dart | 131 ++++++++++++++ lib/retrofit/data/business_goods.dart | 8 + lib/retrofit/data/tenant_info.dart | 23 ++- lib/retrofit/retrofit_api.dart | 2 +- lib/store/store_view/product_meals_sku.dart | 4 - lib/union/union_list.dart | 2 + lib/view_widget/my_appbar.dart | 1 + lib/vip/vip_view/vip_top.dart | 27 +-- 19 files changed, 593 insertions(+), 122 deletions(-) diff --git a/lib/business_system/goods/on_sale/batch_shelf.dart b/lib/business_system/goods/on_sale/batch_shelf.dart index 13453c59..a2a613ff 100644 --- a/lib/business_system/goods/on_sale/batch_shelf.dart +++ b/lib/business_system/goods/on_sale/batch_shelf.dart @@ -45,11 +45,13 @@ class _BatchShelf extends State { int groupIndex = -1; String networkError = ""; int networkStatus = 0; + String titleName; @override void initState() { super.initState(); _onRefresh(); + titleName = widget?.arguments["titleName"] ?? ""; } @override @@ -186,7 +188,7 @@ class _BatchShelf extends State { return Scaffold( backgroundColor: Colors.white, appBar: MyAppBar( - title: "批量下架", + title: titleName, titleColor: Colors.black, background: Colors.white, leadingColor: Colors.black, @@ -194,17 +196,36 @@ class _BatchShelf extends State { action: GestureDetector( behavior: HitTestBehavior.opaque, onTap: (){ - if (productIds.length != 0) - productIds.clear(); - adminProductVoList.forEach((element) { - if (element.isSelect) productIds.add(element.id); - }); - if (productIds.length == 0) { - SmartDialog.showToast("请选择要下架的商品", - alignment: Alignment.center); - return; - } else { - showGoodsStateDialog(); + List> goodsMeal = []; + if(titleName == "批量下架"){ + if (productIds.length != 0) + productIds.clear(); + adminProductVoList.forEach((element) { + if (element.isSelect) productIds.add(element.id); + }); + if (productIds.length == 0) { + SmartDialog.showToast("请选择要下架的商品", + alignment: Alignment.center); + return; + } else { + showGoodsStateDialog(); + } + }else{ + if(goodsMeal.length != 0) + goodsMeal.clear(); + adminProductVoList.forEach((element) { + if (element.isSelect) + goodsMeal.add({ + "goodsName": element.productName, + "goodsNum": element.goodsNumber.toString() + }); + }); + Navigator.of(context).pop(goodsMeal); + if (goodsMeal.length == 0) { + SmartDialog.showToast("请选择要增加的商品", + alignment: Alignment.center); + return; + } } }, child: Container( @@ -487,28 +508,74 @@ class _BatchShelf extends State { ], ), SizedBox(height:7.h,), - Text.rich( - TextSpan( - children: [ + Row( + children: [ + Expanded(child:Text.rich( TextSpan( - text: "¥", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), - ), + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: adminProductVoList?.price ?? "", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], ), - TextSpan( - text: adminProductVoList?.price ?? "", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), - ), + )), + if(titleName == "选择商品") + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap:(){ + setState((){ + if(adminProductVoList.goodsNumber <= 1) + return; + adminProductVoList?.goodsNumber = adminProductVoList.goodsNumber - 1; + }); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + child: Icon( + Icons.remove_circle_outline, + color: Color(0xFF30415B), + size: 24, + ))), + if(titleName == "选择商品") + Text( + adminProductVoList?.goodsNumber?.toString() ?? "", + style: TextStyle( + color: Color(0xD9000000), + fontSize: 20.sp, + fontWeight: MyFontWeight.regular, ), - ], - ), - ) + ), + if(titleName == "选择商品") + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap:(){ + setState((){ + adminProductVoList.goodsNumber = adminProductVoList.goodsNumber + 1; + }); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + child: Icon( + Icons.add_circle, + color: Color(0xFF30415B), + size: 24, + )), + ), + ], + ), ], )), ], diff --git a/lib/business_system/goods/on_sale/on_sale_page.dart b/lib/business_system/goods/on_sale/on_sale_page.dart index 74cf8cdd..1cdf9ebb 100644 --- a/lib/business_system/goods/on_sale/on_sale_page.dart +++ b/lib/business_system/goods/on_sale/on_sale_page.dart @@ -403,7 +403,7 @@ class _OnSalePage extends State { behavior: HitTestBehavior.opaque, onTap: () { Navigator.of(context).pushNamed('/router/batch_shelf', - arguments: {"storeId": widget.storeId}).then((value) { + arguments: {"storeId": widget.storeId,"titleName":"批量下架"}).then((value) { adminProductVoList.clear(); _onRefresh(); }); diff --git a/lib/business_system/home/cashier/cashier_page.dart b/lib/business_system/home/cashier/cashier_page.dart index af574575..aa6ae250 100644 --- a/lib/business_system/home/cashier/cashier_page.dart +++ b/lib/business_system/home/cashier/cashier_page.dart @@ -347,7 +347,17 @@ class _CashierPage extends State { ), ), (phoneQueryMemberInfo != null && isDisplayVipInfo == true) - ? vipPlate() + ? GestureDetector( + onTap:(){ + Navigator.of(context).pushNamed( + '/router/member_details_page', + arguments: { + "storeId": widget?.arguments["storeId"] ?? "", + "phoneNum":editingController?.text ?? "" + }); + }, + child: vipPlate(), + ) : SizedBox(height: 103.h), calculator() ], diff --git a/lib/business_system/home/vip/vip_recharge_page.dart b/lib/business_system/home/vip/vip_recharge_page.dart index 7b0592f2..93dd966e 100644 --- a/lib/business_system/home/vip/vip_recharge_page.dart +++ b/lib/business_system/home/vip/vip_recharge_page.dart @@ -683,6 +683,7 @@ class _VipRechargePage extends State { right: 16.w, bottom: 34.h), child: Container( + padding:EdgeInsets.symmetric(vertical: 16.h), alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xFF30415B), diff --git a/lib/business_system/login/business_login_page.dart b/lib/business_system/login/business_login_page.dart index fc8b99c2..68263c38 100644 --- a/lib/business_system/login/business_login_page.dart +++ b/lib/business_system/login/business_login_page.dart @@ -99,8 +99,8 @@ class _BusinessLoginPage extends State { } BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode; BusinessInstance.instance.businessToken = businessLoginInfo.token; - BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime; - BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc; + BusinessInstance.instance.expirationTime = businessLoginInfo?.expirationTime ?? ""; + BusinessInstance.instance.serviceStatus = businessLoginInfo?.status?.desc ?? ""; sharedPreferences.setString('account', _userPhoneController.text); sharedPreferences.setString('password', _passwordController.text); sharedPreferences.setString('identitySwitch', "1"); @@ -145,7 +145,7 @@ class _BusinessLoginPage extends State { children: [ Container( padding: - EdgeInsets.only(top: 54.h, left: 16.w, right: 17.w), + EdgeInsets.only(top:34.h, left: 16.w, right: 17.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -165,7 +165,7 @@ class _BusinessLoginPage extends State { color: Color(0xFF30415B), fontWeight: MyFontWeight.medium)), ), - SizedBox(height: 160.h), + SizedBox(height:134.h), Row( children: [ Image.asset( @@ -354,11 +354,68 @@ class _BusinessLoginPage extends State { ) ], ), + Padding(padding:EdgeInsets.only(top:45.h), + child: + Row( + mainAxisAlignment:MainAxisAlignment.center, + children: [ + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed( + '/router/register_retrieve_password',arguments:{"titleName":"注册账号"}); + }, + child:Column( + children: [ + Image.asset( + "assets/image/register_account.webp", + width:24.h, + height:24.h, + fit: BoxFit.fill, + ), + Padding(padding:EdgeInsets.only(top:4.h), + child: Text( + "注册账号", + style: TextStyle( + fontSize: 11.sp, + color: Color(0xFF010101), + fontWeight: MyFontWeight.regular), + )) + ], + ), + ), + SizedBox(width:63.w), + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed( + '/router/register_retrieve_password',arguments:{"titleName":"找回密码"}); + }, + child:Column( + children: [ + Image.asset( + "assets/image/retrieve_password.webp", + width:24.h, + height:24.h, + fit: BoxFit.fill, + ), + Padding(padding:EdgeInsets.only(top:4.h), + child: Text( + "找回密码", + style: TextStyle( + fontSize: 11.sp, + color: Color(0xFF010101), + fontWeight: MyFontWeight.regular), + )) + ], + )), + ], + ),) ], ), ), Container( - margin: EdgeInsets.only(top: 98.h), + margin: EdgeInsets.only(top:74.h), child: Image.asset( "assets/image/business_login.webp", fit: BoxFit.cover, diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index 028826be..5e767f0e 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -12,6 +12,7 @@ import '../../retrofit/business_api.dart'; import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/business_login_info.dart'; import '../../retrofit/data/business_store_list.dart'; +import '../../retrofit/data/tenant_info.dart'; import '../../utils/business_instance.dart'; import '../../utils/flutter_utils.dart'; import '../../utils/font_weight.dart'; @@ -35,6 +36,7 @@ class _BusinessMinePage extends State{ List records = []; double visiblePercentage; int networkStatus = 0; + TenantInfo tenantInfo; @override void initState() { @@ -73,6 +75,7 @@ class _BusinessMinePage extends State{ if (!mounted) return; if (baseData != null && baseData.isSuccess) { records.addAll((baseData.data.records ?? []).reversed); + queryTenantInfo(); refreshController.refreshCompleted(); networkStatus = 1; } else { @@ -80,6 +83,29 @@ class _BusinessMinePage extends State{ } } + ///查询商户信息 + queryTenantInfo() async { + try { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.storeId); + } + BaseData baseData = await businessService + .tenantInfo(BusinessInstance.instance.businessTenant) + .catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + tenantInfo = baseData.data; + BusinessInstance.instance.expirationTime = baseData.data.expirationTime; + BusinessInstance.instance.serviceStatus = baseData.data.status.desc; + } + } finally { + setState(() {}); + } + } + @override Widget build(BuildContext context) { return VisibilityDetector( @@ -228,6 +254,7 @@ class _BusinessMinePage extends State{ '/router/service_subscription_page', arguments: { "storeId":widget.storeId ?? "", + "packageName":tenantInfo?.packageName ?? "" }).then((value){ if(value == 1){ setState((){}); @@ -236,30 +263,55 @@ class _BusinessMinePage extends State{ }, child: Container( padding: EdgeInsets.only(bottom:12.h,left: 16.w), - child: Row( + child:Column( + crossAxisAlignment:CrossAxisAlignment.start, children: [ - Padding(padding:EdgeInsets.only(right: 14.w), - child: Text( - "服务有效期:${(BusinessInstance.instance.expirationTime ?? "").length > 9 ? (BusinessInstance.instance.expirationTime ?? "").substring(0, 10) : ""}", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - fontWeight: MyFontWeight.regular), - )), - Padding(padding:EdgeInsets.only(right:4.w), - child: Text( - "去续费", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - fontWeight: MyFontWeight.regular), - )), - Image.asset( - "assets/image/icon_right_z.webp", - width: 16.h, - height: 16.h, - color: Color(0xFF353535), + if(tenantInfo != null) + Container( + padding:EdgeInsets.only(left: 4.w,right: 4.w,bottom:2.h,top: 1.h), + margin:EdgeInsets.only(bottom:5.h), + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all( + color: Color(0xFF2E3552), + width: 1, + ), + borderRadius: BorderRadius.circular(4), + ), + child:Text( + tenantInfo?.packageName ??"", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF2E3552), + fontWeight: MyFontWeight.regular), + ), ), + Row( + children: [ + Padding(padding:EdgeInsets.only(right: 14.w), + child: Text( + "服务有效期:${(BusinessInstance.instance.expirationTime ?? "").length > 9 ? (BusinessInstance.instance.expirationTime ?? "").substring(0, 10) : ""}", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular), + )), + Padding(padding:EdgeInsets.only(right:4.w), + child: Text( + "去续费", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular), + )), + Image.asset( + "assets/image/icon_right_z.webp", + width: 16.h, + height: 16.h, + color: Color(0xFF353535), + ), + ], + ) ], ), ), diff --git a/lib/business_system/mine/service_subscription/service_subscription_page.dart b/lib/business_system/mine/service_subscription/service_subscription_page.dart index 41b57385..e0486834 100644 --- a/lib/business_system/mine/service_subscription/service_subscription_page.dart +++ b/lib/business_system/mine/service_subscription/service_subscription_page.dart @@ -65,6 +65,12 @@ class _ServiceSubscriptionPage extends State { }); } + @override + void dispose() { + super.dispose(); + if (payListen != null) payListen.cancel(); + } + ///服务套餐列表 queryTenantList({isSing = true}) async { if (isSing) @@ -115,7 +121,6 @@ class _ServiceSubscriptionPage extends State { BaseData baseData = await businessService.tenantPackageCalculate({ "packageId": int.tryParse(tenantPackageList[serviceType]?.id ?? 0), - "payChannel": payType, "packageSale": { "packagePrice": tenantPackageList[serviceType] ?.tenantPackageSale[selectIndex] @@ -186,14 +191,24 @@ class _ServiceSubscriptionPage extends State { int.tryParse(tenantPackageCalculateDetails?.packageId ?? 0), "payChannel": payType, "packageSale": { - "packagePrice": tenantPackageCalculateDetails?.totalFee ?? "", - "expirationTime": tenantPackageCalculateDetails?.expirationTime ?? "", - "duration": tenantPackageCalculateDetails?.duration ?? 0 + "packagePrice": tenantPackageList[serviceType] + ?.tenantPackageSale[selectIndex] + ?.packagePrice ?? + "", + "originalPackagePrice": tenantPackageList[serviceType] + ?.tenantPackageSale[selectIndex] + ?.originalPackagePrice ?? + "", + "duration": tenantPackageList[serviceType] + ?.tenantPackageSale[selectIndex] + ?.duration ?? + 0, } }).catchError((error) { networkError = AppUtils.dioErrorTypeToString(error.type); - networkStatus = -1; - setState(() {});}); + networkStatus = -1; + setState(() {}); + }); if (baseData != null && baseData.isSuccess) { if (payType == 1) { if (Platform.isAndroid) { @@ -231,15 +246,15 @@ class _ServiceSubscriptionPage extends State { payRes['resultStatus'] == '9000') { queryTenantInfo(); } else { - if(payRes['memo'] != "") - SmartDialog.showToast(payRes['memo'], - alignment: Alignment.center); + if (payRes['memo'] != "") + SmartDialog.showToast(payRes['memo'], + alignment: Alignment.center); } }) } }); } - networkStatus =1; + networkStatus = 1; } else { SmartDialog.show( clickBgDismissTemp: false, @@ -345,11 +360,57 @@ class _ServiceSubscriptionPage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child:Row( + children: [ + Expanded(child:Text( + "你当前的套餐是: ${BusinessInstance.instance.serviceStatus == "正常" ? (widget?.arguments["packageName"] ?? ""):BusinessInstance.instance.serviceStatus}", + maxLines: 1, + overflow:TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: + MyFontWeight.regular, + ), + )), + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap:(){ + Navigator.of(context).pushNamed( + '/router/service_purchase_record',arguments: { + "storeId":widget.arguments["storeId"], + }); + }, + child: Row( + children: [ + Text( + "购买记录", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + Padding(padding:EdgeInsets.only(left:4.w,right:12.w), + child: Image.asset( + "assets/image/bs_right.webp", + width:7.w, + height:12.h, + color:Color(0xFF1A1A1A), + )), + ], + ), + ) + ], + )), Padding( padding: EdgeInsets.only(bottom: 16.h), child: Text( - "你的到期时间是: ${(tenantPackageCalculateDetails?.expirationTime ?? "").length > 9 ? (tenantPackageCalculateDetails?.expirationTime ?? "").substring(0, 10) : ""}", + "你的到期时间是: ${(BusinessInstance.instance.expirationTime ?? "").length > 9 ? (BusinessInstance.instance.expirationTime ?? "").substring(0, 10) : ""}", style: TextStyle( color: Color(0xFF1A1A1A), fontSize: 14.sp, @@ -384,23 +445,36 @@ class _ServiceSubscriptionPage extends State { color: Color(0xFF0D0D0D), fontWeight: MyFontWeight.bold), )), - Padding( - padding: - EdgeInsets.only(right: 2.w), - child: Text( - "功能版本介绍", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: - MyFontWeight.regular), - )), - Image.asset( - "assets/image/icon_right_z.webp", - width: 14.h, - height: 14.h, - color: Color(0xFF1A1A1A), - ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed( + '/router/function_version_detail'); + }, + child: Row( + children: [ + Padding( + padding: EdgeInsets.only( + right: 2.w), + child: Text( + "功能版本介绍", + style: TextStyle( + fontSize: 12.sp, + color: + Color(0xFF1A1A1A), + fontWeight: + MyFontWeight + .regular), + )), + Image.asset( + "assets/image/icon_right_z.webp", + width: 14.h, + height: 14.h, + color: Color(0xFF1A1A1A), + ), + ], + ), + ) ], ), ), @@ -471,6 +545,7 @@ class _ServiceSubscriptionPage extends State { onTap: () { setState(() { serviceType = position; + selectIndex = 0; queryTenantCalculate(); }); }, @@ -643,7 +718,7 @@ class _ServiceSubscriptionPage extends State { ], ), ), - if ((tenantPackageSale?.canDiscount ?? false) == true) + if ((tenantPackageSale?.canDiscount ?? false) == true && ((tenantPackageSale?.packageDiscount?? "")!=100)) Container( decoration: BoxDecoration( color: Color(0xFFFF8F1F), @@ -654,7 +729,7 @@ class _ServiceSubscriptionPage extends State { ), padding: EdgeInsets.symmetric(horizontal: 4.w), child: Text( - "${(tenantPackageSale?.packageDiscount ?? 0) / 100}折", + "${AppUtils.calculateDouble((tenantPackageSale?.packageDiscount ?? 0) / 10)}折", style: TextStyle( fontSize: 12.sp, color: Colors.white, @@ -918,6 +993,38 @@ class _ServiceSubscriptionPage extends State { SizedBox( height: 16.h, ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 112.w, + height: 20.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 85.w, + height: 20.h, + ), + ), + ], + ), + SizedBox( + height: 16.h, + ), Row( children: [ Shimmer.fromColors( diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index c9b09c8d..f885a00e 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -311,8 +311,8 @@ class _NewLoginPage extends State { } BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode; BusinessInstance.instance.businessToken = businessLoginInfo.token; - BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime; - BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc; + BusinessInstance.instance.expirationTime = businessLoginInfo?.expirationTime ?? ""; + BusinessInstance.instance.serviceStatus = businessLoginInfo?.status?.desc ?? ""; if (businessLoginInfo.storeList.length > 1) { Navigator.of(context) .popAndPushNamed('/router/select_shop', arguments: { diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index f78850e9..4c0e444b 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -241,7 +241,6 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { backgroundColor: Color(0xFFF9FAF7), body: Container( padding: EdgeInsets.only(bottom: 76.h), - // margin: EdgeInsets.only(top: 40.h), child: SmartRefresher( controller: _refreshController, enablePullDown: true, diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 305e9044..d40d6dc5 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -49,8 +49,8 @@ class _MineItem extends State { } BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode; BusinessInstance.instance.businessToken = businessLoginInfo.token; - BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime; - BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc; + BusinessInstance.instance.expirationTime = businessLoginInfo?.expirationTime ?? ""; + BusinessInstance.instance.serviceStatus = businessLoginInfo?.status?.desc ?? ""; sharedPreferences.setString('identitySwitch', "1"); if (businessLoginInfo.storeList.length > 1) { Navigator.of(context) diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index 2cb39df0..417045f4 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/order_trend.dart'; import 'package:huixiang/retrofit/data/vip_counts_info.dart'; import 'package:retrofit/retrofit.dart'; +import '../login/captcha/click_word_captcha.dart'; import 'data/add_vip_info.dart'; import 'data/balance_change_list.dart'; import 'data/balance_consumption_ranking_list.dart'; @@ -32,6 +33,7 @@ import 'data/popular_sales_list.dart'; import 'data/product_group_list.dart'; import 'data/recharge_flow_list.dart'; import 'data/refund_reason_list.dart'; +import 'data/service_bug_list.dart'; import 'data/single_sales_list.dart'; import 'data/store_time_info_list.dart'; import 'data/store_total_money_info.dart'; @@ -53,7 +55,7 @@ part 'business_api.g.dart'; const localBaseUrl = "http://admin-api.test.yixinhuixiang.com/"; ///测试 -// const localBaseUrl = "http://test-merchant.lotus-wallet.com/test-merchant/"; +// const localBaseUrl = "http://pos-test.admin.api.lotus-wallet.com/"; ///线上 const serviceBaseUrl = "http://pos.tenant.lotus-wallet.com/test-merchant/"; @@ -166,6 +168,26 @@ abstract class BusinessApiService { @POST("anno/token") Future annoToken(@Body() Map param); + ///加载验证码 + @POST("/captcha/get") + Future captchaGet(@Body() Map param); + + ///校验验证码 + @POST("/captcha/check") + Future captchaCheck(@Body() Map param); + + ///发送验证码 + @POST("auth/sendVerify") + Future> busSendVerify(@Body() Map param); + + ///注册 + @POST("auth/tenantAppLogin") + Future tenantAppLogin(@Body() Map param); + + ///找回密码 + @POST("auth/tenantUserChangePsd") + Future tenantUserChangePsd(@Body() Map param); + /// 当日各种金额统计 @POST("comprehensiveReport/getDayCounts") Future> getDayCounts(@Body() Map param); @@ -416,11 +438,13 @@ abstract class BusinessApiService { ///服务套餐支付 @POST("tenantApply/tenantApplyPay") - Future tenantApplyPay( - @Body() Map param); + Future tenantApplyPay(@Body() Map param); ///查询商户信息 @GET("tenant/tenantInfo/{tenantId}") - Future> tenantInfo( - @Path("tenantId") String tenantId); + Future> tenantInfo(@Path("tenantId") String tenantId); + + ///服务购买记录 + @POST("tenantPackage/packageBuyList") + Future> packageBuyList(@Body() Map param); } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index d753fab4..d245458f 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -43,6 +43,114 @@ class _BusinessApiService implements BusinessApiService { return value; } + @override + Future captchaGet(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/captcha/get', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = + (_result.data['repCode'] != '0000' || _result.data['repData'] == null) + ? null + : ClickWordCaptchaModel.fromMap(_result.data['repData']); + return value; + } + + @override + Future captchaCheck(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/captcha/check', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + return (_result.data['repCode'] != '0000' || _result.data['repData'] == null || !_result.data['repData']['result']); + } + + @override + Future> busSendVerify(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('auth/sendVerify', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ((json??"") == "")? null :json as dynamic, + ); + return value; + } + + @override + Future tenantAppLogin(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'auth/tenantAppLogin', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ((json??"") == "")? null : json, + ); + return value; + } + + @override + Future tenantUserChangePsd(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'auth/tenantUserChangePsd', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ((json??"") == "")? null : json, + ); + return value; + } + @override Future> getDayCounts(param) async { ArgumentError.checkNotNull(param, 'param'); @@ -1319,4 +1427,27 @@ class _BusinessApiService implements BusinessApiService { return value; } + @override + Future> packageBuyList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'tenantPackage/packageBuyList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : ServiceBugList.fromJson(json), + ); + return value; + } + } diff --git a/lib/retrofit/data/business_goods.dart b/lib/retrofit/data/business_goods.dart index 068e2bda..7b3c3c29 100644 --- a/lib/retrofit/data/business_goods.dart +++ b/lib/retrofit/data/business_goods.dart @@ -253,6 +253,7 @@ AdminProductVoList copyWith({ String id, String get storeId => _storeId; SalesRules get salesRules => _salesRules; bool _isSelect = false; + num _goodsNumber = 1; bool get isSelect => _isSelect; @@ -260,6 +261,13 @@ AdminProductVoList copyWith({ String id, _isSelect = value; } + + num get goodsNumber => _goodsNumber; + + set goodsNumber(num value) { + _goodsNumber = value; + } + Map toJson() { final map = {}; map['id'] = _id; diff --git a/lib/retrofit/data/tenant_info.dart b/lib/retrofit/data/tenant_info.dart index bc95d863..7677c04d 100644 --- a/lib/retrofit/data/tenant_info.dart +++ b/lib/retrofit/data/tenant_info.dart @@ -13,9 +13,9 @@ /// money : "0" /// duty : "fxz" /// address : "洪山区光谷一路天成美景" -/// expireLimitYear : 3 +/// expireLimitYear : 12 /// startTime : "2023-12-27 13:41:53" -/// expirationTime : null +/// expirationTime : "2039-09-11 15:39:12" /// contactTel : "15827991715" /// logo : "" /// describe : "" @@ -23,7 +23,8 @@ /// dianwodaId : "" /// dadaId : "" /// showVipCard : true -/// packageId : "1552543966157602816" +/// packageId : "1742842291845857280" +/// packageName : "测试啊" /// posType : {"desc":"普通餐饮","code":"NORMALSTORE"} class TenantInfo { @@ -45,7 +46,7 @@ class TenantInfo { String address, num expireLimitYear, String startTime, - dynamic expirationTime, + String expirationTime, String contactTel, String logo, String describe, @@ -54,6 +55,7 @@ class TenantInfo { String dadaId, bool showVipCard, String packageId, + String packageName, PosType posType,}){ _id = id; _createTime = createTime; @@ -81,6 +83,7 @@ class TenantInfo { _dadaId = dadaId; _showVipCard = showVipCard; _packageId = packageId; + _packageName = packageName; _posType = posType; } @@ -111,6 +114,7 @@ class TenantInfo { _dadaId = json['dadaId']; _showVipCard = json['showVipCard']; _packageId = json['packageId']; + _packageName = json['packageName']; _posType = json['posType'] != null ? PosType.fromJson(json['posType']) : null; } String _id; @@ -130,7 +134,7 @@ class TenantInfo { String _address; num _expireLimitYear; String _startTime; - dynamic _expirationTime; + String _expirationTime; String _contactTel; String _logo; String _describe; @@ -139,6 +143,7 @@ class TenantInfo { String _dadaId; bool _showVipCard; String _packageId; + String _packageName; PosType _posType; TenantInfo copyWith({ String id, String createTime, @@ -157,7 +162,7 @@ TenantInfo copyWith({ String id, String address, num expireLimitYear, String startTime, - dynamic expirationTime, + String expirationTime, String contactTel, String logo, String describe, @@ -166,6 +171,7 @@ TenantInfo copyWith({ String id, String dadaId, bool showVipCard, String packageId, + String packageName, PosType posType, }) => TenantInfo( id: id ?? _id, createTime: createTime ?? _createTime, @@ -193,6 +199,7 @@ TenantInfo copyWith({ String id, dadaId: dadaId ?? _dadaId, showVipCard: showVipCard ?? _showVipCard, packageId: packageId ?? _packageId, + packageName: packageName ?? _packageName, posType: posType ?? _posType, ); String get id => _id; @@ -212,7 +219,7 @@ TenantInfo copyWith({ String id, String get address => _address; num get expireLimitYear => _expireLimitYear; String get startTime => _startTime; - dynamic get expirationTime => _expirationTime; + String get expirationTime => _expirationTime; String get contactTel => _contactTel; String get logo => _logo; String get describe => _describe; @@ -221,6 +228,7 @@ TenantInfo copyWith({ String id, String get dadaId => _dadaId; bool get showVipCard => _showVipCard; String get packageId => _packageId; + String get packageName => _packageName; PosType get posType => _posType; Map toJson() { @@ -255,6 +263,7 @@ TenantInfo copyWith({ String id, map['dadaId'] = _dadaId; map['showVipCard'] = _showVipCard; map['packageId'] = _packageId; + map['packageName'] = _packageName; if (_posType != null) { map['posType'] = _posType.toJson(); } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index f8d56bf5..f1d4dc15 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -66,7 +66,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.54:8766/app/";///本地 // const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///测试 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/store/store_view/product_meals_sku.dart b/lib/store/store_view/product_meals_sku.dart index 48e69a00..78841b1f 100644 --- a/lib/store/store_view/product_meals_sku.dart +++ b/lib/store/store_view/product_meals_sku.dart @@ -4,15 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; -import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/store/store_view/people_num.dart'; -import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index e1237c7a..2080ac73 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -85,6 +85,8 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } EasyLoading.dismiss(); + if(!mounted) + return; setState(() {}); } diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index 52760e27..36f55441 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -45,6 +45,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { actions.add( Container( margin: EdgeInsets.only(right: 15), + alignment: Alignment.center, child: GestureDetector( onTap: onTap, child: action, diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 5fa77df1..3ddad0dc 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -39,18 +39,25 @@ class _VipTop extends State { @override void initState() { super.initState(); - // payListen = weChatResponseEventHandler.listen((event) async { - // print("payCallback: ${event.errCode}"); - // if (event.errCode == 0) { - // widget.queryVipHome(); - // SmartDialog.showToast("支付成功", alignment: Alignment.center); - // } else { - // SmartDialog.showToast("支付失败", alignment: Alignment.center); - // return; - // } - // }); + payListen = weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + if (event.errCode == 0) { + // widget.queryVipHome(); + SmartDialog.showToast("支付成功", alignment: Alignment.center); + } else { + SmartDialog.showToast("支付失败", alignment: Alignment.center); + return; + } + }); + } + + @override + void dispose() { + super.dispose(); + if (payListen != null) payListen.cancel(); } + rechargeVIP() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance();