From 4bb182bf4c50b1c1e9d63a51f671e3c594d53801 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 27 Jul 2022 16:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BF=AE=E6=94=B9;=20?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E4=BF=AE=E6=94=B9;=20=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=B3=E6=BB=91=E5=88=A0=E9=99=A4;=20?= =?UTF-8?q?=E5=8D=95=E8=A6=8F=E6=A0=BC=E4=B9=9F=E5=BC=B9=E7=AA=97;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/gradle.properties | 3 +- .../community_view/class_details_video.dart | 5 +- .../shopping_cart/shopping_cart_page.dart | 56 +++++++++++++++---- .../shopping/shopping_goods_details.dart | 12 ++-- lib/store/store_view/product_sku.dart | 34 ++++++----- lib/store/store_view/store_order_list.dart | 4 +- lib/union/union_list.dart | 2 +- pubspec.lock | 9 ++- pubspec.yaml | 4 +- 9 files changed, 89 insertions(+), 40 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index 42c318de..8794949b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,4 +2,5 @@ org.gradle.jvmargs=-Xmx4096m android.useAndroidX=true android.enableJetifier=true -MobSDK.mobEnv=x \ No newline at end of file +MobSDK.mobEnv=x +MobSDK.spEdition=FP \ No newline at end of file diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index 0627a41b..abbf7d71 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -74,6 +74,7 @@ class ClassDetailsVideoState extends State { chewieAudioController = ChewieController( videoPlayerController: videoPlayerController, aspectRatio: videoPlayerController.value.aspectRatio, + // aspectRatio: 1.44, //宽高比 autoPlay: false, //自动播放 @@ -81,7 +82,7 @@ class ClassDetailsVideoState extends State { //循环播放 allowFullScreen: true, // 允许全屏 - allowedScreenSleep: true, + allowedScreenSleep: false, //允许屏幕休眠 materialProgressColors: chewie.ChewieProgressColors( playedColor: Colors.white, @@ -104,7 +105,7 @@ class ClassDetailsVideoState extends State { color: Colors.black, key: globalKey,child:(videoPlayerController?.value?.isInitialized ?? false) ? videoWidget( MediaQuery.of(context).size.height, - (MediaQuery.of(context).size.height/videoPlayerController.value.aspectRatio)-43, + (MediaQuery.of(context).size.height/1.44)-43, widget.coverImg, ):Container()); } diff --git a/lib/store/shopping/shopping_cart/shopping_cart_page.dart b/lib/store/shopping/shopping_cart/shopping_cart_page.dart index b50a2d98..a2e65784 100644 --- a/lib/store/shopping/shopping_cart/shopping_cart_page.dart +++ b/lib/store/shopping/shopping_cart/shopping_cart_page.dart @@ -1,6 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -387,7 +388,8 @@ class _ShoppingCartPage extends State ) : Container( margin: EdgeInsets.only(bottom: 50.h), - child: ListView.builder( + child: SlidableAutoCloseBehavior( + child:ListView.builder( itemCount: ((shopCarGoods?.length ?? 0) > 0) ? (shopCarGoods[0]?.shoppingCartSkuItemList?.length ?? 0) : 0, @@ -402,18 +404,52 @@ class _ShoppingCartPage extends State onTap: () { bIndex = position; }, - child: cartGoodsItem(position), + child:Padding( + padding: EdgeInsets.all(8), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(4)), + child: Slidable( + endActionPane: ActionPane( + extentRatio: 0.22, + motion: ScrollMotion(), + children: [ + SlidableAction( + onPressed: (bc) { + shopCarGoods[0].shoppingCartSkuItemList[position].selected = + (shopCarGoods[0].shoppingCartSkuItemList[position].selected == + 0) + ? 1 + : 0; + shopCartAdd(shopCarGoods[0].shoppingCartSkuItemList[position], 0, + shopCarGoods[0].shoppingCartSkuItemList[position].selected); + if(isAllItemUnSelected()) + return; + clearShopCar(); + }, + backgroundColor: Color(0xFFFB312B), + foregroundColor: Colors.white, + label: '删除', + ), + ], + ), + child:cartGoodsItem(position), + ), + ), + ) ); - }), + }) , + ), ); } Widget cartGoodsItem(index) { return Container( - margin: EdgeInsets.all(16), + // margin: EdgeInsets.all(16), padding: EdgeInsets.all(16), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(4),), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), @@ -476,7 +512,7 @@ class _ShoppingCartPage extends State maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 14.sp, + fontSize: 16.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF353535), ), @@ -486,7 +522,7 @@ class _ShoppingCartPage extends State shopCarGoods[0].shoppingCartSkuItemList[index]?.skuName ?? "", style: TextStyle( - fontSize: 10.sp, + fontSize: 12.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF727272), ), @@ -503,7 +539,7 @@ class _ShoppingCartPage extends State TextSpan( text: "¥", style: TextStyle( - fontSize: 10.sp, + fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF32A060), ), @@ -514,7 +550,7 @@ class _ShoppingCartPage extends State ?.skuPrice ?? "", style: TextStyle( - fontSize: 14.sp, + fontSize: 16.sp, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF32A060), ), @@ -559,7 +595,7 @@ class _ShoppingCartPage extends State 0, style: TextStyle( color: Colors.black, - fontSize: 14.sp, + fontSize: 16.sp, fontWeight: MyFontWeight.medium, ), ), diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 5c4d4b88..77fc765c 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -252,11 +252,11 @@ class _ShoppingGoodsDetails extends State { ///选规格弹窗 showStoreSelector(MiNiDetail miNiDetail, String id, int count) async { - if (miNiDetail.attrList != null && - miNiDetail.attrList.length == 1 && - miNiDetail.attrList[0].attrValueList.length == 1) { - _addShopCar(miNiDetail, [], count); - } else { + // if (miNiDetail.attrList != null && + // miNiDetail.attrList.length == 1 && + // miNiDetail.attrList[0].attrValueList.length == 1) { + // _addShopCar(miNiDetail, [], count); + // } else { EasyLoading.dismiss(); dialogShowing = true; SmartDialog.show( @@ -274,7 +274,7 @@ class _ShoppingGoodsDetails extends State { }, alignmentTemp: Alignment.bottomCenter, ); - } + // } } ///选规格添加购物车 diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index e90372e7..ae6ce3d8 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -114,8 +114,8 @@ class _ProductSku extends State { children: [ MImage( widget.miNiDetail.imgs[0], - width: 76, - height: 76, + width: 76.h, + height: 76.h, fit: BoxFit.cover, radius: BorderRadius.circular(4), errorSrc: "assets/image/default_1.webp", @@ -125,6 +125,7 @@ class _ProductSku extends State { width: 10, ), Expanded(child:Column( + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -135,20 +136,21 @@ class _ProductSku extends State { fontWeight: MyFontWeight.medium, ), ), - Padding( - padding: EdgeInsets.only(top: 4, bottom: 7), - child: Text( - "已选: " + - (selectSkus.map((e) => "$e").toList().toString()), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF727272), - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, + if(widget.miNiDetail.attrList[0].attrName!="") + Padding( + padding: EdgeInsets.only(top: 4, bottom: 7), + child: Text( + "已选: " + + (selectSkus.map((e) => "$e").toList().toString()), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF727272), + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + ), ), ), - ), Row( children: [ Text( @@ -188,7 +190,7 @@ class _ProductSku extends State { SizedBox( height:10, ), - if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0) + if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0 && widget.miNiDetail.attrList[0].attrName!="") Expanded( child: ListView.builder( itemCount: widget.miNiDetail.attrList.length, @@ -209,6 +211,8 @@ class _ProductSku extends State { }, ), ), + if (widget.miNiDetail.attrList[0].attrName=="") + Expanded(child: Container()), SizedBox( height: 24, ), diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index 081c2712..b0dd6257 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -200,9 +200,6 @@ class _StoreOrderListPage extends State { // productListBeans.clear(); // productListBeans.addAll(appletProducts[index].productList); controller.jumpTo(appletProducts[index].goodsIndex); - // controller.animateTo(appletProducts[index].goodsIndex, - // duration: Duration(milliseconds: 300), - // curve: Curves.ease); }); }, child: Stack( @@ -212,6 +209,7 @@ class _StoreOrderListPage extends State { color: currentIndex != index ? Color(0xFFFAFAFA) : Colors.white, alignment: Alignment.center, padding: EdgeInsets.all(15), + margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 0ae3d6e6..f7880708 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -59,7 +59,7 @@ class _UnionList extends State { showDeleteDialog(); } // else if (widget.storeList[position].posType.code == - // "RETAILSTORE" && + // "DIRECT" && // widget.storeList[position].storeName == "一心回乡商城") { // Navigator.of(context).pushNamed( // '/router/shopping_mall_home', diff --git a/pubspec.lock b/pubspec.lock index 2d7f0280..5446d6b2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -256,6 +256,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0+1" + flutter_slidable: + dependency: "direct main" + description: + name: flutter_slidable + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.2" flutter_smart_dialog: dependency: "direct main" description: @@ -650,7 +657,7 @@ packages: name: sharesdk_plugin url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.2" + version: "1.3.4" simple_gesture_detector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index df8a9280..e41629c9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -79,7 +79,7 @@ dependencies: package_info: ^2.0.2 - sharesdk_plugin: ^1.3.0 + sharesdk_plugin: ^1.3.4 flutter_spinkit: ^5.0.0 flutter_easyloading: ^3.0.0 @@ -94,6 +94,8 @@ dependencies: table_calendar: ^2.3.3 + flutter_slidable: ^1.3.0 +