|
|
|
@ -11,7 +11,6 @@ import 'package:huixiang/view_widget/round_button.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
|
|
|
|
|
|
class StoreInfos extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
final StoreInfo storeInfo; |
|
|
|
|
|
|
|
|
|
StoreInfos(this.storeInfo); |
|
|
|
@ -20,12 +19,164 @@ class StoreInfos extends StatefulWidget {
|
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
|
return _StoreInfos(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _StoreInfos extends State<StoreInfos> { |
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(17, 20, 15, 8), |
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), |
|
|
|
|
width: double.infinity, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(25), |
|
|
|
|
offset: Offset(0, 1), |
|
|
|
|
blurRadius: 12, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
widget.storeInfo != null ? widget.storeInfo.storeName : "", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
S.of(context).ren( |
|
|
|
|
widget.storeInfo != null |
|
|
|
|
? widget.storeInfo.perCapitaConsumption |
|
|
|
|
: "", |
|
|
|
|
), |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 22.w, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: itemServer( |
|
|
|
|
widget.storeInfo != null |
|
|
|
|
? widget.storeInfo.businessService |
|
|
|
|
: "", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
widget.storeInfo != null ? widget.storeInfo.address : "", |
|
|
|
|
maxLines: 2, |
|
|
|
|
textAlign: TextAlign.justify, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).yingyeshijian(widget.storeInfo == null |
|
|
|
|
? "" |
|
|
|
|
: (widget.storeInfo.openStartTime == null && |
|
|
|
|
widget.storeInfo.openEndTime == null) |
|
|
|
|
? S.of(context).quantian |
|
|
|
|
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " |
|
|
|
|
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Column( |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
widget.storeInfo != null ? widget.storeInfo.logo : "", |
|
|
|
|
width: 69, |
|
|
|
|
height: 69, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 21.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
if (widget.storeInfo == null || |
|
|
|
|
widget.storeInfo.latitude == null || |
|
|
|
|
widget.storeInfo.longitude == null || |
|
|
|
|
widget.storeInfo.latitude == "" || |
|
|
|
|
widget.storeInfo.longitude == "") return; |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/location_map', arguments: { |
|
|
|
|
"lat": widget.storeInfo.latitude, |
|
|
|
|
"lng": widget.storeInfo.longitude, |
|
|
|
|
"storeName": widget.storeInfo.storeName, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_location.png", |
|
|
|
|
width: 24.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 16.w, |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showCallMobile(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_union_call.png", |
|
|
|
|
width: 24, |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
return AspectRatio( |
|
|
|
|
aspectRatio: 1, |
|
|
|
|
child: Container( |
|
|
|
@ -226,13 +377,13 @@ class _StoreInfos extends State<StoreInfos> {
|
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
itemCount: (widget.storeInfo != null && widget.storeInfo.bannerList != null) |
|
|
|
|
itemCount: |
|
|
|
|
(widget.storeInfo != null && widget.storeInfo.bannerList != null) |
|
|
|
|
? widget.storeInfo.bannerList.length |
|
|
|
|
: 1), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Widget> itemServer(String businessService) { |
|
|
|
|
if (businessService == null || businessService == "") return []; |
|
|
|
|
var list = businessService.split(","); |
|
|
|
@ -293,7 +444,4 @@ class _StoreInfos extends State<StoreInfos> {
|
|
|
|
|
throw 'Could not launch $url'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|