|
|
|
@ -77,123 +77,122 @@ class _ActivityListPage extends State<ActivityListPage>
|
|
|
|
|
super.build(context); |
|
|
|
|
return Container( |
|
|
|
|
child: SizeCacheWidget( |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
controller: _refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
footer: CustomFooter( |
|
|
|
|
builder: (context, mode) { |
|
|
|
|
return MyFooter(mode); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
onRefresh: queryActivity, |
|
|
|
|
child: ListView.builder( |
|
|
|
|
itemCount: activityList == null ? 0 : activityList.length, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/store_detail_page', arguments: { |
|
|
|
|
"html": activityList[position].content, |
|
|
|
|
"title": activityList[position].mainTitle, |
|
|
|
|
"time": activityList[position].createTime, |
|
|
|
|
"storeId": activityList[position].storeId, |
|
|
|
|
"author": activityList[position].storeName |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: FrameSeparateWidget( |
|
|
|
|
child: activityItem(activityList[position]), |
|
|
|
|
placeHolder: AspectRatio( |
|
|
|
|
aspectRatio: 1.34, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
controller: _refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
footer: CustomFooter( |
|
|
|
|
builder: (context, mode) { |
|
|
|
|
return MyFooter(mode); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
onRefresh: queryActivity, |
|
|
|
|
child: ListView.builder( |
|
|
|
|
itemCount: activityList == null ? 0 : activityList.length, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/store_detail_page', arguments: { |
|
|
|
|
"activityId": activityList[position].id |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: FrameSeparateWidget( |
|
|
|
|
child: activityItem(activityList[position]), |
|
|
|
|
placeHolder: AspectRatio( |
|
|
|
|
aspectRatio: 1.34, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget activityItem(Activity activity) { |
|
|
|
|
return AspectRatio( |
|
|
|
|
aspectRatio: 1.34, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
activity.coverImg, |
|
|
|
|
aspectRatio: 2.1, |
|
|
|
|
radius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_2_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_2_1.png", |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
activity.coverImg, |
|
|
|
|
aspectRatio: 2.1, |
|
|
|
|
radius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 16.w, right: 16.w, top: 8.h, bottom: 12.h), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
activity.mainTitle, |
|
|
|
|
maxLines: 1, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_2_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_2_1.png", |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 16.w, right: 16.w, top: 8.h, bottom: 12.h), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
activity.mainTitle, |
|
|
|
|
maxLines: 1, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
activity.viceTitle ?? "", |
|
|
|
|
maxLines: 1, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
activity.viceTitle ?? "", |
|
|
|
|
maxLines: 1, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
ConstrainedBox( |
|
|
|
|
constraints: BoxConstraints( |
|
|
|
|
maxWidth: double.infinity, |
|
|
|
|
minWidth: double.infinity, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
child: Row( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
children: [ |
|
|
|
@ -227,12 +226,12 @@ class _ActivityListPage extends State<ActivityListPage>
|
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|