소스 검색

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

更新淘宝图片加载异常处理
tags/0.0.1
Weller 4 년 전
부모
커밋
47c11d999f
69개의 변경된 파일180개의 추가작업 그리고 85개의 파일을 삭제
  1. +54
    -18
      example/ios/Runner.xcodeproj/project.pbxproj
  2. BIN
     
  3. BIN
     
  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. +0
    -23
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. +0
    -5
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  22. +8
    -8
      example/ios/Runner/Info.plist
  23. BIN
     
  24. BIN
     
  25. BIN
     
  26. BIN
     
  27. BIN
     
  28. BIN
     
  29. BIN
     
  30. BIN
     
  31. BIN
     
  32. +0
    -1
      example/ios/Runner/JDSDK.bundle/safe.jpg
  33. BIN
     
  34. BIN
     
  35. BIN
     
  36. BIN
     
  37. BIN
     
  38. BIN
     
  39. BIN
     
  40. BIN
     
  41. +20
    -20
      example/ios/Runner/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json
  42. BIN
     
  43. BIN
     
  44. BIN
     
  45. BIN
     
  46. BIN
     
  47. BIN
     
  48. BIN
     
  49. BIN
     
  50. BIN
     
  51. BIN
     
  52. BIN
     
  53. BIN
     
  54. BIN
     
  55. BIN
     
  56. BIN
     
  57. BIN
     
  58. BIN
     
  59. BIN
     
  60. +6
    -0
      example/ios/Runner/智莺生活/image/智莺生活.xcassets/Contents.json
  61. BIN
     
  62. BIN
     
  63. BIN
     
  64. BIN
     
  65. BIN
     
  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;
}
}

불러오는 중...
취소
저장