瀏覽代碼

更新基础库网络请求错误问题

更新淘宝图片加载异常处理
tags/0.0.1
Weller 4 年之前
父節點
當前提交
47c11d999f
共有 69 個文件被更改,包括 180 次插入85 次删除
  1. +54
    -18
      example/ios/Runner.xcodeproj/project.pbxproj
  2. 二進制
     
  3. 二進制
     
  4. 二進制
     
  5. 二進制
     
  6. 二進制
     
  7. 二進制
     
  8. 二進制
     
  9. 二進制
     
  10. 二進制
     
  11. 二進制
     
  12. 二進制
     
  13. 二進制
     
  14. 二進制
     
  15. 二進制
     
  16. 二進制
     
  17. +0
    -23
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  18. 二進制
     
  19. 二進制
     
  20. 二進制
     
  21. +0
    -5
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  22. +8
    -8
      example/ios/Runner/Info.plist
  23. 二進制
     
  24. 二進制
     
  25. 二進制
     
  26. 二進制
     
  27. 二進制
     
  28. 二進制
     
  29. 二進制
     
  30. 二進制
     
  31. 二進制
     
  32. +0
    -1
      example/ios/Runner/JDSDK.bundle/safe.jpg
  33. 二進制
     
  34. 二進制
     
  35. 二進制
     
  36. 二進制
     
  37. 二進制
     
  38. 二進制
     
  39. 二進制
     
  40. 二進制
     
  41. +20
    -20
      example/ios/Runner/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json
  42. 二進制
     
  43. 二進制
     
  44. 二進制
     
  45. 二進制
     
  46. 二進制
     
  47. 二進制
     
  48. 二進制
     
  49. 二進制
     
  50. 二進制
     
  51. 二進制
     
  52. 二進制
     
  53. 二進制
     
  54. 二進制
     
  55. 二進制
     
  56. 二進制
     
  57. 二進制
     
  58. 二進制
     
  59. 二進制
     
  60. +6
    -0
      example/ios/Runner/智莺生活/image/智莺生活.xcassets/Contents.json
  61. 二進制
     
  62. 二進制
     
  63. 二進制
     
  64. 二進制
     
  65. 二進制
     
  66. +71
    -0
      example/ios/Runner/智莺生活/image/智莺生活.xcassets/LaunchImage.launchimage/Contents.json
  67. +1
    -1
      example/lib/taobao_image_viewer.dart
  68. +1
    -1
      lib/util/api.dart
  69. +19
    -8
      lib/util/taobao/taobao_loader.dart

+ 54
- 18
example/ios/Runner.xcodeproj/project.pbxproj 查看文件

@@ -17,10 +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 */; };
9F8951A62514ED8900DF5620 /* yw_1222_baichuan.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9F8951A42514ED8900DF5620 /* yw_1222_baichuan.jpg */; };
9F8951A72514ED8900DF5620 /* JDSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9F8951A52514ED8900DF5620 /* JDSDK.bundle */; };
9F7F175025189FC700E91CD7 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F174825189FC600E91CD7 /* 1.png */; };
9F7F175125189FC700E91CD7 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F174925189FC600E91CD7 /* 2.png */; };
9F7F175225189FC700E91CD7 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F174A25189FC600E91CD7 /* 3.png */; };
9F7F175325189FC700E91CD7 /* 4.png in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F174B25189FC600E91CD7 /* 4.png */; };
9F7F175425189FC700E91CD7 /* 智莺生活.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F174C25189FC600E91CD7 /* 智莺生活.xcassets */; };
9F7F17562518AF2000E91CD7 /* yw_1222_baichuan.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9F7F17552518AF2000E91CD7 /* yw_1222_baichuan.jpg */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
@@ -55,11 +58,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>"; };
9F8951A42514ED8900DF5620 /* yw_1222_baichuan.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yw_1222_baichuan.jpg; sourceTree = "<group>"; };
9F8951A52514ED8900DF5620 /* JDSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = JDSDK.bundle; sourceTree = "<group>"; };
9F7F174825189FC600E91CD7 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = "<group>"; };
9F7F174925189FC600E91CD7 /* 2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 2.png; sourceTree = "<group>"; };
9F7F174A25189FC600E91CD7 /* 3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 3.png; sourceTree = "<group>"; };
9F7F174B25189FC600E91CD7 /* 4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 4.png; sourceTree = "<group>"; };
9F7F174C25189FC600E91CD7 /* 智莺生活.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "智莺生活.xcassets"; sourceTree = "<group>"; };
9F7F17552518AF2000E91CD7 /* yw_1222_baichuan.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yw_1222_baichuan.jpg; sourceTree = "<group>"; };
F1628CBC8D15F3FA852FDD72 /* 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 */

@@ -122,12 +128,10 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
9F8951A52514ED8900DF5620 /* JDSDK.bundle */,
9F8951A42514ED8900DF5620 /* yw_1222_baichuan.jpg */,
9F7F174125189FC600E91CD7 /* 智莺生活 */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
@@ -145,6 +149,35 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9F7F174125189FC600E91CD7 /* 智莺生活 */ = {
isa = PBXGroup;
children = (
9F7F174225189FC600E91CD7 /* config */,
9F7F174725189FC600E91CD7 /* image */,
);
path = "智莺生活";
sourceTree = "<group>";
};
9F7F174225189FC600E91CD7 /* config */ = {
isa = PBXGroup;
children = (
9F7F17552518AF2000E91CD7 /* yw_1222_baichuan.jpg */,
);
path = config;
sourceTree = "<group>";
};
9F7F174725189FC600E91CD7 /* image */ = {
isa = PBXGroup;
children = (
9F7F174825189FC600E91CD7 /* 1.png */,
9F7F174925189FC600E91CD7 /* 2.png */,
9F7F174A25189FC600E91CD7 /* 3.png */,
9F7F174B25189FC600E91CD7 /* 4.png */,
9F7F174C25189FC600E91CD7 /* 智莺生活.xcassets */,
);
path = image;
sourceTree = "<group>";
};
C515045CAD881A02B77DBC01 /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -218,11 +251,14 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F8951A72514ED8900DF5620 /* JDSDK.bundle in Resources */,
9F7F175325189FC700E91CD7 /* 4.png in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
9F7F175025189FC700E91CD7 /* 1.png in Resources */,
9F7F17562518AF2000E91CD7 /* yw_1222_baichuan.jpg in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
9F8951A62514ED8900DF5620 /* yw_1222_baichuan.jpg in Resources */,
9F7F175225189FC700E91CD7 /* 3.png in Resources */,
9F7F175425189FC700E91CD7 /* 智莺生活.xcassets in Resources */,
9F7F175125189FC700E91CD7 /* 2.png in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -415,9 +451,9 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.fnuo123.newhairuyi;
PRODUCT_BUNDLE_IDENTIFIER = cn.zhios.zhiying;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "com.fnuo123.newhairuyi Development";
PROVISIONING_PROFILE_SPECIFIER = cn.zhios.zhiying_dev;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
@@ -548,9 +584,9 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.fnuo123.newhairuyi;
PRODUCT_BUNDLE_IDENTIFIER = cn.zhios.zhiying;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "com.fnuo123.newhairuyi Development";
PROVISIONING_PROFILE_SPECIFIER = cn.zhios.zhiying_dev;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@@ -574,9 +610,9 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.fnuo123.newhairuyi;
PRODUCT_BUNDLE_IDENTIFIER = cn.zhios.zhiying;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "com.fnuo123.newhairuyi Development";
PROVISIONING_PROFILE_SPECIFIER = cn.zhios.zhiying_dev;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 0
- 23
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json 查看文件

@@ -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 查看文件

@@ -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.

+ 8
- 8
example/ios/Runner/Info.plist 查看文件

@@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>zhiying_comm_example</string>
<string>智莺生活</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
@@ -27,7 +27,7 @@
<string>WBkey</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wb2180230632</string>
<string>wb</string>
</array>
</dict>
<dict>
@@ -37,7 +37,7 @@
<string>QQ10JZ</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tencent1105605716</string>
<string>tencent1111030588</string>
</array>
</dict>
<dict>
@@ -47,7 +47,7 @@
<string>WBSecret</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sina.15b5959a00eb2b91d1654f357d8a798b</string>
<string>sina.</string>
</array>
</dict>
<dict>
@@ -57,7 +57,7 @@
<string>QQ16JZ</string>
<key>CFBundleURLSchemes</key>
<array>
<string>QQ41e63454</string>
<string>QQ4238fb3c</string>
</array>
</dict>
<dict>
@@ -67,7 +67,7 @@
<string>tb</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tbopen23430346</string>
<string>tbopen31333495</string>
</array>
</dict>
<dict>
@@ -77,7 +77,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx7f995405e40245d7</string>
<string>wx</string>
</array>
</dict>
<dict>
@@ -95,7 +95,7 @@
<string>JD</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sdkback9fc3dec00b9b40cc950dfba5262cd6d3</string>
<string>sdkback</string>
</array>
</dict>
<dict>


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 0
- 1
example/ios/Runner/JDSDK.bundle/safe.jpg 查看文件

@@ -1 +0,0 @@
5nu<;+FJp.

二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json → example/ios/Runner/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json 查看文件

@@ -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 查看文件

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

二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 71
- 0
example/ios/Runner/智莺生活/image/智莺生活.xcassets/LaunchImage.launchimage/Contents.json 查看文件

@@ -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"
}
}

+ 1
- 1
example/lib/taobao_image_viewer.dart 查看文件

@@ -12,7 +12,7 @@ class _TaobaoImageViewState extends State<TaobaoImageView> {

@override
void initState() {
TaobaoLoader.loadImages('592787622422').then((images) {
TaobaoLoader.loadImages('553848677009').then((images) {
_images = images;
setState(() {});
});


+ 1
- 1
lib/util/api.dart 查看文件

@@ -65,7 +65,7 @@ class Api {
_formatError(e);
}

return result;
return result[GlobalConfig.HTTP_RESPONSE_KEY_DATA];
}

// 获取headers,headers保存各种签名认证信息


+ 19
- 8
lib/util/taobao/taobao_loader.dart 查看文件

@@ -1,4 +1,5 @@
import 'package:dio/dio.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class TaobaoLoader {
static Future<List<String>> loadImages(String id) async {
@@ -8,18 +9,28 @@ class TaobaoLoader {
Response response = await dio.get(url);
// Logger.debug(response.data.toString());
Map<String, dynamic> json = Map<String, dynamic>.from(response.data);
List list = json['data']['wdescContent']['pages'];
List<String> images = List();
for (var item in list) {
RegExp exp = new RegExp("(?<=<img(.*?)>)(.*?)(?=</img>)");
String image = exp.stringMatch(item.toString());
if (image.startsWith('//')) {
images.add('http:' + image);
} else if (image.startsWith('https://') || image.startsWith('http://')) {
images.add(image);
try {
Map<String, dynamic> data = json['data'];
List list = json['data']['wdescContent']['pages'];
for (var item in list) {
Logger.debug(item);
RegExp exp = new RegExp("(?<=<img(.*?)>)(.*?)(?=</img>)");
String image = exp.stringMatch(item.toString());
if (image != null && image != '') {
if (image.startsWith('//')) {
images.add('http:' + image);
} else
if (image.startsWith('https://') || image.startsWith('http://')) {
images.add(image);
}
}
}
} catch (err) {
Logger.error(err);
}


return images;
}
}

Loading…
取消
儲存