设备 预约接口
This commit is contained in:
@@ -11,13 +11,9 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
BoxConstraints? bodysize;
|
||||
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
IssueListController controller = Get.put(IssueListController());
|
||||
// ScrollController scrollController = ScrollController();
|
||||
// IssueListPage() {
|
||||
// controller.model.limit = AppConstants.limit;
|
||||
// controller.model.offset = 0;
|
||||
// controller.model.isLoading = false;
|
||||
// controller.model.hasMore = true;
|
||||
// controller.model.issueList!.clear();
|
||||
// controller.initData();
|
||||
|
||||
@@ -31,20 +27,10 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
// });
|
||||
// }
|
||||
|
||||
// void initData() async {}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
controller.model.issueList = [
|
||||
{'title': 'APP如何连接我的智能床?'},
|
||||
{'title': '智能床如何连接网络?'},
|
||||
{'title': '跟换WIFI名称或密码,或者刚换了路由器后,我的智能床无法使用怎么办?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'}
|
||||
];
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
@@ -96,89 +82,120 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
// color: Color(0xFFF6F6F6),
|
||||
),
|
||||
child: Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.model.issueList != null &&
|
||||
controller.model.issueList!.isNotEmpty,
|
||||
replacement: Container(
|
||||
if (controller.model.isLoading) {
|
||||
return Center(child: CircularProgressIndicator()); // ✅ 加载中
|
||||
}
|
||||
|
||||
if (controller.model.issueList.isEmpty) {
|
||||
return Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'暂无内容!',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: AppFontsize.title_size,
|
||||
letterSpacing: 0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
// TitleComponentWidget(
|
||||
// titleName: '问题与帮助',
|
||||
// ),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15),
|
||||
child: Container(
|
||||
width: bodysize!.maxWidth,
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Obx(() => ListView(
|
||||
controller: scrollController,
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
0,
|
||||
5,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: (controller.model.issueList!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => IssuePreviewWidget(
|
||||
index: e.key,
|
||||
issueListController: controller))
|
||||
.toList() as List<Widget>)
|
||||
// .divide(const SizedBox(
|
||||
// height: 30,
|
||||
// ))
|
||||
// .addToEnd(const SizedBox(
|
||||
// height: 26,
|
||||
// ))
|
||||
// .addToStart(SizedBox(
|
||||
// height: 16,
|
||||
// ))
|
||||
)),
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'暂无内容!',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: AppFontsize.title_size,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 有数据时渲染列表
|
||||
return ListView(
|
||||
children: controller.model.issueList!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => IssuePreviewWidget(
|
||||
index: e.key,
|
||||
issueListController: controller,
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
}),
|
||||
|
||||
// Obx(() {
|
||||
// return Visibility(
|
||||
// visible: controller.model.issueList != null &&
|
||||
// controller.model.issueList.isNotEmpty,
|
||||
// replacement: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: 100,
|
||||
// decoration: BoxDecoration(
|
||||
// color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
// ),
|
||||
// child: Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// Align(
|
||||
// alignment: AlignmentDirectional(-1, 0),
|
||||
// child: Text(
|
||||
// '暂无内容!',
|
||||
// style: FlutterFlowTheme.of(context)
|
||||
// .bodyMedium
|
||||
// .override(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: Color(0xFF9EA4B7),
|
||||
// fontSize: AppFontsize.title_size,
|
||||
// letterSpacing: 0,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// // TitleComponentWidget(
|
||||
// // titleName: '问题与帮助',
|
||||
// // ),
|
||||
// Flexible(
|
||||
// child: Padding(
|
||||
// padding:
|
||||
// EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15),
|
||||
// child: Container(
|
||||
// width: bodysize!.maxWidth,
|
||||
// decoration: BoxDecoration(
|
||||
// // color: Colors.white,
|
||||
// // borderRadius: BorderRadius.circular(16),
|
||||
// ),
|
||||
// child: Obx(() => ListView(
|
||||
// padding: const EdgeInsets.fromLTRB(
|
||||
// 0,
|
||||
// 5,
|
||||
// 0,
|
||||
// 0,
|
||||
// ),
|
||||
// shrinkWrap: true,
|
||||
// scrollDirection: Axis.vertical,
|
||||
// children: (controller.model.issueList!
|
||||
// .asMap()
|
||||
// .entries
|
||||
// .map((e) => IssuePreviewWidget(
|
||||
// index: e.key,
|
||||
// issueListController: controller))
|
||||
// .toList() as List<Widget>))),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user