|
@@ -1,10 +1,17 @@
|
|
|
+import 'package:cpt_property/modules/ioan/page/property_ioan_page.dart';
|
|
|
+import 'package:cpt_property/modules/news/page/property_news_page.dart';
|
|
|
+import 'package:cpt_property/modules/rent/page/property_rent_page.dart';
|
|
|
+import 'package:cpt_property/modules/sale/page/property_sale_page.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
|
+import 'package:shared/utils/log_utils.dart';
|
|
|
+import 'package:widgets/my_load_image.dart';
|
|
|
+import 'package:widgets/ext/ex_widget.dart';
|
|
|
|
|
|
import '../../../router/page/property_page_router.dart';
|
|
|
-import '../vm/property_view_model.dart';
|
|
|
+import '../vm/property_vm.dart';
|
|
|
|
|
|
@RoutePage()
|
|
|
class PropertyPage extends HookConsumerWidget {
|
|
@@ -19,15 +26,84 @@ class PropertyPage extends HookConsumerWidget {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @override
|
|
|
- Widget build(BuildContext context, WidgetRef ref) {
|
|
|
- final _viewModel = ref.read(propertyViewModelProvider.notifier);
|
|
|
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(title: Text("资产")),
|
|
|
- body: Center(
|
|
|
- child: Text("房屋资产的主页面"),
|
|
|
+
|
|
|
+ // 顶部tab 切换
|
|
|
+ Widget _buildTopSection(BuildContext context, WidgetRef ref, _vm) {
|
|
|
+ final topSectionsData = _vm.topSectionsData;
|
|
|
+ return Container(
|
|
|
+ color: Colors.white,
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: List.generate(topSectionsData.length, (index) {
|
|
|
+ final item = topSectionsData[index];
|
|
|
+ return Container(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ MyAssetImage(item['icon'], width: 70, height: 70,).onTap((){
|
|
|
+ Log.d("fdjskfds${item['title']}");
|
|
|
+ _vm.switchPage(index, context);
|
|
|
+ switch(index){
|
|
|
+ case 0:
|
|
|
+ PropertySalePage.startInstance(context: context);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ PropertyRentPage.startInstance(context: context);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ PropertyIoanPage.startInstance(context: context);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ PropertyNewsPage.startInstance(context: context);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ type: ClickType.throttle,
|
|
|
+ ),
|
|
|
+ TextButton(
|
|
|
+ onPressed: () {
|
|
|
+ // _vm.selectTab(index);
|
|
|
+ },
|
|
|
+ child: Text(item['title']),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).marginOnly(left:18,right:18,top: 10,bottom: 10);
|
|
|
+ }),
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context, WidgetRef ref) {
|
|
|
+ final _vm = ref.read(propertyVmProvider.notifier);
|
|
|
+ return DefaultTabController(
|
|
|
+ length: 4,
|
|
|
+ child: Scaffold(
|
|
|
+ appBar: AppBar(
|
|
|
+ title: Text("Property"),
|
|
|
+ bottomOpacity: 0.0, // 取消下横线
|
|
|
+ titleTextStyle: TextStyle(color: Colors.black),
|
|
|
+ ),
|
|
|
+ body: Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ _buildTopSection(context, ref, _vm),
|
|
|
+ Expanded(
|
|
|
+ child: AutoRouter(),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|