소스 검색

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

tags/0.0.4+9
“yanghuaxuan” 3 년 전
부모
커밋
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 {
// 智夜生活
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 ->


+ 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));
}
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<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) {
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(
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<SearchResultSortWidget> {
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);
}

@@ -469,7 +537,7 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
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<SearchResultSortWidget> {
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<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;
}

}
}

불러오는 중...
취소
저장