|
@@ -3,6 +3,7 @@ import 'package:cs_resources/generated/l10n.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:plugin_platform/engine/image/image_nine_grid.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
@@ -16,14 +17,17 @@ import 'feedback_detail_view_model.dart';
|
|
|
|
|
|
@RoutePage()
|
|
|
class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
- const FeedbackDetailPage({Key? key}) : super(key: key);
|
|
|
+ //Feedback的Id
|
|
|
+ final String? id;
|
|
|
+
|
|
|
+ const FeedbackDetailPage({Key? key, required this.id}) : super(key: key);
|
|
|
|
|
|
//启动当前页面
|
|
|
- static void startInstance({BuildContext? context}) {
|
|
|
+ static void startInstance({BuildContext? context, required String? id}) {
|
|
|
if (context != null) {
|
|
|
- context.router.push(const FeedbackDetailPageRoute());
|
|
|
+ context.router.push(FeedbackDetailPageRoute(id: id));
|
|
|
} else {
|
|
|
- appRouter.push(const FeedbackDetailPageRoute());
|
|
|
+ appRouter.push(FeedbackDetailPageRoute(id: id));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -32,6 +36,14 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
final viewModel = ref.watch(feedbackDetailViewModelProvider.notifier);
|
|
|
final state = ref.watch(feedbackDetailViewModelProvider);
|
|
|
|
|
|
+ useEffect(() {
|
|
|
+ // 组件挂载时执行 - 执行接口请求
|
|
|
+ Future.microtask(() => viewModel.fetchFeedbackDetail(id));
|
|
|
+ return () {
|
|
|
+ // 组件卸载时执行
|
|
|
+ };
|
|
|
+ }, []);
|
|
|
+
|
|
|
return Scaffold(
|
|
|
appBar: MyAppBar.appBar(context, S.current.feedback_details, showBottomDivider: true),
|
|
|
backgroundColor: context.appColors.backgroundDark,
|
|
@@ -53,13 +65,13 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- "Exchange old houses for new ones",
|
|
|
+ state.detail?.title ?? "-",
|
|
|
fontSize: 21,
|
|
|
isFontMedium: true,
|
|
|
textColor: context.appColors.textBlack,
|
|
|
),
|
|
|
MyTextView(
|
|
|
- "18 Sep 2024 18:00 | Security | In Progress",
|
|
|
+ "${state.detail?.createdAt ?? ""} | ${state.detail?.category?.name ?? ""} | ${state.detail?.status == 1 ? S.current.in_progress : S.current.replied}",
|
|
|
fontSize: 12,
|
|
|
marginTop: 8,
|
|
|
isFontRegular: true,
|
|
@@ -87,9 +99,10 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
],
|
|
|
),
|
|
|
child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- "Why are there no implementation rules andapplication methods for exchanging old houses for new ones in Jiang han District?",
|
|
|
+ state.detail?.content ?? "",
|
|
|
fontSize: 15,
|
|
|
marginBottom: 15,
|
|
|
isFontRegular: true,
|
|
@@ -102,12 +115,7 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
maxImages: 10,
|
|
|
spacing: 10,
|
|
|
aspectRatio: 108 / 80,
|
|
|
- initialImages: const [
|
|
|
- "https://img1.baidu.com/it/u=2931243091,718249849&fm=253&fmt=auto&app=120&f=JPEG?w=569&h=427",
|
|
|
- "https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641",
|
|
|
- "https://inews.gtimg.com/om_bt/OVx3YS2XJc1zbndGTkjPKW9J0W7kN8M0SIidT-3K4mb2YAA/641",
|
|
|
- "https://inews.gtimg.com/om_bt/OAVMydtx9BsJxf5i_thi4Oll9sR1px-Esmtv6UHSxoisEAA/641"
|
|
|
- ],
|
|
|
+ initialImages: state.detail?.resources ?? [],
|
|
|
onImagesChanged: (list) {},
|
|
|
),
|
|
|
],
|
|
@@ -122,6 +130,7 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
}
|
|
|
|
|
|
Widget _buildReplyWidget(BuildContext context, WidgetRef ref) {
|
|
|
+ final state = ref.watch(feedbackDetailViewModelProvider);
|
|
|
return Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
@@ -137,13 +146,13 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
textColor: context.appColors.textBlack,
|
|
|
).expanded(),
|
|
|
MyTextView(
|
|
|
- "20 sep 2024 18:00",
|
|
|
+ state.detail?.replies?[0].createdAt ?? "-",
|
|
|
fontSize: 12,
|
|
|
isFontRegular: true,
|
|
|
textColor: context.appColors.textDarkGray,
|
|
|
)
|
|
|
],
|
|
|
- ).marginOnly(left: 12.5, right: 12.5,bottom: 14,top: 2.5),
|
|
|
+ ).marginOnly(left: 12.5, right: 12.5, bottom: 14, top: 2.5),
|
|
|
|
|
|
//回复的内容
|
|
|
Container(
|
|
@@ -163,9 +172,10 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
],
|
|
|
),
|
|
|
child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- "Although the policy of exchanging old houses for new houses in Jianghan District has been released, the specific implementation details and application methods are not yet clear. According to relevant reports, Jianghan District has issued multiple measures for the development of the real estate market, including promoting the trade in policy, but the specific implementation details and application methods have not vet been announced",
|
|
|
+ state.detail?.replies?[0].content ?? "",
|
|
|
fontSize: 15,
|
|
|
marginBottom: 15,
|
|
|
isFontRegular: true,
|
|
@@ -178,11 +188,7 @@ class FeedbackDetailPage extends HookConsumerWidget {
|
|
|
maxImages: 10,
|
|
|
spacing: 10,
|
|
|
aspectRatio: 108 / 80,
|
|
|
- initialImages: const [
|
|
|
- "https://img1.baidu.com/it/u=2931243091,718249849&fm=253&fmt=auto&app=120&f=JPEG?w=569&h=427",
|
|
|
- "https://inews.gtimg.com/om_bt/OVx3YS2XJc1zbndGTkjPKW9J0W7kN8M0SIidT-3K4mb2YAA/641",
|
|
|
- "https://inews.gtimg.com/om_bt/OAVMydtx9BsJxf5i_thi4Oll9sR1px-Esmtv6UHSxoisEAA/641"
|
|
|
- ],
|
|
|
+ initialImages: state.detail?.replies?[0].resources ?? [],
|
|
|
onImagesChanged: (list) {},
|
|
|
),
|
|
|
],
|