|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/activity_area_list.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/product.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/custom_image.dart'; |
|
|
|
@ -11,6 +12,9 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
class ActivityPrefectureDetails extends StatefulWidget { |
|
|
|
|
final Map<String, dynamic> arguments; |
|
|
|
|
|
|
|
|
|
ActivityPrefectureDetails({this.arguments}); |
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
|
return _ActivityPrefectureDetails(); |
|
|
|
@ -21,12 +25,14 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
ApiService apiService; |
|
|
|
|
int seckillIndex = 0; |
|
|
|
|
RefreshController refreshController = RefreshController(); |
|
|
|
|
List<ActivityAreaList> activityAreaList = []; |
|
|
|
|
ScrollController _scrollController; |
|
|
|
|
ScrollPhysics _scrollPhysics = NeverScrollableScrollPhysics(); |
|
|
|
|
bool scrollFlag = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<TimeProductList> actTimeList = []; |
|
|
|
|
List<ProductList> productList = []; |
|
|
|
|
ActTemplate actTemplate; |
|
|
|
|
int actTimeListIndex = 0; |
|
|
|
|
int pageType = 1; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
@ -34,23 +40,25 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
_scrollController = ScrollController(); |
|
|
|
|
_scrollController.addListener(() { |
|
|
|
|
setState(() { |
|
|
|
|
if(_scrollController.offset < (325.h-MediaQuery.of(context).padding.top)){ |
|
|
|
|
if (_scrollController.offset < |
|
|
|
|
(325.h - MediaQuery.of(context).padding.top)) { |
|
|
|
|
_scrollPhysics = NeverScrollableScrollPhysics(); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
} else { |
|
|
|
|
_scrollPhysics = BouncingScrollPhysics(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
pageType =widget.arguments["type"]; |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
apiService = |
|
|
|
|
ApiService(Dio(), context: context, token: value.getString("token")); |
|
|
|
|
queryFindActListByType(false,2); |
|
|
|
|
|
|
|
|
|
queryFindActListByType(pageType == 2 ?false:true); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///秒杀/砍价/拼团列表 |
|
|
|
|
queryFindActListByType(allDay,type) async { |
|
|
|
|
queryFindActListByType(allDay) async { |
|
|
|
|
if (apiService == null) { |
|
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
apiService = ApiService( |
|
|
|
@ -59,14 +67,27 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
token: value.getString("token"), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
BaseData<List<ActivityAreaList>> baseData = |
|
|
|
|
await apiService.findActListByType(allDay,type).catchError((error) { |
|
|
|
|
BaseData<ActivityAreaList> baseData = |
|
|
|
|
await apiService.findActListByType(allDay,pageType).catchError((error) { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
}); |
|
|
|
|
setState(() { |
|
|
|
|
actTimeList.clear(); |
|
|
|
|
productList.clear(); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
activityAreaList.clear(); |
|
|
|
|
activityAreaList.addAll(baseData.data); |
|
|
|
|
setState(() { |
|
|
|
|
actTemplate = baseData.data.actTemplate; |
|
|
|
|
actTimeList.addAll(baseData.data.timeProductList); |
|
|
|
|
actTimeListIndex = 0; |
|
|
|
|
for (var i = 0; i < actTimeList.length; i++) { |
|
|
|
|
if (timeFlag(actTimeList[i].actTime.startHour) == 1) { |
|
|
|
|
actTimeListIndex = i; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (actTimeList.length > actTimeListIndex) |
|
|
|
|
productList.addAll(actTimeList[actTimeListIndex].productList); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -108,14 +129,13 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
swiper(), |
|
|
|
|
seckillIndex == 0 ? |
|
|
|
|
Container( |
|
|
|
|
pageType == 2?(seckillIndex == 0 |
|
|
|
|
? Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
height: 62.h, |
|
|
|
|
padding: EdgeInsets.only(left: 16.w, right: 16.w), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFFEED9)), |
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFEED9)), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
@ -126,22 +146,27 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
height: 38, |
|
|
|
|
fit: BoxFit.contain, |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 14.w,), |
|
|
|
|
Expanded(child:ListView.builder( |
|
|
|
|
SizedBox( |
|
|
|
|
width: 14.w, |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: ListView.builder( |
|
|
|
|
scrollDirection: Axis.horizontal, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
itemCount:activityAreaList != null ? activityAreaList.length : 0, |
|
|
|
|
itemCount: actTimeList?.length ?? 0, |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
actTimeListIndex = position; |
|
|
|
|
productList.clear(); |
|
|
|
|
productList.addAll(actTimeList[actTimeListIndex].productList); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: timeItem(activityAreaList[position],position), |
|
|
|
|
child: timeItem(actTimeList[position], position), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
)) |
|
|
|
|
, |
|
|
|
|
)), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
@ -150,8 +175,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
height: 62.h, |
|
|
|
|
padding: EdgeInsets.only(left: 16.w, right: 16.w), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFFEED9)), |
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFEED9)), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
@ -196,11 +220,11 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
SizedBox(width: 4.w), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,children: [ |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
setState(() {}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: 20, |
|
|
|
@ -219,7 +243,8 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 2.w, right: 2.w), |
|
|
|
|
child: Text( |
|
|
|
|
":", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -227,7 +252,8 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xFFFB312B), |
|
|
|
|
), |
|
|
|
|
),), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 20, |
|
|
|
|
height: 20, |
|
|
|
@ -244,7 +270,8 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 2.w, right: 2.w), |
|
|
|
|
child: Text( |
|
|
|
|
":", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -252,10 +279,10 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xFFFB312B), |
|
|
|
|
), |
|
|
|
|
),), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
}, |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Container( |
|
|
|
|
width: 20, |
|
|
|
|
height: 20, |
|
|
|
@ -273,12 +300,13 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
],) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
)) :Container(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -288,14 +316,16 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
aspectRatio: 1.3698, |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
"", |
|
|
|
|
Positioned( |
|
|
|
|
top: 0,left: 0,right: 0,bottom: 0, |
|
|
|
|
child: MImage( |
|
|
|
|
actTemplate?.coverImg ?? "", |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 330.h, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
@ -310,6 +340,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
pageType == 2 ? |
|
|
|
|
Align( |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
child: Container( |
|
|
|
@ -326,6 +357,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
seckillIndex = 0; |
|
|
|
|
queryFindActListByType(false); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
@ -338,8 +370,12 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
begin: Alignment.centerRight, |
|
|
|
|
end: Alignment.centerLeft, |
|
|
|
|
colors: [ |
|
|
|
|
seckillIndex == 0 ? Color(0xFFF67E5F):Colors.transparent, |
|
|
|
|
seckillIndex == 0 ? Color(0xFFFC5237):Colors.transparent, |
|
|
|
|
seckillIndex == 0 |
|
|
|
|
? Color(0xFFF67E5F) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
seckillIndex == 0 |
|
|
|
|
? Color(0xFFFC5237) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
]), |
|
|
|
|
borderRadius: BorderRadius.circular(16), |
|
|
|
|
boxShadow: [ |
|
|
|
@ -361,13 +397,12 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
))), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
seckillIndex = 1; |
|
|
|
|
queryFindActListByType(true); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
@ -380,8 +415,12 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
begin: Alignment.centerRight, |
|
|
|
|
end: Alignment.centerLeft, |
|
|
|
|
colors: [ |
|
|
|
|
seckillIndex == 1 ? Color(0xFFF67E5F):Colors.transparent, |
|
|
|
|
seckillIndex == 1 ? Color(0xFFFC5237):Colors.transparent, |
|
|
|
|
seckillIndex == 1 |
|
|
|
|
? Color(0xFFF67E5F) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
seckillIndex == 1 |
|
|
|
|
? Color(0xFFFC5237) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
]), |
|
|
|
|
borderRadius: BorderRadius.circular(16), |
|
|
|
|
boxShadow: [ |
|
|
|
@ -403,13 +442,11 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
))), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) : Container(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -419,27 +456,43 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
///秒杀列表 |
|
|
|
|
Widget seckilList() { |
|
|
|
|
return Container( |
|
|
|
|
height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top, |
|
|
|
|
height: MediaQuery.of(context).size.height - |
|
|
|
|
62.h - |
|
|
|
|
MediaQuery.of(context).padding.top, |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
color: Colors.white, |
|
|
|
|
child: ListView.builder( |
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
itemCount:10, |
|
|
|
|
itemCount: productList?.length ?? 0, |
|
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: _scrollPhysics, |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() {}); |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: seckilItem(), |
|
|
|
|
child: seckilItem(productList[position]), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget timeItem(ActivityAreaList activityAreaList,position) { |
|
|
|
|
int timeFlag(String time) { |
|
|
|
|
var now = DateTime.now().hour; |
|
|
|
|
var tHour = int.tryParse(time.substring(0, 2)); |
|
|
|
|
if (now < tHour) |
|
|
|
|
return 0; |
|
|
|
|
else if (now == tHour) |
|
|
|
|
return 1; |
|
|
|
|
else |
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget timeItem(TimeProductList actTimeList, index) { |
|
|
|
|
var tStatus = timeFlag(actTimeList.actTime.startHour); |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.only(right: 12.w, top: 8.h, bottom: 8.h), |
|
|
|
|
child: Column( |
|
|
|
@ -447,19 +500,84 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
activityAreaList.timeProductList[position].actTime.startHour, |
|
|
|
|
actTimeList.actTime.startHour, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 17.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
color: Color(0xFFFC3127), |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Color(0xFFFC3127) |
|
|
|
|
: Color(0xFF4D4D4D), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded(child: Container( |
|
|
|
|
Expanded( |
|
|
|
|
child: tStatus == 0 |
|
|
|
|
? Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 48.w, |
|
|
|
|
height: 15.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFB312B), |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Color(0xFFFB312B) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
borderRadius: BorderRadius.circular(16), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"即将开始", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Colors.white |
|
|
|
|
: Color(0xFF4D4D4D), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: (tStatus == 1 |
|
|
|
|
? Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 48.w, |
|
|
|
|
height: 15.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Color(0xFFFB312B) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
borderRadius: BorderRadius.circular(16), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"马上抢", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Colors.white |
|
|
|
|
: Color(0xFF4D4D4D), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 48.w, |
|
|
|
|
height: 15.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Color(0xFFFB312B) |
|
|
|
|
: Colors.transparent, |
|
|
|
|
borderRadius: BorderRadius.circular(16), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
@ -475,43 +593,43 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.white, |
|
|
|
|
color: index == actTimeListIndex |
|
|
|
|
? Colors.white |
|
|
|
|
: Color(0xFF4D4D4D), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
)) |
|
|
|
|
))) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget seckilItem() { |
|
|
|
|
Widget seckilItem(ProductList productList) { |
|
|
|
|
var tStatus = timeFlag(actTimeList[actTimeListIndex].actTime.startHour); |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.only(right: 12.w, top: 12.h, bottom: 12.h), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
// MImage( |
|
|
|
|
// "", |
|
|
|
|
// width: 94.w, |
|
|
|
|
// height: 94.h, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorSrc: "assets/image/default_1.png", |
|
|
|
|
// fadeSrc: "assets/image/default_1.png", |
|
|
|
|
// ), |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_story_td.png", |
|
|
|
|
MImage( |
|
|
|
|
productList.productImg, |
|
|
|
|
width: 94, |
|
|
|
|
height: 94, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 12.w, |
|
|
|
|
), |
|
|
|
|
SizedBox(width:12.w,), |
|
|
|
|
Expanded(child: Column( |
|
|
|
|
Expanded( |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"[生态小农]山林放养鸡蛋30枚/盒", |
|
|
|
|
productList.productName, |
|
|
|
|
maxLines: 2, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -521,7 +639,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"限量45件", |
|
|
|
|
"限量${productList.productStock}件", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
@ -532,8 +650,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
children: [ |
|
|
|
|
ClipRRect( |
|
|
|
|
borderRadius: BorderRadius.circular(6.5), |
|
|
|
|
child: |
|
|
|
|
Stack( |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 180.w, |
|
|
|
@ -547,13 +664,18 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
gradient: LinearGradient( |
|
|
|
|
begin: Alignment.centerLeft, |
|
|
|
|
end: Alignment.centerRight, |
|
|
|
|
colors: [Color(0xFFFDBA56), Color(0xFFFB2B2B)])), |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFFFDBA56), |
|
|
|
|
Color(0xFFFB2B2B) |
|
|
|
|
])), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
SizedBox(width: 5,), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 5, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"已售67%", |
|
|
|
|
"已售${productList.sellCount}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
@ -576,7 +698,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: "123.00", |
|
|
|
|
text: productList.promotionPrice, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
@ -586,8 +708,9 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded(child: Text( |
|
|
|
|
"¥234.00", |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
productList.productPrice, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
decoration: TextDecoration.lineThrough, |
|
|
|
@ -595,8 +718,36 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
),), |
|
|
|
|
Container( |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
tStatus == 0 |
|
|
|
|
? Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 60.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFE2F6EA), |
|
|
|
|
borderRadius: BorderRadius.circular(12), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"即将开始", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF52AF79), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: (tStatus == 1 |
|
|
|
|
? Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 60.w, |
|
|
|
|
height: 24.h, |
|
|
|
@ -620,64 +771,39 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
|
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
width: 60.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
borderRadius: BorderRadius.circular(12), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"已结束", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFFADADAD), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
// Container( |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// width:60.w, |
|
|
|
|
// height:24.h, |
|
|
|
|
// decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFE2F6EA), |
|
|
|
|
// borderRadius: BorderRadius.circular(12), |
|
|
|
|
// boxShadow: [ |
|
|
|
|
// BoxShadow( |
|
|
|
|
// color: Colors.black.withAlpha(12), |
|
|
|
|
// offset: Offset(0, 3), |
|
|
|
|
// blurRadius: 14, |
|
|
|
|
// spreadRadius: 0, |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// child: Text( |
|
|
|
|
// "即将开始", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize:12.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFF52AF79), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// Container( |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// width:60.w, |
|
|
|
|
// height:24.h, |
|
|
|
|
// decoration: BoxDecoration( |
|
|
|
|
// color: Colors.transparent, |
|
|
|
|
// borderRadius: BorderRadius.circular(12), |
|
|
|
|
// boxShadow: [ |
|
|
|
|
// BoxShadow( |
|
|
|
|
// color: Colors.black.withAlpha(12), |
|
|
|
|
// offset: Offset(0, 3), |
|
|
|
|
// blurRadius: 14, |
|
|
|
|
// spreadRadius: 0, |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// child: Text( |
|
|
|
|
// "已结束", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize:12.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFADADAD), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
)), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
),) |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|