|
|
@@ -20,7 +20,8 @@ class StoreWidget extends StatelessWidget { |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return BlocProvider<StoreBloc>( |
|
|
|
create: (_) => StoreBloc(repository: StoreRepository()), //..add(StoreInitEvent(model: model)), |
|
|
|
create: (_) => StoreBloc(repository: StoreRepository()), |
|
|
|
//..add(StoreInitEvent(model: model)), |
|
|
|
child: StoreContainer( |
|
|
|
model, |
|
|
|
key: UniqueKey(), |
|
|
@@ -49,12 +50,13 @@ class _StoreContainerState extends State<StoreContainer> { |
|
|
|
void _onMoreClick() {} |
|
|
|
|
|
|
|
/// 点击商家 |
|
|
|
void _onStoreClick() { |
|
|
|
print("点击了_onStoreClick"); |
|
|
|
void _onStoreClick(StoreModel model) { |
|
|
|
print("点击商家_onStoreClick"); |
|
|
|
Logger.log(widget.model['data']); |
|
|
|
|
|
|
|
// RouterUtil.openWebview(url, context); |
|
|
|
|
|
|
|
Logger.log("店铺:" + model.shop_url); |
|
|
|
if (!EmptyUtil.isEmpty(model.shop_url)) { |
|
|
|
RouterUtil.openWebview(model.shop_url, context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
@@ -80,22 +82,27 @@ class _StoreContainerState extends State<StoreContainer> { |
|
|
|
Widget _getMianWidget(StoreModel model) { |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
_onStoreClick(); |
|
|
|
_onStoreClick(model); |
|
|
|
}, |
|
|
|
child: Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 50 + 20.0 + 18, |
|
|
|
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 20, bottom: 18), |
|
|
|
margin: EdgeInsets.only(top: ParseUtil.stringParseDouble(model?.topMargin), left: ParseUtil.stringParseDouble(model?.leftRightMargin), right: ParseUtil.stringParseDouble(model?.leftRightMargin)), |
|
|
|
margin: EdgeInsets.only( |
|
|
|
top: ParseUtil.stringParseDouble(model?.topMargin), |
|
|
|
left: ParseUtil.stringParseDouble(model?.leftRightMargin), |
|
|
|
right: ParseUtil.stringParseDouble(model?.leftRightMargin)), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex(model?.bgColor), |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), |
|
|
|
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), |
|
|
|
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), |
|
|
|
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), |
|
|
|
) |
|
|
|
), |
|
|
|
color: HexColor.fromHex(model?.bgColor), |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
topRight: |
|
|
|
Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), |
|
|
|
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), |
|
|
|
bottomRight: |
|
|
|
Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), |
|
|
|
bottomLeft: |
|
|
|
Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), |
|
|
|
)), |
|
|
|
child: Row( |
|
|
|
children: <Widget>[ |
|
|
|
/// 商家图片 |
|
|
@@ -149,7 +156,8 @@ class _StoreContainerState extends State<StoreContainer> { |
|
|
|
/// 更多 TODO 暂时隐藏,等后台有数据后再打开 |
|
|
|
Visibility( |
|
|
|
visible: false, |
|
|
|
child: Text(model?.moreText ?? '更多店铺优惠', style: TextStyle(color: HexColor.fromHex('#FF4242'), fontSize: 11))), |
|
|
|
child: Text(model?.moreText ?? '更多店铺优惠', |
|
|
|
style: TextStyle(color: HexColor.fromHex('#FF4242'), fontSize: 11))), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
@@ -160,13 +168,16 @@ class _StoreContainerState extends State<StoreContainer> { |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: <Widget>[ |
|
|
|
/// 宝贝描述 5.0 |
|
|
|
_getCoustomWidet(model?.description ?? '宝贝描述 5.0', model?.descTextColor1 ?? '#999999', model?.heightPointIcon ?? ''), |
|
|
|
_getCoustomWidet(model?.description ?? '宝贝描述 5.0', |
|
|
|
model?.descTextColor1 ?? '#999999', model?.heightPointIcon ?? ''), |
|
|
|
|
|
|
|
/// 物流服务 5.0 |
|
|
|
_getCoustomWidet(model?.logistics ?? '宝贝描述 5.0', model?.descTextColor2 ?? '#999999', model?.publicPointIcon ?? ''), |
|
|
|
_getCoustomWidet(model?.logistics ?? '宝贝描述 5.0', |
|
|
|
model?.descTextColor2 ?? '#999999', model?.publicPointIcon ?? ''), |
|
|
|
|
|
|
|
/// 服务态度 1.0 |
|
|
|
_getCoustomWidet(model?.service ?? '宝贝描述 5.0', model?.descTextColor3 ?? '#999999', model?.lowPointIcon ?? ''), |
|
|
|
_getCoustomWidet(model?.service ?? '宝贝描述 5.0', model?.descTextColor3 ?? '#999999', |
|
|
|
model?.lowPointIcon ?? ''), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|