소스 검색

1.添加搜索结果页的重置完成按钮

tags/0.0.4+9
“yanghuaxuan” 4 년 전
부모
커밋
66a17f30e5
2개의 변경된 파일133개의 추가작업 그리고 42개의 파일을 삭제
  1. +27
    -27
      example/android/app/build.gradle
  2. +106
    -15
      lib/widgets/search_result/sort/search_result_sort_widget.dart

+ 27
- 27
example/android/app/build.gradle 파일 보기

@@ -108,33 +108,33 @@ android {




// 应用信息配置 // 应用信息配置
productFlavors { // productFlavors {
// 智夜生活 // // 智夜生活
zhiying { // zhiying {
applicationId "cn.zhios.zhiying" // applicationId "cn.zhios.zhiying"
versionCode 37 // versionCode 37
dimension "app" // dimension "app"
versionName '1.2.37' // versionName '1.2.37'
// 签名信息 // // 签名信息
signingConfig signingConfigs.zhiying // signingConfig signingConfigs.zhiying
} // }
} // }
//
// 打包脚本 // // 打包脚本
android.applicationVariants.all { variant -> // android.applicationVariants.all { variant ->
if (variant.buildType.name != "debug") { // if (variant.buildType.name != "debug") {
variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") // variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
} // }
//
variant.outputs.all { output -> // variant.outputs.all { output ->
def outputFile = output.outputFile // def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) { // if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名 // //这里修改apk文件名
def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" // def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
outputFileName = fileName // outputFileName = fileName
} // }
} // }
} // }


configurations.all { configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details -> resolutionStrategy.eachDependency { DependencyResolveDetails details ->


+ 106
- 15
lib/widgets/search_result/sort/search_result_sort_widget.dart 파일 보기

@@ -169,9 +169,9 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: !model.isSelect)); BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: !model.isSelect));
} }
setState(() { setState(() {
_expand = false; _expand = true;
_isShowSX = false; _isShowSX = true;
_isShowZh = false; _isShowZh = true;
}); });


if (model.isSelect || data.select_list[0].isSelect) { if (model.isSelect || data.select_list[0].isSelect) {
@@ -181,6 +181,20 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
} }
} }


void _onClickFinsh(SearchResultItemSort data, SearchResultSortSelect model) {
String arg = model?.query_args ?? '';
String id = model?.id ?? '';
if (!EmptyUtil.isEmpty(id)) {
// BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListSortEvent(arg, id));
BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListSortEvent(id: id, args: arg, remove: !model.isSelect));
}
setState(() {
_expand = false;
_isShowSX = false;
_isShowZh = false;
});
}

/// 点击当前 /// 点击当前
void _clickSortType(SearchResultItemSort model) { void _clickSortType(SearchResultItemSort model) {
if (model.type == 'popup' || model.type == 'popup-filter') { if (model.type == 'popup' || model.type == 'popup-filter') {
@@ -292,7 +306,7 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
), ),
), ),
), ),
) ),
], ],
); );
} }
@@ -375,12 +389,9 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
lists.add(Container( lists.add(Container(
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 13, bottom: 15), padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 13, bottom: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border.all(width: 0, 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: _getStoryType(parendData, model[1]))); child: _getStoryType(parendData, model[1])));
} }
} }
@@ -391,6 +402,63 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
lists.add(Container()); 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: <Widget>[
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); return Column(children: lists);
} }


@@ -469,7 +537,7 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: Colors.transparent, fillColor: Colors.transparent,
isDense: true, isDense: true,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
// contentPadding: const EdgeInsets.only(bottom: 6, left: ), // contentPadding: const EdgeInsets.only(bottom: 6, left: ),
border: InputBorder.none, border: InputBorder.none,
@@ -495,10 +563,9 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
Text( Text(
model?.name ?? '综合', model?.name ?? '综合',
style: TextStyle( style: TextStyle(
color: HexColor.fromHex( color: HexColor.fromHex(model.type != 'sort'
model.type != 'sort' ? model.isSelect ? widget?.model?.text_select_color ?? '#FF4242' : widget?.model?.text_no_select_color ?? '#333333' : ? model.isSelect ? widget?.model?.text_select_color ?? '#FF4242' : widget?.model?.text_no_select_color ?? '#333333'
model.state == '0' ? '#333333' : '#FF4242' : model.state == '0' ? '#333333' : '#FF4242'),
),
fontSize: 14, fontSize: 14,
), ),
), ),
@@ -556,4 +623,28 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
), ),
); );
} }

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<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListSortEvent(arg, id));
BlocProvider.of<SearchResultGoodsListBloc>(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;
}

}
} }

||||||
x
 
000:0
불러오는 중...
취소
저장