|
|
@@ -30,7 +30,8 @@ class GoodsDetailsFooterWidget extends StatelessWidget { |
|
|
|
visible: !EmptyUtil.isEmpty(model), |
|
|
|
replacement: GoodsDetailsFooterSkeleton(), |
|
|
|
child: BlocProvider<GoodsDetailsFooterBloc>( |
|
|
|
create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), |
|
|
|
create: (_) => |
|
|
|
GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), |
|
|
|
//..add(GoodsDetailsFooterInitEvent(model: model)), |
|
|
|
child: GooddsDetailsFooterContainer( |
|
|
|
model, |
|
|
@@ -47,16 +48,18 @@ class GooddsDetailsFooterContainer extends StatefulWidget { |
|
|
|
const GooddsDetailsFooterContainer(this.model, {Key key}) : super(key: key); |
|
|
|
|
|
|
|
@override |
|
|
|
_GooddsDetailsFooterContainerState createState() => _GooddsDetailsFooterContainerState(); |
|
|
|
_GooddsDetailsFooterContainerState createState() => |
|
|
|
_GooddsDetailsFooterContainerState(); |
|
|
|
} |
|
|
|
|
|
|
|
class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContainer> { |
|
|
|
|
|
|
|
class _GooddsDetailsFooterContainerState |
|
|
|
extends State<GooddsDetailsFooterContainer> { |
|
|
|
UserInfoModel _user; |
|
|
|
|
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
BlocProvider.of<GoodsDetailsFooterBloc>(context).add(GoodsDetailsFooterInitEvent(model: widget?.model)); |
|
|
|
BlocProvider.of<GoodsDetailsFooterBloc>(context) |
|
|
|
.add(GoodsDetailsFooterInitEvent(model: widget?.model)); |
|
|
|
super.initState(); |
|
|
|
} |
|
|
|
|
|
|
@@ -64,7 +67,9 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
void _openHome() { |
|
|
|
Navigator.pushAndRemoveUntil( |
|
|
|
context, |
|
|
|
CupertinoPageRoute(builder: (BuildContext context) => PageFactory.create('homePage', null)), |
|
|
|
CupertinoPageRoute( |
|
|
|
builder: (BuildContext context) => |
|
|
|
PageFactory.create('homePage', null)), |
|
|
|
(Route<dynamic> route) => false, |
|
|
|
); |
|
|
|
} |
|
|
@@ -100,7 +105,8 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Navigator.of(context).push(CupertinoPageRoute(builder: (context) => GoodsSharePage(widget.model))); |
|
|
|
Navigator.of(context).push(CupertinoPageRoute( |
|
|
|
builder: (context) => GoodsSharePage(widget.model))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -170,7 +176,8 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
return SafeArea( |
|
|
|
child: Container( |
|
|
|
width: double.infinity, |
|
|
|
padding: EdgeInsets.only(bottom: (height > 10 ? 0 : 8), top: 8, left: 21, right: 12.5), |
|
|
|
padding: EdgeInsets.only( |
|
|
|
bottom: (height > 10 ? 0 : 8), top: 8, left: 21, right: 12.5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
// boxShadow: [ |
|
|
|
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0), |
|
|
@@ -209,12 +216,18 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
onTap: () => _openHome(), |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.only(right: 35), |
|
|
|
child: _getCustomWidget(model?.home ?? '首页', model?.home_color ?? '999999', model?.home_icon ?? ''), |
|
|
|
child: _getCustomWidget(model?.home ?? '首页', |
|
|
|
model?.home_color ?? '999999', model?.home_icon ?? ''), |
|
|
|
)), |
|
|
|
GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: () => _collectOnClick(), |
|
|
|
child: Padding(padding: const EdgeInsets.only(right: 0), child: _getCustomWidget(model?.collect ?? '收藏', model?.collect_color ?? '999999', model?.collect_icon ?? ''))) |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.only(right: 0), |
|
|
|
child: _getCustomWidget( |
|
|
|
model?.collect ?? '收藏', |
|
|
|
model?.collect_color ?? '999999', |
|
|
|
model?.collect_icon ?? ''))) |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
@@ -241,30 +254,40 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
width: 110, |
|
|
|
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
colors: [HexColor.fromHex(model?.share_earn_bg1_color ?? '#FFCA66'), HexColor.fromHex(model?.share_earn_bg2_color ?? '#FFD961')], |
|
|
|
begin: Alignment.centerLeft, |
|
|
|
end: Alignment.centerRight), |
|
|
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))), |
|
|
|
gradient: LinearGradient(colors: [ |
|
|
|
HexColor.fromHex(model?.share_earn_bg1_color ?? '#FFCA66'), |
|
|
|
HexColor.fromHex(model?.share_earn_bg2_color ?? '#FFD961') |
|
|
|
], begin: Alignment.centerLeft, end: Alignment.centerRight), |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
children: <Widget>[ |
|
|
|
RichText( |
|
|
|
text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.share_earn_val_color ?? 'FFFFFF')), children: [ |
|
|
|
TextSpan( |
|
|
|
text: model?.share_value ?? '0.0', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget')), |
|
|
|
]), |
|
|
|
text: TextSpan( |
|
|
|
text: '¥ ', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12, |
|
|
|
color: HexColor.fromHex( |
|
|
|
model?.share_earn_val_color ?? 'FFFFFF')), |
|
|
|
children: [ |
|
|
|
TextSpan( |
|
|
|
text: model?.share_value ?? '0.0', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
color: HexColor.fromHex( |
|
|
|
model?.share_earn_color ?? '#FFFFFF'), |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget')), |
|
|
|
]), |
|
|
|
), |
|
|
|
Text( |
|
|
|
model?.share_earn ?? '分享赚', |
|
|
|
style: TextStyle(color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), fontSize: 12), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), |
|
|
|
fontSize: 12), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
@@ -283,29 +306,42 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
height: 44, |
|
|
|
width: 110, |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
colors: [HexColor.fromHex(model?.save_earn_bg1_color ?? '#FF6969'), HexColor.fromHex(model?.save_earn_bg2_color ?? '#FF4646')], |
|
|
|
begin: Alignment.centerLeft, |
|
|
|
end: Alignment.centerRight), |
|
|
|
borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))), |
|
|
|
gradient: LinearGradient(colors: [ |
|
|
|
HexColor.fromHex(model?.save_earn_bg1_color ?? '#FF6969'), |
|
|
|
HexColor.fromHex(model?.save_earn_bg2_color ?? '#FF4646') |
|
|
|
], begin: Alignment.centerLeft, end: Alignment.centerRight), |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
bottomRight: Radius.circular(25), |
|
|
|
topRight: Radius.circular(25))), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
children: <Widget>[ |
|
|
|
RichText( |
|
|
|
text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.save_earn_val_color ?? 'FFFFFF')), children: [ |
|
|
|
TextSpan( |
|
|
|
text: model?.slef_buy_value ?? '0.0', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
color: HexColor.fromHex(model?.save_earn_val_color ?? '#FFFFFF'), |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget', |
|
|
|
)), |
|
|
|
]), |
|
|
|
text: TextSpan( |
|
|
|
text: '¥ ', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12, |
|
|
|
color: HexColor.fromHex( |
|
|
|
model?.save_earn_val_color ?? 'FFFFFF')), |
|
|
|
children: [ |
|
|
|
TextSpan( |
|
|
|
text: model?.self_buy_value ?? '0.0', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
color: HexColor.fromHex( |
|
|
|
model?.save_earn_val_color ?? '#FFFFFF'), |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget', |
|
|
|
)), |
|
|
|
]), |
|
|
|
), |
|
|
|
Text(model?.save_earn ?? '自购省', style: TextStyle(color: HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'), fontSize: 12)) |
|
|
|
Text(model?.save_earn ?? '自购省', |
|
|
|
style: TextStyle( |
|
|
|
color: |
|
|
|
HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'), |
|
|
|
fontSize: 12)) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
@@ -328,7 +364,8 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
|
const SizedBox(height: 5), |
|
|
|
|
|
|
|
/// 图片 |
|
|
|
Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11)) |
|
|
|
Text(text, |
|
|
|
style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11)) |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|