From 66a17f30e56450b7cc3b5e45b1d920f3355c7e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Tue, 2 Feb 2021 19:51:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E9=A1=B5=E7=9A=84=E9=87=8D=E7=BD=AE=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/android/app/build.gradle | 54 ++++---- .../sort/search_result_sort_widget.dart | 121 +++++++++++++++--- 2 files changed, 133 insertions(+), 42 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 8ad1ad1..82f147d 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -108,33 +108,33 @@ android { // 应用信息配置 - productFlavors { - // 智夜生活 - zhiying { - applicationId "cn.zhios.zhiying" - versionCode 37 - dimension "app" - versionName '1.2.37' - // 签名信息 - signingConfig signingConfigs.zhiying - } - } - - // 打包脚本 - android.applicationVariants.all { variant -> - if (variant.buildType.name != "debug") { - variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") - } - - variant.outputs.all { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.apk')) { - //这里修改apk文件名 - def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" - outputFileName = fileName - } - } - } +// productFlavors { +// // 智夜生活 +// zhiying { +// applicationId "cn.zhios.zhiying" +// versionCode 37 +// dimension "app" +// versionName '1.2.37' +// // 签名信息 +// signingConfig signingConfigs.zhiying +// } +// } +// +// // 打包脚本 +// android.applicationVariants.all { variant -> +// if (variant.buildType.name != "debug") { +// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") +// } +// +// variant.outputs.all { output -> +// def outputFile = output.outputFile +// if (outputFile != null && outputFile.name.endsWith('.apk')) { +// //这里修改apk文件名 +// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" +// outputFileName = fileName +// } +// } +// } configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> diff --git a/lib/widgets/search_result/sort/search_result_sort_widget.dart b/lib/widgets/search_result/sort/search_result_sort_widget.dart index c40c0bd..e441aae 100644 --- a/lib/widgets/search_result/sort/search_result_sort_widget.dart +++ b/lib/widgets/search_result/sort/search_result_sort_widget.dart @@ -169,9 +169,9 @@ class _SearchResultSortWidgetState extends State { BlocProvider.of(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: !model.isSelect)); } setState(() { - _expand = false; - _isShowSX = false; - _isShowZh = false; + _expand = true; + _isShowSX = true; + _isShowZh = true; }); if (model.isSelect || data.select_list[0].isSelect) { @@ -181,6 +181,20 @@ class _SearchResultSortWidgetState extends State { } } + void _onClickFinsh(SearchResultItemSort data, SearchResultSortSelect model) { + String arg = model?.query_args ?? ''; + String id = model?.id ?? ''; + if (!EmptyUtil.isEmpty(id)) { + // BlocProvider.of(context).add(SearchResultGoodsListSortEvent(arg, id)); + BlocProvider.of(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: !model.isSelect)); + } + setState(() { + _expand = false; + _isShowSX = false; + _isShowZh = false; + }); + } + /// 点击当前 void _clickSortType(SearchResultItemSort model) { if (model.type == 'popup' || model.type == 'popup-filter') { @@ -292,7 +306,7 @@ class _SearchResultSortWidgetState extends State { ), ), ), - ) + ), ], ); } @@ -375,12 +389,9 @@ class _SearchResultSortWidgetState extends State { lists.add(Container( padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 13, bottom: 15), decoration: BoxDecoration( - color: Colors.white, - border: Border.all(width: 0, color: Colors.white), - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(12.5), - bottomRight: Radius.circular(12.5), - )), + color: Colors.white, + border: Border.all(width: 0, color: Colors.white), + ), child: _getStoryType(parendData, model[1]))); } } @@ -391,6 +402,63 @@ class _SearchResultSortWidgetState extends State { lists.add(Container()); } + lists.add(Divider( + height: 1, + thickness: 1, + color: HexColor.fromHex("#FFEBEBEB"), + )); + lists.add(Container( + height: 48, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(width: 0, color: Colors.white), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(12.5), + bottomRight: Radius.circular(12.5), + )), + child: Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _reset(parendData, model[1]); + }, + child: Container( + child: Center( + child: Text( + "重置", + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 15), + ), + ), + ), + )), + VerticalDivider( + color: HexColor.fromHex("#FFEBEBEB"), + width: 1, + thickness: 1, + indent: 8, + endIndent: 8, + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + _onClickFinsh(parendData,model[1]); + }, + child: Container( + child: Center( + child: Text( + "完成", + style: TextStyle(color: HexColor.fromHex("#FFFF4242"), fontSize: 15), + ), + ), + ), + )) + ], + ), + )); + return Column(children: lists); } @@ -469,7 +537,7 @@ class _SearchResultSortWidgetState extends State { decoration: InputDecoration( filled: true, fillColor: Colors.transparent, - isDense: true, + isDense: true, contentPadding: EdgeInsets.zero, // contentPadding: const EdgeInsets.only(bottom: 6, left: ), border: InputBorder.none, @@ -495,10 +563,9 @@ class _SearchResultSortWidgetState extends State { Text( model?.name ?? '综合', style: TextStyle( - color: HexColor.fromHex( - model.type != 'sort' ? model.isSelect ? widget?.model?.text_select_color ?? '#FF4242' : widget?.model?.text_no_select_color ?? '#333333' : - model.state == '0' ? '#333333' : '#FF4242' - ), + color: HexColor.fromHex(model.type != 'sort' + ? model.isSelect ? widget?.model?.text_select_color ?? '#FF4242' : widget?.model?.text_no_select_color ?? '#333333' + : model.state == '0' ? '#333333' : '#FF4242'), fontSize: 14, ), ), @@ -556,4 +623,28 @@ class _SearchResultSortWidgetState extends State { ), ); } + + void _reset(SearchResultItemSort data ,SearchResultSortSelect model) { + _startPriceEditingController.text = ""; + _endPriceEditingController.text = ""; + String arg = model?.query_args ?? ''; + String id = model?.id ?? ''; + model.isSelect = false; + if (!EmptyUtil.isEmpty(id)) { + // BlocProvider.of(context).add(SearchResultGoodsListSortEvent(arg, id)); + BlocProvider.of(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: false)); + } + setState(() { + _expand = true; + _isShowSX = true; + _isShowZh = true; + }); + + if (model.isSelect || data.select_list[0].isSelect) { + data.isSelect = true; + } else { + data.isSelect = false; + } + + } }