Browse Source

更改

master
w-R 3 years ago
parent
commit
2a2b1ff269
  1. 39
      lib/home/home_view/featured_acticvity.dart
  2. 2
      lib/web/web_page.dart

39
lib/home/home_view/featured_acticvity.dart

@ -39,13 +39,12 @@ class _FeaturedActivity extends State<FeaturedActivity> {
"searchKey": "",
"type": 1,
"state": 1
}).catchError((error) {
});
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
activityList = baseData.data.list;
if(activityList != null && activityList.length == 1)
if (activityList != null && activityList.length == 1)
activityList.add(activityList[0]);
if(activityList != null && activityList.length == 2)
if (activityList != null && activityList.length == 2)
activityList.add(activityList[1]);
}
}
@ -69,9 +68,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
margin: EdgeInsets.symmetric(horizontal: 9.w),
child: Row(
children: [
if(activityList != null && activityList.length > 0)
if (activityList != null && activityList.length > 0)
Container(
child: stackItem(18.sp,activityList[0]),
child: stackItem(18.sp, activityList[0]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h,
@ -86,13 +85,13 @@ class _FeaturedActivity extends State<FeaturedActivity> {
),
),
),
if(activityList != null && activityList.length > 1)
if (activityList != null && activityList.length > 1)
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
child: stackItem(12.sp,activityList[1]),
child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
@ -101,15 +100,17 @@ class _FeaturedActivity extends State<FeaturedActivity> {
color: Colors.green,
image: DecorationImage(
image: NetworkImage(
activityList[1].coverImg,
activityList[2].coverImg,
),
fit: BoxFit.cover,
),
),
),
SizedBox(height: 5,),
SizedBox(
height: 5,
),
Container(
child: stackItem(12.sp,activityList[2]),
child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
@ -123,7 +124,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
fit: BoxFit.cover,
),
),
),
)
],
),
),
@ -137,7 +138,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
);
}
Widget stackItem(double textSize,Activity activity) {
Widget stackItem(double textSize, Activity activity) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
@ -149,6 +150,8 @@ class _FeaturedActivity extends State<FeaturedActivity> {
children: [
Text(
activity.mainTitle,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: textSize,
@ -181,7 +184,13 @@ class _FeaturedActivity extends State<FeaturedActivity> {
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Row(
child:
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activity.id});
},
child:Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -199,7 +208,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
size: 12,
),
],
),
)),
),
],
);

2
lib/web/web_page.dart

@ -271,7 +271,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
///
CommentList(
commentKey,
article?.likes ?? activity?.likes ?? "0",
article?.likes ?? activity?.likes.toString() ?? "0",
article?.id ?? activity?.id,
isKeyBoardShow,
_reply,

Loading…
Cancel
Save