From 84a0ed103fee4fe3af597fc81e547ec559cc3b8e Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 7 Apr 2022 16:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B4=AD=E7=89=A9=E8=BD=A6,?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_view/mine_item.dart | 127 +++++++++--------- lib/order/bargain_group_order.dart | 2 +- lib/retrofit/min_api.dart | 4 +- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 4 +- lib/retrofit/retrofit_api.g.dart | 2 +- .../shopping_cart/shopping_cart_page.dart | 27 +++- .../shopping/shopping_home/search_page.dart | 52 +++---- lib/store/shopping/shopping_mall_home.dart | 3 +- 9 files changed, 121 insertions(+), 102 deletions(-) diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index c346c14c..22c898fa 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -35,22 +35,6 @@ class _MineItem extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // InkWell( - // onTap: () { - // SharedPreferences.getInstance().then((value) { - // if (value.getString("token") == null || - // value.getString("token") == "") { - // LoginTipsDialog().show(context); - // return; - // } - // Navigator.of(context).pushNamed('/router/mine_wallet'); - // }); - // }, - // child: mineItem( - // S.of(context).wodeqianbao, - // "assets/image/icon_mine_wallet.webp", - // ), - // ), Container( padding: EdgeInsets.only(left: 16,top:16,bottom:4), child: Text( @@ -85,6 +69,8 @@ class _MineItem extends State { // ), // ), // ), + + ///兑换历史 Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -102,6 +88,7 @@ class _MineItem extends State { "assets/image/icon_mine_records_of_consumption.webp", ), ),), + ///我的卡券 Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -118,6 +105,7 @@ class _MineItem extends State { "assets/image/icon_mine_card.webp", ), ),), + ///管理地址 Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -134,48 +122,66 @@ class _MineItem extends State { "assets/image/icon_location_address.webp", ), ),), - Expanded(child:InkWell( + ///联系客服 + Expanded(child: InkWell( onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + showCallMobile(); }, child: mineItem( - S.of(context).tuiguangma, - "assets/image/icon_mine_promotion_code.webp", + "联系客服", + "assets/image/icon_mine_online_service.webp", ), ),), ], ), + SizedBox(height: 10.h,), Row( - children: [ - Expanded(child:InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); - }, - child: mineItem( - "邀请记录", - "assets/image/yao_q.webp", - ), - ),), - ///联系客服 - Expanded(child: InkWell( - onTap: () { - showCallMobile(); - }, - child: mineItem( - "联系客服", - "assets/image/icon_mine_online_service.webp", - ), - ),), - Expanded(child:Container()), - Expanded(child:Container()) - ], + children: [ + Expanded(child: + InkWell( + onTap: () { + Navigator.of(context) + .pushNamed('/router/bargain_group_order', + arguments: {"type":3}); + }, + child: mineItem( + S.of(context).wodekanjia, + "assets/image/icon_mine_records_of_consumption.webp", + ), + ),), + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/bargain_group_order', + arguments: {"type":1}); + }, + child: mineItem( + S.of(context).wodepintuan, + "assets/image/kan_jia.webp", + ), + ),), + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/pin_tuan.webp", + ), + ),), + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); + }, + child: mineItem( + "邀请记录", + "assets/image/yao_q.webp", + ), + ),), + ], + ), + SizedBox(height: 10.h,), + ], ), - // mineItem( - // S.of(context).bangzhuyufankui, - // "assets/image/icon_mine_feedback.webp", - // ), - ], - ), ); } @@ -204,11 +210,6 @@ class _MineItem extends State { color: Color(0xFF353535), ), ), - // Icon( - // Icons.keyboard_arrow_right, - // size: 20, - // color: Colors.black, - // ) ], ), ); @@ -221,15 +222,15 @@ class _MineItem extends State { return CupertinoActionSheet( title: Text(S.of(context).bodadianhua), actions: [ - CupertinoActionSheetAction( - child: Text("15392949097"), - onPressed: () { - callMobile("15392949097"); - Navigator.of(context).pop(); - }, - isDefaultAction: true, - isDestructiveAction: false, - ), + CupertinoActionSheetAction( + child: Text("15392949097"), + onPressed: () { + callMobile("15392949097"); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), ], cancelButton: CupertinoActionSheetAction( onPressed: () { diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index ab2e92ea..c49b47a1 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -212,7 +212,7 @@ class _ExchangeHistoryList extends State { return Container( child: SmartRefresher( enablePullDown: true, - enablePullUp: true, + enablePullUp: false, header: MyHeader(), footer: CustomFooter( builder: (BuildContext context, LoadStatus mode) { diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7b9705df..d671ea0f 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -39,8 +39,8 @@ part 'min_api.g.dart'; // const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -const base_url = "http://192.168.10.104:8765/app/";///詹云久 -const baseUrl = "http://192.168.10.104:8765/app/";///詹云久 +const base_url = "http://192.168.10.132:8765/app/";///詹云久 +const baseUrl = "http://192.168.10.132:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1bf8987c..a488dced 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.104:8765/app/'; + baseUrl ??= 'http://192.168.10.132:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 75ea9102..11436b59 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -72,8 +72,8 @@ part 'retrofit_api.g.dart'; // const baseUrl = "http://192.168.10.37:8766/app/"; -const base_url = "http://192.168.10.104:8766/app/";///詹云久 -const baseUrl = "http://192.168.10.104:8766/app/";///詹云久 +const base_url = "http://192.168.10.132:8766/app/";///詹云久 +const baseUrl = "http://192.168.10.132:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5cfa3725..12d19c02 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.104:8766/app/'; + baseUrl ??= 'http://192.168.10.132:8766/app/'; } final Dio _dio; diff --git a/lib/store/shopping/shopping_cart/shopping_cart_page.dart b/lib/store/shopping/shopping_cart/shopping_cart_page.dart index 25f8997b..b50a2d98 100644 --- a/lib/store/shopping/shopping_cart/shopping_cart_page.dart +++ b/lib/store/shopping/shopping_cart/shopping_cart_page.dart @@ -314,6 +314,8 @@ class _ShoppingCartPage extends State ) : GestureDetector( onTap: () { + if(isAllItemUnSelected()) + return; clearShopCar(); }, child: Container( @@ -322,7 +324,7 @@ class _ShoppingCartPage extends State height: 32.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( - color:Color(0xFFFB312B), + color:isAllItemUnSelected()?Color(0xFFE5E5E5):Color(0xFFFB312B), borderRadius: BorderRadius.circular(16), boxShadow: [ BoxShadow( @@ -351,6 +353,29 @@ class _ShoppingCartPage extends State ); } + ///按钮选中/未选中 + bool isAllItemUnSelected(){ + bool unAllSelectedFlag = true; + bool allSelectedFlag = true; + if(shopCarGoods == null || shopCarGoods.length == 0){ + setState(() { + isAllSelect = false; + }); + return unAllSelectedFlag; + } + shopCarGoods[0] + .shoppingCartSkuItemList + .forEach((element) { + if(element.selected == 1) + unAllSelectedFlag = false; + else allSelectedFlag = false; + }); + setState(() { + isAllSelect = allSelectedFlag; + }); + return unAllSelectedFlag; + } + Widget cartGoodsList() { return (shopCarGoods == null || shopCarGoods.length == 0) ? NoDataView( diff --git a/lib/store/shopping/shopping_home/search_page.dart b/lib/store/shopping/shopping_home/search_page.dart index 2861bc28..ee067d04 100644 --- a/lib/store/shopping/shopping_home/search_page.dart +++ b/lib/store/shopping/shopping_home/search_page.dart @@ -99,7 +99,7 @@ class _SearchPage extends State strArr.removeAt(strArr.length - 1); setState(() { historySearch.clear(); - historySearch.addAll(strArr); + historySearch.addAll(strArr.reversed); }); } @@ -772,43 +772,35 @@ class _SearchPage extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(top: 8, right: 8), - padding: EdgeInsets.only(left: 2, right: 2), - height: 17.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - color: Color(0xFF5A5A5A), - ), - child: Text( - productListBeans.supplierName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, - ), - ), + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left: 2, right: 2), + height: 18.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF5A5A5A), ), - ), - Expanded( - child: Container( child: Text( - "已售${productListBeans?.sellCount ?? 0}件", + AppUtils.textSubStr( productListBeans.supplierName ?? "",8), style: TextStyle( - fontSize: 12.sp, + fontSize: 10.sp, fontWeight: MyFontWeight.regular, - color: Color(0xFF5D5D5D), + color: Colors.white, ), ), - alignment: Alignment.topRight, - )), + ), + Text( + "已售${productListBeans?.sellCount ?? 0}件", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5D5D5D), + ), + ), ], ), Text( diff --git a/lib/store/shopping/shopping_mall_home.dart b/lib/store/shopping/shopping_mall_home.dart index 197f1093..b761fedf 100644 --- a/lib/store/shopping/shopping_mall_home.dart +++ b/lib/store/shopping/shopping_mall_home.dart @@ -139,7 +139,8 @@ class _ShoppingMallHome extends State storeId, tenant, ), - if (minToken != null && choiceIndex == 1) ShoppingCartPage( + if (minToken != null && choiceIndex == 1) + ShoppingCartPage( minToken, storeId, tenant,