diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart index 0e7b41d9..a53fbca4 100644 --- a/lib/home/home_view/featured_acticvity.dart +++ b/lib/home/home_view/featured_acticvity.dart @@ -197,38 +197,43 @@ class _FeaturedActivity extends State { ], ), ), - Container( - width: 48.w, - margin: EdgeInsets.only(left: 8, bottom: 8), - padding: EdgeInsets.symmetric( - vertical: 4.h, - horizontal: 8.w, - ), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(20), - ), - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "了解", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), + Row( + children: [ + Container( + // width: 52.w, + margin: EdgeInsets.only(left: 8, bottom: 8), + padding: EdgeInsets.symmetric( + vertical: 4.h, + horizontal: 8.w, ), - Icon( - Icons.keyboard_arrow_right, - color: Colors.white, - size: 12, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(20), ), - ], - ), - ), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "了解", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.white, + size: 12, + ), + ], + ), + ), + Spacer() + ], + ) ], )); } diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 490debd7..dd55456d 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -343,7 +343,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { EasyLoading.dismiss(); } else { - // SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); + if(value?.msg !=null) + SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); } }); } diff --git a/lib/main_page.dart b/lib/main_page.dart index f037e522..12b0a20e 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -409,6 +409,7 @@ class _MainPage extends State with WidgetsBindingObserver { bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu2, 1), bottomNavigationItem(S.of(context).main_menu3 , 2), + // bottomNavigationItem("订单", 2), bottomNavigationItem(S.of(context).main_menu4, 3), ], ), @@ -490,7 +491,6 @@ class _MainPage extends State with WidgetsBindingObserver { ); } - // Widget bottomNavigationBigItem(text, index) { // var isSelected = index == clickIndex; // return Expanded( diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 1504d4f0..d045b833 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -16,6 +16,8 @@ class SettleOrderInfo { String threshold; String freePostAge; List orderProductList; + String promotionId; + String memberCouponId; static SettleOrderInfo fromJson(Map map) { if (map == null) return null; @@ -40,6 +42,8 @@ class SettleOrderInfo { settleOrderInfoBean.orderProductList = List()..addAll( (map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o)) ); + settleOrderInfoBean.promotionId = map['promotionId']; + settleOrderInfoBean.memberCouponId = map['memberCouponId']; return settleOrderInfoBean; } @@ -58,6 +62,8 @@ class SettleOrderInfo { "threshold": threshold, "freePostAge": freePostAge, "orderProductList": orderProductList, + "promotionId": promotionId, + "memberCouponId": memberCouponId, }; } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 4efc5058..ebd2d0da 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -171,8 +171,7 @@ abstract class ApiService { @Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo); /// 周边搜索 - @GET( - "https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") + @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") Future searchPoi(@Path("lat") String lat, @Path("lng") String lng, @Path("keywords") String keywords, int size, int page); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index c7088cb1..ccc9c5fc 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -172,9 +172,29 @@ class _Settlement extends State { "buyNum": buyNum, "payChannel": payChannel }).catchError((error) {}); + this.promotion = null; + promotions = ""; + this.couponListBean = null; + coupons = ""; if (baseData != null && baseData.isSuccess) { setState(() { settleOrderInfo = baseData.data; + if((settleOrderInfo?.promotionId??"")!=""){ + settleOrderInfo.promotionInfoList.forEach((element) { + if(element.id == settleOrderInfo.promotionId){ + this.promotion = element; + promotions = promotion?.name ?? ""; + } + }); + } + if((settleOrderInfo?.memberCouponId??"")!=""){ + settleOrderInfo.couponList.forEach((element) { + if(element.id == settleOrderInfo.memberCouponId){ + this.couponListBean = element; + coupons = couponListBean?.promotionName ?? ""; + } + }); + } if (settleOrderInfo.orderProductList == null || settleOrderInfo.orderProductList.length == 0) { placeOrder = true; @@ -668,8 +688,8 @@ class _Settlement extends State { couponCart, activityCart, settleOrderInfo, - payChannel == 4 ? null : coupons, - payChannel == 4 ? null : promotions, + coupons, + promotions, couponCount(), placeOrder, remakers, @@ -778,9 +798,9 @@ class _Settlement extends State { queryOrderInfo( address?.id, selectedBtn, - payChannel == 4 ? null : couponListBean?.id, + couponListBean?.id, 0, - payChannel == 4 ? null : promotion?.id, + promotion?.id, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", @@ -819,10 +839,10 @@ class _Settlement extends State { }, ); // if (couponBean != null) { - this.couponListBean = couponBean; - coupons = couponListBean?.promotionName ?? ""; - promotions = ""; - this.promotion = null; + // this.couponListBean = couponBean; + // coupons = couponListBean?.promotionName ?? ""; + // promotions = ""; + // this.promotion = null; queryOrderInfo( address?.id, selectedBtn, @@ -848,16 +868,16 @@ class _Settlement extends State { }, ); // if (pro != null) { - this.promotion = pro; - promotions = promotion?.name ?? ""; - coupons = ""; - this.couponListBean = null; + // this.promotion = pro; + // promotions = promotion?.name ?? ""; + // coupons = ""; + // this.couponListBean = null; queryOrderInfo( address?.id, selectedBtn, null, 0, - promotion != null ? promotion.id : (productId ?? null), + promotion != null ? pro.id : (productId ?? null), productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index c14b7f3c..c7b85641 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -599,9 +599,9 @@ class _StoreOrderPage extends State "tableId": tableId, "parentCode": parentCode, "parentId": parentId, - "pName": pName, + // "pName": pName, "pid": pid, - "cName": cName, + // "cName": cName, "cid": cid, "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople, diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 79895d9c..584f0708 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; @@ -139,7 +138,7 @@ class _ProductSku extends State { Padding( padding: EdgeInsets.only(top: 4, bottom: 7), child: Text( - ": " + + "已选: " + (selectSkus.map((e) => "$e").toList().toString()), maxLines: 1, overflow: TextOverflow.ellipsis, diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index 25fe5328..03156b55 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -16,9 +16,20 @@ class NewCouponWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return homeCoupon(context); + return buildCoupon(context); } + + String getCouponStoreName(){ + String couponStoreName = coupon.tenantName; + if(coupon?.storeList != null && coupon.storeId != "0"){ + coupon.storeList.forEach((element) { + if(element.id == coupon.storeId) + couponStoreName = element.storeName; + }); + } + return couponStoreName; + } ///优惠券ui Widget buildCoupon(BuildContext context) { // if(coupon != null) { @@ -246,9 +257,7 @@ class NewCouponWidget extends StatelessWidget { width: 8.w, ), Expanded( - child: Text( - (coupon.storeId != "0" && coupon?.storeList != null && coupon.storeList.isNotEmpty && coupon.storeList.firstWhere((x) => x.id == coupon.storeId)!=null ? - coupon.storeList.firstWhere((x) => x.id == coupon.storeId).storeName : coupon.tenantName), + child: Text(getCouponStoreName(), overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.sp, diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index fa42f586..97605d08 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -30,7 +30,7 @@ class _UpdateDialog extends State { child: Center( child: Container( width: MediaQuery.of(context).size.width - 80.w, - height: 180.h, + height: 192.h, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), @@ -39,7 +39,7 @@ class _UpdateDialog extends State { children: [ Container( width: double.infinity, - height: 110.h, + // height: 110.h, alignment: Alignment.center, padding: EdgeInsets.all(20), child: Column( @@ -102,9 +102,7 @@ class _UpdateDialog extends State { Expanded( child: InkWell( onTap: () { - (Theme.of(context).platform == TargetPlatform.android) ? - androidUpdate():Bridge.toAppStore().then((value) { - }); + updateApp(); // Navigator.of(context).pop(); }, child: Container( @@ -139,8 +137,8 @@ class _UpdateDialog extends State { Navigator.of(context).pop(); } - androidUpdate() async { - String url = "http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1"; + updateApp() async { + String url = Platform.isIOS ? "itms-apps://itunes.apple.com/app/id1575124838":"http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1"; if (await canLaunch(url)) { await launch(url); } else { diff --git a/pubspec.yaml b/pubspec.yaml index 523b3a8e..c75364f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.1+2 +version: 1.0.95+3 environment: sdk: ">=2.7.0 <3.0.0"