feedback_detail_page.dart 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. import 'package:cpt_main/modules/demo_page.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import 'package:cs_resources/generated/l10n.dart';
  4. import 'package:cs_resources/theme/app_colors_theme.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:auto_route/auto_route.dart';
  7. import 'package:hooks_riverpod/hooks_riverpod.dart';
  8. import 'package:plugin_platform/engine/image/image_nine_grid.dart';
  9. import 'package:router/ext/auto_router_extensions.dart';
  10. import 'package:widgets/ext/ex_widget.dart';
  11. import 'package:widgets/my_appbar.dart';
  12. import 'package:widgets/my_load_image.dart';
  13. import 'package:widgets/my_text_view.dart';
  14. import '../../../router/page/main_page_router.dart';
  15. import 'feedback_detail_view_model.dart';
  16. @RoutePage()
  17. class FeedbackDetailPage extends HookConsumerWidget {
  18. const FeedbackDetailPage({Key? key}) : super(key: key);
  19. //启动当前页面
  20. static void startInstance({BuildContext? context}) {
  21. if (context != null) {
  22. context.router.push(const FeedbackDetailPageRoute());
  23. } else {
  24. appRouter.push(const FeedbackDetailPageRoute());
  25. }
  26. }
  27. @override
  28. Widget build(BuildContext context, WidgetRef ref) {
  29. final viewModel = ref.watch(feedbackDetailViewModelProvider.notifier);
  30. final state = ref.watch(feedbackDetailViewModelProvider);
  31. return Scaffold(
  32. appBar: MyAppBar.appBar(context, S.current.feedback_details, showBottomDivider: true),
  33. backgroundColor: context.appColors.backgroundDark,
  34. body: SingleChildScrollView(
  35. scrollDirection: Axis.vertical,
  36. physics: const BouncingScrollPhysics(),
  37. child: Column(
  38. mainAxisSize: MainAxisSize.max,
  39. crossAxisAlignment: CrossAxisAlignment.start,
  40. children: [
  41. Container(
  42. color: context.appColors.whiteBG,
  43. width: double.infinity,
  44. padding: const EdgeInsets.symmetric(horizontal: 10),
  45. height: 85,
  46. child: Column(
  47. mainAxisAlignment: MainAxisAlignment.center,
  48. mainAxisSize: MainAxisSize.max,
  49. crossAxisAlignment: CrossAxisAlignment.start,
  50. children: [
  51. MyTextView(
  52. "Exchange old houses for new ones",
  53. fontSize: 21,
  54. isFontMedium: true,
  55. textColor: context.appColors.textBlack,
  56. ),
  57. MyTextView(
  58. "18 Sep 2024 18:00 | Security | In Progress",
  59. fontSize: 12,
  60. marginTop: 8,
  61. isFontRegular: true,
  62. textColor: context.appColors.textDarkGray,
  63. ),
  64. ],
  65. ),
  66. ),
  67. //反馈的内容
  68. Container(
  69. width: double.infinity,
  70. margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 12.5, bottom: 12.5),
  71. padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 25),
  72. decoration: BoxDecoration(
  73. color: context.appColors.whiteBG,
  74. borderRadius: BorderRadius.circular(6.0), // 圆角
  75. boxShadow: [
  76. BoxShadow(
  77. color: const Color(0xFFB8BFD9).withOpacity(0.3), // 阴影颜色
  78. offset: const Offset(0, 3), // 阴影的偏移量
  79. blurRadius: 8.0, // 模糊半径
  80. spreadRadius: 3.0, // 扩散半径
  81. ),
  82. ],
  83. ),
  84. child: Column(
  85. children: [
  86. MyTextView(
  87. "Why are there no implementation rules andapplication methods for exchanging old houses for new ones in Jiang han District?",
  88. fontSize: 15,
  89. marginBottom: 15,
  90. isFontRegular: true,
  91. textColor: context.appColors.textDarkGray,
  92. ),
  93. //九宫格展示
  94. ImageNineGrid(
  95. isSelectEnable: false,
  96. maxImages: 10,
  97. spacing: 10,
  98. aspectRatio: 108 / 80,
  99. initialImages: const [
  100. "https://img1.baidu.com/it/u=2931243091,718249849&fm=253&fmt=auto&app=120&f=JPEG?w=569&h=427",
  101. "https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641",
  102. "https://inews.gtimg.com/om_bt/OVx3YS2XJc1zbndGTkjPKW9J0W7kN8M0SIidT-3K4mb2YAA/641",
  103. "https://inews.gtimg.com/om_bt/OAVMydtx9BsJxf5i_thi4Oll9sR1px-Esmtv6UHSxoisEAA/641"
  104. ],
  105. onImagesChanged: (list) {},
  106. ),
  107. ],
  108. ),
  109. ),
  110. //回复的数据
  111. state.isReplyState ? _buildReplyWidget(context, ref) : _buildWaitingWidget(context)
  112. ],
  113. )),
  114. );
  115. }
  116. Widget _buildReplyWidget(BuildContext context, WidgetRef ref) {
  117. return Column(
  118. crossAxisAlignment: CrossAxisAlignment.start,
  119. children: [
  120. Row(
  121. mainAxisSize: MainAxisSize.max,
  122. mainAxisAlignment: MainAxisAlignment.start,
  123. crossAxisAlignment: CrossAxisAlignment.center,
  124. children: [
  125. MyTextView(
  126. S.current.administrator_reply,
  127. fontSize: 18,
  128. isFontRegular: true,
  129. textColor: context.appColors.textBlack,
  130. ).expanded(),
  131. MyTextView(
  132. "20 sep 2024 18:00",
  133. fontSize: 12,
  134. isFontRegular: true,
  135. textColor: context.appColors.textDarkGray,
  136. )
  137. ],
  138. ).marginOnly(left: 12.5, right: 12.5,bottom: 14,top: 2.5),
  139. //回复的内容
  140. Container(
  141. width: double.infinity,
  142. margin: const EdgeInsets.only(left: 12.5, right: 12.5, bottom: 13.5),
  143. padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 25),
  144. decoration: BoxDecoration(
  145. color: context.appColors.whiteBG,
  146. borderRadius: BorderRadius.circular(6.0), // 圆角
  147. boxShadow: [
  148. BoxShadow(
  149. color: const Color(0xFFB8BFD9).withOpacity(0.3), // 阴影颜色
  150. offset: const Offset(0, 3), // 阴影的偏移量
  151. blurRadius: 8.0, // 模糊半径
  152. spreadRadius: 3.0, // 扩散半径
  153. ),
  154. ],
  155. ),
  156. child: Column(
  157. children: [
  158. MyTextView(
  159. "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",
  160. fontSize: 15,
  161. marginBottom: 15,
  162. isFontRegular: true,
  163. textColor: context.appColors.textDarkGray,
  164. ),
  165. //九宫格展示
  166. ImageNineGrid(
  167. isSelectEnable: false,
  168. maxImages: 10,
  169. spacing: 10,
  170. aspectRatio: 108 / 80,
  171. initialImages: const [
  172. "https://img1.baidu.com/it/u=2931243091,718249849&fm=253&fmt=auto&app=120&f=JPEG?w=569&h=427",
  173. "https://inews.gtimg.com/om_bt/OVx3YS2XJc1zbndGTkjPKW9J0W7kN8M0SIidT-3K4mb2YAA/641",
  174. "https://inews.gtimg.com/om_bt/OAVMydtx9BsJxf5i_thi4Oll9sR1px-Esmtv6UHSxoisEAA/641"
  175. ],
  176. onImagesChanged: (list) {},
  177. ),
  178. ],
  179. ),
  180. )
  181. ],
  182. );
  183. }
  184. Widget _buildWaitingWidget(BuildContext context) {
  185. return SizedBox(
  186. width: double.infinity,
  187. child: Column(
  188. children: [
  189. const SizedBox(height: 40),
  190. const MyAssetImage(Assets.mainFeedbackWaitingIcon, width: 38, height: 38),
  191. MyTextView(
  192. S.current.waiting_for_the_administrator,
  193. fontSize: 15,
  194. marginTop: 11,
  195. marginBottom: 40,
  196. isFontRegular: true,
  197. textColor: context.appColors.textDarkGray,
  198. )
  199. ],
  200. ),
  201. );
  202. }
  203. }