Selaa lähdekoodia

更新ios环境

tags/0.0.1
Weller 4 vuotta sitten
vanhempi
commit
672f99eca2
63 muutettua tiedostoa jossa 491 lisäystä ja 183 poistoa
  1. +1
    -1
      .dart_tool/package_config.json
  2. +0
    -13
      .idea/saveactions_settings.xml
  3. +56
    -4
      example/ios/Runner.xcodeproj/project.pbxproj
  4. BIN
     
  5. BIN
     
  6. BIN
     
  7. BIN
     
  8. BIN
     
  9. BIN
     
  10. BIN
     
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. BIN
     
  16. BIN
     
  17. BIN
     
  18. BIN
     
  19. +0
    -23
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  20. BIN
     
  21. BIN
     
  22. BIN
     
  23. +0
    -5
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  24. +148
    -0
      example/ios/Runner/Info.plist
  25. BIN
     
  26. BIN
     
  27. BIN
     
  28. BIN
     
  29. BIN
     
  30. BIN
     
  31. +20
    -20
      example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json
  32. BIN
     
  33. BIN
     
  34. BIN
     
  35. BIN
     
  36. BIN
     
  37. BIN
     
  38. BIN
     
  39. BIN
     
  40. BIN
     
  41. BIN
     
  42. BIN
     
  43. BIN
     
  44. BIN
     
  45. BIN
     
  46. BIN
     
  47. BIN
     
  48. BIN
     
  49. BIN
     
  50. +6
    -0
      example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/Contents.json
  51. BIN
     
  52. BIN
     
  53. BIN
     
  54. BIN
     
  55. BIN
     
  56. +71
    -0
      example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/LaunchImage.launchimage/Contents.json
  57. +9
    -1
      example/lib/main.dart
  58. +42
    -41
      lib/pages/goods_details_page/goods_details_page.dart
  59. +4
    -4
      lib/pages/setting_page/setting_page.dart
  60. +24
    -29
      lib/pages/webview/base_webview.dart
  61. +105
    -41
      lib/widgets/goods_details/footer/goods_details_footer_widget.dart
  62. +3
    -0
      lib/widgets/home/home_goods/models/home_goods_style_model.dart
  63. +2
    -1
      lib/widgets/home/home_goods/models/home_goods_style_model.g.dart

+ 1
- 1
.dart_tool/package_config.json Näytä tiedosto

@@ -788,7 +788,7 @@
"languageVersion": "2.1"
}
],
"generated": "2020-09-22T09:35:21.193093Z",
"generated": "2020-09-22T12:40:39.852808Z",
"generator": "pub",
"generatorVersion": "2.7.2"
}

+ 0
- 13
.idea/saveactions_settings.xml Näytä tiedosto

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SaveActionSettings">
<option name="actions">
<set>
<option value="activate" />
<option value="organizeImports" />
<option value="reformat" />
</set>
</option>
<option name="configurationPath" value="" />
</component>
</project>

+ 56
- 4
example/ios/Runner.xcodeproj/project.pbxproj Näytä tiedosto

@@ -17,8 +17,13 @@
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
9FFCE301251ADE0600F4F353 /* yw_1222_baichuan.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */; };
9FFCE303251ADE0600F4F353 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FB251ADE0600F4F353 /* 1.png */; };
9FFCE304251ADE0600F4F353 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FC251ADE0600F4F353 /* 2.png */; };
9FFCE305251ADE0600F4F353 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FD251ADE0600F4F353 /* 3.png */; };
9FFCE306251ADE0600F4F353 /* 4.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FE251ADE0600F4F353 /* 4.png */; };
9FFCE307251ADE0600F4F353 /* 智莺生活.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FF251ADE0600F4F353 /* 智莺生活.xcassets */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
@@ -52,9 +57,14 @@
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yw_1222_baichuan.jpg; sourceTree = "<group>"; };
9FFCE2FB251ADE0600F4F353 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = "<group>"; };
9FFCE2FC251ADE0600F4F353 /* 2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 2.png; sourceTree = "<group>"; };
9FFCE2FD251ADE0600F4F353 /* 3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 3.png; sourceTree = "<group>"; };
9FFCE2FE251ADE0600F4F353 /* 4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 4.png; sourceTree = "<group>"; };
9FFCE2FF251ADE0600F4F353 /* 智莺生活.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "智莺生活.xcassets"; sourceTree = "<group>"; };
A860D105A09AEA74261219D2 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
E03B6CB558D0A26B049E0718 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -118,10 +128,10 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
9FFCE2F3251ADE0600F4F353 /* 项目资源 */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
@@ -139,6 +149,43 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9FFCE2F3251ADE0600F4F353 /* 项目资源 */ = {
isa = PBXGroup;
children = (
9FFCE2F4251ADE0600F4F353 /* 智莺生活 */,
);
path = "项目资源";
sourceTree = "<group>";
};
9FFCE2F4251ADE0600F4F353 /* 智莺生活 */ = {
isa = PBXGroup;
children = (
9FFCE2F5251ADE0600F4F353 /* config */,
9FFCE2FA251ADE0600F4F353 /* image */,
);
path = "智莺生活";
sourceTree = "<group>";
};
9FFCE2F5251ADE0600F4F353 /* config */ = {
isa = PBXGroup;
children = (
9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */,
);
path = config;
sourceTree = "<group>";
};
9FFCE2FA251ADE0600F4F353 /* image */ = {
isa = PBXGroup;
children = (
9FFCE2FB251ADE0600F4F353 /* 1.png */,
9FFCE2FC251ADE0600F4F353 /* 2.png */,
9FFCE2FD251ADE0600F4F353 /* 3.png */,
9FFCE2FE251ADE0600F4F353 /* 4.png */,
9FFCE2FF251ADE0600F4F353 /* 智莺生活.xcassets */,
);
path = image;
sourceTree = "<group>";
};
EE1370F94952C6405CCA440D /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -212,9 +259,14 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9FFCE306251ADE0600F4F353 /* 4.png in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
9FFCE303251ADE0600F4F353 /* 1.png in Resources */,
9FFCE301251ADE0600F4F353 /* yw_1222_baichuan.jpg in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
9FFCE305251ADE0600F4F353 /* 3.png in Resources */,
9FFCE307251ADE0600F4F353 /* 智莺生活.xcassets in Resources */,
9FFCE304251ADE0600F4F353 /* 2.png in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

















+ 0
- 23
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json Näytä tiedosto

@@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}




+ 0
- 5
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md Näytä tiedosto

@@ -1,5 +0,0 @@
# Launch Screen Assets

You can customize the launch screen with your own desired assets by replacing the image files in this directory.

You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.

+ 148
- 0
example/ios/Runner/Info.plist Näytä tiedosto

@@ -64,5 +64,153 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>WBkey</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wb</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>QQ10JZ</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tencent1111030588</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>WBSecret</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sina.</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>QQ16JZ</string>
<key>CFBundleURLSchemes</key>
<array>
<string>QQ4238fb3c</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>tb</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tbopen31333495</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>JD</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sdkback</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>otpauth</string>
<string>iosamap</string>
<string>baidumap</string>
<string>vipshop</string>
<string>jdlogin</string>
<string>openapp</string>
<string>openapp.jdmobile</string>
<string>pinduoduo</string>
<string>wechat</string>
<string>tbopen</string>
<string>tmall</string>
<string>taobao</string>
<string>weixin</string>
<string>weixinULAPI</string>
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>sinaweibosso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<string>weibosdk2</string>
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqqopensdkapiV4</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
<string>renrenios</string>
<string>renrenapi</string>
<string>renren</string>
<string>renreniphone</string>
<string>laiwangsso</string>
<string>yixin</string>
<string>yixinopenapi</string>
<string>instagram</string>
<string>whatsapp</string>
<string>line</string>
<string>fbapi</string>
<string>fb</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>alipays</string>
<string>alitrip</string>
<string>fleamarket</string>
<string>youku</string>
</array>
</dict>
</plist>







example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json → example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json Näytä tiedosto

@@ -3,115 +3,115 @@
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"filename" : "icon-20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"filename" : "icon-20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"filename" : "icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"filename" : "icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"filename" : "icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"filename" : "icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"filename" : "icon-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"filename" : "icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"filename" : "icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"filename" : "icon-20-ipad.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"filename" : "icon-20@2x-ipad.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"filename" : "icon-29-ipad.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"filename" : "icon-29@2x-ipad.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"filename" : "icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"filename" : "icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"filename" : "icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"filename" : "icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"filename" : "icon-83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"filename" : "icon-1024.png",
"scale" : "1x"
}
],
@@ -119,4 +119,4 @@
"version" : 1,
"author" : "xcode"
}
}
}



















+ 6
- 0
example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/Contents.json Näytä tiedosto

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}






+ 71
- 0
example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/LaunchImage.launchimage/Contents.json Näytä tiedosto

@@ -0,0 +1,71 @@
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "2436h",
"filename" : "1125x2436.png",
"minimum-system-version" : "11.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "1242x2208.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "750x1334.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "640x960.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "640x1136.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

+ 9
- 1
example/lib/main.dart Näytä tiedosto

@@ -4,6 +4,7 @@ import 'package:zhiying_base_widget/pages/home_page/home_page.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/register.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:flutter_alibc/flutter_alibc.dart';

void main() {
FlutterError.onError = (FlutterErrorDetails details) {
@@ -25,7 +26,11 @@ class _MyAppState extends State<MyApp> {
child: Text(
"走神了~\n${error.exceptionAsString()}",
style:
Theme.of(context).textTheme.title.copyWith(color: Colors.redAccent),
Theme
.of(context)
.textTheme
.title
.copyWith(color: Colors.redAccent),
),
);
}
@@ -35,6 +40,9 @@ class _MyAppState extends State<MyApp> {
super.initState();
print('初始化~~~~');
BaseWidgetRegister.init();
FlutterAlibc.initAlibc(version: "", appName: "").then((result) {
Logger.debug('${result.errorCode} ${result.errorMessage}');
});
}

@override


+ 42
- 41
lib/pages/goods_details_page/goods_details_page.dart Näytä tiedosto

@@ -1,13 +1,14 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/bloc/goods_details_page_bloc.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/bloc/goods_details_page_repository.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/notifier/goods_details_page_notifier.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:provider/provider.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'dart:ui';

class GoodsDetailsPage extends StatefulWidget {
final Map<String, dynamic> data;
@@ -24,19 +25,19 @@ class _GoodsDetailsPageState extends State<GoodsDetailsPage> {
print("parent data = ${widget.data}");
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: HexColor.fromHex('#FFF1F1F1'),
body: MultiProvider(
providers: [
/// 滑动通知
ChangeNotifierProvider.value(value: GoodsDetailsPageNotifier()),
],
child: BlocProvider<GoodsDetailsPageBloc>(
create: (_) => GoodsDetailsPageBloc(repository: GoodsDetailsPageRepository())..add(GoodsDetailsPageInitEvent(model: widget?.data)),
child: GoodsDetailsContainer(widget?.data),
),
return MultiProvider(
providers: [
/// 滑动通知
ChangeNotifierProvider.value(value: GoodsDetailsPageNotifier()),
],
child: BlocProvider<GoodsDetailsPageBloc>(
create: (_) =>
GoodsDetailsPageBloc(repository: GoodsDetailsPageRepository())
..add(GoodsDetailsPageInitEvent(model: widget?.data)),
child: GoodsDetailsContainer(widget?.data),
),
);
}
@@ -54,7 +55,8 @@ class GoodsDetailsContainer extends StatefulWidget {
class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {
bool _isEnded = false;
ScrollController _controller = ScrollController();
RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController _refreshController =
RefreshController(initialRefresh: false);

void _onLoading() async {
// await Future.delayed(Duration(milliseconds: 1000));
@@ -79,11 +81,14 @@ class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {
void initState() {
_controller.addListener(() {
// print('${_controller.offset} ${_controller.position.maxScrollExtent}');
if (_controller.offset >= _controller.position.maxScrollExtent && !_isEnded) {
if (_controller.offset >= _controller.position.maxScrollExtent &&
!_isEnded) {
// 滑动到底部
_isEnded = true;
Provider.of<GoodsDetailsPageNotifier>(context, listen: false).loadMore();
} else if (_controller.offset < _controller.position.maxScrollExtent && _isEnded) {
Provider.of<GoodsDetailsPageNotifier>(context, listen: false)
.loadMore();
} else if (_controller.offset < _controller.position.maxScrollExtent &&
_isEnded) {
_isEnded = false;
Provider.of<GoodsDetailsPageNotifier>(context, listen: false).reset();
}
@@ -125,35 +130,30 @@ class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {

/// 主视图
Widget _getMainWidget(List<Map<String, dynamic>> datas) {
return Stack(
fit: StackFit.passthrough,
children: <Widget>[
/// 主体布局
SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: WaterDropHeader(),
controller: _refreshController,
onLoading: _onLoading,
child: CustomScrollView(
controller: _controller,
slivers: _createContent(context, datas ?? []),
),
),
/// appBar
Align(alignment: Alignment.topCenter, child: _getAppBarWidget()),
return Scaffold(
backgroundColor: Colors.white,
body: CustomScrollView(
controller: _controller,
slivers: _createContent(context, datas ?? []),
),

/// 底部
Align(alignment: Alignment.bottomCenter, child: GoodsDetailsFooterWidget(!EmptyUtil.isEmpty(datas) ? datas[ datas.length-1 ] : null))
],
/// appBar
// Align(alignment: Alignment.topCenter, child: _getAppBarWidget()),

/// 底部
bottomNavigationBar: GoodsDetailsFooterWidget(
!EmptyUtil.isEmpty(datas) ? datas[datas.length - 1] : null),
);
}

List<Widget> _createContent(BuildContext context, List<Map<String, dynamic>> datas) {
List<Widget> _createContent(
BuildContext context, List<Map<String, dynamic>> datas) {
List<Widget> list = List();

/// datas.length - 1 为最后一个在底部
for (int i = 0; i < datas.length - 1; i++) {
WidgetModel item = WidgetModel.fromJson(Map<String, dynamic>.from(datas[i]));
WidgetModel item =
WidgetModel.fromJson(Map<String, dynamic>.from(datas[i]));

print('item.modName ${item.modName}');
list.addAll(WidgetFactory.create(
@@ -180,7 +180,8 @@ class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {
return Container(
width: double.infinity,
height: 40,
margin: EdgeInsets.only(top: MediaQueryData.fromWindow(window).padding.top),
margin:
EdgeInsets.only(top: MediaQueryData.fromWindow(window).padding.top),
child: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,


+ 4
- 4
lib/pages/setting_page/setting_page.dart Näytä tiedosto

@@ -76,7 +76,7 @@ class _SettingContainerState extends State<_SettingContainer> {
style: BorderStyle.none,
),
),
backgroundColor: HexColor.fromHex(style?.appBarBgColor ?? 'ffffff'),
backgroundColor: HexColor.fromHex(style?.appBarBgColor ?? '#ffffff'),
leading: Navigator.canPop(context)
? GestureDetector(
child: Container(
@@ -97,7 +97,7 @@ class _SettingContainerState extends State<_SettingContainer> {
style?.appBarName ?? '设置',
style: TextStyle(
fontSize: 15,
color: HexColor.fromHex(style?.appBarNameColor ?? '333333'),
color: HexColor.fromHex(style?.appBarNameColor ?? '#333333'),
),
),
);
@@ -128,7 +128,7 @@ class _SettingContainerState extends State<_SettingContainer> {
item.name,
style: TextStyle(
fontSize: 13,
color: HexColor.fromHex(item.nameColor),
color: HexColor.fromHex(item?.nameColor ?? '#333333'),
fontWeight: FontWeight.bold,
),
),
@@ -139,7 +139,7 @@ class _SettingContainerState extends State<_SettingContainer> {
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 13,
color: HexColor.fromHex(item.descColor),
color: HexColor.fromHex(item?.descColor ?? '#333333'),
),
),
),


+ 24
- 29
lib/pages/webview/base_webview.dart Näytä tiedosto

@@ -1,15 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class BaseWebview extends StatefulWidget {
final Map<String, dynamic> model;

const BaseWebview(
this.model, {
Key key,
}) : super(key: key);
const BaseWebview(this.model, {Key key}) : super(key: key);

@override
_BaseWebviewState createState() => _BaseWebviewState();
@@ -30,29 +26,28 @@ class _BaseWebviewState extends State<BaseWebview> {
Widget build(BuildContext context) {
return Scaffold(
appBar: _createNav(),
body: Builder(builder: (BuildContext context) {
return WebView(
initialUrl: _url,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_webViewController = webViewController;
},
navigationDelegate: (NavigationRequest request) {
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
print('Page started loading: $url');
},
onPageFinished: (String url) {
print('Page finished loading: $url');
_webViewController.getTitle().then((title) {
_title = title;
setState(() {});
});
},
gestureNavigationEnabled: true,
);
}),
backgroundColor: Colors.white,
body: WebView(
initialUrl: _url,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_webViewController = webViewController;
},
navigationDelegate: (NavigationRequest request) {
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
print('Page started loading: $url');
},
onPageFinished: (String url) {
print('Page finished loading: $url');
_webViewController.getTitle().then((title) {
_title = title;
setState(() {});
});
},
gestureNavigationEnabled: true,
),
);
}

@@ -86,7 +81,7 @@ class _BaseWebviewState extends State<BaseWebview> {
_title ?? '',
style: TextStyle(
fontSize: 15,
color: HexColor.fromHex('333333'),
color: Color(0xff333333),
),
),
trailing: GestureDetector(


+ 105
- 41
lib/widgets/goods_details/footer/goods_details_footer_widget.dart Näytä tiedosto

@@ -1,11 +1,11 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_bloc.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_repository.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_sk.dart';
import 'package:zhiying_base_widget/widgets/goods_details/footer/model/goods_details_footer_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:cached_network_image/cached_network_image.dart';

///
/// 商品详情底部Widget
@@ -21,7 +21,9 @@ class GoodsDetailsFooterWidget extends StatelessWidget {
visible: !EmptyUtil.isEmpty(model),
replacement: GoodsDetailsFooterSkeleton(),
child: BlocProvider<GoodsDetailsFooterBloc>(
create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository())..add(GoodsDetailsFooterInitEvent(model: model)),
create: (_) =>
GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository())
..add(GoodsDetailsFooterInitEvent(model: model)),
child: GooddsDetailsFooterContainer(),
),
);
@@ -30,10 +32,12 @@ class GoodsDetailsFooterWidget extends StatelessWidget {

class GooddsDetailsFooterContainer extends StatefulWidget {
@override
_GooddsDetailsFooterContainerState createState() => _GooddsDetailsFooterContainerState();
_GooddsDetailsFooterContainerState createState() =>
_GooddsDetailsFooterContainerState();
}

class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContainer> {
class _GooddsDetailsFooterContainerState
extends State<GooddsDetailsFooterContainer> {
/// 打开首页
void _openHome() {}

@@ -67,18 +71,21 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
}

Widget _getMainWidget(GoodsDetailsFooterModel model) {
return Container(
height: 70,
width: double.infinity,
padding: const EdgeInsets.only(bottom: 10, top: 12.5, left: 21, right: 12.5),
decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0),
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0)),
// ],
color: Colors.white,
double height = MediaQuery.of(context).padding.bottom;
return SafeArea(
child: Container(
width: double.infinity,
padding: EdgeInsets.only(
bottom: (height > 10 ? 0 : 10), top: 10, left: 21, right: 12.5),
decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0),
// BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0)),
// ],
color: Colors.white,
),
child: Container(height: 44, child: _getMainWidet(model)),
),
child: _getMainWidet(model),
);
}

@@ -108,12 +115,18 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
onTap: () => _openHome(),
child: Padding(
padding: const EdgeInsets.only(right: 35),
child: _getCustomWidget(model?.home ?? '首页', model?.home_color ?? '999999', model?.home_icon ?? ''),
child: _getCustomWidget(model?.home ?? '首页',
model?.home_color ?? '999999', model?.home_icon ?? ''),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _collectOnClick(),
child: Padding(padding: const EdgeInsets.only(right: 0), child: _getCustomWidget(model?.collect ?? '收藏', model?.collect_color ?? '999999', model?.collect_icon ?? '')))
child: Padding(
padding: const EdgeInsets.only(right: 0),
child: _getCustomWidget(
model?.collect ?? '收藏',
model?.collect_color ?? '999999',
model?.collect_icon ?? '')))
],
);
}
@@ -123,7 +136,10 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
return Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[_getFxzButton(model), _getZgsButton(model)],
children: <Widget>[
_getFxzButton(model),
_getZgsButton(model),
],
);
}

@@ -133,18 +149,44 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
onTap: () => _shareOnClick(),
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5),
height: 44,
width: 110,
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5),
decoration: BoxDecoration(
gradient: LinearGradient(colors: [HexColor.fromHex(model?.share_earn_bg1_color ?? '#FFCA66'), HexColor.fromHex(model?.share_earn_bg2_color ?? '#FFD961')], begin: Alignment.centerLeft, end: Alignment.centerRight),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))),
gradient: LinearGradient(colors: [
HexColor.fromHex(model?.share_earn_bg1_color ?? '#FFCA66'),
HexColor.fromHex(model?.share_earn_bg2_color ?? '#FFD961')
], begin: Alignment.centerLeft, end: Alignment.centerRight),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25), topLeft: Radius.circular(25))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RichText(
text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.share_earn_val_color ?? 'FFFFFF')), children: [
TextSpan(text: model?.share_value ?? '0.0', style: TextStyle(fontSize: 15, color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), fontFamily: 'Din', package: 'zhiying_base_widget')),
]),
text: TextSpan(
text: '¥ ',
style: TextStyle(
fontSize: 12,
color: HexColor.fromHex(
model?.share_earn_val_color ?? 'FFFFFF')),
children: [
TextSpan(
text: model?.share_value ?? '0.0',
style: TextStyle(
fontSize: 15,
color: HexColor.fromHex(
model?.share_earn_color ?? '#FFFFFF'),
fontFamily: 'Din',
package: 'zhiying_base_widget')),
]),
),
Text(
model?.share_earn ?? '分享赚',
style: TextStyle(
color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'),
fontSize: 12),
),
Text(model?.share_earn ?? '分享赚', style: TextStyle(color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), fontSize: 15))
],
),
),
@@ -158,25 +200,45 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
onTap: () => _savemoneyOnClick(),
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5),
// padding: const EdgeInsets.only(left: 30, right: 30, top: 5, bottom: 5),
height: 44,
width: 110,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [HexColor.fromHex(model?.save_earn_bg1_color ?? '#FF6969'), HexColor.fromHex(model?.save_earn_bg2_color ?? '#FF4646')], begin: Alignment.centerLeft, end: Alignment.centerRight),
borderRadius: BorderRadius.only(bottomRight: Radius.circular(25), topRight: Radius.circular(25))),
gradient: LinearGradient(colors: [
HexColor.fromHex(model?.save_earn_bg1_color ?? '#FF6969'),
HexColor.fromHex(model?.save_earn_bg2_color ?? '#FF4646')
], begin: Alignment.centerLeft, end: Alignment.centerRight),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(25),
topRight: Radius.circular(25))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RichText(
text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.save_earn_val_color ?? 'FFFFFF')), children: [
TextSpan(
text: model?.slef_buy_value ??'0.0',
style: TextStyle(
fontSize: 15,
color: HexColor.fromHex(model?.save_earn_val_color ?? '#FFFFFF'),
fontFamily: 'Din',
package: 'zhiying_base_widget',
)),
]),
text: TextSpan(
text: '¥ ',
style: TextStyle(
fontSize: 12,
color: HexColor.fromHex(
model?.save_earn_val_color ?? 'FFFFFF')),
children: [
TextSpan(
text: model?.slef_buy_value ?? '0.0',
style: TextStyle(
fontSize: 15,
color: HexColor.fromHex(
model?.save_earn_val_color ?? '#FFFFFF'),
fontFamily: 'Din',
package: 'zhiying_base_widget',
)),
]),
),
Text(model?.save_earn ?? '自购省', style: TextStyle(color: HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'), fontSize: 15))
Text(model?.save_earn ?? '自购省',
style: TextStyle(
color:
HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'),
fontSize: 12))
],
),
),
@@ -197,8 +259,10 @@ class _GooddsDetailsFooterContainerState extends State<GooddsDetailsFooterContai
),
// Container( width: 25, margin: const EdgeInsets.only(bottom: 3), child: CachedNetworkImage(imageUrl: icon, fit: BoxFit.fill, width: 25,),),
const SizedBox(height: 3),

/// 图片
Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11))
Text(text,
style: TextStyle(color: HexColor.fromHex(textColor), fontSize: 11))
],
);
}


+ 3
- 0
lib/widgets/home/home_goods/models/home_goods_style_model.dart Näytä tiedosto

@@ -5,6 +5,9 @@ part 'home_goods_style_model.g.dart';

@JsonSerializable()
class HomeGoodsStyleModel extends Object {
@JsonKey(name: 'list_column')
String column;

@JsonKey(name: 'recommend_list')
List<HomeGoodsHeaderModel> recommendList;



+ 2
- 1
lib/widgets/home/home_goods/models/home_goods_style_model.g.dart Näytä tiedosto

@@ -23,12 +23,13 @@ HomeGoodsStyleModel _$HomeGoodsStyleModelFromJson(Map<String, dynamic> json) {
json['commission_bg_color'] as String,
json['market_price_color'] as String,
json['current_price_color'] as String,
);
)..column = json['list_column'] as String;
}

Map<String, dynamic> _$HomeGoodsStyleModelToJson(
HomeGoodsStyleModel instance) =>
<String, dynamic>{
'list_column': instance.column,
'recommend_list': instance.recommendList,
'provider_name_color': instance.providerNameColor,
'provider_name_background_color': instance.providerNameBackgroundColor,


Ladataan…
Peruuta
Tallenna