|
|
@ -2,6 +2,7 @@ import 'package:dio/dio.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; |
|
|
|
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
|
|
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; |
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
@ -644,7 +645,6 @@ class _SearchPage extends State<SearchPage> |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
|
|
|
|
(productListBeans == null || productListBeans?.length == 0) |
|
|
|
(productListBeans == null || productListBeans?.length == 0) |
|
|
|
? NoDataView( |
|
|
|
? NoDataView( |
|
|
|
src: "assets/image/ding_dan.webp", |
|
|
|
src: "assets/image/ding_dan.webp", |
|
|
@ -653,37 +653,66 @@ class _SearchPage extends State<SearchPage> |
|
|
|
fontSize: 16.sp, |
|
|
|
fontSize: 16.sp, |
|
|
|
margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w), |
|
|
|
margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w), |
|
|
|
) |
|
|
|
) |
|
|
|
: GridView.builder( |
|
|
|
: |
|
|
|
itemCount: productListBeans?.length ?? 0, |
|
|
|
// GridView.builder( |
|
|
|
shrinkWrap: true, |
|
|
|
// itemCount: productListBeans?.length ?? 0, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
// shrinkWrap: true, |
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
// physics: NeverScrollableScrollPhysics(), |
|
|
|
//一行的Widget数量 |
|
|
|
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
crossAxisCount: 2, |
|
|
|
// //一行的Widget数量 |
|
|
|
//水平子Widget之间间距 |
|
|
|
// crossAxisCount: 2, |
|
|
|
crossAxisSpacing: 11.w, |
|
|
|
// //水平子Widget之间间距 |
|
|
|
//垂直子Widget之间间距 |
|
|
|
// crossAxisSpacing: 11.w, |
|
|
|
mainAxisSpacing: 16.w, |
|
|
|
// //垂直子Widget之间间距 |
|
|
|
//子Widget宽高比例 0.59 |
|
|
|
// mainAxisSpacing: 16.w, |
|
|
|
childAspectRatio: 185 / |
|
|
|
// //子Widget宽高比例 0.59 |
|
|
|
(281 / 2 + (281 / 2) * AppUtils.textScale(context)), |
|
|
|
// childAspectRatio: 185 / |
|
|
|
), |
|
|
|
// (281 / 2 + (281 / 2) * AppUtils.textScale(context)), |
|
|
|
itemBuilder: (context, index) { |
|
|
|
// ), |
|
|
|
return GestureDetector( |
|
|
|
// itemBuilder: (context, index) { |
|
|
|
onTap: () { |
|
|
|
// return GestureDetector( |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
// onTap: () { |
|
|
|
'/router/shopping_goods_details', |
|
|
|
// Navigator.of(context).pushNamed( |
|
|
|
arguments: { |
|
|
|
// '/router/shopping_goods_details', |
|
|
|
"id": productListBeans[index].id, |
|
|
|
// arguments: { |
|
|
|
"storeId": widget.arguments["storeId"], |
|
|
|
// "id": productListBeans[index].id, |
|
|
|
"tenant": widget.arguments["tenant"], |
|
|
|
// "storeId": widget.arguments["storeId"], |
|
|
|
}, |
|
|
|
// "tenant": widget.arguments["tenant"], |
|
|
|
); |
|
|
|
// }, |
|
|
|
}, |
|
|
|
// ); |
|
|
|
child: searchListItem(productListBeans[index]), |
|
|
|
// }, |
|
|
|
); |
|
|
|
// child: searchListItem(productListBeans[index]), |
|
|
|
}, |
|
|
|
// ); |
|
|
|
) |
|
|
|
// }, |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
StaggeredGridView.countBuilder( |
|
|
|
|
|
|
|
crossAxisCount: 2, |
|
|
|
|
|
|
|
shrinkWrap: true, |
|
|
|
|
|
|
|
itemCount: productListBeans.length, |
|
|
|
|
|
|
|
mainAxisSpacing: 8, |
|
|
|
|
|
|
|
crossAxisSpacing: 8, |
|
|
|
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
|
|
|
// scrollDirection: Axis.vertical, |
|
|
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
|
|
|
return GestureDetector( |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
|
|
|
'/router/shopping_goods_details', |
|
|
|
|
|
|
|
arguments: { |
|
|
|
|
|
|
|
"id": productListBeans[position].id, |
|
|
|
|
|
|
|
"storeId": widget.arguments["storeId"], |
|
|
|
|
|
|
|
"tenant": widget.arguments["tenant"], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: searchListItem(productListBeans[position]), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
staggeredTileBuilder: (position) { |
|
|
|
|
|
|
|
// return StaggeredTile.count(1,position==0?1:1.2); |
|
|
|
|
|
|
|
return StaggeredTile.fit(1); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
@ -709,19 +738,9 @@ class _SearchPage extends State<SearchPage> |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
ClipRRect( |
|
|
|
decoration: BoxDecoration( |
|
|
|
child: |
|
|
|
borderRadius: BorderRadius.circular(4), |
|
|
|
MImage( |
|
|
|
boxShadow: [ |
|
|
|
|
|
|
|
BoxShadow( |
|
|
|
|
|
|
|
color: Colors.black.withAlpha(10), |
|
|
|
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
|
|
|
blurRadius: 14, |
|
|
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: MImage( |
|
|
|
|
|
|
|
productListBeans?.imgPath ?? "", |
|
|
|
productListBeans?.imgPath ?? "", |
|
|
|
width: double.infinity, |
|
|
|
width: double.infinity, |
|
|
|
height: 166, |
|
|
|
height: 166, |
|
|
@ -729,96 +748,98 @@ class _SearchPage extends State<SearchPage> |
|
|
|
errorSrc: "assets/image/default_1.webp", |
|
|
|
errorSrc: "assets/image/default_1.webp", |
|
|
|
fadeSrc: "assets/image/default_1.webp", |
|
|
|
fadeSrc: "assets/image/default_1.webp", |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
|
|
|
top: Radius.circular(4), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Container( |
|
|
|
child: Container( |
|
|
|
padding: EdgeInsets.only(left: 8.w, right: 8.w,bottom: 15.h), |
|
|
|
padding: EdgeInsets.only(left: 8.w, right: 8.w), |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(top: 8, right: 8), |
|
|
|
margin: EdgeInsets.only(top: 8, right: 8), |
|
|
|
padding: EdgeInsets.only(left: 2, right: 2), |
|
|
|
padding: EdgeInsets.only(left: 2, right: 2), |
|
|
|
height: 18.h, |
|
|
|
height: 18.h, |
|
|
|
alignment: Alignment.center, |
|
|
|
alignment: Alignment.center, |
|
|
|
decoration: BoxDecoration( |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
color: Color(0xFF5A5A5A), |
|
|
|
color: Color(0xFF5A5A5A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
AppUtils.textSubStr( productListBeans.supplierName ?? "",8), |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
child: Text( |
|
|
|
"已售${productListBeans?.sellCount ?? 0}件", |
|
|
|
AppUtils.textSubStr( productListBeans.supplierName ?? "",8), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
color: Color(0xFF5D5D5D), |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
productListBeans?.productName ?? "", |
|
|
|
|
|
|
|
maxLines: 2, |
|
|
|
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"已售${productListBeans?.sellCount ?? 0}件", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
color: Color(0xFF5D5D5D), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(height: 7.h,), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
productListBeans?.productName ?? "", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
height: 1.2.h, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
), |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
SizedBox(height: 7.h,), |
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
Text.rich( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
TextSpan( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text.rich( |
|
|
|
TextSpan( |
|
|
|
TextSpan( |
|
|
|
text: "¥", |
|
|
|
children: [ |
|
|
|
style: TextStyle( |
|
|
|
TextSpan( |
|
|
|
fontSize: 12.sp, |
|
|
|
text: "¥", |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFF32A060), |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
TextSpan( |
|
|
|
), |
|
|
|
text: productListBeans?.price ?? "", |
|
|
|
TextSpan( |
|
|
|
style: TextStyle( |
|
|
|
text: productListBeans?.price ?? "", |
|
|
|
fontSize: 18.sp, |
|
|
|
style: TextStyle( |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontSize: 18.sp, |
|
|
|
color: Color(0xFF32A060), |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
), |
|
|
|
color: Color(0xFF32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
), |
|
|
|
"¥283.00", |
|
|
|
Text( |
|
|
|
style: TextStyle( |
|
|
|
"¥283.00", |
|
|
|
fontSize: 14.sp, |
|
|
|
style: TextStyle( |
|
|
|
decoration: TextDecoration.lineThrough, |
|
|
|
fontSize: 14.sp, |
|
|
|
decorationColor: Color(0xFF585858), |
|
|
|
decoration: TextDecoration.lineThrough, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
decorationColor: Color(0xFF585858), |
|
|
|
color: Color(0xFFA2A2A2), |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
), |
|
|
|
color: Color(0xFFA2A2A2), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|