drew 6 jaren geleden
bovenliggende
commit
d327f0674c

BIN
img/3x/icon_dianzhan.png


+ 79 - 0
ios/Podfile.lock

@@ -0,0 +1,79 @@
+PODS:
+  - Flutter (1.0.0)
+  - FMDB (2.7.5):
+    - FMDB/standard (= 2.7.5)
+  - FMDB/standard (2.7.5)
+  - path_provider (0.0.1):
+    - Flutter
+  - path_provider_linux (0.0.1):
+    - Flutter
+  - path_provider_macos (0.0.1):
+    - Flutter
+  - screen (0.0.1):
+    - Flutter
+  - sqflite (0.0.1):
+    - Flutter
+    - FMDB (~> 2.7.2)
+  - video_player (0.0.1):
+    - Flutter
+  - video_player_web (0.0.1):
+    - Flutter
+  - wakelock (0.0.1):
+    - Flutter
+  - webview_flutter (0.0.1):
+    - Flutter
+
+DEPENDENCIES:
+  - Flutter (from `Flutter`)
+  - path_provider (from `.symlinks/plugins/path_provider/ios`)
+  - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
+  - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
+  - screen (from `.symlinks/plugins/screen/ios`)
+  - sqflite (from `.symlinks/plugins/sqflite/ios`)
+  - video_player (from `.symlinks/plugins/video_player/ios`)
+  - video_player_web (from `.symlinks/plugins/video_player_web/ios`)
+  - wakelock (from `.symlinks/plugins/wakelock/ios`)
+  - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
+
+SPEC REPOS:
+  trunk:
+    - FMDB
+
+EXTERNAL SOURCES:
+  Flutter:
+    :path: Flutter
+  path_provider:
+    :path: ".symlinks/plugins/path_provider/ios"
+  path_provider_linux:
+    :path: ".symlinks/plugins/path_provider_linux/ios"
+  path_provider_macos:
+    :path: ".symlinks/plugins/path_provider_macos/ios"
+  screen:
+    :path: ".symlinks/plugins/screen/ios"
+  sqflite:
+    :path: ".symlinks/plugins/sqflite/ios"
+  video_player:
+    :path: ".symlinks/plugins/video_player/ios"
+  video_player_web:
+    :path: ".symlinks/plugins/video_player_web/ios"
+  wakelock:
+    :path: ".symlinks/plugins/wakelock/ios"
+  webview_flutter:
+    :path: ".symlinks/plugins/webview_flutter/ios"
+
+SPEC CHECKSUMS:
+  Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
+  FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
+  path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
+  path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
+  path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
+  screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
+  sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
+  video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
+  video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
+  wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
+  webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
+
+PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
+
+COCOAPODS: 1.8.4

+ 83 - 0
ios/Runner.xcodeproj/project.pbxproj

@@ -13,6 +13,7 @@
 		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
 		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+		B85C0C080E311BFE1ED979F9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BCAC573BDBAFBAEEF971F39 /* Pods_Runner.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -31,9 +32,12 @@
 /* Begin PBXFileReference section */
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
+		2BCAC573BDBAFBAEEF971F39 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
 		74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
 		74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+		74DA41316C13AD0F870DE332 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
+		75B144CA2C13C07D6630150F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -42,6 +46,7 @@
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		9908DED987804F7AA1EC11CF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -49,12 +54,24 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				B85C0C080E311BFE1ED979F9 /* Pods_Runner.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		25EB80FFD04D855305EA5E02 /* Pods */ = {
+			isa = PBXGroup;
+			children = (
+				9908DED987804F7AA1EC11CF /* Pods-Runner.debug.xcconfig */,
+				75B144CA2C13C07D6630150F /* Pods-Runner.release.xcconfig */,
+				74DA41316C13AD0F870DE332 /* Pods-Runner.profile.xcconfig */,
+			);
+			name = Pods;
+			path = Pods;
+			sourceTree = "<group>";
+		};
 		9740EEB11CF90186004384FC /* Flutter */ = {
 			isa = PBXGroup;
 			children = (
@@ -72,6 +89,8 @@
 				9740EEB11CF90186004384FC /* Flutter */,
 				97C146F01CF9000F007C117D /* Runner */,
 				97C146EF1CF9000F007C117D /* Products */,
+				25EB80FFD04D855305EA5E02 /* Pods */,
+				EC108A6BC8EB2AA96E04C817 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -98,6 +117,14 @@
 			path = Runner;
 			sourceTree = "<group>";
 		};
+		EC108A6BC8EB2AA96E04C817 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				2BCAC573BDBAFBAEEF971F39 /* Pods_Runner.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -105,12 +132,14 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
 			buildPhases = (
+				6793E4CA47ADA6C5C7FAEE63 /* [CP] Check Pods Manifest.lock */,
 				9740EEB61CF901F6004384FC /* Run Script */,
 				97C146EA1CF9000F007C117D /* Sources */,
 				97C146EB1CF9000F007C117D /* Frameworks */,
 				97C146EC1CF9000F007C117D /* Resources */,
 				9705A1C41CF9048500538489 /* Embed Frameworks */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+				DD1801F14F300CF415E1810C /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -183,6 +212,28 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
 		};
+		6793E4CA47ADA6C5C7FAEE63 /* [CP] Check Pods Manifest.lock */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			showEnvVarsInLog = 0;
+		};
 		9740EEB61CF901F6004384FC /* Run Script */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -197,6 +248,38 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
 		};
+		DD1801F14F300CF415E1810C /* [CP] Embed Pods Frameworks */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
+				"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
+				"${PODS_ROOT}/../Flutter/Flutter.framework",
+				"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
+				"${BUILT_PRODUCTS_DIR}/screen/screen.framework",
+				"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
+				"${BUILT_PRODUCTS_DIR}/video_player/video_player.framework",
+				"${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
+				"${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework",
+			);
+			name = "[CP] Embed Pods Frameworks";
+			outputPaths = (
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/screen.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+			showEnvVarsInLog = 0;
+		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */

+ 3 - 0
ios/Runner.xcworkspace/contents.xcworkspacedata

@@ -4,4 +4,7 @@
    <FileRef
       location = "group:Runner.xcodeproj">
    </FileRef>
+   <FileRef
+      location = "group:Pods/Pods.xcodeproj">
+   </FileRef>
 </Workspace>

+ 4 - 0
lib/constant/styles.dart

@@ -12,6 +12,10 @@ const COLOR_TEXT_3 = Color(0xFFCACBCC);
 
 const COLOR_TEXT_1 = Color(0xFF000000);
 
+const COLOR_INPUT_BG = Color(0x1A8E8E93);
+
+const COLOR_USERNAME = Color(0xFF7D2424);
+
 Widget appbarTitle(String title, {Color color = COLOR_TEXT_1}) {
   return Text(
     title,

+ 9 - 0
lib/main.dart

@@ -3,6 +3,10 @@ import 'package:flutter/material.dart';
 import 'package:jmrh/constant/styles.dart';
 import 'package:jmrh/view/article.dart';
 import 'package:jmrh/view/home/home_page.dart';
+import 'package:jmrh/view/product_detail.dart';
+import 'package:jmrh/view/product_list.dart';
+import 'package:jmrh/view/qa_detail.dart';
+import 'package:jmrh/view/search.dart';
 import 'package:wakelock/wakelock.dart';
 import 'package:flutter/foundation.dart';
 
@@ -20,6 +24,7 @@ class MyApp extends StatelessWidget {
     return MaterialApp(
       theme: ThemeData(
         backgroundColor: COLOR_PAGE_BG,
+        scaffoldBackgroundColor: COLOR_PAGE_BG,
         primaryColor: COLOR_PRIMARY,
         accentColor: COLOR_PRIMARY,
         highlightColor: Colors.transparent,
@@ -35,6 +40,10 @@ class MyApp extends StatelessWidget {
       routes: {
         '/': (context) => HomePage(),
         '/article': (context) => Article(),
+        '/search': (context) => Search(),
+        '/productList': (context) => ProductList(),
+        '/productDetail': (context) => ProductDetail(),
+        '/qaDetail': (context) => QaDetail()
       },
     );
   }

+ 10 - 6
lib/view/article.dart

@@ -11,13 +11,13 @@ class Article extends StatefulWidget {
 }
 
 class _ArticleState extends State<Article> {
-
   @override
   Widget build(BuildContext context) {
-    final Map<dynamic, dynamic> data = ModalRoute.of(context).settings.arguments;
+    final Map<dynamic, dynamic> data =
+        ModalRoute.of(context).settings.arguments;
     return Scaffold(
-      backgroundColor: COLOR_PAGE_BG,
       appBar: AppBar(
+        brightness: Brightness.light,
         iconTheme: IconTheme.of(context).copyWith(color: COLOR_TEXT_1),
         backgroundColor: Colors.white,
         elevation: 0,
@@ -34,7 +34,8 @@ class _ArticleState extends State<Article> {
         ),
         actions: [
           IconButton(
-            icon: ImageIcon(AssetImage('img/nav_icon_fenxiang_heise.png'), size: 28),
+            icon: ImageIcon(AssetImage('img/nav_icon_fenxiang_heise.png'),
+                size: 28),
             tooltip: '分享',
             onPressed: () {},
           )
@@ -45,8 +46,11 @@ class _ArticleState extends State<Article> {
           SliverToBoxAdapter(
             child: Container(
               margin: EdgeInsets.fromLTRB(16, 27, 16, 0),
-              child:
-                  Text(data['title'], style: TextStyle(fontSize: 20, color: COLOR_TEXT_1, fontWeight: FontWeight.bold)),
+              child: Text(data['title'],
+                  style: TextStyle(
+                      fontSize: 20,
+                      color: COLOR_TEXT_1,
+                      fontWeight: FontWeight.bold)),
             ),
           ),
           SliverToBoxAdapter(

+ 123 - 61
lib/view/home/news.dart

@@ -35,7 +35,9 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
   void initState() {
     super.initState();
     _tabController = TabController(initialIndex: 0, vsync: this, length: 2);
-    DefaultAssetBundle.of(context).loadString('mockdata/news.json').then((value) {
+    DefaultAssetBundle.of(context)
+        .loadString('mockdata/news.json')
+        .then((value) {
       var data = JsonDecoder().convert(value);
       print(data);
       setState(() {
@@ -53,16 +55,16 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      backgroundColor: COLOR_PAGE_BG,
       body: CustomScrollView(
         slivers: <Widget>[
           SliverAppBar(
-            expandedHeight: 355,
+            expandedHeight: 395,
             pinned: true,
             elevation: 0,
             flexibleSpace: FlexibleSpaceBar(
               background: Container(
                 color: Colors.white,
+                margin: EdgeInsets.only(bottom: 40),
                 child: Stack(
                   children: [
                     Image.asset(
@@ -83,23 +85,29 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                               borderRadius: BorderRadius.all(
                                 Radius.circular(4),
                               )),
-                          child: Row(
-                            children: [
-                              Container(
-                                margin: EdgeInsets.only(left: 10),
-                                child: Image.asset(
-                                  'img/icon_search.png',
-                                  width: 16,
-                                ),
-                              ),
-                              Container(
-                                margin: EdgeInsets.only(left: 5),
-                                child: Text(
-                                  '请输入关键字搜索',
-                                  style: TextStyle(fontSize: 11, color: COLOR_TEXT_3),
+                          child: InkWell(
+                            child: Row(
+                              children: [
+                                Container(
+                                  margin: EdgeInsets.only(left: 10),
+                                  child: Image.asset(
+                                    'img/icon_search.png',
+                                    width: 16,
+                                  ),
                                 ),
-                              )
-                            ],
+                                Container(
+                                  margin: EdgeInsets.only(left: 5),
+                                  child: Text(
+                                    '请输入关键字搜索',
+                                    style: TextStyle(
+                                        fontSize: 11, color: COLOR_TEXT_3),
+                                  ),
+                                )
+                              ],
+                            ),
+                            onTap: () {
+                              Navigator.pushNamed(context, '/search');
+                            },
                           ),
                         ),
                         Container(
@@ -107,8 +115,14 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                           margin: EdgeInsets.fromLTRB(16, 0, 16, 20),
                           decoration: BoxDecoration(
                               color: Colors.white,
-                              borderRadius: BorderRadius.all(Radius.circular(4)),
-                              boxShadow: [BoxShadow(color: Color(0x1FEE4444), offset: Offset(0, 6), blurRadius: 16)]),
+                              borderRadius:
+                                  BorderRadius.all(Radius.circular(4)),
+                              boxShadow: [
+                                BoxShadow(
+                                    color: Color(0x1FEE4444),
+                                    offset: Offset(0, 6),
+                                    blurRadius: 16)
+                              ]),
                           child: ClipRRect(
                             child: Column(
                               children: [
@@ -116,7 +130,8 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                                   height: 160,
                                   child: Swiper(
                                     itemCount: banners.length,
-                                    itemBuilder: (BuildContext context, int index) {
+                                    itemBuilder:
+                                        (BuildContext context, int index) {
                                       return CachedNetworkImage(
                                         imageUrl: banners[index]['pic'],
                                         fit: BoxFit.cover,
@@ -127,16 +142,22 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                                         _bannerIndex = index;
                                       });
                                     },
-                                    pagination: SwiperCustomPagination(
-                                        builder: (BuildContext context, SwiperPluginConfig config) {
+                                    pagination: SwiperCustomPagination(builder:
+                                        (BuildContext context,
+                                            SwiperPluginConfig config) {
                                       List<Widget> list = [];
-                                      for (int i = 0; i < config.itemCount; i++) {
+                                      for (int i = 0;
+                                          i < config.itemCount;
+                                          i++) {
                                         list.add(Container(
                                           width: 8,
                                           height: 2,
-                                          margin: EdgeInsets.only(left: 3, right: 3),
+                                          margin: EdgeInsets.only(
+                                              left: 3, right: 3),
                                           decoration: BoxDecoration(
-                                              color: i == config.activeIndex ? Colors.white : Color(0x75FFFFFF)),
+                                              color: i == config.activeIndex
+                                                  ? Colors.white
+                                                  : Color(0x75FFFFFF)),
                                         ));
                                       }
                                       return Container(
@@ -144,7 +165,8 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                                         margin: EdgeInsets.only(bottom: 6),
                                         child: Row(
                                           children: list,
-                                          mainAxisAlignment: MainAxisAlignment.center,
+                                          mainAxisAlignment:
+                                              MainAxisAlignment.center,
                                         ),
                                       );
                                     }),
@@ -155,7 +177,8 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                                   alignment: Alignment.centerLeft,
                                   padding: EdgeInsets.only(left: 12, right: 12),
                                   child: Text(banners[_bannerIndex]['title'],
-                                      maxLines: 1, overflow: TextOverflow.ellipsis),
+                                      maxLines: 1,
+                                      overflow: TextOverflow.ellipsis),
                                 )
                               ],
                             ),
@@ -174,39 +197,76 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
               alignment: Alignment.center,
             ),
             centerTitle: true,
-          ),
-          SliverToBoxAdapter(
-            child: Container(
-              width: 150,
-              height: 40,
-              margin: EdgeInsets.only(bottom: 10),
-              child: TabBar(
-                isScrollable: true,
-                indicatorSize: TabBarIndicatorSize.label,
-                indicatorColor: COLOR_PRIMARY,
-                labelColor: COLOR_PRIMARY,
-                unselectedLabelColor: Color(0xFF939599),
-                labelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
-                unselectedLabelStyle: TextStyle(fontWeight: FontWeight.normal, fontSize: 14),
-                tabs: [
-                  Container(
-                    width: 80,
-                    child: Tab(text: '通知公告'),
-                  ),
-                  Container(
-                    width: 80,
-                    child: Tab(text: '政策法规'),
-                  ),
-                ],
-                controller: _tabController,
-                onTap: (index) {
-                  setState(() {
-                    _tabIndex = index;
-                  });
-                },
+            bottom: PreferredSize(
+              child: Container(
+                height: 40,
+                width: double.infinity,
+                color: Colors.white,
+                child: TabBar(
+                  isScrollable: true,
+                  indicatorSize: TabBarIndicatorSize.label,
+                  indicatorColor: Color(0xFFEA2D2F),
+                  labelColor: COLOR_PRIMARY,
+                  unselectedLabelColor: Color(0xFF939599),
+                  labelStyle:
+                      TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
+                  unselectedLabelStyle:
+                      TextStyle(fontWeight: FontWeight.normal, fontSize: 14),
+                  tabs: [
+                    Container(
+                      width: 80,
+                      child: Tab(text: '通知公告'),
+                    ),
+                    Container(
+                      width: 80,
+                      child: Tab(text: '政策法规'),
+                    ),
+                  ],
+                  controller: _tabController,
+                  onTap: (index) {
+                    setState(() {
+                      _tabIndex = index;
+                    });
+                  },
+                ),
               ),
+              preferredSize: Size.fromHeight(50),
             ),
           ),
+//          SliverToBoxAdapter(
+//            child: Container(
+//              width: 150,
+//              height: 40,
+//              margin: EdgeInsets.only(bottom: 10),
+//              child: TabBar(
+//                isScrollable: true,
+//                indicatorSize: TabBarIndicatorSize.label,
+//                indicatorColor: COLOR_PRIMARY,
+//                labelColor: COLOR_PRIMARY,
+//                unselectedLabelColor: Color(0xFF939599),
+//                labelStyle:
+//                    TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
+//                unselectedLabelStyle:
+//                    TextStyle(fontWeight: FontWeight.normal, fontSize: 14),
+//                tabs: [
+//                  Container(
+//                    width: 80,
+//                    child: Tab(text: '通知公告'),
+//                  ),
+//                  Container(
+//                    width: 80,
+//                    child: Tab(text: '政策法规'),
+//                  ),
+//                ],
+//                controller: _tabController,
+//                onTap: (index) {
+//                  setState(() {
+//                    _tabIndex = index;
+//                  });
+//                },
+//              ),
+//            ),
+//          ),
           SliverList(
             delegate: SliverChildBuilderDelegate(
               (context, index) {
@@ -218,9 +278,11 @@ class _NewsState extends State<News> with SingleTickerProviderStateMixin {
                     endIndent: 16,
                   );
                 }
-                return ItemNewsList((_tabIndex == 0 ? news1 : news2)[index ~/ 2]);
+                return ItemNewsList(
+                    (_tabIndex == 0 ? news1 : news2)[index ~/ 2]);
               },
-              childCount: (_tabIndex == 0 ? news1.length : news2.length) * 2 - 1,
+              childCount:
+                  (_tabIndex == 0 ? news1.length : news2.length) * 2 - 1,
             ),
           ),
         ],

+ 66 - 56
lib/view/home/qa.dart

@@ -28,17 +28,22 @@ class _QaState extends State<Qa> {
                     margin: EdgeInsets.fromLTRB(16, 9, 16, 9),
                     padding: EdgeInsets.only(left: 10),
                     decoration: BoxDecoration(color: Colors.white.withAlpha((255 * 0.2).toInt())),
-                    child: Row(
-                      children: <Widget>[
-                        Image.asset('img/icon_search_white.png'),
-                        Container(
-                          child: Text(
-                            '搜索...',
-                            style: TextStyle(fontSize: 12, color: Colors.white),
+                    child: InkWell(
+                      child: Row(
+                        children: <Widget>[
+                          Image.asset('img/icon_search_white.png'),
+                          Container(
+                            child: Text(
+                              '搜索...',
+                              style: TextStyle(fontSize: 12, color: Colors.white),
+                            ),
+                            margin: EdgeInsets.only(left: 6),
                           ),
-                          margin: EdgeInsets.only(left: 6),
-                        ),
-                      ],
+                        ],
+                      ),
+                      onTap: () {
+                        Navigator.pushNamed(context, '/search');
+                      },
                     ),
                   ),
                 ),
@@ -150,67 +155,72 @@ class _QaState extends State<Qa> {
   }
 
   Widget _qaItem() {
-    return Container(
-      padding: EdgeInsets.only(top: 16, bottom: 16),
-      decoration: BoxDecoration(border: Border(top: BorderSide(width: 1, color: COLOR_BORDER))),
-      child: Column(
-        crossAxisAlignment: CrossAxisAlignment.start,
-        children: [
-          Row(
-            children: [
-              Container(
-                width: 18,
-                height: 18,
-                alignment: Alignment.center,
-                decoration: BoxDecoration(color: COLOR_PRIMARY, borderRadius: BorderRadius.all(Radius.circular(2))),
-                child: Text('问', style: TextStyle(color: Colors.white, fontSize: 11)),
-              ),
-              Expanded(
-                child: Container(
-                  margin: EdgeInsets.only(left: 5),
-                  child: Text(
-                    '李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个“捧”字?',
-                    style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
-                    maxLines: 1,
-                    overflow: TextOverflow.ellipsis,
-                  ),
-                ),
-              )
-            ],
-          ),
-          Container(
-            margin: EdgeInsets.only(top: 10),
-            child: Row(
-              crossAxisAlignment: CrossAxisAlignment.start,
+    return InkWell(
+      child: Container(
+        padding: EdgeInsets.only(top: 16, bottom: 16),
+        decoration: BoxDecoration(border: Border(top: BorderSide(width: 1, color: COLOR_BORDER))),
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            Row(
               children: [
                 Container(
                   width: 18,
                   height: 18,
                   alignment: Alignment.center,
-                  decoration:
-                      BoxDecoration(color: Color(0xFFFFC23B), borderRadius: BorderRadius.all(Radius.circular(2))),
-                  child: Text('答', style: TextStyle(color: Colors.white, fontSize: 11)),
+                  decoration: BoxDecoration(color: COLOR_PRIMARY, borderRadius: BorderRadius.all(Radius.circular(2))),
+                  child: Text('问', style: TextStyle(color: Colors.white, fontSize: 11)),
                 ),
                 Expanded(
                   child: Container(
                     margin: EdgeInsets.only(left: 5),
-                    child: RichText(
-                      maxLines: 2,
-                      text: TextSpan(
-                        style: TextStyle(color: COLOR_TEXT_1, fontSize: 13, height: 1.4),
-                        text: '李克强11月15日上午考察南昌航空城,在首款国产大飞机C919装配厂勉励员工:“安全舒适的大飞安全舒适的大飞安全舒适的大飞…',
-                        children: [
-                          TextSpan(text: '查看详情', style: TextStyle(color: COLOR_PRIMARY, fontWeight: FontWeight.bold))
-                        ],
-                      ),
+                    child: Text(
+                      '李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个“捧”字?',
+                      style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
+                      maxLines: 1,
+                      overflow: TextOverflow.ellipsis,
                     ),
                   ),
                 )
               ],
             ),
-          )
-        ],
+            Container(
+              margin: EdgeInsets.only(top: 10),
+              child: Row(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  Container(
+                    width: 18,
+                    height: 18,
+                    alignment: Alignment.center,
+                    decoration:
+                        BoxDecoration(color: Color(0xFFFFC23B), borderRadius: BorderRadius.all(Radius.circular(2))),
+                    child: Text('答', style: TextStyle(color: Colors.white, fontSize: 11)),
+                  ),
+                  Expanded(
+                    child: Container(
+                      margin: EdgeInsets.only(left: 5),
+                      child: RichText(
+                        maxLines: 2,
+                        text: TextSpan(
+                          style: TextStyle(color: COLOR_TEXT_1, fontSize: 13, height: 1.4),
+                          text: '李克强11月15日上午考察南昌航空城,在首款国产大飞机C919装配厂勉励员工:“安全舒适的大飞安全舒适的大飞安全舒适的大飞…',
+                          children: [
+                            TextSpan(text: '查看详情', style: TextStyle(color: COLOR_PRIMARY, fontWeight: FontWeight.bold))
+                          ],
+                        ),
+                      ),
+                    ),
+                  )
+                ],
+              ),
+            )
+          ],
+        ),
       ),
+      onTap: () {
+        Navigator.of(context).pushNamed('/qaDetail');
+      },
     );
   }
 }

+ 22 - 14
lib/view/home/ronghe.dart

@@ -67,22 +67,30 @@ class _RongheState extends State<Ronghe> {
   }
 
   Widget _item(bg, icon, title) {
-    return ClipRRect(
-      borderRadius: BorderRadius.all(Radius.circular(4)),
-      child: Container(
-        decoration: BoxDecoration(image: DecorationImage(fit: BoxFit.cover, image: Image.asset(bg).image)),
-        child: Column(
-          mainAxisAlignment: MainAxisAlignment.center,
-          crossAxisAlignment: CrossAxisAlignment.center,
-          children: [
-            Image.asset(icon),
-            Container(
-              child: Text(title, style: TextStyle(color: Colors.white, fontSize: 16)),
-              margin: EdgeInsets.only(top: 10),
-            ),
-          ],
+    return InkWell(
+      child: ClipRRect(
+        borderRadius: BorderRadius.all(Radius.circular(4)),
+        child: Container(
+          decoration: BoxDecoration(
+              image: DecorationImage(
+                  fit: BoxFit.cover, image: Image.asset(bg).image)),
+          child: Column(
+            mainAxisAlignment: MainAxisAlignment.center,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              Image.asset(icon),
+              Container(
+                child: Text(title,
+                    style: TextStyle(color: Colors.white, fontSize: 16)),
+                margin: EdgeInsets.only(top: 10),
+              ),
+            ],
+          ),
         ),
       ),
+      onTap: () {
+        Navigator.of(context).pushNamed('/productList');
+      },
     );
   }
 }

+ 111 - 0
lib/view/product_detail.dart

@@ -0,0 +1,111 @@
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:flutter/material.dart';
+import 'package:jmrh/constant/styles.dart';
+
+class ProductDetail extends StatefulWidget {
+  ProductDetail({Key key}) : super(key: key);
+
+  @override
+  _ProductDetailState createState() => _ProductDetailState();
+}
+
+class _ProductDetailState extends State<ProductDetail> {
+  Map<dynamic, dynamic> data = {
+    'title': 'TAS系列回馈式交流精密电子负载',
+    'pic':
+        'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591435687924&di=4198f46193a18f1b48fb044d7cb19c14&imgtype=0&src=http%3A%2F%2Fwww.wocendianyuan.com%2FUploads%2Fimage%2F20181221%2F20181221152807_28835.png',
+    'time': '2020-06-01',
+    'intro':
+        '银河天涛TAS系列回馈式交流精密电子负载,是一款高功率因数、高精度、可编程的IGBT式工频隔离交流电子负载。负载采用AC-DC、DC-AC两级变换架构,动态响应速度快、输入电压适应范围宽,可将输入的交流能量全功率段回馈至电网。广泛应用于交流充电桩、大功率交流电源、交流电源系统等性能测试,也可用于试验站双馈交流电源系统。 系统采用具有中间直流环节的AC-DC、DC-AC变换两级架构,输入输出完全隔离,使用安全可靠。',
+    'specs': [
+      {'name': '应用领域', 'info': '电子负载;交流精密'},
+      {'name': '价格', 'info': '面议'},
+      {'name': '先进程度', 'info': '国内领先'},
+      {'name': '有效期', 'info': '2022-03-31'},
+      {
+        'name': '技术参数',
+        'info':
+            '尺寸:W1200*D1100*H2200/W1400*D1100*H2200(两种单柜尺寸) 回馈电压:三相AC380±10% 、50Hz±5 额定功率:50kW、100kW、150kW、200kW、250kW、400kW、500kW、600kW可选、可定制 输入电压:24~800VDC、50~1000VDC、100~2000VDC可选、可定制 输入电流:200A、250A、333A、500A、 600A、800A、1000A可选、可定制 控制精度: 电压、电流精度0.1%FS 冷却方式:强制冷风 海拔高度:≤2000m 通讯方式:RS485/CAN/LAN 工作温度:-20℃~+50℃ 存储温度:-40℃~+70℃ 相对湿度:10%~90% 防护等级:IP21(室内)'
+      },
+    ]
+  };
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        brightness: Brightness.light,
+        iconTheme: IconTheme.of(context).copyWith(color: Colors.black),
+        backgroundColor: Colors.white,
+        elevation: 0,
+        title: appbarTitle('详情'),
+        actions: [
+          IconButton(
+            icon: Icon(Icons.share),
+            onPressed: () {},
+          )
+        ],
+      ),
+      body: SingleChildScrollView(
+        child: Column(
+          children: <Widget>[
+            CachedNetworkImage(
+              imageUrl: data['pic'],
+            ),
+            Container(
+              alignment: Alignment.centerLeft,
+              margin: EdgeInsets.only(left: 16, top: 15, right: 16),
+              child: Text(
+                data['title'],
+                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: COLOR_TEXT_1),
+              ),
+            ),
+            Container(
+              alignment: Alignment.centerLeft,
+              margin: EdgeInsets.only(left: 16, top: 15, right: 16),
+              child: Text(
+                '发布时间:${data['time']}',
+                style: TextStyle(fontSize: 13, color: COLOR_TEXT_2),
+              ),
+            ),
+            Container(
+              alignment: Alignment.centerLeft,
+              margin: EdgeInsets.only(left: 16, top: 15, right: 16),
+              child: Text(
+                data['intro'],
+                style: TextStyle(fontSize: 14, color: COLOR_TEXT_1, height: 1.8),
+              ),
+            ),
+            Container(
+              width: double.infinity,
+              margin: EdgeInsets.symmetric(horizontal: 16),
+              padding: EdgeInsets.only(bottom: 40),
+              child: Column(
+                children: data['specs']
+                    .map<Widget>((i) => Container(
+                          margin: EdgeInsets.only(top: 20),
+                          child: Row(
+                            crossAxisAlignment: CrossAxisAlignment.start,
+                            children: [
+                              Container(
+                                width: 82,
+                                child: Text(i['name'], style: TextStyle(fontSize: 13, color: COLOR_TEXT_1)),
+                              ),
+                              Expanded(
+                                child: Text(
+                                  i['info'],
+                                  style: TextStyle(fontSize: 13, color: COLOR_TEXT_1, fontWeight: FontWeight.bold),
+                                ),
+                              )
+                            ],
+                          ),
+                        ))
+                    .toList(),
+              ),
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 132 - 0
lib/view/product_list.dart

@@ -0,0 +1,132 @@
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:flutter/material.dart';
+import 'package:jmrh/constant/styles.dart';
+
+class ProductList extends StatefulWidget {
+  ProductList({Key key}) : super(key: key);
+
+  @override
+  _ProductListState createState() => _ProductListState();
+}
+
+class _ProductListState extends State<ProductList> with SingleTickerProviderStateMixin {
+  TabController _tabController;
+  List<String> _tabs = ['全部', '智能', '能源', '兵器', '电子', '海洋', '生物', '工业'];
+
+  @override
+  void initState() {
+    super.initState();
+    _tabController = TabController(initialIndex: 0, vsync: this, length: _tabs.length);
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+    _tabController.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      body: CustomScrollView(
+        slivers: [
+          SliverAppBar(
+            pinned: true,
+            backgroundColor: Colors.white,
+            iconTheme: IconTheme.of(context).copyWith(color: Colors.black),
+            brightness: Brightness.light,
+            title: appbarTitle('产品展示'),
+            elevation: 0,
+            bottom: PreferredSize(
+              preferredSize: Size.fromHeight(86),
+              child: Container(
+                width: double.infinity,
+                child: Column(
+                  children: [
+                    Container(
+                      height: 44,
+                      padding: EdgeInsets.symmetric(vertical: 10),
+                      child: TabBar(
+                        controller: _tabController,
+                        isScrollable: true,
+                        indicatorSize: TabBarIndicatorSize.label,
+                        indicatorColor: Color(0xFFEA2D2F),
+                        labelColor: COLOR_PRIMARY,
+                        unselectedLabelColor: Color(0xFF939599),
+                        labelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 13),
+                        unselectedLabelStyle: TextStyle(fontWeight: FontWeight.normal, fontSize: 13),
+                        tabs: _tabs.map<Widget>((e) => Tab(text: e)).toList(),
+                      ),
+                    ),
+                    InkWell(
+                      child: Container(
+                        height: 32,
+                        margin: EdgeInsets.only(left: 16, right: 16, bottom: 10),
+                        decoration:
+                            BoxDecoration(color: COLOR_INPUT_BG, borderRadius: BorderRadius.all(Radius.circular(2))),
+                        padding: EdgeInsets.symmetric(horizontal: 10),
+                        child: Row(
+                          children: [
+                            Image.asset('img/icon_search.png'),
+                            Container(
+                              margin: EdgeInsets.only(left: 6),
+                              child: Text(
+                                '搜索...',
+                                style: TextStyle(color: COLOR_TEXT_3, fontSize: 12),
+                              ),
+                            )
+                          ],
+                        ),
+                      ),
+                      onTap: () {
+                        Navigator.of(context).pushNamed('/search');
+                      },
+                    )
+                  ],
+                ),
+              ),
+            ),
+          ),
+          SliverList(
+            delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
+              return _item();
+            }, childCount: 10),
+          )
+        ],
+      ),
+    );
+  }
+
+  Widget _item() {
+    return InkWell(
+      child: Container(
+        padding: EdgeInsets.symmetric(horizontal: 16, vertical: 15),
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            AspectRatio(
+              aspectRatio: 1.8,
+              child: CachedNetworkImage(
+                fit: BoxFit.cover,
+                imageUrl:
+                    'https://pics4.baidu.com/feed/a044ad345982b2b7b4c4ae3d8b4464e974099be4.jpeg?token=91e6d6e69e51bd9ac35c0f1137aeea2c',
+              ),
+            ),
+            Container(
+              margin: EdgeInsets.only(top: 12),
+              child: Text(
+                '消防无人机系统',
+                maxLines: 2,
+                style: TextStyle(fontSize: 15, color: COLOR_TEXT_1),
+                overflow: TextOverflow.ellipsis,
+              ),
+            ),
+          ],
+        ),
+      ),
+      onTap: () {
+        Navigator.of(context).pushNamed('/productDetail');
+      },
+    );
+  }
+}

+ 265 - 0
lib/view/qa_detail.dart

@@ -0,0 +1,265 @@
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:flutter/material.dart';
+import 'package:jmrh/constant/styles.dart';
+
+class QaDetail extends StatefulWidget {
+  QaDetail({Key key}) : super(key: key);
+
+  @override
+  _QaDetailState createState() => _QaDetailState();
+}
+
+class _QaDetailState extends State<QaDetail> {
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        backgroundColor: Colors.white,
+        brightness: Brightness.light,
+        iconTheme: IconTheme.of(context).copyWith(color: Colors.black),
+        title: appbarTitle('问答详情'),
+        elevation: 0,
+      ),
+      body: CustomScrollView(
+        slivers: [
+          SliverToBoxAdapter(
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.stretch,
+              children: [
+                Container(
+                  padding: EdgeInsets.all(16),
+                  child: Row(
+                    children: [
+                      ClipOval(
+                        child: CachedNetworkImage(
+                          imageUrl: 'https://zhumj.oss-cn-hangzhou.aliyuncs.com/image/user.jpg',
+                          width: 26,
+                          height: 26,
+                        ),
+                      ),
+                      Expanded(
+                        child: Container(
+                          padding: EdgeInsets.symmetric(horizontal: 10),
+                          child: Text(
+                            '夏秋雨',
+                            style: TextStyle(fontSize: 14, color: Colors.black),
+                            overflow: TextOverflow.ellipsis,
+                          ),
+                        ),
+                      ),
+                      Text(
+                        '05-23',
+                        style: TextStyle(color: COLOR_TEXT_2, fontSize: 13),
+                      )
+                    ],
+                  ),
+                ),
+                Container(
+                  padding: EdgeInsets.symmetric(horizontal: 16),
+                  child: RichText(
+                    text: TextSpan(children: [
+                      WidgetSpan(
+                        alignment: PlaceholderAlignment.baseline,
+                        baseline: TextBaseline.alphabetic,
+                        child: Container(
+                          decoration: BoxDecoration(
+                            color: COLOR_PRIMARY,
+                            borderRadius: BorderRadius.all(Radius.circular(2)),
+                          ),
+                          padding: EdgeInsets.symmetric(horizontal: 4, vertical: 1),
+                          margin: EdgeInsets.only(right: 4),
+                          child: Text(
+                            '热议',
+                            style: TextStyle(color: Colors.white, fontSize: 11, height: 1.8),
+                          ),
+                        ),
+                      ),
+                      TextSpan(
+                          text: '自来水总是有一股消毒水味道,政府加大水质监管措施的几点建议',
+                          style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold, height: 1.8))
+                    ]),
+                  ),
+                ),
+                Container(
+                  height: 51,
+                  decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 5, color: COLOR_BORDER))),
+                  child: Row(
+                    children: [
+                      Expanded(
+                        child: Row(children: [
+                          Image.asset('img/icon_redu.png'),
+                          Container(
+                            margin: EdgeInsets.only(left: 4),
+                            child: Text(
+                              '123',
+                              style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
+                            ),
+                          )
+                        ], mainAxisAlignment: MainAxisAlignment.center),
+                      ),
+                      Expanded(
+                        child: Row(children: [
+                          Image.asset('img/icon_pingjia.png'),
+                          Container(
+                            margin: EdgeInsets.only(left: 4),
+                            child: Text(
+                              '123',
+                              style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
+                            ),
+                          )
+                        ], mainAxisAlignment: MainAxisAlignment.center),
+                      ),
+                      Expanded(
+                        child: Row(children: [
+                          Image.asset('img/icon_dianzhan.png'),
+                          Container(
+                            margin: EdgeInsets.only(left: 4),
+                            child: Text(
+                              '123',
+                              style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
+                            ),
+                          )
+                        ], mainAxisAlignment: MainAxisAlignment.center),
+                      )
+                    ],
+                  ),
+                ),
+              ],
+            ),
+          ),
+          SliverToBoxAdapter(
+            child: Container(
+              margin: EdgeInsets.only(left: 16, top: 16, bottom: 10),
+              child: Text(
+                '评论56',
+                style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
+              ),
+            ),
+          ),
+          SliverList(
+            delegate: SliverChildBuilderDelegate((BuildContext context, int index) => _item(), childCount: 10),
+          )
+        ],
+      ),
+      bottomNavigationBar: SafeArea(
+        child: Container(
+          height: 50,
+          padding: EdgeInsets.symmetric(horizontal: 16, vertical: 7),
+          child: Container(
+            height: 36,
+            alignment: Alignment.centerLeft,
+            padding: EdgeInsets.symmetric(horizontal: 15),
+            decoration: BoxDecoration(
+              color: COLOR_INPUT_BG,
+              borderRadius: BorderRadius.all(
+                Radius.circular(2),
+              ),
+            ),
+            child: TextField(
+              style: TextStyle(fontSize: 14),
+              decoration: InputDecoration.collapsed(
+                  hintText: '发表您的观点…',
+                  hintStyle: TextStyle(
+                    fontSize: 13,
+                    color: COLOR_TEXT_3,
+                  )),
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+
+  Widget _item() {
+    return Container(
+      padding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        children: [
+          ClipOval(
+            child: CachedNetworkImage(
+              width: 28,
+              height: 28,
+              imageUrl: 'https://zhumj.oss-cn-hangzhou.aliyuncs.com/image/user.jpg',
+            ),
+          ),
+          Expanded(
+            child: Container(
+              margin: EdgeInsets.only(left: 6),
+              child: Column(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  Text(
+                    '唐丛茸',
+                    style: TextStyle(color: COLOR_USERNAME, fontSize: 13, fontWeight: FontWeight.bold),
+                  ),
+                  Container(
+                    margin: EdgeInsets.only(top: 4),
+                    child: Text(
+                      '评论内容评论内容,评论内容评论内容评论,内容评论内容评论内容评论内容',
+                      style: TextStyle(color: COLOR_TEXT_1, fontSize: 14),
+                    ),
+                  ),
+                  Container(
+                    margin: EdgeInsets.only(top: 4),
+                    child: Row(
+                      children: [
+                        Text(
+                          '15分钟前',
+                          style: TextStyle(fontSize: 12, color: COLOR_TEXT_2),
+                        ),
+                        Container(
+                          margin: EdgeInsets.only(left: 15),
+                          child: Text(
+                            '回复Ta',
+                            style: TextStyle(fontSize: 12, color: COLOR_TEXT_2),
+                          ),
+                        )
+                      ],
+                    ),
+                  ),
+                  Container(
+                    width: double.infinity,
+                    margin: EdgeInsets.only(top: 10),
+                    decoration: BoxDecoration(
+                      color: COLOR_BORDER,
+                      borderRadius: BorderRadius.all(
+                        Radius.circular(2),
+                      ),
+                    ),
+                    padding: EdgeInsets.symmetric(horizontal: 8, vertical: 10),
+                    child: Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      children: [
+                        RichText(
+                          text: TextSpan(children: [
+                            TextSpan(text: '夏秋雨', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
+                            TextSpan(text: ':评论内容评论内容评论内容评论内容', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
+                          ]),
+                        ),
+                        RichText(
+                          text: TextSpan(children: [
+                            TextSpan(text: '唐丛茸', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
+                            TextSpan(text: ' 回复 ', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
+                            TextSpan(text: '夏秋雨', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
+                            TextSpan(
+                                text: ':评论内容评论内容评论内容评论内容评论内容', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
+                          ]),
+                        ),
+                        RichText(
+                          text: TextSpan(children: [
+                            TextSpan(text: '查看全部5条回复', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
+                          ]),
+                        ),
+                      ],
+                    ),
+                  )
+                ],
+              ),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}

+ 112 - 0
lib/view/search.dart

@@ -0,0 +1,112 @@
+import 'package:flutter/material.dart';
+import 'package:jmrh/constant/styles.dart';
+
+class Search extends StatefulWidget {
+  Search({Key key}) : super(key: key);
+
+  @override
+  _SearchState createState() => _SearchState();
+}
+
+class _SearchState extends State<Search> {
+  TextEditingController _controller;
+
+  @override
+  void initState() {
+    super.initState();
+    _controller = TextEditingController();
+  }
+
+  @override
+  void dispose() {
+    _controller.dispose();
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      body: CustomScrollView(
+        slivers: [
+          SliverAppBar(
+            brightness: Brightness.light,
+            pinned: true,
+            backgroundColor: Colors.white,
+            iconTheme: IconTheme.of(context).copyWith(color: Colors.black),
+            title: appbarTitle('搜索'),
+            leading: IconButton(
+              icon: ImageIcon(
+                AssetImage('img/nav_icon_return.png'),
+                size: 28,
+              ),
+              onPressed: () {
+                Navigator.pop(context);
+              },
+            ),
+            bottom: PreferredSize(
+                child: Row(
+                  children: [
+                    Expanded(
+                      child: Container(
+                        height: 36,
+                        decoration: BoxDecoration(
+                            color: COLOR_INPUT_BG,
+                            borderRadius: BorderRadius.all(Radius.circular(2))),
+                        margin: EdgeInsets.only(left: 16),
+                        padding: EdgeInsets.symmetric(horizontal: 10),
+                        child: Row(
+                          children: [
+                            Image.asset('img/icon_search.png'),
+                            Expanded(
+                              child: Container(
+                                  margin: EdgeInsets.only(left: 10, right: 10),
+                                  child: TextField(
+                                    controller: _controller,
+                                    decoration: InputDecoration.collapsed(
+                                      hintText: '搜索...',
+                                    ),
+                                    onSubmitted: (String value) async {
+                                      await showDialog<void>(
+                                        context: context,
+                                        builder: (BuildContext context) {
+                                          return AlertDialog(
+                                            title: const Text('Thanks!'),
+                                            content:
+                                                Text('You typed "$value".'),
+                                            actions: <Widget>[
+                                              FlatButton(
+                                                onPressed: () {
+                                                  Navigator.pop(context);
+                                                },
+                                                child: const Text('OK'),
+                                              ),
+                                            ],
+                                          );
+                                        },
+                                      );
+                                    },
+                                  )),
+                            ),
+                          ],
+                        ),
+                      ),
+                    ),
+                    Container(
+                      width: 60,
+                      child: FlatButton(
+                        child: Text(
+                          '搜索',
+                          style: TextStyle(color: COLOR_PRIMARY, fontSize: 14),
+                        ),
+                        onPressed: () {},
+                      ),
+                    )
+                  ],
+                ),
+                preferredSize: Size.fromHeight(36)),
+          )
+        ],
+      ),
+    );
+  }
+}

File diff suppressed because it is too large
+ 0 - 8
mockdata/news.json


Some files were not shown because too many files changed in this diff