Browse Source

详情增加,普通购买待更改

zyh
w-R 3 years ago
parent
commit
4263e4ecaf
  1. 7
      lib/retrofit/data/activity_details.dart
  2. 2
      lib/store/shopping/activity_prefecture_details.dart
  3. 305
      lib/store/shopping/shopping_goods_details.dart

7
lib/retrofit/data/activity_details.dart

@ -461,6 +461,7 @@ class ActProduct {
String shortName, String shortName,
String supplierName, String supplierName,
String detail, String detail,
String rightImg,
}) { }) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
@ -482,6 +483,7 @@ class ActProduct {
_shortName = shortName; _shortName = shortName;
_supplierName =supplierName; _supplierName =supplierName;
_detail = detail; _detail = detail;
_rightImg = rightImg;
} }
ActProduct.fromJson(dynamic json) { ActProduct.fromJson(dynamic json) {
@ -510,6 +512,7 @@ class ActProduct {
_shortName = json['shortName']; _shortName = json['shortName'];
_supplierName = json['supplierName']; _supplierName = json['supplierName'];
_detail = json['detail']; _detail = json['detail'];
_rightImg = json['rightImg'];
} }
String _id; String _id;
@ -532,6 +535,7 @@ class ActProduct {
String _shortName; String _shortName;
String _supplierName; String _supplierName;
String _detail; String _detail;
String _rightImg;
String get id => _id; String get id => _id;
@ -573,6 +577,8 @@ class ActProduct {
String get detail => _detail; String get detail => _detail;
String get rightImg => _rightImg;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['id'] = _id; map['id'] = _id;
@ -597,6 +603,7 @@ class ActProduct {
map['shortName'] = _shortName; map['shortName'] = _shortName;
map['supplierName'] = _supplierName; map['supplierName'] = _supplierName;
map['detail'] = _detail; map['detail'] = _detail;
map['rightImg'] = _rightImg;
return map; return map;
} }
} }

2
lib/store/shopping/activity_prefecture_details.dart

@ -638,7 +638,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
"tenant": tenant, "tenant": tenant,
"limitNumber":actTemplate.limitNumber, "limitNumber":actTemplate.limitNumber,
"limitTime":actTemplate.limitTime, "limitTime":actTemplate.limitTime,
"bannerImg":actTemplate.bannerImg "bannerImg":actTemplate.bannerImg,
}, },
); );
}); });

305
lib/store/shopping/shopping_goods_details.dart

@ -1219,7 +1219,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
Color(0xFF32A057), Color(0xFF32A057),
Color(0xFF61CE6B) Color(0xFF61CE6B)
])), ])),
child: Row( child:
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -1238,7 +1239,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
text: pageType == null text: pageType == null
? (miNiDetail?.price ?? "") ? (miNiDetail?.price ?? "")
: (activityDetails?.actProduct?.promotionPrice ?? : (activityDetails?.actProduct?.promotionPrice ??
""), ""),
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -1249,6 +1250,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
), ),
SizedBox(width: 4.w), SizedBox(width: 4.w),
Expanded(child:
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -1267,87 +1269,250 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
pageType == null pageType == null
? Text( ? Text(
"已售${miNiDetail?.sellCount ?? 0}", "已售${miNiDetail?.sellCount ?? 0}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Colors.white,
),
)
: (pageType == "1"
? Row(
children: [
Container(
margin: EdgeInsets.only(right: 2),
padding: EdgeInsets.only(left: 2, right: 2),
height: 15.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFFFFFFFF),
),
child: Text(
"${limitNumber ?? 0}人团",
style: TextStyle(
fontSize: 9.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF45B35F),
),
),
),
Text(
"已团${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: (pageType == "3"
? Row(
children: [
Container(
margin: EdgeInsets.only(right: 2),
padding:
EdgeInsets.only(left: 2, right: 2),
height: 15.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFFFFFFFF),
),
child: Text(
"最高可砍${double.parse(activityDetails?.actProduct?.productPrice ?? "0") - double.parse(activityDetails?.actProduct?.promotionPrice ?? "0")}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 9.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF45B35F),
),
),
),
Text(
"已砍${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: Text(
"已秒${activityDetails?.actProduct?.sellCount ?? 0}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Colors.white,
),
)))
],
)),
pageType != null ?
(pageType == "2" ?
Row(
children: [
MImage(
activityDetails?.actProduct?.rightImg ?? "",
width:72,
height:30.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
Container(
width:91,
height:50,
color: Color(0xFFB1F6CD),
margin: EdgeInsets.only(left: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"距离结束",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 10.sp, fontSize: 10.sp,
color: Colors.white, color: Color(0xFF32A060),
), ),
) ),
: (pageType == "1" SizedBox(height: 3),
? Row( Row(
children: [ mainAxisAlignment: MainAxisAlignment.center,
Container( crossAxisAlignment: CrossAxisAlignment.center,
margin: EdgeInsets.only(right: 2), children: [
padding: EdgeInsets.only(left: 2, right: 2), InkWell(
height: 15.h, onTap: () {
alignment: Alignment.center, setState(() {});
decoration: BoxDecoration( },
borderRadius: BorderRadius.circular(2), child: Container(
color: Color(0xFFFFFFFF), width: 13,
), height: 14,
child: Text( alignment: Alignment.center,
"${limitNumber ?? 0}人团", decoration: BoxDecoration(
style: TextStyle( color: Color(0xFF32A060),
fontSize: 9.sp, borderRadius: BorderRadius.circular(1)),
fontWeight: MyFontWeight.semi_bold, child: Text(
color: Color(0xFF45B35F), "5",
), style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
), ),
), ),
Text( ),
"已团${(activityDetails?.actProduct?.sellCount ?? 0)}", ),
Padding(
padding: EdgeInsets.only(left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(1)),
child: Text(
"5",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white, color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
), ),
), ),
], ),
) ),
: (pageType == "3" Padding(
? Row( padding: EdgeInsets.only(left: 2.w, right: 2.w),
children: [ child: Text(
Container( ":",
margin: EdgeInsets.only(right: 2), style: TextStyle(
padding: fontWeight: MyFontWeight.medium,
EdgeInsets.only(left: 2, right: 2), fontSize: 10.sp,
height: 15.h, color: Color(0xFF32A060),
alignment: Alignment.center, ),
decoration: BoxDecoration( ),
borderRadius: ),InkWell(
BorderRadius.circular(2), onTap: () {
color: Color(0xFFFFFFFF), setState(() {});
), },
child: Text( child: Container(
"最高可砍${double.parse(activityDetails?.actProduct?.productPrice ?? "0") - double.parse(activityDetails?.actProduct?.promotionPrice ?? "0")}", width: 13,
style: TextStyle( height: 14,
fontSize: 9.sp, alignment: Alignment.center,
fontWeight: MyFontWeight.semi_bold, decoration: BoxDecoration(
color: Color(0xFF45B35F), color: Color(0xFF32A060),
), borderRadius: BorderRadius.circular(1)),
), child: Text(
), "5",
Text(
"已砍${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: Text(
"已秒${activityDetails?.actProduct?.sellCount ?? 0}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, color: Colors.white,
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(1)),
child: Text(
"5",
style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
), ),
))) ),
], ),
) ),
],)
],),
)
],):Padding(padding:EdgeInsets.only(right:16),
child:
MImage(
activityDetails?.actProduct?.rightImg ?? "",
width:72,
height:30.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),)) : Container(),
], ],
), ),
), ),

Loading…
Cancel
Save