|
@@ -30,7 +30,8 @@ class GoodsDetailsFooterWidget extends StatelessWidget { |
|
|
visible: !EmptyUtil.isEmpty(model), |
|
|
visible: !EmptyUtil.isEmpty(model), |
|
|
replacement: GoodsDetailsFooterSkeleton(), |
|
|
replacement: GoodsDetailsFooterSkeleton(), |
|
|
child: BlocProvider<GoodsDetailsFooterBloc>( |
|
|
child: BlocProvider<GoodsDetailsFooterBloc>( |
|
|
create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), |
|
|
|
|
|
|
|
|
create: (_) => |
|
|
|
|
|
GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), |
|
|
//..add(GoodsDetailsFooterInitEvent(model: model)), |
|
|
//..add(GoodsDetailsFooterInitEvent(model: model)), |
|
|
child: GooddsDetailsFooterContainer( |
|
|
child: GooddsDetailsFooterContainer( |
|
|
model, |
|
|
model, |
|
@@ -47,16 +48,18 @@ class GooddsDetailsFooterContainer extends StatefulWidget { |
|
|
const GooddsDetailsFooterContainer(this.model, {Key key}) : super(key: key); |
|
|
const GooddsDetailsFooterContainer(this.model, {Key key}) : super(key: key); |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
_GooddsDetailsFooterContainerState createState() => _GooddsDetailsFooterContainerState(); |
|
|
|
|
|
|
|
|
_GooddsDetailsFooterContainerState createState() => |
|
|
|
|
|
_GooddsDetailsFooterContainerState(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContainer> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _GooddsDetailsFooterContainerState |
|
|
|
|
|
extends State<GooddsDetailsFooterContainer> { |
|
|
UserInfoModel _user; |
|
|
UserInfoModel _user; |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
void initState() { |
|
|
void initState() { |
|
|
BlocProvider.of<GoodsDetailsFooterBloc>(context).add(GoodsDetailsFooterInitEvent(model: widget?.model)); |
|
|
|
|
|
|
|
|
BlocProvider.of<GoodsDetailsFooterBloc>(context) |
|
|
|
|
|
.add(GoodsDetailsFooterInitEvent(model: widget?.model)); |
|
|
super.initState(); |
|
|
super.initState(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -64,7 +67,9 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
void _openHome() { |
|
|
void _openHome() { |
|
|
Navigator.pushAndRemoveUntil( |
|
|
Navigator.pushAndRemoveUntil( |
|
|
context, |
|
|
context, |
|
|
CupertinoPageRoute(builder: (BuildContext context) => PageFactory.create('homePage', null)), |
|
|
|
|
|
|
|
|
CupertinoPageRoute( |
|
|
|
|
|
builder: (BuildContext context) => |
|
|
|
|
|
PageFactory.create('homePage', null)), |
|
|
(Route<dynamic> route) => false, |
|
|
(Route<dynamic> route) => false, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@@ -100,7 +105,8 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai |
|
|
return; |
|
|
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( |
|
|
return SafeArea( |
|
|
child: Container( |
|
|
child: Container( |
|
|
width: double.infinity, |
|
|
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( |
|
|
decoration: BoxDecoration( |
|
|
// boxShadow: [ |
|
|
// boxShadow: [ |
|
|
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0), |
|
|
// 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(), |
|
|
onTap: () => _openHome(), |
|
|
child: Padding( |
|
|
child: Padding( |
|
|
padding: const EdgeInsets.only(right: 35), |
|
|
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( |
|
|
GestureDetector( |
|
|
behavior: HitTestBehavior.opaque, |
|
|
behavior: HitTestBehavior.opaque, |
|
|
onTap: () => _collectOnClick(), |
|
|
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, |
|
|
width: 110, |
|
|
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), |
|
|
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5), |
|
|
decoration: BoxDecoration( |
|
|
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( |
|
|
child: Column( |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
RichText( |
|
|
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( |
|
|
Text( |
|
|
model?.share_earn ?? '分享赚', |
|
|
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, |
|
|
height: 44, |
|
|
width: 110, |
|
|
width: 110, |
|
|
decoration: BoxDecoration( |
|
|
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( |
|
|
child: Column( |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
RichText( |
|
|
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), |
|
|
const SizedBox(height: 5), |
|
|
|
|
|
|
|
|
/// 图片 |
|
|
/// 图片 |
|
|
Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11)) |
|
|
|
|
|
|
|
|
Text(text, |
|
|
|
|
|
style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11)) |
|
|
], |
|
|
], |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|