|
@@ -1,9 +1,12 @@
|
|
|
+import 'package:cpt_property/components/bottomDialog.dart';
|
|
|
import 'package:cpt_property/modules/property/page/property_page.dart';
|
|
|
+import 'package:cs_resources/theme/app_colors_theme.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
|
+import 'package:shared/utils/color_utils.dart';
|
|
|
import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:shared/utils/util.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
@@ -29,21 +32,33 @@ class PropertyNewsPage extends HookConsumerWidget {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ static double cardHeight = 117.5 + 50;
|
|
|
+ static double cardLeftWidth = 125;
|
|
|
+
|
|
|
Widget _buildItemLeftSection(BuildContext context,WidgetRef ref, item, _vm) {
|
|
|
+ final imageHeight = item['pic']!.isNotEmpty? cardHeight + 15 : cardHeight;
|
|
|
return Container(
|
|
|
- // color: Colors.blue,
|
|
|
- width: 100,
|
|
|
- // height: 117.5,
|
|
|
- child: Center(
|
|
|
- child: MyLoadImage(
|
|
|
- item['pic'],
|
|
|
- placeholderPath: Assets.propertyNewsItemBg,
|
|
|
- width: 60.5,
|
|
|
- height: 50.5,
|
|
|
+ height: imageHeight,
|
|
|
+ width: cardLeftWidth,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorUtils.string2Color('#F2F3F6'),
|
|
|
+ // color: Colors.red,
|
|
|
+ borderRadius: const BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(8),
|
|
|
+ bottomLeft: Radius.circular(8),
|
|
|
+ ),
|
|
|
),
|
|
|
- )
|
|
|
- ).marginOnly(right: 17.5).constrained(
|
|
|
- minHeight: 117.5,
|
|
|
+ child: Center(
|
|
|
+ child: MyLoadImage(
|
|
|
+ item['pic'],
|
|
|
+ placeholderPath: Assets.propertyNewsItemBg,
|
|
|
+ height: item['pic']!.isNotEmpty? imageHeight : 60.5,
|
|
|
+ width: item['pic']!.isNotEmpty? cardLeftWidth : 50.5,
|
|
|
+ // fit: BoxFit.cover,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ cornerRadius: 8,
|
|
|
+ ),
|
|
|
+ )
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -58,74 +73,78 @@ class PropertyNewsPage extends HookConsumerWidget {
|
|
|
}));
|
|
|
|
|
|
return Container(
|
|
|
- color: Colors.white,
|
|
|
- padding: const EdgeInsets.only(left:5, top: 10.5, bottom: 10.5),
|
|
|
- child: Container(
|
|
|
- child: Stack(
|
|
|
- children: [
|
|
|
- Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: MyTextView(
|
|
|
- item['title'],
|
|
|
- maxLines: 2, // 设置最大行数为2
|
|
|
- isTextEllipsis: true, // 超出部分用省略号表示
|
|
|
- fontSize: 16,
|
|
|
- textColor: Colors.black,
|
|
|
- isFontMedium: true,
|
|
|
- ),
|
|
|
+ padding: const EdgeInsets.only(left:17.5,right: 17.5,top: 13, bottom: 13),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: context.appColors.backgroundWhite,
|
|
|
+ borderRadius: const BorderRadius.only(
|
|
|
+ topRight: Radius.circular(8),
|
|
|
+ bottomRight: Radius.circular(8),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: MyTextView(
|
|
|
+ item['title'],
|
|
|
+ maxLines: 2, // 设置最大行数为2
|
|
|
+ isTextEllipsis: true, // 超出部分用省略号表示
|
|
|
+ fontSize: 16,
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
+ isFontMedium: true,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 10.5),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: MyTextView(
|
|
|
+ item['description'],
|
|
|
+ maxLines: 2, // 设置最大行数为2
|
|
|
+ isTextEllipsis: true, // 超出部分用省略号表示
|
|
|
+ fontSize: 12,
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
+ isFontRegular: true,
|
|
|
)
|
|
|
- ],
|
|
|
- ),
|
|
|
- const SizedBox(height: 10.5),
|
|
|
- Row(
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 12.5),
|
|
|
+ Row(
|
|
|
children: [
|
|
|
Expanded(
|
|
|
child: MyTextView(
|
|
|
- item['description'],
|
|
|
- maxLines: 2, // 设置最大行数为2
|
|
|
+ Utils.getTimeAgo(item['time']),
|
|
|
+ maxLines: 1, // 设置最大行数为1
|
|
|
isTextEllipsis: true, // 超出部分用省略号表示
|
|
|
fontSize: 12,
|
|
|
- textColor: Colors.black,
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
isFontRegular: true,
|
|
|
- )
|
|
|
+ ),
|
|
|
)
|
|
|
]
|
|
|
- ),
|
|
|
- const SizedBox(height: 12.5),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: MyTextView(
|
|
|
- Utils.getTimeAgo(item['time']),
|
|
|
- maxLines: 1, // 设置最大行数为2
|
|
|
- isTextEllipsis: true, // 超出部分用省略号表示
|
|
|
- fontSize: 12,
|
|
|
- textColor: Colors.black,
|
|
|
- isFontRegular: true,
|
|
|
- ),
|
|
|
- )
|
|
|
- ]
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
- right: 5,
|
|
|
- bottom: 0,
|
|
|
- child: MyAssetImage(isCollection? Assets.propertyCollectionActive:Assets.propertyCollection,width:22,height: 20.5,).onTap((){
|
|
|
- Log.d("点击了收藏按钮");
|
|
|
- _vm.handlerCollection(item, isCollection);
|
|
|
- }),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ).constrained(
|
|
|
- minHeight: 96.5,
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ right: 5,
|
|
|
+ bottom: 0,
|
|
|
+ child: MyAssetImage(isCollection? Assets.propertyCollectionActive:Assets.propertyCollection,width:22,height: 20.5,).onTap((){
|
|
|
+ Log.d("点击了收藏按钮");
|
|
|
+ _vm.handlerCollection(item, isCollection);
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
+ ).constrained(
|
|
|
+ minHeight: cardHeight
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -139,6 +158,17 @@ class PropertyNewsPage extends HookConsumerWidget {
|
|
|
Container(
|
|
|
width: MediaQuery.of(context).size.width - 30,
|
|
|
margin: const EdgeInsets.only(left: 15,right: 15,top: 12.5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(10),
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: ColorUtils.string2Color('#000000').withOpacity(0.05),
|
|
|
+ offset: const Offset(0, 0),
|
|
|
+ blurRadius: 10,
|
|
|
+ spreadRadius: 0,
|
|
|
+ ),
|
|
|
+ ]
|
|
|
+ ),
|
|
|
child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
@@ -153,7 +183,7 @@ class PropertyNewsPage extends HookConsumerWidget {
|
|
|
],
|
|
|
).onTap((){
|
|
|
// 去详情
|
|
|
- _vm.goNewsDetail(item);
|
|
|
+ // _vm.goNewsDetail(item);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -173,6 +203,8 @@ class PropertyNewsPage extends HookConsumerWidget {
|
|
|
|
|
|
return Scaffold(
|
|
|
// appBar: AppBar(title: Text("资产")),
|
|
|
+ // backgroundColor: context.appColors.backgroundDefault,
|
|
|
+ backgroundColor: ColorUtils.string2Color("#F2F3F6"),
|
|
|
body: SizedBox(
|
|
|
width: double.infinity,
|
|
|
height: double.infinity,
|