|
|
@@ -12,25 +12,31 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
HotRankingListModel styleModel; |
|
|
|
int index; |
|
|
|
|
|
|
|
HotRankingGoods({Key key, this.good, this.styleModel, this.index}) : super(key: key); |
|
|
|
HotRankingGoods({Key key, this.good, this.styleModel, this.index}) |
|
|
|
: super(key: key); |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
var indexImage; |
|
|
|
if (styleModel.hotRankIconList != null && styleModel.hotRankIconList.length > 0 && styleModel.hotRankIconList.length - 1 >= index) { |
|
|
|
if (styleModel.hotRankIconList != null && |
|
|
|
styleModel.hotRankIconList.length > 0 && |
|
|
|
styleModel.hotRankIconList.length - 1 >= index) { |
|
|
|
indexImage = styleModel.hotRankIconList[index]; |
|
|
|
} |
|
|
|
Providers providers = getProvider(good.provider); |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
RouterUtil.route(SkipModel(skipIdentifier: "goods_details"), good?.toJson(), context); |
|
|
|
RouterUtil.route(SkipModel(skipIdentifier: "goods_details"), |
|
|
|
good?.toJson(), context); |
|
|
|
}, |
|
|
|
child: Stack( |
|
|
|
children: <Widget>[ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.all(15.w), |
|
|
|
margin: EdgeInsets.only(top: 8.w, bottom: 8.w, left: 25.w, right: 25.w), |
|
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15.w)), |
|
|
|
margin: |
|
|
|
EdgeInsets.only(top: 8.w, bottom: 8.w, left: 25.w, right: 25.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, borderRadius: BorderRadius.circular(15.w)), |
|
|
|
child: Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
@@ -40,11 +46,15 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
height: 254.w, |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(6), |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: good?.goodImage ?? '', |
|
|
|
child: Hero( |
|
|
|
tag: (good?.goodImage ?? "") + "top", |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: good?.goodImage ?? '', |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(6)), |
|
|
|
decoration: |
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(6)), |
|
|
|
), |
|
|
|
|
|
|
|
/// 商品图片右边视图 |
|
|
@@ -64,8 +74,12 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
WidgetSpan( |
|
|
|
alignment: ui.PlaceholderAlignment.middle, |
|
|
|
child: Container( |
|
|
|
padding: EdgeInsets.only(left: 4.w, right: 4.w, top: 1, bottom: 1), |
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex(providers.providerBgColor), borderRadius: BorderRadius.circular(2.5)), |
|
|
|
padding: EdgeInsets.only( |
|
|
|
left: 4.w, right: 4.w, top: 1, bottom: 1), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex( |
|
|
|
providers.providerBgColor), |
|
|
|
borderRadius: BorderRadius.circular(2.5)), |
|
|
|
child: Text( |
|
|
|
good.providerName ?? "", |
|
|
|
style: TextStyle( |
|
|
@@ -79,7 +93,12 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
child: SizedBox( |
|
|
|
width: 4.h, |
|
|
|
)), |
|
|
|
TextSpan(text: good.goodTitle, style: TextStyle(color: HexColor.fromHex(styleModel.titleColor ?? ""), fontSize: 30.sp)) |
|
|
|
TextSpan( |
|
|
|
text: good.goodTitle, |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex( |
|
|
|
styleModel.titleColor ?? ""), |
|
|
|
fontSize: 30.sp)) |
|
|
|
])), |
|
|
|
|
|
|
|
/// 优惠券 |
|
|
@@ -88,16 +107,32 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
good.coupon == "" |
|
|
|
? Container() |
|
|
|
: Container( |
|
|
|
margin: EdgeInsets.only(top: 4, bottom: 4, right: 15.w), |
|
|
|
margin: EdgeInsets.only( |
|
|
|
top: 4, bottom: 4, right: 15.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: HexColor.fromHex(styleModel.couponCommission.left.couponBgColor), |
|
|
|
image: DecorationImage(image: CachedNetworkImageProvider(styleModel.couponCommission.left.couponBgImg))), |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: HexColor.fromHex(styleModel |
|
|
|
.couponCommission.left.couponBgColor), |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
styleModel.couponCommission.left |
|
|
|
.couponBgImg))), |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.only(left: 8, right: 8, top: 2, bottom: 2), |
|
|
|
padding: const EdgeInsets.only( |
|
|
|
left: 8, right: 8, top: 2, bottom: 2), |
|
|
|
child: Text( |
|
|
|
(good.coupon ?? "") + (styleModel.couponCommission.left.couonText ?? ""), |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel.couponCommission.left.couponFontColor), fontSize: 22.sp, fontFamily: 'Din', package: 'zhiying_base_widget'), |
|
|
|
(good.coupon ?? "") + |
|
|
|
(styleModel.couponCommission.left |
|
|
|
.couonText ?? |
|
|
|
""), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex(styleModel |
|
|
|
.couponCommission |
|
|
|
.left |
|
|
|
.couponFontColor), |
|
|
|
fontSize: 22.sp, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget'), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@@ -106,14 +141,33 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
: Container( |
|
|
|
margin: EdgeInsets.only(top: 4, bottom: 4), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: HexColor.fromHex(styleModel.couponCommission.right.commissionBgColor ?? ""), |
|
|
|
image: DecorationImage(image: CachedNetworkImageProvider(styleModel.couponCommission.right.commissionBgImg ?? ""))), |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: HexColor.fromHex(styleModel |
|
|
|
.couponCommission |
|
|
|
.right |
|
|
|
.commissionBgColor ?? |
|
|
|
""), |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
styleModel.couponCommission.right |
|
|
|
.commissionBgImg ?? |
|
|
|
""))), |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.only(left: 8, right: 8, top: 2, bottom: 2), |
|
|
|
padding: const EdgeInsets.only( |
|
|
|
left: 8, right: 8, top: 2, bottom: 2), |
|
|
|
child: Text( |
|
|
|
(styleModel.couponCommission.right.commissionText ?? "") + (good.commission ?? ""), |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel.couponCommission.right.commissionFontColor), fontSize: 22.sp,fontFamily: 'Din', package: 'zhiying_base_widget'), |
|
|
|
(styleModel.couponCommission.right |
|
|
|
.commissionText ?? |
|
|
|
"") + |
|
|
|
(good.commission ?? ""), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex(styleModel |
|
|
|
.couponCommission |
|
|
|
.right |
|
|
|
.commissionFontColor), |
|
|
|
fontSize: 22.sp, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget'), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@@ -130,12 +184,21 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
padding: EdgeInsets.only(bottom: 6.sp), |
|
|
|
child: Text( |
|
|
|
"¥", |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel.currentPriceColor ?? ""), fontSize: 20.sp), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex( |
|
|
|
styleModel.currentPriceColor ?? ""), |
|
|
|
fontSize: 20.sp), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
good.currentPrice ?? "", |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel.currentPriceColor ?? ""), fontSize: 40.sp,fontWeight: FontWeight.bold ,fontFamily: 'Din', package: 'zhiying_base_widget'), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex( |
|
|
|
styleModel.currentPriceColor ?? ""), |
|
|
|
fontSize: 40.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget'), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
width: 6, |
|
|
@@ -144,7 +207,13 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
padding: EdgeInsets.only(bottom: 4.sp), |
|
|
|
child: Text( |
|
|
|
"¥" + good.marketPrice ?? "", |
|
|
|
style: TextStyle(color: HexColor.fromHex(styleModel.marketPriceColor ?? ""), fontSize: 22.sp, decoration: TextDecoration.lineThrough, fontFamily: 'Din', package: 'zhiying_base_widget'), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex( |
|
|
|
styleModel.marketPriceColor ?? ""), |
|
|
|
fontSize: 22.sp, |
|
|
|
decoration: TextDecoration.lineThrough, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget'), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
@@ -167,11 +236,17 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
padding: EdgeInsets.only( |
|
|
|
left: 40.w, |
|
|
|
), |
|
|
|
margin: EdgeInsets.only(right: 20, left: 20.w), |
|
|
|
color: HexColor.fromHex(styleModel.hotRank.bgColor ?? ""), |
|
|
|
margin: |
|
|
|
EdgeInsets.only(right: 20, left: 20.w), |
|
|
|
color: HexColor.fromHex( |
|
|
|
styleModel.hotRank.bgColor ?? ""), |
|
|
|
child: Text( |
|
|
|
"热销" + good.inorderCount + "件", |
|
|
|
style: TextStyle(color: Colors.white, fontSize: 22.sp, fontFamily: 'Din', package: 'zhiying_base_widget'), |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.white, |
|
|
|
fontSize: 22.sp, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_base_widget'), |
|
|
|
), |
|
|
|
)) |
|
|
|
], |
|
|
@@ -180,10 +255,12 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
width: 48.w, |
|
|
|
height: 48.w, |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: styleModel?.hotRank?.hotSaleImg ?? "", |
|
|
|
imageUrl: |
|
|
|
styleModel?.hotRank?.hotSaleImg ?? "", |
|
|
|
width: 48.w, |
|
|
|
height: 48.w, |
|
|
|
placeholder: (context, _) => Container(color: Colors.yellow), |
|
|
|
placeholder: (context, _) => |
|
|
|
Container(color: Colors.yellow), |
|
|
|
fit: BoxFit.fill, |
|
|
|
), |
|
|
|
), |
|
|
@@ -193,8 +270,13 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
height: 48.h, |
|
|
|
width: 127.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage(image: CachedNetworkImageProvider(styleModel.hotRank.buyNowImg ?? ""), fit: BoxFit.fitWidth), |
|
|
|
borderRadius: BorderRadius.circular(20)), |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
styleModel.hotRank.buyNowImg ?? |
|
|
|
""), |
|
|
|
fit: BoxFit.fitWidth), |
|
|
|
borderRadius: |
|
|
|
BorderRadius.circular(20)), |
|
|
|
margin: EdgeInsets.only(right: 0), |
|
|
|
)) |
|
|
|
], |
|
|
@@ -210,7 +292,9 @@ class HotRankingGoods extends StatelessWidget { |
|
|
|
Align( |
|
|
|
alignment: Alignment.topLeft, |
|
|
|
child: Container( |
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(indexImage ?? ""))), |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider(indexImage ?? ""))), |
|
|
|
margin: EdgeInsets.only(left: 40.w, top: 8.h), |
|
|
|
height: 60.w, |
|
|
|
width: 60.w, |
|
|
|