x 4 年之前
父节点
当前提交
b6e27b8f96
共有 100 个文件被更改,包括 2520 次插入298 次删除
  1. 0 0
      assets/area.json
  2. 0 0
      assets/config/area.json
  3. 二进制
      assets/fonts/iconfont.ttf
  4. 3 0
      build.py
  5. 1 1
      ios/Podfile
  6. 11 10
      ios/Podfile.lock
  7. 26 6
      ios/Runner.xcodeproj/project.pbxproj
  8. 12 8
      ios/Runner/Base.lproj/LaunchScreen.storyboard
  9. 8 5
      ios/Runner/Base.lproj/Main.storyboard
  10. 67 16
      ios/Runner/Info.plist
  11. 10 0
      ios/Runner/Runner.entitlements
  12. 6 0
      jsons/cashRecord.json
  13. 1 1
      jsons/computeData.json
  14. 4 0
      jsons/express.json
  15. 5 0
      jsons/expressInfo.json
  16. 16 0
      jsons/expressOrder.json
  17. 5 0
      jsons/expressResult.json
  18. 10 0
      jsons/message.json
  19. 3 2
      jsons/orderData.json
  20. 56 0
      jsons/orderDetails.json
  21. 1 1
      jsons/orderInfo.json
  22. 5 5
      jsons/orderStatus.json
  23. 6 0
      jsons/promoteRecord.json
  24. 4 0
      jsons/promoteRecordList.json
  25. 8 0
      jsons/promotionOrder.json
  26. 4 0
      jsons/promotionOrderData.json
  27. 5 0
      jsons/promotionOrderList.json
  28. 9 0
      jsons/promotionPeople.json
  29. 5 0
      jsons/promotionPeopleData.json
  30. 5 0
      jsons/rechargeData.json
  31. 5 0
      jsons/rechargeIndex.json
  32. 1 1
      jsons/user.json
  33. 1 1
      jsons/userInfo.json
  34. 9 0
      jsons/vipConfig.json
  35. 7 0
      jsons/vipInfo.json
  36. 50 4
      lib/api/index.dart
  37. 29 8
      lib/api/order.dart
  38. 124 10
      lib/api/user.dart
  39. 17 6
      lib/config/pay_config.dart
  40. 10 1
      lib/config/protocols.dart
  41. 48 0
      lib/config/setting.dart
  42. 24 0
      lib/config/style.dart
  43. 14 15
      lib/main.dart
  44. 1 1
      lib/models/cartInfo.g.dart
  45. 16 0
      lib/models/cashRecord.dart
  46. 23 0
      lib/models/cashRecord.g.dart
  47. 1 1
      lib/models/computeData.dart
  48. 2 2
      lib/models/computeData.g.dart
  49. 15 0
      lib/models/express.dart
  50. 20 0
      lib/models/express.g.dart
  51. 15 0
      lib/models/expressInfo.dart
  52. 23 0
      lib/models/expressInfo.g.dart
  53. 16 0
      lib/models/expressOrder.dart
  54. 23 0
      lib/models/expressOrder.g.dart
  55. 15 0
      lib/models/expressResult.dart
  56. 21 0
      lib/models/expressResult.g.dart
  57. 20 0
      lib/models/index.dart
  58. 20 0
      lib/models/message.dart
  59. 30 0
      lib/models/message.g.dart
  60. 38 0
      lib/models/orderData.dart
  61. 69 0
      lib/models/orderData.g.dart
  62. 66 0
      lib/models/orderDetails.dart
  63. 126 0
      lib/models/orderDetails.g.dart
  64. 2 2
      lib/models/orderInfo.dart
  65. 1 3
      lib/models/orderInfo.g.dart
  66. 17 0
      lib/models/orderStatus.dart
  67. 25 0
      lib/models/orderStatus.g.dart
  68. 16 0
      lib/models/promoteRecord.dart
  69. 23 0
      lib/models/promoteRecord.g.dart
  70. 14 0
      lib/models/promoteRecordList.dart
  71. 20 0
      lib/models/promoteRecordList.g.dart
  72. 18 0
      lib/models/promotionOrder.dart
  73. 27 0
      lib/models/promotionOrder.g.dart
  74. 14 0
      lib/models/promotionOrderData.dart
  75. 20 0
      lib/models/promotionOrderData.g.dart
  76. 15 0
      lib/models/promotionOrderList.dart
  77. 25 0
      lib/models/promotionOrderList.g.dart
  78. 19 0
      lib/models/promotionPeople.dart
  79. 29 0
      lib/models/promotionPeople.g.dart
  80. 15 0
      lib/models/promotionPeopleData.dart
  81. 26 0
      lib/models/promotionPeopleData.g.dart
  82. 15 0
      lib/models/rechargeData.dart
  83. 21 0
      lib/models/rechargeData.g.dart
  84. 15 0
      lib/models/rechargeIndex.dart
  85. 24 0
      lib/models/rechargeIndex.g.dart
  86. 1 1
      lib/models/user.dart
  87. 1 1
      lib/models/user.g.dart
  88. 1 1
      lib/models/userInfo.dart
  89. 1 1
      lib/models/userInfo.g.dart
  90. 19 0
      lib/models/vipConfig.dart
  91. 28 0
      lib/models/vipConfig.g.dart
  92. 17 0
      lib/models/vipInfo.dart
  93. 24 0
      lib/models/vipInfo.g.dart
  94. 271 0
      lib/pages/address/address_edit.dart
  95. 116 0
      lib/pages/address/address_list.dart
  96. 0 81
      lib/pages/address/editAddress.dart
  97. 343 98
      lib/pages/login/login.dart
  98. 3 4
      lib/pages/login/protocol.dart
  99. 0 1
      lib/pages/login/register.dart
  100. 99 0
      lib/pages/order/order_comment.dart

文件差异内容过多而无法显示
+ 0 - 0
assets/area.json


文件差异内容过多而无法显示
+ 0 - 0
assets/config/area.json


二进制
assets/fonts/iconfont.ttf


+ 3 - 0
build.py

@@ -17,14 +17,17 @@ if __name__ == "__main__":
     if len(args) > 1:
         if args[1] == "gen":
             gen_models()
+            exit()
         if args[1] == "splash":
             gen_splash()
+            exit()
         elif args[1] == "help":
             print("用法:\n\
         gen\t\t-- 生成 json models\n\
         splash\t\t-- 生成 splash files\n\
         help\t\t-- 显示帮助文档\n\
                 ")
+            exit()
         else:
             print("参数错误 请使用 help 检查可用的参数列表")
     else:

+ 1 - 1
ios/Podfile

@@ -1,6 +1,6 @@
 # Uncomment this line to define a global platform for your project
 # platform :ios, '9.0'
-
+platform :ios, '9.0'
 # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
 ENV['COCOAPODS_DISABLE_STATS'] = 'true'
 

+ 11 - 10
ios/Podfile.lock

@@ -11,6 +11,9 @@ PODS:
     - Flutter
   - flutter_local_notifications (0.0.1):
     - Flutter
+  - fluwx (0.0.1):
+    - Flutter
+    - WechatOpenSDK (= 1.8.7.1)
   - FMDB (2.7.5):
     - FMDB/standard (= 2.7.5)
   - FMDB/standard (2.7.5)
@@ -33,11 +36,7 @@ PODS:
     - Flutter
   - webview_flutter (0.0.1):
     - Flutter
-  - wechat_kit (1.1.2):
-    - Flutter
-    - wechat_kit/vendor (= 1.1.2)
-  - wechat_kit/vendor (1.1.2):
-    - Flutter
+  - WechatOpenSDK (1.8.7.1)
 
 DEPENDENCIES:
   - alipay_kit (from `.symlinks/plugins/alipay_kit/ios`)
@@ -45,6 +44,7 @@ DEPENDENCIES:
   - Flutter (from `Flutter`)
   - flutter_app_upgrade (from `.symlinks/plugins/flutter_app_upgrade/ios`)
   - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
+  - fluwx (from `.symlinks/plugins/fluwx/ios`)
   - image_picker (from `.symlinks/plugins/image_picker/ios`)
   - package_info (from `.symlinks/plugins/package_info/ios`)
   - path_provider (from `.symlinks/plugins/path_provider/ios`)
@@ -54,11 +54,11 @@ DEPENDENCIES:
   - video_player (from `.symlinks/plugins/video_player/ios`)
   - wakelock (from `.symlinks/plugins/wakelock/ios`)
   - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
-  - wechat_kit (from `.symlinks/plugins/wechat_kit/ios`)
 
 SPEC REPOS:
   trunk:
     - FMDB
+    - WechatOpenSDK
 
 EXTERNAL SOURCES:
   alipay_kit:
@@ -71,6 +71,8 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/flutter_app_upgrade/ios"
   flutter_local_notifications:
     :path: ".symlinks/plugins/flutter_local_notifications/ios"
+  fluwx:
+    :path: ".symlinks/plugins/fluwx/ios"
   image_picker:
     :path: ".symlinks/plugins/image_picker/ios"
   package_info:
@@ -89,8 +91,6 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/wakelock/ios"
   webview_flutter:
     :path: ".symlinks/plugins/webview_flutter/ios"
-  wechat_kit:
-    :path: ".symlinks/plugins/wechat_kit/ios"
 
 SPEC CHECKSUMS:
   alipay_kit: 7ab9452e6db0ddfa567b4a0767ad9791f9b5242b
@@ -98,6 +98,7 @@ SPEC CHECKSUMS:
   Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
   flutter_app_upgrade: a62fbe2a09a2176a7b44211c8355adfcfb969779
   flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
+  fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
   FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
   image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
   package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
@@ -108,8 +109,8 @@ SPEC CHECKSUMS:
   video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
   wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
   webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
-  wechat_kit: 07eb4f9d9b1da6a95696b1904084a9031cacd78d
+  WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
 
-PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
+PODFILE CHECKSUM: c986e11b2ab3ede0a6249842c2bc996c90212ba2
 
 COCOAPODS: 1.10.0

+ 26 - 6
ios/Runner.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 46;
+	objectVersion = 51;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -32,6 +32,7 @@
 /* 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>"; };
+		1755DAFD258973CA00104BBA /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
 		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>"; };
@@ -102,6 +103,7 @@
 		97C146F01CF9000F007C117D /* Runner */ = {
 			isa = PBXGroup;
 			children = (
+				1755DAFD258973CA00104BBA /* Runner.entitlements */,
 				97C146FA1CF9000F007C117D /* Main.storyboard */,
 				97C146FD1CF9000F007C117D /* Assets.xcassets */,
 				97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -121,7 +123,6 @@
 				D3DAFAF304182BE53852A8D4 /* Pods-Runner.release.xcconfig */,
 				DD36FD1ABF42B05CA65F9F70 /* Pods-Runner.profile.xcconfig */,
 			);
-			name = Pods;
 			path = Pods;
 			sourceTree = "<group>";
 		};
@@ -355,14 +356,20 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
+				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				DEVELOPMENT_TEAM = D5DGD222ZA;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
@@ -475,7 +482,8 @@
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				SUPPORTED_PLATFORMS = iphoneos;
-				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+				SWIFT_COMPILATION_MODE = wholemodule;
+				SWIFT_OPTIMIZATION_LEVEL = "-O";
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 			};
@@ -487,14 +495,20 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
+				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				DEVELOPMENT_TEAM = D5DGD222ZA;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
@@ -514,14 +528,20 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
+				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				DEVELOPMENT_TEAM = D5DGD222ZA;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",

+ 12 - 8
ios/Runner/Base.lproj/LaunchScreen.storyboard

@@ -1,8 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
         <!--View Controller-->
@@ -14,12 +16,14 @@
                         <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
                     </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
+                            <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" misplaced="YES" image="LaunchImage" highlighted="YES" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
+                                <rect key="frame" x="0.0" y="44" width="414" height="896"/>
                             </imageView>
                         </subviews>
-                        <color key="backgroundColor" red="1.0" green="1.0" blue="1.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
                             <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
@@ -28,10 +32,10 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="53" y="375"/>
+            <point key="canvasLocation" x="76.811594202898561" y="251.11607142857142"/>
         </scene>
     </scenes>
     <resources>
-        <image name="LaunchImage" width="720" height="1280"/>
+        <image name="LaunchImage" width="180" height="320"/>
     </resources>
-</document>
+</document>

+ 8 - 5
ios/Runner/Base.lproj/Main.storyboard

@@ -1,8 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+    <device id="retina6_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
         <!--Flutter View Controller-->
@@ -14,13 +16,14 @@
                         <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
                     </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
-                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                        <rect key="frame" x="0.0" y="0.0" width="428" height="926"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
+            <point key="canvasLocation" x="87" y="-22"/>
         </scene>
     </scenes>
 </document>

+ 67 - 16
ios/Runner/Info.plist

@@ -11,21 +11,86 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>twong</string>
+	<string>美天旺</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<string>$(FLUTTER_BUILD_NAME)</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>shotshock.shop</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>twong</string>
+			</array>
+		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>weixin</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>wx1bb4342986c22b28</string>
+			</array>
+		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>alipay</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>ali2021001196660263</string>
+			</array>
+		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>app</string>
+			</array>
+		</dict>
+	</array>
 	<key>CFBundleVersion</key>
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>alipay</string>
+		<string>weixin</string>
+		<string>weixinULAPI</string>
+	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+	<key>NSCameraUsageDescription</key>
+	<string>是否允许美天旺访问相机使用拍照获取图片</string>
+	<key>NSPhotoLibraryAddUsageDescription</key>
+	<string>是否允许美天旺把图片写入相册</string>
+	<key>NSPhotoLibraryUsageDescription</key>
+	<string>是否允许美天旺访问相册获取图片</string>
+	<key>UIBackgroundModes</key>
+	<array>
+		<string>processing</string>
+		<string>remote-notification</string>
+	</array>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>
 	<key>UIMainStoryboardFile</key>
 	<string>Main</string>
+	<key>UIStatusBarHidden</key>
+	<true/>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
@@ -41,19 +106,5 @@
 	</array>
 	<key>UIViewControllerBasedStatusBarAppearance</key>
 	<false/>
-	<key>LSApplicationQueriesSchemes</key>
-    <array>
-    	<string>alipay</string>
-    	<string>weixin</string>
-    	<string>weixinULAPI</string>
-    </array>
-    <key>NSAppTransportSecurity</key>
-    <dict>
-        <key>NSAllowsArbitraryLoads</key>
-        <true/>
-    </dict>
-	<key>UIStatusBarHidden</key>
-	<true/>
-
 </dict>
-</plist>
+</plist>

+ 10 - 0
ios/Runner/Runner.entitlements

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.developer.associated-domains</key>
+	<array>
+		<string>https://shotshock.shop</string>
+	</array>
+</dict>
+</plist>

+ 6 - 0
jsons/cashRecord.json

@@ -0,0 +1,6 @@
+{
+  "add_time":"2020-11-19 04:20",
+  "title":"余额提现",
+  "number":"100.00",
+  "pm": 0
+}

+ 1 - 1
jsons/computeData.json

@@ -1,7 +1,7 @@
 {
   "total_price": "222.00",
   "pay_price": 222,
-  "pay_postage": "0.00",
+  "pay_postage": 0,
   "coupon_price": 0,
   "deduction_price": 0,
   "SurplusIntegral": 0

+ 4 - 0
jsons/express.json

@@ -0,0 +1,4 @@
+{
+  "order": "$expressOrder",
+  "express": "$expressInfo"
+}

+ 5 - 0
jsons/expressInfo.json

@@ -0,0 +1,5 @@
+{
+  "status": "201",
+  "msg": "快递单号错误",
+  "result": "$expressResult"
+}

+ 16 - 0
jsons/expressOrder.json

@@ -0,0 +1,16 @@
+{
+  "delivery_id": "ss",
+  "delivery_name": "圆通速递",
+  "delivery_type": "express",
+  "cartInfo": [
+    {
+      "cart_num": 1,
+      "truePrice": "0.01",
+      "productInfo": {
+        "image": "http://kaifa.crmeb.net/uploads/attach/2019/08/13/5653627e73313cf61c9620725c45a376.jpg",
+        "store_name": "尔给polo衫短袖日系运动休闲套装女2020年夏宽松韩版学生两件套",
+        "unit_name": "套"
+      }
+    }
+  ]
+}

+ 5 - 0
jsons/expressResult.json

@@ -0,0 +1,5 @@
+{
+  "number": "SS",
+  "type": "AUTO",
+  "list": []
+}

+ 10 - 0
jsons/message.json

@@ -0,0 +1,10 @@
+{
+  "id":5,
+  "sender":"美天旺客服",
+  "subject":"回复>测试标题",
+  "desc":"回复您的反馈,标题:测试标题",
+  "body":"<div>行</div>",
+  "add_time":1603406363,
+  "expire_at":0,
+  "read":1
+}

+ 3 - 2
jsons/orderData.json

@@ -1,4 +1,5 @@
 {
+  "@import":"orderStatus.dart",
   "add_time":1606550984,
   "seckill_id":0,
   "bargain_id":0,
@@ -17,11 +18,11 @@
   "coupon_price":"0.00",
   "deduction_price":"0.40",
   "pink_id":0,
-  "delivery_type":null,
+  "@JsonKey(name: 'delivery_type') dynamic": "delivery_type",
   "is_del":0,
   "shipping_type":1,
   "cartInfo":"$[]cartInfo",
-  "_status": "$orderStatus",
+  "@JsonKey(name: '_status') OrderStatus": "orderStatus",
   "_pay_time":"2020-11-28 16:09:44",
   "_add_time":"2020-11-28 16:09:44",
   "status_pic":"",

+ 56 - 0
jsons/orderDetails.json

@@ -0,0 +1,56 @@
+{
+  "@import":"orderStatus.dart",
+  "id":54,
+  "order_id":"wx160663693704869106",
+  "uid":2,
+  "real_name":"xx",
+  "user_phone":"13111111111",
+  "user_address":"福建省 龙岩市 上杭县 xxx",
+  "cart_id":[84],
+  "freight_price":"0.00",
+  "total_num":1,
+  "total_price":"499.00",
+  "total_postage":"0.00",
+  "pay_price":"499.00",
+  "pay_postage":"0.00",
+  "deduction_price":"0.00",
+  "coupon_id":0,
+  "coupon_price":"0.00",
+  "paid":0,
+  "pay_time": 0,
+  "pay_type":"yue",
+  "add_time":1606636937,
+  "status":0,
+  "refund_status":0,
+  "refund_price":"0.00",
+  "gain_integral":"60.00",
+  "use_integral":"0.00",
+  "back_integral": 0,
+  "mark":"",
+  "is_del":0,
+  "unique":"a58fea9d2cde8ec1eb35bda2a2cdc963",
+  "mer_id":0,
+  "is_mer_check":0,
+  "combination_id":0,
+  "pink_id":0,
+  "cost":"125.00",
+  "seckill_id":0,
+  "bargain_id":0,
+  "verify_code":"",
+  "store_id":0,
+  "shipping_type":1,
+  "clerk_id":0,
+  "is_channel":2,
+  "is_remind":0,
+  "is_system_del":0,
+  "is_rebate":0,
+  "add_time_y":"2020-11-29",
+  "add_time_h":"16:02:17",
+  "mapKey":"",
+  "cartInfo":"$[]cartInfo",
+  "@JsonKey(name: '_status') OrderStatus": "orderStatus",
+  "@JsonKey(name: '_pay_time') String": "payTime",
+  "@JsonKey(name: '_add_time') String": "addTime",
+  "status_pic":"http://twongstatic.shotshock.shop/order_9.gif",
+  "offlinePayStatus":2
+}

+ 1 - 1
jsons/orderInfo.json

@@ -1,4 +1,4 @@
 {
-  "result": "$orderConfig",
+  "@JsonKey(name: 'result') dynamic": "result",
   "status": ""
 }

+ 5 - 5
jsons/orderStatus.json

@@ -1,7 +1,7 @@
 {
-  "_type":0,
-  "_title":"未支付",
-  "_msg":"请在11-28 16:15:44前完成支付!",
-  "_class":"nobuy",
-  "_payType":"微信支付"
+  "@JsonKey(name: '_type') num": "type",
+  "@JsonKey(name: '_title') String": "title",
+  "@JsonKey(name: '_msg') String": "msg",
+  "@JsonKey(name: '_class') String": "className",
+  "@JsonKey(name: '_payType') String": "payType"
 }

+ 6 - 0
jsons/promoteRecord.json

@@ -0,0 +1,6 @@
+{
+  "add_time": "2020-12-03 22:01",
+  "title": "订单",
+  "number": "18.00",
+  "pm": 1
+}

+ 4 - 0
jsons/promoteRecordList.json

@@ -0,0 +1,4 @@
+{
+  "time": "time",
+  "list": "$[]promoteRecord"
+}

+ 8 - 0
jsons/promotionOrder.json

@@ -0,0 +1,8 @@
+{
+  "avatar": "http://0ab5dba3.png",
+  "nickname": "a3e81f4c9759",
+  "number": "18.00",
+  "order_id": "wx160700407626365661",
+  "time": "2020-12-03 22:01",
+  "type": "brokerage"
+}

+ 4 - 0
jsons/promotionOrderData.json

@@ -0,0 +1,4 @@
+{
+  "count": 1,
+  "list": "$[]promotionOrderList"
+}

+ 5 - 0
jsons/promotionOrderList.json

@@ -0,0 +1,5 @@
+{
+  "child": "$[]promotionOrder",
+  "count": 7,
+  "time": "2020-12"
+}

+ 9 - 0
jsons/promotionPeople.json

@@ -0,0 +1,9 @@
+{
+  "avatar": "http://kaifa.crmeb.net/uploads/attach/2019/08/20190807/723adbdd4e49a0f9394dfc700ab5dba3.png",
+  "childCount": 0,
+  "nickname": "153",
+  "numberCount": 0,
+  "orderCount": 0,
+  "time": "2020/10/15",
+  "uid": 9
+}

+ 5 - 0
jsons/promotionPeopleData.json

@@ -0,0 +1,5 @@
+{
+  "list": "$[]promotionPeople",
+  "total": 3,
+  "totalLevel": 3
+}

+ 5 - 0
jsons/rechargeData.json

@@ -0,0 +1,5 @@
+{
+  "id": 177,
+  "give_money": "0.00",
+  "price": "20.00"
+}

+ 5 - 0
jsons/rechargeIndex.json

@@ -0,0 +1,5 @@
+{
+  "balance": "0.01",
+  "recharge_attention": ["1", "2"],
+  "recharge_quota": "$[]rechargeData"
+}

+ 1 - 1
jsons/user.json

@@ -26,7 +26,7 @@
   "vip_status": 0,
   "vip_card_level": 0,
   "vip_gift": 0,
-  "vip_time": null,
+  "vip_time": 0,
   "vip_card_id": null,
   "couponCount": 0,
   "like": 0,

+ 1 - 1
jsons/userInfo.json

@@ -26,7 +26,7 @@
   "vip_status":0,
   "vip_card_level":0,
   "vip_gift":0,
-  "vip_time":null,
+  "vip_time":0,
   "vip_card_id":null,
   "broken_commission":"0.00",
   "commissionCount":"0.00"

+ 9 - 0
jsons/vipConfig.json

@@ -0,0 +1,9 @@
+{
+  "name":"普通会员1",
+  "discount":100,
+  "image":"http://twong.h/uploads/attach/2020/10/20201015/46a961d9da7583c6bbaf6dba65be2bc6.png",
+  "icon":"http://datong.crmeb.net/public/uploads/attach/2019/03/28/5c9ccca8bc1e0.png",
+  "explain":"普通会员",
+  "id":1,
+  "grade":1
+}

+ 7 - 0
jsons/vipInfo.json

@@ -0,0 +1,7 @@
+{
+  "card_benefit": "1,拥有会员卡推广权限,两级返佣",
+  "money_available": 0,
+  "money_next": 0,
+  "card_product_id": "73",
+  "card_updater_id": "74"
+}

+ 50 - 4
lib/api/index.dart

@@ -2,6 +2,9 @@
 export 'user.dart';
 export 'order.dart';
 
+import 'package:provider/provider.dart';
+import 'package:twong/providers/home.dart';
+
 import '../utils/index.dart';
 import '../models/index.dart';
 
@@ -9,9 +12,11 @@ class Network {
   static Network _inst = new Network();
   static Network get inst => _inst;
   // get home page data
-  Future<Home> getIndex({dynamic data}) async {
+  Future getIndex() async {
     var resp = await Request.get('index');
-    return Home.fromJson(resp);
+    var data = Home.fromJson(resp);
+    Provider.of<HomeModel>(Cache.context, listen: false).update(data);
+    return data;
   }
   // user login
   Future<UserInfo> login({String account, String password, String code}) async {
@@ -21,14 +26,55 @@ class Network {
       "password": password,
     };
     var resp = await Request.post("login", params: params);
+    return _processToken(resp);
+  }
+  // auto login
+  Future<UserInfo> autoLogin() async {
+    if(Cache.account?.account != null && Cache.account?.password != null) {
+      Log.i("begin auto login...");
+      return login(account: Cache.account.account, password: Cache.account.password);
+    }
+    return null;
+  }
+  // request verify code
+  Future verify() async {
+    var resp = await Request.get("verify_code");
+    var key = resp["key"];
+    resp = await Request.post("register/verify");
+
+  }
+  // register account
+  Future<UserInfo> register(String account, String code, String password,
+      {String spread}) async
+  {
+    var params = {
+      "account": account,
+      "password": password,
+      "captcha": code,
+      "spread": spread
+    };
+    var resp = await Request.post("register", params: params);
+    return _processToken(resp);
+  }
+  // login with sms
+  Future smsLogin(String account, String code) async {
+    var params = {
+      "account": account,
+      "captcha": code,
+    };
+    var resp = await Request.post("login/mobile", params: params);
+    return _processToken(resp);
+  }
+  Future<UserInfo> _processToken(dynamic resp) async {
+    if(resp == null) return null;
+
     var token = Token.fromJson(resp);
     Cache.updateToken(token);
-    return await getUserInfo();
+    return getUserInfo();
   }
   // get user info
   Future<UserInfo> getUserInfo() async {
     var resp = await Request.get('userinfo');
-
     var info = UserInfo.fromJson(resp);
     Cache.updateUserInfo(info);
     return info;

+ 29 - 8
lib/api/order.dart

@@ -1,4 +1,7 @@
 
+import 'package:provider/provider.dart';
+import 'package:twong/providers/order_num.dart';
+
 import 'index.dart';
 import '../utils/index.dart';
 import '../models/index.dart';
@@ -10,8 +13,8 @@ extension OrderAPI on Network {
     return ConfirmInfo.fromJson(resp);
   }
   // compute order info
-  Future<ComputeInfo> computedOrder(String id, { int addressId, int couponId = 0,
-    int shopType = 1, String payType, double useIntegral }) async {
+  Future<ComputeInfo> computedOrder(String id, { num addressId, num couponId = 0,
+    int shopType = 1, String payType, num useIntegral }) async {
     var data = {
       "addressId": addressId,
       "couponId": couponId,
@@ -20,12 +23,9 @@ extension OrderAPI on Network {
       "useIntegral": useIntegral
     };
     var resp = await Request.post("order/computed/$id", params: data);
+    Log.d(resp);
     return ComputeInfo.fromJson(resp);
   }
-  // get order detail info
-  Future orderDetail() async {
-    var resp = await Request.post("order/detail/");
-  }
   // pay order from id
   Future<OrderInfo> payOrder({String payType, String orderId}) async {
     var data = {
@@ -34,6 +34,7 @@ extension OrderAPI on Network {
       "uni": orderId
     };
     var resp = await Request.post("order/pay", params: data);
+    Log.d(resp);
     return OrderInfo.fromJson(resp);
   }
   // create order
@@ -57,8 +58,28 @@ extension OrderAPI on Network {
     return OrderInfo.fromJson(resp);
   }
   
-  Future getOrderList({int page = 1, int limit=20, int type = 0}) async {
+  Future<List<OrderData>> getOrderList({int page = 1, int limit = 20, int type = 0}) async {
     var resp = await Request.get("order/list?page=$page&limit=$limit&type=$type");
-    
+    List<OrderData> orders = List<OrderData>();
+    for(var item in resp as List<dynamic>) {
+      orders.add(OrderData.fromJson(item));
+    }
+    return orders;
+  }
+  // get order detail info
+  Future<OrderDetails> getOrderDetails(String orderId) async {
+    var resp = await Request.get("order/detail/$orderId");
+    return OrderDetails.fromJson(resp);
+  }
+
+  Future<Express> getOrderExpress(String orderId) async {
+    var resp = await Request.get("order/express/$orderId");
+    return Express.fromJson(resp);
+  }
+
+  Future getOrderData() async {
+    var resp = await Request.get("order/data");
+    Provider.of<OrderNumModel>(Cache.context, listen: false).update(resp);
+    return resp;
   }
 }

+ 124 - 10
lib/api/user.dart

@@ -1,4 +1,7 @@
 
+import 'package:provider/provider.dart';
+import 'package:twong/providers/message.dart';
+
 import 'index.dart';
 import '../utils/index.dart';
 import '../models/index.dart';
@@ -9,16 +12,6 @@ extension UserAPI on Network {
     var resp = await Request.get('user/balance');
     return Balance.fromJson(resp);
   }
-  // get user address list
-  Future<List<Address>> getAddress() async {
-    var resp = await Request.get('address/list');
-    List<dynamic> list = resp as List<dynamic>;
-    List<Address> result = List<Address>();
-    for(var address in list) {
-      result.add(Address.fromJson(address));
-    }
-    return result;
-  }
   // get user cart list
   Future<CartList> getCartList() async {
     var resp = await Request.get("cart/list");
@@ -70,4 +63,125 @@ extension UserAPI on Network {
     }
     return list;
   }
+
+  Future<List<VipConfig>> getVipConfig() async {
+    var resp = await Request.get("user/level/grade");
+    var configs = List<VipConfig>();
+    for(var item in resp["list"] as List) {
+      configs.add(VipConfig.fromJson(item));
+    }
+    return configs;
+  }
+
+  Future<VipInfo> getVipInfo() async {
+    var resp = await Request.get("user/vip/info");
+    return VipInfo.fromJson(resp);
+  }
+
+  Future getCashRecord({int type = 4, int page = 1, int limit = 10}) async {
+    var resp = await Request.get("spread/commission/$type?page=$page&limit=$limit");
+
+  }
+
+  Future<List<Message>> getMessage() async {
+    var resp = await Request.get("user/mails");
+    List<Message> list = List<Message>();
+    for(var item in resp as List) {
+      list.add(Message.fromJson(item));
+    }
+
+    var context = Cache.navigator.currentState.overlay.context;
+    Provider.of<MessageModel>(context, listen: false).update(list);
+    return list;
+  }
+
+  Future<PromotionPeopleData> getPromotionPeople({int grade = 0,
+    String keyword = "", int limit = 15, int page = 1, String sort = "" }) async {
+    var params = {
+      "grade": grade,
+      "keyword": keyword,
+      "limit": limit,
+      "page": page,
+      "sort": sort
+    };
+    var resp = await Request.post("spread/people", params: params);
+    return PromotionPeopleData.fromJson(resp);
+  }
+
+  Future getPromotionCommission() async {
+    var resp = await Request.get("commission");
+    return resp;
+  }
+
+  Future<List<PromoteRecordList>> getPromotionRecord({int type, int page = 1, int limit = 3}) async {
+    var resp = await Request.get("spread/commission/$type?page=$page&limit=$limit");
+    var list = List<PromoteRecordList>();
+    for(var item in resp as List){
+      list.add(PromoteRecordList.fromJson(item));
+    }
+    return list;
+  }
+
+  Future<PromotionOrderData> getPromotionOrder({int page = 1, int limit = 15}) async {
+    var params = {
+      "page": page,
+      "limit": limit
+    };
+    var resp = await Request.post("spread/order", params: params);
+    return PromotionOrderData.fromJson(resp);
+  }
+  // get user address list
+  Future<List<Address>> getAddressList({int page = 1, int limit = 20}) async {
+    var resp = await Request.get("address/list?page=$page&limit=$limit");
+    List<Address> list = List<Address>();
+    for(var item in resp as List) {
+      list.add(Address.fromJson(item));
+    }
+    return list;
+  }
+
+  Future editAddress(Address address) async {
+    var params = {
+      "detail": address.detail,
+      "is_default": address.is_default,
+      "phone": address.phone,
+      "real_name": address.real_name,
+      "post_code": address.post_code,
+      "address": {
+        "province": address.province,
+        "city": address.city,
+        "city_id": address.city_id,
+        "district": address.district
+      }
+    };
+    return Request.post("address/edit", params: params);
+  }
+
+  Future delAddress(num id) async {
+    return Request.post("address/del", params: { "id": id });
+  }
+  
+  Future<RechargeIndex> getRecharge() async {
+    var resp = await Request.get("recharge/index");
+    return RechargeIndex.fromJson(resp);
+  }
+  
+  Future recharge({ num id, String price, String type }) async {
+    var params = {
+      "from": "app",
+      "payType": type,
+      "price": pragma,
+      "rechargeId": id
+    };
+    var resp = await Request.post("recharge/wechat", params: params);
+    return OrderInfo.fromJson(resp);
+  }
+
+  Future editUser({ String nickname , String avatar }) async {
+    var params = {
+      "avatar": avatar == null ? Cache.user.avatar : avatar,
+      "nickname": nickname == null ? Cache.user.nickname : nickname
+    };
+    return await Request.post("user/edit", params: params);
+  }
 }

+ 17 - 6
lib/config/pay_config.dart

@@ -1,8 +1,13 @@
 
+import 'package:flutter/material.dart';
+
+import 'package:twong/utils/index.dart';
+import 'package:twong/utils/image_utils.dart';
+
 class PayInfo {
   String key;
   PayType type;
-  String icon;
+  Widget icon;
   String name;
   String desc;
   PayInfo(this.type, this.key, this.icon, this.name, {this.desc});
@@ -13,14 +18,20 @@ enum PayType {
 }
 
 class PayConfig {
-  static const String wechatAppId = "123";
-  static const String universalLink = "twong://shotshock.shop/open";
+  static const String wechatAppId = "wx1bb4342986c22b28";
+  static const String universalLink = "https://www.shotshock.shop/ios";
 
   static List<PayInfo> get payTypes {
     return [
-      PayInfo(PayType.alipay, "alipay", "icon", "支付宝", desc: "使用支付宝快捷支付"),
-      PayInfo(PayType.wechat, "weixin", "icon", "微信", desc: "使用微信快捷支付"),
-      PayInfo(PayType.yue, "yue", "icon", "余额", desc: "当前可用余额: "),
+      PayInfo(PayType.alipay, "alipay",
+          Icon(IconFonts.alipay, color: Color.fromARGB(255, 22, 120, 255), size: 26.px),
+          "支付宝", desc: "使用支付宝快捷支付"),
+      PayInfo(PayType.wechat, "weixin",
+          Icon(IconFonts.wechat_pay,  color: Color.fromARGB(255, 34, 172, 56), size: 26.px),
+          "微信", desc: "使用微信快捷支付"),
+      PayInfo(PayType.yue, "yue",
+          Icon(IconFonts.balance_pay,  color: Color.fromARGB(255, 248, 188, 88), size: 26.px),
+          "余额", desc: "当前可用余额: "),
     ];
   }
 }

+ 10 - 1
lib/config/protocols.dart

@@ -1,14 +1,23 @@
 
 enum ProtocolType {
   USER,
-  VIP
+  VIP,
+  PRIVATE,
 }
 
 class Protocols {
   static Map<ProtocolType, String> protocols = {
     ProtocolType.USER : 'Here is user protocol',
     ProtocolType.VIP: 'Welcome ! Here is VIP protocol',
+    ProtocolType.PRIVATE: 'Welcome ! Here is private protocol',
+  };
+
+  static Map<ProtocolType, String> protocolNames = {
+    ProtocolType.USER : '用户注册协议',
+    ProtocolType.VIP: '美天旺会员协议',
+    ProtocolType.PRIVATE: '隐私政策',
   };
 
   static String getType(ProtocolType type) => protocols[type];
+  static String getTitle(ProtocolType type) => protocolNames[type];
 }

+ 48 - 0
lib/config/setting.dart

@@ -0,0 +1,48 @@
+
+import 'package:bot_toast/bot_toast.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:twong/providers/setting.dart';
+import 'package:twong/router/index.dart';
+import 'package:twong/utils/index.dart';
+
+class SettingInfo {
+  String name;
+  IconData icon;
+  Function onTap;
+  String route;
+  Widget subText;
+  SettingInfo(this.name, this.icon, this.subText, {this.onTap, this.route});
+}
+
+class SettingConfig {
+  static List<SettingInfo> get data {
+    return [
+      SettingInfo("账号信息", Icons.account_circle, null, route: RouteNames.account),
+      SettingInfo("隐私设置", Icons.policy, null, route: RouteNames.private),
+      SettingInfo("检查更新", Icons.update, Consumer<SettingModel>(
+          builder: (context, model, child) => Text(model.version, style: TextStyle(color: Colors.grey))
+      ), onTap: checkUpdate),
+      SettingInfo("清除缓存", Icons.delete, Consumer<SettingModel>(
+        builder: (context, model, child) => Text(model.cacheSize, style: TextStyle(color: Colors.grey))
+      ), onTap: clearCache),
+      SettingInfo("关于我们", Icons.info, null, route: RouteNames.about),
+    ];
+  }
+
+  static void checkUpdate() {
+    Utils.loading();
+    Utils.checkUpdate();
+  }
+
+  static void clearCache() {
+    Cache.clearFiles().then((value){
+      Provider.of<SettingModel>(Cache.context, listen: false).updateCache(value);
+      BotToast.showText(text: "清理成功");
+    }).catchError((err) {
+      Log.e(err);
+      BotToast.showText(text: "清理失败");
+    });
+  }
+}

+ 24 - 0
lib/config/style.dart

@@ -4,6 +4,10 @@ import '../utils/index.dart';
 
 class DStyle {
   static const Size appBarHeight = Size.fromHeight(40);
+  static Size appBarWithBottom(PreferredSizeWidget widget) {
+    if(widget == null) return appBarHeight;
+    return Size.fromHeight(appBarHeight.height + widget.preferredSize.height);
+  }
 }
 
 class DColors {
@@ -17,4 +21,24 @@ class DText {
   static TextStyle appBar = TextStyle(fontSize: 16.px);
   static TextStyle search = TextStyle(fontSize: 16.px, color: Colors.black);
   static TextStyle price = TextStyle(color: DColors.price, fontWeight: FontWeight.bold, fontSize: 10.px);
+}
+
+class DShadow {
+  static const top = [
+    BoxShadow(
+        color: Color.fromRGBO(223, 223, 223, 1),
+        offset: Offset(0.0, -3.0), //阴影xy轴偏移量
+        blurRadius: 2.0, //阴影模糊程度
+        spreadRadius: 1.0 //阴影扩散程度
+    )
+  ];
+
+  static const down = [
+    BoxShadow(
+        color: Color.fromRGBO(223, 223, 223, 1),
+        offset: Offset(0.0, 3.0), //阴影xy轴偏移量
+        blurRadius: 2.0, //阴影模糊程度
+        spreadRadius: 1.0 //阴影扩散程度
+    )
+  ];
 }

+ 14 - 15
lib/main.dart

@@ -1,6 +1,4 @@
 
-import 'dart:async';
-
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:provider/provider.dart';
@@ -16,25 +14,26 @@ import 'package:twong/providers/index.dart';
 
 void main() async {
   WidgetsFlutterBinding.ensureInitialized();
-  await SentryUtils.initPlatformState();
-  runZoned((){
-    ErrorWidget.builder = (FlutterErrorDetails details){
-      Zone.current.handleUncaughtError(details.exception, details.stack);
-      ///出现异常时会进入下方页面(flutter原有的红屏),
-      // return ExceptionPageState(details.exception.toString(),details.stack.toString()).generateWidget();
-      return Container();
-    };
-  }, onError: (Object error,StackTrace trace){
-    ///你可以将下面日志上传到服务器,用于release后的错误处理
-    Log.e(error);
-    SentryUtils.reportError(error, trace);
-  });
+  // await SentryUtils.initPlatformState();
+  // runZoned((){
+  //   ErrorWidget.builder = (FlutterErrorDetails details){
+  //     Zone.current.handleUncaughtError(details.exception, details.stack);
+  //     ///出现异常时会进入下方页面(flutter原有的红屏),
+  //     // return ExceptionPageState(details.exception.toString(),details.stack.toString()).generateWidget();
+  //     return Container();
+  //   };
+  // }, onError: (Object error,StackTrace trace){
+  //   ///你可以将下面日志上传到服务器,用于release后的错误处理
+  //   Log.e("$error ${trace.toString()}");
+  //   SentryUtils.reportError(error, trace);
+  // });
   try {
     Log.init();
     initRouterList();
     Cache.initial().then((e) => runApp(MainApp()));
     SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
   } catch (error, trace) {
+    Log.e("$error ${trace.toString()}");
     SentryUtils.reportError(error, trace);
   }
 }

+ 1 - 1
lib/models/cartInfo.g.dart

@@ -17,7 +17,7 @@ CartInfo _$CartInfoFromJson(Map<String, dynamic> json) {
     ..seckill_id = json['seckill_id'] as num
     ..bargain_id = json['bargain_id'] as num
     ..productInfo = json['productInfo'] as Map<String, dynamic>
-    ..truePrice = json['truePrice'] as num
+    ..truePrice = num.parse(json['truePrice'].toString())
     ..vip_truePrice = json['vip_truePrice'] as num
     ..trueStock = json['trueStock'] as num;
 }

+ 16 - 0
lib/models/cashRecord.dart

@@ -0,0 +1,16 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'cashRecord.g.dart';
+
+@JsonSerializable()
+class CashRecord {
+    CashRecord();
+
+    String add_time;
+    String title;
+    String number;
+    num pm;
+    
+    factory CashRecord.fromJson(Map<String,dynamic> json) => _$CashRecordFromJson(json);
+    Map<String, dynamic> toJson() => _$CashRecordToJson(this);
+}

+ 23 - 0
lib/models/cashRecord.g.dart

@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'cashRecord.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+CashRecord _$CashRecordFromJson(Map<String, dynamic> json) {
+  return CashRecord()
+    ..add_time = json['add_time'] as String
+    ..title = json['title'] as String
+    ..number = json['number'] as String
+    ..pm = json['pm'] as num;
+}
+
+Map<String, dynamic> _$CashRecordToJson(CashRecord instance) =>
+    <String, dynamic>{
+      'add_time': instance.add_time,
+      'title': instance.title,
+      'number': instance.number,
+      'pm': instance.pm
+    };

+ 1 - 1
lib/models/computeData.dart

@@ -8,7 +8,7 @@ class ComputeData {
 
     String total_price;
     num pay_price;
-    String pay_postage;
+    num pay_postage;
     num coupon_price;
     num deduction_price;
     num SurplusIntegral;

+ 2 - 2
lib/models/computeData.g.dart

@@ -9,8 +9,8 @@ part of 'computeData.dart';
 ComputeData _$ComputeDataFromJson(Map<String, dynamic> json) {
   return ComputeData()
     ..total_price = json['total_price'] as String
-    ..pay_price = json['pay_price']
-    ..pay_postage = json['pay_postage'] as String
+    ..pay_price = num.parse(json['pay_price'].toString())
+    ..pay_postage = num.parse(json['pay_postage'].toString())
     ..coupon_price = json['coupon_price'] as num
     ..deduction_price = json['deduction_price'] as num
     ..SurplusIntegral = json['SurplusIntegral'] as num;

+ 15 - 0
lib/models/express.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+import "expressOrder.dart";
+import "expressInfo.dart";
+part 'express.g.dart';
+
+@JsonSerializable()
+class Express {
+    Express();
+
+    ExpressOrder order;
+    ExpressInfo express;
+    
+    factory Express.fromJson(Map<String,dynamic> json) => _$ExpressFromJson(json);
+    Map<String, dynamic> toJson() => _$ExpressToJson(this);
+}

+ 20 - 0
lib/models/express.g.dart

@@ -0,0 +1,20 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'express.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Express _$ExpressFromJson(Map<String, dynamic> json) {
+  return Express()
+    ..order = json['order'] == null
+        ? null
+        : ExpressOrder.fromJson(json['order'] as Map<String, dynamic>)
+    ..express = json['express'] == null
+        ? null
+        : ExpressInfo.fromJson(json['express'] as Map<String, dynamic>);
+}
+
+Map<String, dynamic> _$ExpressToJson(Express instance) =>
+    <String, dynamic>{'order': instance.order, 'express': instance.express};

+ 15 - 0
lib/models/expressInfo.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+import "expressResult.dart";
+part 'expressInfo.g.dart';
+
+@JsonSerializable()
+class ExpressInfo {
+    ExpressInfo();
+
+    String status;
+    String msg;
+    ExpressResult result;
+    
+    factory ExpressInfo.fromJson(Map<String,dynamic> json) => _$ExpressInfoFromJson(json);
+    Map<String, dynamic> toJson() => _$ExpressInfoToJson(this);
+}

+ 23 - 0
lib/models/expressInfo.g.dart

@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'expressInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+ExpressInfo _$ExpressInfoFromJson(Map<String, dynamic> json) {
+  return ExpressInfo()
+    ..status = json['status'] as String
+    ..msg = json['msg'] as String
+    ..result = json['result'] == null
+        ? null
+        : ExpressResult.fromJson(json['result'] as Map<String, dynamic>);
+}
+
+Map<String, dynamic> _$ExpressInfoToJson(ExpressInfo instance) =>
+    <String, dynamic>{
+      'status': instance.status,
+      'msg': instance.msg,
+      'result': instance.result
+    };

+ 16 - 0
lib/models/expressOrder.dart

@@ -0,0 +1,16 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'expressOrder.g.dart';
+
+@JsonSerializable()
+class ExpressOrder {
+    ExpressOrder();
+
+    String delivery_id;
+    String delivery_name;
+    String delivery_type;
+    List cartInfo;
+    
+    factory ExpressOrder.fromJson(Map<String,dynamic> json) => _$ExpressOrderFromJson(json);
+    Map<String, dynamic> toJson() => _$ExpressOrderToJson(this);
+}

+ 23 - 0
lib/models/expressOrder.g.dart

@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'expressOrder.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+ExpressOrder _$ExpressOrderFromJson(Map<String, dynamic> json) {
+  return ExpressOrder()
+    ..delivery_id = json['delivery_id'] as String
+    ..delivery_name = json['delivery_name'] as String
+    ..delivery_type = json['delivery_type'] as String
+    ..cartInfo = json['cartInfo'] as List;
+}
+
+Map<String, dynamic> _$ExpressOrderToJson(ExpressOrder instance) =>
+    <String, dynamic>{
+      'delivery_id': instance.delivery_id,
+      'delivery_name': instance.delivery_name,
+      'delivery_type': instance.delivery_type,
+      'cartInfo': instance.cartInfo
+    };

+ 15 - 0
lib/models/expressResult.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'expressResult.g.dart';
+
+@JsonSerializable()
+class ExpressResult {
+    ExpressResult();
+
+    String number;
+    String type;
+    List list;
+    
+    factory ExpressResult.fromJson(Map<String,dynamic> json) => _$ExpressResultFromJson(json);
+    Map<String, dynamic> toJson() => _$ExpressResultToJson(this);
+}

+ 21 - 0
lib/models/expressResult.g.dart

@@ -0,0 +1,21 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'expressResult.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+ExpressResult _$ExpressResultFromJson(Map<String, dynamic> json) {
+  return ExpressResult()
+    ..number = json['number'] as String
+    ..type = json['type'] as String
+    ..list = json['list'] as List;
+}
+
+Map<String, dynamic> _$ExpressResultToJson(ExpressResult instance) =>
+    <String, dynamic>{
+      'number': instance.number,
+      'type': instance.type,
+      'list': instance.list
+    };

+ 20 - 0
lib/models/index.dart

@@ -1,31 +1,51 @@
 export 'confirmInfo.dart' ; 
 export 'productInfo.dart' ; 
 export 'orderConfig.dart' ; 
+export 'promotionOrderList.dart' ; 
 export 'productAttr.dart' ; 
+export 'promotionOrder.dart' ; 
 export 'version.dart' ; 
 export 'storeInfo.dart' ; 
 export 'computeInfo.dart' ; 
 export 'computeData.dart' ; 
+export 'vipInfo.dart' ; 
 export 'cartList.dart' ; 
 export 'cartInfo.dart' ; 
 export 'token.dart' ; 
 export 'balance.dart' ; 
+export 'promotionOrderData.dart' ; 
+export 'rechargeIndex.dart' ; 
+export 'cashRecord.dart' ; 
 export 'banner.dart' ; 
+export 'promotionPeople.dart' ; 
 export 'orderInfo.dart' ; 
 export 'resp.dart' ; 
+export 'orderData.dart' ; 
+export 'expressResult.dart' ; 
 export 'fastCate.dart' ; 
 export 'userInfo.dart' ; 
+export 'express.dart' ; 
 export 'account.dart' ; 
 export 'address.dart' ; 
 export 'homeInfo.dart' ; 
 export 'attrValue.dart' ; 
 export 'friend.dart' ; 
 export 'user.dart' ; 
+export 'promotionPeopleData.dart' ; 
 export 'menu.dart' ; 
 export 'details.dart' ; 
+export 'rechargeData.dart' ; 
+export 'orderStatus.dart' ; 
+export 'promoteRecord.dart' ; 
+export 'orderDetails.dart' ; 
+export 'expressInfo.dart' ; 
 export 'collect.dart' ; 
+export 'expressOrder.dart' ; 
 export 'product.dart' ; 
 export 'home.dart' ; 
 export 'reply.dart' ; 
+export 'vipConfig.dart' ; 
 export 'activity.dart' ; 
+export 'promoteRecordList.dart' ; 
 export 'similarity.dart' ; 
+export 'message.dart' ; 

+ 20 - 0
lib/models/message.dart

@@ -0,0 +1,20 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'message.g.dart';
+
+@JsonSerializable()
+class Message {
+    Message();
+
+    num id;
+    String sender;
+    String subject;
+    String desc;
+    String body;
+    num add_time;
+    num expire_at;
+    num read;
+    
+    factory Message.fromJson(Map<String,dynamic> json) => _$MessageFromJson(json);
+    Map<String, dynamic> toJson() => _$MessageToJson(this);
+}

+ 30 - 0
lib/models/message.g.dart

@@ -0,0 +1,30 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Message _$MessageFromJson(Map<String, dynamic> json) {
+  return Message()
+    ..id = json['id'] as num
+    ..sender = json['sender'] as String
+    ..subject = json['subject'] as String
+    ..desc = json['desc'] as String
+    ..body = json['body'] as String
+    ..add_time = json['add_time'] as num
+    ..expire_at = json['expire_at'] as num
+    ..read = json['read'] as num;
+}
+
+Map<String, dynamic> _$MessageToJson(Message instance) => <String, dynamic>{
+      'id': instance.id,
+      'sender': instance.sender,
+      'subject': instance.subject,
+      'desc': instance.desc,
+      'body': instance.body,
+      'add_time': instance.add_time,
+      'expire_at': instance.expire_at,
+      'read': instance.read
+    };

+ 38 - 0
lib/models/orderData.dart

@@ -0,0 +1,38 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'orderStatus.dart';
+import "cartInfo.dart";
+part 'orderData.g.dart';
+
+@JsonSerializable()
+class OrderData {
+    OrderData();
+
+    num add_time;
+    num seckill_id;
+    num bargain_id;
+    num combination_id;
+    num id;
+    String order_id;
+    String pay_price;
+    num total_num;
+    String total_price;
+    String pay_postage;
+    String total_postage;
+    num paid;
+    num status;
+    num refund_status;
+    String pay_type;
+    String coupon_price;
+    String deduction_price;
+    num pink_id;
+    @JsonKey(name: 'delivery_type') dynamic delivery_type;
+    num is_del;
+    num shipping_type;
+    List<CartInfo> cartInfo;
+    @JsonKey(name: '_status') OrderStatus orderStatus;
+    String status_pic;
+    num offlinePayStatus;
+    
+    factory OrderData.fromJson(Map<String,dynamic> json) => _$OrderDataFromJson(json);
+    Map<String, dynamic> toJson() => _$OrderDataToJson(this);
+}

+ 69 - 0
lib/models/orderData.g.dart

@@ -0,0 +1,69 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'orderData.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+OrderData _$OrderDataFromJson(Map<String, dynamic> json) {
+  return OrderData()
+    ..add_time = json['add_time'] as num
+    ..seckill_id = json['seckill_id'] as num
+    ..bargain_id = json['bargain_id'] as num
+    ..combination_id = json['combination_id'] as num
+    ..id = json['id'] as num
+    ..order_id = json['order_id'] as String
+    ..pay_price = json['pay_price'] as String
+    ..total_num = json['total_num'] as num
+    ..total_price = json['total_price'] as String
+    ..pay_postage = json['pay_postage'] as String
+    ..total_postage = json['total_postage'] as String
+    ..paid = json['paid'] as num
+    ..status = json['status'] as num
+    ..refund_status = json['refund_status'] as num
+    ..pay_type = json['pay_type'] as String
+    ..coupon_price = json['coupon_price'] as String
+    ..deduction_price = json['deduction_price'] as String
+    ..pink_id = json['pink_id'] as num
+    ..delivery_type = json['delivery_type']
+    ..is_del = json['is_del'] as num
+    ..shipping_type = json['shipping_type'] as num
+    ..cartInfo = (json['cartInfo'] as List)
+        ?.map((e) =>
+            e == null ? null : CartInfo.fromJson(e as Map<String, dynamic>))
+        ?.toList()
+    ..orderStatus = json['_status'] == null
+        ? null
+        : OrderStatus.fromJson(json['_status'] as Map<String, dynamic>)
+    ..status_pic = json['status_pic'] as String
+    ..offlinePayStatus = json['offlinePayStatus'] as num;
+}
+
+Map<String, dynamic> _$OrderDataToJson(OrderData instance) => <String, dynamic>{
+      'add_time': instance.add_time,
+      'seckill_id': instance.seckill_id,
+      'bargain_id': instance.bargain_id,
+      'combination_id': instance.combination_id,
+      'id': instance.id,
+      'order_id': instance.order_id,
+      'pay_price': instance.pay_price,
+      'total_num': instance.total_num,
+      'total_price': instance.total_price,
+      'pay_postage': instance.pay_postage,
+      'total_postage': instance.total_postage,
+      'paid': instance.paid,
+      'status': instance.status,
+      'refund_status': instance.refund_status,
+      'pay_type': instance.pay_type,
+      'coupon_price': instance.coupon_price,
+      'deduction_price': instance.deduction_price,
+      'pink_id': instance.pink_id,
+      'delivery_type': instance.delivery_type,
+      'is_del': instance.is_del,
+      'shipping_type': instance.shipping_type,
+      'cartInfo': instance.cartInfo,
+      '_status': instance.orderStatus,
+      'status_pic': instance.status_pic,
+      'offlinePayStatus': instance.offlinePayStatus
+    };

+ 66 - 0
lib/models/orderDetails.dart

@@ -0,0 +1,66 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'orderStatus.dart';
+import "cartInfo.dart";
+part 'orderDetails.g.dart';
+
+@JsonSerializable()
+class OrderDetails {
+    OrderDetails();
+
+    num id;
+    String order_id;
+    num uid;
+    String real_name;
+    String user_phone;
+    String user_address;
+    List cart_id;
+    String freight_price;
+    num total_num;
+    String total_price;
+    String total_postage;
+    String pay_price;
+    String pay_postage;
+    String deduction_price;
+    num coupon_id;
+    String coupon_price;
+    num paid;
+    num pay_time;
+    String pay_type;
+    num add_time;
+    num status;
+    num refund_status;
+    String refund_price;
+    String gain_integral;
+    String use_integral;
+    num back_integral;
+    String mark;
+    num is_del;
+    String unique;
+    num mer_id;
+    num is_mer_check;
+    num combination_id;
+    num pink_id;
+    String cost;
+    num seckill_id;
+    num bargain_id;
+    String verify_code;
+    num store_id;
+    num shipping_type;
+    num clerk_id;
+    num is_channel;
+    num is_remind;
+    num is_system_del;
+    num is_rebate;
+    String add_time_y;
+    String add_time_h;
+    String mapKey;
+    List<CartInfo> cartInfo;
+    @JsonKey(name: '_status') OrderStatus orderStatus;
+    @JsonKey(name: '_pay_time') String payTime;
+    @JsonKey(name: '_add_time') String addTime;
+    String status_pic;
+    num offlinePayStatus;
+    
+    factory OrderDetails.fromJson(Map<String,dynamic> json) => _$OrderDetailsFromJson(json);
+    Map<String, dynamic> toJson() => _$OrderDetailsToJson(this);
+}

+ 126 - 0
lib/models/orderDetails.g.dart

@@ -0,0 +1,126 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'orderDetails.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+OrderDetails _$OrderDetailsFromJson(Map<String, dynamic> json) {
+  return OrderDetails()
+    ..id = json['id'] as num
+    ..order_id = json['order_id'] as String
+    ..uid = json['uid'] as num
+    ..real_name = json['real_name'] as String
+    ..user_phone = json['user_phone'] as String
+    ..user_address = json['user_address'] as String
+    ..cart_id = json['cart_id'] as List
+    ..freight_price = json['freight_price'] as String
+    ..total_num = json['total_num'] as num
+    ..total_price = json['total_price'] as String
+    ..total_postage = json['total_postage'] as String
+    ..pay_price = json['pay_price'] as String
+    ..pay_postage = json['pay_postage'] as String
+    ..deduction_price = json['deduction_price'] as String
+    ..coupon_id = json['coupon_id'] as num
+    ..coupon_price = json['coupon_price'] as String
+    ..paid = json['paid'] as num
+    ..pay_time = json['pay_time'] as num
+    ..pay_type = json['pay_type'] as String
+    ..add_time = json['add_time'] as num
+    ..status = json['status'] as num
+    ..refund_status = json['refund_status'] as num
+    ..refund_price = json['refund_price'] as String
+    ..gain_integral = json['gain_integral'] as String
+    ..use_integral = json['use_integral'] as String
+    ..back_integral = json['back_integral'] as num
+    ..mark = json['mark'] as String
+    ..is_del = json['is_del'] as num
+    ..unique = json['unique'] as String
+    ..mer_id = json['mer_id'] as num
+    ..is_mer_check = json['is_mer_check'] as num
+    ..combination_id = json['combination_id'] as num
+    ..pink_id = json['pink_id'] as num
+    ..cost = json['cost'] as String
+    ..seckill_id = json['seckill_id'] as num
+    ..bargain_id = json['bargain_id'] as num
+    ..verify_code = json['verify_code'] as String
+    ..store_id = json['store_id'] as num
+    ..shipping_type = json['shipping_type'] as num
+    ..clerk_id = json['clerk_id'] as num
+    ..is_channel = json['is_channel'] as num
+    ..is_remind = json['is_remind'] as num
+    ..is_system_del = json['is_system_del'] as num
+    ..is_rebate = json['is_rebate'] as num
+    ..add_time_y = json['add_time_y'] as String
+    ..add_time_h = json['add_time_h'] as String
+    ..mapKey = json['mapKey'] as String
+    ..cartInfo = (json['cartInfo'] as List)
+        ?.map((e) =>
+            e == null ? null : CartInfo.fromJson(e as Map<String, dynamic>))
+        ?.toList()
+    ..orderStatus = json['_status'] == null
+        ? null
+        : OrderStatus.fromJson(json['_status'] as Map<String, dynamic>)
+    ..payTime = json['_pay_time'] as String
+    ..addTime = json['_add_time'] as String
+    ..status_pic = json['status_pic'] as String
+    ..offlinePayStatus = json['offlinePayStatus'] as num;
+}
+
+Map<String, dynamic> _$OrderDetailsToJson(OrderDetails instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'order_id': instance.order_id,
+      'uid': instance.uid,
+      'real_name': instance.real_name,
+      'user_phone': instance.user_phone,
+      'user_address': instance.user_address,
+      'cart_id': instance.cart_id,
+      'freight_price': instance.freight_price,
+      'total_num': instance.total_num,
+      'total_price': instance.total_price,
+      'total_postage': instance.total_postage,
+      'pay_price': instance.pay_price,
+      'pay_postage': instance.pay_postage,
+      'deduction_price': instance.deduction_price,
+      'coupon_id': instance.coupon_id,
+      'coupon_price': instance.coupon_price,
+      'paid': instance.paid,
+      'pay_time': instance.pay_time,
+      'pay_type': instance.pay_type,
+      'add_time': instance.add_time,
+      'status': instance.status,
+      'refund_status': instance.refund_status,
+      'refund_price': instance.refund_price,
+      'gain_integral': instance.gain_integral,
+      'use_integral': instance.use_integral,
+      'back_integral': instance.back_integral,
+      'mark': instance.mark,
+      'is_del': instance.is_del,
+      'unique': instance.unique,
+      'mer_id': instance.mer_id,
+      'is_mer_check': instance.is_mer_check,
+      'combination_id': instance.combination_id,
+      'pink_id': instance.pink_id,
+      'cost': instance.cost,
+      'seckill_id': instance.seckill_id,
+      'bargain_id': instance.bargain_id,
+      'verify_code': instance.verify_code,
+      'store_id': instance.store_id,
+      'shipping_type': instance.shipping_type,
+      'clerk_id': instance.clerk_id,
+      'is_channel': instance.is_channel,
+      'is_remind': instance.is_remind,
+      'is_system_del': instance.is_system_del,
+      'is_rebate': instance.is_rebate,
+      'add_time_y': instance.add_time_y,
+      'add_time_h': instance.add_time_h,
+      'mapKey': instance.mapKey,
+      'cartInfo': instance.cartInfo,
+      '_status': instance.orderStatus,
+      '_pay_time': instance.payTime,
+      '_add_time': instance.addTime,
+      'status_pic': instance.status_pic,
+      'offlinePayStatus': instance.offlinePayStatus
+    };

+ 2 - 2
lib/models/orderInfo.dart

@@ -1,12 +1,12 @@
 import 'package:json_annotation/json_annotation.dart';
-import "orderConfig.dart";
+
 part 'orderInfo.g.dart';
 
 @JsonSerializable()
 class OrderInfo {
     OrderInfo();
 
-    OrderConfig result;
+    @JsonKey(name: 'result') dynamic result;
     String status;
     
     factory OrderInfo.fromJson(Map<String,dynamic> json) => _$OrderInfoFromJson(json);

+ 1 - 3
lib/models/orderInfo.g.dart

@@ -8,9 +8,7 @@ part of 'orderInfo.dart';
 
 OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
   return OrderInfo()
-    ..result = json['result'] == null
-        ? null
-        : OrderConfig.fromJson(json['result'] as Map<String, dynamic>)
+    ..result = json['result']
     ..status = json['status'] as String;
 }
 

+ 17 - 0
lib/models/orderStatus.dart

@@ -0,0 +1,17 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'orderStatus.g.dart';
+
+@JsonSerializable()
+class OrderStatus {
+    OrderStatus();
+
+    @JsonKey(name: '_type') num type;
+    @JsonKey(name: '_title') String title;
+    @JsonKey(name: '_msg') String msg;
+    @JsonKey(name: '_class') String className;
+    @JsonKey(name: '_payType') String payType;
+    
+    factory OrderStatus.fromJson(Map<String,dynamic> json) => _$OrderStatusFromJson(json);
+    Map<String, dynamic> toJson() => _$OrderStatusToJson(this);
+}

+ 25 - 0
lib/models/orderStatus.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'orderStatus.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+OrderStatus _$OrderStatusFromJson(Map<String, dynamic> json) {
+  return OrderStatus()
+    ..type = json['_type'] as num
+    ..title = json['_title'] as String
+    ..msg = json['_msg'] as String
+    ..className = json['_class'] as String
+    ..payType = json['_payType'] as String;
+}
+
+Map<String, dynamic> _$OrderStatusToJson(OrderStatus instance) =>
+    <String, dynamic>{
+      '_type': instance.type,
+      '_title': instance.title,
+      '_msg': instance.msg,
+      '_class': instance.className,
+      '_payType': instance.payType
+    };

+ 16 - 0
lib/models/promoteRecord.dart

@@ -0,0 +1,16 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'promoteRecord.g.dart';
+
+@JsonSerializable()
+class PromoteRecord {
+    PromoteRecord();
+
+    String add_time;
+    String title;
+    String number;
+    num pm;
+    
+    factory PromoteRecord.fromJson(Map<String,dynamic> json) => _$PromoteRecordFromJson(json);
+    Map<String, dynamic> toJson() => _$PromoteRecordToJson(this);
+}

+ 23 - 0
lib/models/promoteRecord.g.dart

@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promoteRecord.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromoteRecord _$PromoteRecordFromJson(Map<String, dynamic> json) {
+  return PromoteRecord()
+    ..add_time = json['add_time'] as String
+    ..title = json['title'] as String
+    ..number = json['number'] as String
+    ..pm = json['pm'] as num;
+}
+
+Map<String, dynamic> _$PromoteRecordToJson(PromoteRecord instance) =>
+    <String, dynamic>{
+      'add_time': instance.add_time,
+      'title': instance.title,
+      'number': instance.number,
+      'pm': instance.pm
+    };

+ 14 - 0
lib/models/promoteRecordList.dart

@@ -0,0 +1,14 @@
+import 'package:json_annotation/json_annotation.dart';
+import "promoteRecord.dart";
+part 'promoteRecordList.g.dart';
+
+@JsonSerializable()
+class PromoteRecordList {
+    PromoteRecordList();
+
+    String time;
+    List<PromoteRecord> list;
+    
+    factory PromoteRecordList.fromJson(Map<String,dynamic> json) => _$PromoteRecordListFromJson(json);
+    Map<String, dynamic> toJson() => _$PromoteRecordListToJson(this);
+}

+ 20 - 0
lib/models/promoteRecordList.g.dart

@@ -0,0 +1,20 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promoteRecordList.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromoteRecordList _$PromoteRecordListFromJson(Map<String, dynamic> json) {
+  return PromoteRecordList()
+    ..time = json['time'] as String
+    ..list = (json['list'] as List)
+        ?.map((e) => e == null
+            ? null
+            : PromoteRecord.fromJson(e as Map<String, dynamic>))
+        ?.toList();
+}
+
+Map<String, dynamic> _$PromoteRecordListToJson(PromoteRecordList instance) =>
+    <String, dynamic>{'time': instance.time, 'list': instance.list};

+ 18 - 0
lib/models/promotionOrder.dart

@@ -0,0 +1,18 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'promotionOrder.g.dart';
+
+@JsonSerializable()
+class PromotionOrder {
+    PromotionOrder();
+
+    String avatar;
+    String nickname;
+    String number;
+    String order_id;
+    String time;
+    String type;
+    
+    factory PromotionOrder.fromJson(Map<String,dynamic> json) => _$PromotionOrderFromJson(json);
+    Map<String, dynamic> toJson() => _$PromotionOrderToJson(this);
+}

+ 27 - 0
lib/models/promotionOrder.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotionOrder.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromotionOrder _$PromotionOrderFromJson(Map<String, dynamic> json) {
+  return PromotionOrder()
+    ..avatar = json['avatar'] as String
+    ..nickname = json['nickname'] as String
+    ..number = json['number'] as String
+    ..order_id = json['order_id'] as String
+    ..time = json['time'] as String
+    ..type = json['type'] as String;
+}
+
+Map<String, dynamic> _$PromotionOrderToJson(PromotionOrder instance) =>
+    <String, dynamic>{
+      'avatar': instance.avatar,
+      'nickname': instance.nickname,
+      'number': instance.number,
+      'order_id': instance.order_id,
+      'time': instance.time,
+      'type': instance.type
+    };

+ 14 - 0
lib/models/promotionOrderData.dart

@@ -0,0 +1,14 @@
+import 'package:json_annotation/json_annotation.dart';
+import "promotionOrderList.dart";
+part 'promotionOrderData.g.dart';
+
+@JsonSerializable()
+class PromotionOrderData {
+    PromotionOrderData();
+
+    num count;
+    List<PromotionOrderList> list;
+    
+    factory PromotionOrderData.fromJson(Map<String,dynamic> json) => _$PromotionOrderDataFromJson(json);
+    Map<String, dynamic> toJson() => _$PromotionOrderDataToJson(this);
+}

+ 20 - 0
lib/models/promotionOrderData.g.dart

@@ -0,0 +1,20 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotionOrderData.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromotionOrderData _$PromotionOrderDataFromJson(Map<String, dynamic> json) {
+  return PromotionOrderData()
+    ..count = json['count'] as num
+    ..list = (json['list'] as List)
+        ?.map((e) => e == null
+            ? null
+            : PromotionOrderList.fromJson(e as Map<String, dynamic>))
+        ?.toList();
+}
+
+Map<String, dynamic> _$PromotionOrderDataToJson(PromotionOrderData instance) =>
+    <String, dynamic>{'count': instance.count, 'list': instance.list};

+ 15 - 0
lib/models/promotionOrderList.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+import "promotionOrder.dart";
+part 'promotionOrderList.g.dart';
+
+@JsonSerializable()
+class PromotionOrderList {
+    PromotionOrderList();
+
+    List<PromotionOrder> child;
+    num count;
+    String time;
+    
+    factory PromotionOrderList.fromJson(Map<String,dynamic> json) => _$PromotionOrderListFromJson(json);
+    Map<String, dynamic> toJson() => _$PromotionOrderListToJson(this);
+}

+ 25 - 0
lib/models/promotionOrderList.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotionOrderList.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromotionOrderList _$PromotionOrderListFromJson(Map<String, dynamic> json) {
+  return PromotionOrderList()
+    ..child = (json['child'] as List)
+        ?.map((e) => e == null
+            ? null
+            : PromotionOrder.fromJson(e as Map<String, dynamic>))
+        ?.toList()
+    ..count = json['count'] as num
+    ..time = json['time'] as String;
+}
+
+Map<String, dynamic> _$PromotionOrderListToJson(PromotionOrderList instance) =>
+    <String, dynamic>{
+      'child': instance.child,
+      'count': instance.count,
+      'time': instance.time
+    };

+ 19 - 0
lib/models/promotionPeople.dart

@@ -0,0 +1,19 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'promotionPeople.g.dart';
+
+@JsonSerializable()
+class PromotionPeople {
+    PromotionPeople();
+
+    String avatar;
+    num childCount;
+    String nickname;
+    num numberCount;
+    num orderCount;
+    String time;
+    num uid;
+    
+    factory PromotionPeople.fromJson(Map<String,dynamic> json) => _$PromotionPeopleFromJson(json);
+    Map<String, dynamic> toJson() => _$PromotionPeopleToJson(this);
+}

+ 29 - 0
lib/models/promotionPeople.g.dart

@@ -0,0 +1,29 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotionPeople.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromotionPeople _$PromotionPeopleFromJson(Map<String, dynamic> json) {
+  return PromotionPeople()
+    ..avatar = json['avatar'] as String
+    ..childCount = json['childCount'] as num
+    ..nickname = json['nickname'] as String
+    ..numberCount = json['numberCount'] as num
+    ..orderCount = json['orderCount'] as num
+    ..time = json['time'] as String
+    ..uid = json['uid'] as num;
+}
+
+Map<String, dynamic> _$PromotionPeopleToJson(PromotionPeople instance) =>
+    <String, dynamic>{
+      'avatar': instance.avatar,
+      'childCount': instance.childCount,
+      'nickname': instance.nickname,
+      'numberCount': instance.numberCount,
+      'orderCount': instance.orderCount,
+      'time': instance.time,
+      'uid': instance.uid
+    };

+ 15 - 0
lib/models/promotionPeopleData.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+import "promotionPeople.dart";
+part 'promotionPeopleData.g.dart';
+
+@JsonSerializable()
+class PromotionPeopleData {
+    PromotionPeopleData();
+
+    List<PromotionPeople> list;
+    num total;
+    num totalLevel;
+    
+    factory PromotionPeopleData.fromJson(Map<String,dynamic> json) => _$PromotionPeopleDataFromJson(json);
+    Map<String, dynamic> toJson() => _$PromotionPeopleDataToJson(this);
+}

+ 26 - 0
lib/models/promotionPeopleData.g.dart

@@ -0,0 +1,26 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotionPeopleData.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+PromotionPeopleData _$PromotionPeopleDataFromJson(Map<String, dynamic> json) {
+  return PromotionPeopleData()
+    ..list = (json['list'] as List)
+        ?.map((e) => e == null
+            ? null
+            : PromotionPeople.fromJson(e as Map<String, dynamic>))
+        ?.toList()
+    ..total = json['total'] as num
+    ..totalLevel = json['totalLevel'] as num;
+}
+
+Map<String, dynamic> _$PromotionPeopleDataToJson(
+        PromotionPeopleData instance) =>
+    <String, dynamic>{
+      'list': instance.list,
+      'total': instance.total,
+      'totalLevel': instance.totalLevel
+    };

+ 15 - 0
lib/models/rechargeData.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'rechargeData.g.dart';
+
+@JsonSerializable()
+class RechargeData {
+    RechargeData();
+
+    num id;
+    String give_money;
+    String price;
+    
+    factory RechargeData.fromJson(Map<String,dynamic> json) => _$RechargeDataFromJson(json);
+    Map<String, dynamic> toJson() => _$RechargeDataToJson(this);
+}

+ 21 - 0
lib/models/rechargeData.g.dart

@@ -0,0 +1,21 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rechargeData.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+RechargeData _$RechargeDataFromJson(Map<String, dynamic> json) {
+  return RechargeData()
+    ..id = json['id'] as num
+    ..give_money = json['give_money'] as String
+    ..price = json['price'] as String;
+}
+
+Map<String, dynamic> _$RechargeDataToJson(RechargeData instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'give_money': instance.give_money,
+      'price': instance.price
+    };

+ 15 - 0
lib/models/rechargeIndex.dart

@@ -0,0 +1,15 @@
+import 'package:json_annotation/json_annotation.dart';
+import "rechargeData.dart";
+part 'rechargeIndex.g.dart';
+
+@JsonSerializable()
+class RechargeIndex {
+    RechargeIndex();
+
+    String balance;
+    List recharge_attention;
+    List<RechargeData> recharge_quota;
+    
+    factory RechargeIndex.fromJson(Map<String,dynamic> json) => _$RechargeIndexFromJson(json);
+    Map<String, dynamic> toJson() => _$RechargeIndexToJson(this);
+}

+ 24 - 0
lib/models/rechargeIndex.g.dart

@@ -0,0 +1,24 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rechargeIndex.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+RechargeIndex _$RechargeIndexFromJson(Map<String, dynamic> json) {
+  return RechargeIndex()
+    ..balance = json['balance'] as String
+    ..recharge_attention = json['recharge_attention'] as List
+    ..recharge_quota = (json['recharge_quota'] as List)
+        ?.map((e) =>
+            e == null ? null : RechargeData.fromJson(e as Map<String, dynamic>))
+        ?.toList();
+}
+
+Map<String, dynamic> _$RechargeIndexToJson(RechargeIndex instance) =>
+    <String, dynamic>{
+      'balance': instance.balance,
+      'recharge_attention': instance.recharge_attention,
+      'recharge_quota': instance.recharge_quota
+    };

+ 1 - 1
lib/models/user.dart

@@ -33,7 +33,7 @@ class User {
     num vip_status;
     num vip_card_level;
     num vip_gift;
-    String vip_time;
+    num vip_time;
     String vip_card_id;
     num couponCount;
     num like;

+ 1 - 1
lib/models/user.g.dart

@@ -35,7 +35,7 @@ User _$UserFromJson(Map<String, dynamic> json) {
     ..vip_status = json['vip_status'] as num
     ..vip_card_level = json['vip_card_level'] as num
     ..vip_gift = json['vip_gift'] as num
-    ..vip_time = json['vip_time'] as String
+    ..vip_time = json['vip_time'] as num
     ..vip_card_id = json['vip_card_id'] as String
     ..couponCount = json['couponCount'] as num
     ..like = json['like'] as num

+ 1 - 1
lib/models/userInfo.dart

@@ -33,7 +33,7 @@ class UserInfo {
     num vip_status;
     num vip_card_level;
     num vip_gift;
-    String vip_time;
+    num vip_time;
     String vip_card_id;
     String broken_commission;
     String commissionCount;

+ 1 - 1
lib/models/userInfo.g.dart

@@ -35,7 +35,7 @@ UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
     ..vip_status = json['vip_status'] as num
     ..vip_card_level = json['vip_card_level'] as num
     ..vip_gift = json['vip_gift'] as num
-    ..vip_time = json['vip_time'] as String
+    ..vip_time = json['vip_time'] as num
     ..vip_card_id = json['vip_card_id'] as String
     ..broken_commission = json['broken_commission'] as String
     ..commissionCount = json['commissionCount'] as String;

+ 19 - 0
lib/models/vipConfig.dart

@@ -0,0 +1,19 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'vipConfig.g.dart';
+
+@JsonSerializable()
+class VipConfig {
+    VipConfig();
+
+    String name;
+    num discount;
+    String image;
+    String icon;
+    String explain;
+    num id;
+    num grade;
+    
+    factory VipConfig.fromJson(Map<String,dynamic> json) => _$VipConfigFromJson(json);
+    Map<String, dynamic> toJson() => _$VipConfigToJson(this);
+}

+ 28 - 0
lib/models/vipConfig.g.dart

@@ -0,0 +1,28 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'vipConfig.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+VipConfig _$VipConfigFromJson(Map<String, dynamic> json) {
+  return VipConfig()
+    ..name = json['name'] as String
+    ..discount = json['discount'] as num
+    ..image = json['image'] as String
+    ..icon = json['icon'] as String
+    ..explain = json['explain'] as String
+    ..id = json['id'] as num
+    ..grade = json['grade'] as num;
+}
+
+Map<String, dynamic> _$VipConfigToJson(VipConfig instance) => <String, dynamic>{
+      'name': instance.name,
+      'discount': instance.discount,
+      'image': instance.image,
+      'icon': instance.icon,
+      'explain': instance.explain,
+      'id': instance.id,
+      'grade': instance.grade
+    };

+ 17 - 0
lib/models/vipInfo.dart

@@ -0,0 +1,17 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'vipInfo.g.dart';
+
+@JsonSerializable()
+class VipInfo {
+    VipInfo();
+
+    String card_benefit;
+    num money_available;
+    num money_next;
+    String card_product_id;
+    String card_updater_id;
+    
+    factory VipInfo.fromJson(Map<String,dynamic> json) => _$VipInfoFromJson(json);
+    Map<String, dynamic> toJson() => _$VipInfoToJson(this);
+}

+ 24 - 0
lib/models/vipInfo.g.dart

@@ -0,0 +1,24 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'vipInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+VipInfo _$VipInfoFromJson(Map<String, dynamic> json) {
+  return VipInfo()
+    ..card_benefit = json['card_benefit'] as String
+    ..money_available = json['money_available'] as num
+    ..money_next = json['money_next'] as num
+    ..card_product_id = json['card_product_id'] as String
+    ..card_updater_id = json['card_updater_id'] as String;
+}
+
+Map<String, dynamic> _$VipInfoToJson(VipInfo instance) => <String, dynamic>{
+      'card_benefit': instance.card_benefit,
+      'money_available': instance.money_available,
+      'money_next': instance.money_next,
+      'card_product_id': instance.card_product_id,
+      'card_updater_id': instance.card_updater_id
+    };

+ 271 - 0
lib/pages/address/address_edit.dart

@@ -0,0 +1,271 @@
+
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:provider/provider.dart';
+import 'package:bot_toast/bot_toast.dart';
+
+import 'package:twong/api/index.dart';
+import 'package:twong/utils/index.dart';
+import 'package:twong/config/style.dart';
+import 'package:twong/models/address.dart';
+import 'package:twong/widgets/app_bar.dart';
+import 'package:twong/providers/address.dart';
+import 'package:twong/widgets/address_selecter.dart';
+import 'package:twong/widgets/circle_check_box.dart';
+
+class EditAddressPage extends StatefulWidget {
+  final Address data;
+
+  EditAddressPage(this.data);
+
+  @override
+  State<StatefulWidget> createState() {
+    return _EditAddressPageState();
+  }
+}
+
+class _EditAddressPageState extends State<EditAddressPage> {
+  bool _isAdd = true;
+  Address _address = Address();
+  TextEditingController _nameController = TextEditingController();
+  TextEditingController _phoneController = TextEditingController();
+  TextEditingController _detailController = TextEditingController();
+
+  @override
+  void initState() {
+    super.initState();
+
+    if(widget.data != null) {
+      _isAdd = false;
+      _address = widget.data;
+    }
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      backgroundColor: DColors.back,
+      appBar: DAppBar(_isAdd ? "添加收货地址" : "编辑收货地址",
+        actions: _isAdd ? null : [
+          InkWell(
+            onTap: _delClick,
+            highlightColor: Colors.transparent,
+            child: Container(
+              margin: EdgeInsets.only(right: 12.px),
+              alignment: Alignment.center,
+              child: Text("删除地址"),
+            ),
+          )
+        ]),
+      body: SafeArea(
+        child: Container(
+          margin: EdgeInsets.all(12.px),
+          child: ListView(
+            physics: ClampingScrollPhysics(),
+            children: [
+              _buildName(),
+              Divider(),
+              _buildPhone(),
+              Divider(),
+              _buildAddress(),
+              Divider(),
+              _buildDetail(),
+              Divider(),
+              _buildDefault(),
+              Divider(),
+              FlatButton(
+                color: DColors.Main,
+                shape: StadiumBorder(),
+                child: Text("立即保存", style: TextStyle(color: Colors.white)),
+                onPressed: _saveClick,
+              )
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+
+  _delClick() {
+    Utils.loading();
+    Network.inst.delAddress(_address.id).then((res) {
+      Utils.closeLoading();
+      Provider.of<AddressModel>(context, listen: false)
+          .delete(_address.id);
+      BotToast.showText(text: "删除成功");
+      Navigator.pop(context);
+    }).catchError((err) {
+      Utils.closeLoading();
+      Log.e(err);
+    });
+  }
+
+  _saveClick () {
+    _address.id = widget.data?.id;
+    // _address.is_default = _default ? 1 : 0;
+    _address.real_name = _nameController.text;
+    _address.phone = _phoneController.text;
+    _address.detail = _detailController.text;
+    // var areas = _area.split(" ");
+    // _address.province = areas[0];
+    // _address.city = areas[1];
+    // _address.district = areas[2];
+
+    Utils.loading();
+    Network.inst.editAddress(_address).then((value) {
+      Utils.closeLoading();
+      if(value["id"] != null) {
+        _address.id = num.parse(value["id"].toString());
+      }
+      Provider.of<AddressModel>(context, listen: false)
+          .update(_address.id, _address);
+      BotToast.showText(text: "保存成功");
+      Navigator.pop(context);
+    }).catchError((err, stack) {
+      Log.e(err.toString() + stack.toString());
+    });
+  }
+
+  Widget _buildName() {
+    if(_address.real_name != null) {
+      _nameController.text = _address.real_name;
+    }
+
+    return Container(
+        height: 38.px,
+        child: Row(
+          children: [
+            Container(
+              width: 64.px,
+              child: Text("收货人"),
+            ),
+            Expanded(child: TextField(
+              controller: _nameController,
+              style: TextStyle(fontSize: 13.px),
+              decoration: InputDecoration(
+                border: InputBorder.none,
+                hintText: "收货人"
+              ),
+            ))
+          ],
+        ));
+  }
+
+  Widget _buildPhone() {
+    if(_address.phone != null) {
+      _phoneController.text = _address.phone;
+    }
+
+    return Container(
+        height: 38.px,
+        child: Row(
+          children: [
+            Container(
+              width: 64.px,
+              child: Text("联系电话"),
+            ),
+            Expanded(child: TextField(
+              controller: _phoneController,
+              style: TextStyle(fontSize: 13.px),
+              keyboardType: TextInputType.phone,
+              decoration: InputDecoration(
+                border: InputBorder.none,
+                hintText: "联系电话"
+              ),
+            ))
+          ],
+        ));
+  }
+
+  Widget _buildAddress() {
+    var _area = _address.province == null ? "所在区域" :
+      "${_address.province} ${_address.city} ${_address.district}";
+
+    return Container(
+        height: 38.px,
+        child: Row(
+          children: [
+            Container(
+              width: 64.px,
+              child: Text("所在区域"),
+            ),
+            Expanded(child: InkWell(
+              highlightColor: Colors.transparent,
+              onTap: _choiceAddressDialog,
+              child: Text(_area, style: TextStyle(color: _address.province ==
+                  null ? Colors.grey : Colors.black)),
+            )),
+            Icon(Icons.chevron_right, color: Colors.grey)
+          ],
+        ));
+  }
+
+  void _choiceAddressDialog() {
+    FocusScope.of(context).requestFocus(new FocusNode());
+    showModalBottomSheet(
+        context: context,
+        shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(
+            topLeft: Radius.circular(45.px), topRight: Radius.circular(12.px)
+        )),
+        builder: (BuildContext context) {
+          return AddressSelecter(
+              onSelected: (province, city, county, code) {
+                _address.province = province;
+                _address.city = city;
+                _address.district = county;
+                _address.city_id = code;
+                setState(() {});
+              },
+              title: '选择地址',
+              selectedColor: Colors.red,
+              unselectedColor: Colors.black);
+        }
+    );
+  }
+
+  Widget _buildDetail() {
+    if(_address.detail != null) {
+      _detailController.text = _address.detail;
+    }
+
+    return Container(
+        height: 64.px,
+        child: Row(
+          children: [
+            Container(
+              width: 64.px,
+              alignment: Alignment.topLeft,
+              margin: EdgeInsets.only(top: 6.px),
+              child: Text("详细地址"),
+            ),
+            Expanded(child: TextField(
+              maxLines: 2,
+              style: TextStyle(fontSize: 13.px),
+              controller: _detailController,
+              decoration: InputDecoration(
+                border: InputBorder.none,
+                hintText: "详细地址:如道路、门牌号、小区、楼栋号、单元室等",
+              ),
+            ))
+          ],
+        ));
+  }
+
+  Widget _buildDefault() {
+    return Container(
+        height: 38.px,
+        child: Row(
+          children: [
+            Expanded(child: Text("设为默认收货地址")),
+            Container(
+              margin: EdgeInsets.only(right: 6.px),
+              child: CircleCheckBox((value) {
+                setState(() {
+                  _address.is_default = value ? 1 : 0;
+                });
+              }, initValue: _address.is_default == 1),
+            )
+          ],
+        ));
+  }
+}

+ 116 - 0
lib/pages/address/address_list.dart

@@ -0,0 +1,116 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+
+import 'package:twong/api/index.dart';
+import 'package:twong/router/base.dart';
+import 'package:twong/utils/index.dart';
+import 'package:twong/config/style.dart';
+import 'package:twong/models/index.dart';
+import 'package:twong/widgets/address_item.dart';
+import 'package:twong/widgets/app_bar.dart';
+import 'package:twong/providers/address.dart';
+
+class AddressPage extends StatefulWidget {
+  @override
+  State<StatefulWidget> createState() {
+    return _AddressPageState();
+  }
+}
+
+class _AddressPageState extends State<AddressPage> {
+
+  @override
+  void initState() {
+    super.initState();
+    loadData();
+  }
+
+  void loadData() {
+    Network.inst.getAddressList().then((value){
+      Log.d(value);
+      Provider.of<AddressModel>(context, listen: false).set(value);
+    });
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: DAppBar("地址管理", actions: [
+        InkWell(
+          onTap: _newAddress,
+          highlightColor: Colors.transparent,
+          child: Container(
+            margin: EdgeInsets.only(right: 12.px),
+            alignment: Alignment.center,
+            child: Text("添加新地址"),
+          ),
+        )
+      ]),
+      body: SafeArea(
+        child: Container(
+          color: DColors.back,
+          child: Consumer<AddressModel>(
+            builder: (context, model, child) => _buildAddressList(model.list),
+          ),
+        ),
+      ),
+      bottomNavigationBar: SafeArea(
+        child: Container(
+          height: 50.px,
+          decoration: BoxDecoration(
+            color: Colors.white,
+            boxShadow: DShadow.top,
+          ),
+          padding: EdgeInsets.only(top: 6.px, bottom: 12.px),
+          child: InkWell(
+            onTap: _newAddress,
+            child: Container(
+              decoration: BoxDecoration(
+                color: DColors.Main,
+                borderRadius: BorderRadius.circular(45.px),
+              ),
+              alignment: Alignment.center,
+              margin: EdgeInsets.only(left: 22.px, right: 22.px),
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: [
+                  Icon(Icons.room_outlined, color: Colors.white),
+                  Text("新建收货地址", style: TextStyle(color: Colors.white))
+                ],
+              ),
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+
+  Widget _buildAddressList(List<Address> list) {
+    if(list == null) {
+      return Center(child: Utils.loadingWidget);
+    }
+
+    List<Widget> widgets = List<Widget>();
+    for(var item in list) {
+      widgets.add(Container(
+        decoration: BoxDecoration(
+          color: Colors.white,
+          borderRadius: BorderRadius.circular(6.px)
+        ),
+        width: double.infinity,
+        padding: EdgeInsets.all(6.px),
+        margin: EdgeInsets.only(left: 12.px, right: 12.px,
+            top: 6.px, bottom: 6.px),
+        child: AddressItem(item),
+      ));
+    }
+    return ListView(
+      physics: ClampingScrollPhysics(),
+      children: widgets,
+    );
+  }
+
+  _newAddress() {
+    Navigator.pushNamed(context, RouteNames.editAddress);
+  }
+}

+ 0 - 81
lib/pages/address/editAddress.dart

@@ -1,81 +0,0 @@
-
-import 'package:flutter/material.dart';
-import 'package:twong/config/style.dart';
-import 'package:twong/models/address.dart';
-
-import 'package:twong/utils/index.dart';
-import 'package:twong/widgets/address_selecter.dart';
-import 'package:twong/widgets/app_bar.dart';
-
-class EditAddressPage extends StatefulWidget {
-  final dynamic data;
-
-  EditAddressPage(this.data);
-
-  @override
-  State<StatefulWidget> createState() {
-    return _EditAddressPageState();
-  }
-}
-
-class _EditAddressPageState extends State<EditAddressPage> {
-  Address _address = Address();
-
-  @override
-  Widget build(BuildContext context) {
-    return Scaffold(
-      appBar: DAppBar(widget.data == null ? "添加收货地址" : "编辑收货地址"),
-      body: SafeArea(
-        child: Container(
-          margin: EdgeInsets.all(12.px),
-          child: ListView(
-            children: [
-              Container(child: Row(
-                children: [
-                  Text("姓名"),
-                ],
-              )),
-              Divider(),
-              Text("联系电话"),
-              Divider(),
-              Text("所在区域"),
-              Divider(),
-              Text("详细地址"),
-              Divider(),
-              FlatButton(
-                color: DColors.Main,
-                shape: StadiumBorder(),
-                child: Text("立即保存", style: TextStyle(color: Colors.white)),
-                onPressed: () {
-                  Navigator.pop(context, _address);
-                },
-              )
-            ],
-          ),
-        ),
-      ),
-    );
-  }
-
-  void _choiceAddressDialog() async {
-    showModalBottomSheet(
-        context: context,
-        shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(
-            topLeft: Radius.circular(10.px), topRight: Radius.circular(10.px)
-        )),
-        builder: (BuildContext context) {
-          return AddressSelecter(
-              onSelected: (province, city, county) {
-                print('$province-$city-$county');
-                _address.province = province;
-                _address.city = city;
-                _address.district = county;
-                // _address = '$province-$city-$county';
-                setState(() {});
-              },
-              title: '选择地址',
-              selectedColor: Colors.red,
-              unselectedColor: Colors.black);
-        });
-  }
-}

+ 343 - 98
lib/pages/login/login.dart

@@ -1,14 +1,15 @@
 
+import 'dart:async';
+
 import 'package:flutter/material.dart';
 import 'package:bot_toast/bot_toast.dart';
+
 import 'package:twong/api/index.dart';
+import 'package:twong/config/protocols.dart';
 import 'package:twong/config/style.dart';
-import 'package:twong/providers/user_model.dart';
-
-import 'package:twong/router/index.dart';
+import 'package:twong/router/base.dart';
 import 'package:twong/utils/index.dart';
-import 'package:twong/config/protocols.dart';
-import 'package:provider/provider.dart';
+import 'package:twong/widgets/counter_botton.dart';
 
 class LoginPage extends StatefulWidget {
   @override
@@ -18,11 +19,20 @@ class LoginPage extends StatefulWidget {
 }
 
 class _LoginPageState extends State<LoginPage> {
-  bool read = false;
-  FocusNode _accountNode = new FocusNode();
-  FocusNode _passwordNode = new FocusNode();
+  var _enable = true;
+  final _max = 60;
+  var _counter;
+  Timer _timer;
+  var _codeTxt = "获取验证码";
+  FocusNode _codeNode = FocusNode();
+  FocusNode _accountNode = FocusNode();
+  FocusNode _passwordNode = FocusNode();
+  FocusNode _rePasswordNode = FocusNode();
+  PageController _pageController = PageController();
+  TextEditingController _codeCtl = TextEditingController();
   TextEditingController _accountCtl = TextEditingController();
   TextEditingController _passwordCtl = TextEditingController();
+  TextEditingController _rePasswordCtl = TextEditingController();
 
   _onLogin(String value) {
     var account = _accountCtl.text;
@@ -41,6 +51,23 @@ class _LoginPageState extends State<LoginPage> {
     });
   }
 
+  bool _onGetCode() {
+    if(_accountCtl.text.trim() == "") {
+      BotToast.showText(text: "手机号不能为空");
+      return false;
+    }
+
+    return true;
+  }
+
+  _onSmsLogin(String value) {
+
+  }
+
+  _onRegister(String value) {
+
+  }
+
   _onNextInput(String value) {
     FocusScope.of(context).requestFocus(_passwordNode);
   }
@@ -52,40 +79,46 @@ class _LoginPageState extends State<LoginPage> {
   Widget _buildInput(String hit, FocusNode node, TextEditingController controller,
       TextInputAction action, Function(String) onSubmit, IconData icon,
       {bool password = false, TextInputType type}) {
-    return Container(
-        padding: EdgeInsets.only(left: 30, right: 30, top: 10.px),
-        child: TextField(
-          focusNode: node,
-          obscureText: password,
-          onSubmitted: onSubmit,
-          controller: controller,
-          keyboardType: type,
-          style: TextStyle(color: Colors.white),
-          textInputAction: action,
-          decoration: InputDecoration(
-            filled: true,
-            hintText: hit,
-            border: InputBorder.none,
-            hintStyle: TextStyle(color: Colors.white70),
-            enabledBorder: OutlineInputBorder(
-              borderSide: BorderSide(color: Color(0x00FF00a0)),
-              borderRadius: BorderRadius.all(
-                Radius.circular(100),
-              ),
-            ),
-            focusedBorder: OutlineInputBorder(
-              borderSide: BorderSide(color: Color(0x000000a0)),
-              borderRadius: BorderRadius.all(
-                Radius.circular(100),
-              ),
-            ),
-            contentPadding: EdgeInsets.all(10.px),
-            prefixIcon: Icon(icon, color: Colors.white),
+    return TextField(
+      focusNode: node,
+      obscureText: password,
+      onSubmitted: onSubmit,
+      controller: controller,
+      keyboardType: type,
+      style: TextStyle(color: Colors.white),
+      textInputAction: action,
+      cursorColor: Colors.white,
+      decoration: InputDecoration(
+        filled: true,
+        hintText: hit,
+        border: InputBorder.none,
+        hintStyle: TextStyle(color: Colors.white70),
+        enabledBorder: OutlineInputBorder(
+          borderSide: BorderSide(color: Color(0x00FF00a0)),
+          borderRadius: BorderRadius.all(
+            Radius.circular(100),
           ),
-        )
+        ),
+        focusedBorder: OutlineInputBorder(
+          borderSide: BorderSide(color: Color(0x000000a0)),
+          borderRadius: BorderRadius.all(
+            Radius.circular(100),
+          ),
+        ),
+        contentPadding: EdgeInsets.all(10.px),
+        prefixIcon: Icon(icon, color: Colors.white),
+      ),
     );
   }
 
+  @override
+  void dispose() {
+    super.dispose();
+    if(_timer != null) {
+      _timer.cancel();
+    }
+  }
+
   @override
   Widget build(BuildContext context) {
     return Scaffold(
@@ -96,73 +129,285 @@ class _LoginPageState extends State<LoginPage> {
               image: AssetImage('assets/images/launcher.png'),
             )
         ),
-        child: ListView(
-          physics: ClampingScrollPhysics(),
-          children: <Widget>[
-            Container(
-              alignment: Alignment.topRight,
-              child: FlatButton(
-                highlightColor: Colors.transparent,
-                child: Text('跳过,看好货 >',
-                  style: TextStyle(color: Colors.white)
+        child: SafeArea(
+          child: Column(
+            children: <Widget>[
+              Container(
+                alignment: Alignment.topRight,
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('跳过,看好货 >',
+                        style: TextStyle(color: Colors.white)
+                    ),
+                    onPressed: () {
+                      Navigator.pop(context);
+                    }
                 ),
-                onPressed: () { Navigator.pop(context); }
               ),
-            ),
-            Container(
-              height: 100.px,
-              margin: EdgeInsets.only(bottom: 50.px, top: 10.px),
-              child: Center(
-                child: Image.asset("assets/images/logo.png"),
+              Container(
+                height: 100.px,
+                margin: EdgeInsets.only(bottom: 50.px, top: 10.px),
+                child: Center(
+                  child: Image.asset("assets/images/logo.png"),
+                ),
               ),
-            ),
-            _buildInput("请输入您的账号", _accountNode, _accountCtl,
-                TextInputAction.next,_onNextInput, Icons.account_circle,
-                type: TextInputType.phone),
-            _buildInput("请输入您的密码", _passwordNode, _passwordCtl,
-                TextInputAction.done, _onLogin, Icons.lock, password: true,
-                type: TextInputType.text),
-            Container(
-              height: 50.px,
-              margin: EdgeInsets.only(left: 56.px, right: 56.px),
-              padding: EdgeInsets.only(top: 12.px),
-              child: FlatButton(
-                color: Colors.white,
-                shape: StadiumBorder(),
-                onPressed: () { _onLogin(_accountCtl.text); },
-                child: Text('登 陆', style: TextStyle(fontSize: 16.px)),
+              Container(
+                height: 368.px,
+                margin: EdgeInsets.only(left: 12.px, right: 12.px),
+                child: PageView(
+                  controller: _pageController,
+                  physics: NeverScrollableScrollPhysics(),
+                  children: [
+                    _buildLogin(),
+                    _buildRegister(),
+                    _buildSMSLogin()
+                  ],
+                ),
               ),
-            ),
-            Container(
-              padding: EdgeInsets.only(right: 20.px, bottom: 20.px),
-              alignment: Alignment.topRight,
-              child: FlatButton(
-                  highlightColor: Colors.transparent,
-                  child: Text('遇到问题?', style: TextStyle(color: Colors.white)),
-                  onPressed: () {}),
-            ),
-            Center(
-              child: Text('其他登录方式', style: TextStyle(color: Colors.white)),
-            ),
-            Container(
-              padding: EdgeInsets.only(top: 30),
-              child: Flex(
-                direction: Axis.horizontal,
-                children: <Widget>[
-                  Expanded(child: Container(
-                      width: 46,
-                      height: 46,
-                      child: InkWell(
-                        onTap: () => wechatLogin(),
-                        child: Image.asset("assets/images/wechat.png"),
-                      )
-                  )),
-                ],
+              Expanded(child: _buildOtherLogin()),
+              _buildBottom()
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+
+  Widget _buildLogin() {
+    return Column(
+      children: [
+        Container(
+          margin: EdgeInsets.only(bottom: 12.px),
+          child: _buildInput("请输入您的手机号", _accountNode, _accountCtl,
+              TextInputAction.next,_onNextInput, Icons.account_circle,
+              type: TextInputType.phone),
+        ),
+        _buildInput("请输入您的密码", _passwordNode, _passwordCtl,
+            TextInputAction.done, _onLogin, Icons.lock, password: true,
+            type: TextInputType.text),
+        Container(
+          height: 50.px,
+          width: double.infinity,
+          margin: EdgeInsets.only(left: 56.px, right: 56.px),
+          padding: EdgeInsets.only(top: 12.px),
+          child: FlatButton(
+            color: Colors.white,
+            shape: StadiumBorder(),
+            onPressed: () { _onLogin(_accountCtl.text); },
+            child: Text('登 陆', style: TextStyle(fontSize: 16.px)),
+          ),
+        ),
+        Container(
+          margin: EdgeInsets.only(bottom: 22.px),
+          child: Row(
+            children: [
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('验证码登陆', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(2); }),
               ),
-            )
+              Spacer(),
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('没有账号?去注册', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(1); }),
+              ),
+            ],
+          ),
+        ),
+      ],
+    );
+  }
+
+  Widget _buildRegister() {
+    return Column(
+      children: [
+        Container(
+          margin: EdgeInsets.only(bottom: 12.px),
+          child: _buildInput("请输入您的手机号", _accountNode, _accountCtl,
+              TextInputAction.next,_onNextInput, Icons.account_circle,
+              type: TextInputType.phone),
+        ),
+        Row(
+          children: [
+            Expanded(child: Container(
+              margin: EdgeInsets.only(right: 12.px, bottom: 12.px),
+              child: _buildInput("请输入短信验证码", _codeNode, _codeCtl,
+                  TextInputAction.done, _onNextInput, Icons.sms,
+                  type: TextInputType.number),
+            )),
+            CounterButton(onClick: _onGetCode)
           ],
         ),
-      ),
+        Container(
+          margin: EdgeInsets.only(bottom: 12.px),
+          child: _buildInput("请输入您的密码", _passwordNode, _passwordCtl,
+              TextInputAction.done, _onLogin, Icons.lock, password: true,
+              type: TextInputType.text),
+        ),
+        _buildInput("请再次输入您的密码", _rePasswordNode, _rePasswordCtl,
+            TextInputAction.done, _onLogin, Icons.lock_outline, password: true,
+            type: TextInputType.text),
+        Container(
+          height: 50.px,
+          width: double.infinity,
+          margin: EdgeInsets.only(left: 56.px, right: 56.px),
+          padding: EdgeInsets.only(top: 12.px),
+          child: FlatButton(
+            color: Colors.white,
+            shape: StadiumBorder(),
+            onPressed: () { _onRegister(_accountCtl.text); },
+            child: Text('注 册', style: TextStyle(fontSize: 16.px)),
+          ),
+        ),
+        Container(
+          margin: EdgeInsets.only(bottom: 22.px),
+          child: Row(
+            children: [
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('验证码登陆', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(2); }),
+              ),
+              Spacer(),
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('已有账号?去登陆', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(0); }),
+              ),
+            ],
+          ),
+        ),
+      ],
     );
   }
+
+  Widget _buildSMSLogin() {
+    return Column(
+      children: [
+        Container(
+          margin: EdgeInsets.only(bottom: 12.px),
+          child: _buildInput("请输入您的手机号", _accountNode, _accountCtl,
+              TextInputAction.next,_onNextInput, Icons.account_circle,
+              type: TextInputType.phone),
+        ),
+        Row(
+          children: [
+            Expanded(child: Container(
+              margin: EdgeInsets.only(right: 12.px, bottom: 12.px),
+              child: _buildInput("请输入短信验证码", _codeNode, _codeCtl,
+                  TextInputAction.done, _onLogin, Icons.sms,
+                  type: TextInputType.number),
+            )),
+            CounterButton(onClick: _onGetCode)
+          ],
+        ),
+        Container(
+          height: 50.px,
+          width: double.infinity,
+          margin: EdgeInsets.only(left: 56.px, right: 56.px),
+          padding: EdgeInsets.only(top: 12.px),
+          child: FlatButton(
+            color: Colors.white,
+            shape: StadiumBorder(),
+            onPressed: () { _onSmsLogin(_accountCtl.text); },
+            child: Text('登 陆', style: TextStyle(fontSize: 16.px)),
+          ),
+        ),
+        Container(
+          margin: EdgeInsets.only(bottom: 22.px),
+          child: Row(
+            children: [
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('账号密码登陆', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(0); }),
+              ),
+              Spacer(),
+              Container(
+                child: FlatButton(
+                    highlightColor: Colors.transparent,
+                    child: Text('没有账号?去注册', style: TextStyle(color:
+                    Colors.white, decoration: TextDecoration.underline)),
+                    onPressed: () { _jumpTo(1); }),
+              ),
+            ],
+          ),
+        ),
+      ],
+    );
+  }
+
+  void _jumpTo(int index) {
+    _pageController.animateToPage(index, curve: Curves.easeIn,
+        duration: Duration(milliseconds: 260));
+  }
+
+  Widget _buildOtherLogin() {
+    return Column(
+      children: [
+        Container(
+          child: Text('其他登录方式', style: TextStyle(color: Colors.white)),
+        ),
+        Container(
+          width: double.infinity,
+          padding: EdgeInsets.only(top: 30),
+          child: Row(
+            children: <Widget>[
+              Expanded(child: Container(
+                  width: 46,
+                  height: 46,
+                  child: InkWell(
+                    onTap: () => wechatLogin(),
+                    child: Image.asset("assets/images/wechat.png"),
+                  )
+              )),
+            ],
+          ),
+        )
+      ],
+    );
+  }
+
+  Widget _buildBottom() {
+    return
+      Container(
+        margin: EdgeInsets.only(bottom: 12.px),
+        alignment: Alignment.center,
+        child: Wrap(
+          children: [
+            Text("登陆即视为您以阅读并同意",
+                style: TextStyle(fontSize: 11.px, color: Colors.black54)),
+            InkWell(
+              onTap: () {
+                Navigator.pushNamed(context, RouteNames.protocol,
+                    arguments: ProtocolType.USER);
+              },
+              child: Text("《用户注册协议》",
+                  style: TextStyle(fontSize: 11.px, color: Colors.white)),
+            ),
+            Text("和",
+                style: TextStyle(fontSize: 11.px, color: Colors.black54)),
+            InkWell(
+              onTap: () {
+                Navigator.pushNamed(context, RouteNames.protocol,
+                    arguments: ProtocolType.PRIVATE);
+              },
+              child: Text("《美天旺会员隐私协议》",
+                  style: TextStyle(fontSize: 11.px, color: Colors.white)),
+            ),
+          ],
+        ),
+      );
+  }
 }

+ 3 - 4
lib/pages/login/protocol.dart

@@ -1,8 +1,7 @@
 
 import 'package:flutter/material.dart';
-import 'package:twong/config/protocols.dart';
-import 'package:twong/config/style.dart';
 import 'package:twong/widgets/app_bar.dart';
+import 'package:twong/config/protocols.dart';
 
 class ProtocolPage extends StatefulWidget {
   final ProtocolType type;
@@ -23,9 +22,9 @@ class _ProtocolPageState extends State<ProtocolPage> {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      appBar: DAppBar("用户协议"),
+      appBar: DAppBar(Protocols.getTitle(type)),
       body: Container(
-        child: Text(Protocols.getType(type)),
+        child: Center(child: Text(Protocols.getType(type))),
       ),
     );
   }

+ 0 - 1
lib/pages/login/register.dart

@@ -6,7 +6,6 @@ import 'package:flutter/rendering.dart';
 import 'package:twong/router/index.dart';
 import 'package:twong/utils/index.dart';
 import 'package:twong/config/protocols.dart';
-import 'package:twong/widgets/round_check_box.dart';
 
 class RegisterPage extends StatefulWidget {
   @override

+ 99 - 0
lib/pages/order/order_comment.dart

@@ -0,0 +1,99 @@
+
+import 'package:flutter/material.dart';
+import 'package:twong/config/style.dart';
+
+import 'package:twong/utils/index.dart';
+import 'package:twong/models/index.dart';
+import 'package:twong/widgets/app_bar.dart';
+import 'package:twong/widgets/cart_item.dart';
+import 'package:twong/widgets/rank_stars.dart';
+
+class OrderCommentPage extends StatefulWidget {
+  final CartInfo info;
+  OrderCommentPage(this.info);
+
+  @override
+  State<StatefulWidget> createState() {
+    return _OrderCommentState();
+  }
+}
+
+class _OrderCommentState extends State<OrderCommentPage> {
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: DAppBar("商品评价"),
+      backgroundColor: DColors.back,
+      body: Container(
+        margin: EdgeInsets.only(left: 12.px, right: 12.px),
+        child: ListView(
+          physics: ClampingScrollPhysics(),
+          children: [
+            Container(
+              child: CartItem(widget.info),
+              padding: EdgeInsets.all(6.px),
+              margin: EdgeInsets.only(top: 6.px),
+              decoration: BoxDecoration(
+                color: Colors.white,
+                borderRadius: BorderRadius.circular(6.px)
+              ),
+            ),
+            Divider(),
+            Container(
+              padding: EdgeInsets.all(6.px),
+              decoration: BoxDecoration(
+                  color: Colors.white,
+                  borderRadius: BorderRadius.circular(6.px)
+              ),
+              child: Column(
+                children: [
+                  RankStars(5, value: 5, color: DColors.Main, header: Text("商品质量:")),
+                  RankStars(5, color: DColors.Main, header: Text("服务态度:")),
+                  TextField(
+                    maxLines: 3,
+                    style: TextStyle(fontSize: 12.px),
+                    decoration: InputDecoration(
+                      border: InputBorder.none,
+                      hintText: "说说您的想法,分享给大家吧~",
+                      enabledBorder: OutlineInputBorder(
+                        borderSide: BorderSide(color: Color(0x00FF00a0)),
+                        borderRadius: BorderRadius.all(
+                          Radius.circular(100),
+                        ),
+                      ),
+                      focusedBorder: OutlineInputBorder(
+                        borderSide: BorderSide(color: Color(0x000000a0)),
+                        borderRadius: BorderRadius.all(
+                          Radius.circular(100),
+                        ),
+                      ),
+                    ),
+                  ),
+                  Stack(
+                    children: [
+                      Container(
+                        height: 32.px,
+                        child: Center(child: Text("上传图片")),
+                      )
+                    ],
+                  ),
+                  Container(
+                    margin: EdgeInsets.only(left: 12.px, right: 12.px),
+                    width: double.infinity,
+                    child: FlatButton(
+                      onPressed: () {},
+                      color: DColors.Main,
+                      textColor: Colors.white,
+                      shape: StadiumBorder(),
+                      child: Text("立即评价"),
+                    ),
+                  )
+                ],
+              ),
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}

部分文件因为文件数量过多而无法显示